@cuby-ui/core 0.0.610 → 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.
@@ -10770,9 +10770,19 @@ class CuiCheckListBlockService {
10770
10770
  this.checkListItemsSignal = signal(null);
10771
10771
  this.componentIdSignal = signal(null);
10772
10772
  this.isDragAvailableSignal = signal(false);
10773
+ this.titleInvalidityByIdSignal = signal({});
10774
+ this.descriptionInvalidityByIdSignal = signal({});
10775
+ this.isDescriptionRequiredSignal = signal(false);
10773
10776
  this.checkListItems = this.checkListItemsSignal.asReadonly();
10774
10777
  this.componentId = this.componentIdSignal.asReadonly();
10775
10778
  this.isDragAvailable = this.isDragAvailableSignal.asReadonly();
10779
+ this.isDescriptionRequired = this.isDescriptionRequiredSignal.asReadonly();
10780
+ this.isTitleReady = computed(() => this.hasEveryItemReported(this.titleInvalidityByIdSignal()));
10781
+ this.isTitleValid = computed(() => !this.hasInvalidItem(this.titleInvalidityByIdSignal()));
10782
+ this.isDescriptionReady = computed(() => this.isDescriptionRequiredSignal()
10783
+ ? this.hasEveryItemReported(this.descriptionInvalidityByIdSignal())
10784
+ : !!this.checkListItemsSignal());
10785
+ this.isDescriptionValid = computed(() => !this.isDescriptionRequiredSignal() || !this.hasInvalidItem(this.descriptionInvalidityByIdSignal()));
10776
10786
  }
10777
10787
  setCheckListItems(checkListItems) {
10778
10788
  this.checkListItemsSignal.set(checkListItems);
@@ -10806,6 +10816,29 @@ class CuiCheckListBlockService {
10806
10816
  toggleDragPermission(isDragButtonVisible) {
10807
10817
  this.isDragAvailableSignal.set(isDragButtonVisible);
10808
10818
  }
10819
+ setDescriptionRequired(isRequired) {
10820
+ this.isDescriptionRequiredSignal.set(isRequired);
10821
+ }
10822
+ setItemTitleInvalidity(id, isInvalid) {
10823
+ this.titleInvalidityByIdSignal.update((invalidityById) => ({ ...invalidityById, [id]: isInvalid }));
10824
+ }
10825
+ setItemDescriptionInvalidity(id, isInvalid) {
10826
+ this.descriptionInvalidityByIdSignal.update((invalidityById) => ({ ...invalidityById, [id]: isInvalid }));
10827
+ }
10828
+ removeItemValidity(id) {
10829
+ this.titleInvalidityByIdSignal.update((invalidityById) => this.omitItem(invalidityById, id));
10830
+ this.descriptionInvalidityByIdSignal.update((invalidityById) => this.omitItem(invalidityById, id));
10831
+ }
10832
+ hasEveryItemReported(invalidityById) {
10833
+ const checkListItems = this.checkListItemsSignal();
10834
+ return !!checkListItems && checkListItems.every((checkListItem) => checkListItem.id in invalidityById);
10835
+ }
10836
+ hasInvalidItem(invalidityById) {
10837
+ return Object.values(invalidityById).some((isInvalid) => isInvalid);
10838
+ }
10839
+ omitItem(invalidityById, id) {
10840
+ return Object.fromEntries(Object.entries(invalidityById).filter(([itemId]) => itemId !== id));
10841
+ }
10809
10842
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCheckListBlockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
10810
10843
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCheckListBlockService }); }
10811
10844
  }
