@cuby-ui/core 0.0.610 → 0.0.611
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/widgets/ui/checklist-block/checklist-block.component.mjs +34 -3
- package/esm2022/widgets/ui/checklist-block/components/checklist-block-list-item-container/checklist-block-list-item-container.component.mjs +25 -3
- package/esm2022/widgets/ui/checklist-block/services/checklist-block.service.mjs +35 -2
- package/fesm2022/cuby-ui-core.mjs +89 -3
- package/fesm2022/cuby-ui-core.mjs.map +1 -1
- package/package.json +4 -4
- package/widgets/ui/checklist-block/checklist-block.component.d.ts +15 -3
- package/widgets/ui/checklist-block/components/checklist-block-list-item-container/checklist-block-list-item-container.component.d.ts +9 -2
- package/widgets/ui/checklist-block/services/checklist-block.service.d.ts +15 -0
|
@@ -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
|
|
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
|
|
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,
|