diff --git a/ng16/patch/module.ts b/ng16/patch/module.ts index 244b06f..348a59c 100644 --- a/ng16/patch/module.ts +++ b/ng16/patch/module.ts @@ -7,6 +7,7 @@ import { SocketComponent } from './presets/classic/components/socket/socket.comp import { ConnectionWrapperComponent } from './presets/classic/components/connection/connection-wrapper.component'; import { ControlComponent } from './presets/classic/components/control/control.component'; import { RefDirective } from './ref'; +import { ImpureKeyvaluePipe } from './shared/pipes/impure-keyvalue.pipe'; @NgModule({ declarations: [ @@ -15,7 +16,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ], imports: [ CommonModule @@ -26,7 +28,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ] }) export class ReteModule { } diff --git a/ng17/patch/module.ts b/ng17/patch/module.ts index 244b06f..348a59c 100644 --- a/ng17/patch/module.ts +++ b/ng17/patch/module.ts @@ -7,6 +7,7 @@ import { SocketComponent } from './presets/classic/components/socket/socket.comp import { ConnectionWrapperComponent } from './presets/classic/components/connection/connection-wrapper.component'; import { ControlComponent } from './presets/classic/components/control/control.component'; import { RefDirective } from './ref'; +import { ImpureKeyvaluePipe } from './shared/pipes/impure-keyvalue.pipe'; @NgModule({ declarations: [ @@ -15,7 +16,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ], imports: [ CommonModule @@ -26,7 +28,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ] }) export class ReteModule { } diff --git a/ng18/patch/module.ts b/ng18/patch/module.ts index 244b06f..348a59c 100644 --- a/ng18/patch/module.ts +++ b/ng18/patch/module.ts @@ -7,6 +7,7 @@ import { SocketComponent } from './presets/classic/components/socket/socket.comp import { ConnectionWrapperComponent } from './presets/classic/components/connection/connection-wrapper.component'; import { ControlComponent } from './presets/classic/components/control/control.component'; import { RefDirective } from './ref'; +import { ImpureKeyvaluePipe } from './shared/pipes/impure-keyvalue.pipe'; @NgModule({ declarations: [ @@ -15,7 +16,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ], imports: [ CommonModule @@ -26,7 +28,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ] }) export class ReteModule { } diff --git a/ng19/patch/presets/classic/components/node/.node.component.ts b/ng19/patch/presets/classic/components/node/.node.component.ts index 1715f45..cb05f3c 100644 --- a/ng19/patch/presets/classic/components/node/.node.component.ts +++ b/ng19/patch/presets/classic/components/node/.node.component.ts @@ -1,5 +1,6 @@ // [imports] import { CommonModule } from '@angular/common'; import { RefDirective } from '../../../../ref'; +import { ImpureKeyvaluePipe } from '../../../../shared/pipes/impure-keyvalue.pipe'; // [component-directive] -imports: [CommonModule, RefDirective], \ No newline at end of file +imports: [CommonModule, RefDirective, ImpureKeyvaluePipe], \ No newline at end of file diff --git a/ng20/patch/presets/classic/components/node/.node.component.ts b/ng20/patch/presets/classic/components/node/.node.component.ts index 1715f45..cb05f3c 100644 --- a/ng20/patch/presets/classic/components/node/.node.component.ts +++ b/ng20/patch/presets/classic/components/node/.node.component.ts @@ -1,5 +1,6 @@ // [imports] import { CommonModule } from '@angular/common'; import { RefDirective } from '../../../../ref'; +import { ImpureKeyvaluePipe } from '../../../../shared/pipes/impure-keyvalue.pipe'; // [component-directive] -imports: [CommonModule, RefDirective], \ No newline at end of file +imports: [CommonModule, RefDirective, ImpureKeyvaluePipe], \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index a6a3533..3b7a0b7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,5 +10,6 @@ export * from './presets/classic/components' export * from './presets/context-menu/components' export * from './presets/minimap/components' export * from './presets/reroute/components' +export * from './shared/pipes' export * from './ref' export * from './core' diff --git a/src/module.ts b/src/module.ts index 3e1b0bc..57c4020 100644 --- a/src/module.ts +++ b/src/module.ts @@ -7,6 +7,7 @@ import { SocketComponent } from './presets/classic/components/socket/socket.comp import { ConnectionWrapperComponent } from './presets/classic/components/connection/connection-wrapper.component'; import { ControlComponent } from './presets/classic/components/control/control.component'; import { RefDirective } from './ref'; +import { ImpureKeyvaluePipe } from './shared/pipes/impure-keyvalue.pipe'; @NgModule({ declarations: [ @@ -15,7 +16,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ], imports: [ CommonModule @@ -26,7 +28,8 @@ import { RefDirective } from './ref'; ConnectionComponent, ConnectionWrapperComponent, SocketComponent, - ControlComponent + ControlComponent, + ImpureKeyvaluePipe ], entryComponents: [ NodeComponent, diff --git a/src/presets/classic/components/node/node.component.html b/src/presets/classic/components/node/node.component.html index 071c423..b78482f 100644 --- a/src/presets/classic/components/node/node.component.html +++ b/src/presets/classic/components/node/node.component.html @@ -1,5 +1,5 @@
{{data.label}}
-
+
{{output.value?.label}}
-
+
number): Array<{key: string, value: any}> { + if (!value || typeof value !== 'object') { + return []; + } + + const result = Object.entries(value).map(([key, val]) => ({key, value: val})); + + if (compareFn) { + result.sort(compareFn); + } + + return result; + } +} diff --git a/src/shared/pipes/index.ts b/src/shared/pipes/index.ts new file mode 100644 index 0000000..2b3f6fc --- /dev/null +++ b/src/shared/pipes/index.ts @@ -0,0 +1 @@ +export { ImpureKeyvaluePipe } from './impure-keyvalue.pipe';