@@ -11034,10 +11067,12 @@ class CuiChecklistBlockListItemContainerComponent {
11034
11067
  this.nodeCheckListApiService = inject(CuiNodeChecklistApiService);
11035
11068
  this.DEFAULT_CONTROL_DELAY = 700;
11036
11069
  this.isOpen = signal(false);
11070
+ this.isDescriptionEmpty = signal(false);
11037
11071
  this.checkListBlockItem = input.required();
11038
11072
  this.config = input.required();
11039
11073
  this.index = input(0);
11040
11074
  this.componentId = this.checkListBlockService.componentId;
11075
+ this.isDescriptionRequired = this.checkListBlockService.isDescriptionRequired;
11041
11076
  this.rotate = computed(() => `rotate(${this.isOpen() ? '0deg' : '-90deg'})`);
11042
11077
  this.headerText = computed(() => this.checkListItem().title ? this.checkListItem().title : this.translocoService.translate('UNTITLED'));
11043
11078
  this.checkListItem = computed(() => this.checkListBlockItem().content);
@@ -11088,6 +11123,9 @@ class CuiChecklistBlockListItemContainerComponent {
11088
11123
  ngOnInit() {
11089
11124
  this.initControls();
11090
11125
  }
11126
+ ngOnDestroy() {
11127
+ this.destroyItemValidity();
11128
+ }
11091
11129
  onRowToggle() {
11092
11130
  this.isOpen.update((prev) => !prev);
11093
11131
  }
@@ -11097,14 +11135,25 @@ class CuiChecklistBlockListItemContainerComponent {
11097
11135
  onProhibitDrag() {
11098
11136
  this.checkListBlockService.toggleDragPermission(false);
11099
11137
  }
11138
+ onDescriptionEmpty(isEmpty) {
11139
+ this.isDescriptionEmpty.set(isEmpty);
11140
+ this.checkListBlockService.setItemDescriptionInvalidity(this.checkListItem().id, isEmpty);
11141
+ }
11100
11142
  initControls() {
11101
11143
  this.initTitleControlValue();
11144
+ this.initTitleControlValidity();
11102
11145
  this.initTitleControlSubscription();
11103
11146
  }
11104
11147
  initTitleControlValue() {
11105
11148
  this.titleControl.enable();
11106
11149
  this.titleControl.setValue(this.checkListItem().title ? this.checkListItem().title : '');
11107
11150
  }
11151
+ initTitleControlValidity() {
11152
+ this.reportTitleValidity();
11153
+ this.titleControl.statusChanges
11154
+ .pipe(takeUntilDestroyed(this.destroyRef))
11155
+ .subscribe(() => this.reportTitleValidity());
11156
+ }
11108
11157
  initTitleControlSubscription() {
11109
11158
  this.titleControl.valueChanges
11110
11159
  .pipe(debounceTime(this.DEFAULT_CONTROL_DELAY), distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
@@ -11122,6 +11171,12 @@ class CuiChecklistBlockListItemContainerComponent {
11122
11171
  });
11123
11172
  });
11124
11173
  }
11174
+ destroyItemValidity() {
11175
+ this.checkListBlockService.removeItemValidity(this.checkListItem().id);
11176
+ }
11177
+ reportTitleValidity() {
11178
+ this.checkListBlockService.setItemTitleInvalidity(this.checkListItem().id, this.titleControl.invalid);
11179
+ }
11125
11180
  openDeleteChecklistNodeModal() {
11126
11181
  const content = ['THIS_ACTION_WILL_PERMANENTLY_DELETE_THE_ITEM_FROM_CHECKLIST'];
11127
11182
  this.cuiDialogService
@@ -11135,7 +11190,7 @@ class CuiChecklistBlockListItemContainerComponent {
11135
11190
  .subscribe((data) => data?.canceled || this.checkListBlockService.deleteCheckListItem(this.checkListItem().id));
11136
11191
  }
11137
11192
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiChecklistBlockListItemContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11138
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiChecklistBlockListItemContainerComponent, isStandalone: true, selector: "cui-checklist-block-list-item-container", inputs: { checkListBlockItem: { classPropertyName: "checkListBlockItem", publicName: "checkListBlockItem", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <ng-container *cuiLet=\"checkListItemWithOptions() as checkListItem\">\n <header\n class=\"header\"\n [style.border-left-color]=\"headerBorderColor()\"\n [class.header__opened]=\"isOpen()\"\n >\n <button\n class=\"icon-drag\"\n cuiButton\n cuiDragPointer\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [icon]=\"'cuiIconDragHandleDots'\"\n (mouseenter)=\"onAllowDrag()\"\n (mouseleave)=\"onProhibitDrag()\"\n ></button>\n <button\n cuiButton\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [style.transform]=\"rotate()\"\n icon=\"cuiIconCaretDownFillXxs\"\n (click)=\"onRowToggle()\"\n ></button>\n <cui-svg\n [icon]=\"iconChecklistType()\"\n color=\"var(--cui-base-500)\"\n />\n <div class=\"header__content\">\n <div class=\"header__numeration\">{{ index() }}.</div>\n <div class=\"header__text\">{{ headerText() }}</div>\n </div>\n @if (isTitleEmpty) {\n <cui-svg\n [cuiTooltip]=\"t('TITLE_IS_REQUIRED')\"\n icon=\"cuiIconAlertTriangle\"\n color=\"var(--cui-danger)\"\n class=\"icon\"\n />\n }\n <button\n #actionButton=\"elementRef\"\n cuiButton\n type=\"button\"\n cuiElement\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconMoreVertical\"\n class=\"list__context-menu-button\"\n ></button>\n <cui-context-menu\n [items]=\"checkListItem.options\"\n [target]=\"actionButton.nativeElement\"\n />\n </header>\n @if (isOpen()) {\n <div class=\"info\">\n <cui-checklist-block-title-control [control]=\"titleControl\" />\n <cui-editor-block\n [config]=\"config()\"\n [editorId]=\"checkListItem.textContainerId!\"\n [title]=\"titleControl.value\"\n />\n </div>\n <ng-container\n [ngComponentOutlet]=\"checkListItemComponent()\"\n [ngComponentOutletInputs]=\"{\n checkListItem: checkListItem\n }\"\n />\n }\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:16px;border-radius:inherit;background-color:var(--cui-base-0)}.header{padding-right:7px;padding-left:7px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:4px;background:var(--cui-base-0);border-radius:inherit;border-left:6px solid var(--cui-yellow-bg)}.header__content{display:flex;flex-direction:row;align-items:center;gap:8px;flex:1}.header__numeration{font-weight:600;font-size:13px;line-height:16px;padding-right:8px;padding-left:8px;display:flex;justify-content:center;align-items:center}.header__text{font-weight:500;font-size:14px;line-height:20px;padding-top:11px;padding-bottom:11px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.header__opened{background:var(--cui-badge-blue-bg);border-bottom:.5px solid var(--cui-base-200);border-bottom-left-radius:0;border-bottom-right-radius:0}.header:hover{background:var(--cui-base-10)}.info{padding-right:15px;padding-left:15px;display:flex;flex-direction:column;gap:16px}.icon{padding:6px;width:max-content}\n"], dependencies: [{ kind: "directive", type: CuiTooltipDirective, selector: "[cuiTooltip]:not(ng-container):not(ng-template)", inputs: ["cuiTooltipContext", "cuiTooltipAppearance", "cuiTooltip"] }, { kind: "component", type: CuiEditorBlockComponent, selector: "cui-editor-block", inputs: ["title", "editorId", "config", "required"], outputs: ["editorEmpty"] }, { kind: "component", type: CuiChecklistBlockTitleControlComponent, selector: "cui-checklist-block-title-control", inputs: ["control"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "ngmodule", type: CuiContextMenuModule }, { kind: "component", type: CuiContextMenuComponent, selector: "cui-context-menu[items][target]", inputs: ["items", "target", "width", "withPaddings"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }, { kind: "ngmodule", type: CuiLabelModule }, { kind: "directive", type: CuiLetDirective, selector: "[cuiLet]", inputs: ["cuiLet"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { 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"] }, { kind: "directive", type: CuiDragPointerDirective, selector: "[cuiDragPointer]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11193
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiChecklistBlockListItemContainerComponent, isStandalone: true, selector: "cui-checklist-block-list-item-container", inputs: { checkListBlockItem: { classPropertyName: "checkListBlockItem", publicName: "checkListBlockItem", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <ng-container *cuiLet=\"checkListItemWithOptions() as checkListItem\">\n <header\n class=\"header\"\n [style.border-left-color]=\"headerBorderColor()\"\n [class.header__opened]=\"isOpen()\"\n >\n <button\n class=\"icon-drag\"\n cuiButton\n cuiDragPointer\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [icon]=\"'cuiIconDragHandleDots'\"\n (mouseenter)=\"onAllowDrag()\"\n (mouseleave)=\"onProhibitDrag()\"\n ></button>\n <button\n cuiButton\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [style.transform]=\"rotate()\"\n icon=\"cuiIconCaretDownFillXxs\"\n (click)=\"onRowToggle()\"\n ></button>\n <cui-svg\n [icon]=\"iconChecklistType()\"\n color=\"var(--cui-base-500)\"\n />\n <div class=\"header__content\">\n <div class=\"header__numeration\">{{ index() }}.</div>\n <div class=\"header__text\">{{ headerText() }}</div>\n </div>\n @if (isTitleEmpty) {\n <cui-svg\n [cuiTooltip]=\"t('TITLE_IS_REQUIRED')\"\n icon=\"cuiIconAlertTriangle\"\n color=\"var(--cui-danger)\"\n class=\"icon\"\n />\n }\n @if (isDescriptionRequired() && isDescriptionEmpty()) {\n <cui-svg\n [cuiTooltip]=\"t('DESCRIPTION_IS_REQUIRED')\"\n icon=\"cuiIconAlertTriangle\"\n color=\"var(--cui-danger)\"\n class=\"icon\"\n />\n }\n <button\n #actionButton=\"elementRef\"\n cuiButton\n type=\"button\"\n cuiElement\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconMoreVertical\"\n class=\"list__context-menu-button\"\n ></button>\n <cui-context-menu\n [items]=\"checkListItem.options\"\n [target]=\"actionButton.nativeElement\"\n />\n </header>\n @if (isOpen() || isDescriptionRequired()) {\n <div\n class=\"info\"\n [class.info_hidden]=\"!isOpen()\"\n >\n <cui-checklist-block-title-control [control]=\"titleControl\" />\n <cui-editor-block\n [config]=\"config()\"\n [editorId]=\"checkListItem.textContainerId!\"\n [required]=\"isDescriptionRequired()\"\n [title]=\"titleControl.value\"\n (editorEmpty)=\"onDescriptionEmpty($event)\"\n />\n </div>\n }\n @if (isOpen()) {\n <ng-container\n [ngComponentOutlet]=\"checkListItemComponent()\"\n [ngComponentOutletInputs]=\"{\n checkListItem: checkListItem\n }\"\n />\n }\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:16px;border-radius:inherit;background-color:var(--cui-base-0)}.header{padding-right:7px;padding-left:7px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:4px;background:var(--cui-base-0);border-radius:inherit;border-left:6px solid var(--cui-yellow-bg)}.header__content{display:flex;flex-direction:row;align-items:center;gap:8px;flex:1}.header__numeration{font-weight:600;font-size:13px;line-height:16px;padding-right:8px;padding-left:8px;display:flex;justify-content:center;align-items:center}.header__text{font-weight:500;font-size:14px;line-height:20px;padding-top:11px;padding-bottom:11px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.header__opened{background:var(--cui-badge-blue-bg);border-bottom:.5px solid var(--cui-base-200);border-bottom-left-radius:0;border-bottom-right-radius:0}.header:hover{background:var(--cui-base-10)}.info{padding-right:15px;padding-left:15px;display:flex;flex-direction:column;gap:16px}.info_hidden{display:none}.icon{padding:6px;width:max-content}\n"], dependencies: [{ kind: "directive", type: CuiTooltipDirective, selector: "[cuiTooltip]:not(ng-container):not(ng-template)", inputs: ["cuiTooltipContext", "cuiTooltipAppearance", "cuiTooltip"] }, { kind: "component", type: CuiEditorBlockComponent, selector: "cui-editor-block", inputs: ["title", "editorId", "config", "required"], outputs: ["editorEmpty"] }, { kind: "component", type: CuiChecklistBlockTitleControlComponent, selector: "cui-checklist-block-title-control", inputs: ["control"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "ngmodule", type: CuiContextMenuModule }, { kind: "component", type: CuiContextMenuComponent, selector: "cui-context-menu[items][target]", inputs: ["items", "target", "width", "withPaddings"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }, { kind: "ngmodule", type: CuiLabelModule }, { kind: "directive", type: CuiLetDirective, selector: "[cuiLet]", inputs: ["cuiLet"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { 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"] }, { kind: "directive", type: CuiDragPointerDirective, selector: "[cuiDragPointer]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11139
11194
  }
11140
11195
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiChecklistBlockListItemContainerComponent, decorators: [{
11141
11196
  type: Component,
@@ -11152,7 +11207,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
11152
11207
  NgComponentOutlet,
11153
11208
  TranslocoDirective,
11154
11209
  CuiDragPointerDirective
11155
- ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <ng-container *cuiLet=\"checkListItemWithOptions() as checkListItem\">\n <header\n class=\"header\"\n [style.border-left-color]=\"headerBorderColor()\"\n [class.header__opened]=\"isOpen()\"\n >\n <button\n class=\"icon-drag\"\n cuiButton\n cuiDragPointer\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [icon]=\"'cuiIconDragHandleDots'\"\n (mouseenter)=\"onAllowDrag()\"\n (mouseleave)=\"onProhibitDrag()\"\n ></button>\n <button\n cuiButton\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [style.transform]=\"rotate()\"\n icon=\"cuiIconCaretDownFillXxs\"\n (click)=\"onRowToggle()\"\n ></button>\n <cui-svg\n [icon]=\"iconChecklistType()\"\n color=\"var(--cui-base-500)\"\n />\n <div class=\"header__content\">\n <div class=\"header__numeration\">{{ index() }}.</div>\n <div class=\"header__text\">{{ headerText() }}</div>\n </div>\n @if (isTitleEmpty) {\n <cui-svg\n [cuiTooltip]=\"t('TITLE_IS_REQUIRED')\"\n icon=\"cuiIconAlertTriangle\"\n color=\"var(--cui-danger)\"\n class=\"icon\"\n />\n }\n <button\n #actionButton=\"elementRef\"\n cuiButton\n type=\"button\"\n cuiElement\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconMoreVertical\"\n class=\"list__context-menu-button\"\n ></button>\n <cui-context-menu\n [items]=\"checkListItem.options\"\n [target]=\"actionButton.nativeElement\"\n />\n </header>\n @if (isOpen()) {\n <div class=\"info\">\n <cui-checklist-block-title-control [control]=\"titleControl\" />\n <cui-editor-block\n [config]=\"config()\"\n [editorId]=\"checkListItem.textContainerId!\"\n [title]=\"titleControl.value\"\n />\n </div>\n <ng-container\n [ngComponentOutlet]=\"checkListItemComponent()\"\n [ngComponentOutletInputs]=\"{\n checkListItem: checkListItem\n }\"\n />\n }\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:16px;border-radius:inherit;background-color:var(--cui-base-0)}.header{padding-right:7px;padding-left:7px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:4px;background:var(--cui-base-0);border-radius:inherit;border-left:6px solid var(--cui-yellow-bg)}.header__content{display:flex;flex-direction:row;align-items:center;gap:8px;flex:1}.header__numeration{font-weight:600;font-size:13px;line-height:16px;padding-right:8px;padding-left:8px;display:flex;justify-content:center;align-items:center}.header__text{font-weight:500;font-size:14px;line-height:20px;padding-top:11px;padding-bottom:11px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.header__opened{background:var(--cui-badge-blue-bg);border-bottom:.5px solid var(--cui-base-200);border-bottom-left-radius:0;border-bottom-right-radius:0}.header:hover{background:var(--cui-base-10)}.info{padding-right:15px;padding-left:15px;display:flex;flex-direction:column;gap:16px}.icon{padding:6px;width:max-content}\n"] }]
11210
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <ng-container *cuiLet=\"checkListItemWithOptions() as checkListItem\">\n <header\n class=\"header\"\n [style.border-left-color]=\"headerBorderColor()\"\n [class.header__opened]=\"isOpen()\"\n >\n <button\n class=\"icon-drag\"\n cuiButton\n cuiDragPointer\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [icon]=\"'cuiIconDragHandleDots'\"\n (mouseenter)=\"onAllowDrag()\"\n (mouseleave)=\"onProhibitDrag()\"\n ></button>\n <button\n cuiButton\n type=\"button\"\n appearance=\"ghost\"\n size=\"xxs\"\n [style.transform]=\"rotate()\"\n icon=\"cuiIconCaretDownFillXxs\"\n (click)=\"onRowToggle()\"\n ></button>\n <cui-svg\n [icon]=\"iconChecklistType()\"\n color=\"var(--cui-base-500)\"\n />\n <div class=\"header__content\">\n <div class=\"header__numeration\">{{ index() }}.</div>\n <div class=\"header__text\">{{ headerText() }}</div>\n </div>\n @if (isTitleEmpty) {\n <cui-svg\n [cuiTooltip]=\"t('TITLE_IS_REQUIRED')\"\n icon=\"cuiIconAlertTriangle\"\n color=\"var(--cui-danger)\"\n class=\"icon\"\n />\n }\n @if (isDescriptionRequired() && isDescriptionEmpty()) {\n <cui-svg\n [cuiTooltip]=\"t('DESCRIPTION_IS_REQUIRED')\"\n icon=\"cuiIconAlertTriangle\"\n color=\"var(--cui-danger)\"\n class=\"icon\"\n />\n }\n <button\n #actionButton=\"elementRef\"\n cuiButton\n type=\"button\"\n cuiElement\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconMoreVertical\"\n class=\"list__context-menu-button\"\n ></button>\n <cui-context-menu\n [items]=\"checkListItem.options\"\n [target]=\"actionButton.nativeElement\"\n />\n </header>\n @if (isOpen() || isDescriptionRequired()) {\n <div\n class=\"info\"\n [class.info_hidden]=\"!isOpen()\"\n >\n <cui-checklist-block-title-control [control]=\"titleControl\" />\n <cui-editor-block\n [config]=\"config()\"\n [editorId]=\"checkListItem.textContainerId!\"\n [required]=\"isDescriptionRequired()\"\n [title]=\"titleControl.value\"\n (editorEmpty)=\"onDescriptionEmpty($event)\"\n />\n </div>\n }\n @if (isOpen()) {\n <ng-container\n [ngComponentOutlet]=\"checkListItemComponent()\"\n [ngComponentOutletInputs]=\"{\n checkListItem: checkListItem\n }\"\n />\n }\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:16px;border-radius:inherit;background-color:var(--cui-base-0)}.header{padding-right:7px;padding-left:7px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:4px;background:var(--cui-base-0);border-radius:inherit;border-left:6px solid var(--cui-yellow-bg)}.header__content{display:flex;flex-direction:row;align-items:center;gap:8px;flex:1}.header__numeration{font-weight:600;font-size:13px;line-height:16px;padding-right:8px;padding-left:8px;display:flex;justify-content:center;align-items:center}.header__text{font-weight:500;font-size:14px;line-height:20px;padding-top:11px;padding-bottom:11px;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.header__opened{background:var(--cui-badge-blue-bg);border-bottom:.5px solid var(--cui-base-200);border-bottom-left-radius:0;border-bottom-right-radius:0}.header:hover{background:var(--cui-base-10)}.info{padding-right:15px;padding-left:15px;display:flex;flex-direction:column;gap:16px}.info_hidden{display:none}.icon{padding:6px;width:max-content}\n"] }]
11156
11211
  }] });
11157
11212
 
11158
11213
  class CuiCheckListBlockListItemEvaluationCriteriaComponent {
@@ -11598,6 +11653,9 @@ class CuiChecklistBlockComponent {
11598
11653
  this.translocoService = inject(TranslocoService);
11599
11654
  this.nodeCheckListApiService = inject(CuiNodeChecklistApiService);
11600
11655
  this.checkListBlockService = inject(CuiCheckListBlockService);
11656
+ this.isTitleVerdictEmitted = signal(false);
11657
+ this.isDescriptionVerdictEmitted = signal(false);
11658
+ this.isVerdictPending = computed(() => !this.isTitleVerdictEmitted() || !this.isDescriptionVerdictEmitted());
11601
11659
  this.CHECKLIST_BLOCK_SELECT_OPTIONS = [
11602
11660
  {
11603
11661
  label: this.translocoService.translate('ASSIGNEE_APPROVAL'),
@@ -11616,7 +11674,35 @@ class CuiChecklistBlockComponent {
11616
11674
  this.isLoading = signal(false);
11617
11675
  this.componentId = input.required();
11618
11676
  this.config = input.required();
11677
+ this.isDescriptionRequired = input(false);
11678
+ this.loadingChanged = output();
11679
+ this.titleValidationChanged = output();
11680
+ this.descriptionValidationChanged = output();
11619
11681
  this.initNodeCheckListBlock();
11682
+ this.initDescriptionRequirementEffect();
11683
+ this.initLoadingEffect();
11684
+ this.initValidationEffects();
11685
+ }
11686
+ initDescriptionRequirementEffect() {
11687
+ effect(() => this.checkListBlockService.setDescriptionRequired(this.isDescriptionRequired()), {
11688
+ allowSignalWrites: true
11689
+ });
11690
+ }
11691
+ initLoadingEffect() {
11692
+ effect(() => this.loadingChanged.emit(this.isVerdictPending()));
11693
+ }
11694
+ initValidationEffects() {
11695
+ this.initVerdictEffect(this.checkListBlockService.isTitleReady, this.checkListBlockService.isTitleValid, this.isTitleVerdictEmitted, this.titleValidationChanged);
11696
+ this.initVerdictEffect(this.checkListBlockService.isDescriptionReady, this.checkListBlockService.isDescriptionValid, this.isDescriptionVerdictEmitted, this.descriptionValidationChanged);
11697
+ }
11698
+ initVerdictEffect(isReady, isValid, isVerdictEmitted, verdictOutput) {
11699
+ effect(() => {
11700
+ if (!isReady()) {
11701
+ return;
11702
+ }
11703
+ verdictOutput.emit(isValid());
11704
+ isVerdictEmitted.set(true);
11705
+ }, { allowSignalWrites: true });
11620
11706
  }
11621
11707
  initNodeCheckListBlock() {
11622
11708
  effect(() => {
@@ -11639,7 +11725,7 @@ class CuiChecklistBlockComponent {
11639
11725
  .subscribe((checkListItem) => this.checkListBlockService.addCheckListItem(checkListItem));
11640
11726
  }
11641
11727
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiChecklistBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11642
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiChecklistBlockComponent, isStandalone: true, selector: "cui-checklist-block, [cuiCheckListBlock]", inputs: { componentId: { classPropertyName: "componentId", publicName: "componentId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, providers: [CuiCheckListBlockService], ngImport: i0, template: "<cui-content-wrapper\n *transloco=\"let t\"\n backgroundColor=\"var(--cui-base-10)\"\n [gap]=\"16\"\n>\n <ng-container *cuiLet=\"checkListItems() as checkListItems\">\n <header class=\"header\">\n <h2 class=\"heading\">{{ t('CHECKLIST') }}</h2>\n\n @if (checkListItems) {\n <span class=\"item\">{{ checkListItems?.length }} {{ t('ITEM_VARIANT') }}</span>\n }\n </header>\n <cui-content-wrapper>\n <cui-checklist-block-list [config]=\"config()\" />\n </cui-content-wrapper>\n <div>\n <button\n #actionButton=\"elementRef\"\n cuiElement\n cuiButton\n type=\"button\"\n appearance=\"flat\"\n size=\"xxs\"\n icon=\"cuiIconPlus\"\n >\n {{ t('ADD_NEW_ITEM') }}\n </button>\n <cui-context-menu\n [items]=\"CHECKLIST_BLOCK_SELECT_OPTIONS\"\n [target]=\"actionButton.nativeElement\"\n />\n </div>\n </ng-container>\n</cui-content-wrapper>\n", styles: [".header{display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:space-between}.heading{font-weight:500;font-size:16px;line-height:24px}.item{font-weight:400;font-size:12px;line-height:14px;color:var(--cui-base-500)}\n"], dependencies: [{ kind: "component", type: CuiChecklistBlockListComponent, selector: "cui-checklist-block-list", inputs: ["config"] }, { kind: "component", type: CuiContentWrapperComponent, selector: "cui-content-wrapper, [cuiContentWrapper]", inputs: ["backgroundColor", "gap"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "ngmodule", type: CuiContextMenuModule }, { kind: "component", type: CuiContextMenuComponent, selector: "cui-context-menu[items][target]", inputs: ["items", "target", "width", "withPaddings"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }, { kind: "directive", type: CuiLetDirective, selector: "[cuiLet]", inputs: ["cuiLet"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11728
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiChecklistBlockComponent, isStandalone: true, selector: "cui-checklist-block, [cuiCheckListBlock]", inputs: { componentId: { classPropertyName: "componentId", publicName: "componentId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isDescriptionRequired: { classPropertyName: "isDescriptionRequired", publicName: "isDescriptionRequired", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loadingChanged: "loadingChanged", titleValidationChanged: "titleValidationChanged", descriptionValidationChanged: "descriptionValidationChanged" }, providers: [CuiCheckListBlockService], ngImport: i0, template: "<cui-content-wrapper\n *transloco=\"let t\"\n backgroundColor=\"var(--cui-base-10)\"\n [gap]=\"16\"\n>\n <ng-container *cuiLet=\"checkListItems() as checkListItems\">\n <header class=\"header\">\n <h2 class=\"heading\">{{ t('CHECKLIST') }}</h2>\n\n @if (checkListItems) {\n <span class=\"item\">{{ checkListItems?.length }} {{ t('ITEM_VARIANT') }}</span>\n }\n </header>\n <cui-content-wrapper>\n <cui-checklist-block-list [config]=\"config()\" />\n </cui-content-wrapper>\n <div>\n <button\n #actionButton=\"elementRef\"\n cuiElement\n cuiButton\n type=\"button\"\n appearance=\"flat\"\n size=\"xxs\"\n icon=\"cuiIconPlus\"\n >\n {{ t('ADD_NEW_ITEM') }}\n </button>\n <cui-context-menu\n [items]=\"CHECKLIST_BLOCK_SELECT_OPTIONS\"\n [target]=\"actionButton.nativeElement\"\n />\n </div>\n </ng-container>\n</cui-content-wrapper>\n", styles: [".header{display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:space-between}.heading{font-weight:500;font-size:16px;line-height:24px}.item{font-weight:400;font-size:12px;line-height:14px;color:var(--cui-base-500)}\n"], dependencies: [{ kind: "component", type: CuiChecklistBlockListComponent, selector: "cui-checklist-block-list", inputs: ["config"] }, { kind: "component", type: CuiContentWrapperComponent, selector: "cui-content-wrapper, [cuiContentWrapper]", inputs: ["backgroundColor", "gap"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "ngmodule", type: CuiContextMenuModule }, { kind: "component", type: CuiContextMenuComponent, selector: "cui-context-menu[items][target]", inputs: ["items", "target", "width", "withPaddings"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }, { kind: "directive", type: CuiLetDirective, selector: "[cuiLet]", inputs: ["cuiLet"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11643
11729
  }
11644
11730
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiChecklistBlockComponent, decorators: [{
11645
11731
  type: Component,
@@ -11955,86 +12041,136 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
11955
12041
 
11956
12042
  const UTILITY_MODAL_SERVICE_TOKEN = new InjectionToken('UTILITY_MODAL_SERVICE_TOKEN');
11957
12043
 
11958
- class CuiUtilityModalCreateComponent {
12044
+ class CuiCriterionInfoComponent {
11959
12045
  constructor() {
11960
- this.window = inject(CUI_WINDOW);
11961
- this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
11962
- this.utilityModalService = inject(UTILITY_MODAL_SERVICE_TOKEN);
11963
- this.prevUtility = this.cuiDialogContext.data.utility;
11964
- this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
11965
- this.tools = this.cuiDialogContext.data.tools;
11966
- this.header = this.cuiDialogContext.data.header;
11967
- this._utility = computed(() => signal(this.initialUtility()));
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;
11968
12056
  this.isFormValid = signal(false);
11969
- this.utility = computed(() => this._utility()());
11970
- this.initialUtility = input.required();
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();
11971
12068
  }
11972
12069
  ngOnInit() {
11973
- this.initWindowUnloadEvent();
12070
+ this.initCategory();
11974
12071
  }
11975
- ngOnDestroy() {
11976
- this.window.onbeforeunload = null;
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();
11977
12080
  }
11978
- onSave() {
11979
- this.cuiDialogContext.completeWith(this.initialUtility() ? { prevId: this.prevUtility.id, ...this.utility() } : this.utility());
12081
+ onFormValidationChanged(isValid) {
12082
+ this.isFormValid.set(isValid);
12083
+ this.validationChanged.emit(isValid);
11980
12084
  }
11981
- onCancel() {
11982
- this.destroyUtility();
11983
- const returnedValue = this.initialUtility() ? this.utility() : null;
11984
- this.cuiDialogContext.completeWith(returnedValue);
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
+ });
11985
12099
  }
11986
- initWindowUnloadEvent() {
11987
- this.window.onbeforeunload = () => this.destroyUtility();
12100
+ initConfigEffect() {
12101
+ effect(() => {
12102
+ const element = this.element()?.nativeElement;
12103
+ if (!element) {
12104
+ return;
12105
+ }
12106
+ this.editorConfig.set({ ...this.config(), element });
12107
+ });
11988
12108
  }
11989
- destroyUtility() {
11990
- const utility = this.utility();
11991
- if (!utility || this.initialUtility()) {
12109
+ initCategory() {
12110
+ const storageObjectId = this.criterion()?.id;
12111
+ if (!storageObjectId) {
11992
12112
  return;
11993
12113
  }
11994
- this.utilityModalService.deleteUtility(utility).subscribe();
11995
- }
11996
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityModalCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11997
- 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 }); }
11998
- }
11999
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityModalCreateComponent, decorators: [{
12000
- type: Component,
12001
- 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"] }]
12002
- }] });
12003
-
12004
- class CuiCriterionModalCreateComponent {
12005
- constructor() {
12006
- this.destroyRef = inject(DestroyRef);
12007
- this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
12008
- this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
12009
- this.isCreated = false;
12010
- this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
12011
- this.tools = this.cuiDialogContext.data.tools;
12012
- this.header = this.cuiDialogContext.data.header;
12013
- this._criterion = computed(() => signal(this.initialUtility()));
12014
- this.isFormValid = signal(false);
12015
- this.criterion = computed(() => this._criterion()());
12016
- this.initialUtility = input.required();
12017
- 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
+ });
12018
12122
  }
12019
- onCriterionCreated(storageNodeId) {
12020
- if (this.isCreated || this.initialUtility()) {
12123
+ changeCategory(categoryId, targetId) {
12124
+ const prevCategoryId = untracked(this.prevCategoryId);
12125
+ if (!prevCategoryId) {
12021
12126
  return;
12022
12127
  }
12023
- this.criterionApiService
12024
- .createUtility(storageNodeId)
12025
- .pipe(takeUntilDestroyed(this.destroyRef))
12026
- .subscribe((criterion) => {
12027
- this.isCreated = true;
12028
- this._criterion().set(criterion);
12029
- });
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));
12030
12137
  }
12031
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionModalCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12032
- 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 }); }
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 }); }
12033
12159
  }
12034
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionModalCreateComponent, decorators: [{
12160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, decorators: [{
12035
12161
  type: Component,
12036
- 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" }]
12037
- }] });
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: () => [] });
12038
12174
 
12039
12175
  class CuiInstructionInfoFormComponent {
12040
12176
  get controls() {
@@ -12307,169 +12443,426 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
12307
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"] }]
12308
12444
  }], ctorParameters: () => [] });
12309
12445
 
12310
- class CuiInstructionModalCreateComponent {
12446
+ class CuiSelectModalFolderComponent {
12311
12447
  constructor() {
12312
- this.destroyRef = inject(DestroyRef);
12313
- this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
12314
- this.instructionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
12315
- this.isCreated = false;
12316
- this.tools = this.cuiDialogContext.data.tools;
12317
- this.header = this.cuiDialogContext.data.header;
12318
- this._instruction = computed(() => signal(this.initialUtility()));
12319
- this.isFormValid = signal(false);
12320
- this.instruction = computed(() => this._instruction()());
12321
- this.initialUtility = input.required();
12322
- this.config = input.required();
12323
- }
12324
- onInstructionCreated(storageNodeId) {
12325
- if (this.isCreated || this.initialUtility()) {
12326
- return;
12327
- }
12328
- this.instructionApiService
12329
- .createUtility(storageNodeId)
12330
- .pipe(takeUntilDestroyed(this.destroyRef))
12331
- .subscribe((instruction) => {
12332
- this.isCreated = true;
12333
- this._instruction().set(instruction);
12334
- });
12448
+ this.icon = computed(() => (this.isOpen() ? 'cuiIconFolderOpen' : 'cuiIconFolder'));
12449
+ this.title = input.required();
12450
+ this.buttonSlot = input.required();
12451
+ this.isOpen = input(false);
12335
12452
  }
12336
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiInstructionModalCreateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12337
- 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 }); }
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 }); }
12338
12455
  }
12339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiInstructionModalCreateComponent, decorators: [{
12456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, decorators: [{
12340
12457
  type: Component,
12341
- 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" }]
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"] }]
12342
12459
  }] });
12343
12460
 
12344
- class CuiUtilityReadonlyThumbnailComponent {
12461
+ class CuiSelectModalSearchComponent {
12345
12462
  constructor() {
12346
- this.thumbnailUrl = input.required();
12347
- this.isVideo = input(false);
12463
+ this.destroyRef = inject(DestroyRef);
12464
+ this.searchControl = input(new FormControl(''));
12465
+ this.controlDelay = input(700);
12466
+ this.searchStringChanged = output();
12348
12467
  }
12349
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityReadonlyThumbnailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12350
- 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 }); }
12468
+ ngOnInit() {
12469
+ this.searchControl()
12470
+ .valueChanges.pipe(debounceTime(this.controlDelay()), takeUntilDestroyed(this.destroyRef))
12471
+ .subscribe((value) => this.searchStringChanged.emit(value));
12472
+ }
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 }); }
12351
12475
  }
12352
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityReadonlyThumbnailComponent, decorators: [{
12476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, decorators: [{
12353
12477
  type: Component,
12354
- 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"] }]
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"] }]
12355
12479
  }] });
12356
12480
 
12357
- class CuiCriterionReadonlyInfoComponent {
12481
+ class CuiSelectModalComponent {
12358
12482
  constructor() {
12359
- this.hostElement = inject(ElementRef).nativeElement;
12360
- this.frameApiService = inject(CuiFrameApiService);
12361
- this.resourceApiService = inject(CuiResourceApiService);
12362
- this.isVideo = false;
12363
- this.jText = signal(null);
12364
- this.resource = signal(null);
12365
- this.thumbnailUrl = computed(() => {
12366
- const resource = this.resource();
12367
- if (!resource?.fileId) {
12368
- return of(null);
12369
- }
12370
- return this.resourceApiService.get(resource.fileId, this.config().requestOptions).pipe(map((url) => {
12371
- return {
12372
- src: URL.createObjectURL(url),
12373
- name: resource.name || resource.type
12374
- };
12375
- }));
12376
- });
12377
- this.isDescriptionEmpty = computed(() => !this.jText()?.notEmpty);
12378
- this.framerId = input.required();
12379
- this.config = input.required();
12380
- this.initConfigEffect();
12381
- this.initFramerIdEffect();
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;
12382
12488
  }
12383
- initConfigEffect() {
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 }); }
12494
+ }
12495
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, decorators: [{
12496
+ type: Component,
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() {
12384
12551
  effect(() => {
12385
- this.editorConfig = { readOnly: true, element: this.hostElement, ...this.config() };
12552
+ const storage = this.storage();
12553
+ this.areContentOpened();
12554
+ untracked(this.setChildren.bind(this, storage));
12386
12555
  });
12387
12556
  }
12388
- initFramerIdEffect() {
12557
+ initStorageElementsEffect() {
12389
12558
  effect(() => {
12390
- const framerId = this.framerId();
12391
- if (!framerId) {
12392
- return;
12393
- }
12394
- this.subscription?.unsubscribe();
12395
- this.initFrameFragments();
12559
+ const storage = this.storage();
12560
+ untracked(this.setElements.bind(this, storage));
12396
12561
  });
12397
12562
  }
12398
- initFrameFragments() {
12399
- const frameId = this.framerId();
12400
- this.jText.set(null);
12401
- this.resource.set(null);
12402
- if (!frameId) {
12563
+ setChildren(storage) {
12564
+ const storageChildren = storage.children;
12565
+ if (!storageChildren.length) {
12566
+ this.storageChildren.set([]);
12567
+ }
12568
+ if (this.isLoadingChildren || !this.areContentOpened()) {
12403
12569
  return;
12404
12570
  }
12405
- const fragmentActions = {
12406
- ["J_TEXT" /* FragmentType.jText */]: (fragment) => {
12407
- this.jText.set(fragment);
12408
- },
12409
- ["RESOURCE_FILE" /* FragmentType.resourceFile */]: (fragment) => {
12410
- this.resource.set(fragment);
12411
- }
12412
- };
12413
- this.subscription = this.frameApiService.getFrame(frameId, this.config().requestOptions).subscribe((frame) => {
12414
- frame.fragments.forEach((fragment) => fragmentActions[fragment.type](fragment));
12415
- });
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));
12416
12580
  }
12417
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionReadonlyInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12418
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiCriterionReadonlyInfoComponent, isStandalone: true, selector: "cui-criterion-readonly-info", inputs: { framerId: { classPropertyName: "framerId", publicName: "framerId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (jText()) {\n @if (!isDescriptionEmpty()) {\n @if (thumbnailUrl() | async; as thumbnailUrl) {\n <cui-utility-readonly-thumbnail\n [thumbnailUrl]=\"thumbnailUrl\"\n [isVideo]=\"isVideo\"\n />\n }\n\n @if (jText()?.id; as id) {\n <div class=\"wrapper\">\n <cui-editor\n class=\"editor\"\n [editorApiId]=\"id\"\n [config]=\"editorConfig\"\n />\n </div>\n }\n } @else {\n <cui-empty-state [subtitle]=\"t('NO_DESCRIPTION_WAS_PROVIDED')\" />\n }\n }\n</ng-container>\n", styles: [":host{padding-top:16px;padding-right:16px;padding-left:16px;display:flex;flex-direction:column;gap:12px;height:100%;overflow:auto}.wrapper{padding:12px}.editor{display:block;height:100%;overflow:auto}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty", "editorReady"] }, { kind: "component", type: CuiEmptyStateComponent, selector: "cui-empty-state, [cuiEmptyState]", inputs: ["title", "subtitle"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiUtilityReadonlyThumbnailComponent, selector: "cui-utility-readonly-thumbnail", inputs: ["thumbnailUrl", "isVideo"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
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 }); }
12419
12602
  }
12420
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionReadonlyInfoComponent, decorators: [{
12603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, decorators: [{
12421
12604
  type: Component,
12422
- args: [{ selector: 'cui-criterion-readonly-info', imports: [CuiEditorComponent, CuiEmptyStateComponent, AsyncPipe, TranslocoDirective, CuiUtilityReadonlyThumbnailComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n @if (jText()) {\n @if (!isDescriptionEmpty()) {\n @if (thumbnailUrl() | async; as thumbnailUrl) {\n <cui-utility-readonly-thumbnail\n [thumbnailUrl]=\"thumbnailUrl\"\n [isVideo]=\"isVideo\"\n />\n }\n\n @if (jText()?.id; as id) {\n <div class=\"wrapper\">\n <cui-editor\n class=\"editor\"\n [editorApiId]=\"id\"\n [config]=\"editorConfig\"\n />\n </div>\n }\n } @else {\n <cui-empty-state [subtitle]=\"t('NO_DESCRIPTION_WAS_PROVIDED')\" />\n }\n }\n</ng-container>\n", styles: [":host{padding-top:16px;padding-right:16px;padding-left:16px;display:flex;flex-direction:column;gap:12px;height:100%;overflow:auto}.wrapper{padding:12px}.editor{display:block;height:100%;overflow:auto}\n"] }]
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"] }]
12423
12606
  }], ctorParameters: () => [] });
12424
12607
 
12425
- class CuiReadonlyUtilityModalComponent {
12608
+ class CuiStorageListComponent {
12426
12609
  constructor() {
12427
- this.destroyRef = inject(DestroyRef);
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);
12428
12625
  this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
12429
12626
  this.utilityModalService = inject(UTILITY_MODAL_SERVICE_TOKEN);
12627
+ this.prevUtility = this.cuiDialogContext.data.utility;
12430
12628
  this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
12431
12629
  this.tools = this.cuiDialogContext.data.tools;
12432
12630
  this.header = this.cuiDialogContext.data.header;
12433
- this.isLoading = signal(false);
12434
- this.utility = input.required();
12435
- this.utilityUnbinded = output();
12631
+ this._utility = computed(() => signal(this.initialUtility()));
12632
+ this.isFormValid = signal(false);
12633
+ this.utility = computed(() => this._utility()());
12634
+ this.initialUtility = input.required();
12436
12635
  }
12437
- onClose() {
12438
- this.cuiDialogContext.completeWith();
12636
+ ngOnInit() {
12637
+ this.initWindowUnloadEvent();
12439
12638
  }
12440
- onUnbind() {
12441
- this.isLoading.set(true);
12442
- this.utilityModalService
12443
- .unbindUtility(this.utility().id)
12444
- .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.isLoading.set(false)))
12445
- .subscribe((utility) => {
12446
- this.utilityUnbinded.emit(utility);
12447
- });
12639
+ ngOnDestroy() {
12640
+ this.window.onbeforeunload = null;
12448
12641
  }
12449
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiReadonlyUtilityModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12450
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiReadonlyUtilityModalComponent, isStandalone: true, selector: "cui-readonly-utility-modal", inputs: { utility: { classPropertyName: "utility", publicName: "utility", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { utilityUnbinded: "utilityUnbinded" }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <header class=\"header\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n\n <cui-badge\n color=\"violet\"\n class=\"badge\"\n >\n <cui-svg\n cuiBadgeIcon\n class=\"icon\"\n icon=\"cuiIconVariant\"\n />\n {{ t('INSERTED') }}\n </cui-badge>\n\n <button\n type=\"button\"\n cuiButton\n appearance=\"ghost\"\n icon=\"cuiIconX\"\n class=\"button\"\n (click)=\"onClose()\"\n ></button>\n </header>\n\n <ng-content />\n\n <div class=\"actions\">\n <button\n type=\"button\"\n #button\n cuiButton\n size=\"sm\"\n icon=\"cuiIconLinkBroken\"\n appearance=\"action-violet\"\n [isLoaderShown]=\"isLoading()\"\n (click)=\"onUnbind()\"\n >\n {{ t('UNBIND') }}\n </button>\n </div>\n</ng-container>\n", styles: [".header{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;padding:16px 24px}.header__title{font-weight:500;font-size:16px;line-height:24px}.button{margin-left:auto}.actions{padding:16px;border-top:1px solid var(--cui-base-200)}.badge{display:flex;flex-direction:row;gap:4px;align-items:center;justify-content:flex-start;font-weight:500;font-size:14px;line-height:20px}\n"], dependencies: [{ kind: "ngmodule", type: CuiBadgeModule }, { kind: "component", type: CuiBadgeComponent, selector: "cui-badge", inputs: ["color", "size", "variant"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { 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 }); }
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 }); }
12451
12662
  }
12452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiReadonlyUtilityModalComponent, decorators: [{
12663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiUtilityModalCreateComponent, decorators: [{
12453
12664
  type: Component,
12454
- args: [{ selector: 'cui-readonly-utility-modal', imports: [CuiBadgeModule, CuiButtonModule, CuiSvgModule, NgTemplateOutlet, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <header class=\"header\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n\n <cui-badge\n color=\"violet\"\n class=\"badge\"\n >\n <cui-svg\n cuiBadgeIcon\n class=\"icon\"\n icon=\"cuiIconVariant\"\n />\n {{ t('INSERTED') }}\n </cui-badge>\n\n <button\n type=\"button\"\n cuiButton\n appearance=\"ghost\"\n icon=\"cuiIconX\"\n class=\"button\"\n (click)=\"onClose()\"\n ></button>\n </header>\n\n <ng-content />\n\n <div class=\"actions\">\n <button\n type=\"button\"\n #button\n cuiButton\n size=\"sm\"\n icon=\"cuiIconLinkBroken\"\n appearance=\"action-violet\"\n [isLoaderShown]=\"isLoading()\"\n (click)=\"onUnbind()\"\n >\n {{ t('UNBIND') }}\n </button>\n </div>\n</ng-container>\n", styles: [".header{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;padding:16px 24px}.header__title{font-weight:500;font-size:16px;line-height:24px}.button{margin-left:auto}.actions{padding:16px;border-top:1px solid var(--cui-base-200)}.badge{display:flex;flex-direction:row;gap:4px;align-items:center;justify-content:flex-start;font-weight:500;font-size:14px;line-height:20px}\n"] }]
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"] }]
12455
12666
  }] });
12456
12667
 
12457
- class CuiReadonlyCriterionModalComponent {
12668
+ class CuiCriterionModalCreateComponent {
12458
12669
  constructor() {
12670
+ this.destroyRef = inject(DestroyRef);
12459
12671
  this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
12460
- this.cuiRenderDynamicComponentsService = inject(CuiRenderDynamicComponentsService);
12672
+ this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
12673
+ this.isCreated = false;
12674
+ this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
12461
12675
  this.tools = this.cuiDialogContext.data.tools;
12462
12676
  this.header = this.cuiDialogContext.data.header;
12463
- this.isLoading = signal(false);
12464
- this.config = computed(() => ({
12465
- tools: this.tools(),
12466
- requestOptions: this.context(),
12467
- element: this.element()?.nativeElement
12468
- }));
12469
- this.framerId = computed(() => this.criterion().storageElement.framerCriterionId);
12470
- this.element = viewChild('scrollContainer');
12471
- this.criterion = input.required();
12472
- this.context = input.required();
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"] }]
12748
+ }] });
12749
+
12750
+ class CuiCriterionReadonlyInfoComponent {
12751
+ constructor() {
12752
+ this.hostElement = inject(ElementRef).nativeElement;
12753
+ this.frameApiService = inject(CuiFrameApiService);
12754
+ this.resourceApiService = inject(CuiResourceApiService);
12755
+ this.isVideo = false;
12756
+ this.jText = signal(null);
12757
+ this.resource = signal(null);
12758
+ this.thumbnailUrl = computed(() => {
12759
+ const resource = this.resource();
12760
+ if (!resource?.fileId) {
12761
+ return of(null);
12762
+ }
12763
+ return this.resourceApiService.get(resource.fileId, this.config().requestOptions).pipe(map((url) => {
12764
+ return {
12765
+ src: URL.createObjectURL(url),
12766
+ name: resource.name || resource.type
12767
+ };
12768
+ }));
12769
+ });
12770
+ this.isDescriptionEmpty = computed(() => !this.jText()?.notEmpty);
12771
+ this.framerId = input.required();
12772
+ this.config = input.required();
12773
+ this.initConfigEffect();
12774
+ this.initFramerIdEffect();
12775
+ }
12776
+ initConfigEffect() {
12777
+ effect(() => {
12778
+ this.editorConfig = { readOnly: true, element: this.hostElement, ...this.config() };
12779
+ });
12780
+ }
12781
+ initFramerIdEffect() {
12782
+ effect(() => {
12783
+ const framerId = this.framerId();
12784
+ if (!framerId) {
12785
+ return;
12786
+ }
12787
+ this.subscription?.unsubscribe();
12788
+ this.initFrameFragments();
12789
+ });
12790
+ }
12791
+ initFrameFragments() {
12792
+ const frameId = this.framerId();
12793
+ this.jText.set(null);
12794
+ this.resource.set(null);
12795
+ if (!frameId) {
12796
+ return;
12797
+ }
12798
+ const fragmentActions = {
12799
+ ["J_TEXT" /* FragmentType.jText */]: (fragment) => {
12800
+ this.jText.set(fragment);
12801
+ },
12802
+ ["RESOURCE_FILE" /* FragmentType.resourceFile */]: (fragment) => {
12803
+ this.resource.set(fragment);
12804
+ }
12805
+ };
12806
+ this.subscription = this.frameApiService.getFrame(frameId, this.config().requestOptions).subscribe((frame) => {
12807
+ frame.fragments.forEach((fragment) => fragmentActions[fragment.type](fragment));
12808
+ });
12809
+ }
12810
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionReadonlyInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12811
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CuiCriterionReadonlyInfoComponent, isStandalone: true, selector: "cui-criterion-readonly-info", inputs: { framerId: { classPropertyName: "framerId", publicName: "framerId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (jText()) {\n @if (!isDescriptionEmpty()) {\n @if (thumbnailUrl() | async; as thumbnailUrl) {\n <cui-utility-readonly-thumbnail\n [thumbnailUrl]=\"thumbnailUrl\"\n [isVideo]=\"isVideo\"\n />\n }\n\n @if (jText()?.id; as id) {\n <div class=\"wrapper\">\n <cui-editor\n class=\"editor\"\n [editorApiId]=\"id\"\n [config]=\"editorConfig\"\n />\n </div>\n }\n } @else {\n <cui-empty-state [subtitle]=\"t('NO_DESCRIPTION_WAS_PROVIDED')\" />\n }\n }\n</ng-container>\n", styles: [":host{padding-top:16px;padding-right:16px;padding-left:16px;display:flex;flex-direction:column;gap:12px;height:100%;overflow:auto}.wrapper{padding:12px}.editor{display:block;height:100%;overflow:auto}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty", "editorReady"] }, { kind: "component", type: CuiEmptyStateComponent, selector: "cui-empty-state, [cuiEmptyState]", inputs: ["title", "subtitle"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiUtilityReadonlyThumbnailComponent, selector: "cui-utility-readonly-thumbnail", inputs: ["thumbnailUrl", "isVideo"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12812
+ }
12813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionReadonlyInfoComponent, decorators: [{
12814
+ type: Component,
12815
+ args: [{ selector: 'cui-criterion-readonly-info', imports: [CuiEditorComponent, CuiEmptyStateComponent, AsyncPipe, TranslocoDirective, CuiUtilityReadonlyThumbnailComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n @if (jText()) {\n @if (!isDescriptionEmpty()) {\n @if (thumbnailUrl() | async; as thumbnailUrl) {\n <cui-utility-readonly-thumbnail\n [thumbnailUrl]=\"thumbnailUrl\"\n [isVideo]=\"isVideo\"\n />\n }\n\n @if (jText()?.id; as id) {\n <div class=\"wrapper\">\n <cui-editor\n class=\"editor\"\n [editorApiId]=\"id\"\n [config]=\"editorConfig\"\n />\n </div>\n }\n } @else {\n <cui-empty-state [subtitle]=\"t('NO_DESCRIPTION_WAS_PROVIDED')\" />\n }\n }\n</ng-container>\n", styles: [":host{padding-top:16px;padding-right:16px;padding-left:16px;display:flex;flex-direction:column;gap:12px;height:100%;overflow:auto}.wrapper{padding:12px}.editor{display:block;height:100%;overflow:auto}\n"] }]
12816
+ }], ctorParameters: () => [] });
12817
+
12818
+ class CuiReadonlyUtilityModalComponent {
12819
+ constructor() {
12820
+ this.destroyRef = inject(DestroyRef);
12821
+ this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
12822
+ this.utilityModalService = inject(UTILITY_MODAL_SERVICE_TOKEN);
12823
+ this.editorResourceUrl = this.cuiDialogContext.data.editorResourceUrl;
12824
+ this.tools = this.cuiDialogContext.data.tools;
12825
+ this.header = this.cuiDialogContext.data.header;
12826
+ this.isLoading = signal(false);
12827
+ this.utility = input.required();
12828
+ this.utilityUnbinded = output();
12829
+ }
12830
+ onClose() {
12831
+ this.cuiDialogContext.completeWith();
12832
+ }
12833
+ onUnbind() {
12834
+ this.isLoading.set(true);
12835
+ this.utilityModalService
12836
+ .unbindUtility(this.utility().id)
12837
+ .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.isLoading.set(false)))
12838
+ .subscribe((utility) => {
12839
+ this.utilityUnbinded.emit(utility);
12840
+ });
12841
+ }
12842
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiReadonlyUtilityModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12843
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CuiReadonlyUtilityModalComponent, isStandalone: true, selector: "cui-readonly-utility-modal", inputs: { utility: { classPropertyName: "utility", publicName: "utility", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { utilityUnbinded: "utilityUnbinded" }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <header class=\"header\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n\n <cui-badge\n color=\"violet\"\n class=\"badge\"\n >\n <cui-svg\n cuiBadgeIcon\n class=\"icon\"\n icon=\"cuiIconVariant\"\n />\n {{ t('INSERTED') }}\n </cui-badge>\n\n <button\n type=\"button\"\n cuiButton\n appearance=\"ghost\"\n icon=\"cuiIconX\"\n class=\"button\"\n (click)=\"onClose()\"\n ></button>\n </header>\n\n <ng-content />\n\n <div class=\"actions\">\n <button\n type=\"button\"\n #button\n cuiButton\n size=\"sm\"\n icon=\"cuiIconLinkBroken\"\n appearance=\"action-violet\"\n [isLoaderShown]=\"isLoading()\"\n (click)=\"onUnbind()\"\n >\n {{ t('UNBIND') }}\n </button>\n </div>\n</ng-container>\n", styles: [".header{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;padding:16px 24px}.header__title{font-weight:500;font-size:16px;line-height:24px}.button{margin-left:auto}.actions{padding:16px;border-top:1px solid var(--cui-base-200)}.badge{display:flex;flex-direction:row;gap:4px;align-items:center;justify-content:flex-start;font-weight:500;font-size:14px;line-height:20px}\n"], dependencies: [{ kind: "ngmodule", type: CuiBadgeModule }, { kind: "component", type: CuiBadgeComponent, selector: "cui-badge", inputs: ["color", "size", "variant"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "theme", "size"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { 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 }); }
12844
+ }
12845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiReadonlyUtilityModalComponent, decorators: [{
12846
+ type: Component,
12847
+ args: [{ selector: 'cui-readonly-utility-modal', imports: [CuiBadgeModule, CuiButtonModule, CuiSvgModule, NgTemplateOutlet, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <header class=\"header\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n\n <cui-badge\n color=\"violet\"\n class=\"badge\"\n >\n <cui-svg\n cuiBadgeIcon\n class=\"icon\"\n icon=\"cuiIconVariant\"\n />\n {{ t('INSERTED') }}\n </cui-badge>\n\n <button\n type=\"button\"\n cuiButton\n appearance=\"ghost\"\n icon=\"cuiIconX\"\n class=\"button\"\n (click)=\"onClose()\"\n ></button>\n </header>\n\n <ng-content />\n\n <div class=\"actions\">\n <button\n type=\"button\"\n #button\n cuiButton\n size=\"sm\"\n icon=\"cuiIconLinkBroken\"\n appearance=\"action-violet\"\n [isLoaderShown]=\"isLoading()\"\n (click)=\"onUnbind()\"\n >\n {{ t('UNBIND') }}\n </button>\n </div>\n</ng-container>\n", styles: [".header{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;padding:16px 24px}.header__title{font-weight:500;font-size:16px;line-height:24px}.button{margin-left:auto}.actions{padding:16px;border-top:1px solid var(--cui-base-200)}.badge{display:flex;flex-direction:row;gap:4px;align-items:center;justify-content:flex-start;font-weight:500;font-size:14px;line-height:20px}\n"] }]
12848
+ }] });
12849
+
12850
+ class CuiReadonlyCriterionModalComponent {
12851
+ constructor() {
12852
+ this.cuiDialogContext = inject(CUI_DIALOG_CONTEXT);
12853
+ this.cuiRenderDynamicComponentsService = inject(CuiRenderDynamicComponentsService);
12854
+ this.tools = this.cuiDialogContext.data.tools;
12855
+ this.header = this.cuiDialogContext.data.header;
12856
+ this.isLoading = signal(false);
12857
+ this.config = computed(() => ({
12858
+ tools: this.tools(),
12859
+ requestOptions: this.context(),
12860
+ element: this.element()?.nativeElement
12861
+ }));
12862
+ this.framerId = computed(() => this.criterion().storageElement.framerCriterionId);
12863
+ this.element = viewChild('scrollContainer');
12864
+ this.criterion = input.required();
12865
+ this.context = input.required();
12473
12866
  }
12474
12867
  onUnbind(criterion) {
12475
12868
  this.cuiRenderDynamicComponentsService.closeAll();
@@ -12619,313 +13012,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
12619
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"] }]
12620
13013
  }], ctorParameters: () => [] });
12621
13014
 
12622
- class CuiCriterionInfoComponent {
12623
- constructor() {
12624
- this.destroyRef = inject(DestroyRef);
12625
- this.translocoService = inject(TranslocoService);
12626
- this.cuiIdService = inject(CuiIdService);
12627
- this.cuiCategoriesModalService = inject(CuiSelectedCategoryService);
12628
- this.treeStructNavigatorApiService = inject(CuiTreeStructNavigatorApiService);
12629
- this.criterionApiService = inject(UTILITY_MODAL_SERVICE_TOKEN);
12630
- this.TYPE = "INSTRUCTION_STORAGE" /* TreeStructType.Instruction */;
12631
- this.skipCategoryChange = false;
12632
- this.categoryId = this.cuiIdService.generate();
12633
- this.category = this.cuiCategoriesModalService.category;
12634
- this.isFormValid = signal(false);
12635
- this.prevCategoryId = signal(null);
12636
- this.editorConfig = signal(null);
12637
- this.labelColor = computed(() => this.category()?.title ? 'var(--cui-base-900)' : 'var(--cui-base-400)');
12638
- this.selectTitle = computed(() => this.category()?.title || this.translocoService.translate('SELECT') + '...');
12639
- this.element = viewChild('scrollContent');
12640
- this.criterion = model();
12641
- this.config = input.required();
12642
- this.validationChanged = output();
12643
- this.criterionCreated = output();
12644
- this.initConfigEffect();
12645
- this.initCategoryEffect();
12646
- }
12647
- ngOnInit() {
12648
- this.initCategory();
12649
- }
12650
- onFormChanged(values, criterionId) {
12651
- const actions = {
12652
- title: (title) => this.changeTitle(title, criterionId),
12653
- description: (description) => this.changeDescription(description, criterionId)
12654
- };
12655
- forkJoin(Object.keys(values).map((key) => actions[key](values[key] || '')))
12656
- .pipe(takeUntilDestroyed(this.destroyRef))
12657
- .subscribe();
12658
- }
12659
- onFormValidationChanged(isValid) {
12660
- this.isFormValid.set(isValid);
12661
- this.validationChanged.emit(isValid);
12662
- }
12663
- initCategoryEffect() {
12664
- effect(() => {
12665
- const category = this.category();
12666
- const storageObjectCriterion = untracked(this.criterion);
12667
- if (!category || this.skipCategoryChange) {
12668
- this.skipCategoryChange = false;
12669
- return;
12670
- }
12671
- if (storageObjectCriterion) {
12672
- this.changeCategory(category.id, storageObjectCriterion.id);
12673
- return;
12674
- }
12675
- this.createCriterion(category.id);
12676
- });
12677
- }
12678
- initConfigEffect() {
12679
- effect(() => {
12680
- const element = this.element()?.nativeElement;
12681
- if (!element) {
12682
- return;
12683
- }
12684
- this.editorConfig.set({ ...this.config(), element });
12685
- });
12686
- }
12687
- initCategory() {
12688
- const storageObjectId = this.criterion()?.id;
12689
- if (!storageObjectId) {
12690
- return;
12691
- }
12692
- this.treeStructNavigatorApiService
12693
- .getCategory(storageObjectId, "CRITERION_STORAGE" /* TreeStructType.Criteria */, this.config().requestOptions)
12694
- .pipe(takeUntilDestroyed(this.destroyRef))
12695
- .subscribe((category) => {
12696
- this.skipCategoryChange = true;
12697
- this.prevCategoryId.set(category.id);
12698
- this.cuiCategoriesModalService.setCurrentCategory(category);
12699
- });
12700
- }
12701
- changeCategory(categoryId, targetId) {
12702
- const prevCategoryId = untracked(this.prevCategoryId);
12703
- if (!prevCategoryId) {
12704
- return;
12705
- }
12706
- this.subscription?.unsubscribe();
12707
- this.subscription = this.treeStructNavigatorApiService
12708
- .moveElement({
12709
- type: "MOVING_TARGET_TREE_STRUCT" /* MovingType.TARGET_TREE_STRUCT */,
12710
- movableItemId: targetId,
12711
- treeStructTargetItemId: categoryId,
12712
- treeStructMovableItemId: prevCategoryId
12713
- }, this.config().requestOptions)
12714
- .subscribe(() => this.prevCategoryId.set(categoryId));
12715
- }
12716
- createCriterion(categoryId) {
12717
- this.criterionCreated.emit(categoryId);
12718
- this.prevCategoryId.set(categoryId);
12719
- }
12720
- changeTitle(value, criterionId) {
12721
- return this.criterionApiService.changeTitle(criterionId, value, this.config().requestOptions).pipe(finalize(() => this.criterion.update((prev) => ({
12722
- ...prev,
12723
- storageElement: { ...prev.storageElement, title: value }
12724
- }))));
12725
- }
12726
- changeDescription(value, criterionId) {
12727
- if (!this.criterionApiService.changeDescription) {
12728
- throw new Error('Change description not implemented');
12729
- }
12730
- return this.criterionApiService.changeDescription(criterionId, value, this.config().requestOptions).pipe(finalize(() => this.criterion.update((prev) => ({
12731
- ...prev,
12732
- storageElement: { ...prev.storageElement, shortDescription: value }
12733
- }))));
12734
- }
12735
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12736
- 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 }); }
12737
- }
12738
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiCriterionInfoComponent, decorators: [{
12739
- type: Component,
12740
- args: [{ selector: 'cui-criterion-info', imports: [
12741
- CuiBadgeModule,
12742
- CuiButtonModule,
12743
- CuiCategoriesComponent,
12744
- CuiDialogModule,
12745
- CuiFormFieldModule,
12746
- CuiCriterionInfoFormComponent,
12747
- CuiLabelModule,
12748
- CuiSvgModule,
12749
- TranslocoModule
12750
- ], 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"] }]
12751
- }], ctorParameters: () => [] });
12752
-
12753
- class CuiSelectModalFolderComponent {
12754
- constructor() {
12755
- this.icon = computed(() => (this.isOpen() ? 'cuiIconFolderOpen' : 'cuiIconFolder'));
12756
- this.title = input.required();
12757
- this.buttonSlot = input.required();
12758
- this.isOpen = input(false);
12759
- }
12760
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12761
- 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 }); }
12762
- }
12763
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalFolderComponent, decorators: [{
12764
- type: Component,
12765
- 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"] }]
12766
- }] });
12767
-
12768
- class CuiSelectModalSearchComponent {
12769
- constructor() {
12770
- this.destroyRef = inject(DestroyRef);
12771
- this.searchControl = input(new FormControl(''));
12772
- this.controlDelay = input(700);
12773
- this.searchStringChanged = output();
12774
- }
12775
- ngOnInit() {
12776
- this.searchControl()
12777
- .valueChanges.pipe(debounceTime(this.controlDelay()), takeUntilDestroyed(this.destroyRef))
12778
- .subscribe((value) => this.searchStringChanged.emit(value));
12779
- }
12780
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12781
- 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 }); }
12782
- }
12783
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalSearchComponent, decorators: [{
12784
- type: Component,
12785
- 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"] }]
12786
- }] });
12787
-
12788
- class CuiSelectModalComponent {
12789
- constructor() {
12790
- this.context = inject(CUI_DIALOG_CONTEXT);
12791
- this.data = this.context.data;
12792
- this.heading = this.data.heading;
12793
- this.leftData = this.data.leftData;
12794
- this.rightData = this.data.rightData;
12795
- }
12796
- onCancel() {
12797
- this.context.completeWith();
12798
- }
12799
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12800
- 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 }); }
12801
- }
12802
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalComponent, decorators: [{
12803
- type: Component,
12804
- args: [{ imports: [
12805
- CuiButtonModule,
12806
- CuiDialogModule,
12807
- CuiIconButtonModule,
12808
- CuiInputModule,
12809
- NgComponentOutlet,
12810
- TranslocoDirective
12811
- ], 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"] }]
12812
- }] });
12813
-
12814
- class CuiSelectModalService {
12815
- constructor() {
12816
- this.selectedElementSignal = signal(null);
12817
- this.selectedElement = this.selectedElementSignal.asReadonly();
12818
- }
12819
- getSelectedData() {
12820
- return this.selectedElementSignal.asReadonly();
12821
- }
12822
- set(element) {
12823
- this.selectedElementSignal.set(element);
12824
- }
12825
- delete() {
12826
- this.selectedElementSignal.set(null);
12827
- }
12828
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
12829
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService }); }
12830
- }
12831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiSelectModalService, decorators: [{
12832
- type: Injectable
12833
- }] });
12834
-
12835
- const CUI_STORAGE_LIST_SERVICE_TOKEN = new InjectionToken('STORAGE_LIST_SERVICE_TOKEN');
12836
-
12837
- class CuiStorageListItemComponent {
12838
- constructor() {
12839
- this.storageListService = inject(CUI_STORAGE_LIST_SERVICE_TOKEN);
12840
- this.isLoadingChildren = false;
12841
- this.isLoadingElements = false;
12842
- this.storageChildren = signal([]);
12843
- this.storageElements = signal([]);
12844
- this.areContentOpened = signal(false);
12845
- this.openCloseButtonIcon = computed(() => this.areContentOpened() ? 'cuiIconChevronDown' : 'cuiIconChevronRight');
12846
- this.hasContent = computed(() => this.storage().children.length || this.storageChildren().length || this.storageElements().length);
12847
- this.storage = input.required();
12848
- this.elementSlot = input();
12849
- this.itemSlot = input();
12850
- this.initStorageChildrenEffect();
12851
- this.initStorageElementsEffect();
12852
- }
12853
- onToggleChildren(event) {
12854
- event.preventDefault();
12855
- this.areContentOpened.update((prevAreChildrenOpened) => !prevAreChildrenOpened);
12856
- }
12857
- initStorageChildrenEffect() {
12858
- effect(() => {
12859
- const storage = this.storage();
12860
- this.areContentOpened();
12861
- untracked(this.setChildren.bind(this, storage));
12862
- });
12863
- }
12864
- initStorageElementsEffect() {
12865
- effect(() => {
12866
- const storage = this.storage();
12867
- untracked(this.setElements.bind(this, storage));
12868
- });
12869
- }
12870
- setChildren(storage) {
12871
- const storageChildren = storage.children;
12872
- if (!storageChildren.length) {
12873
- this.storageChildren.set([]);
12874
- }
12875
- if (this.isLoadingChildren || !this.areContentOpened()) {
12876
- return;
12877
- }
12878
- if (typeof storageChildren[0] !== 'string') {
12879
- this.storageChildren.set(storageChildren);
12880
- return;
12881
- }
12882
- this.isLoadingChildren = true;
12883
- this.storageListService
12884
- .getChildren?.(storage, this.storageChildren())
12885
- .pipe(finalize(() => (this.isLoadingChildren = false)))
12886
- .subscribe((response) => this.storageChildren.set(response));
12887
- }
12888
- setElements(storage) {
12889
- const storageElements = storage.elements;
12890
- if (this.isLoadingElements) {
12891
- return;
12892
- }
12893
- if (!storageElements?.length) {
12894
- this.storageElements.set([]);
12895
- return;
12896
- }
12897
- if (this.storageElements().length) {
12898
- this.storageElements.set(storageElements);
12899
- return;
12900
- }
12901
- this.isLoadingElements = true;
12902
- this.storageListService
12903
- .getElements?.(storage, this.storageElements())
12904
- .pipe(finalize(() => (this.isLoadingElements = false)))
12905
- .subscribe((response) => this.storageElements.set(response));
12906
- }
12907
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12908
- 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 }); }
12909
- }
12910
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListItemComponent, decorators: [{
12911
- type: Component,
12912
- 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"] }]
12913
- }], ctorParameters: () => [] });
12914
-
12915
- class CuiStorageListComponent {
12916
- constructor() {
12917
- this.storages = input.required();
12918
- this.elementSlot = input();
12919
- this.itemSlot = input();
12920
- }
12921
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12922
- 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 }); }
12923
- }
12924
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiStorageListComponent, decorators: [{
12925
- type: Component,
12926
- 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"] }]
12927
- }] });
12928
-
12929
13015
  class CuiActivityBaseService {
12930
13016
  constructor() {
12931
13017
  this.userCompanyApiService = inject(UserCompanyApiService);