@anglr/dynamic 1.0.0-beta.20221109083513 → 1.0.0-beta.20221109102920
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/interfaces/propertiesControl/propertiesControl.interface.js.map +1 -1
- package/es2015/layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.js +4 -4
- package/es2015/layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.js.map +1 -1
- package/es2015/layout-relations/src/components/customComponentOptions/customComponentOptions.component.js +146 -0
- package/es2015/layout-relations/src/components/customComponentOptions/customComponentOptions.component.js.map +1 -0
- package/es2015/layout-relations/src/components/customComponentOptions/customComponentOptions.interface.js +2 -0
- package/es2015/layout-relations/src/components/customComponentOptions/customComponentOptions.interface.js.map +1 -0
- package/es2015/layout-relations/src/components/index.js +2 -2
- package/es2015/layout-relations/src/components/index.js.map +1 -1
- package/es2015/layout-relations/src/directives/index.js +1 -1
- package/es2015/layout-relations/src/directives/index.js.map +1 -1
- package/es2015/layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.js +97 -0
- package/es2015/layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.js.map +1 -0
- package/es2015/layout-relations/src/dynamicItems/customComponent/customComponent.options.js.map +1 -1
- package/es2015/layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.js +0 -4
- package/es2015/layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.js.map +1 -1
- package/es2015/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.js +53 -101
- package/es2015/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.js.map +1 -1
- package/es2015/layout-relations/src/misc/utils.js +3 -3
- package/es2015/layout-relations/src/misc/utils.js.map +1 -1
- package/es2015/layout-relations/src/services/customComponentsRegister/customComponentsRegister.interface.js.map +1 -1
- package/es2015/layout-relations/src/services/customComponentsRegister/customComponentsRegister.service.js +7 -0
- package/es2015/layout-relations/src/services/customComponentsRegister/customComponentsRegister.service.js.map +1 -1
- package/es2020/layout-editor/src/interfaces/propertiesControl/propertiesControl.interface.js.map +1 -1
- package/es2020/layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.js +4 -4
- package/es2020/layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.js.map +1 -1
- package/es2020/layout-relations/src/components/customComponentOptions/customComponentOptions.component.js +143 -0
- package/es2020/layout-relations/src/components/customComponentOptions/customComponentOptions.component.js.map +1 -0
- package/es2020/layout-relations/src/components/customComponentOptions/customComponentOptions.interface.js +2 -0
- package/es2020/layout-relations/src/components/customComponentOptions/customComponentOptions.interface.js.map +1 -0
- package/es2020/layout-relations/src/components/index.js +2 -2
- package/es2020/layout-relations/src/components/index.js.map +1 -1
- package/es2020/layout-relations/src/directives/index.js +1 -1
- package/es2020/layout-relations/src/directives/index.js.map +1 -1
- package/es2020/layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.js +89 -0
- package/es2020/layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.js.map +1 -0
- package/es2020/layout-relations/src/dynamicItems/customComponent/customComponent.options.js.map +1 -1
- package/es2020/layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.js +0 -4
- package/es2020/layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.js.map +1 -1
- package/es2020/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.js +46 -80
- package/es2020/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.js.map +1 -1
- package/es2020/layout-relations/src/misc/utils.js +3 -3
- package/es2020/layout-relations/src/misc/utils.js.map +1 -1
- package/es2020/layout-relations/src/services/customComponentsRegister/customComponentsRegister.interface.js.map +1 -1
- package/es2020/layout-relations/src/services/customComponentsRegister/customComponentsRegister.service.js +7 -0
- package/es2020/layout-relations/src/services/customComponentsRegister/customComponentsRegister.service.js.map +1 -1
- package/layout-editor/src/interfaces/propertiesControl/propertiesControl.interface.d.ts.map +1 -1
- package/layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.html +1 -1
- package/layout-relations/src/components/{contentOptionsSelection/contentOptionsSelection.component.d.ts → customComponentOptions/customComponentOptions.component.d.ts} +16 -10
- package/layout-relations/src/components/customComponentOptions/customComponentOptions.component.d.ts.map +1 -0
- package/layout-relations/src/components/{contentOptionsSelection/contentOptionsSelection.component.html → customComponentOptions/customComponentOptions.component.html} +2 -2
- package/layout-relations/src/components/{contentOptionsSelection/contentOptionsSelection.interface.d.ts → customComponentOptions/customComponentOptions.interface.d.ts} +6 -5
- package/layout-relations/src/components/customComponentOptions/customComponentOptions.interface.d.ts.map +1 -0
- package/layout-relations/src/components/index.d.ts +2 -2
- package/layout-relations/src/components/index.d.ts.map +1 -1
- package/layout-relations/src/directives/index.d.ts +1 -1
- package/layout-relations/src/directives/index.d.ts.map +1 -1
- package/layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.d.ts +46 -0
- package/layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.d.ts.map +1 -0
- package/layout-relations/src/dynamicItems/customComponent/customComponent.options.d.ts +0 -4
- package/layout-relations/src/dynamicItems/customComponent/customComponent.options.d.ts.map +1 -1
- package/layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.d.ts +0 -4
- package/layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.d.ts.map +1 -1
- package/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.d.ts +14 -35
- package/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.d.ts.map +1 -1
- package/layout-relations/src/dynamicItems/customComponent/misc/components/contentOptionsPropertiesControl/contentOptionsPropertiesControl.component.html +6 -8
- package/layout-relations/src/misc/utils.d.ts.map +1 -1
- package/layout-relations/src/services/customComponentsRegister/customComponentsRegister.interface.d.ts +2 -2
- package/layout-relations/src/services/customComponentsRegister/customComponentsRegister.interface.d.ts.map +1 -1
- package/layout-relations/src/services/customComponentsRegister/customComponentsRegister.service.d.ts +6 -0
- package/layout-relations/src/services/customComponentsRegister/customComponentsRegister.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/styles/components/_content-options.scss +6 -0
- package/styles/core/_mixins.scss +1 -0
- package/styles/core/_theme.scss +4 -0
- package/version.bak +1 -1
- package/es2015/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.component.js +0 -143
- package/es2015/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.component.js.map +0 -1
- package/es2015/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.interface.js +0 -2
- package/es2015/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.interface.js.map +0 -1
- package/es2015/layout-relations/src/directives/showContentOptionsSelection/showContentOptionsSelection.directive.js +0 -32
- package/es2015/layout-relations/src/directives/showContentOptionsSelection/showContentOptionsSelection.directive.js.map +0 -1
- package/es2020/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.component.js +0 -140
- package/es2020/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.component.js.map +0 -1
- package/es2020/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.interface.js +0 -2
- package/es2020/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.interface.js.map +0 -1
- package/es2020/layout-relations/src/directives/showContentOptionsSelection/showContentOptionsSelection.directive.js +0 -29
- package/es2020/layout-relations/src/directives/showContentOptionsSelection/showContentOptionsSelection.directive.js.map +0 -1
- package/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.component.d.ts.map +0 -1
- package/layout-relations/src/components/contentOptionsSelection/contentOptionsSelection.interface.d.ts.map +0 -1
- package/layout-relations/src/directives/showContentOptionsSelection/showContentOptionsSelection.directive.d.ts +0 -14
- package/layout-relations/src/directives/showContentOptionsSelection/showContentOptionsSelection.directive.d.ts.map +0 -1
package/es2015/layout-editor/src/interfaces/propertiesControl/propertiesControl.interface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertiesControl.interface.js","sourceRoot":"","sources":["../../../../../layout-editor/src/interfaces/propertiesControl/propertiesControl.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {OnInit} from '@angular/core';\nimport {FormGroup} from '@angular/forms';\nimport {FormModelGroup} from '@anglr/common/forms';\nimport {Dictionary, PromiseOr} from '@jscrpt/common';\n\nimport {LayoutEditorPropertyMetadata} from '../../misc/types';\nimport {LayoutPropertyTypeData} from '../../decorators';\n\n//TODO: also rework for ngOnInit\n\n/**\n * Defines control that will handle displaying of properties/options of component\n */\nexport interface PropertiesControl<TOptions = any> extends OnInit\n{\n /**\n * Form group representing whole options\n */\n form: FormGroup<FormModelGroup<TOptions>>|undefined;\n\n /**\n * Properties metadata that are being rendered\n */\n propertiesMetadata: Dictionary<LayoutEditorPropertyMetadata&LayoutPropertyTypeData>|null;\n\n /**\n * Initialize component\n */\n initialize(): PromiseOr<void>;\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n invalidateVisuals(): void;\n}"]}
|
|
1
|
+
{"version":3,"file":"propertiesControl.interface.js","sourceRoot":"","sources":["../../../../../layout-editor/src/interfaces/propertiesControl/propertiesControl.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {OnInit} from '@angular/core';\nimport {FormGroup} from '@angular/forms';\nimport {FormModelGroup} from '@anglr/common/forms';\nimport {Dictionary, PromiseOr} from '@jscrpt/common';\n\nimport {LayoutEditorPropertyMetadata} from '../../misc/types';\nimport {LayoutPropertyTypeData} from '../../decorators';\n\n//TODO: also rework for ngOnInit\n//TODO: allow specifying usedProperties, to filter out some properties\n\n/**\n * Defines control that will handle displaying of properties/options of component\n */\nexport interface PropertiesControl<TOptions = any> extends OnInit\n{\n /**\n * Form group representing whole options\n */\n form: FormGroup<FormModelGroup<TOptions>>|undefined;\n\n /**\n * Properties metadata that are being rendered\n */\n propertiesMetadata: Dictionary<LayoutEditorPropertyMetadata&LayoutPropertyTypeData>|null;\n\n /**\n * Initialize component\n */\n initialize(): PromiseOr<void>;\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n invalidateVisuals(): void;\n}"]}
|
|
@@ -23,10 +23,10 @@ export class DefaultGenericPropertiesControlComponent extends PropertiesControlB
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
DefaultGenericPropertiesControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DefaultGenericPropertiesControlComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
-
DefaultGenericPropertiesControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: DefaultGenericPropertiesControlComponent, selector: "default-generic-properties-control", inputs: { properties: "properties" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible"] }, { kind: "directive", type: i3.PropertyTypeControlRendererDirective, selector: "[propertyTypeControl]", inputs: ["control", "propertyTypeControl", "values"] }, { kind: "pipe", type: i4.AsFormControlPipe, name: "asFormControl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
26
|
+
DefaultGenericPropertiesControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: DefaultGenericPropertiesControlComponent, selector: "default-generic-properties-control", inputs: { properties: "properties" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible"] }, { kind: "directive", type: i3.PropertyTypeControlRendererDirective, selector: "[propertyTypeControl]", inputs: ["control", "propertyTypeControl", "values"] }, { kind: "pipe", type: i4.AsFormControlPipe, name: "asFormControl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
27
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DefaultGenericPropertiesControlComponent, decorators: [{
|
|
28
28
|
type: Component,
|
|
29
|
-
args: [{ selector: 'default-generic-properties-control', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>" }]
|
|
29
|
+
args: [{ selector: 'default-generic-properties-control', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>" }]
|
|
30
30
|
}], propDecorators: { properties: [{
|
|
31
31
|
type: Input
|
|
32
32
|
}] } });
|
|
@@ -45,7 +45,7 @@ export function genericPropertiesControlFor(properties) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
GenericPropertiesControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: GenericPropertiesControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
-
GenericPropertiesControl.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: GenericPropertiesControl, isStandalone: true, selector: "generic-properties-control", inputs: { properties: "properties" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible"] }, { kind: "ngmodule", type: PropertyTypeControlsModule }, { kind: "directive", type: i3.PropertyTypeControlRendererDirective, selector: "[propertyTypeControl]", inputs: ["control", "propertyTypeControl", "values"] }, { kind: "ngmodule", type: FormPipesModule }, { kind: "pipe", type: i4.AsFormControlPipe, name: "asFormControl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
|
+
GenericPropertiesControl.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: GenericPropertiesControl, isStandalone: true, selector: "generic-properties-control", inputs: { properties: "properties" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible"] }, { kind: "ngmodule", type: PropertyTypeControlsModule }, { kind: "directive", type: i3.PropertyTypeControlRendererDirective, selector: "[propertyTypeControl]", inputs: ["control", "propertyTypeControl", "values"] }, { kind: "ngmodule", type: FormPipesModule }, { kind: "pipe", type: i4.AsFormControlPipe, name: "asFormControl" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
49
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: GenericPropertiesControl, decorators: [{
|
|
50
50
|
type: Component,
|
|
51
51
|
args: [{ selector: 'generic-properties-control', standalone: true, imports: [
|
|
@@ -53,7 +53,7 @@ export function genericPropertiesControlFor(properties) {
|
|
|
53
53
|
TooltipModule,
|
|
54
54
|
PropertyTypeControlsModule,
|
|
55
55
|
FormPipesModule,
|
|
56
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>" }]
|
|
56
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>" }]
|
|
57
57
|
}], propDecorators: { properties: [{
|
|
58
58
|
type: Input
|
|
59
59
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericPropertiesControl.component.js","sourceRoot":"","sources":["../../../../../../../layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.ts","../../../../../../../layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAO,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAC,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAC,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;;;;;;AAEzE;;GAEG;AAOH,MAAM,OAAO,wCAAyD,SAAQ,qBAA+B;IAN7G;;QAQI,gFAAgF;QAEhF;;WAEG;QAEI,eAAU,GAAa,EAAE,CAAC;KACpC;;qIATY,wCAAwC;yHAAxC,wCAAwC,uIClBrD,
|
|
1
|
+
{"version":3,"file":"genericPropertiesControl.component.js","sourceRoot":"","sources":["../../../../../../../layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.ts","../../../../../../../layout-editor/src/modules/propertiesControls/components/genericPropertiesControl/genericPropertiesControl.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAO,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAC,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAC,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;;;;;;AAEzE;;GAEG;AAOH,MAAM,OAAO,wCAAyD,SAAQ,qBAA+B;IAN7G;;QAQI,gFAAgF;QAEhF;;WAEG;QAEI,eAAU,GAAa,EAAE,CAAC;KACpC;;qIATY,wCAAwC;yHAAxC,wCAAwC,uIClBrD,2qBAMe;2FDYF,wCAAwC;kBANpD,SAAS;+BAEI,oCAAoC,mBAE7B,uBAAuB,CAAC,MAAM;8BAUxC,UAAU;sBADhB,KAAK;;AAIV;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAS,UAA6C;IAE7F,MAcM,wBAAyC,SAAQ,wCAAwC;QAd/F;;YAgBI;;eAEG;YAEa,eAAU,GAAa,UAAU,CAAC;SACrD;;yHAPK,wBAAwB;6GAAxB,wBAAwB,mJCjDlC,2qBAMe,2CDoCH,YAAY,+PACZ,aAAa,yLACb,0BAA0B,6LAC1B,eAAe;+FAIjB,wBAAwB;sBAd7B,SAAS;mCAEI,4BAA4B,cAE1B,IAAI,WAEhB;4BACI,YAAY;4BACZ,aAAa;4BACb,0BAA0B;4BAC1B,eAAe;yBAClB,mBACgB,uBAAuB,CAAC,MAAM;kCAQ/B,UAAU;0BADzB,KAAK;;IAIV,OAAO,wBAAwB,CAAC;CACnC","sourcesContent":["import {ChangeDetectionStrategy, Component, Input, Type} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {TooltipModule} from '@anglr/common';\nimport {FormPipesModule} from '@anglr/common/forms';\n\nimport {PropertiesControl} from '../../../../interfaces';\nimport {PropertiesControlBase} from '../propertiesControlBase';\nimport {PropertyTypeControlsModule} from '../../../propertyTypeControls';\n\n/**\n * Component used for displaying default generic properties control, displaying specified properties\n */\n@Component(\n{\n selector: 'default-generic-properties-control',\n templateUrl: 'genericPropertiesControl.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DefaultGenericPropertiesControlComponent<TOptions = any> extends PropertiesControlBase<TOptions> implements PropertiesControl<TOptions>\n{\n //######################### public properties - inputs #########################\n\n /**\n * Array of properties that should be displayed by this component\n */\n @Input()\n public properties: string[] = [];\n}\n\n/**\n * Gets generic properties control component for specific properties\n * @param properties - Array of properties which will be displayed in generic properties control\n */\nexport function genericPropertiesControlFor<TModel>(properties: (Extract<keyof TModel, string>)[]): Type<PropertiesControl>\n{\n @Component(\n {\n selector: 'generic-properties-control',\n templateUrl: 'genericPropertiesControl.component.html',\n standalone: true,\n imports:\n [\n CommonModule,\n TooltipModule,\n PropertyTypeControlsModule,\n FormPipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n })\n class GenericPropertiesControl<TOptions = any> extends DefaultGenericPropertiesControlComponent implements PropertiesControl<TOptions>\n {\n /**\n * @inheritdoc\n */\n @Input()\n public override properties: string[] = properties;\n }\n\n return GenericPropertiesControl;\n}","<ng-container *ngFor=\"let property of properties\">\n <!-- TODO pipe for control.control -->\n <div class=\"properties-form-group\" *ngIf=\"form?.get(property)\">\n <label class=\"properties-control-label\">{{propertiesMetadata?.[property]?.name ?? property}} <span *ngIf=\"propertiesMetadata?.[property]?.description\" class=\"fas fa-info-circle\" [tooltip]=\"propertiesMetadata?.[property]?.description\"></span></label>\n <ng-container [propertyTypeControl]=\"propertiesMetadata?.[property]?.type\" [control]=\"$any(form?.get(property) | asFormControl)\" [values]=\"propertiesMetadata?.[property]?.values ?? []\"></ng-container>\n </div>\n</ng-container>"]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, Inject } from '@angular/core';
|
|
2
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { DialogRef } from '@angular/cdk/dialog';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
6
|
+
import { FormModelBuilder } from '@anglr/common/forms';
|
|
7
|
+
import { TITLED_DIALOG_DATA } from '@anglr/common/material';
|
|
8
|
+
import { TooltipModule } from '@anglr/common';
|
|
9
|
+
import { GetModelSAPipe, PropertySelectedSAPipe, PropertiesMetadataSAPipe } from '../../pipes';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@angular/cdk/dialog";
|
|
12
|
+
import * as i2 from "@anglr/common/forms";
|
|
13
|
+
import * as i3 from "@angular/common";
|
|
14
|
+
import * as i4 from "@angular/material/dialog";
|
|
15
|
+
import * as i5 from "@angular/forms";
|
|
16
|
+
import * as i6 from "@anglr/common";
|
|
17
|
+
/**
|
|
18
|
+
* Component used for displaying and editation of custom component options
|
|
19
|
+
*/
|
|
20
|
+
export class CustomComponentOptionsSAComponent {
|
|
21
|
+
//######################### constructor #########################
|
|
22
|
+
constructor(data, dialog, formModelBuilder) {
|
|
23
|
+
var _a, _b, _c, _d, _e;
|
|
24
|
+
var _f, _g, _h;
|
|
25
|
+
this.data = data;
|
|
26
|
+
this.dialog = dialog;
|
|
27
|
+
//######################### protected properties - template bindings #########################
|
|
28
|
+
/**
|
|
29
|
+
* Instance of form control that is used for selection of component
|
|
30
|
+
*/
|
|
31
|
+
this.component = new FormControl();
|
|
32
|
+
/**
|
|
33
|
+
* Array of used properties for components and their models
|
|
34
|
+
*/
|
|
35
|
+
this.usedProperties = {};
|
|
36
|
+
/**
|
|
37
|
+
* Array of available properties for components and their models
|
|
38
|
+
*/
|
|
39
|
+
this.availableProperties = {};
|
|
40
|
+
/**
|
|
41
|
+
* Array of content components that are available
|
|
42
|
+
*/
|
|
43
|
+
this.contentComponents = [];
|
|
44
|
+
this.contentComponents = Object.keys(data.customComponentContentMetadata);
|
|
45
|
+
this.nameDescriptionForm = formModelBuilder.build({ displayName: '', description: '', });
|
|
46
|
+
for (const id in this.data.configuration.configurableProperties) {
|
|
47
|
+
const models = this.data.configuration.configurableProperties[id];
|
|
48
|
+
(_a = (_f = this.usedProperties)[id]) !== null && _a !== void 0 ? _a : (_f[id] = {});
|
|
49
|
+
for (const modelName in models) {
|
|
50
|
+
const properties = models[modelName];
|
|
51
|
+
this.usedProperties[id][modelName] = [...properties];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const usedComponents = Object.keys(this.usedProperties);
|
|
55
|
+
this.contentComponents = this.contentComponents.filter(itm => usedComponents.indexOf(itm) < 0);
|
|
56
|
+
for (const id in data.customComponentContentMetadata) {
|
|
57
|
+
const meta = data.customComponentContentMetadata[id];
|
|
58
|
+
if (!((_c = (_b = meta === null || meta === void 0 ? void 0 : meta.editorMetadata.metaInfo) === null || _b === void 0 ? void 0 : _b.optionsMetadata) === null || _c === void 0 ? void 0 : _c.propertiesMetadata)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
for (const propMeta of meta.editorMetadata.metaInfo.optionsMetadata.propertiesMetadata) {
|
|
62
|
+
const model = new propMeta.modelType(undefined);
|
|
63
|
+
if (!Object.keys(model).length) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const modelName = propMeta.modelType.name;
|
|
67
|
+
(_d = (_g = this.availableProperties)[id]) !== null && _d !== void 0 ? _d : (_g[id] = {});
|
|
68
|
+
(_e = (_h = this.availableProperties[id])[modelName]) !== null && _e !== void 0 ? _e : (_h[modelName] = []);
|
|
69
|
+
for (const prop in model) {
|
|
70
|
+
this.availableProperties[id][modelName].push(prop);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//######################### protected methods - template bindings #########################
|
|
76
|
+
/**
|
|
77
|
+
* Adds component from custom component layout
|
|
78
|
+
*/
|
|
79
|
+
addComponent() {
|
|
80
|
+
var _a;
|
|
81
|
+
if (!this.component.value) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.usedProperties[this.component.value] = {};
|
|
85
|
+
const index = this.contentComponents.indexOf(this.component.value);
|
|
86
|
+
if (index >= 0) {
|
|
87
|
+
this.contentComponents.splice(index, 1);
|
|
88
|
+
this.component.setValue((_a = this.contentComponents[0]) !== null && _a !== void 0 ? _a : null);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Removes component options
|
|
93
|
+
* @param id - Id of component that should be removed
|
|
94
|
+
*/
|
|
95
|
+
removeComponent(id) {
|
|
96
|
+
delete this.usedProperties[id];
|
|
97
|
+
this.contentComponents.push(id);
|
|
98
|
+
if (this.contentComponents.length == 1) {
|
|
99
|
+
this.component.setValue(this.contentComponents[0]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Toggle selected property in component in model
|
|
104
|
+
* @param id - Id of component to be edited
|
|
105
|
+
* @param modelName - Name of model to be edited
|
|
106
|
+
* @param propertyName - Name of property to be toggled
|
|
107
|
+
*/
|
|
108
|
+
toggleSelected(id, modelName, propertyName) {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
var _c, _d;
|
|
111
|
+
(_a = (_c = this.usedProperties)[id]) !== null && _a !== void 0 ? _a : (_c[id] = {});
|
|
112
|
+
(_b = (_d = this.usedProperties[id])[modelName]) !== null && _b !== void 0 ? _b : (_d[modelName] = []);
|
|
113
|
+
const index = this.usedProperties[id][modelName].indexOf(propertyName);
|
|
114
|
+
//remove
|
|
115
|
+
if (index >= 0) {
|
|
116
|
+
this.usedProperties[id][modelName].splice(index, 1);
|
|
117
|
+
this.usedProperties[id][modelName] = [...this.usedProperties[id][modelName]];
|
|
118
|
+
}
|
|
119
|
+
//add
|
|
120
|
+
else {
|
|
121
|
+
this.usedProperties[id][modelName] =
|
|
122
|
+
[
|
|
123
|
+
...this.usedProperties[id][modelName],
|
|
124
|
+
propertyName,
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
CustomComponentOptionsSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomComponentOptionsSAComponent, deps: [{ token: TITLED_DIALOG_DATA }, { token: i1.DialogRef }, { token: i2.FormModelBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
130
|
+
CustomComponentOptionsSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: CustomComponentOptionsSAComponent, isStandalone: true, selector: "custom-component-options", providers: [FormModelBuilder], ngImport: i0, template: "<div class=\"dynamic-margin-bottom-small dynamic-flex-row\">\n <div class=\"dynamic-flex-1 dynamic-margin-right-small\">\n <label class=\"dynamic-control-label\">Available content components</label>\n\n <select class=\"dynamic-form-control\" [formControl]=\"component\">\n <option *ngFor=\"let component of contentComponents\" [value]=\"component\">{{data.customComponentContentMetadata[component]?.metadata?.displayName}}</option>\n </select>\n </div>\n\n <a class=\"dynamic-btn-icon dynamic-margin-left-small dynamic-large-text\" (click)=\"addComponent()\">\n <span class=\"fas fa-plus\"></span>\n </a>\n</div>\n\n<div>\n <div *ngFor=\"let component of usedProperties | keyvalue\" class=\"dynamic-margin-bottom-small\">\n <div class=\"dynamic-bold dynamic-flex-row \">\n <span class=\"dynamic-margin-right-small\">{{data.customComponentContentMetadata[component.key]?.metadata?.displayName}}</span>\n \n <a class=\"dynamic-btn-icon\" (click)=\"removeComponent(component.key)\">\n <span class=\"fas fa-times\"></span>\n </a>\n </div>\n \n <ng-container *ngFor=\"let modelProps of availableProperties[component.key] | keyvalue\">\n <div *ngFor=\"let prop of modelProps.value\">\n <label>\n <input type=\"checkbox\" (change)=\"toggleSelected(component.key, modelProps.key, prop)\" [checked]=\"usedProperties | propertySelected: component.key: modelProps.key: prop\">\n <span>{{(modelProps.key | getModel: data.customComponentContentMetadata[component.key] | propertiesMetadata: data.propsMetadataExtractor)?.[prop]?.name ?? prop}}</span>\n <span class=\"fas fa-info-circle dynamic-margin-left-extra-small\" *ngIf=\"(modelProps.key | getModel: data.customComponentContentMetadata[component.key] | propertiesMetadata: data.propsMetadataExtractor)?.[prop]?.description as description\" [tooltip]=\"description\" ></span>\n </label>\n </div>\n </ng-container>\n </div>\n</div>\n\n<div class=\"dynamic-flex-row dynamic-flex-end\">\n <button type=\"button\" class=\"dynamic-btn dynamic-btn-info dynamic-margin-right-extra-small\" [mat-dialog-close]=\"undefined\">\n <span>cancel</span>\n </button>\n\n <button type=\"button\" class=\"dynamic-btn dynamic-btn-primary\" [mat-dialog-close]=\"{configurableProperties: usedProperties, displayName: '', description: ''}\">\n <span>ok</span>\n </button>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.KeyValuePipe, name: "keyvalue" }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i5.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i5.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: PropertySelectedSAPipe, name: "propertySelected" }, { kind: "pipe", type: GetModelSAPipe, name: "getModel" }, { kind: "pipe", type: PropertiesMetadataSAPipe, name: "propertiesMetadata" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "allowHtml", "template", "tooltipOptions", "tooltipVisible"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: CustomComponentOptionsSAComponent, decorators: [{
|
|
132
|
+
type: Component,
|
|
133
|
+
args: [{ selector: 'custom-component-options', standalone: true, imports: [
|
|
134
|
+
CommonModule,
|
|
135
|
+
MatDialogModule,
|
|
136
|
+
ReactiveFormsModule,
|
|
137
|
+
PropertySelectedSAPipe,
|
|
138
|
+
GetModelSAPipe,
|
|
139
|
+
PropertiesMetadataSAPipe,
|
|
140
|
+
TooltipModule,
|
|
141
|
+
], providers: [FormModelBuilder], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dynamic-margin-bottom-small dynamic-flex-row\">\n <div class=\"dynamic-flex-1 dynamic-margin-right-small\">\n <label class=\"dynamic-control-label\">Available content components</label>\n\n <select class=\"dynamic-form-control\" [formControl]=\"component\">\n <option *ngFor=\"let component of contentComponents\" [value]=\"component\">{{data.customComponentContentMetadata[component]?.metadata?.displayName}}</option>\n </select>\n </div>\n\n <a class=\"dynamic-btn-icon dynamic-margin-left-small dynamic-large-text\" (click)=\"addComponent()\">\n <span class=\"fas fa-plus\"></span>\n </a>\n</div>\n\n<div>\n <div *ngFor=\"let component of usedProperties | keyvalue\" class=\"dynamic-margin-bottom-small\">\n <div class=\"dynamic-bold dynamic-flex-row \">\n <span class=\"dynamic-margin-right-small\">{{data.customComponentContentMetadata[component.key]?.metadata?.displayName}}</span>\n \n <a class=\"dynamic-btn-icon\" (click)=\"removeComponent(component.key)\">\n <span class=\"fas fa-times\"></span>\n </a>\n </div>\n \n <ng-container *ngFor=\"let modelProps of availableProperties[component.key] | keyvalue\">\n <div *ngFor=\"let prop of modelProps.value\">\n <label>\n <input type=\"checkbox\" (change)=\"toggleSelected(component.key, modelProps.key, prop)\" [checked]=\"usedProperties | propertySelected: component.key: modelProps.key: prop\">\n <span>{{(modelProps.key | getModel: data.customComponentContentMetadata[component.key] | propertiesMetadata: data.propsMetadataExtractor)?.[prop]?.name ?? prop}}</span>\n <span class=\"fas fa-info-circle dynamic-margin-left-extra-small\" *ngIf=\"(modelProps.key | getModel: data.customComponentContentMetadata[component.key] | propertiesMetadata: data.propsMetadataExtractor)?.[prop]?.description as description\" [tooltip]=\"description\" ></span>\n </label>\n </div>\n </ng-container>\n </div>\n</div>\n\n<div class=\"dynamic-flex-row dynamic-flex-end\">\n <button type=\"button\" class=\"dynamic-btn dynamic-btn-info dynamic-margin-right-extra-small\" [mat-dialog-close]=\"undefined\">\n <span>cancel</span>\n </button>\n\n <button type=\"button\" class=\"dynamic-btn dynamic-btn-primary\" [mat-dialog-close]=\"{configurableProperties: usedProperties, displayName: '', description: ''}\">\n <span>ok</span>\n </button>\n</div>" }]
|
|
142
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
143
|
+
type: Inject,
|
|
144
|
+
args: [TITLED_DIALOG_DATA]
|
|
145
|
+
}] }, { type: i1.DialogRef }, { type: i2.FormModelBuilder }]; } });
|
|
146
|
+
//# sourceMappingURL=customComponentOptions.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customComponentOptions.component.js","sourceRoot":"","sources":["../../../../../layout-relations/src/components/customComponentOptions/customComponentOptions.component.ts","../../../../../layout-relations/src/components/customComponentOptions/customComponentOptions.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,WAAW,EAAa,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,gBAAgB,EAAiB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAC,cAAc,EAAE,sBAAsB,EAAE,wBAAwB,EAAC,MAAM,aAAa,CAAC;;;;;;;;AAG7F;;GAEG;AAmBH,MAAM,OAAO,iCAAiC;IA6B1C,iEAAiE;IACjE,YAAkD,IAAgC,EAC5D,MAAsE,EAChF,gBAAkC;;;QAFI,SAAI,GAAJ,IAAI,CAA4B;QAC5D,WAAM,GAAN,MAAM,CAAgE;QA7B5F,8FAA8F;QAE9F;;WAEG;QACO,cAAS,GAAwB,IAAI,WAAW,EAAE,CAAC;QAO7D;;WAEG;QACO,mBAAc,GAAqC,EAAE,CAAC;QAEhE;;WAEG;QACO,wBAAmB,GAAqC,EAAE,CAAC;QAErE;;WAEG;QACO,sBAAiB,GAAa,EAAE,CAAC;QAOvC,IAAI,CAAC,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nB,sBAAsB,oDACtB,cAAc,4CACd,wBAAwB,0DACxB,aAAa;2FAKR,iCAAiC;kBAlB7C,SAAS;+BAEI,0BAA0B,cAExB,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;wBACf,mBAAmB;wBACnB,sBAAsB;wBACtB,cAAc;wBACd,wBAAwB;wBACxB,aAAa;qBAChB,aACU,CAAC,gBAAgB,CAAC,mBACZ,uBAAuB,CAAC,MAAM;;0BAgClC,MAAM;2BAAC,kBAAkB","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject} from '@angular/core';\nimport {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';\nimport {DialogRef} from '@angular/cdk/dialog';\nimport {CommonModule} from '@angular/common';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {FormModelBuilder, FormModelGroup} from '@anglr/common/forms';\nimport {TITLED_DIALOG_DATA} from '@anglr/common/material';\nimport {TooltipModule} from '@anglr/common';\nimport {Dictionary} from '@jscrpt/common';\n\nimport {CustomComponentOptionsData} from './customComponentOptions.interface';\nimport {GetModelSAPipe, PropertySelectedSAPipe, PropertiesMetadataSAPipe} from '../../pipes';\nimport {CustomComponentConfiguration} from '../../services';\n\n/**\n * Component used for displaying and editation of custom component options\n */\n@Component(\n{\n selector: 'custom-component-options',\n templateUrl: 'customComponentOptions.component.html',\n standalone: true,\n imports:\n [\n CommonModule,\n MatDialogModule,\n ReactiveFormsModule,\n PropertySelectedSAPipe,\n GetModelSAPipe,\n PropertiesMetadataSAPipe,\n TooltipModule,\n ],\n providers: [FormModelBuilder],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CustomComponentOptionsSAComponent<TConfig extends CustomComponentConfiguration = CustomComponentConfiguration>\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Instance of form control that is used for selection of component\n */\n protected component: FormControl<string> = new FormControl();\n\n /**\n * Form for name and description of custom component\n */\n protected nameDescriptionForm: FormGroup<FormModelGroup<CustomComponentConfiguration>>;\n\n /**\n * Array of used properties for components and their models\n */\n protected usedProperties: Dictionary<Dictionary<string[]>> = {};\n\n /**\n * Array of available properties for components and their models\n */\n protected availableProperties: Dictionary<Dictionary<string[]>> = {};\n\n /**\n * Array of content components that are available\n */\n protected contentComponents: string[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(TITLED_DIALOG_DATA) protected data: CustomComponentOptionsData,\n protected dialog: DialogRef<CustomComponentOptionsSAComponent<TConfig>, TConfig>,\n formModelBuilder: FormModelBuilder,)\n {\n this.contentComponents = Object.keys(data.customComponentContentMetadata);\n this.nameDescriptionForm = formModelBuilder.build<CustomComponentConfiguration>({displayName: '', description: '',});\n\n for(const id in this.data.configuration.configurableProperties)\n {\n const models = this.data.configuration.configurableProperties[id];\n\n this.usedProperties[id] ??= {};\n\n for(const modelName in models)\n {\n const properties = models[modelName];\n\n this.usedProperties[id][modelName] = [...properties];\n }\n }\n\n const usedComponents = Object.keys(this.usedProperties);\n this.contentComponents = this.contentComponents.filter(itm => usedComponents.indexOf(itm) < 0);\n\n for(const id in data.customComponentContentMetadata)\n {\n const meta = data.customComponentContentMetadata[id];\n\n if(!meta?.editorMetadata.metaInfo?.optionsMetadata?.propertiesMetadata)\n {\n continue;\n }\n\n for(const propMeta of meta.editorMetadata.metaInfo.optionsMetadata.propertiesMetadata)\n {\n const model = new propMeta.modelType(undefined);\n\n if(!Object.keys(model).length)\n {\n continue;\n }\n\n const modelName = propMeta.modelType.name;\n\n this.availableProperties[id] ??= {};\n this.availableProperties[id][modelName] ??= [];\n\n for(const prop in model)\n {\n this.availableProperties[id][modelName].push(prop);\n }\n }\n }\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Adds component from custom component layout\n */\n protected addComponent(): void\n {\n if(!this.component.value)\n {\n return;\n }\n\n this.usedProperties[this.component.value] = {};\n const index = this.contentComponents.indexOf(this.component.value);\n\n if(index >= 0)\n {\n this.contentComponents.splice(index, 1);\n this.component.setValue(this.contentComponents[0] ?? null);\n }\n }\n\n /**\n * Removes component options\n * @param id - Id of component that should be removed\n */\n protected removeComponent(id: string): void\n {\n delete this.usedProperties[id];\n this.contentComponents.push(id);\n\n if(this.contentComponents.length == 1)\n {\n this.component.setValue(this.contentComponents[0]);\n }\n }\n\n /**\n * Toggle selected property in component in model\n * @param id - Id of component to be edited\n * @param modelName - Name of model to be edited\n * @param propertyName - Name of property to be toggled\n */\n protected toggleSelected(id: string, modelName: string, propertyName: string): void\n {\n this.usedProperties[id] ??= {};\n this.usedProperties[id][modelName] ??= [];\n\n const index = this.usedProperties[id][modelName].indexOf(propertyName);\n\n //remove\n if(index >= 0)\n {\n this.usedProperties[id][modelName].splice(index, 1);\n this.usedProperties[id][modelName] = [...this.usedProperties[id][modelName]];\n }\n //add\n else\n {\n this.usedProperties[id][modelName] =\n [\n ...this.usedProperties[id][modelName],\n propertyName,\n ];\n }\n }\n}","<div class=\"dynamic-margin-bottom-small dynamic-flex-row\">\n <div class=\"dynamic-flex-1 dynamic-margin-right-small\">\n <label class=\"dynamic-control-label\">Available content components</label>\n\n <select class=\"dynamic-form-control\" [formControl]=\"component\">\n <option *ngFor=\"let component of contentComponents\" [value]=\"component\">{{data.customComponentContentMetadata[component]?.metadata?.displayName}}</option>\n </select>\n </div>\n\n <a class=\"dynamic-btn-icon dynamic-margin-left-small dynamic-large-text\" (click)=\"addComponent()\">\n <span class=\"fas fa-plus\"></span>\n </a>\n</div>\n\n<div>\n <div *ngFor=\"let component of usedProperties | keyvalue\" class=\"dynamic-margin-bottom-small\">\n <div class=\"dynamic-bold dynamic-flex-row \">\n <span class=\"dynamic-margin-right-small\">{{data.customComponentContentMetadata[component.key]?.metadata?.displayName}}</span>\n \n <a class=\"dynamic-btn-icon\" (click)=\"removeComponent(component.key)\">\n <span class=\"fas fa-times\"></span>\n </a>\n </div>\n \n <ng-container *ngFor=\"let modelProps of availableProperties[component.key] | keyvalue\">\n <div *ngFor=\"let prop of modelProps.value\">\n <label>\n <input type=\"checkbox\" (change)=\"toggleSelected(component.key, modelProps.key, prop)\" [checked]=\"usedProperties | propertySelected: component.key: modelProps.key: prop\">\n <span>{{(modelProps.key | getModel: data.customComponentContentMetadata[component.key] | propertiesMetadata: data.propsMetadataExtractor)?.[prop]?.name ?? prop}}</span>\n <span class=\"fas fa-info-circle dynamic-margin-left-extra-small\" *ngIf=\"(modelProps.key | getModel: data.customComponentContentMetadata[component.key] | propertiesMetadata: data.propsMetadataExtractor)?.[prop]?.description as description\" [tooltip]=\"description\" ></span>\n </label>\n </div>\n </ng-container>\n </div>\n</div>\n\n<div class=\"dynamic-flex-row dynamic-flex-end\">\n <button type=\"button\" class=\"dynamic-btn dynamic-btn-info dynamic-margin-right-extra-small\" [mat-dialog-close]=\"undefined\">\n <span>cancel</span>\n </button>\n\n <button type=\"button\" class=\"dynamic-btn dynamic-btn-primary\" [mat-dialog-close]=\"{configurableProperties: usedProperties, displayName: '', description: ''}\">\n <span>ok</span>\n </button>\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customComponentOptions.interface.js","sourceRoot":"","sources":["../../../../../layout-relations/src/components/customComponentOptions/customComponentOptions.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {LayoutEditorMetadataDescriptor, LayoutEditorPropertyMetadataExtractor} from '@anglr/dynamic/layout-editor';\nimport {Dictionary} from '@jscrpt/common';\n\nimport {CustomComponentConfiguration} from '../../services';\n\n/**\n * Data that are stored for content component\n */\nexport interface ContentComponentData\n{\n /**\n * Metadata of component\n */\n metadata: LayoutComponentMetadata;\n\n /**\n * Editor metadata of component\n */\n editorMetadata: LayoutEditorMetadataDescriptor;\n}\n\n/**\n * Data that are passed to custom component options dialog\n */\nexport interface CustomComponentOptionsData<TConfig extends CustomComponentConfiguration = CustomComponentConfiguration>\n{\n /**\n * Metadata for each component in custom component\n */\n customComponentContentMetadata: Dictionary<ContentComponentData|undefined|null>;\n\n /**\n * Current value of configuration\n */\n configuration: TConfig;\n\n /**\n * Instance of property metadata extractor for models\n */\n propsMetadataExtractor: LayoutEditorPropertyMetadataExtractor;\n}"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './configureNodeEndpoint/configureNodeEndpoint.component';
|
|
2
2
|
export * from './configureNodeEndpoint/configureNodeEndpoint.model';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
3
|
+
export * from './customComponentOptions/customComponentOptions.component';
|
|
4
|
+
export * from './customComponentOptions/customComponentOptions.interface';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../layout-relations/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,qDAAqD,CAAC;AACpE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../layout-relations/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,2DAA2D,CAAC","sourcesContent":["export * from './configureNodeEndpoint/configureNodeEndpoint.component';\nexport * from './configureNodeEndpoint/configureNodeEndpoint.model';\nexport * from './customComponentOptions/customComponentOptions.component';\nexport * from './customComponentOptions/customComponentOptions.interface';\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './showCustomComponentOptions/showCustomComponentOptions.directive';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../layout-relations/src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../layout-relations/src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,mEAAmE,CAAC","sourcesContent":["export * from './showCustomComponentOptions/showCustomComponentOptions.directive';\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Directive, HostListener, Injector, Input } from '@angular/core';
|
|
3
|
+
import { TitledDialogService } from '@anglr/common/material';
|
|
4
|
+
import { LayoutEditorPropertyMetadataExtractor } from '@anglr/dynamic/layout-editor';
|
|
5
|
+
import { lastValueFrom } from '@jscrpt/common/rxjs';
|
|
6
|
+
import { CustomComponentOptionsSAComponent } from '../../components';
|
|
7
|
+
import { getCustomComponentMeta } from '../../misc/utils';
|
|
8
|
+
import { CustomComponentsRegister } from '../../services';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "@anglr/common/material";
|
|
11
|
+
import * as i2 from "../../services";
|
|
12
|
+
import * as i3 from "@anglr/dynamic/layout-editor";
|
|
13
|
+
/**
|
|
14
|
+
* Directive that is used for displaying custom component options
|
|
15
|
+
*/
|
|
16
|
+
export class ShowCustomComponentOptionsSADirective {
|
|
17
|
+
//######################### constructor #########################
|
|
18
|
+
constructor(injector, dialogSvc, customComponentsRegister, propsMetadataExtractor) {
|
|
19
|
+
this.injector = injector;
|
|
20
|
+
this.dialogSvc = dialogSvc;
|
|
21
|
+
this.customComponentsRegister = customComponentsRegister;
|
|
22
|
+
this.propsMetadataExtractor = propsMetadataExtractor;
|
|
23
|
+
//######################### protected properties #########################
|
|
24
|
+
/**
|
|
25
|
+
* Metadata for each component in custom component
|
|
26
|
+
*/
|
|
27
|
+
this.customComponentContentMetadata = {};
|
|
28
|
+
}
|
|
29
|
+
//######################### public methods - implementation of OnChanges #########################
|
|
30
|
+
/**
|
|
31
|
+
* Called when input value changes
|
|
32
|
+
*/
|
|
33
|
+
ngOnChanges() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (!this.name) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const result = (yield getCustomComponentMeta(this.name, this.injector));
|
|
39
|
+
if (!result) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.customComponentContentMetadata = result.contentMetadata;
|
|
43
|
+
this.customComponentMetadata = result.metadata;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//######################### public methods - implementation of OnInit #########################
|
|
47
|
+
/**
|
|
48
|
+
* Initialize component
|
|
49
|
+
*/
|
|
50
|
+
ngOnInit() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
if (!this.name) {
|
|
53
|
+
throw new Error('Please provide name of custom component for its options');
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//######################### protected methods - host #########################
|
|
58
|
+
/**
|
|
59
|
+
* Shows content options selection dialog
|
|
60
|
+
* @param event - Event that occured
|
|
61
|
+
*/
|
|
62
|
+
show(event) {
|
|
63
|
+
var _a, _b, _c;
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
const result = yield lastValueFrom(this.dialogSvc.open(CustomComponentOptionsSAComponent, {
|
|
68
|
+
title: 'custom component options',
|
|
69
|
+
width: '75vw',
|
|
70
|
+
data: {
|
|
71
|
+
customComponentContentMetadata: this.customComponentContentMetadata,
|
|
72
|
+
configuration: (_b = this.customComponentsRegister.getConfigurationForComponent((_a = this.name) !== null && _a !== void 0 ? _a : '')) !== null && _b !== void 0 ? _b : {},
|
|
73
|
+
propsMetadataExtractor: this.propsMetadataExtractor,
|
|
74
|
+
}
|
|
75
|
+
}).afterClosed());
|
|
76
|
+
if (result) {
|
|
77
|
+
yield this.customComponentsRegister.setConfigurationForComponent((_c = this.name) !== null && _c !== void 0 ? _c : '', result);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
ShowCustomComponentOptionsSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ShowCustomComponentOptionsSADirective, deps: [{ token: i0.Injector }, { token: i1.TitledDialogService }, { token: i2.CustomComponentsRegister }, { token: i3.LayoutEditorPropertyMetadataExtractor }], target: i0.ɵɵFactoryTarget.Directive });
|
|
83
|
+
ShowCustomComponentOptionsSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: ShowCustomComponentOptionsSADirective, isStandalone: true, selector: "[showCustomComponentOptions]", inputs: { name: ["showCustomComponentOptions", "name"] }, host: { listeners: { "click": "show($event)" } }, usesOnChanges: true, ngImport: i0 });
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ShowCustomComponentOptionsSADirective, decorators: [{
|
|
85
|
+
type: Directive,
|
|
86
|
+
args: [{
|
|
87
|
+
selector: '[showCustomComponentOptions]',
|
|
88
|
+
standalone: true,
|
|
89
|
+
}]
|
|
90
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.TitledDialogService }, { type: i2.CustomComponentsRegister }, { type: i3.LayoutEditorPropertyMetadataExtractor }]; }, propDecorators: { name: [{
|
|
91
|
+
type: Input,
|
|
92
|
+
args: ['showCustomComponentOptions']
|
|
93
|
+
}], show: [{
|
|
94
|
+
type: HostListener,
|
|
95
|
+
args: ['click', ['$event']]
|
|
96
|
+
}] } });
|
|
97
|
+
//# sourceMappingURL=showCustomComponentOptions.directive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showCustomComponentOptions.directive.js","sourceRoot":"","sources":["../../../../../layout-relations/src/directives/showCustomComponentOptions/showCustomComponentOptions.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAoB,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAC,qCAAqC,EAAC,MAAM,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Ae,EAAE,CAAC;YAExB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAwF,iCAAiC,EAC/K;gBACI,KAAK,EAAE,0BAA0B;gBACjC,KAAK,EAAE,MAAM;gBACb,IAAI,EACJ;oBACI,8BAA8B,EAAE,IAAI,CAAC,8BAA8B;oBACnE,aAAa,EAAE,MAAA,IAAI,CAAC,wBAAwB,CAAC,4BAA4B,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,mCAAI,EAAE;oBAChG,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;iBACtD;aACJ,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YAElB,IAAG,MAAM,EACT;gBACI,MAAM,IAAI,CAAC,wBAAwB,CAAC,4BAA4B,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,EAAE,MAAM,CAAC,CAAC;aAC7F;;KACJ;;kIA9FQ,qCAAqC;sHAArC,qCAAqC;2FAArC,qCAAqC;kBALjD,SAAS;mBACV;oBACI,QAAQ,EAAE,8BAA8B;oBACxC,UAAU,EAAE,IAAI;iBACnB;4NAqBU,IAAI;sBADV,KAAK;uBAAC,4BAA4B;gBAsDnB,IAAI;sBADnB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {Directive, HostListener, Injector, Input, OnChanges, OnInit} from '@angular/core';\nimport {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {TitledDialogService} from '@anglr/common/material';\nimport {LayoutEditorPropertyMetadataExtractor} from '@anglr/dynamic/layout-editor';\nimport {lastValueFrom} from '@jscrpt/common/rxjs';\nimport {Dictionary} from '@jscrpt/common';\n\nimport {ContentComponentData, CustomComponentOptionsData, CustomComponentOptionsSAComponent} from '../../components';\nimport {getCustomComponentMeta} from '../../misc/utils';\nimport {CustomComponentConfiguration, CustomComponentsRegister} from '../../services';\n\n/**\n * Directive that is used for displaying custom component options\n */\n@Directive(\n{\n selector: '[showCustomComponentOptions]',\n standalone: true,\n})\nexport class ShowCustomComponentOptionsSADirective<TConfig extends CustomComponentConfiguration = CustomComponentConfiguration> implements OnInit, OnChanges\n{\n //######################### protected properties #########################\n\n /**\n * Metadata for each component in custom component\n */\n protected customComponentContentMetadata: Dictionary<ContentComponentData|undefined|null> = {};\n\n /**\n * Custom component layout metadata\n */\n protected customComponentMetadata: LayoutComponentMetadata|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Name of custom component which will be edited\n */\n @Input('showCustomComponentOptions')\n public name: string|undefined|null;\n\n //######################### constructor #########################\n constructor(protected injector: Injector,\n protected dialogSvc: TitledDialogService,\n protected customComponentsRegister: CustomComponentsRegister<TConfig>,\n protected propsMetadataExtractor: LayoutEditorPropertyMetadataExtractor,)\n {\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public async ngOnChanges(): Promise<void>\n {\n if(!this.name)\n {\n return;\n }\n\n const result = (await getCustomComponentMeta(this.name, this.injector));\n\n if(!result)\n {\n return;\n }\n\n this.customComponentContentMetadata = result.contentMetadata;\n this.customComponentMetadata = result.metadata;\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(!this.name)\n {\n throw new Error('Please provide name of custom component for its options');\n }\n }\n \n //######################### protected methods - host #########################\n\n /**\n * Shows content options selection dialog\n * @param event - Event that occured\n */\n @HostListener('click', ['$event'])\n protected async show(event: MouseEvent): Promise<void>\n {\n event.preventDefault();\n event.stopPropagation();\n \n const result = await lastValueFrom(this.dialogSvc.open<CustomComponentOptionsSAComponent, CustomComponentOptionsData, TConfig|undefined|null>(CustomComponentOptionsSAComponent,\n {\n title: 'custom component options',\n width: '75vw',\n data:\n {\n customComponentContentMetadata: this.customComponentContentMetadata,\n configuration: this.customComponentsRegister.getConfigurationForComponent(this.name ?? '') ?? {},\n propsMetadataExtractor: this.propsMetadataExtractor,\n }\n }).afterClosed());\n\n if(result)\n {\n await this.customComponentsRegister.setConfigurationForComponent(this.name ?? '', result);\n }\n }\n}"]}
|
package/es2015/layout-relations/src/dynamicItems/customComponent/customComponent.options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customComponent.options.js","sourceRoot":"","sources":["../../../../../layout-relations/src/dynamicItems/customComponent/customComponent.options.ts"],"names":[],"mappings":"","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {Dictionary} from '@jscrpt/common';\n\n/**\n * Options for custom component component\n */\nexport interface CustomComponentComponentOptions\n{\n /**\n * Name of custom component, used for obtaining metadata\n */\n name: string;\n\n /**\n * Represents layout metadata for all placeholders used within custom component\n */\n placeholderContainers: Dictionary<LayoutComponentMetadata>|undefined|null;\n\n /**\n * Static options for content components\n */\n contentOptions: Dictionary<unknown>;\n
|
|
1
|
+
{"version":3,"file":"customComponent.options.js","sourceRoot":"","sources":["../../../../../layout-relations/src/dynamicItems/customComponent/customComponent.options.ts"],"names":[],"mappings":"","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {Dictionary} from '@jscrpt/common';\n\n/**\n * Options for custom component component\n */\nexport interface CustomComponentComponentOptions\n{\n /**\n * Name of custom component, used for obtaining metadata\n */\n name: string;\n\n /**\n * Represents layout metadata for all placeholders used within custom component\n */\n placeholderContainers: Dictionary<LayoutComponentMetadata>|undefined|null;\n\n /**\n * Static options for content components\n */\n contentOptions: Dictionary<unknown>;\n}\n\n/**\n * Options for custom component relations\n */\nexport interface CustomComponentRelationsOptions\n{\n /**\n * Name of custom component, used for obtaining metadata\n */\n name: string;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customComponent.model.js","sourceRoot":"","sources":["../../../../../../layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAI3D;;GAEG;AACH,MAAM,OAAO,oBAAoB;
|
|
1
|
+
{"version":3,"file":"customComponent.model.js","sourceRoot":"","sources":["../../../../../../layout-relations/src/dynamicItems/customComponent/metadata/customComponent.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAI3D;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAmB7B,iEAAiE;IACjE,YAAY,KAAqD;QAlBjE,uEAAuE;QAEvE;;WAEG;QACI,SAAI,GAAW,EAAE,CAAC;QAOzB;;WAEG;QACI,mBAAc,GAAwB,EAAE,CAAC;QAK5C,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {Dictionary, mapValuesToThis} from '@jscrpt/common';\n\nimport {CustomComponentComponentOptions} from '../customComponent.options';\n\n/**\n * Custom component model for properties editor\n */\nexport class CustomComponentModel implements CustomComponentComponentOptions\n{\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public name: string = '';\n\n /**\n * @inheritdoc\n */\n public placeholderContainers: Dictionary<LayoutComponentMetadata>|undefined|null;\n\n /**\n * @inheritdoc\n */\n public contentOptions: Dictionary<unknown> = {};\n\n //######################### constructor #########################\n constructor(value: CustomComponentComponentOptions|undefined|null)\n {\n mapValuesToThis.bind(this)(value);\n }\n}"]}
|