@anglr/dynamic 1.0.0-beta.20220919063341 → 1.0.0-beta.20220919074100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015/layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.js +2 -2
- package/es2015/layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.js.map +1 -1
- package/es2015/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.js +3 -2
- package/es2015/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.js.map +1 -1
- package/es2015/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.js +2 -2
- package/es2015/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.js.map +1 -1
- package/es2015/relations-editor/src/components/nodesPalette/nodesPalette.component.js +2 -2
- package/es2015/relations-editor/src/components/nodesPalette/nodesPalette.component.js.map +1 -1
- package/es2015/relations-editor/src/components/relationsCanvas/relationsCanvas.component.js +2 -2
- package/es2015/relations-editor/src/components/relationsCanvas/relationsCanvas.component.js.map +1 -1
- package/es2015/relations-editor/src/components/relationsEditor/relationsEditor.component.js.map +1 -1
- package/es2015/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.js +9 -3
- package/es2015/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.js.map +1 -1
- package/es2015/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.js +9 -3
- package/es2015/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.js.map +1 -1
- package/es2020/layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.js +2 -2
- package/es2020/layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.js.map +1 -1
- package/es2020/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.js +3 -2
- package/es2020/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.js.map +1 -1
- package/es2020/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.js +2 -2
- package/es2020/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.js.map +1 -1
- package/es2020/relations-editor/src/components/nodesPalette/nodesPalette.component.js +2 -2
- package/es2020/relations-editor/src/components/nodesPalette/nodesPalette.component.js.map +1 -1
- package/es2020/relations-editor/src/components/relationsCanvas/relationsCanvas.component.js +2 -2
- package/es2020/relations-editor/src/components/relationsCanvas/relationsCanvas.component.js.map +1 -1
- package/es2020/relations-editor/src/components/relationsEditor/relationsEditor.component.js.map +1 -1
- package/es2020/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.js +9 -3
- package/es2020/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.js.map +1 -1
- package/es2020/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.js +9 -3
- package/es2020/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.js.map +1 -1
- package/layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.html +1 -1
- package/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.d.ts.map +1 -1
- package/relations-editor/src/components/nodesPalette/nodesPalette.component.d.ts.map +1 -1
- package/relations-editor/src/components/relationsCanvas/relationsCanvas.component.d.ts.map +1 -1
- package/relations-editor/src/components/relationsEditor/relationsEditor.component.d.ts.map +1 -1
- package/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.d.ts.map +1 -1
- package/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.d.ts.map +1 -1
- package/styles/components/_nodes-palette-item.scss +19 -0
- package/styles/components/_nodes-palette.scss +40 -0
- package/styles/components/_relation-node-input.scss +9 -0
- package/styles/components/_relation-node-output.scss +9 -0
- package/styles/components/_relations-canvas.scss +19 -0
- package/styles/core/_misc.scss +23 -0
- package/styles/core/_mixins.scss +15 -0
- package/styles/core/_theme.scss +20 -2
- package/version.bak +1 -1
- package/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.css +0 -4
- package/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.css +0 -16
- package/relations-editor/src/components/nodesPalette/nodesPalette.component.css +0 -37
- package/relations-editor/src/components/relationsCanvas/relationsCanvas.component.css +0 -21
- package/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.css +0 -16
- package/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.css +0 -16
|
@@ -6,10 +6,10 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
export class LayoutEditorDragPreviewSAComponent {
|
|
7
7
|
}
|
|
8
8
|
LayoutEditorDragPreviewSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutEditorDragPreviewSAComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9
|
-
LayoutEditorDragPreviewSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutEditorDragPreviewSAComponent, isStandalone: true, selector: "layout-editor-drag-preview", inputs: { layoutMetadata: "layoutMetadata" }, ngImport: i0, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9
|
+
LayoutEditorDragPreviewSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutEditorDragPreviewSAComponent, isStandalone: true, selector: "layout-editor-drag-preview", inputs: { layoutMetadata: "layoutMetadata" }, ngImport: i0, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small dynamic-small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10
10
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutEditorDragPreviewSAComponent, decorators: [{
|
|
11
11
|
type: Component,
|
|
12
|
-
args: [{ selector: 'layout-editor-drag-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>" }]
|
|
12
|
+
args: [{ selector: 'layout-editor-drag-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small dynamic-small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>" }]
|
|
13
13
|
}], propDecorators: { layoutMetadata: [{
|
|
14
14
|
type: Input
|
|
15
15
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layoutEditorDragPreview.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.ts","../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;;AAGxE;;GAEG;AAQH,MAAM,OAAO,kCAAkC;;+HAAlC,kCAAkC;mHAAlC,kCAAkC,oICb/C,
|
|
1
|
+
{"version":3,"file":"layoutEditorDragPreview.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.ts","../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;;AAGxE;;GAEG;AAQH,MAAM,OAAO,kCAAkC;;+HAAlC,kCAAkC;mHAAlC,kCAAkC,oICb/C,mMAA6L;2FDahL,kCAAkC;kBAP9C,SAAS;+BAEI,4BAA4B,cAE1B,IAAI,mBACC,uBAAuB,CAAC,MAAM;8BAUxC,cAAc;sBADpB,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input} from '@angular/core';\nimport {LayoutComponentMetadata} from '@anglr/dynamic/layout';\n\n/**\n * Component used for displaying layout editor drag preview\n */\n@Component(\n{\n selector: 'layout-editor-drag-preview',\n templateUrl: 'layoutEditorDragPreview.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LayoutEditorDragPreviewSAComponent\n{\n //######################### public properties - inputs #########################\n\n /**\n * Layout metadata for dragged component\n */\n @Input()\n public layoutMetadata?: LayoutComponentMetadata|null;\n}","<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small dynamic-small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>"]}
|
package/es2015/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.js
CHANGED
|
@@ -4,6 +4,7 @@ import { MatExpansionModule } from '@angular/material/expansion';
|
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { LayoutComponentBase, LayoutComponentRendererSADirective } from '@anglr/dynamic/layout';
|
|
6
6
|
import { LayoutEditorMetadata } from '@anglr/dynamic/layout-editor';
|
|
7
|
+
import { HostDisplayBlockStyle } from '@anglr/common';
|
|
7
8
|
import { MaterialExpansionPanelLayoutMetadataLoader } from './expansionPanel.metadata';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
import * as i1 from "@angular/common";
|
|
@@ -32,7 +33,7 @@ let MaterialExpansionPanelSAComponent = class MaterialExpansionPanelSAComponent
|
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
MaterialExpansionPanelSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MaterialExpansionPanelSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
-
MaterialExpansionPanelSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MaterialExpansionPanelSAComponent, isStandalone: true, selector: "material-expansion-panel", inputs: { expanded: "expanded", title: "title", description: "description" }, usesInheritance: true, ngImport: i0, template: "<mat-expansion-panel [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{title}}</mat-panel-title>\n <mat-panel-description>{{description}}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-container *ngFor=\"let type of options?.children\">\n <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n </ng-container>\n</mat-expansion-panel>", styles: [":host
|
|
36
|
+
MaterialExpansionPanelSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MaterialExpansionPanelSAComponent, isStandalone: true, selector: "material-expansion-panel", inputs: { expanded: "expanded", title: "title", description: "description" }, usesInheritance: true, ngImport: i0, template: "<mat-expansion-panel [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{title}}</mat-panel-title>\n <mat-panel-description>{{description}}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-container *ngFor=\"let type of options?.children\">\n <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n </ng-container>\n</mat-expansion-panel>", styles: [":host{display: block;}"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i2.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
36
37
|
MaterialExpansionPanelSAComponent = __decorate([
|
|
37
38
|
LayoutEditorMetadata(MaterialExpansionPanelLayoutMetadataLoader)
|
|
38
39
|
], MaterialExpansionPanelSAComponent);
|
|
@@ -43,7 +44,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
43
44
|
CommonModule,
|
|
44
45
|
MatExpansionModule,
|
|
45
46
|
LayoutComponentRendererSADirective,
|
|
46
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-expansion-panel [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{title}}</mat-panel-title>\n <mat-panel-description>{{description}}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-container *ngFor=\"let type of options?.children\">\n <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n </ng-container>\n</mat-expansion-panel>", styles: [":host
|
|
47
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-expansion-panel [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{title}}</mat-panel-title>\n <mat-panel-description>{{description}}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-container *ngFor=\"let type of options?.children\">\n <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n </ng-container>\n</mat-expansion-panel>", styles: [":host{display: block;}"] }]
|
|
47
48
|
}], propDecorators: { expanded: [{
|
|
48
49
|
type: Input
|
|
49
50
|
}], title: [{
|
package/es2015/material-components/src/dynamicItems/expansionPanel/expansionPanel.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expansionPanel.component.js","sourceRoot":"","sources":["../../../../../material-components/src/dynamicItems/expansionPanel/expansionPanel.component.ts","../../../../../material-components/src/dynamicItems/expansionPanel/expansionPanel.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACxE,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAkB,mBAAmB,EAAE,kCAAkC,EAAC,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"expansionPanel.component.js","sourceRoot":"","sources":["../../../../../material-components/src/dynamicItems/expansionPanel/expansionPanel.component.ts","../../../../../material-components/src/dynamicItems/expansionPanel/expansionPanel.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACxE,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAkB,mBAAmB,EAAE,kCAAkC,EAAC,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAC,0CAA0C,EAAC,MAAM,2BAA2B,CAAC;;;;AAErF;;GAEG;IAgBU,iCAAiC,SAAjC,iCAAkC,SAAQ,mBAA2D;;;QAE9G,gFAAgF;QAEhF;;WAEG;QAEI,aAAQ,GAAY,IAAI,CAAC;KAyBnC;IAXG,2EAA2E;IAE3E;;OAEG;IACgB,YAAY;;QAE3B,IAAI,CAAC,QAAQ,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,QAAQ,mCAAI,KAAK,CAAC;QAChD,IAAI,CAAC,KAAK,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,KAAK,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,WAAW,CAAC;IACjD,CAAC;CACJ,CAAA;8HAjCY,iCAAiC;kHAAjC,iCAAiC,yLC5B9C,saASsB,+EDYd,YAAY,2JACZ,kBAAkB,ynBAClB,kCAAkC;AAK7B,iCAAiC;IAD7C,oBAAoB,CAAC,0CAA0C,CAAC;GACpD,iCAAiC,CAiC7C;SAjCY,iCAAiC;2FAAjC,iCAAiC;kBAf7C,SAAS;+BAEI,0BAA0B,cAGxB,IAAI,WAEhB;wBACI,YAAY;wBACZ,kBAAkB;wBAClB,kCAAkC;qBACrC,mBACgB,uBAAuB,CAAC,MAAM;8BAWxC,QAAQ;sBADd,KAAK;gBAOC,KAAK;sBADX,KAAK;gBAOC,WAAW;sBADjB,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input} from '@angular/core';\nimport {MatExpansionModule} from '@angular/material/expansion';\nimport {CommonModule} from '@angular/common';\nimport {LayoutComponent, LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {LayoutEditorMetadata} from '@anglr/dynamic/layout-editor';\nimport {HostDisplayBlockStyle} from '@anglr/common';\n\nimport {MaterialExpansionPanelComponentOptions} from './expansionPanel.options';\nimport {MaterialExpansionPanelLayoutMetadataLoader} from './expansionPanel.metadata';\n\n/**\n * Component used for displaying toggle panel layout\n */\n@Component(\n{\n selector: 'material-expansion-panel',\n templateUrl: 'expansionPanel.component.html',\n styles: [HostDisplayBlockStyle],\n standalone: true,\n imports:\n [\n CommonModule,\n MatExpansionModule,\n LayoutComponentRendererSADirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\n@LayoutEditorMetadata(MaterialExpansionPanelLayoutMetadataLoader)\nexport class MaterialExpansionPanelSAComponent extends LayoutComponentBase<MaterialExpansionPanelComponentOptions> implements LayoutComponent<MaterialExpansionPanelComponentOptions>\n{\n //######################### public properties - inputs #########################\n\n /**\n * Indication whether panel is expanded\n */\n @Input()\n public expanded: boolean = true;\n\n /**\n * Expansion panel title\n */\n @Input()\n public title: string|null|undefined;\n\n /**\n * Expansion panel description\n */\n @Input()\n public description: string|null|undefined;\n\n //######################### protected - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onOptionsSet(): void\n {\n this.expanded = this.options?.expanded ?? false;\n this.title = this.options?.title;\n this.description = this.options?.description;\n }\n}","<mat-expansion-panel [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{title}}</mat-panel-title>\n <mat-panel-description>{{description}}</mat-panel-description>\n </mat-expansion-panel-header>\n\n <ng-container *ngFor=\"let type of options?.children\">\n <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n </ng-container>\n</mat-expansion-panel>"]}
|
package/es2015/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.js
CHANGED
|
@@ -94,12 +94,12 @@ export class NodesPaletteItemSAComponent {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
NodesPaletteItemSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: NodesPaletteItemSAComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.PackageManager }, { token: i2.RelationsNodeManager }, { token: i3.CdkDrag, optional: true }, { token: LOGGER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
97
|
-
NodesPaletteItemSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: NodesPaletteItemSAComponent, isStandalone: true, selector: "nodes-palette-item", inputs: { data: "data" }, host: { listeners: { "dblclick": "focusNode()" }, properties: { "class.used": "this.used" } }, ngImport: i0, template: "<div class=\"editor-component-name\">{{data.metadata.singleton ? (data.metadata.displayName || data.itemSource.name) : (data.metadata.metaInfo?.name ?? data.itemSource.name)}}</div>\n<div class=\"editor-component-description\" *ngIf=\"data.metadata.metaInfo?.description\">{{data.metadata.metaInfo?.description}}</div>",
|
|
97
|
+
NodesPaletteItemSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: NodesPaletteItemSAComponent, isStandalone: true, selector: "nodes-palette-item", inputs: { data: "data" }, host: { listeners: { "dblclick": "focusNode()" }, properties: { "class.used": "this.used" } }, ngImport: i0, template: "<div class=\"editor-component-name\">{{data.metadata.singleton ? (data.metadata.displayName || data.itemSource.name) : (data.metadata.metaInfo?.name ?? data.itemSource.name)}}</div>\n<div class=\"editor-component-description\" *ngIf=\"data.metadata.metaInfo?.description\">{{data.metadata.metaInfo?.description}}</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
98
98
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: NodesPaletteItemSAComponent, decorators: [{
|
|
99
99
|
type: Component,
|
|
100
100
|
args: [{ selector: 'nodes-palette-item', standalone: true, imports: [
|
|
101
101
|
CommonModule,
|
|
102
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"editor-component-name\">{{data.metadata.singleton ? (data.metadata.displayName || data.itemSource.name) : (data.metadata.metaInfo?.name ?? data.itemSource.name)}}</div>\n<div class=\"editor-component-description\" *ngIf=\"data.metadata.metaInfo?.description\">{{data.metadata.metaInfo?.description}}</div>"
|
|
102
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"editor-component-name\">{{data.metadata.singleton ? (data.metadata.displayName || data.itemSource.name) : (data.metadata.metaInfo?.name ?? data.itemSource.name)}}</div>\n<div class=\"editor-component-description\" *ngIf=\"data.metadata.metaInfo?.description\">{{data.metadata.metaInfo?.description}}</div>" }]
|
|
103
103
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.PackageManager }, { type: i2.RelationsNodeManager }, { type: i3.CdkDrag, decorators: [{
|
|
104
104
|
type: Optional
|
|
105
105
|
}] }, { type: undefined, decorators: [{
|
package/es2015/relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodesPaletteItem.component.js","sourceRoot":"","sources":["../../../../../../relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.ts","../../../../../../relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAU,MAAM,EAAE,QAAQ,EAAa,KAAK,EAAE,WAAW,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3J,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAS,MAAM,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;;;;;;AAGvD;;GAEG;
|
|
1
|
+
{"version":3,"file":"nodesPaletteItem.component.js","sourceRoot":"","sources":["../../../../../../relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.ts","../../../../../../relations-editor/src/components/nodesPalette/item/nodesPaletteItem.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAU,MAAM,EAAE,QAAQ,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FAIP,2BAA2B;kBAXvC,SAAS;+BAEI,oBAAoB,cAElB,IAAI,WAEhB;wBACI,YAAY;qBACf,mBACgB,uBAAuB,CAAC,MAAM;;0BA6BlC,QAAQ;;0BACR,MAAM;2BAAC,MAAM;;0BAAG,QAAQ;4CAf3B,IAAI;sBADb,WAAW;uBAAC,YAAY;gBASlB,IAAI;sBADV,KAAK;gBA+EI,SAAS;sBADlB,YAAY;uBAAC,UAAU","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, OnInit, Inject, Optional, OnDestroy, Input, HostBinding, HostListener} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {CdkDrag} from '@angular/cdk/drag-drop';\nimport {PackageManager} from '@anglr/dynamic';\nimport {Logger, LOGGER} from '@anglr/common';\nimport {Subscription} from 'rxjs';\n\nimport {RelationsNodeManager} from '../../../services';\nimport {NodesPaletteItem} from '../nodesPalette.interface';\n\n/**\n * Component displaying nodes palette item\n */\n@Component(\n{\n selector: 'nodes-palette-item',\n templateUrl: 'nodesPaletteItem.component.html',\n standalone: true,\n imports:\n [\n CommonModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NodesPaletteItemSAComponent implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Indication whether node is already used\n */\n @HostBinding('class.used')\n protected used: boolean = false;\n\n //######################### public properties - inputs #########################\n\n /**\n * Nodes palette item\n */\n @Input()\n public data!: NodesPaletteItem;\n\n //######################### constructor #########################\n constructor(protected _changeDetector: ChangeDetectorRef,\n protected packageManager: PackageManager,\n protected _metadataManager: RelationsNodeManager,\n @Optional() protected _cdkDrag: CdkDrag,\n @Inject(LOGGER) @Optional() protected _logger?: Logger,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n for (const nodeId in this._metadataManager.nodes)\n {\n if (this.data?.itemSource?.name === nodeId)\n {\n this._setUsed(true);\n break;\n }\n }\n\n //TODO initsubscription add used change\n this.initSubscriptions.add(this._metadataManager.nodeRegisterChange.subscribe(registeredNode => \n {\n if (registeredNode.id === this.data?.itemSource?.name)\n {\n this._setUsed(true);\n }\n }));\n this.initSubscriptions.add(this._metadataManager.nodeUnregisterChange.subscribe(unregisteredNode => \n {\n if (unregisteredNode.id === this.data?.itemSource?.name)\n {\n this._setUsed(false);\n }\n }));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets used indication for node\n * @param used \n */\n protected _setUsed(used: boolean): void\n {\n this.used = used;\n\n if (this._cdkDrag)\n {\n this._cdkDrag.disabled = used;\n }\n\n this._changeDetector.markForCheck();\n }\n\n /**\n * Focus to relations node\n * @param item \n * @returns \n */\n @HostListener('dblclick')\n protected focusNode(): void\n {\n if (!this.used ||\n !this.data?.metadata?.singleton)\n {\n return;\n }\n\n this._metadataManager.setActiveNode(this.data?.itemSource?.name);\n }\n}","<div class=\"editor-component-name\">{{data.metadata.singleton ? (data.metadata.displayName || data.itemSource.name) : (data.metadata.metaInfo?.name ?? data.itemSource.name)}}</div>\n<div class=\"editor-component-description\" *ngIf=\"data.metadata.metaInfo?.description\">{{data.metadata.metaInfo?.description}}</div>"]}
|
|
@@ -117,7 +117,7 @@ export class NodesPaletteSAComponent {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
NodesPaletteSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: NodesPaletteSAComponent, deps: [{ token: RELATIONS_MODULE_TYPES_LOADER }, { token: RELATIONS_NODES_LOADER }, { token: i0.ChangeDetectorRef }, { token: i1.PackageManager }, { token: i2.RelationsNodeManager }, { token: REFRESH_PALETTE_OBSERVABLES, optional: true }, { token: LOGGER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
120
|
-
NodesPaletteSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: NodesPaletteSAComponent, isStandalone: true, selector: "nodes-palette", inputs: { canvasDropList: "canvasDropList" }, ngImport: i0, template: "<div class=\"dynamic-flex-column\">\n <ng-container *ngFor=\"let groupKeyValue of groupedItems | keyvalue\">\n <div class=\"dynamic-text-spread dynamic-text-small-caps dynamic-margin-left-extra-small dynamic-margin-horizontal-small dynamic-bold\">{{groupKeyValue.key}} </div>\n\n <div *ngFor=\"let item of groupKeyValue.value\"\n cdkDropList\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"canvasDropList\"\n class=\"palette-droplist\">\n <nodes-palette-item [data]=\"item\"\n class=\"editor-component mat-elevation-z2\"\n cdkDrag\n [cdkDragData]=\"item | toRelationsDragData: newCompnentId: item.metadata.singleton: item.metadata.scope\"\n (cdkDragDropped)=\"generateNewId()\"></nodes-palette-item>\n </div>\n </ng-container>\n</div>",
|
|
120
|
+
NodesPaletteSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: NodesPaletteSAComponent, isStandalone: true, selector: "nodes-palette", inputs: { canvasDropList: "canvasDropList" }, ngImport: i0, template: "<div class=\"dynamic-flex-column\">\n <ng-container *ngFor=\"let groupKeyValue of groupedItems | keyvalue\">\n <div class=\"dynamic-text-spread dynamic-text-small-caps dynamic-margin-left-extra-small dynamic-margin-horizontal-small dynamic-bold\">{{groupKeyValue.key}} </div>\n\n <div *ngFor=\"let item of groupKeyValue.value\"\n cdkDropList\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"canvasDropList\"\n class=\"palette-droplist\">\n <nodes-palette-item [data]=\"item\"\n class=\"editor-component mat-elevation-z2\"\n cdkDrag\n [cdkDragData]=\"item | toRelationsDragData: newCompnentId: item.metadata.singleton: item.metadata.scope\"\n (cdkDragDropped)=\"generateNewId()\"></nodes-palette-item>\n </div>\n </ng-container>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i3.KeyValuePipe, name: "keyvalue" }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "pipe", type:
|
|
121
121
|
// LayoutEditorDragPreviewSAComponent,
|
|
122
122
|
// LayoutEditorDragPlaceholderSAComponent,
|
|
123
123
|
ToRelationsDragDataSAPipe, name: "toRelationsDragData" }, { kind: "component", type: NodesPaletteItemSAComponent, selector: "nodes-palette-item", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -137,7 +137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
137
137
|
// LayoutEditorDragPlaceholderSAComponent,
|
|
138
138
|
ToRelationsDragDataSAPipe,
|
|
139
139
|
NodesPaletteItemSAComponent,
|
|
140
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dynamic-flex-column\">\n <ng-container *ngFor=\"let groupKeyValue of groupedItems | keyvalue\">\n <div class=\"dynamic-text-spread dynamic-text-small-caps dynamic-margin-left-extra-small dynamic-margin-horizontal-small dynamic-bold\">{{groupKeyValue.key}} </div>\n\n <div *ngFor=\"let item of groupKeyValue.value\"\n cdkDropList\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"canvasDropList\"\n class=\"palette-droplist\">\n <nodes-palette-item [data]=\"item\"\n class=\"editor-component mat-elevation-z2\"\n cdkDrag\n [cdkDragData]=\"item | toRelationsDragData: newCompnentId: item.metadata.singleton: item.metadata.scope\"\n (cdkDragDropped)=\"generateNewId()\"></nodes-palette-item>\n </div>\n </ng-container>\n</div>"
|
|
140
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dynamic-flex-column\">\n <ng-container *ngFor=\"let groupKeyValue of groupedItems | keyvalue\">\n <div class=\"dynamic-text-spread dynamic-text-small-caps dynamic-margin-left-extra-small dynamic-margin-horizontal-small dynamic-bold\">{{groupKeyValue.key}} </div>\n\n <div *ngFor=\"let item of groupKeyValue.value\"\n cdkDropList\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"canvasDropList\"\n class=\"palette-droplist\">\n <nodes-palette-item [data]=\"item\"\n class=\"editor-component mat-elevation-z2\"\n cdkDrag\n [cdkDragData]=\"item | toRelationsDragData: newCompnentId: item.metadata.singleton: item.metadata.scope\"\n (cdkDragDropped)=\"generateNewId()\"></nodes-palette-item>\n </div>\n </ng-container>\n</div>" }]
|
|
141
141
|
}], ctorParameters: function () { return [{ type: i1.DynamicItemLoader, decorators: [{
|
|
142
142
|
type: Inject,
|
|
143
143
|
args: [RELATIONS_MODULE_TYPES_LOADER]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodesPalette.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/nodesPalette/nodesPalette.component.ts","../../../../../relations-editor/src/components/nodesPalette/nodesPalette.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAU,MAAM,EAAE,QAAQ,EAAa,KAAK,EAAC,MAAM,eAAe,CAAC;AAChI,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAC,iBAAiB,EAAqB,cAAc,EAAC,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAS,MAAM,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAc,UAAU,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAa,YAAY,EAAC,MAAM,MAAM,CAAC;AAG9C,OAAO,EAAC,2BAA2B,EAAE,6BAA6B,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AAErH,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;;;;;;AAE9E;;GAEG;AAkBH,MAAM,OAAO,uBAAuB;IAuChC,iEAAiE;IACjE,YAA6D,kBAA2D,EAClE,YAAiD,EACjF,eAAkC,EAClC,cAA8B,EAC9B,gBAAsC,EACW,mBAAwC,EAC7D,OAAgB;QANL,uBAAkB,GAAlB,kBAAkB,CAAyC;QAClE,iBAAY,GAAZ,YAAY,CAAqC;QACjF,oBAAe,GAAf,eAAe,CAAmB;QAClC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,qBAAgB,GAAhB,gBAAgB,CAAsB;QACW,wBAAmB,GAAnB,mBAAmB,CAAqB;QAC7D,YAAO,GAAP,OAAO,CAAS;QA5ClE,0EAA0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;YACd,sCAAsC;YACtC,0CAA0C;YAC1C,yBAAyB,4DACzB,2BAA2B;AAyF/B;IAFC,YAAY,CAAC,EAAE,CAAC;IAChB,QAAQ,EAAE;;;;wDAyCV;2FA7HQ,uBAAuB;kBAjBnC,SAAS;+BAEI,eAAe,cAGb,IAAI,WAEhB;wBACI,YAAY;wBACZ,cAAc;wBACd,sCAAsC;wBACtC,0CAA0C;wBAC1C,yBAAyB;wBACzB,2BAA2B;qBAC9B,mBACgB,uBAAuB,CAAC,MAAM;;0BA0ClC,MAAM;2BAAC,6BAA6B;;0BACpC,MAAM;2BAAC,sBAAsB;;0BAI7B,MAAM;2BAAC,2BAA2B;;0BAAG,QAAQ;;0BAC7C,MAAM;2BAAC,MAAM;;0BAAG,QAAQ;4CAT9B,cAAc;sBADpB,KAAK;gBAiDU,SAAS","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, OnInit, Inject, Optional, OnDestroy, Input} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {CdkDropList, DragDropModule} from '@angular/cdk/drag-drop';\nimport {DynamicItemLoader, DynamicItemSource, PackageManager} from '@anglr/dynamic';\nimport {Logger, LOGGER} from '@anglr/common';\nimport {DebounceCall, Dictionary, generateId, WithSync} from '@jscrpt/common';\nimport {Observable, Subscription} from 'rxjs';\n\nimport {NodesPaletteItem} from './nodesPalette.interface';\nimport {REFRESH_PALETTE_OBSERVABLES, RELATIONS_MODULE_TYPES_LOADER, RELATIONS_NODES_LOADER} from '../../misc/tokens';\nimport {RelationsModuleTypes, RelationsNodeDef} from '../../misc/types';\nimport {RelationsNodeManager} from '../../services';\nimport {ToRelationsDragDataSAPipe} from '../../pipes';\nimport {NodesPaletteItemSAComponent} from './item/nodesPaletteItem.component';\n\n/**\n * Component displaying available nodes palette\n */\n@Component(\n{\n selector: 'nodes-palette',\n templateUrl: 'nodesPalette.component.html',\n styleUrls: ['nodesPalette.component.css'],\n standalone: true,\n imports:\n [\n CommonModule,\n DragDropModule,\n // LayoutEditorDragPreviewSAComponent,\n // LayoutEditorDragPlaceholderSAComponent,\n ToRelationsDragDataSAPipe,\n NodesPaletteItemSAComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NodesPaletteSAComponent implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Array of all available items in palette\n */\n protected allItems: NodesPaletteItem[] = [];\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Available items grouped by group name\n */\n protected groupedItems: Dictionary<(NodesPaletteItem & {temp?: boolean})[]> = {};\n\n /**\n * Generated component id, that is used for new component\n */\n protected newCompnentId: string = generateId(16);\n\n /**\n * Indication whether drag element is over palette\n */\n protected isDragOverPalette: boolean = false;\n\n //######################### public properties - inputs #########################\n\n /**\n * Instance of canvas drop list\n */\n @Input()\n public canvasDropList!: CdkDropList;\n\n //######################### constructor #########################\n constructor(@Inject(RELATIONS_MODULE_TYPES_LOADER) protected _moduleTypesLoader: DynamicItemLoader<RelationsModuleTypes>,\n @Inject(RELATIONS_NODES_LOADER) protected _nodesLoader: DynamicItemLoader<RelationsNodeDef>,\n protected _changeDetector: ChangeDetectorRef,\n protected packageManager: PackageManager,\n protected _metadataManager: RelationsNodeManager,\n @Inject(REFRESH_PALETTE_OBSERVABLES) @Optional() protected _refreshObservables?: Observable<void>[],\n @Inject(LOGGER) @Optional() protected _logger?: Logger,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(this._refreshObservables && Array.isArray(this._refreshObservables))\n {\n for(const obs of this._refreshObservables)\n {\n this.initSubscriptions.add(obs.subscribe(() => this.loadNodes()));\n }\n }\n\n this.initSubscriptions.add(this.packageManager.usedPackagesChange.subscribe(() => this.loadNodes()));\n\n await this.loadNodes();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n /**\n * Loads available relations nodes into palette\n */\n @DebounceCall(10)\n @WithSync()\n protected async loadNodes(): Promise<void>\n {\n this.allItems = [];\n this.groupedItems = {};\n\n for (const packageName of this.packageManager.usedPackages)\n {\n const types = (await this._moduleTypesLoader.loadItem({package: packageName, name: 'types'}))?.data ?? [];\n\n for(const type of types)\n {\n const itemSource: DynamicItemSource = {package: packageName, name: type};\n const metadata = await this._nodesLoader.loadItem(itemSource);\n \n if(!metadata)\n {\n this._logger?.warn('NodesPaletteSAComponent: Failed to obtain layout editor metadata {@source}', itemSource);\n }\n else\n {\n this.allItems.push(\n {\n itemSource,\n metadata\n });\n }\n }\n } \n\n this.groupedItems[''] = [];\n\n //group items\n for(const item of this.allItems)\n {\n const group = item.metadata.metaInfo?.group ?? '';\n this.groupedItems[group] ??= [];\n this.groupedItems[group].push(item);\n }\n\n this._changeDetector.detectChanges();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Generates new component id\n */\n protected generateNewId(): void\n {\n this.newCompnentId = generateId(16);\n }\n}","<div class=\"dynamic-flex-column\">\n <ng-container *ngFor=\"let groupKeyValue of groupedItems | keyvalue\">\n <div class=\"dynamic-text-spread dynamic-text-small-caps dynamic-margin-left-extra-small dynamic-margin-horizontal-small dynamic-bold\">{{groupKeyValue.key}} </div>\n\n <div *ngFor=\"let item of groupKeyValue.value\"\n cdkDropList\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"canvasDropList\"\n class=\"palette-droplist\">\n <nodes-palette-item [data]=\"item\"\n class=\"editor-component mat-elevation-z2\"\n cdkDrag\n [cdkDragData]=\"item | toRelationsDragData: newCompnentId: item.metadata.singleton: item.metadata.scope\"\n (cdkDragDropped)=\"generateNewId()\"></nodes-palette-item>\n </div>\n </ng-container>\n</div>"]}
|
|
1
|
+
{"version":3,"file":"nodesPalette.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/nodesPalette/n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,yBAAyB,4DACzB,2BAA2B;AAyF/B;IAFC,YAAY,CAAC,EAAE,CAAC;IAChB,QAAQ,EAAE;;;;wDAyCV;2FA7HQ,uBAAuB;kBAhBnC,SAAS;+BAEI,eAAe,cAEb,IAAI,WAEhB;wBACI,YAAY;wBACZ,cAAc;wBACd,sCAAsC;wBACtC,0CAA0C;wBAC1C,yBAAyB;wBACzB,2BAA2B;qBAC9B,mBACgB,uBAAuB,CAAC,MAAM;;0BA0ClC,MAAM;2BAAC,6BAA6B;;0BACpC,MAAM;2BAAC,sBAAsB;;0BAI7B,MAAM;2BAAC,2BAA2B;;0BAAG,QAAQ;;0BAC7C,MAAM;2BAAC,MAAM;;0BAAG,QAAQ;4CAT9B,cAAc;sBADpB,KAAK;gBAiDU,SAAS","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, OnInit, Inject, Optional, OnDestroy, Input} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {CdkDropList, DragDropModule} from '@angular/cdk/drag-drop';\nimport {DynamicItemLoader, DynamicItemSource, PackageManager} from '@anglr/dynamic';\nimport {Logger, LOGGER} from '@anglr/common';\nimport {DebounceCall, Dictionary, generateId, WithSync} from '@jscrpt/common';\nimport {Observable, Subscription} from 'rxjs';\n\nimport {NodesPaletteItem} from './nodesPalette.interface';\nimport {REFRESH_PALETTE_OBSERVABLES, RELATIONS_MODULE_TYPES_LOADER, RELATIONS_NODES_LOADER} from '../../misc/tokens';\nimport {RelationsModuleTypes, RelationsNodeDef} from '../../misc/types';\nimport {RelationsNodeManager} from '../../services';\nimport {ToRelationsDragDataSAPipe} from '../../pipes';\nimport {NodesPaletteItemSAComponent} from './item/nodesPaletteItem.component';\n\n/**\n * Component displaying available nodes palette\n */\n@Component(\n{\n selector: 'nodes-palette',\n templateUrl: 'nodesPalette.component.html',\n standalone: true,\n imports:\n [\n CommonModule,\n DragDropModule,\n // LayoutEditorDragPreviewSAComponent,\n // LayoutEditorDragPlaceholderSAComponent,\n ToRelationsDragDataSAPipe,\n NodesPaletteItemSAComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NodesPaletteSAComponent implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Array of all available items in palette\n */\n protected allItems: NodesPaletteItem[] = [];\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Available items grouped by group name\n */\n protected groupedItems: Dictionary<(NodesPaletteItem & {temp?: boolean})[]> = {};\n\n /**\n * Generated component id, that is used for new component\n */\n protected newCompnentId: string = generateId(16);\n\n /**\n * Indication whether drag element is over palette\n */\n protected isDragOverPalette: boolean = false;\n\n //######################### public properties - inputs #########################\n\n /**\n * Instance of canvas drop list\n */\n @Input()\n public canvasDropList!: CdkDropList;\n\n //######################### constructor #########################\n constructor(@Inject(RELATIONS_MODULE_TYPES_LOADER) protected _moduleTypesLoader: DynamicItemLoader<RelationsModuleTypes>,\n @Inject(RELATIONS_NODES_LOADER) protected _nodesLoader: DynamicItemLoader<RelationsNodeDef>,\n protected _changeDetector: ChangeDetectorRef,\n protected packageManager: PackageManager,\n protected _metadataManager: RelationsNodeManager,\n @Inject(REFRESH_PALETTE_OBSERVABLES) @Optional() protected _refreshObservables?: Observable<void>[],\n @Inject(LOGGER) @Optional() protected _logger?: Logger,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(this._refreshObservables && Array.isArray(this._refreshObservables))\n {\n for(const obs of this._refreshObservables)\n {\n this.initSubscriptions.add(obs.subscribe(() => this.loadNodes()));\n }\n }\n\n this.initSubscriptions.add(this.packageManager.usedPackagesChange.subscribe(() => this.loadNodes()));\n\n await this.loadNodes();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n /**\n * Loads available relations nodes into palette\n */\n @DebounceCall(10)\n @WithSync()\n protected async loadNodes(): Promise<void>\n {\n this.allItems = [];\n this.groupedItems = {};\n\n for (const packageName of this.packageManager.usedPackages)\n {\n const types = (await this._moduleTypesLoader.loadItem({package: packageName, name: 'types'}))?.data ?? [];\n\n for(const type of types)\n {\n const itemSource: DynamicItemSource = {package: packageName, name: type};\n const metadata = await this._nodesLoader.loadItem(itemSource);\n \n if(!metadata)\n {\n this._logger?.warn('NodesPaletteSAComponent: Failed to obtain layout editor metadata {@source}', itemSource);\n }\n else\n {\n this.allItems.push(\n {\n itemSource,\n metadata\n });\n }\n }\n } \n\n this.groupedItems[''] = [];\n\n //group items\n for(const item of this.allItems)\n {\n const group = item.metadata.metaInfo?.group ?? '';\n this.groupedItems[group] ??= [];\n this.groupedItems[group].push(item);\n }\n\n this._changeDetector.detectChanges();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Generates new component id\n */\n protected generateNewId(): void\n {\n this.newCompnentId = generateId(16);\n }\n}","<div class=\"dynamic-flex-column\">\n <ng-container *ngFor=\"let groupKeyValue of groupedItems | keyvalue\">\n <div class=\"dynamic-text-spread dynamic-text-small-caps dynamic-margin-left-extra-small dynamic-margin-horizontal-small dynamic-bold\">{{groupKeyValue.key}} </div>\n\n <div *ngFor=\"let item of groupKeyValue.value\"\n cdkDropList\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"canvasDropList\"\n class=\"palette-droplist\">\n <nodes-palette-item [data]=\"item\"\n class=\"editor-component mat-elevation-z2\"\n cdkDrag\n [cdkDragData]=\"item | toRelationsDragData: newCompnentId: item.metadata.singleton: item.metadata.scope\"\n (cdkDragDropped)=\"generateNewId()\"></nodes-palette-item>\n </div>\n </ng-container>\n</div>"]}
|
|
@@ -216,13 +216,13 @@ export class RelationsCanvasSAComponent {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
RelationsCanvasSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RelationsCanvasSAComponent, deps: [{ token: i0.ElementRef }, { token: i1.RelationsNodeManager }, { token: i0.ChangeDetectorRef }, { token: RELATIONS_HISTORY_MANAGER }], target: i0.ɵɵFactoryTarget.Component });
|
|
219
|
-
RelationsCanvasSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RelationsCanvasSAComponent, isStandalone: true, selector: "relations-canvas", inputs: { nodeDefinitions: "nodeDefinitions" }, host: { listeners: { "mousedown": "onMouseDown($event)", "mousemove": "onMouseMove($event)", "window:mouseup": "onMouseUp($event)", "wheel": "onWheel($event)" }, properties: { "style.backgroundSize": "this.backgroundSizeStyle", "style.backgroundPosition": "this._backgroundPositionStyle" } }, viewQueries: [{ propertyName: "relationsGroup", first: true, predicate: ["relationsGroup"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"flow-area\" [style.transform]=\"'translate(' + canvasPosition.x + 'px, ' + canvasPosition.y + 'px) scale(' + zoomLevel + ')'\">\n <svg class=\"relations-wrapper\">\n <g #relationsGroup></g>\n </svg>\n \n <ng-container *ngFor=\"let nodeDefinition of nodeDefinitions\">\n <ng-container [relationsNodeRenderer]=\"nodeDefinition\" [zoomLevel]=\"zoomLevel\" (destroy)=\"destroyNode($event)\"></ng-container>\n </ng-container>\n</div>",
|
|
219
|
+
RelationsCanvasSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RelationsCanvasSAComponent, isStandalone: true, selector: "relations-canvas", inputs: { nodeDefinitions: "nodeDefinitions" }, host: { listeners: { "mousedown": "onMouseDown($event)", "mousemove": "onMouseMove($event)", "window:mouseup": "onMouseUp($event)", "wheel": "onWheel($event)" }, properties: { "style.backgroundSize": "this.backgroundSizeStyle", "style.backgroundPosition": "this._backgroundPositionStyle" } }, viewQueries: [{ propertyName: "relationsGroup", first: true, predicate: ["relationsGroup"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"flow-area\" [style.transform]=\"'translate(' + canvasPosition.x + 'px, ' + canvasPosition.y + 'px) scale(' + zoomLevel + ')'\">\n <svg class=\"relations-wrapper\">\n <g #relationsGroup></g>\n </svg>\n \n <ng-container *ngFor=\"let nodeDefinition of nodeDefinitions\">\n <ng-container [relationsNodeRenderer]=\"nodeDefinition\" [zoomLevel]=\"zoomLevel\" (destroy)=\"destroyNode($event)\"></ng-container>\n </ng-container>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: RelationsNodeRendererSADirective, selector: "[relationsNodeRenderer]", inputs: ["relationsNodeRenderer", "zoomLevel"], outputs: ["create", "destroy"], exportAs: ["relationsNodeRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
220
220
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RelationsCanvasSAComponent, decorators: [{
|
|
221
221
|
type: Component,
|
|
222
222
|
args: [{ selector: 'relations-canvas', standalone: true, imports: [
|
|
223
223
|
CommonModule,
|
|
224
224
|
RelationsNodeRendererSADirective,
|
|
225
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flow-area\" [style.transform]=\"'translate(' + canvasPosition.x + 'px, ' + canvasPosition.y + 'px) scale(' + zoomLevel + ')'\">\n <svg class=\"relations-wrapper\">\n <g #relationsGroup></g>\n </svg>\n \n <ng-container *ngFor=\"let nodeDefinition of nodeDefinitions\">\n <ng-container [relationsNodeRenderer]=\"nodeDefinition\" [zoomLevel]=\"zoomLevel\" (destroy)=\"destroyNode($event)\"></ng-container>\n </ng-container>\n</div>"
|
|
225
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flow-area\" [style.transform]=\"'translate(' + canvasPosition.x + 'px, ' + canvasPosition.y + 'px) scale(' + zoomLevel + ')'\">\n <svg class=\"relations-wrapper\">\n <g #relationsGroup></g>\n </svg>\n \n <ng-container *ngFor=\"let nodeDefinition of nodeDefinitions\">\n <ng-container [relationsNodeRenderer]=\"nodeDefinition\" [zoomLevel]=\"zoomLevel\" (destroy)=\"destroyNode($event)\"></ng-container>\n </ng-container>\n</div>" }]
|
|
226
226
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.RelationsNodeManager }, { type: i0.ChangeDetectorRef }, { type: i3.MetadataHistoryManager, decorators: [{
|
|
227
227
|
type: Inject,
|
|
228
228
|
args: [RELATIONS_HISTORY_MANAGER]
|
package/es2015/relations-editor/src/components/relationsCanvas/relationsCanvas.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationsCanvas.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsCanvas/relationsCanvas.component.ts","../../../../../relations-editor/src/components/relationsCanvas/relationsCanvas.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAU,iBAAiB,EAAY,MAAM,eAAe,CAAC;AACxK,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,MAAM,EAAC,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAC,gCAAgC,EAAC,MAAM,kBAAkB,CAAC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AAC","sourcesContent":["import {Component, ChangeDetectionStrategy, HostBinding, HostListener, ViewChild, ElementRef, Input, Inject, OnInit, ChangeDetectorRef, OnDestroy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MetadataHistoryManager} from '@anglr/dynamic';\nimport {select} from 'd3';\nimport {Subscription} from 'rxjs';\n\nimport {Coordinates, RelationsNodeMetadata} from '../../interfaces';\nimport {RelationsNodeManager} from '../../services';\nimport {NodeRelationPath} from '../../misc/nodeRelationPath';\nimport {MouseButton} from '../../misc/enums';\nimport {clamp} from '../../misc/utils';\nimport {RelationsNodeRendererSADirective} from '../../directives';\nimport {RELATIONS_HISTORY_MANAGER} from '../../misc/tokens';\n\n/**\n * Default background size in pixels\n */\nconst DEFAULT_BACKGROUND_SIZE = 16;\n\n/**\n * Minimum scale factor\n */\nconst SCALE_FACTOR_MIN = 0.2;\n\n/**\n * Maximum sclae factor\n */\nconst SCALE_FACTOR_MAX = 2;\n\n/**\n * Component used as designer component wrapper for layout component\n */\n@Component(\n{\n selector: 'relations-canvas',\n templateUrl: 'relationsCanvas.component.html',\n styleUrls: ['relationsCanvas.component.css'],\n standalone: true,\n imports:\n [\n CommonModule,\n RelationsNodeRendererSADirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RelationsCanvasSAComponent implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected _initSubscriptions: Subscription = new Subscription();\n\n /**\n * Background pattern size\n */\n protected backgroundSize: number = DEFAULT_BACKGROUND_SIZE;\n\n /**\n * Drag start position coordinates\n */\n protected dragStartPosition: Coordinates =\n {\n x: 0,\n y: 0,\n };\n\n //######################### protected properties - host bindings #########################\n\n /**\n * Background size css styles\n */\n @HostBinding('style.backgroundSize')\n protected get backgroundSizeStyle(): string\n {\n return `${this.backgroundSize}px ${this.backgroundSize}px`;\n }\n\n /**\n * Background position css styles\n */\n @HostBinding('style.backgroundPosition')\n protected get _backgroundPositionStyle(): string\n {\n return `${this.canvasPosition.x % this.backgroundSize}px ${this.canvasPosition.y % this.backgroundSize}px`;\n }\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Canvas position\n */\n protected canvasPosition: Coordinates = {x: 0, y: 0};\n\n /**\n * Zoom level\n */\n protected zoomLevel = 1;\n\n /**\n * Indication whether canvas is being dragged\n */\n protected isDragging: boolean = false;\n\n \n //######################### protected properties - getters and setters #########################\n\n /**\n * Canvas bounding box\n */\n protected get boundingBox(): DOMRect\n {\n return this.element.nativeElement.getBoundingClientRect();\n }\n\n //######################### protected properties - children #########################\n\n /**\n * Node relations svg group\n */\n @ViewChild('relationsGroup', {read: ElementRef})\n protected relationsGroup: ElementRef|null|undefined;\n\n //######################### public properties - inputs #########################\n\n /**\n * Sample data to render\n */\n @Input()\n public nodeDefinitions: RelationsNodeMetadata[] = [];\n\n //######################### constructor #########################\n constructor(protected element: ElementRef,\n protected relationManager: RelationsNodeManager,\n private _changeDetector: ChangeDetectorRef,\n @Inject(RELATIONS_HISTORY_MANAGER) protected history: MetadataHistoryManager<RelationsNodeMetadata[]>,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._initSubscriptions.add(this.relationManager.activeNodeChange.subscribe(() => this.focusNode(this.relationManager.activeNode)));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._initSubscriptions.unsubscribe();\n }\n\n //######################### public methods #########################\n\n /**\n * Focuses canvas to selected node\n * @param id Relations node identifier\n * @returns \n */\n public focusNode(id?: string|null): void\n {\n if (!id)\n {\n return;\n }\n\n const node = this.nodeDefinitions?.find(node => node.id === id);\n\n if (node?.nodeMetadata?.coordinates)\n {\n // this._setZoomLevel(1);\n this.canvasPosition = \n {\n x: (-node?.nodeMetadata?.coordinates.x) * this.zoomLevel + this.boundingBox.width/2,\n y: (-node?.nodeMetadata?.coordinates.y) * this.zoomLevel + this.boundingBox.height/2,\n };\n \n this._changeDetector.detectChanges();\n }\n }\n\n /**\n * Creates node relation path\n */\n public createRelation(): NodeRelationPath\n {\n return new NodeRelationPath(select(this.relationsGroup?.nativeElement), this.relationManager, this.history, null, null);\n }\n\n public getPositionInCanvas(point: {x: number, y: number}): Coordinates\n {\n return {\n x: (point.x - this.boundingBox.left - this.canvasPosition.x)/this.zoomLevel,\n y: (point.y - this.boundingBox.top - this.canvasPosition.y)/this.zoomLevel\n };\n }\n\n //######################### protected methods - host listeners #########################\n\n /**\n * Mouse down event, handles moving of canvas\n * @param event - Mouse event that occured\n */\n @HostListener('mousedown', ['$event'])\n protected onMouseDown(event: MouseEvent): void\n {\n if (event.buttons == MouseButton.LEFT)\n {\n this.dragStartPosition =\n {\n x: event.clientX - this.canvasPosition.x,\n y: event.clientY - this.canvasPosition.y\n };\n \n this.isDragging = true;\n }\n }\n\n /**\n * Mouse move event, handles moving of canvas\n * @param event - Mouse event that occured\n */\n @HostListener('mousemove', ['$event'])\n protected onMouseMove(event: MouseEvent): void\n {\n if (this.isDragging)\n {\n this.canvasPosition =\n {\n x: event.clientX - this.dragStartPosition.x,\n y: event.clientY - this.dragStartPosition.y\n };\n }\n }\n\n /**\n * Mouse up event, handles moving of canvas\n * @param event - Mouse event that occured\n */\n @HostListener('window:mouseup', ['$event'])\n protected onMouseUp(_: MouseEvent): void\n {\n if (this.isDragging)\n {\n this.isDragging = false;\n }\n }\n\n /**\n * Wheel event, used for zooming\n * @param event - Wheel event that occured\n */\n @HostListener('wheel', ['$event'])\n protected onWheel(event: WheelEvent): void\n {\n if (event.deltaY)\n {\n const newZoomLevel = clamp(this.zoomLevel + (event.deltaY > 1 ? -1 : 1) * 0.05, SCALE_FACTOR_MIN, SCALE_FACTOR_MAX); \n \n const posX = (event.clientX - this.canvasPosition.x - this.boundingBox.left) / this.zoomLevel;\n const posY = (event.clientY - this.canvasPosition.y - this.boundingBox.top) / this.zoomLevel;\n\n this.canvasPosition.x = event.clientX - this.boundingBox.left - posX*newZoomLevel;\n this.canvasPosition.y = event.clientY - this.boundingBox.top - posY*newZoomLevel;\n\n this._setZoomLevel(newZoomLevel);\n }\n \n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Destroys node\n * @param node - Definition of node to be destroyed\n */\n protected destroyNode(node: RelationsNodeMetadata): void\n {\n const index = this.nodeDefinitions.indexOf(node);\n\n if(index < 0)\n {\n return;\n }\n\n this.nodeDefinitions.splice(index, 1);\n\n this.history.getNewState();\n }\n\n //######################### private methods #########################\n\n /**\n * Sets zoom level\n * @param newZoomLevel new zoom level\n */\n private _setZoomLevel(newZoomLevel: number): void\n {\n this.zoomLevel = newZoomLevel;\n this.backgroundSize = DEFAULT_BACKGROUND_SIZE * this.zoomLevel;\n }\n}","<div class=\"flow-area\" [style.transform]=\"'translate(' + canvasPosition.x + 'px, ' + canvasPosition.y + 'px) scale(' + zoomLevel + ')'\">\n <svg class=\"relations-wrapper\">\n <g #relationsGroup></g>\n </svg>\n \n <ng-container *ngFor=\"let nodeDefinition of nodeDefinitions\">\n <ng-container [relationsNodeRenderer]=\"nodeDefinition\" [zoomLevel]=\"zoomLevel\" (destroy)=\"destroyNode($event)\"></ng-container>\n </ng-container>\n</div>"]}
|
|
1
|
+
{"version":3,"file":"relationsCanvas.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsCanvas/relationsCanvas.component.ts","../../../../../relations-editor/src/components/relationsCanvas/relationsCanvas.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAU,iBAAiB,EAAY,MAAM,eAAe,CAAC;AACxK,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,MAA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AC,gBAAgB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC;gBASxC,eAAe;sBADrB,KAAK;gBAmFI,WAAW;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAoB3B,WAAW;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAkB3B,SAAS;sBADlB,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;gBAchC,OAAO;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, HostBinding, HostListener, ViewChild, ElementRef, Input, Inject, OnInit, ChangeDetectorRef, OnDestroy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MetadataHistoryManager} from '@anglr/dynamic';\nimport {select} from 'd3';\nimport {Subscription} from 'rxjs';\n\nimport {Coordinates, RelationsNodeMetadata} from '../../interfaces';\nimport {RelationsNodeManager} from '../../services';\nimport {NodeRelationPath} from '../../misc/nodeRelationPath';\nimport {MouseButton} from '../../misc/enums';\nimport {clamp} from '../../misc/utils';\nimport {RelationsNodeRendererSADirective} from '../../directives';\nimport {RELATIONS_HISTORY_MANAGER} from '../../misc/tokens';\n\n/**\n * Default background size in pixels\n */\nconst DEFAULT_BACKGROUND_SIZE = 16;\n\n/**\n * Minimum scale factor\n */\nconst SCALE_FACTOR_MIN = 0.2;\n\n/**\n * Maximum sclae factor\n */\nconst SCALE_FACTOR_MAX = 2;\n\n/**\n * Component used as designer component wrapper for layout component\n */\n@Component(\n{\n selector: 'relations-canvas',\n templateUrl: 'relationsCanvas.component.html',\n standalone: true,\n imports:\n [\n CommonModule,\n RelationsNodeRendererSADirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RelationsCanvasSAComponent implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected _initSubscriptions: Subscription = new Subscription();\n\n /**\n * Background pattern size\n */\n protected backgroundSize: number = DEFAULT_BACKGROUND_SIZE;\n\n /**\n * Drag start position coordinates\n */\n protected dragStartPosition: Coordinates =\n {\n x: 0,\n y: 0,\n };\n\n //######################### protected properties - host bindings #########################\n\n /**\n * Background size css styles\n */\n @HostBinding('style.backgroundSize')\n protected get backgroundSizeStyle(): string\n {\n return `${this.backgroundSize}px ${this.backgroundSize}px`;\n }\n\n /**\n * Background position css styles\n */\n @HostBinding('style.backgroundPosition')\n protected get _backgroundPositionStyle(): string\n {\n return `${this.canvasPosition.x % this.backgroundSize}px ${this.canvasPosition.y % this.backgroundSize}px`;\n }\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Canvas position\n */\n protected canvasPosition: Coordinates = {x: 0, y: 0};\n\n /**\n * Zoom level\n */\n protected zoomLevel = 1;\n\n /**\n * Indication whether canvas is being dragged\n */\n protected isDragging: boolean = false;\n\n \n //######################### protected properties - getters and setters #########################\n\n /**\n * Canvas bounding box\n */\n protected get boundingBox(): DOMRect\n {\n return this.element.nativeElement.getBoundingClientRect();\n }\n\n //######################### protected properties - children #########################\n\n /**\n * Node relations svg group\n */\n @ViewChild('relationsGroup', {read: ElementRef})\n protected relationsGroup: ElementRef|null|undefined;\n\n //######################### public properties - inputs #########################\n\n /**\n * Sample data to render\n */\n @Input()\n public nodeDefinitions: RelationsNodeMetadata[] = [];\n\n //######################### constructor #########################\n constructor(protected element: ElementRef,\n protected relationManager: RelationsNodeManager,\n private _changeDetector: ChangeDetectorRef,\n @Inject(RELATIONS_HISTORY_MANAGER) protected history: MetadataHistoryManager<RelationsNodeMetadata[]>,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._initSubscriptions.add(this.relationManager.activeNodeChange.subscribe(() => this.focusNode(this.relationManager.activeNode)));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._initSubscriptions.unsubscribe();\n }\n\n //######################### public methods #########################\n\n /**\n * Focuses canvas to selected node\n * @param id Relations node identifier\n * @returns \n */\n public focusNode(id?: string|null): void\n {\n if (!id)\n {\n return;\n }\n\n const node = this.nodeDefinitions?.find(node => node.id === id);\n\n if (node?.nodeMetadata?.coordinates)\n {\n // this._setZoomLevel(1);\n this.canvasPosition = \n {\n x: (-node?.nodeMetadata?.coordinates.x) * this.zoomLevel + this.boundingBox.width/2,\n y: (-node?.nodeMetadata?.coordinates.y) * this.zoomLevel + this.boundingBox.height/2,\n };\n \n this._changeDetector.detectChanges();\n }\n }\n\n /**\n * Creates node relation path\n */\n public createRelation(): NodeRelationPath\n {\n return new NodeRelationPath(select(this.relationsGroup?.nativeElement), this.relationManager, this.history, null, null);\n }\n\n public getPositionInCanvas(point: {x: number, y: number}): Coordinates\n {\n return {\n x: (point.x - this.boundingBox.left - this.canvasPosition.x)/this.zoomLevel,\n y: (point.y - this.boundingBox.top - this.canvasPosition.y)/this.zoomLevel\n };\n }\n\n //######################### protected methods - host listeners #########################\n\n /**\n * Mouse down event, handles moving of canvas\n * @param event - Mouse event that occured\n */\n @HostListener('mousedown', ['$event'])\n protected onMouseDown(event: MouseEvent): void\n {\n if (event.buttons == MouseButton.LEFT)\n {\n this.dragStartPosition =\n {\n x: event.clientX - this.canvasPosition.x,\n y: event.clientY - this.canvasPosition.y\n };\n \n this.isDragging = true;\n }\n }\n\n /**\n * Mouse move event, handles moving of canvas\n * @param event - Mouse event that occured\n */\n @HostListener('mousemove', ['$event'])\n protected onMouseMove(event: MouseEvent): void\n {\n if (this.isDragging)\n {\n this.canvasPosition =\n {\n x: event.clientX - this.dragStartPosition.x,\n y: event.clientY - this.dragStartPosition.y\n };\n }\n }\n\n /**\n * Mouse up event, handles moving of canvas\n * @param event - Mouse event that occured\n */\n @HostListener('window:mouseup', ['$event'])\n protected onMouseUp(_: MouseEvent): void\n {\n if (this.isDragging)\n {\n this.isDragging = false;\n }\n }\n\n /**\n * Wheel event, used for zooming\n * @param event - Wheel event that occured\n */\n @HostListener('wheel', ['$event'])\n protected onWheel(event: WheelEvent): void\n {\n if (event.deltaY)\n {\n const newZoomLevel = clamp(this.zoomLevel + (event.deltaY > 1 ? -1 : 1) * 0.05, SCALE_FACTOR_MIN, SCALE_FACTOR_MAX); \n \n const posX = (event.clientX - this.canvasPosition.x - this.boundingBox.left) / this.zoomLevel;\n const posY = (event.clientY - this.canvasPosition.y - this.boundingBox.top) / this.zoomLevel;\n\n this.canvasPosition.x = event.clientX - this.boundingBox.left - posX*newZoomLevel;\n this.canvasPosition.y = event.clientY - this.boundingBox.top - posY*newZoomLevel;\n\n this._setZoomLevel(newZoomLevel);\n }\n \n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Destroys node\n * @param node - Definition of node to be destroyed\n */\n protected destroyNode(node: RelationsNodeMetadata): void\n {\n const index = this.nodeDefinitions.indexOf(node);\n\n if(index < 0)\n {\n return;\n }\n\n this.nodeDefinitions.splice(index, 1);\n\n this.history.getNewState();\n }\n\n //######################### private methods #########################\n\n /**\n * Sets zoom level\n * @param newZoomLevel new zoom level\n */\n private _setZoomLevel(newZoomLevel: number): void\n {\n this.zoomLevel = newZoomLevel;\n this.backgroundSize = DEFAULT_BACKGROUND_SIZE * this.zoomLevel;\n }\n}","<div class=\"flow-area\" [style.transform]=\"'translate(' + canvasPosition.x + 'px, ' + canvasPosition.y + 'px) scale(' + zoomLevel + ')'\">\n <svg class=\"relations-wrapper\">\n <g #relationsGroup></g>\n </svg>\n \n <ng-container *ngFor=\"let nodeDefinition of nodeDefinitions\">\n <ng-container [relationsNodeRenderer]=\"nodeDefinition\" [zoomLevel]=\"zoomLevel\" (destroy)=\"destroyNode($event)\"></ng-container>\n </ng-container>\n</div>"]}
|
package/es2015/relations-editor/src/components/relationsEditor/relationsEditor.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationsEditor.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsEditor/relationsEditor.component.ts","../../../../../relations-editor/src/components/relationsEditor/relationsEditor.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAqB,MAAM,EAAE,iBAAiB,EAA4B,SAAS,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACrK,OAAO,EAAc,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,aAAa,EAAE,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,0BAA0B,EAAC,MAAM,8CAA8C,CAAC;AAExF,OAAO,EAAC,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;;;;;AAE5D;;GAEG;
|
|
1
|
+
{"version":3,"file":"relationsEditor.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsEditor/relationsEditor.component.ts","../../../../../relations-editor/src/components/relationsEditor/relationsEditor.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAqB,MAAM,EAAE,iBAAiB,EAA4B,SAAS,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACrK,OAAO,EAAc,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,aAAa,EAAE,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MA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AA0B,qEC7CzC,0cAOM,+EDgBE,uBAAuB,sFACvB,0BAA0B,yFAC1B,cAAc,2gBACd,oBAAoB;2FAIf,0BAA0B;kBAftC,SAAS;+BAEI,kBAAkB,cAGhB,IAAI,WAEhB;wBACI,uBAAuB;wBACvB,0BAA0B;wBAC1B,cAAc;wBACd,oBAAoB;qBACvB,mBACgB,uBAAuB,CAAC,MAAM;;0BA6BlC,MAAM;2BAAC,yBAAyB;;0BAEhC,QAAQ;4CAbX,cAAc;sBADvB,SAAS;uBAAC,0BAA0B;gBAS9B,QAAQ;sBADd,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input, OnDestroy, OnInit, Inject, ChangeDetectorRef, OnChanges, SimpleChanges, ViewChild, Optional} from '@angular/core';\nimport {CdkDragDrop, DragDropModule} from '@angular/cdk/drag-drop';\nimport {HostDisplayFlexStyle} from '@anglr/common';\nimport {EditorHotkeys, MetadataHistoryManager, PackageManagerModule} from '@anglr/dynamic';\nimport {nameof} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {NodesPaletteSAComponent} from '../nodesPalette/nodesPalette.component';\nimport {RelationsCanvasSAComponent} from '../relationsCanvas/relationsCanvas.component';\nimport {RelationsNodeDragData, RelationsNodeMetadata} from '../../interfaces';\nimport {RELATIONS_HISTORY_MANAGER} from '../../misc/tokens';\n\n/**\n * Component that represents relations editor with palette and canvas\n */\n@Component(\n{\n selector: 'relations-editor',\n templateUrl: 'relationsEditor.component.html',\n styles: [HostDisplayFlexStyle],\n standalone: true,\n imports:\n [\n NodesPaletteSAComponent,\n RelationsCanvasSAComponent,\n DragDropModule,\n PackageManagerModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RelationsEditorSAComponent implements OnInit, OnChanges, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n\n //######################### protected properties - view children #########################\n\n /**\n * Relation canvas\n */\n @ViewChild(RelationsCanvasSAComponent)\n protected relationCanvas: RelationsCanvasSAComponent|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Metadata used for rendering relations in canvas\n */\n @Input()\n public metadata: RelationsNodeMetadata[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(RELATIONS_HISTORY_MANAGER) protected history: MetadataHistoryManager<RelationsNodeMetadata[]>,\n protected changeDetector: ChangeDetectorRef,\n @Optional() protected hotkeys?: EditorHotkeys,)\n {\n hotkeys?.init();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.initSubscriptions.add(this.history.pop.subscribe(metadata =>\n {\n this.metadata = metadata;\n this.changeDetector.detectChanges();\n }));\n\n if(this.hotkeys)\n {\n this.initSubscriptions.add(this.hotkeys.undo.subscribe(() => this.history.undo()));\n this.initSubscriptions.add(this.hotkeys.redo.subscribe(() => this.history.redo()));\n }\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<RelationsEditorSAComponent>('metadata') in changes)\n {\n this.history.clean();\n \n if(this.metadata)\n {\n this.history.setInitialState(this.metadata);\n }\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n this.hotkeys?.destroy();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Adds new node into canvas and metadata\n * @param event - Drop event that occured\n */\n protected addNode(event: CdkDragDrop<RelationsNodeDragData, RelationsNodeDragData, RelationsNodeDragData>): void\n { \n if (event.item.data.metadata.nodeMetadata?.coordinates)\n {\n const coordinates = this.relationCanvas?.getPositionInCanvas(event.dropPoint);\n\n if(coordinates)\n {\n event.item.data.metadata.nodeMetadata.coordinates.x = coordinates.x;\n event.item.data.metadata.nodeMetadata.coordinates.y = coordinates.y;\n }\n }\n\n this.metadata =\n [\n ...this.metadata,\n event.item.data.metadata,\n ];\n\n this.history.getNewState();\n }\n}","<div class=\"dynamic-flex-row dynamic-flex-1\">\n <div class=\"overflow-vertical-scroll dynamic-thin-scrollbar\">\n <package-manager></package-manager>\n <nodes-palette [canvasDropList]=\"dropList\" style=\"width: 250px;\"></nodes-palette>\n </div>\n\n <relations-canvas #dropList=\"cdkDropList\" [nodeDefinitions]=\"metadata\" class=\"dynamic-flex-1\" cdkDropList (cdkDropListDropped)=\"addNode($event)\"></relations-canvas>\n</div>"]}
|
package/es2015/relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.js
CHANGED
|
@@ -127,12 +127,18 @@ export class RelationNodeInputSAComponent extends RelationNodeEndpointBase {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
RelationNodeInputSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RelationNodeInputSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
130
|
-
RelationNodeInputSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RelationNodeInputSAComponent, isStandalone: true, selector: "relation-node-input", host: { listeners: { "mouseenter": "_onMouseEnter($event)", "mouseleave": "_onMouseLeave($event)", "mousedown": "_onMouseDown($event)", "window:mousemove": "_onMouseMove($event)", "window:mouseup": "_onMouseUp($event)" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true,
|
|
130
|
+
RelationNodeInputSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RelationNodeInputSAComponent, isStandalone: true, selector: "relation-node-input", host: { listeners: { "mouseenter": "_onMouseEnter($event)", "mouseleave": "_onMouseLeave($event)", "mousedown": "_onMouseDown($event)", "window:mousemove": "_onMouseMove($event)", "window:mouseup": "_onMouseUp($event)" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
131
131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RelationNodeInputSAComponent, decorators: [{
|
|
132
132
|
type: Component,
|
|
133
|
-
args: [{
|
|
133
|
+
args: [{
|
|
134
|
+
selector: 'relation-node-input',
|
|
135
|
+
template: '',
|
|
136
|
+
standalone: true,
|
|
137
|
+
imports: [
|
|
134
138
|
CommonModule,
|
|
135
|
-
],
|
|
139
|
+
],
|
|
140
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
141
|
+
}]
|
|
136
142
|
}], propDecorators: { _onMouseEnter: [{
|
|
137
143
|
type: HostListener,
|
|
138
144
|
args: ['mouseenter', ['$event']]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationsNodeInput.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AAGtE,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;;AAErD;;GAEG;
|
|
1
|
+
{"version":3,"file":"relationsNodeInput.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsNodeInput/relationsNodeInput.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AAGtE,OAAO,EAAC,WAAW,EAAC,MAAM,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'@angular/common';\n\nimport {RelationNodeEndpointBase} from '../relationsNodeEndpointBase';\nimport {RelationsInput} from '../../interfaces';\nimport {NodeRelationPath} from '../../misc/nodeRelationPath';\nimport {MouseButton} from '../../misc/enums';\nimport {INVALIDATE_DROP} from '../../misc/constants';\n\n/**\n * Component used to display relation node input\n */\n@Component(\n{\n selector: 'relation-node-input',\n template: '',\n standalone: true,\n imports:\n [\n CommonModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RelationNodeInputSAComponent extends RelationNodeEndpointBase implements RelationsInput, OnDestroy\n{\n //######################### private properties #########################\n\n /**\n * Temporary relation path when updating existing relation\n */\n private _tempRelation: NodeRelationPath|null|undefined;\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(this._relation)\n {\n this._relation.destroy();\n }\n }\n\n //######################### public methods - implementation of RelationsInput #########################\n\n /**\n * @inheritdoc\n */\n public addRelation(relation: NodeRelationPath): boolean\n {\n if (this._relation)\n {\n //Same relation\n if (this._relation.start?.x === relation.start?.x &&\n this._relation.start?.y === relation.start?.y)\n {\n return false;\n }\n\n this._relation.destroy();\n }\n\n this._relation = relation;\n \n return true;\n }\n\n /**\n * @inheritdoc\n */\n public endRelation(relation: NodeRelationPath): void\n {\n if(this.addRelation(relation))\n {\n this.updateRelation();\n }\n }\n\n //######################### public methods - overrides #########################\n\n /**\n * Updates node output relation\n */\n public updateRelation(): void\n {\n if (!this._relation)\n {\n return;\n }\n\n this._relation.end = this.getCoordinates();\n this._relation.input = this;\n this._relation.invalidateVisuals();\n }\n\n //######################### protected methods - host listeners #########################\n\n /**\n * Mouse enter event, marks input as active\n * @param event - Mouse event that occured\n */\n @HostListener('mouseenter', ['$event'])\n protected _onMouseEnter(event: MouseEvent): void\n {\n if (event.buttons === MouseButton.LEFT)\n {\n this._relationManager.setActiveInput(this);\n }\n\n this._relation?.highlight();\n }\n\n /**\n * Mouse leave event, clears marked active input\n * @param event - Mouse event that occured\n */\n @HostListener('mouseleave', ['$event'])\n protected _onMouseLeave(event: MouseEvent): void\n {\n if (event.buttons === MouseButton.LEFT)\n {\n this._relationManager.setActiveInput(null);\n }\n\n this._relation?.cancelHighlight();\n }\n\n /**\n * Mouse down event, starts dragging\n * @param event - Mouse event that occured\n */\n @HostListener('mousedown', ['$event'])\n protected _onMouseDown(event: MouseEvent): void\n {\n event.stopImmediatePropagation();\n event.preventDefault();\n\n this._lastMouseDownPosition =\n {\n x: event.clientX,\n y: event.clientY\n };\n\n this._tempRelation = this._relation;\n this._relation = null;\n this._isDragging = true;\n }\n\n /**\n * Mouse move event on whole window\n * @param event - Mouse event that occured\n */\n @HostListener('window:mousemove', ['$event'])\n protected _onMouseMove(event: MouseEvent): void\n {\n if (this._isDragging)\n {\n event.stopImmediatePropagation();\n event.preventDefault();\n\n if (this._tempRelation)\n {\n this._tempRelation.end =\n {\n x: this.getCoordinates().x + (event.clientX - this._lastMouseDownPosition?.x) * 1/this.zoomLevel,\n y: this.getCoordinates().y + (event.clientY - this._lastMouseDownPosition?.y) * 1/this.zoomLevel\n };\n \n this._tempRelation.invalidateVisuals();\n }\n }\n }\n\n /**\n * Mouse up event on whole window\n * @param event - Mouse event that occured\n */\n @HostListener('window:mouseup', ['$event'])\n protected _onMouseUp(event: MouseEvent): void\n {\n if (this._isDragging)\n {\n this._isDragging = false;\n event.stopImmediatePropagation();\n event.preventDefault();\n this._tempRelation?.invalidateVisuals(INVALIDATE_DROP);\n }\n }\n}"]}
|
package/es2015/relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.js
CHANGED
|
@@ -129,12 +129,18 @@ export class RelationNodeOutputSAComponent extends RelationNodeEndpointBase {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
RelationNodeOutputSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RelationNodeOutputSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
132
|
-
RelationNodeOutputSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RelationNodeOutputSAComponent, isStandalone: true, selector: "relation-node-output", host: { listeners: { "mousedown": "_onMouseDown($event)", "mouseenter": "_onMouseEnter($event)", "mouseleave": "_onMouseLeave($event)", "window:mousemove": "_onMouseMove($event)", "window:mouseup": "_onMouseUp($event)" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true,
|
|
132
|
+
RelationNodeOutputSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RelationNodeOutputSAComponent, isStandalone: true, selector: "relation-node-output", host: { listeners: { "mousedown": "_onMouseDown($event)", "mouseenter": "_onMouseEnter($event)", "mouseleave": "_onMouseLeave($event)", "window:mousemove": "_onMouseMove($event)", "window:mouseup": "_onMouseUp($event)" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
133
133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RelationNodeOutputSAComponent, decorators: [{
|
|
134
134
|
type: Component,
|
|
135
|
-
args: [{
|
|
135
|
+
args: [{
|
|
136
|
+
selector: 'relation-node-output',
|
|
137
|
+
template: '',
|
|
138
|
+
standalone: true,
|
|
139
|
+
imports: [
|
|
136
140
|
CommonModule,
|
|
137
|
-
],
|
|
141
|
+
],
|
|
142
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
143
|
+
}]
|
|
138
144
|
}], propDecorators: { _onMouseDown: [{
|
|
139
145
|
type: HostListener,
|
|
140
146
|
args: ['mousedown', ['$event']]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationsNodeOutput.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AAGtE,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;;AAErD;;GAEG;
|
|
1
|
+
{"version":3,"file":"relationsNodeOutput.component.js","sourceRoot":"","sources":["../../../../../relations-editor/src/components/relationsNodeOutput/relationsNodeOutput.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AAGtE,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;;AAErD;;GAEG;AAYH,MAAM,OAAO,6BAA8B,SAAQ,wBAAwB;IAX3E;;QAaI,0EAA0E;QAE1E;;WAEG;QACO,eAAU,GAAuB,EAAE,CAAC;KA+JjD;IA7JG,2GAA2G;IAE3G;;OAEG;IACH,IAAW,SAAS;QAEhB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAG,IAAI,CAAC,UAAU,EAClB;YACI,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;YAEvC,KAAI,MAAM,QAAQ,IAAI,SAAS,EAC/B;gBACI,QAAQ,CAAC,OAAO,EAAE,CAAC;aACtB;SACJ;IACL,CAAC;IAED,wGAAwG;IAExG;;OAEG;IACI,aAAa;QAEhB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAE/C,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc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AAS;mBACV;oBACI,QAAQ,EAAE,sBAAsB;oBAChC,QAAQ,EAAE,EAAE;oBACZ,UAAU,EAAE,IAAI;oBAChB,OAAO,EACP;wBACI,YAAY;qBACf;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;8BA2Fa,YAAY;sBADrB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;gBAqB3B,aAAa;sBADtB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBAW5B,aAAa;sBADtB,YAAY;uBAAC,YAAY,EAAE,CAAC,QAAQ,CAAC;gBAW5B,YAAY;sBADrB,YAAY;uBAAC,kBAAkB,EAAE,CAAC,QAAQ,CAAC;gBA0BlC,UAAU;sBADnB,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, HostListener, OnDestroy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {RelationNodeEndpointBase} from '../relationsNodeEndpointBase';\nimport {RelationsOutput} from '../../interfaces';\nimport {NodeRelationPath} from '../../misc/nodeRelationPath';\nimport {INVALIDATE_DROP} from '../../misc/constants';\n\n/**\n * Component used to display relation node output\n */\n@Component(\n{\n selector: 'relation-node-output',\n template: '',\n standalone: true,\n imports:\n [\n CommonModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RelationNodeOutputSAComponent extends RelationNodeEndpointBase implements RelationsOutput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Relations\n */\n protected _relations: NodeRelationPath[] = [];\n\n //######################### public properties - implementation of RelationsOutput #########################\n\n /**\n * @inheritdoc\n */\n public get relations(): NodeRelationPath[]\n {\n return this._relations;\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(this._relations)\n {\n const relations = [...this._relations];\n\n for(const relation of relations)\n {\n relation.destroy();\n }\n }\n }\n\n //######################### public methods - implementation of RelationsOutput #########################\n\n /**\n * @inheritdoc\n */\n public startRelation(): NodeRelationPath\n {\n const relation = this._canvas.createRelation();\n\n relation.start = this.getCoordinates();\n relation.output = this;\n\n relation.destroying.subscribe(() =>\n {\n const index = this._relations.indexOf(relation);\n\n if(index >= 0)\n {\n this._relations.splice(index, 1);\n }\n });\n\n this._relations.push(relation);\n\n return relation;\n }\n\n //######################### public methods - overrides #########################\n\n /**\n * Updates node output relations\n */\n public updateRelation(): void\n {\n if (!this._relations)\n {\n return;\n }\n\n for (const relation of this._relations)\n {\n relation.start = this.getCoordinates();\n relation.invalidateVisuals();\n }\n }\n\n //######################### protected methods - host listeners #########################\n\n /**\n * Mouse down event, creates new relation\n * @param event - Mouse event that occured\n */\n @HostListener('mousedown', ['$event'])\n protected _onMouseDown(event: DragEvent): void\n {\n event.stopImmediatePropagation();\n event.preventDefault();\n\n this._isDragging = true;\n this._lastMouseDownPosition =\n {\n x: event.clientX,\n y: event.clientY\n };\n\n this._relation = this.startRelation();\n }\n\n /**\n * Mouse enter event, marks input as active\n * @param event - Mouse event that occured\n */\n @HostListener('mouseenter', ['$event'])\n protected _onMouseEnter(_: MouseEvent): void\n {\n this._relations?.forEach(relation => relation?.highlight());\n }\n\n /**\n * Mouse leave event, clears marked active input\n * @param event - Mouse event that occured\n */\n @HostListener('mouseleave', ['$event'])\n protected _onMouseLeave(_: MouseEvent): void\n {\n this._relations?.forEach(relation => relation?.cancelHighlight());\n }\n\n /**\n * Mouse move event - whole window\n * @param event - Mouse event that occured\n */\n @HostListener('window:mousemove', ['$event'])\n protected _onMouseMove(event: DragEvent): void\n {\n if (this._isDragging)\n {\n event.stopImmediatePropagation();\n event.preventDefault();\n\n if (this._relation)\n {\n this._relation.end =\n {\n x: this.getCoordinates().x + (event.clientX - this._lastMouseDownPosition.x) * 1/this.zoomLevel,\n y: this.getCoordinates().y + (event.clientY - this._lastMouseDownPosition.y) * 1/this.zoomLevel\n };\n\n this._relation.invalidateVisuals();\n }\n }\n }\n\n /**\n * Mouse up event - whole window\n * @param event - Mouse event that occured\n */\n @HostListener('window:mouseup', ['$event'])\n protected _onMouseUp(event: DragEvent): void\n {\n if (this._isDragging)\n {\n this._isDragging = false;\n event.stopImmediatePropagation();\n event.preventDefault();\n\n this._relation?.invalidateVisuals(INVALIDATE_DROP);\n }\n }\n}"]}
|
|
@@ -6,10 +6,10 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
export class LayoutEditorDragPreviewSAComponent {
|
|
7
7
|
}
|
|
8
8
|
LayoutEditorDragPreviewSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutEditorDragPreviewSAComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9
|
-
LayoutEditorDragPreviewSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutEditorDragPreviewSAComponent, isStandalone: true, selector: "layout-editor-drag-preview", inputs: { layoutMetadata: "layoutMetadata" }, ngImport: i0, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9
|
+
LayoutEditorDragPreviewSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutEditorDragPreviewSAComponent, isStandalone: true, selector: "layout-editor-drag-preview", inputs: { layoutMetadata: "layoutMetadata" }, ngImport: i0, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small dynamic-small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10
10
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutEditorDragPreviewSAComponent, decorators: [{
|
|
11
11
|
type: Component,
|
|
12
|
-
args: [{ selector: 'layout-editor-drag-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>" }]
|
|
12
|
+
args: [{ selector: 'layout-editor-drag-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small dynamic-small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>" }]
|
|
13
13
|
}], propDecorators: { layoutMetadata: [{
|
|
14
14
|
type: Input
|
|
15
15
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layoutEditorDragPreview.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.ts","../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;;AAGxE;;GAEG;AAQH,MAAM,OAAO,kCAAkC;;+HAAlC,kCAAkC;mHAAlC,kCAAkC,oICb/C,
|
|
1
|
+
{"version":3,"file":"layoutEditorDragPreview.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.ts","../../../../../layout-editor/src/components/layoutEditorDragPreview/layoutEditorDragPreview.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;;AAGxE;;GAEG;AAQH,MAAM,OAAO,kCAAkC;;+HAAlC,kCAAkC;mHAAlC,kCAAkC,oICb/C,mMAA6L;2FDahL,kCAAkC;kBAP9C,SAAS;+BAEI,4BAA4B,cAE1B,IAAI,mBACC,uBAAuB,CAAC,MAAM;8BAUxC,cAAc;sBADpB,KAAK","sourcesContent":["import {Component, ChangeDetectionStrategy, Input} from '@angular/core';\nimport {LayoutComponentMetadata} from '@anglr/dynamic/layout';\n\n/**\n * Component used for displaying layout editor drag preview\n */\n@Component(\n{\n selector: 'layout-editor-drag-preview',\n templateUrl: 'layoutEditorDragPreview.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LayoutEditorDragPreviewSAComponent\n{\n //######################### public properties - inputs #########################\n\n /**\n * Layout metadata for dragged component\n */\n @Input()\n public layoutMetadata?: LayoutComponentMetadata|null;\n}","<span class=\"dynamic-semi-bold\">{{layoutMetadata?.name}}</span><span class=\"dynamic-margin-left-extra-small dynamic-small-text\">#{{layoutMetadata?.displayName || layoutMetadata?.id}}</span>"]}
|