@cuby-ui/core 0.0.611 → 0.0.613
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.
|
@@ -12041,86 +12041,136 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
12041
12041
|
|
|
12042
12042
|
const UTILITY_MODAL_SERVICE_TOKEN = new InjectionToken('UTILITY_MODAL_SERVICE_TOKEN');
|
|
12043
12043
|
|
|
12044
|
-
class
|
|
12044
|
+
class CuiCriterionInfoComponent {
|
|
12045
12045
|
constructor() {
|
|
12046
|
-
this.
|
|
12047
|
-
this.
|
|
12048
|
-
this.
|
|
12049
|
-
this.
|
|
12050
|
-
this.
|
|
12051
|
-
this.
|
|
12052
|
-
this.
|
|
12053
|
-
this.
|
|
12046
|
+
this.destroyRef = inject(DestroyRef);
|
|
12047
|
+
this.translocoService = inject(TranslocoService);
|
|
12048
|
+
this.cuiIdService = inject(CuiIdService);
|
|
12049
|
+
this.cuiCategoriesModalService = inject(CuiSelectedCategoryService);
|
|
12050
|
+
this.treeStructNavigatorApiService = inject(CuiTreeStructNavigatorApiService);
|
|
12051
|
+
this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
|
|
12052
|
+
this.TYPE = "INSTRUCTION_STORAGE" /* TreeStructType.Instruction */;
|
|
12053
|
+
this.skipCategoryChange = false;
|
|
12054
|
+
this.categoryId = this.cuiIdService.generate();
|
|
12055
|
+
this.category = this.cuiCategoriesModalService.category;
|
|
12054
12056
|
this.isFormValid = signal(false);
|
|
12055
|
-
this.
|
|
12056
|
-
this.
|
|
12057
|
+
this.prevCategoryId = signal(null);
|
|
12058
|
+
this.editorConfig = signal(null);
|
|
12059
|
+
this.labelColor = computed(() => this.category()?.title ? 'var(--cui-base-900)' : 'var(--cui-base-400)');
|
|
12060
|
+
this.selectTitle = computed(() => this.category()?.title || this.translocoService.translate('SELECT') + '...');
|
|
12061
|
+
this.element = viewChild('scrollContent');
|
|
12062
|
+
this.criterion = model();
|
|
12063
|
+
this.config = input.required();
|
|
12064
|
+
this.validationChanged = output();
|
|
12065
|
+
this.criterionCreated = output();
|
|
12066
|
+
this.initConfigEffect();
|
|
12067
|
+
this.initCategoryEffect();
|
|
12057
12068
|
}
|
|
12058
12069
|
ngOnInit() {
|
|
12059
|
-
this.
|
|
12070
|
+
this.initCategory();
|
|
12060
12071
|
}
|
|
12061
|
-
|
|
12062
|
-
|
|
12072
|
+
onFormChanged(values, criterionId) {
|
|
12073
|
+
const actions = {
|
|
12074
|
+
title: (title) => this.changeTitle(title, criterionId),
|
|
12075
|
+
description: (description) => this.changeDescription(description, criterionId)
|
|
12076
|
+
};
|
|
12077
|
+
forkJoin(Object.keys(values).map((key) => actions[key](values[key] || '')))
|
|
12078
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12079
|
+
.subscribe();
|
|
12063
12080
|
}
|
|
12064
|
-
|
|
12065
|
-
this.
|
|
12081
|
+
onFormValidationChanged(isValid) {
|
|
12082
|
+
this.isFormValid.set(isValid);
|
|
12083
|
+
this.validationChanged.emit(isValid);
|
|
12066
12084
|
}
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12085
|
+
initCategoryEffect() {
|
|
12086
|
+
effect(() => {
|
|
12087
|
+
const category = this.category();
|
|
12088
|
+
const storageObjectCriterion = untracked(this.criterion);
|
|
12089
|
+
if (!category || this.skipCategoryChange) {
|
|
12090
|
+
this.skipCategoryChange = false;
|
|
12091
|
+
return;
|
|
12092
|
+
}
|
|
12093
|
+
if (storageObjectCriterion) {
|
|
12094
|
+
this.changeCategory(category.id, storageObjectCriterion.id);
|
|
12095
|
+
return;
|
|
12096
|
+
}
|
|
12097
|
+
this.createCriterion(category.id);
|
|
12098
|
+
});
|
|
12071
12099
|
}
|
|
12072
|
-
|
|
12073
|
-
|
|
12100
|
+
initConfigEffect() {
|
|
12101
|
+
effect(() => {
|
|
12102
|
+
const element = this.element()?.nativeElement;
|
|
12103
|
+
if (!element) {
|
|
12104
|
+
return;
|
|
12105
|
+
}
|
|
12106
|
+
this.editorConfig.set({ ...this.config(), element });
|
|
12107
|
+
});
|
|
12074
12108
|
}
|
|
12075
|
-
|
|
12076
|
-
const
|
|
12077
|
-
if (!
|
|
12109
|
+
initCategory() {
|
|
12110
|
+
const storageObjectId = this.criterion()?.id;
|
|
12111
|
+
if (!storageObjectId) {
|
|
12078
12112
|
return;
|
|
12079
12113
|
}
|
|
12080
|
-
this.
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
}] });
|
|
12089
|
-
|
|
12090
|
-
class CuiCriterionModalCreateComponent {
|
|
12091
|
-
constructor() {
|
|
12092
|
-
this.destroyRef = inject(DestroyRef);
|
|
12093
|
-
this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
|
|
12094
|
-
this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
|
|
12095
|
-
this.isCreated = false;
|
|
12096
|
-
this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
|
|
12097
|
-
this.tools = this.cuiDialogContext.data.tools;
|
|
12098
|
-
this.header = this.cuiDialogContext.data.header;
|
|
12099
|
-
this._criterion = computed(() => signal(this.initialUtility()));
|
|
12100
|
-
this.isFormValid = signal(false);
|
|
12101
|
-
this.criterion = computed(() => this._criterion()());
|
|
12102
|
-
this.initialUtility = input.required();
|
|
12103
|
-
this.config = input.required();
|
|
12114
|
+
this.treeStructNavigatorApiService
|
|
12115
|
+
.getCategory(storageObjectId, "CRITERION_STORAGE" /* TreeStructType.Criteria */, this.config().requestOptions)
|
|
12116
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12117
|
+
.subscribe((category) => {
|
|
12118
|
+
this.skipCategoryChange = true;
|
|
12119
|
+
this.prevCategoryId.set(category.id);
|
|
12120
|
+
this.cuiCategoriesModalService.setCurrentCategory(category);
|
|
12121
|
+
});
|
|
12104
12122
|
}
|
|
12105
|
-
|
|
12106
|
-
|
|
12123
|
+
changeCategory(categoryId, targetId) {
|
|
12124
|
+
const prevCategoryId = untracked(this.prevCategoryId);
|
|
12125
|
+
if (!prevCategoryId) {
|
|
12107
12126
|
return;
|
|
12108
12127
|
}
|
|
12109
|
-
this.
|
|
12110
|
-
|
|
12111
|
-
.
|
|
12112
|
-
.
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12128
|
+
this.subscription?.unsubscribe();
|
|
12129
|
+
this.subscription = this.treeStructNavigatorApiService
|
|
12130
|
+
.moveElement({
|
|
12131
|
+
type: "MOVING_TARGET_TREE_STRUCT" /* MovingType.TARGET_TREE_STRUCT */,
|
|
12132
|
+
movableItemId: targetId,
|
|
12133
|
+
treeStructTargetItemId: categoryId,
|
|
12134
|
+
treeStructMovableItemId: prevCategoryId
|
|
12135
|
+
}, this.config().requestOptions)
|
|
12136
|
+
.subscribe(() => this.prevCategoryId.set(categoryId));
|
|
12116
12137
|
}
|
|
12117
|
-
|
|
12118
|
-
|
|
12138
|
+
createCriterion(categoryId) {
|
|
12139
|
+
this.criterionCreated.emit(categoryId);
|
|
12140
|
+
this.prevCategoryId.set(categoryId);
|
|
12141
|
+
}
|
|
12142
|
+
changeTitle(value, criterionId) {
|
|
12143
|
+
return this.criterionApiService.changeTitle(criterionId, value, this.config().requestOptions).pipe(finalize(() => this.criterion.update((prev) => ({
|
|
12144
|
+
...prev,
|
|
12145
|
+
storageElement: { ...prev.storageElement, title: value }
|
|
12146
|
+
}))));
|
|
12147
|
+
}
|
|
12148
|
+
changeDescription(value, criterionId) {
|
|
12149
|
+
if (!this.criterionApiService.changeDescription) {
|
|
12150
|
+
throw new Error('Change description not implemented');
|
|
12151
|
+
}
|
|
12152
|
+
return this.criterionApiService.changeDescription(criterionId, value, this.config().requestOptions).pipe(finalize(() => this.criterion.update((prev) => ({
|
|
12153
|
+
...prev,
|
|
12154
|
+
storageElement: { ...prev.storageElement, shortDescription: value }
|
|
12155
|
+
}))));
|
|
12156
|
+
}
|
|
12157
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12158
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiCriterionInfoComponent, isStandalone: true, selector: "cui-criterion-info", inputs: { criterion: { classPropertyName: "criterion", publicName: "criterion", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { criterion: "criterionChange", validationChanged: "validationChanged", criterionCreated: "criterionCreated" }, providers: [CuiSelectedCategoryService], viewQueries: [{ propertyName: "element", first: true, predicate: ["scrollContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <div\n #scrollContent\n class=\"content content_scrollable\"\n >\n <div class=\"category\">\n <cui-form-field>\n <label\n cuiLabel\n [for]=\"categoryId\"\n [isRequired]=\"true\"\n >\n {{ t('SELECT_CATEGORY') }}\n </label>\n <cui-categories\n [buttonId]=\"categoryId\"\n [treeStructType]=\"TYPE\"\n >\n <div class=\"select\">\n <span [style.color]=\"labelColor()\">\n {{ selectTitle() }}\n </span>\n\n <cui-svg icon=\"cuiIconChevronDown\" />\n </div>\n </cui-categories>\n </cui-form-field>\n </div>\n\n @let criterionData = criterion();\n @let editorConfigData = editorConfig();\n\n @if (editorConfigData && criterionData) {\n <cui-criterion-info-form\n [config]=\"editorConfigData\"\n [title]=\"criterionData.storageElement.title\"\n [description]=\"criterionData.storageElement.shortDescription\"\n [framerId]=\"criterionData.storageElement.framerCriterionId\"\n class=\"utility\"\n (isFormValidChanged)=\"onFormValidationChanged($event)\"\n (formChanged)=\"onFormChanged($event, criterionData.id)\"\n />\n }\n </div>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;height:100%}.content{height:calc(100vh - 109px)}.content_scrollable{overflow:auto}.category{padding-top:16px;padding-right:23px;padding-left:23px}.select{padding:7px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;height:36px;border-radius:8px;border:1px solid var(--cui-base-200);color:var(--cui-base-900);background:var(--cui-input)}.utility{--editor-height: none}\n"], dependencies: [{ kind: "ngmodule", type: CuiBadgeModule }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiCategoriesComponent, selector: "cui-categories", inputs: ["treeStructType", "buttonId", "disabled", "context"] }, { kind: "ngmodule", type: CuiDialogModule }, { kind: "ngmodule", type: CuiFormFieldModule }, { kind: "component", type: CuiFormFieldComponent, selector: "cui-form-field" }, { kind: "component", type: CuiCriterionInfoFormComponent, selector: "cui-criterion-info-form", inputs: ["title", "description", "framerId", "config"], outputs: ["formChanged", "isFormValidChanged"] }, { kind: "ngmodule", type: CuiLabelModule }, { kind: "component", type: CuiLabelComponent, selector: "label[cuiLabel]", inputs: ["isRequired"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i4.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12119
12159
|
}
|
|
12120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
12160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, decorators: [{
|
|
12121
12161
|
type: Component,
|
|
12122
|
-
args: [{
|
|
12123
|
-
|
|
12162
|
+
args: [{ selector: 'cui-criterion-info', imports: [
|
|
12163
|
+
CuiBadgeModule,
|
|
12164
|
+
CuiButtonModule,
|
|
12165
|
+
CuiCategoriesComponent,
|
|
12166
|
+
CuiDialogModule,
|
|
12167
|
+
CuiFormFieldModule,
|
|
12168
|
+
CuiCriterionInfoFormComponent,
|
|
12169
|
+
CuiLabelModule,
|
|
12170
|
+
CuiSvgModule,
|
|
12171
|
+
TranslocoModule
|
|
12172
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiSelectedCategoryService], template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <div\n #scrollContent\n class=\"content content_scrollable\"\n >\n <div class=\"category\">\n <cui-form-field>\n <label\n cuiLabel\n [for]=\"categoryId\"\n [isRequired]=\"true\"\n >\n {{ t('SELECT_CATEGORY') }}\n </label>\n <cui-categories\n [buttonId]=\"categoryId\"\n [treeStructType]=\"TYPE\"\n >\n <div class=\"select\">\n <span [style.color]=\"labelColor()\">\n {{ selectTitle() }}\n </span>\n\n <cui-svg icon=\"cuiIconChevronDown\" />\n </div>\n </cui-categories>\n </cui-form-field>\n </div>\n\n @let criterionData = criterion();\n @let editorConfigData = editorConfig();\n\n @if (editorConfigData && criterionData) {\n <cui-criterion-info-form\n [config]=\"editorConfigData\"\n [title]=\"criterionData.storageElement.title\"\n [description]=\"criterionData.storageElement.shortDescription\"\n [framerId]=\"criterionData.storageElement.framerCriterionId\"\n class=\"utility\"\n (isFormValidChanged)=\"onFormValidationChanged($event)\"\n (formChanged)=\"onFormChanged($event, criterionData.id)\"\n />\n }\n </div>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;height:100%}.content{height:calc(100vh - 109px)}.content_scrollable{overflow:auto}.category{padding-top:16px;padding-right:23px;padding-left:23px}.select{padding:7px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;height:36px;border-radius:8px;border:1px solid var(--cui-base-200);color:var(--cui-base-900);background:var(--cui-input)}.utility{--editor-height: none}\n"] }]
|
|
12173
|
+
}], ctorParameters: () => [] });
|
|
12124
12174
|
|
|
12125
12175
|
class CuiInstructionInfoFormComponent {
|
|
12126
12176
|
get controls() {
|
|
@@ -12393,51 +12443,308 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
12393
12443
|
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiSelectedCategoryService], template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <div\n #scrollContent\n class=\"content content_scrollable\"\n >\n <div class=\"category\">\n <cui-form-field>\n <label\n cuiLabel\n [for]=\"categoryId\"\n [isRequired]=\"true\"\n >\n {{ t('SELECT_CATEGORY') }}\n </label>\n <cui-categories\n [buttonId]=\"categoryId\"\n [treeStructType]=\"TYPE\"\n >\n <div class=\"select\">\n <span [style.color]=\"labelColor()\">\n {{ selectTitle() }}\n </span>\n\n <cui-svg icon=\"cuiIconChevronDown\" />\n </div>\n </cui-categories>\n </cui-form-field>\n </div>\n\n @let instructionData = instruction();\n @let editorConfigData = editorConfig();\n\n @if (editorConfigData && instructionData) {\n <cui-instruction-info-form\n [config]=\"editorConfigData\"\n [title]=\"instructionData.storageElement.title\"\n [description]=\"instructionData.storageElement.shortDescription\"\n [framerId]=\"instructionData.storageElement.framerInstructionId\"\n class=\"utility\"\n (isFormValidChanged)=\"onFormValidationChanged($event)\"\n (formChanged)=\"onFormChanged($event, instructionData.id)\"\n />\n }\n </div>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;height:100%}.content{height:calc(100vh - 109px)}.content_scrollable{overflow:auto}.category{padding-top:16px;padding-right:23px;padding-left:23px}.select{padding:7px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;height:36px;border-radius:8px;border:1px solid var(--cui-base-200);color:var(--cui-base-900);background:var(--cui-input)}.utility{--editor-height: none}\n"] }]
|
|
12394
12444
|
}], ctorParameters: () => [] });
|
|
12395
12445
|
|
|
12396
|
-
class
|
|
12446
|
+
class CuiSelectModalFolderComponent {
|
|
12447
|
+
constructor() {
|
|
12448
|
+
this.icon = computed(() => (this.isOpen() ? 'cuiIconFolderOpen' : 'cuiIconFolder'));
|
|
12449
|
+
this.title = input.required();
|
|
12450
|
+
this.buttonSlot = input.required();
|
|
12451
|
+
this.isOpen = input(false);
|
|
12452
|
+
}
|
|
12453
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12454
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiSelectModalFolderComponent, isStandalone: true, selector: "cui-select-modal-folder", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, buttonSlot: { classPropertyName: "buttonSlot", publicName: "buttonSlot", isSignal: true, isRequired: true, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<cui-card-wrapper class=\"wrapper\">\n <ng-container [ngTemplateOutlet]=\"buttonSlot()\" />\n\n <cui-svg\n [icon]=\"icon()\"\n class=\"icon\"\n />\n\n <span class=\"title\">{{ title() }}</span>\n</cui-card-wrapper>\n", styles: [":host{--border-color: var(--cui-base-200);--padding-horizontal: 8px;--padding-vertical: 8px}:host .wrapper{--border: var(--border-color);padding:var(--padding-vertical) var(--padding-horizontal)}.title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon{padding:2px}\n"], dependencies: [{ kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "component", type: CuiCardWrapperComponent, selector: "cui-card-wrapper, [cuiCardWrapper]", inputs: ["withBorder", "isSelected"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12455
|
+
}
|
|
12456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, decorators: [{
|
|
12457
|
+
type: Component,
|
|
12458
|
+
args: [{ selector: 'cui-select-modal-folder', imports: [CuiSvgModule, CuiCardWrapperComponent, NgTemplateOutlet], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-card-wrapper class=\"wrapper\">\n <ng-container [ngTemplateOutlet]=\"buttonSlot()\" />\n\n <cui-svg\n [icon]=\"icon()\"\n class=\"icon\"\n />\n\n <span class=\"title\">{{ title() }}</span>\n</cui-card-wrapper>\n", styles: [":host{--border-color: var(--cui-base-200);--padding-horizontal: 8px;--padding-vertical: 8px}:host .wrapper{--border: var(--border-color);padding:var(--padding-vertical) var(--padding-horizontal)}.title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon{padding:2px}\n"] }]
|
|
12459
|
+
}] });
|
|
12460
|
+
|
|
12461
|
+
class CuiSelectModalSearchComponent {
|
|
12397
12462
|
constructor() {
|
|
12398
12463
|
this.destroyRef = inject(DestroyRef);
|
|
12399
|
-
this.
|
|
12400
|
-
this.
|
|
12401
|
-
this.
|
|
12402
|
-
this.tools = this.cuiDialogContext.data.tools;
|
|
12403
|
-
this.header = this.cuiDialogContext.data.header;
|
|
12404
|
-
this._instruction = computed(() => signal(this.initialUtility()));
|
|
12405
|
-
this.isFormValid = signal(false);
|
|
12406
|
-
this.instruction = computed(() => this._instruction()());
|
|
12407
|
-
this.initialUtility = input.required();
|
|
12408
|
-
this.config = input.required();
|
|
12464
|
+
this.searchControl = input(new FormControl(''));
|
|
12465
|
+
this.controlDelay = input(700);
|
|
12466
|
+
this.searchStringChanged = output();
|
|
12409
12467
|
}
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
this.instructionApiService
|
|
12415
|
-
.createUtility(storageNodeId)
|
|
12416
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12417
|
-
.subscribe((instruction) => {
|
|
12418
|
-
this.isCreated = true;
|
|
12419
|
-
this._instruction().set(instruction);
|
|
12420
|
-
});
|
|
12468
|
+
ngOnInit() {
|
|
12469
|
+
this.searchControl()
|
|
12470
|
+
.valueChanges.pipe(debounceTime(this.controlDelay()), takeUntilDestroyed(this.destroyRef))
|
|
12471
|
+
.subscribe((value) => this.searchStringChanged.emit(value));
|
|
12421
12472
|
}
|
|
12422
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
12423
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type:
|
|
12473
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12474
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiSelectModalSearchComponent, isStandalone: true, selector: "cui-select-modal-search", inputs: { searchControl: { classPropertyName: "searchControl", publicName: "searchControl", isSignal: true, isRequired: false, transformFunction: null }, controlDelay: { classPropertyName: "controlDelay", publicName: "controlDelay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchStringChanged: "searchStringChanged" }, ngImport: i0, template: "<cui-input-text\n cuiTextFieldPlaceholder=\"Search...\"\n cuiTextFieldIconLeft=\"cuiIconSearch\"\n [formControl]=\"searchControl()\"\n class=\"search\"\n/>\n<button\n class=\"filters\"\n type=\"button\"\n cuiIconButton\n icon=\"cuiIconFiltersLines\"\n></button>\n", styles: [":host{padding-right:15px;display:flex;align-items:center;gap:4px}.search{width:100%}.filters{padding:4px;width:auto;height:auto}\n"], dependencies: [{ kind: "ngmodule", type: CuiInputModule }, { kind: "component", type: CuiInputTextComponent, selector: "cui-input-text" }, { kind: "directive", type: CuiTextFieldIconLeftDirective, selector: "[cuiTextFieldIconLeft]", inputs: ["cuiTextFieldIconLeft"] }, { kind: "directive", type: CuiTextFieldPlaceholderDirective, selector: "[cuiTextFieldPlaceholder]", inputs: ["cuiTextFieldPlaceholder"] }, { kind: "ngmodule", type: CuiIconButtonModule }, { kind: "component", type: CuiIconButtonComponent, selector: "button[cuiIconButton][icon], a[cuiIconButton][icon]", inputs: ["icon", "color", "hoverColor"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12424
12475
|
}
|
|
12425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
12476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, decorators: [{
|
|
12426
12477
|
type: Component,
|
|
12427
|
-
args: [{ imports: [
|
|
12478
|
+
args: [{ selector: 'cui-select-modal-search', imports: [CuiInputModule, CuiIconButtonModule, ReactiveFormsModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-input-text\n cuiTextFieldPlaceholder=\"Search...\"\n cuiTextFieldIconLeft=\"cuiIconSearch\"\n [formControl]=\"searchControl()\"\n class=\"search\"\n/>\n<button\n class=\"filters\"\n type=\"button\"\n cuiIconButton\n icon=\"cuiIconFiltersLines\"\n></button>\n", styles: [":host{padding-right:15px;display:flex;align-items:center;gap:4px}.search{width:100%}.filters{padding:4px;width:auto;height:auto}\n"] }]
|
|
12428
12479
|
}] });
|
|
12429
12480
|
|
|
12430
|
-
class
|
|
12481
|
+
class CuiSelectModalComponent {
|
|
12431
12482
|
constructor() {
|
|
12432
|
-
this.
|
|
12433
|
-
this.
|
|
12483
|
+
this.context = inject(CUI_DIALOG_CONTEXT);
|
|
12484
|
+
this.data = this.context.data;
|
|
12485
|
+
this.heading = this.data.heading;
|
|
12486
|
+
this.leftData = this.data.leftData;
|
|
12487
|
+
this.rightData = this.data.rightData;
|
|
12434
12488
|
}
|
|
12435
|
-
|
|
12436
|
-
|
|
12489
|
+
onCancel() {
|
|
12490
|
+
this.context.completeWith();
|
|
12491
|
+
}
|
|
12492
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12493
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiSelectModalComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"content\">\n <header\n class=\"header\"\n cuiDialogHeader\n [heading]=\"heading\"\n (closed)=\"onCancel()\"\n ></header>\n <div class=\"wrapper\">\n <div class=\"left-block\">\n @if (leftData) {\n <ng-container\n [ngComponentOutlet]=\"leftData.component\"\n [ngComponentOutletInputs]=\"leftData.inputs\"\n />\n }\n </div>\n <div class=\"right-block\">\n @if (rightData) {\n <ng-container\n [ngComponentOutlet]=\"rightData.component\"\n [ngComponentOutletInputs]=\"rightData.inputs\"\n />\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".header{padding-right:16px;padding-left:16px}.content{display:flex;flex-direction:column;height:calc(100vh - 180px)}.wrapper{display:flex;flex-direction:row;flex-grow:1;border-top:1px solid var(--cui-base-200);width:100%;min-height:400px;overflow-y:hidden}.left-block{padding-left:16px;padding-top:19px;flex-shrink:0;display:flex;flex-direction:column;gap:16px;width:50%;border-right:1px solid var(--cui-base-200)}.right-block{position:relative;width:50%;overflow:hidden}.right-block__head{padding:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--cui-base-200)}.right-block__title{font-weight:500;font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.right-block__subtitle{font-weight:400;font-size:14px;line-height:20px;margin-bottom:16px;text-transform:uppercase;color:var(--cui-base-500)}\n"], dependencies: [{ kind: "ngmodule", type: CuiButtonModule }, { kind: "ngmodule", type: CuiDialogModule }, { kind: "component", type: CuiDialogHeaderComponent, selector: "header[cuiDialogHeader][heading]", inputs: ["heading", "headingContext", "subheading"], outputs: ["closed"] }, { kind: "ngmodule", type: CuiIconButtonModule }, { kind: "ngmodule", type: CuiInputModule }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12437
12494
|
}
|
|
12438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
12495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, decorators: [{
|
|
12439
12496
|
type: Component,
|
|
12440
|
-
args: [{
|
|
12497
|
+
args: [{ imports: [
|
|
12498
|
+
CuiButtonModule,
|
|
12499
|
+
CuiDialogModule,
|
|
12500
|
+
CuiIconButtonModule,
|
|
12501
|
+
CuiInputModule,
|
|
12502
|
+
NgComponentOutlet,
|
|
12503
|
+
TranslocoDirective
|
|
12504
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <div class=\"content\">\n <header\n class=\"header\"\n cuiDialogHeader\n [heading]=\"heading\"\n (closed)=\"onCancel()\"\n ></header>\n <div class=\"wrapper\">\n <div class=\"left-block\">\n @if (leftData) {\n <ng-container\n [ngComponentOutlet]=\"leftData.component\"\n [ngComponentOutletInputs]=\"leftData.inputs\"\n />\n }\n </div>\n <div class=\"right-block\">\n @if (rightData) {\n <ng-container\n [ngComponentOutlet]=\"rightData.component\"\n [ngComponentOutletInputs]=\"rightData.inputs\"\n />\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".header{padding-right:16px;padding-left:16px}.content{display:flex;flex-direction:column;height:calc(100vh - 180px)}.wrapper{display:flex;flex-direction:row;flex-grow:1;border-top:1px solid var(--cui-base-200);width:100%;min-height:400px;overflow-y:hidden}.left-block{padding-left:16px;padding-top:19px;flex-shrink:0;display:flex;flex-direction:column;gap:16px;width:50%;border-right:1px solid var(--cui-base-200)}.right-block{position:relative;width:50%;overflow:hidden}.right-block__head{padding:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--cui-base-200)}.right-block__title{font-weight:500;font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.right-block__subtitle{font-weight:400;font-size:14px;line-height:20px;margin-bottom:16px;text-transform:uppercase;color:var(--cui-base-500)}\n"] }]
|
|
12505
|
+
}] });
|
|
12506
|
+
|
|
12507
|
+
class CuiSelectModalService {
|
|
12508
|
+
constructor() {
|
|
12509
|
+
this.selectedElementSignal = signal(null);
|
|
12510
|
+
this.selectedElement = this.selectedElementSignal.asReadonly();
|
|
12511
|
+
}
|
|
12512
|
+
getSelectedData() {
|
|
12513
|
+
return this.selectedElementSignal.asReadonly();
|
|
12514
|
+
}
|
|
12515
|
+
set(element) {
|
|
12516
|
+
this.selectedElementSignal.set(element);
|
|
12517
|
+
}
|
|
12518
|
+
delete() {
|
|
12519
|
+
this.selectedElementSignal.set(null);
|
|
12520
|
+
}
|
|
12521
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12522
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService }); }
|
|
12523
|
+
}
|
|
12524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService, decorators: [{
|
|
12525
|
+
type: Injectable
|
|
12526
|
+
}] });
|
|
12527
|
+
|
|
12528
|
+
const CUI_STORAGE_LIST_SERVICE_TOKEN = new InjectionToken('STORAGE_LIST_SERVICE_TOKEN');
|
|
12529
|
+
|
|
12530
|
+
class CuiStorageListItemComponent {
|
|
12531
|
+
constructor() {
|
|
12532
|
+
this.storageListService = inject(CUI_STORAGE_LIST_SERVICE_TOKEN);
|
|
12533
|
+
this.isLoadingChildren = false;
|
|
12534
|
+
this.isLoadingElements = false;
|
|
12535
|
+
this.storageChildren = signal([]);
|
|
12536
|
+
this.storageElements = signal([]);
|
|
12537
|
+
this.areContentOpened = signal(false);
|
|
12538
|
+
this.openCloseButtonIcon = computed(() => this.areContentOpened() ? 'cuiIconChevronDown' : 'cuiIconChevronRight');
|
|
12539
|
+
this.hasContent = computed(() => this.storage().children.length || this.storageChildren().length || this.storageElements().length);
|
|
12540
|
+
this.storage = input.required();
|
|
12541
|
+
this.elementSlot = input();
|
|
12542
|
+
this.itemSlot = input();
|
|
12543
|
+
this.initStorageChildrenEffect();
|
|
12544
|
+
this.initStorageElementsEffect();
|
|
12545
|
+
}
|
|
12546
|
+
onToggleChildren(event) {
|
|
12547
|
+
event.preventDefault();
|
|
12548
|
+
this.areContentOpened.update((prevAreChildrenOpened) => !prevAreChildrenOpened);
|
|
12549
|
+
}
|
|
12550
|
+
initStorageChildrenEffect() {
|
|
12551
|
+
effect(() => {
|
|
12552
|
+
const storage = this.storage();
|
|
12553
|
+
this.areContentOpened();
|
|
12554
|
+
untracked(this.setChildren.bind(this, storage));
|
|
12555
|
+
});
|
|
12556
|
+
}
|
|
12557
|
+
initStorageElementsEffect() {
|
|
12558
|
+
effect(() => {
|
|
12559
|
+
const storage = this.storage();
|
|
12560
|
+
untracked(this.setElements.bind(this, storage));
|
|
12561
|
+
});
|
|
12562
|
+
}
|
|
12563
|
+
setChildren(storage) {
|
|
12564
|
+
const storageChildren = storage.children;
|
|
12565
|
+
if (!storageChildren.length) {
|
|
12566
|
+
this.storageChildren.set([]);
|
|
12567
|
+
}
|
|
12568
|
+
if (this.isLoadingChildren || !this.areContentOpened()) {
|
|
12569
|
+
return;
|
|
12570
|
+
}
|
|
12571
|
+
if (typeof storageChildren[0] !== 'string') {
|
|
12572
|
+
this.storageChildren.set(storageChildren);
|
|
12573
|
+
return;
|
|
12574
|
+
}
|
|
12575
|
+
this.isLoadingChildren = true;
|
|
12576
|
+
this.storageListService
|
|
12577
|
+
.getChildren?.(storage, this.storageChildren())
|
|
12578
|
+
.pipe(finalize(() => (this.isLoadingChildren = false)))
|
|
12579
|
+
.subscribe((response) => this.storageChildren.set(response));
|
|
12580
|
+
}
|
|
12581
|
+
setElements(storage) {
|
|
12582
|
+
const storageElements = storage.elements;
|
|
12583
|
+
if (this.isLoadingElements) {
|
|
12584
|
+
return;
|
|
12585
|
+
}
|
|
12586
|
+
if (!storageElements?.length) {
|
|
12587
|
+
this.storageElements.set([]);
|
|
12588
|
+
return;
|
|
12589
|
+
}
|
|
12590
|
+
if (this.storageElements().length) {
|
|
12591
|
+
this.storageElements.set(storageElements);
|
|
12592
|
+
return;
|
|
12593
|
+
}
|
|
12594
|
+
this.isLoadingElements = true;
|
|
12595
|
+
this.storageListService
|
|
12596
|
+
.getElements?.(storage, this.storageElements())
|
|
12597
|
+
.pipe(finalize(() => (this.isLoadingElements = false)))
|
|
12598
|
+
.subscribe((response) => this.storageElements.set(response));
|
|
12599
|
+
}
|
|
12600
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12601
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiStorageListItemComponent, isStandalone: true, selector: "li[cuiStorageListItem]", inputs: { storage: { classPropertyName: "storage", publicName: "storage", isSignal: true, isRequired: true, transformFunction: null }, elementSlot: { classPropertyName: "elementSlot", publicName: "elementSlot", isSignal: true, isRequired: false, transformFunction: null }, itemSlot: { classPropertyName: "itemSlot", publicName: "itemSlot", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *cuiLet=\"storage() as storage\">\n <div class=\"wrapper\">\n <ng-template #openCloseButton>\n @if (hasContent()) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onToggleChildren($event)\"\n >\n <cui-svg\n [icon]=\"openCloseButtonIcon()\"\n color=\"var(--cui-base-500)\"\n />\n </button>\n }\n </ng-template>\n\n @if (itemSlot(); as item) {\n <ng-container\n *ngTemplateOutlet=\"\n item;\n context: {\n $implicit: storage,\n openCloseButton,\n areContentOpened: areContentOpened(),\n hasContent: hasContent()\n }\n \"\n />\n }\n\n <div\n class=\"content\"\n [class.content_hidden]=\"!areContentOpened()\"\n >\n <div class=\"lists\">\n @if (storageChildren().length) {\n <cui-storage-list\n [storages]=\"storageChildren()\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n />\n }\n @if (storageElements().length && elementSlot()) {\n <ul class=\"list\">\n @for (element of storageElements(); track element.id) {\n <li class=\"item\">\n <ng-container\n *ngTemplateOutlet=\"\n elementSlot()!;\n context: { $implicit: element, storage: storage }\n \"\n />\n </li>\n }\n </ul>\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".button{padding:2px;display:flex;border-radius:4px}@media (hover: hover){.button:hover{background:var(--cui-base-200)}}.button :active{background:var(--cui-base-200)}.icon{padding:2px}.wrapper{display:flex;flex-direction:column;gap:8px}.content{padding-left:20px}.content_hidden{display:none}.lists{display:flex;flex-direction:column;gap:8px;position:relative}.lists>*{z-index:1}.lists:has(>:nth-child(2)):before{content:\"\";position:absolute;top:0;bottom:0;left:8px;border-left:1px solid var(--cui-base-200)}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => CuiLetDirective), selector: "[cuiLet]", inputs: ["cuiLet"] }, { kind: "ngmodule", type: i0.forwardRef(() => CuiSvgModule) }, { kind: "component", type: i0.forwardRef(() => CuiSvgComponent), selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i0.forwardRef(() => CuiStorageListComponent), selector: "cui-storage-list", inputs: ["storages", "elementSlot", "itemSlot"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12602
|
+
}
|
|
12603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, decorators: [{
|
|
12604
|
+
type: Component,
|
|
12605
|
+
args: [{ selector: 'li[cuiStorageListItem]', imports: [CuiLetDirective, CuiSvgModule, NgTemplateOutlet, forwardRef(() => CuiStorageListComponent)], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *cuiLet=\"storage() as storage\">\n <div class=\"wrapper\">\n <ng-template #openCloseButton>\n @if (hasContent()) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onToggleChildren($event)\"\n >\n <cui-svg\n [icon]=\"openCloseButtonIcon()\"\n color=\"var(--cui-base-500)\"\n />\n </button>\n }\n </ng-template>\n\n @if (itemSlot(); as item) {\n <ng-container\n *ngTemplateOutlet=\"\n item;\n context: {\n $implicit: storage,\n openCloseButton,\n areContentOpened: areContentOpened(),\n hasContent: hasContent()\n }\n \"\n />\n }\n\n <div\n class=\"content\"\n [class.content_hidden]=\"!areContentOpened()\"\n >\n <div class=\"lists\">\n @if (storageChildren().length) {\n <cui-storage-list\n [storages]=\"storageChildren()\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n />\n }\n @if (storageElements().length && elementSlot()) {\n <ul class=\"list\">\n @for (element of storageElements(); track element.id) {\n <li class=\"item\">\n <ng-container\n *ngTemplateOutlet=\"\n elementSlot()!;\n context: { $implicit: element, storage: storage }\n \"\n />\n </li>\n }\n </ul>\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".button{padding:2px;display:flex;border-radius:4px}@media (hover: hover){.button:hover{background:var(--cui-base-200)}}.button :active{background:var(--cui-base-200)}.icon{padding:2px}.wrapper{display:flex;flex-direction:column;gap:8px}.content{padding-left:20px}.content_hidden{display:none}.lists{display:flex;flex-direction:column;gap:8px;position:relative}.lists>*{z-index:1}.lists:has(>:nth-child(2)):before{content:\"\";position:absolute;top:0;bottom:0;left:8px;border-left:1px solid var(--cui-base-200)}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"] }]
|
|
12606
|
+
}], ctorParameters: () => [] });
|
|
12607
|
+
|
|
12608
|
+
class CuiStorageListComponent {
|
|
12609
|
+
constructor() {
|
|
12610
|
+
this.storages = input.required();
|
|
12611
|
+
this.elementSlot = input();
|
|
12612
|
+
this.itemSlot = input();
|
|
12613
|
+
}
|
|
12614
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12615
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiStorageListComponent, isStandalone: true, selector: "cui-storage-list", inputs: { storages: { classPropertyName: "storages", publicName: "storages", isSignal: true, isRequired: true, transformFunction: null }, elementSlot: { classPropertyName: "elementSlot", publicName: "elementSlot", isSignal: true, isRequired: false, transformFunction: null }, itemSlot: { classPropertyName: "itemSlot", publicName: "itemSlot", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"list\">\n @for (storage of storages(); track storage.id) {\n <li\n cuiStorageListItem\n [storage]=\"storage\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n class=\"item\"\n ></li>\n }\n</ul>\n", styles: [":host{display:block}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative;z-index:0}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"], dependencies: [{ kind: "component", type: CuiStorageListItemComponent, selector: "li[cuiStorageListItem]", inputs: ["storage", "elementSlot", "itemSlot"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12616
|
+
}
|
|
12617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListComponent, decorators: [{
|
|
12618
|
+
type: Component,
|
|
12619
|
+
args: [{ selector: 'cui-storage-list', imports: [CuiStorageListItemComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"list\">\n @for (storage of storages(); track storage.id) {\n <li\n cuiStorageListItem\n [storage]=\"storage\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n class=\"item\"\n ></li>\n }\n</ul>\n", styles: [":host{display:block}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative;z-index:0}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"] }]
|
|
12620
|
+
}] });
|
|
12621
|
+
|
|
12622
|
+
class CuiUtilityModalCreateComponent {
|
|
12623
|
+
constructor() {
|
|
12624
|
+
this.window = inject(CUI_WINDOW);
|
|
12625
|
+
this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
|
|
12626
|
+
this.utilityModalService = inject(UTILITY_MODAL_SERVICE_TOKEN);
|
|
12627
|
+
this.prevUtility = this.cuiDialogContext.data.utility;
|
|
12628
|
+
this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
|
|
12629
|
+
this.tools = this.cuiDialogContext.data.tools;
|
|
12630
|
+
this.header = this.cuiDialogContext.data.header;
|
|
12631
|
+
this._utility = computed(() => signal(this.initialUtility()));
|
|
12632
|
+
this.isFormValid = signal(false);
|
|
12633
|
+
this.utility = computed(() => this._utility()());
|
|
12634
|
+
this.initialUtility = input.required();
|
|
12635
|
+
}
|
|
12636
|
+
ngOnInit() {
|
|
12637
|
+
this.initWindowUnloadEvent();
|
|
12638
|
+
}
|
|
12639
|
+
ngOnDestroy() {
|
|
12640
|
+
this.window.onbeforeunload = null;
|
|
12641
|
+
}
|
|
12642
|
+
onSave() {
|
|
12643
|
+
this.cuiDialogContext.completeWith(this.initialUtility() ? { prevId: this.prevUtility.id, ...this.utility() } : this.utility());
|
|
12644
|
+
}
|
|
12645
|
+
onCancel() {
|
|
12646
|
+
this.destroyUtility();
|
|
12647
|
+
const returnedValue = this.initialUtility() ? this.utility() : null;
|
|
12648
|
+
this.cuiDialogContext.completeWith(returnedValue);
|
|
12649
|
+
}
|
|
12650
|
+
initWindowUnloadEvent() {
|
|
12651
|
+
this.window.onbeforeunload = () => this.destroyUtility();
|
|
12652
|
+
}
|
|
12653
|
+
destroyUtility() {
|
|
12654
|
+
const utility = this.utility();
|
|
12655
|
+
if (!utility || this.initialUtility()) {
|
|
12656
|
+
return;
|
|
12657
|
+
}
|
|
12658
|
+
this.utilityModalService.deleteUtility(utility).subscribe();
|
|
12659
|
+
}
|
|
12660
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityModalCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12661
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiUtilityModalCreateComponent, isStandalone: true, selector: "cui-utility-modal-create", inputs: { initialUtility: { classPropertyName: "initialUtility", publicName: "initialUtility", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <header class=\"header\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n\n <div class=\"header__content\">\n <cui-loader\n type=\"stated\"\n color=\"var(--cui-base-500)\"\n />\n\n <div class=\"actions\">\n @if (!initialUtility()) {\n <button\n type=\"button\"\n cuiButton\n appearance=\"secondary\"\n (click)=\"onCancel()\"\n >\n {{ t('CANCEL') }}\n </button>\n }\n\n <button\n type=\"button\"\n cuiButton\n [disabled]=\"!isFormValid()\"\n appearance=\"action-violet\"\n (click)=\"onSave()\"\n >\n {{ t('DONE') }}\n </button>\n </div>\n </div>\n </header>\n\n <ng-content />\n</div>\n", styles: [".header{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:space-between;padding:16px 24px}.header__content{display:flex;flex-direction:row;gap:8px}.actions{display:flex;flex-direction:row;gap:16px}\n"], dependencies: [{ kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "component", type: CuiLoaderComponent, selector: "cui-loader", inputs: ["type", "position", "size", "color"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12662
|
+
}
|
|
12663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityModalCreateComponent, decorators: [{
|
|
12664
|
+
type: Component,
|
|
12665
|
+
args: [{ selector: 'cui-utility-modal-create', imports: [CuiButtonModule, CuiLoaderComponent, CuiSvgModule, NgTemplateOutlet, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <header class=\"header\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n\n <div class=\"header__content\">\n <cui-loader\n type=\"stated\"\n color=\"var(--cui-base-500)\"\n />\n\n <div class=\"actions\">\n @if (!initialUtility()) {\n <button\n type=\"button\"\n cuiButton\n appearance=\"secondary\"\n (click)=\"onCancel()\"\n >\n {{ t('CANCEL') }}\n </button>\n }\n\n <button\n type=\"button\"\n cuiButton\n [disabled]=\"!isFormValid()\"\n appearance=\"action-violet\"\n (click)=\"onSave()\"\n >\n {{ t('DONE') }}\n </button>\n </div>\n </div>\n </header>\n\n <ng-content />\n</div>\n", styles: [".header{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:space-between;padding:16px 24px}.header__content{display:flex;flex-direction:row;gap:8px}.actions{display:flex;flex-direction:row;gap:16px}\n"] }]
|
|
12666
|
+
}] });
|
|
12667
|
+
|
|
12668
|
+
class CuiCriterionModalCreateComponent {
|
|
12669
|
+
constructor() {
|
|
12670
|
+
this.destroyRef = inject(DestroyRef);
|
|
12671
|
+
this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
|
|
12672
|
+
this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
|
|
12673
|
+
this.isCreated = false;
|
|
12674
|
+
this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
|
|
12675
|
+
this.tools = this.cuiDialogContext.data.tools;
|
|
12676
|
+
this.header = this.cuiDialogContext.data.header;
|
|
12677
|
+
this._criterion = computed(() => signal(this.initialUtility()));
|
|
12678
|
+
this.isFormValid = signal(false);
|
|
12679
|
+
this.criterion = computed(() => this._criterion()());
|
|
12680
|
+
this.initialUtility = input.required();
|
|
12681
|
+
this.config = input.required();
|
|
12682
|
+
}
|
|
12683
|
+
onCriterionCreated(storageNodeId) {
|
|
12684
|
+
if (this.isCreated || this.initialUtility()) {
|
|
12685
|
+
return;
|
|
12686
|
+
}
|
|
12687
|
+
this.criterionApiService
|
|
12688
|
+
.createUtility(storageNodeId)
|
|
12689
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12690
|
+
.subscribe((criterion) => {
|
|
12691
|
+
this.isCreated = true;
|
|
12692
|
+
this._criterion().set(criterion);
|
|
12693
|
+
});
|
|
12694
|
+
}
|
|
12695
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionModalCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12696
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiCriterionModalCreateComponent, isStandalone: true, selector: "ng-component", inputs: { initialUtility: { classPropertyName: "initialUtility", publicName: "initialUtility", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<cui-utility-modal-create [initialUtility]=\"criterion()\">\n <cui-criterion-info\n [criterion]=\"criterion()\"\n [config]=\"config()\"\n (validationChanged)=\"isFormValid.set($event)\"\n (criterionCreated)=\"onCriterionCreated($event)\"\n />\n</cui-utility-modal-create>\n", dependencies: [{ kind: "ngmodule", type: CuiButtonModule }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiCriterionInfoComponent, selector: "cui-criterion-info", inputs: ["criterion", "config"], outputs: ["criterionChange", "validationChanged", "criterionCreated"] }, { kind: "component", type: CuiUtilityModalCreateComponent, selector: "cui-utility-modal-create", inputs: ["initialUtility"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12697
|
+
}
|
|
12698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionModalCreateComponent, decorators: [{
|
|
12699
|
+
type: Component,
|
|
12700
|
+
args: [{ imports: [CuiButtonModule, CuiSvgModule, CuiCriterionInfoComponent, CuiUtilityModalCreateComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-utility-modal-create [initialUtility]=\"criterion()\">\n <cui-criterion-info\n [criterion]=\"criterion()\"\n [config]=\"config()\"\n (validationChanged)=\"isFormValid.set($event)\"\n (criterionCreated)=\"onCriterionCreated($event)\"\n />\n</cui-utility-modal-create>\n" }]
|
|
12701
|
+
}] });
|
|
12702
|
+
|
|
12703
|
+
class CuiInstructionModalCreateComponent {
|
|
12704
|
+
constructor() {
|
|
12705
|
+
this.destroyRef = inject(DestroyRef);
|
|
12706
|
+
this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
|
|
12707
|
+
this.instructionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
|
|
12708
|
+
this.isCreated = false;
|
|
12709
|
+
this.tools = this.cuiDialogContext.data.tools;
|
|
12710
|
+
this.header = this.cuiDialogContext.data.header;
|
|
12711
|
+
this._instruction = computed(() => signal(this.initialUtility()));
|
|
12712
|
+
this.isFormValid = signal(false);
|
|
12713
|
+
this.instruction = computed(() => this._instruction()());
|
|
12714
|
+
this.initialUtility = input.required();
|
|
12715
|
+
this.config = input.required();
|
|
12716
|
+
}
|
|
12717
|
+
onInstructionCreated(storageNodeId) {
|
|
12718
|
+
if (this.isCreated || this.initialUtility()) {
|
|
12719
|
+
return;
|
|
12720
|
+
}
|
|
12721
|
+
this.instructionApiService
|
|
12722
|
+
.createUtility(storageNodeId)
|
|
12723
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12724
|
+
.subscribe((instruction) => {
|
|
12725
|
+
this.isCreated = true;
|
|
12726
|
+
this._instruction().set(instruction);
|
|
12727
|
+
});
|
|
12728
|
+
}
|
|
12729
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiInstructionModalCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12730
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiInstructionModalCreateComponent, isStandalone: true, selector: "ng-component", inputs: { initialUtility: { classPropertyName: "initialUtility", publicName: "initialUtility", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<cui-utility-modal-create [initialUtility]=\"instruction()\">\n <cui-instruction-info\n [instruction]=\"instruction()\"\n [config]=\"config()\"\n (validationChanged)=\"isFormValid.set($event)\"\n (instructionCreated)=\"onInstructionCreated($event)\"\n />\n</cui-utility-modal-create>\n", dependencies: [{ kind: "ngmodule", type: CuiButtonModule }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiUtilityModalCreateComponent, selector: "cui-utility-modal-create", inputs: ["initialUtility"] }, { kind: "component", type: CuiInstructionInfoComponent, selector: "cui-instruction-info", inputs: ["instruction", "config"], outputs: ["instructionChange", "validationChanged", "instructionCreated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12731
|
+
}
|
|
12732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiInstructionModalCreateComponent, decorators: [{
|
|
12733
|
+
type: Component,
|
|
12734
|
+
args: [{ imports: [CuiButtonModule, CuiSvgModule, CuiUtilityModalCreateComponent, CuiInstructionInfoComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-utility-modal-create [initialUtility]=\"instruction()\">\n <cui-instruction-info\n [instruction]=\"instruction()\"\n [config]=\"config()\"\n (validationChanged)=\"isFormValid.set($event)\"\n (instructionCreated)=\"onInstructionCreated($event)\"\n />\n</cui-utility-modal-create>\n" }]
|
|
12735
|
+
}] });
|
|
12736
|
+
|
|
12737
|
+
class CuiUtilityReadonlyThumbnailComponent {
|
|
12738
|
+
constructor() {
|
|
12739
|
+
this.thumbnailUrl = input.required();
|
|
12740
|
+
this.isVideo = input(false);
|
|
12741
|
+
}
|
|
12742
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityReadonlyThumbnailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12743
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiUtilityReadonlyThumbnailComponent, isStandalone: true, selector: "cui-utility-readonly-thumbnail", inputs: { thumbnailUrl: { classPropertyName: "thumbnailUrl", publicName: "thumbnailUrl", isSignal: true, isRequired: true, transformFunction: null }, isVideo: { classPropertyName: "isVideo", publicName: "isVideo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let url = thumbnailUrl();\n\n@if (url?.src; as src) {\n @if (isVideo()) {\n <video\n class=\"thumbnail\"\n [src]=\"src\"\n controls\n ></video>\n } @else {\n <img\n class=\"thumbnail\"\n [src]=\"src\"\n [alt]=\"url?.name\"\n />\n }\n}\n", styles: [".thumbnail{width:100%;max-height:271px;object-fit:contain}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12744
|
+
}
|
|
12745
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityReadonlyThumbnailComponent, decorators: [{
|
|
12746
|
+
type: Component,
|
|
12747
|
+
args: [{ selector: 'cui-utility-readonly-thumbnail', imports: [], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let url = thumbnailUrl();\n\n@if (url?.src; as src) {\n @if (isVideo()) {\n <video\n class=\"thumbnail\"\n [src]=\"src\"\n controls\n ></video>\n } @else {\n <img\n class=\"thumbnail\"\n [src]=\"src\"\n [alt]=\"url?.name\"\n />\n }\n}\n", styles: [".thumbnail{width:100%;max-height:271px;object-fit:contain}\n"] }]
|
|
12441
12748
|
}] });
|
|
12442
12749
|
|
|
12443
12750
|
class CuiCriterionReadonlyInfoComponent {
|
|
@@ -12705,313 +13012,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
12705
13012
|
args: [{ selector: 'cui-utility-modal', imports: [CuiRenderDynamicComponentsComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiRenderDynamicComponentsService], template: "<cui-render-dynamic-components />\n", styles: [".host{display:block;height:calc(100vh - 40px)}\n"] }]
|
|
12706
13013
|
}], ctorParameters: () => [] });
|
|
12707
13014
|
|
|
12708
|
-
class CuiCriterionInfoComponent {
|
|
12709
|
-
constructor() {
|
|
12710
|
-
this.destroyRef = inject(DestroyRef);
|
|
12711
|
-
this.translocoService = inject(TranslocoService);
|
|
12712
|
-
this.cuiIdService = inject(CuiIdService);
|
|
12713
|
-
this.cuiCategoriesModalService = inject(CuiSelectedCategoryService);
|
|
12714
|
-
this.treeStructNavigatorApiService = inject(CuiTreeStructNavigatorApiService);
|
|
12715
|
-
this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
|
|
12716
|
-
this.TYPE = "INSTRUCTION_STORAGE" /* TreeStructType.Instruction */;
|
|
12717
|
-
this.skipCategoryChange = false;
|
|
12718
|
-
this.categoryId = this.cuiIdService.generate();
|
|
12719
|
-
this.category = this.cuiCategoriesModalService.category;
|
|
12720
|
-
this.isFormValid = signal(false);
|
|
12721
|
-
this.prevCategoryId = signal(null);
|
|
12722
|
-
this.editorConfig = signal(null);
|
|
12723
|
-
this.labelColor = computed(() => this.category()?.title ? 'var(--cui-base-900)' : 'var(--cui-base-400)');
|
|
12724
|
-
this.selectTitle = computed(() => this.category()?.title || this.translocoService.translate('SELECT') + '...');
|
|
12725
|
-
this.element = viewChild('scrollContent');
|
|
12726
|
-
this.criterion = model();
|
|
12727
|
-
this.config = input.required();
|
|
12728
|
-
this.validationChanged = output();
|
|
12729
|
-
this.criterionCreated = output();
|
|
12730
|
-
this.initConfigEffect();
|
|
12731
|
-
this.initCategoryEffect();
|
|
12732
|
-
}
|
|
12733
|
-
ngOnInit() {
|
|
12734
|
-
this.initCategory();
|
|
12735
|
-
}
|
|
12736
|
-
onFormChanged(values, criterionId) {
|
|
12737
|
-
const actions = {
|
|
12738
|
-
title: (title) => this.changeTitle(title, criterionId),
|
|
12739
|
-
description: (description) => this.changeDescription(description, criterionId)
|
|
12740
|
-
};
|
|
12741
|
-
forkJoin(Object.keys(values).map((key) => actions[key](values[key] || '')))
|
|
12742
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12743
|
-
.subscribe();
|
|
12744
|
-
}
|
|
12745
|
-
onFormValidationChanged(isValid) {
|
|
12746
|
-
this.isFormValid.set(isValid);
|
|
12747
|
-
this.validationChanged.emit(isValid);
|
|
12748
|
-
}
|
|
12749
|
-
initCategoryEffect() {
|
|
12750
|
-
effect(() => {
|
|
12751
|
-
const category = this.category();
|
|
12752
|
-
const storageObjectCriterion = untracked(this.criterion);
|
|
12753
|
-
if (!category || this.skipCategoryChange) {
|
|
12754
|
-
this.skipCategoryChange = false;
|
|
12755
|
-
return;
|
|
12756
|
-
}
|
|
12757
|
-
if (storageObjectCriterion) {
|
|
12758
|
-
this.changeCategory(category.id, storageObjectCriterion.id);
|
|
12759
|
-
return;
|
|
12760
|
-
}
|
|
12761
|
-
this.createCriterion(category.id);
|
|
12762
|
-
});
|
|
12763
|
-
}
|
|
12764
|
-
initConfigEffect() {
|
|
12765
|
-
effect(() => {
|
|
12766
|
-
const element = this.element()?.nativeElement;
|
|
12767
|
-
if (!element) {
|
|
12768
|
-
return;
|
|
12769
|
-
}
|
|
12770
|
-
this.editorConfig.set({ ...this.config(), element });
|
|
12771
|
-
});
|
|
12772
|
-
}
|
|
12773
|
-
initCategory() {
|
|
12774
|
-
const storageObjectId = this.criterion()?.id;
|
|
12775
|
-
if (!storageObjectId) {
|
|
12776
|
-
return;
|
|
12777
|
-
}
|
|
12778
|
-
this.treeStructNavigatorApiService
|
|
12779
|
-
.getCategory(storageObjectId, "CRITERION_STORAGE" /* TreeStructType.Criteria */, this.config().requestOptions)
|
|
12780
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
12781
|
-
.subscribe((category) => {
|
|
12782
|
-
this.skipCategoryChange = true;
|
|
12783
|
-
this.prevCategoryId.set(category.id);
|
|
12784
|
-
this.cuiCategoriesModalService.setCurrentCategory(category);
|
|
12785
|
-
});
|
|
12786
|
-
}
|
|
12787
|
-
changeCategory(categoryId, targetId) {
|
|
12788
|
-
const prevCategoryId = untracked(this.prevCategoryId);
|
|
12789
|
-
if (!prevCategoryId) {
|
|
12790
|
-
return;
|
|
12791
|
-
}
|
|
12792
|
-
this.subscription?.unsubscribe();
|
|
12793
|
-
this.subscription = this.treeStructNavigatorApiService
|
|
12794
|
-
.moveElement({
|
|
12795
|
-
type: "MOVING_TARGET_TREE_STRUCT" /* MovingType.TARGET_TREE_STRUCT */,
|
|
12796
|
-
movableItemId: targetId,
|
|
12797
|
-
treeStructTargetItemId: categoryId,
|
|
12798
|
-
treeStructMovableItemId: prevCategoryId
|
|
12799
|
-
}, this.config().requestOptions)
|
|
12800
|
-
.subscribe(() => this.prevCategoryId.set(categoryId));
|
|
12801
|
-
}
|
|
12802
|
-
createCriterion(categoryId) {
|
|
12803
|
-
this.criterionCreated.emit(categoryId);
|
|
12804
|
-
this.prevCategoryId.set(categoryId);
|
|
12805
|
-
}
|
|
12806
|
-
changeTitle(value, criterionId) {
|
|
12807
|
-
return this.criterionApiService.changeTitle(criterionId, value, this.config().requestOptions).pipe(finalize(() => this.criterion.update((prev) => ({
|
|
12808
|
-
...prev,
|
|
12809
|
-
storageElement: { ...prev.storageElement, title: value }
|
|
12810
|
-
}))));
|
|
12811
|
-
}
|
|
12812
|
-
changeDescription(value, criterionId) {
|
|
12813
|
-
if (!this.criterionApiService.changeDescription) {
|
|
12814
|
-
throw new Error('Change description not implemented');
|
|
12815
|
-
}
|
|
12816
|
-
return this.criterionApiService.changeDescription(criterionId, value, this.config().requestOptions).pipe(finalize(() => this.criterion.update((prev) => ({
|
|
12817
|
-
...prev,
|
|
12818
|
-
storageElement: { ...prev.storageElement, shortDescription: value }
|
|
12819
|
-
}))));
|
|
12820
|
-
}
|
|
12821
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12822
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiCriterionInfoComponent, isStandalone: true, selector: "cui-criterion-info", inputs: { criterion: { classPropertyName: "criterion", publicName: "criterion", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { criterion: "criterionChange", validationChanged: "validationChanged", criterionCreated: "criterionCreated" }, providers: [CuiSelectedCategoryService], viewQueries: [{ propertyName: "element", first: true, predicate: ["scrollContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <div\n #scrollContent\n class=\"content content_scrollable\"\n >\n <div class=\"category\">\n <cui-form-field>\n <label\n cuiLabel\n [for]=\"categoryId\"\n [isRequired]=\"true\"\n >\n {{ t('SELECT_CATEGORY') }}\n </label>\n <cui-categories\n [buttonId]=\"categoryId\"\n [treeStructType]=\"TYPE\"\n >\n <div class=\"select\">\n <span [style.color]=\"labelColor()\">\n {{ selectTitle() }}\n </span>\n\n <cui-svg icon=\"cuiIconChevronDown\" />\n </div>\n </cui-categories>\n </cui-form-field>\n </div>\n\n @let criterionData = criterion();\n @let editorConfigData = editorConfig();\n\n @if (editorConfigData && criterionData) {\n <cui-criterion-info-form\n [config]=\"editorConfigData\"\n [title]=\"criterionData.storageElement.title\"\n [description]=\"criterionData.storageElement.shortDescription\"\n [framerId]=\"criterionData.storageElement.framerCriterionId\"\n class=\"utility\"\n (isFormValidChanged)=\"onFormValidationChanged($event)\"\n (formChanged)=\"onFormChanged($event, criterionData.id)\"\n />\n }\n </div>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;height:100%}.content{height:calc(100vh - 109px)}.content_scrollable{overflow:auto}.category{padding-top:16px;padding-right:23px;padding-left:23px}.select{padding:7px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;height:36px;border-radius:8px;border:1px solid var(--cui-base-200);color:var(--cui-base-900);background:var(--cui-input)}.utility{--editor-height: none}\n"], dependencies: [{ kind: "ngmodule", type: CuiBadgeModule }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiCategoriesComponent, selector: "cui-categories", inputs: ["treeStructType", "buttonId", "disabled", "context"] }, { kind: "ngmodule", type: CuiDialogModule }, { kind: "ngmodule", type: CuiFormFieldModule }, { kind: "component", type: CuiFormFieldComponent, selector: "cui-form-field" }, { kind: "component", type: CuiCriterionInfoFormComponent, selector: "cui-criterion-info-form", inputs: ["title", "description", "framerId", "config"], outputs: ["formChanged", "isFormValidChanged"] }, { kind: "ngmodule", type: CuiLabelModule }, { kind: "component", type: CuiLabelComponent, selector: "label[cuiLabel]", inputs: ["isRequired"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: i4.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12823
|
-
}
|
|
12824
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, decorators: [{
|
|
12825
|
-
type: Component,
|
|
12826
|
-
args: [{ selector: 'cui-criterion-info', imports: [
|
|
12827
|
-
CuiBadgeModule,
|
|
12828
|
-
CuiButtonModule,
|
|
12829
|
-
CuiCategoriesComponent,
|
|
12830
|
-
CuiDialogModule,
|
|
12831
|
-
CuiFormFieldModule,
|
|
12832
|
-
CuiCriterionInfoFormComponent,
|
|
12833
|
-
CuiLabelModule,
|
|
12834
|
-
CuiSvgModule,
|
|
12835
|
-
TranslocoModule
|
|
12836
|
-
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiSelectedCategoryService], template: "<div\n class=\"wrapper\"\n *transloco=\"let t\"\n>\n <div\n #scrollContent\n class=\"content content_scrollable\"\n >\n <div class=\"category\">\n <cui-form-field>\n <label\n cuiLabel\n [for]=\"categoryId\"\n [isRequired]=\"true\"\n >\n {{ t('SELECT_CATEGORY') }}\n </label>\n <cui-categories\n [buttonId]=\"categoryId\"\n [treeStructType]=\"TYPE\"\n >\n <div class=\"select\">\n <span [style.color]=\"labelColor()\">\n {{ selectTitle() }}\n </span>\n\n <cui-svg icon=\"cuiIconChevronDown\" />\n </div>\n </cui-categories>\n </cui-form-field>\n </div>\n\n @let criterionData = criterion();\n @let editorConfigData = editorConfig();\n\n @if (editorConfigData && criterionData) {\n <cui-criterion-info-form\n [config]=\"editorConfigData\"\n [title]=\"criterionData.storageElement.title\"\n [description]=\"criterionData.storageElement.shortDescription\"\n [framerId]=\"criterionData.storageElement.framerCriterionId\"\n class=\"utility\"\n (isFormValidChanged)=\"onFormValidationChanged($event)\"\n (formChanged)=\"onFormChanged($event, criterionData.id)\"\n />\n }\n </div>\n</div>\n", styles: [".wrapper{display:flex;flex-direction:column;height:100%}.content{height:calc(100vh - 109px)}.content_scrollable{overflow:auto}.category{padding-top:16px;padding-right:23px;padding-left:23px}.select{padding:7px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;height:36px;border-radius:8px;border:1px solid var(--cui-base-200);color:var(--cui-base-900);background:var(--cui-input)}.utility{--editor-height: none}\n"] }]
|
|
12837
|
-
}], ctorParameters: () => [] });
|
|
12838
|
-
|
|
12839
|
-
class CuiSelectModalFolderComponent {
|
|
12840
|
-
constructor() {
|
|
12841
|
-
this.icon = computed(() => (this.isOpen() ? 'cuiIconFolderOpen' : 'cuiIconFolder'));
|
|
12842
|
-
this.title = input.required();
|
|
12843
|
-
this.buttonSlot = input.required();
|
|
12844
|
-
this.isOpen = input(false);
|
|
12845
|
-
}
|
|
12846
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12847
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiSelectModalFolderComponent, isStandalone: true, selector: "cui-select-modal-folder", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, buttonSlot: { classPropertyName: "buttonSlot", publicName: "buttonSlot", isSignal: true, isRequired: true, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<cui-card-wrapper class=\"wrapper\">\n <ng-container [ngTemplateOutlet]=\"buttonSlot()\" />\n\n <cui-svg\n [icon]=\"icon()\"\n class=\"icon\"\n />\n\n <span class=\"title\">{{ title() }}</span>\n</cui-card-wrapper>\n", styles: [":host{--border-color: var(--cui-base-200);--padding-horizontal: 8px;--padding-vertical: 8px}:host .wrapper{--border: var(--border-color);padding:var(--padding-vertical) var(--padding-horizontal)}.title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon{padding:2px}\n"], dependencies: [{ kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "component", type: CuiCardWrapperComponent, selector: "cui-card-wrapper, [cuiCardWrapper]", inputs: ["withBorder", "isSelected"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12848
|
-
}
|
|
12849
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, decorators: [{
|
|
12850
|
-
type: Component,
|
|
12851
|
-
args: [{ selector: 'cui-select-modal-folder', imports: [CuiSvgModule, CuiCardWrapperComponent, NgTemplateOutlet], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-card-wrapper class=\"wrapper\">\n <ng-container [ngTemplateOutlet]=\"buttonSlot()\" />\n\n <cui-svg\n [icon]=\"icon()\"\n class=\"icon\"\n />\n\n <span class=\"title\">{{ title() }}</span>\n</cui-card-wrapper>\n", styles: [":host{--border-color: var(--cui-base-200);--padding-horizontal: 8px;--padding-vertical: 8px}:host .wrapper{--border: var(--border-color);padding:var(--padding-vertical) var(--padding-horizontal)}.title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon{padding:2px}\n"] }]
|
|
12852
|
-
}] });
|
|
12853
|
-
|
|
12854
|
-
class CuiSelectModalSearchComponent {
|
|
12855
|
-
constructor() {
|
|
12856
|
-
this.destroyRef = inject(DestroyRef);
|
|
12857
|
-
this.searchControl = input(new FormControl(''));
|
|
12858
|
-
this.controlDelay = input(700);
|
|
12859
|
-
this.searchStringChanged = output();
|
|
12860
|
-
}
|
|
12861
|
-
ngOnInit() {
|
|
12862
|
-
this.searchControl()
|
|
12863
|
-
.valueChanges.pipe(debounceTime(this.controlDelay()), takeUntilDestroyed(this.destroyRef))
|
|
12864
|
-
.subscribe((value) => this.searchStringChanged.emit(value));
|
|
12865
|
-
}
|
|
12866
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12867
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiSelectModalSearchComponent, isStandalone: true, selector: "cui-select-modal-search", inputs: { searchControl: { classPropertyName: "searchControl", publicName: "searchControl", isSignal: true, isRequired: false, transformFunction: null }, controlDelay: { classPropertyName: "controlDelay", publicName: "controlDelay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchStringChanged: "searchStringChanged" }, ngImport: i0, template: "<cui-input-text\n cuiTextFieldPlaceholder=\"Search...\"\n cuiTextFieldIconLeft=\"cuiIconSearch\"\n [formControl]=\"searchControl()\"\n class=\"search\"\n/>\n<button\n class=\"filters\"\n type=\"button\"\n cuiIconButton\n icon=\"cuiIconFiltersLines\"\n></button>\n", styles: [":host{padding-right:15px;display:flex;align-items:center;gap:4px}.search{width:100%}.filters{padding:4px;width:auto;height:auto}\n"], dependencies: [{ kind: "ngmodule", type: CuiInputModule }, { kind: "component", type: CuiInputTextComponent, selector: "cui-input-text" }, { kind: "directive", type: CuiTextFieldIconLeftDirective, selector: "[cuiTextFieldIconLeft]", inputs: ["cuiTextFieldIconLeft"] }, { kind: "directive", type: CuiTextFieldPlaceholderDirective, selector: "[cuiTextFieldPlaceholder]", inputs: ["cuiTextFieldPlaceholder"] }, { kind: "ngmodule", type: CuiIconButtonModule }, { kind: "component", type: CuiIconButtonComponent, selector: "button[cuiIconButton][icon], a[cuiIconButton][icon]", inputs: ["icon", "color", "hoverColor"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12868
|
-
}
|
|
12869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, decorators: [{
|
|
12870
|
-
type: Component,
|
|
12871
|
-
args: [{ selector: 'cui-select-modal-search', imports: [CuiInputModule, CuiIconButtonModule, ReactiveFormsModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-input-text\n cuiTextFieldPlaceholder=\"Search...\"\n cuiTextFieldIconLeft=\"cuiIconSearch\"\n [formControl]=\"searchControl()\"\n class=\"search\"\n/>\n<button\n class=\"filters\"\n type=\"button\"\n cuiIconButton\n icon=\"cuiIconFiltersLines\"\n></button>\n", styles: [":host{padding-right:15px;display:flex;align-items:center;gap:4px}.search{width:100%}.filters{padding:4px;width:auto;height:auto}\n"] }]
|
|
12872
|
-
}] });
|
|
12873
|
-
|
|
12874
|
-
class CuiSelectModalComponent {
|
|
12875
|
-
constructor() {
|
|
12876
|
-
this.context = inject(CUI_DIALOG_CONTEXT);
|
|
12877
|
-
this.data = this.context.data;
|
|
12878
|
-
this.heading = this.data.heading;
|
|
12879
|
-
this.leftData = this.data.leftData;
|
|
12880
|
-
this.rightData = this.data.rightData;
|
|
12881
|
-
}
|
|
12882
|
-
onCancel() {
|
|
12883
|
-
this.context.completeWith();
|
|
12884
|
-
}
|
|
12885
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12886
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiSelectModalComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"content\">\n <header\n class=\"header\"\n cuiDialogHeader\n [heading]=\"heading\"\n (closed)=\"onCancel()\"\n ></header>\n <div class=\"wrapper\">\n <div class=\"left-block\">\n @if (leftData) {\n <ng-container\n [ngComponentOutlet]=\"leftData.component\"\n [ngComponentOutletInputs]=\"leftData.inputs\"\n />\n }\n </div>\n <div class=\"right-block\">\n @if (rightData) {\n <ng-container\n [ngComponentOutlet]=\"rightData.component\"\n [ngComponentOutletInputs]=\"rightData.inputs\"\n />\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".header{padding-right:16px;padding-left:16px}.content{display:flex;flex-direction:column;height:calc(100vh - 180px)}.wrapper{display:flex;flex-direction:row;flex-grow:1;border-top:1px solid var(--cui-base-200);width:100%;min-height:400px;overflow-y:hidden}.left-block{padding-left:16px;padding-top:19px;flex-shrink:0;display:flex;flex-direction:column;gap:16px;width:50%;border-right:1px solid var(--cui-base-200)}.right-block{position:relative;width:50%;overflow:hidden}.right-block__head{padding:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--cui-base-200)}.right-block__title{font-weight:500;font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.right-block__subtitle{font-weight:400;font-size:14px;line-height:20px;margin-bottom:16px;text-transform:uppercase;color:var(--cui-base-500)}\n"], dependencies: [{ kind: "ngmodule", type: CuiButtonModule }, { kind: "ngmodule", type: CuiDialogModule }, { kind: "component", type: CuiDialogHeaderComponent, selector: "header[cuiDialogHeader][heading]", inputs: ["heading", "headingContext", "subheading"], outputs: ["closed"] }, { kind: "ngmodule", type: CuiIconButtonModule }, { kind: "ngmodule", type: CuiInputModule }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12887
|
-
}
|
|
12888
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, decorators: [{
|
|
12889
|
-
type: Component,
|
|
12890
|
-
args: [{ imports: [
|
|
12891
|
-
CuiButtonModule,
|
|
12892
|
-
CuiDialogModule,
|
|
12893
|
-
CuiIconButtonModule,
|
|
12894
|
-
CuiInputModule,
|
|
12895
|
-
NgComponentOutlet,
|
|
12896
|
-
TranslocoDirective
|
|
12897
|
-
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <div class=\"content\">\n <header\n class=\"header\"\n cuiDialogHeader\n [heading]=\"heading\"\n (closed)=\"onCancel()\"\n ></header>\n <div class=\"wrapper\">\n <div class=\"left-block\">\n @if (leftData) {\n <ng-container\n [ngComponentOutlet]=\"leftData.component\"\n [ngComponentOutletInputs]=\"leftData.inputs\"\n />\n }\n </div>\n <div class=\"right-block\">\n @if (rightData) {\n <ng-container\n [ngComponentOutlet]=\"rightData.component\"\n [ngComponentOutletInputs]=\"rightData.inputs\"\n />\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".header{padding-right:16px;padding-left:16px}.content{display:flex;flex-direction:column;height:calc(100vh - 180px)}.wrapper{display:flex;flex-direction:row;flex-grow:1;border-top:1px solid var(--cui-base-200);width:100%;min-height:400px;overflow-y:hidden}.left-block{padding-left:16px;padding-top:19px;flex-shrink:0;display:flex;flex-direction:column;gap:16px;width:50%;border-right:1px solid var(--cui-base-200)}.right-block{position:relative;width:50%;overflow:hidden}.right-block__head{padding:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--cui-base-200)}.right-block__title{font-weight:500;font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.right-block__subtitle{font-weight:400;font-size:14px;line-height:20px;margin-bottom:16px;text-transform:uppercase;color:var(--cui-base-500)}\n"] }]
|
|
12898
|
-
}] });
|
|
12899
|
-
|
|
12900
|
-
class CuiSelectModalService {
|
|
12901
|
-
constructor() {
|
|
12902
|
-
this.selectedElementSignal = signal(null);
|
|
12903
|
-
this.selectedElement = this.selectedElementSignal.asReadonly();
|
|
12904
|
-
}
|
|
12905
|
-
getSelectedData() {
|
|
12906
|
-
return this.selectedElementSignal.asReadonly();
|
|
12907
|
-
}
|
|
12908
|
-
set(element) {
|
|
12909
|
-
this.selectedElementSignal.set(element);
|
|
12910
|
-
}
|
|
12911
|
-
delete() {
|
|
12912
|
-
this.selectedElementSignal.set(null);
|
|
12913
|
-
}
|
|
12914
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12915
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService }); }
|
|
12916
|
-
}
|
|
12917
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService, decorators: [{
|
|
12918
|
-
type: Injectable
|
|
12919
|
-
}] });
|
|
12920
|
-
|
|
12921
|
-
const CUI_STORAGE_LIST_SERVICE_TOKEN = new InjectionToken('STORAGE_LIST_SERVICE_TOKEN');
|
|
12922
|
-
|
|
12923
|
-
class CuiStorageListItemComponent {
|
|
12924
|
-
constructor() {
|
|
12925
|
-
this.storageListService = inject(CUI_STORAGE_LIST_SERVICE_TOKEN);
|
|
12926
|
-
this.isLoadingChildren = false;
|
|
12927
|
-
this.isLoadingElements = false;
|
|
12928
|
-
this.storageChildren = signal([]);
|
|
12929
|
-
this.storageElements = signal([]);
|
|
12930
|
-
this.areContentOpened = signal(false);
|
|
12931
|
-
this.openCloseButtonIcon = computed(() => this.areContentOpened() ? 'cuiIconChevronDown' : 'cuiIconChevronRight');
|
|
12932
|
-
this.hasContent = computed(() => this.storage().children.length || this.storageChildren().length || this.storageElements().length);
|
|
12933
|
-
this.storage = input.required();
|
|
12934
|
-
this.elementSlot = input();
|
|
12935
|
-
this.itemSlot = input();
|
|
12936
|
-
this.initStorageChildrenEffect();
|
|
12937
|
-
this.initStorageElementsEffect();
|
|
12938
|
-
}
|
|
12939
|
-
onToggleChildren(event) {
|
|
12940
|
-
event.preventDefault();
|
|
12941
|
-
this.areContentOpened.update((prevAreChildrenOpened) => !prevAreChildrenOpened);
|
|
12942
|
-
}
|
|
12943
|
-
initStorageChildrenEffect() {
|
|
12944
|
-
effect(() => {
|
|
12945
|
-
const storage = this.storage();
|
|
12946
|
-
this.areContentOpened();
|
|
12947
|
-
untracked(this.setChildren.bind(this, storage));
|
|
12948
|
-
});
|
|
12949
|
-
}
|
|
12950
|
-
initStorageElementsEffect() {
|
|
12951
|
-
effect(() => {
|
|
12952
|
-
const storage = this.storage();
|
|
12953
|
-
untracked(this.setElements.bind(this, storage));
|
|
12954
|
-
});
|
|
12955
|
-
}
|
|
12956
|
-
setChildren(storage) {
|
|
12957
|
-
const storageChildren = storage.children;
|
|
12958
|
-
if (!storageChildren.length) {
|
|
12959
|
-
this.storageChildren.set([]);
|
|
12960
|
-
}
|
|
12961
|
-
if (this.isLoadingChildren || !this.areContentOpened()) {
|
|
12962
|
-
return;
|
|
12963
|
-
}
|
|
12964
|
-
if (typeof storageChildren[0] !== 'string') {
|
|
12965
|
-
this.storageChildren.set(storageChildren);
|
|
12966
|
-
return;
|
|
12967
|
-
}
|
|
12968
|
-
this.isLoadingChildren = true;
|
|
12969
|
-
this.storageListService
|
|
12970
|
-
.getChildren?.(storage, this.storageChildren())
|
|
12971
|
-
.pipe(finalize(() => (this.isLoadingChildren = false)))
|
|
12972
|
-
.subscribe((response) => this.storageChildren.set(response));
|
|
12973
|
-
}
|
|
12974
|
-
setElements(storage) {
|
|
12975
|
-
const storageElements = storage.elements;
|
|
12976
|
-
if (this.isLoadingElements) {
|
|
12977
|
-
return;
|
|
12978
|
-
}
|
|
12979
|
-
if (!storageElements?.length) {
|
|
12980
|
-
this.storageElements.set([]);
|
|
12981
|
-
return;
|
|
12982
|
-
}
|
|
12983
|
-
if (this.storageElements().length) {
|
|
12984
|
-
this.storageElements.set(storageElements);
|
|
12985
|
-
return;
|
|
12986
|
-
}
|
|
12987
|
-
this.isLoadingElements = true;
|
|
12988
|
-
this.storageListService
|
|
12989
|
-
.getElements?.(storage, this.storageElements())
|
|
12990
|
-
.pipe(finalize(() => (this.isLoadingElements = false)))
|
|
12991
|
-
.subscribe((response) => this.storageElements.set(response));
|
|
12992
|
-
}
|
|
12993
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12994
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiStorageListItemComponent, isStandalone: true, selector: "li[cuiStorageListItem]", inputs: { storage: { classPropertyName: "storage", publicName: "storage", isSignal: true, isRequired: true, transformFunction: null }, elementSlot: { classPropertyName: "elementSlot", publicName: "elementSlot", isSignal: true, isRequired: false, transformFunction: null }, itemSlot: { classPropertyName: "itemSlot", publicName: "itemSlot", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *cuiLet=\"storage() as storage\">\n <div class=\"wrapper\">\n <ng-template #openCloseButton>\n @if (hasContent()) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onToggleChildren($event)\"\n >\n <cui-svg\n [icon]=\"openCloseButtonIcon()\"\n color=\"var(--cui-base-500)\"\n />\n </button>\n }\n </ng-template>\n\n @if (itemSlot(); as item) {\n <ng-container\n *ngTemplateOutlet=\"\n item;\n context: {\n $implicit: storage,\n openCloseButton,\n areContentOpened: areContentOpened(),\n hasContent: hasContent()\n }\n \"\n />\n }\n\n <div\n class=\"content\"\n [class.content_hidden]=\"!areContentOpened()\"\n >\n <div class=\"lists\">\n @if (storageChildren().length) {\n <cui-storage-list\n [storages]=\"storageChildren()\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n />\n }\n @if (storageElements().length && elementSlot()) {\n <ul class=\"list\">\n @for (element of storageElements(); track element.id) {\n <li class=\"item\">\n <ng-container\n *ngTemplateOutlet=\"\n elementSlot()!;\n context: { $implicit: element, storage: storage }\n \"\n />\n </li>\n }\n </ul>\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".button{padding:2px;display:flex;border-radius:4px}@media (hover: hover){.button:hover{background:var(--cui-base-200)}}.button :active{background:var(--cui-base-200)}.icon{padding:2px}.wrapper{display:flex;flex-direction:column;gap:8px}.content{padding-left:20px}.content_hidden{display:none}.lists{display:flex;flex-direction:column;gap:8px;position:relative}.lists>*{z-index:1}.lists:has(>:nth-child(2)):before{content:\"\";position:absolute;top:0;bottom:0;left:8px;border-left:1px solid var(--cui-base-200)}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => CuiLetDirective), selector: "[cuiLet]", inputs: ["cuiLet"] }, { kind: "ngmodule", type: i0.forwardRef(() => CuiSvgModule) }, { kind: "component", type: i0.forwardRef(() => CuiSvgComponent), selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i0.forwardRef(() => CuiStorageListComponent), selector: "cui-storage-list", inputs: ["storages", "elementSlot", "itemSlot"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12995
|
-
}
|
|
12996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, decorators: [{
|
|
12997
|
-
type: Component,
|
|
12998
|
-
args: [{ selector: 'li[cuiStorageListItem]', imports: [CuiLetDirective, CuiSvgModule, NgTemplateOutlet, forwardRef(() => CuiStorageListComponent)], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *cuiLet=\"storage() as storage\">\n <div class=\"wrapper\">\n <ng-template #openCloseButton>\n @if (hasContent()) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onToggleChildren($event)\"\n >\n <cui-svg\n [icon]=\"openCloseButtonIcon()\"\n color=\"var(--cui-base-500)\"\n />\n </button>\n }\n </ng-template>\n\n @if (itemSlot(); as item) {\n <ng-container\n *ngTemplateOutlet=\"\n item;\n context: {\n $implicit: storage,\n openCloseButton,\n areContentOpened: areContentOpened(),\n hasContent: hasContent()\n }\n \"\n />\n }\n\n <div\n class=\"content\"\n [class.content_hidden]=\"!areContentOpened()\"\n >\n <div class=\"lists\">\n @if (storageChildren().length) {\n <cui-storage-list\n [storages]=\"storageChildren()\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n />\n }\n @if (storageElements().length && elementSlot()) {\n <ul class=\"list\">\n @for (element of storageElements(); track element.id) {\n <li class=\"item\">\n <ng-container\n *ngTemplateOutlet=\"\n elementSlot()!;\n context: { $implicit: element, storage: storage }\n \"\n />\n </li>\n }\n </ul>\n }\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".button{padding:2px;display:flex;border-radius:4px}@media (hover: hover){.button:hover{background:var(--cui-base-200)}}.button :active{background:var(--cui-base-200)}.icon{padding:2px}.wrapper{display:flex;flex-direction:column;gap:8px}.content{padding-left:20px}.content_hidden{display:none}.lists{display:flex;flex-direction:column;gap:8px;position:relative}.lists>*{z-index:1}.lists:has(>:nth-child(2)):before{content:\"\";position:absolute;top:0;bottom:0;left:8px;border-left:1px solid var(--cui-base-200)}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"] }]
|
|
12999
|
-
}], ctorParameters: () => [] });
|
|
13000
|
-
|
|
13001
|
-
class CuiStorageListComponent {
|
|
13002
|
-
constructor() {
|
|
13003
|
-
this.storages = input.required();
|
|
13004
|
-
this.elementSlot = input();
|
|
13005
|
-
this.itemSlot = input();
|
|
13006
|
-
}
|
|
13007
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13008
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiStorageListComponent, isStandalone: true, selector: "cui-storage-list", inputs: { storages: { classPropertyName: "storages", publicName: "storages", isSignal: true, isRequired: true, transformFunction: null }, elementSlot: { classPropertyName: "elementSlot", publicName: "elementSlot", isSignal: true, isRequired: false, transformFunction: null }, itemSlot: { classPropertyName: "itemSlot", publicName: "itemSlot", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ul class=\"list\">\n @for (storage of storages(); track storage.id) {\n <li\n cuiStorageListItem\n [storage]=\"storage\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n class=\"item\"\n ></li>\n }\n</ul>\n", styles: [":host{display:block}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative;z-index:0}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"], dependencies: [{ kind: "component", type: CuiStorageListItemComponent, selector: "li[cuiStorageListItem]", inputs: ["storage", "elementSlot", "itemSlot"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13009
|
-
}
|
|
13010
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListComponent, decorators: [{
|
|
13011
|
-
type: Component,
|
|
13012
|
-
args: [{ selector: 'cui-storage-list', imports: [CuiStorageListItemComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"list\">\n @for (storage of storages(); track storage.id) {\n <li\n cuiStorageListItem\n [storage]=\"storage\"\n [elementSlot]=\"elementSlot()\"\n [itemSlot]=\"itemSlot()\"\n class=\"item\"\n ></li>\n }\n</ul>\n", styles: [":host{display:block}.list{display:flex;flex-direction:column;gap:8px}.item{position:relative;z-index:0}.item:not(:last-child):before{content:\"\";position:absolute;top:0;left:8px;bottom:-8px;z-index:-1;width:1px;background:var(--cui-base-200)}\n"] }]
|
|
13013
|
-
}] });
|
|
13014
|
-
|
|
13015
13015
|
class CuiActivityBaseService {
|
|
13016
13016
|
constructor() {
|
|
13017
13017
|
this.userCompanyApiService = inject(UserCompanyApiService);
|