@libs-ui/components-list 0.2.10-6.2

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.
Files changed (49) hide show
  1. package/README.md +3 -0
  2. package/defines/list.define.d.ts +10 -0
  3. package/esm2022/defines/list.define.mjs +70 -0
  4. package/esm2022/highlight-key-search/highlight-key-search.directive.mjs +82 -0
  5. package/esm2022/index.mjs +4 -0
  6. package/esm2022/interfaces/config-item.interface.mjs +3 -0
  7. package/esm2022/interfaces/data-emit.interface.mjs +3 -0
  8. package/esm2022/interfaces/function-control-event.interface.mjs +2 -0
  9. package/esm2022/interfaces/index.mjs +6 -0
  10. package/esm2022/interfaces/tab.interface.mjs +2 -0
  11. package/esm2022/interfaces/templates-type.type.mjs +2 -0
  12. package/esm2022/libs-ui-components-list.mjs +5 -0
  13. package/esm2022/list.component.mjs +351 -0
  14. package/esm2022/pipes/check-selected-by-key.pipe.mjs +21 -0
  15. package/esm2022/templates/checkbox/checkbox.component.mjs +288 -0
  16. package/esm2022/templates/group/group.component.mjs +775 -0
  17. package/esm2022/templates/group/item/item.component.mjs +80 -0
  18. package/esm2022/templates/group/pipes/calculator-left-line-vertical-item.pipe.mjs +38 -0
  19. package/esm2022/templates/group/pipes/calculator-margin-left-item.pipe.mjs +40 -0
  20. package/esm2022/templates/group/pipes/calculator-padding-left-item.pipe.mjs +26 -0
  21. package/esm2022/templates/radio/radio.component.mjs +189 -0
  22. package/esm2022/templates/rows/rows.component.mjs +70 -0
  23. package/esm2022/templates/tag/tag.component.mjs +151 -0
  24. package/esm2022/templates/templates.component.abstract.mjs +340 -0
  25. package/esm2022/templates/text/text.component.mjs +238 -0
  26. package/fesm2022/libs-ui-components-list.mjs +2650 -0
  27. package/fesm2022/libs-ui-components-list.mjs.map +1 -0
  28. package/highlight-key-search/highlight-key-search.directive.d.ts +13 -0
  29. package/index.d.ts +3 -0
  30. package/interfaces/config-item.interface.d.ts +233 -0
  31. package/interfaces/data-emit.interface.d.ts +16 -0
  32. package/interfaces/function-control-event.interface.d.ts +15 -0
  33. package/interfaces/index.d.ts +5 -0
  34. package/interfaces/tab.interface.d.ts +4 -0
  35. package/interfaces/templates-type.type.d.ts +1 -0
  36. package/list.component.d.ts +93 -0
  37. package/package.json +25 -0
  38. package/pipes/check-selected-by-key.pipe.d.ts +7 -0
  39. package/templates/checkbox/checkbox.component.d.ts +22 -0
  40. package/templates/group/group.component.d.ts +49 -0
  41. package/templates/group/item/item.component.d.ts +27 -0
  42. package/templates/group/pipes/calculator-left-line-vertical-item.pipe.d.ts +7 -0
  43. package/templates/group/pipes/calculator-margin-left-item.pipe.d.ts +7 -0
  44. package/templates/group/pipes/calculator-padding-left-item.pipe.d.ts +7 -0
  45. package/templates/radio/radio.component.d.ts +21 -0
  46. package/templates/rows/rows.component.d.ts +23 -0
  47. package/templates/tag/tag.component.d.ts +17 -0
  48. package/templates/templates.component.abstract.d.ts +94 -0
  49. package/templates/text/text.component.d.ts +24 -0
@@ -0,0 +1,2650 @@
1
+ import { AsyncPipe, NgComponentOutlet, NgTemplateOutlet, NgClass } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, inject, ElementRef, Directive, Pipe, signal, output, effect, untracked, Component, ChangeDetectionStrategy, model, viewChild } from '@angular/core';
4
+ import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
5
+ import { LibsUiComponentsInputsSearchComponent } from '@libs-ui/components-inputs-search';
6
+ import { LibsUiComponentsLabelComponent } from '@libs-ui/components-label';
7
+ import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
8
+ import { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';
9
+ import { deleteUnicode, isEmpty, convertObjectToSignal, convertSignalToObject, cloneDeep, isNil, escapeHtml, uuid, ERROR_MESSAGE_EMPTY_VALID } from '@libs-ui/utils';
10
+ import * as i1 from '@ngx-translate/core';
11
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
12
+ import { lastValueFrom, Subject, interval, range, timer, takeUntil as takeUntil$1 } from 'rxjs';
13
+ import * as i1$1 from '@iharbeck/ngx-virtual-scroller';
14
+ import { VirtualScrollerModule, VirtualScrollerComponent } from '@iharbeck/ngx-virtual-scroller';
15
+ import { LibsUiComponentsCheckboxSingleComponent } from '@libs-ui/components-checkbox-single';
16
+ import { LibsUiComponentsScrollOverlayDirective } from '@libs-ui/components-scroll-overlay';
17
+ import { LibsUiComponentsSpinnerComponent } from '@libs-ui/components-spinner';
18
+ import { LibsUiIconsGetIconComponentPipe } from '@libs-ui/icons';
19
+ import { LibsUiPipesCallFunctionInTemplatePipe } from '@libs-ui/pipes-call-function-in-template';
20
+ import { LibsUiComponentsAvatarComponent } from '@libs-ui/components-avatar';
21
+ import { LibsUiComponentsBadgeComponent } from '@libs-ui/components-badge';
22
+ import { LibsUiHttpRequestService } from '@libs-ui/services-http-request';
23
+ import { takeUntil, skipWhile, take } from 'rxjs/operators';
24
+ import { LibsUiComponentsRadioSingleComponent } from '@libs-ui/components-radio-single';
25
+ import { LibsUiComponentsButtonsSortArrowComponent } from '@libs-ui/components-buttons-sort';
26
+ import { LibsUiComponentsSwitchComponent } from '@libs-ui/components-switch';
27
+
28
+ class LibsUiComponentsListHighlightKeySearchDirective {
29
+ isHighlight = input(undefined);
30
+ keySearch = input(undefined);
31
+ classHighlight = input('libs-ui-list-highlight-text-search');
32
+ elementRef = inject(ElementRef);
33
+ ngAfterViewInit() {
34
+ if (!this.elementRef || !this.isHighlight() || !this.keySearch()) {
35
+ return;
36
+ }
37
+ this.handlerHighlight(this.elementRef.nativeElement);
38
+ }
39
+ handlerHighlight(element) {
40
+ if (!element || element === null) {
41
+ return;
42
+ }
43
+ const children = Array.prototype.slice.call(element.childNodes);
44
+ if (!children.length) {
45
+ return;
46
+ }
47
+ children.forEach(item => {
48
+ if (item.nodeType === Node.TEXT_NODE) {
49
+ this.checkAndReplace(item);
50
+ return;
51
+ }
52
+ if (item.nodeType === Node.ELEMENT_NODE) {
53
+ this.handlerHighlight(item);
54
+ }
55
+ });
56
+ }
57
+ checkAndReplace(node) {
58
+ let nodeVal = node.nodeValue;
59
+ const parentNode = node.parentNode;
60
+ let textNode = null;
61
+ if (!parentNode || !nodeVal) {
62
+ return;
63
+ }
64
+ const textToHighlight = deleteUnicode(this.keySearch()?.trim() || '').toLowerCase();
65
+ let isFirst = true;
66
+ while (true) {
67
+ const foundIndex = deleteUnicode(nodeVal).toLowerCase().indexOf(textToHighlight);
68
+ if (foundIndex < 0) {
69
+ if (isFirst) {
70
+ break;
71
+ }
72
+ if (nodeVal) {
73
+ textNode = document.createTextNode(nodeVal);
74
+ parentNode.insertBefore(textNode, node);
75
+ }
76
+ parentNode.removeChild(node);
77
+ break;
78
+ }
79
+ isFirst = false;
80
+ const start = nodeVal.substring(0, foundIndex);
81
+ const matched = nodeVal.substring(foundIndex, foundIndex + textToHighlight.length);
82
+ if (start) {
83
+ textNode = document.createTextNode(start);
84
+ parentNode.insertBefore(textNode, node);
85
+ }
86
+ const span = document.createElement("span");
87
+ if (!span.classList.contains(this.classHighlight())) {
88
+ span.classList.add(this.classHighlight());
89
+ }
90
+ span.appendChild(document.createTextNode(matched));
91
+ parentNode.insertBefore(span, node);
92
+ nodeVal = nodeVal.substring(foundIndex + textToHighlight.length);
93
+ }
94
+ }
95
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListHighlightKeySearchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
96
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsListHighlightKeySearchDirective, isStandalone: true, selector: "[LibsUiComponentsListHighlightKeySearchDirective]", inputs: { isHighlight: { classPropertyName: "isHighlight", publicName: "isHighlight", isSignal: true, isRequired: false, transformFunction: null }, keySearch: { classPropertyName: "keySearch", publicName: "keySearch", isSignal: true, isRequired: false, transformFunction: null }, classHighlight: { classPropertyName: "classHighlight", publicName: "classHighlight", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListHighlightKeySearchDirective, decorators: [{
99
+ type: Directive,
100
+ args: [{
101
+ // eslint-disable-next-line @angular-eslint/directive-selector
102
+ selector: '[LibsUiComponentsListHighlightKeySearchDirective]',
103
+ standalone: true
104
+ }]
105
+ }] });
106
+
107
+ /* eslint-disable @typescript-eslint/no-explicit-any */
108
+ class LibsUiCheckSelectedByKeyPipe {
109
+ transform(value, multiKeys, length) {
110
+ if (!multiKeys || !(multiKeys instanceof Array) || !multiKeys.length || !length) {
111
+ return false;
112
+ }
113
+ return multiKeys.some(key => key === value);
114
+ }
115
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiCheckSelectedByKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
116
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiCheckSelectedByKeyPipe, isStandalone: true, name: "LibsUiCheckSelectedByKeyPipe" });
117
+ }
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiCheckSelectedByKeyPipe, decorators: [{
119
+ type: Pipe,
120
+ args: [{
121
+ name: 'LibsUiCheckSelectedByKeyPipe',
122
+ standalone: true
123
+ }]
124
+ }] });
125
+
126
+ /* eslint-disable @typescript-eslint/no-explicit-any */
127
+ class LibsUiComponentsListRowsComponent {
128
+ /* PROPERTY */
129
+ popoverIcon = signal(`<i class='libs-ui-icon-tooltip-outline text-[16px] ml-[8px]'></i>`);
130
+ configItemTextRows = signal([]);
131
+ /* INPUT */
132
+ configTemplate = input.required();
133
+ item = input();
134
+ keySelected = input();
135
+ fieldKey = input('id');
136
+ zIndex = input(1200, { transform: (value) => !isEmpty(value) ? (value + 1) : 1200 });
137
+ outChangStageFlagMousePopover = output();
138
+ outEvent = output();
139
+ constructor() {
140
+ effect(() => {
141
+ untracked(() => this.afterViewInit());
142
+ });
143
+ }
144
+ afterViewInit() {
145
+ if (!this.configTemplate().rows?.()?.length) {
146
+ return;
147
+ }
148
+ this.configItemTextRows.set(this.configTemplate().rows?.() || []);
149
+ }
150
+ /* FUNCTIONS */
151
+ handlerSelectItem(event, item, action) {
152
+ if (event !== 'click') {
153
+ return;
154
+ }
155
+ this.outEvent.emit({ event, item, action });
156
+ }
157
+ async handlerErrorImage(event, functionGetImageError) {
158
+ event.stopPropagation();
159
+ if (!event.target || !functionGetImageError) {
160
+ return;
161
+ }
162
+ (event.target.src = await lastValueFrom(functionGetImageError(this.item())));
163
+ }
164
+ handlerChangStageFlagMouse(flag) {
165
+ this.outChangStageFlagMousePopover.emit(flag);
166
+ }
167
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListRowsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
168
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListRowsComponent, isStandalone: true, selector: "libs_ui-components-list-templates_rows", inputs: { configTemplate: { classPropertyName: "configTemplate", publicName: "configTemplate", isSignal: true, isRequired: true, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, keySelected: { classPropertyName: "keySelected", publicName: "keySelected", isSignal: true, isRequired: false, transformFunction: null }, fieldKey: { classPropertyName: "fieldKey", publicName: "fieldKey", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outChangStageFlagMousePopover: "outChangStageFlagMousePopover", outEvent: "outEvent" }, ngImport: i0, template: "@if (configTemplate() && configItemTextRows(); as configItemTextRows) {\n <div class=\"flex flex-col w-full {{ configTemplate().classRows ?? '' }}\">\n @for (row of configItemTextRows; track $index; let indexRow = $index;) {\n <div [class]=\"row().classRow\">\n @if (row().getImage && ((item() | LibsUiPipesCallFunctionInTemplatePipe:row().getImage:item()) | async); as imgUrl) {\n <img [class]=\"(item() | LibsUiPipesCallFunctionInTemplatePipe:row().getClassImage:item()) | async\"\n src=\"{{ imgUrl }}\"\n (error)=\"handlerErrorImage($event,row().getImageError)\" />\n }\n @if (item()['fieldRowAvatarConfig'+indexRow]; as avatarConfig) {\n <libs_ui-components-avatar [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [size]='avatarConfig.size || 32'\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [textAvatar]=\"avatarConfig.textAvatar\" />\n }\n @if (fieldKey() && item()['fieldLabelRow'+indexRow]; as labelRow) {\n <libs_ui-components-popover type=\"text\"\n [config]=\"row().getPopoverConfig ? (('popover' | LibsUiPipesCallFunctionInTemplatePipe:row().getPopoverConfig:item()) | async) : { zIndex: zIndex()}\"\n [classInclude]=\"(keySelected() === item()[fieldKey()]) ? (row().classItemSelected || row().classGetValue || '') :(row().classGetValue || '')\"\n [innerHtml]=\"labelRow\"\n (outChangStageFlagMouse)='handlerChangStageFlagMouse($event)'\n (outEvent)=\"handlerSelectItem($event,item(),row().action)\" />\n }\n @if (row().cols?.()?.length) {\n <div [class]=\"row().classCols || 'flex'\"\n [style]=\"item()[item()['fieldRowStylesDynamicCols'+indexRow]]\">\n @for (col of row().cols?.(); track $index; let colIndex = $index) {\n @if (col().getImage && ((item() | LibsUiPipesCallFunctionInTemplatePipe:col().getImage:item()) | async); as imgUrl) {\n <img [class]=\"(item() | LibsUiPipesCallFunctionInTemplatePipe:col().getClassImage:item()) | async\"\n src=\"{{ imgUrl }}\"\n (error)=\"handlerErrorImage($event,col().getImageError)\" />\n }\n @if (item()['fieldColAvatarConfig'+indexRow+colIndex]; as avatarConfig) {\n <libs_ui-components-avatar [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [size]='avatarConfig.size || 32'\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [textAvatar]=\"avatarConfig.textAvatar\" />\n }\n @if (item()['fieldLabelCol'+indexRow+colIndex]; as labelColFunc) {\n <libs_ui-components-popover type=\"text\"\n [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n [classInclude]=\"(keySelected() === item()[fieldKey()]) ? (row().classItemSelected || item()['fieldColClass'+indexRow+colIndex] || '') :(item()['fieldColClass'+indexRow+colIndex] || '')\"\n [innerHtml]=\"('fieldLabelCol' | LibsUiPipesCallFunctionInTemplatePipe:labelColFunc:item()) | async\"\n [config]=\"{ zIndex: zIndex() }\"\n (outChangStageFlagMouse)='handlerChangStageFlagMouse($event)'\n (outEvent)=\"handlerSelectItem($event,item(),col().action)\" />\n }\n @if (item()['fieldColPopover'+indexRow+colIndex]; as popover) {\n <libs_ui-components-popover [type]=\"popover.type ?? 'other'\"\n [config]=\"popover?.config\"\n [classInclude]=\"item()['fieldColClass'+indexRow+colIndex]\"\n [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n (outChangStageFlagMouse)='handlerChangStageFlagMouse($event)'\n (outEvent)=\"handlerSelectItem($event,item(),col().action)\">\n <span [class]=\"popover.classInclude || ''\"\n [innerHtml]=\"(popover.dataView ?? popoverIcon) | translate\">\n </span>\n </libs_ui-components-popover>\n }\n @if (item()['fieldColToggle'+indexRow+colIndex]; as toggle) {\n <libs_ui-components-label [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n [hasToggle]=\"toggle.hasToggle\"\n [toggleActive]=\"toggle.toggleActive\"\n [toggleDisable]=\"toggle.toggleDisable\"\n [popover]=\"toggle.popover\"\n [classInclude]=\"toggle.classInclude\"\n [labelLeft]=\"toggle.labelLeft\"\n [labelRight]=\"toggle.labelRight\"\n (outSwitchEvent)=\"handlerSelectItem('click',item(),col().action)\" />\n }\n @if (item()['fieldColButton'+indexRow+colIndex]; as button) {\n <libs_ui-components-buttons-button [type]=\"button.type\"\n [classIconLeft]=\"button.classIconLeft\"\n [classIconRight]=\"button.classIconRight\"\n [classLabel]=\"button.classLabel\"\n [iconOnlyType]=\"button.iconOnlyType\"\n [popover]=\"button.popover\"\n [disable]=\"button.disable\"\n [ignorePointerEvent]=\"button.ignorePointerEvent\"\n [classInclude]=\"item()['fieldColClass'+indexRow+colIndex] ?? ' '\"\n [ignoreStopPropagationEvent]=\"false\"\n (outClick)=\"handlerSelectItem('click',item(),col().action)\" />\n }\n @if (item()['fieldBadge'+indexRow+colIndex]; as badge) {\n <libs_ui-components-badge [mode]=\"badge.mode || 'x+'\"\n [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n [count]=\"badge.count\"\n [maxCount]=\"badge.maxCount || 99\"\n [classCircle]=\"badge.classCircle || 'libs-ui-font-h4r'\" />\n }\n }\n </div>\n }\n </div>\n }\n </div>\n}\n", styles: [""], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsAvatarComponent, selector: "libs_ui-components-avatar", inputs: ["getLastTextAfterSpace", "typeShape", "classInclude", "size", "linkAvatar", "linkAvatarError", "idGenColor", "textAvatar", "classImageInclude"], outputs: ["outAvatarError"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsLabelComponent, selector: "libs_ui-components-label", inputs: ["iconPopoverClass", "classInclude", "labelLeft", "labelLeftClass", "labelLeftBehindToggleButton", "popover", "required", "buttonsLeft", "disableButtonsLeft", "buttonsRight", "disableButtonsRight", "labelRight", "labelRightClass", "labelRightRequired", "hasToggle", "toggleSize", "toggleActive", "toggleDisable", "description", "descriptionClass", "buttonsDescription", "disableButtonsDescription", "buttonsDescriptionContainerClass", "onlyShowCount", "zIndexPopover", "timerDestroyPopover", "count", "limitLength"], outputs: ["outClickButton", "outSwitchEvent", "outLabelRightClick", "outLabelLeftClick"] }, { kind: "component", type: LibsUiComponentsBadgeComponent, selector: "libs_ui-components-badge", inputs: ["popoverConfig", "active", "count", "mode", "maxCount", "ignoreMarginDefault", "classCircle", "ignoreStopPropagationEvent"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListRowsComponent, decorators: [{
171
+ type: Component,
172
+ args: [{ selector: "libs_ui-components-list-templates_rows", standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
173
+ AsyncPipe, TranslateModule,
174
+ LibsUiComponentsAvatarComponent,
175
+ LibsUiComponentsPopoverComponent,
176
+ LibsUiComponentsButtonsButtonComponent,
177
+ LibsUiComponentsLabelComponent,
178
+ LibsUiComponentsBadgeComponent,
179
+ LibsUiPipesCallFunctionInTemplatePipe
180
+ ], template: "@if (configTemplate() && configItemTextRows(); as configItemTextRows) {\n <div class=\"flex flex-col w-full {{ configTemplate().classRows ?? '' }}\">\n @for (row of configItemTextRows; track $index; let indexRow = $index;) {\n <div [class]=\"row().classRow\">\n @if (row().getImage && ((item() | LibsUiPipesCallFunctionInTemplatePipe:row().getImage:item()) | async); as imgUrl) {\n <img [class]=\"(item() | LibsUiPipesCallFunctionInTemplatePipe:row().getClassImage:item()) | async\"\n src=\"{{ imgUrl }}\"\n (error)=\"handlerErrorImage($event,row().getImageError)\" />\n }\n @if (item()['fieldRowAvatarConfig'+indexRow]; as avatarConfig) {\n <libs_ui-components-avatar [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [size]='avatarConfig.size || 32'\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [textAvatar]=\"avatarConfig.textAvatar\" />\n }\n @if (fieldKey() && item()['fieldLabelRow'+indexRow]; as labelRow) {\n <libs_ui-components-popover type=\"text\"\n [config]=\"row().getPopoverConfig ? (('popover' | LibsUiPipesCallFunctionInTemplatePipe:row().getPopoverConfig:item()) | async) : { zIndex: zIndex()}\"\n [classInclude]=\"(keySelected() === item()[fieldKey()]) ? (row().classItemSelected || row().classGetValue || '') :(row().classGetValue || '')\"\n [innerHtml]=\"labelRow\"\n (outChangStageFlagMouse)='handlerChangStageFlagMouse($event)'\n (outEvent)=\"handlerSelectItem($event,item(),row().action)\" />\n }\n @if (row().cols?.()?.length) {\n <div [class]=\"row().classCols || 'flex'\"\n [style]=\"item()[item()['fieldRowStylesDynamicCols'+indexRow]]\">\n @for (col of row().cols?.(); track $index; let colIndex = $index) {\n @if (col().getImage && ((item() | LibsUiPipesCallFunctionInTemplatePipe:col().getImage:item()) | async); as imgUrl) {\n <img [class]=\"(item() | LibsUiPipesCallFunctionInTemplatePipe:col().getClassImage:item()) | async\"\n src=\"{{ imgUrl }}\"\n (error)=\"handlerErrorImage($event,col().getImageError)\" />\n }\n @if (item()['fieldColAvatarConfig'+indexRow+colIndex]; as avatarConfig) {\n <libs_ui-components-avatar [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [size]='avatarConfig.size || 32'\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [textAvatar]=\"avatarConfig.textAvatar\" />\n }\n @if (item()['fieldLabelCol'+indexRow+colIndex]; as labelColFunc) {\n <libs_ui-components-popover type=\"text\"\n [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n [classInclude]=\"(keySelected() === item()[fieldKey()]) ? (row().classItemSelected || item()['fieldColClass'+indexRow+colIndex] || '') :(item()['fieldColClass'+indexRow+colIndex] || '')\"\n [innerHtml]=\"('fieldLabelCol' | LibsUiPipesCallFunctionInTemplatePipe:labelColFunc:item()) | async\"\n [config]=\"{ zIndex: zIndex() }\"\n (outChangStageFlagMouse)='handlerChangStageFlagMouse($event)'\n (outEvent)=\"handlerSelectItem($event,item(),col().action)\" />\n }\n @if (item()['fieldColPopover'+indexRow+colIndex]; as popover) {\n <libs_ui-components-popover [type]=\"popover.type ?? 'other'\"\n [config]=\"popover?.config\"\n [classInclude]=\"item()['fieldColClass'+indexRow+colIndex]\"\n [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n (outChangStageFlagMouse)='handlerChangStageFlagMouse($event)'\n (outEvent)=\"handlerSelectItem($event,item(),col().action)\">\n <span [class]=\"popover.classInclude || ''\"\n [innerHtml]=\"(popover.dataView ?? popoverIcon) | translate\">\n </span>\n </libs_ui-components-popover>\n }\n @if (item()['fieldColToggle'+indexRow+colIndex]; as toggle) {\n <libs_ui-components-label [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n [hasToggle]=\"toggle.hasToggle\"\n [toggleActive]=\"toggle.toggleActive\"\n [toggleDisable]=\"toggle.toggleDisable\"\n [popover]=\"toggle.popover\"\n [classInclude]=\"toggle.classInclude\"\n [labelLeft]=\"toggle.labelLeft\"\n [labelRight]=\"toggle.labelRight\"\n (outSwitchEvent)=\"handlerSelectItem('click',item(),col().action)\" />\n }\n @if (item()['fieldColButton'+indexRow+colIndex]; as button) {\n <libs_ui-components-buttons-button [type]=\"button.type\"\n [classIconLeft]=\"button.classIconLeft\"\n [classIconRight]=\"button.classIconRight\"\n [classLabel]=\"button.classLabel\"\n [iconOnlyType]=\"button.iconOnlyType\"\n [popover]=\"button.popover\"\n [disable]=\"button.disable\"\n [ignorePointerEvent]=\"button.ignorePointerEvent\"\n [classInclude]=\"item()['fieldColClass'+indexRow+colIndex] ?? ' '\"\n [ignoreStopPropagationEvent]=\"false\"\n (outClick)=\"handlerSelectItem('click',item(),col().action)\" />\n }\n @if (item()['fieldBadge'+indexRow+colIndex]; as badge) {\n <libs_ui-components-badge [mode]=\"badge.mode || 'x+'\"\n [style]=\"(' ' | LibsUiPipesCallFunctionInTemplatePipe:item()['fieldColStylesDynamic'+indexRow+colIndex]:item()) | async\"\n [count]=\"badge.count\"\n [maxCount]=\"badge.maxCount || 99\"\n [classCircle]=\"badge.classCircle || 'libs-ui-font-h4r'\" />\n }\n }\n </div>\n }\n </div>\n }\n </div>\n}\n" }]
181
+ }], ctorParameters: () => [] });
182
+
183
+ /* eslint-disable @typescript-eslint/no-explicit-any */
184
+ /* eslint-disable @angular-eslint/use-lifecycle-interface */
185
+ class LibsUiComponentsListTemplatesComponentAbstract {
186
+ /* PROPERTY */
187
+ loading = signal(true);
188
+ heightViewPort = signal(0);
189
+ store = signal([]);
190
+ items = signal([]);
191
+ loadedLastItem = signal(false);
192
+ hasScroll = signal(false);
193
+ fieldKeyDefault = signal('id');
194
+ fieldKey = signal('id');
195
+ timeAutoScrollItemSelected = signal(0);
196
+ pagingStore = signal(undefined);
197
+ heightItem = signal(0);
198
+ timeIntervalIntervalSetHeightViewPort = signal(0);
199
+ timeIntervalCheckScroll = signal(250);
200
+ onDestroy = new Subject();
201
+ intervalSetHeightViewPortSubscription;
202
+ intervalCheckScrollSubscription;
203
+ /* INPUT */
204
+ functionGetItemsAutoAddList = input();
205
+ paddingLeftItem = input(undefined);
206
+ maxItemShow = input(0);
207
+ searchConfig = input();
208
+ config = input();
209
+ keySearch = model('');
210
+ dropdownTabKeyActive = input();
211
+ isSearchOnline = input(false);
212
+ onSearch = input();
213
+ onRefresh = input();
214
+ onSetHiddenItemByKey = input();
215
+ onRemoveItems = input();
216
+ onSetDataStore = input();
217
+ onUpdateMultiKeySelectedGroup = input();
218
+ onItemChangeUnSelect = input();
219
+ onUpdateData = input();
220
+ clickExactly = input();
221
+ keySelected = model(); // sử dụng cho type radio,text.
222
+ multiKeySelected = model([]); // sử dụng cho type cho phép chọn nhiều.
223
+ keysDisableItem = input();
224
+ keysHiddenItem = model();
225
+ disable = input();
226
+ disableLabel = input();
227
+ zIndex = input(1200);
228
+ loadingIconSize = input();
229
+ resetKeyWhenSelectAllKeyDropdown = input();
230
+ ignoreClassDisableDefaultWhenUseKeysDisableItem = input(); // bỏ chế độ disable item trên html để disable từng phần trong rows
231
+ templateRefSearchNoData = input(undefined);
232
+ autoSelectedFirstItemCallOutsideBefore = input(false);
233
+ /* OUTPUT */
234
+ outSortSingleSelect = output();
235
+ outSelectKey = output(); // sử dụng cho type radio,text.
236
+ outSelectMultiKey = output(); // sử dụng cho type cho phép chọn nhiều.
237
+ outUnSelectMultiKey = output(); // sử dụng cho type cho phép chọn nhiều.
238
+ outFieldKey = output();
239
+ outChangeView = output();
240
+ outLoading = output();
241
+ outChangStageFlagMousePopover = output();
242
+ outLoadItemsComplete = output();
243
+ /* VIEW CHILD */
244
+ itemRef = viewChild('itemRef');
245
+ /* INJECT */
246
+ translateService = inject(TranslateService);
247
+ httpRequestService = inject(LibsUiHttpRequestService);
248
+ constructor() {
249
+ this.outLoading.emit(this.loading());
250
+ }
251
+ ngOnInit() {
252
+ this.onSearch()?.pipe(takeUntil(this.onDestroy)).subscribe((keySearch) => {
253
+ this.keySearch.set(keySearch ?? '');
254
+ this.processSearch();
255
+ });
256
+ this.onRefresh()?.pipe(skipWhile(() => this.loading()), takeUntil(this.onDestroy)).subscribe(() => {
257
+ if (this.dropdownTabKeyActive()) {
258
+ this.items.set([]);
259
+ this.store.set([]);
260
+ }
261
+ this.callApiByService(true);
262
+ });
263
+ this.onItemChangeUnSelect()?.pipe(takeUntil(this.onDestroy)).subscribe((item) => {
264
+ if (!item) {
265
+ return;
266
+ }
267
+ this.processKeyChangeUnSelect(item);
268
+ });
269
+ this.onSetHiddenItemByKey()?.pipe(takeUntil(this.onDestroy)).subscribe(this.setHiddenItemByKey.bind(this));
270
+ this.outFieldKey.emit(getFieldKeyByType(this.config(), this.fieldKeyDefault()));
271
+ this.onRemoveItems()?.pipe(takeUntil(this.onDestroy)).subscribe(this.removeItems.bind(this));
272
+ this.onUpdateData()?.pipe(takeUntil(this.onDestroy)).subscribe(this.updateData.bind(this));
273
+ }
274
+ /* FUNCTIONS */
275
+ updateData(data) {
276
+ if (!data) {
277
+ return;
278
+ }
279
+ const { newData, functionCustomAddDataToStore } = data;
280
+ if (!newData() || !newData().length) {
281
+ return;
282
+ }
283
+ if (this.config()?.type === 'checkbox') {
284
+ newData().forEach(item => item.update(value => ({ ...value, isAddNew: true })));
285
+ }
286
+ functionCustomAddDataToStore(newData, this.store);
287
+ this.processData();
288
+ }
289
+ getFieldKey() {
290
+ let fieldKey;
291
+ const config = this.config();
292
+ if (!config) {
293
+ return 'id';
294
+ }
295
+ switch (config.type) {
296
+ case 'group':
297
+ fieldKey = config.configTemplateGroup?.()?.fieldKey;
298
+ break;
299
+ case 'tag':
300
+ fieldKey = config.configTemplateTag?.()?.fieldKey;
301
+ break;
302
+ case 'text':
303
+ fieldKey = config.configTemplateText?.()?.fieldKey;
304
+ break;
305
+ case 'checkbox':
306
+ fieldKey = config.configTemplateCheckbox?.()?.fieldKey;
307
+ break;
308
+ case 'radio':
309
+ fieldKey = config.configTemplateRadio?.()?.fieldKey;
310
+ break;
311
+ }
312
+ return fieldKey || 'id';
313
+ }
314
+ removeItems(keys) {
315
+ const fieldKey = this.getFieldKey();
316
+ [this.store(), this.items()].forEach(element => {
317
+ if (this.config()?.type === 'group') {
318
+ element.forEach(item => {
319
+ this.removeItem(item()[this.config()?.configTemplateGroup?.()?.fieldGetItems || 'items'](), keys, fieldKey);
320
+ });
321
+ return;
322
+ }
323
+ this.removeItem(element, keys, fieldKey);
324
+ });
325
+ this.processData();
326
+ }
327
+ removeItem(data, keys, fieldKey) {
328
+ if (!data || !data.length) {
329
+ return;
330
+ }
331
+ keys.forEach(key => {
332
+ const index = data.findIndex(item => item()[fieldKey] === key);
333
+ if (index > -1) {
334
+ data.splice(index, 1);
335
+ }
336
+ });
337
+ }
338
+ setHeightViewPort(callBackCalculatorHeightSuccess) {
339
+ const lengthItems = this.getLengthItem();
340
+ if (!lengthItems) {
341
+ this.outChangeView.emit([...this.items()]);
342
+ if (this.heightItem()) {
343
+ this.heightViewPort.set(this.heightItem());
344
+ }
345
+ callBackCalculatorHeightSuccess?.();
346
+ return;
347
+ }
348
+ const heightViewPort = this.getHeightGroupHasLine() + (lengthItems < this.maxItemShow() ? lengthItems * this.heightItem() : this.maxItemShow() * this.heightItem()) + (this.config()?.configTemplateGroup?.()?.configCheckboxCheckAll ? 27 : 0) + (this.config()?.configTemplateGroup?.()?.configButtonSelectAndUndSelectItem ? 27 : 0);
349
+ if (!this.maxItemShow()) {
350
+ this.heightViewPort.set(0);
351
+ }
352
+ if (this.heightItem() > 13) {
353
+ if (heightViewPort && heightViewPort !== this.heightViewPort()) {
354
+ this.heightViewPort.set(heightViewPort);
355
+ }
356
+ this.outChangeView.emit([...this.items()]);
357
+ callBackCalculatorHeightSuccess?.();
358
+ return;
359
+ }
360
+ this.intervalSetHeightViewPortSubscription?.unsubscribe();
361
+ this.intervalSetHeightViewPortSubscription = interval(this.timeIntervalIntervalSetHeightViewPort()).pipe(takeUntil(this.onDestroy)).subscribe(() => {
362
+ if (!this.itemRef() || !this.itemRef()?.nativeElement) {
363
+ return;
364
+ }
365
+ this.heightItem.set(this.itemRef()?.nativeElement.getBoundingClientRect().height);
366
+ if (this.heightItem() < 13) {
367
+ return;
368
+ }
369
+ this.intervalSetHeightViewPortSubscription?.unsubscribe();
370
+ this.setHeightViewPort(callBackCalculatorHeightSuccess);
371
+ });
372
+ }
373
+ setHiddenItemByKey(keys) {
374
+ this.keysHiddenItem.set(keys);
375
+ if (this.store() && this.store().length) {
376
+ this.processData(false);
377
+ }
378
+ }
379
+ checkViewPortScroll(callBack) {
380
+ const pre = this.hasScroll();
381
+ this.intervalCheckScrollSubscription?.unsubscribe();
382
+ this.intervalCheckScrollSubscription = interval(this.timeIntervalCheckScroll()).pipe(take(5)).subscribe(() => {
383
+ this.hasScroll.set(false);
384
+ if (this.items() && !this.items().length && pre && !this.hasScroll()) {
385
+ callBack?.(pre, this.hasScroll());
386
+ this.intervalCheckScrollSubscription?.unsubscribe();
387
+ }
388
+ callBack?.(pre, this.hasScroll());
389
+ this.intervalCheckScrollSubscription?.unsubscribe();
390
+ });
391
+ }
392
+ async callApiByService(firstCall = true) {
393
+ const config = this.config();
394
+ if (!config) {
395
+ return;
396
+ }
397
+ try {
398
+ const { httpRequestData, ignoreShowDataWhenNotSearch } = config;
399
+ if (!httpRequestData?.() || (ignoreShowDataWhenNotSearch && !this.keySearch())) {
400
+ this.loading.set(false);
401
+ this.outLoading.emit(this.loading());
402
+ this.loadedLastItem.set(true);
403
+ if (ignoreShowDataWhenNotSearch && !this.keySearch()) {
404
+ this.items.set([]);
405
+ this.store.set([]);
406
+ this.processData(true);
407
+ }
408
+ return;
409
+ }
410
+ this.loading.set(true);
411
+ this.outLoading.emit(this.loading());
412
+ const { argumentsValue, guideAutoUpdateArgumentsValue } = httpRequestData();
413
+ if (firstCall) {
414
+ const loadedLastItem = this.httpRequestService.updateArguments(argumentsValue, { ...this.fakeResponseApi(), dropdownTabKeyActive: this.dropdownTabKeyActive() }, this.pagingStore() || {}, this.keySearch(), this.isSearchOnline(), this.loadedLastItem(), guideAutoUpdateArgumentsValue);
415
+ this.loadedLastItem.set(loadedLastItem);
416
+ }
417
+ const result = await this.httpRequestService.callApi(httpRequestData());
418
+ this.pagingStore.set(result.paging);
419
+ if (!this.pagingStore) {
420
+ this.loadedLastItem.set(true);
421
+ }
422
+ const loadedLastItem = this.httpRequestService.updateArguments(argumentsValue, { ...result, dropdownTabKeyActive: this.dropdownTabKeyActive() }, this.pagingStore() || {}, this.keySearch(), this.isSearchOnline(), this.loadedLastItem(), guideAutoUpdateArgumentsValue);
423
+ this.loadedLastItem.set(loadedLastItem);
424
+ if (firstCall) {
425
+ this.store.set(convertObjectToSignal(result.data || [])());
426
+ if (this.functionGetItemsAutoAddList()) {
427
+ const newItems = convertObjectToSignal(this.functionGetItemsAutoAddList()?.() || []);
428
+ this.store.update(items => [...newItems(), ...items]);
429
+ }
430
+ this.processData(true);
431
+ return;
432
+ }
433
+ this.store.update(items => [...items, ...convertObjectToSignal(result.data || [])()]);
434
+ this.processData(false);
435
+ }
436
+ catch (error) {
437
+ this.loading.set(false);
438
+ this.outLoading.emit(this.loading());
439
+ console.log(error);
440
+ }
441
+ }
442
+ fakeResponseApi() {
443
+ this.loadedLastItem.set(false);
444
+ this.pagingStore.set({});
445
+ return this.httpRequestService.fakeResponsePagingApi();
446
+ }
447
+ buildValueByConfig(item, configTemplate) {
448
+ const ref = item().ref || {};
449
+ const label = ref.label || ref.title || ref.value || ref.name || ' ';
450
+ if (typeof label === 'string') {
451
+ item.update(currentItem => {
452
+ return { ...currentItem, fieldLabel: this.translateService.instant(ref.label || ref.title || ref.value || ref.name || ' ') };
453
+ });
454
+ }
455
+ if (configTemplate?.getValue) {
456
+ const value = configTemplate.getValue(ref);
457
+ item.update(currentItem => {
458
+ return { ...currentItem, fieldLabel: value ? this.translateService.instant(`${value}`) : '' };
459
+ });
460
+ }
461
+ if (configTemplate?.getPopover) {
462
+ item.update(currentItem => {
463
+ return { ...currentItem, popoverLabel: configTemplate?.getPopover?.(item()) };
464
+ });
465
+ }
466
+ if (!configTemplate?.rows?.()) {
467
+ return item().fieldLabel;
468
+ }
469
+ let textSearch = item().fieldLabel || '';
470
+ const rows = convertSignalToObject(configTemplate.rows());
471
+ rows.forEach((row, indexRow) => {
472
+ const fieldNameRow = `fieldLabelRow${indexRow}`;
473
+ const currentItem = cloneDeep(item());
474
+ const newItem = { ...currentItem };
475
+ newItem[fieldNameRow] = row.getValue && row.getValue(ref);
476
+ newItem[`fieldRowStylesDynamicCols${indexRow}`] = row.getRowStylesDynamicCols && row.getRowStylesDynamicCols(ref);
477
+ newItem[`fieldRowAvatarConfig${indexRow}`] = row.getAvatarConfig && row.getAvatarConfig(ref);
478
+ if (row.cols && row.cols.length) {
479
+ row.cols.forEach(async (col, indexCol) => {
480
+ const fieldNameCol = `fieldLabelCol${indexRow}${indexCol}`;
481
+ newItem[fieldNameCol] = col.getValue;
482
+ newItem[`fieldColClass${indexRow}${indexCol}`] = col.getClassCol && col.getClassCol(ref, indexCol);
483
+ newItem[`fieldColPopover${indexRow}${indexCol}`] = col.getPopover && col.getPopover(ref, indexCol);
484
+ newItem[`fieldBadge${indexRow}${indexCol}`] = col.getConfigBadge && col.getConfigBadge(ref, indexCol);
485
+ newItem[`fieldColStylesDynamic${indexRow}${indexCol}`] = col.getStylesDynamicCol;
486
+ newItem[`fieldColButton${indexRow}${indexCol}`] = col.getButton && col.getButton(ref, indexCol);
487
+ newItem[`fieldColSwitch${indexRow}${indexCol}`] = col.getLabelSwitch && col.getLabelSwitch(ref, indexCol);
488
+ newItem[`fieldColAvatarConfig${indexRow}${indexCol}`] = col.getAvatarConfig && col.getAvatarConfig(ref);
489
+ textSearch = ` ${textSearch} ${newItem[fieldNameCol] || ''} `;
490
+ });
491
+ }
492
+ item.update(() => newItem);
493
+ textSearch = ` ${textSearch} ${item()[fieldNameRow] || ''} `;
494
+ });
495
+ return textSearch || ' ';
496
+ }
497
+ handlerChangStageFlagMouse(flag) {
498
+ this.outChangStageFlagMousePopover.emit(flag);
499
+ }
500
+ getHeightGroupHasLine() {
501
+ return 0;
502
+ }
503
+ ngOnDestroy() {
504
+ clearTimeout(this.timeAutoScrollItemSelected());
505
+ this.onDestroy.next();
506
+ this.onDestroy.complete();
507
+ }
508
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListTemplatesComponentAbstract, deps: [], target: i0.ɵɵFactoryTarget.Directive });
509
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.13", type: LibsUiComponentsListTemplatesComponentAbstract, inputs: { functionGetItemsAutoAddList: { classPropertyName: "functionGetItemsAutoAddList", publicName: "functionGetItemsAutoAddList", isSignal: true, isRequired: false, transformFunction: null }, paddingLeftItem: { classPropertyName: "paddingLeftItem", publicName: "paddingLeftItem", isSignal: true, isRequired: false, transformFunction: null }, maxItemShow: { classPropertyName: "maxItemShow", publicName: "maxItemShow", isSignal: true, isRequired: false, transformFunction: null }, searchConfig: { classPropertyName: "searchConfig", publicName: "searchConfig", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, keySearch: { classPropertyName: "keySearch", publicName: "keySearch", isSignal: true, isRequired: false, transformFunction: null }, dropdownTabKeyActive: { classPropertyName: "dropdownTabKeyActive", publicName: "dropdownTabKeyActive", isSignal: true, isRequired: false, transformFunction: null }, isSearchOnline: { classPropertyName: "isSearchOnline", publicName: "isSearchOnline", isSignal: true, isRequired: false, transformFunction: null }, onSearch: { classPropertyName: "onSearch", publicName: "onSearch", isSignal: true, isRequired: false, transformFunction: null }, onRefresh: { classPropertyName: "onRefresh", publicName: "onRefresh", isSignal: true, isRequired: false, transformFunction: null }, onSetHiddenItemByKey: { classPropertyName: "onSetHiddenItemByKey", publicName: "onSetHiddenItemByKey", isSignal: true, isRequired: false, transformFunction: null }, onRemoveItems: { classPropertyName: "onRemoveItems", publicName: "onRemoveItems", isSignal: true, isRequired: false, transformFunction: null }, onSetDataStore: { classPropertyName: "onSetDataStore", publicName: "onSetDataStore", isSignal: true, isRequired: false, transformFunction: null }, onUpdateMultiKeySelectedGroup: { classPropertyName: "onUpdateMultiKeySelectedGroup", publicName: "onUpdateMultiKeySelectedGroup", isSignal: true, isRequired: false, transformFunction: null }, onItemChangeUnSelect: { classPropertyName: "onItemChangeUnSelect", publicName: "onItemChangeUnSelect", isSignal: true, isRequired: false, transformFunction: null }, onUpdateData: { classPropertyName: "onUpdateData", publicName: "onUpdateData", isSignal: true, isRequired: false, transformFunction: null }, clickExactly: { classPropertyName: "clickExactly", publicName: "clickExactly", isSignal: true, isRequired: false, transformFunction: null }, keySelected: { classPropertyName: "keySelected", publicName: "keySelected", isSignal: true, isRequired: false, transformFunction: null }, multiKeySelected: { classPropertyName: "multiKeySelected", publicName: "multiKeySelected", isSignal: true, isRequired: false, transformFunction: null }, keysDisableItem: { classPropertyName: "keysDisableItem", publicName: "keysDisableItem", isSignal: true, isRequired: false, transformFunction: null }, keysHiddenItem: { classPropertyName: "keysHiddenItem", publicName: "keysHiddenItem", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, disableLabel: { classPropertyName: "disableLabel", publicName: "disableLabel", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, loadingIconSize: { classPropertyName: "loadingIconSize", publicName: "loadingIconSize", isSignal: true, isRequired: false, transformFunction: null }, resetKeyWhenSelectAllKeyDropdown: { classPropertyName: "resetKeyWhenSelectAllKeyDropdown", publicName: "resetKeyWhenSelectAllKeyDropdown", isSignal: true, isRequired: false, transformFunction: null }, ignoreClassDisableDefaultWhenUseKeysDisableItem: { classPropertyName: "ignoreClassDisableDefaultWhenUseKeysDisableItem", publicName: "ignoreClassDisableDefaultWhenUseKeysDisableItem", isSignal: true, isRequired: false, transformFunction: null }, templateRefSearchNoData: { classPropertyName: "templateRefSearchNoData", publicName: "templateRefSearchNoData", isSignal: true, isRequired: false, transformFunction: null }, autoSelectedFirstItemCallOutsideBefore: { classPropertyName: "autoSelectedFirstItemCallOutsideBefore", publicName: "autoSelectedFirstItemCallOutsideBefore", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { keySearch: "keySearchChange", keySelected: "keySelectedChange", multiKeySelected: "multiKeySelectedChange", keysHiddenItem: "keysHiddenItemChange", outSortSingleSelect: "outSortSingleSelect", outSelectKey: "outSelectKey", outSelectMultiKey: "outSelectMultiKey", outUnSelectMultiKey: "outUnSelectMultiKey", outFieldKey: "outFieldKey", outChangeView: "outChangeView", outLoading: "outLoading", outChangStageFlagMousePopover: "outChangStageFlagMousePopover", outLoadItemsComplete: "outLoadItemsComplete" }, viewQueries: [{ propertyName: "itemRef", first: true, predicate: ["itemRef"], descendants: true, isSignal: true }], ngImport: i0 });
510
+ }
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListTemplatesComponentAbstract, decorators: [{
512
+ type: Directive
513
+ }], ctorParameters: () => [] });
514
+
515
+ /* eslint-disable @typescript-eslint/no-explicit-any */
516
+ class LibsUiComponentsListCheckboxComponent extends LibsUiComponentsListTemplatesComponentAbstract {
517
+ /* PROPERTY */
518
+ configTemplateCheckbox = signal(undefined);
519
+ ngOnInit() {
520
+ if (isEmpty(this.config()?.configTemplateCheckbox?.())) {
521
+ return;
522
+ }
523
+ super.ngOnInit();
524
+ this.configTemplateCheckbox.set(this.config()?.configTemplateCheckbox?.());
525
+ this.fieldKey.set(this.configTemplateCheckbox()?.fieldKey ?? this.fieldKeyDefault());
526
+ this.callApiByService();
527
+ }
528
+ /* FUNCTIONS */
529
+ async handlerSelect(isSelectAll) {
530
+ if (isSelectAll && this.resetKeyWhenSelectAllKeyDropdown()) {
531
+ this.multiKeySelected.set([]);
532
+ }
533
+ if (!this.multiKeySelected()) {
534
+ this.multiKeySelected.set([]);
535
+ }
536
+ if (this.loading()) {
537
+ return;
538
+ }
539
+ const result = await this.getIdsByService();
540
+ this.processHandlerSelectData(isSelectAll, result.data);
541
+ }
542
+ processHandlerSelectData(isSelectAll, ids) {
543
+ const keysDisable = this.keysDisableItem() || [];
544
+ const keys = new Set(this.multiKeySelected());
545
+ this.multiKeySelected.set([]);
546
+ this.loading.set(false);
547
+ this.outLoading.emit(this.loading());
548
+ if (isSelectAll) {
549
+ if (ids.length) {
550
+ ids.forEach(id => !keysDisable.some(key => key === id) && keys.add(id));
551
+ }
552
+ if (!ids.length) {
553
+ this.items().forEach(item => {
554
+ const key = item()[this.fieldKey()];
555
+ if (!keysDisable.some(keyDisable => keyDisable === key)) {
556
+ keys.add(key);
557
+ }
558
+ });
559
+ }
560
+ this.multiKeySelected.update(items => [...(items || []), ...keys]);
561
+ this.emitSelectMultiKey(this.multiKeySelected() || []);
562
+ return;
563
+ }
564
+ const keyUnSelected = new Set();
565
+ ids.forEach(id => {
566
+ if (!keysDisable.some(key => key === id)) {
567
+ keys.delete(id);
568
+ keyUnSelected.add(id);
569
+ }
570
+ });
571
+ if (!ids.length) {
572
+ this.items().forEach(item => {
573
+ const key = item()[this.fieldKey()];
574
+ if (!keysDisable.some(key => key === key)) {
575
+ keys.delete(key);
576
+ keyUnSelected.add(key);
577
+ }
578
+ });
579
+ }
580
+ this.multiKeySelected.update(items => [...(items || []), ...keys]);
581
+ this.outUnSelectMultiKey.emit(Array.from(keyUnSelected));
582
+ this.outSelectMultiKey.emit({ keys: this.multiKeySelected() || [], mapKeys: [], isClickManual: true });
583
+ }
584
+ async getIdsByService() {
585
+ if (!this.searchConfig() || !this.isSearchOnline()) {
586
+ return { code: 200, data: this.items().map(item => item()[this.fieldKey()]) };
587
+ }
588
+ try {
589
+ if (!this.configTemplateCheckbox()?.httpRequestAllIdSelectOrUnSelect?.()) {
590
+ return { data: [] };
591
+ }
592
+ this.loading.set(true);
593
+ this.outLoading.emit(this.loading());
594
+ const httpRequestAllIdSelectOrUnSelect = this.configTemplateCheckbox()?.httpRequestAllIdSelectOrUnSelect?.();
595
+ if (!httpRequestAllIdSelectOrUnSelect) {
596
+ return { data: [] };
597
+ }
598
+ const { argumentsValue, guideAutoUpdateArgumentsValue } = httpRequestAllIdSelectOrUnSelect;
599
+ this.httpRequestService.updateArguments(argumentsValue, this.httpRequestService.fakeResponsePagingApi(), {}, this.keySearch(), this.isSearchOnline(), false, guideAutoUpdateArgumentsValue);
600
+ const result = await this.httpRequestService.callApi(httpRequestAllIdSelectOrUnSelect);
601
+ if (!result || !result.data || !result.data.length) {
602
+ return { data: [] };
603
+ }
604
+ return result;
605
+ }
606
+ catch (error) {
607
+ console.log(error);
608
+ return { data: [] };
609
+ }
610
+ }
611
+ handlerScrollBottom() {
612
+ if (this.loadedLastItem()) {
613
+ this.loading.set(false);
614
+ this.outLoading.emit(this.loading());
615
+ return;
616
+ }
617
+ if (this.loading() || this.loadedLastItem()) {
618
+ return;
619
+ }
620
+ this.loading.set(true);
621
+ this.outLoading.emit(this.loading());
622
+ this.callApiByService(false);
623
+ }
624
+ processSearch() {
625
+ if (!this.isSearchOnline()) {
626
+ return this.processData(true);
627
+ }
628
+ this.callApiByService(true);
629
+ }
630
+ processKeyChangeUnSelect(item) {
631
+ if (isNil(item[this.fieldKey()]) || item[this.fieldKey()] === '') {
632
+ return;
633
+ }
634
+ this.checkAndEmitMultiKeySelected(item);
635
+ }
636
+ handlerChange(event, item, ignoreDisable = false, isClickManual = true) {
637
+ if (this.configTemplateCheckbox()?.ignoreClickItemUnChecked) {
638
+ const key = item[this.fieldKey()];
639
+ if (this.multiKeySelected()?.includes(key)) {
640
+ return;
641
+ }
642
+ }
643
+ if (!this.multiKeySelected()) {
644
+ this.multiKeySelected.set([]);
645
+ }
646
+ if (!ignoreDisable && (this.disable() || this.keysDisableItem()?.some(key => key === item[this.fieldKey()]))) {
647
+ return;
648
+ }
649
+ if (event instanceof Event) {
650
+ if (this.clickExactly()) {
651
+ return;
652
+ }
653
+ this.checkAndEmitMultiKeySelected(item, isClickManual);
654
+ return;
655
+ }
656
+ this.checkAndEmitMultiKeySelected(item, isClickManual);
657
+ }
658
+ checkAndEmitMultiKeySelected(item, isClickManual = true) {
659
+ const key = item[this.fieldKey()];
660
+ const indexOfKey = this.multiKeySelected()?.indexOf(key) ?? -1;
661
+ if (indexOfKey < 0) {
662
+ this.multiKeySelected.update(items => [...(items || []), key]);
663
+ this.emitSelectMultiKey(this.multiKeySelected() || [], isClickManual);
664
+ return;
665
+ }
666
+ this.multiKeySelected()?.splice(indexOfKey, 1);
667
+ this.outUnSelectMultiKey.emit([key]);
668
+ this.emitSelectMultiKey(this.multiKeySelected() || [], isClickManual);
669
+ }
670
+ async emitSelectMultiKey(multiKeySelected, isClickManual = true) {
671
+ const mapKeys = new Array();
672
+ if (!multiKeySelected || !multiKeySelected.length) {
673
+ return this.outSelectMultiKey.emit({ keys: [], mapKeys, isClickManual });
674
+ }
675
+ multiKeySelected.forEach((key) => {
676
+ const item = this.store().find(item => item()[this.fieldKey()] === key);
677
+ mapKeys.push({ key, item: convertSignalToObject(item), isClickManual });
678
+ });
679
+ this.outSelectMultiKey.emit({ keys: this.multiKeySelected() || [], mapKeys, isClickManual });
680
+ }
681
+ processData(replace) {
682
+ const itemByKeySearch = [];
683
+ const keysHidden = this.keysHiddenItem() || [];
684
+ const itemsAddNew = [];
685
+ if (replace) {
686
+ this.items.set([]);
687
+ }
688
+ this.store().forEach((item) => {
689
+ const itemTypeAddNew = item().isAddNew;
690
+ item.update(current => {
691
+ delete current.isAddNew;
692
+ return current;
693
+ });
694
+ const dataStore = cloneDeep(item);
695
+ dataStore.update(currentStore => {
696
+ return { ...currentStore, ref: item() };
697
+ });
698
+ if (this.configTemplateCheckbox()?.getPopover) {
699
+ dataStore.update(currentStore => {
700
+ return { ...currentStore, dataTooltip: this.configTemplateCheckbox()?.getPopover?.(dataStore()) };
701
+ });
702
+ }
703
+ const key = keysHidden.find(key => dataStore()[this.fieldKey()] === key);
704
+ if (key === undefined) {
705
+ const text = deleteUnicode(this.buildValueByConfig(dataStore, this.configTemplateCheckbox())).toLocaleLowerCase();
706
+ const textEscape = escapeHtml(text);
707
+ const keySearch = deleteUnicode(escapeHtml(this.keySearch().toLocaleLowerCase()));
708
+ if (((this.isSearchOnline() && this.config()?.httpRequestData?.()?.serviceName && !this.config()?.httpRequestData?.()?.serviceOther) ||
709
+ (text && (text.includes(keySearch) || textEscape.includes(keySearch)))) && (replace || (!replace && !this.items().find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()]))) && !itemByKeySearch.find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()])) {
710
+ dataStore.update(currentStore => {
711
+ return {
712
+ ...currentStore,
713
+ classLabelInclude: this.configTemplateCheckbox()?.getClassItem?.(dataStore()),
714
+ avatarConfig: this.configTemplateCheckbox()?.getAvatarConfig?.(dataStore())
715
+ };
716
+ });
717
+ if (itemTypeAddNew) {
718
+ itemsAddNew.unshift(dataStore);
719
+ return;
720
+ }
721
+ itemByKeySearch.push(dataStore);
722
+ }
723
+ return;
724
+ }
725
+ const indexItemRemove = this.items().findIndex(item => item()[this.fieldKey()] === key);
726
+ if (indexItemRemove > -1) {
727
+ this.items.update(items => {
728
+ items.splice(indexItemRemove, 1);
729
+ return items;
730
+ });
731
+ }
732
+ });
733
+ const checkLoadItem = (preStateHasScroll, currentHasScroll) => {
734
+ if (this.keysHiddenItem()?.length && preStateHasScroll && !currentHasScroll && (this.isSearchOnline())) {
735
+ this.callApiByService(false);
736
+ }
737
+ };
738
+ if (replace) {
739
+ this.items.set(itemByKeySearch);
740
+ this.config()?.sort?.(this.items());
741
+ this.autoSelectFirstItem(this.items());
742
+ this.setHeightViewPort();
743
+ this.checkViewPortScroll(checkLoadItem);
744
+ this.loading.set(false);
745
+ this.outLoading.emit(this.loading());
746
+ this.outLoadItemsComplete.emit({ items: this.items() });
747
+ return;
748
+ }
749
+ this.items.update(items => [...itemsAddNew, ...(items || []), ...itemByKeySearch]);
750
+ this.config()?.sort?.(this.items());
751
+ this.setHeightViewPort();
752
+ this.checkViewPortScroll(checkLoadItem);
753
+ this.loading.set(false);
754
+ this.outLoading.emit(this.loading());
755
+ this.outLoadItemsComplete.emit({ items: this.items() });
756
+ }
757
+ autoSelectFirstItem(items) {
758
+ if (this.autoSelectedFirstItemCallOutsideBefore() || this.multiKeySelected()?.length || !this.config()?.autoSelectFirstItem || !items || !items.length) {
759
+ return;
760
+ }
761
+ this.handlerChange('checkbox', items[0](), true, false);
762
+ }
763
+ getLengthItem() {
764
+ return this.items().length;
765
+ }
766
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
767
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListCheckboxComponent, isStandalone: true, selector: "libs_ui-components-list-templates_checkbox", usesInheritance: true, ngImport: i0, template: "@if (configTemplateCheckbox(); as configTemplateCheckbox) {\n <div class=\"flex flex-col w-full h-full\">\n @if (items().length && configTemplateCheckbox.configButtonSelectAndUndSelectItem?.(); as configButtonSelectItem) {\n <div [class]=\"'flex items-center bg-[#ffffff] '+(configButtonSelectItem.classInclude ?? 'libs-ui-border-bottom-general')\">\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonCheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonCheckAll?.label ?? 'i18n_select_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonCheckAll?.classInclude || 'pr-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonCheckAll?.classLabel || 'libs-ui-font-h6r'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerSelect(true)\" />\n <div class=\"text-[#e6e7ea]\">|</div>\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonUncheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonUncheckAll?.label ?? 'i18n_unselect_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonUncheckAll?.classInclude || 'pl-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonUncheckAll?.classLabel || 'libs-ui-font-h6r'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerSelect(false)\" />\n </div>\n }\n @if (items().length && configTemplateCheckbox.configCheckboxCheckAll?.(); as configCheckBox) {\n <div [class]=\"'flex libs-ui-border-bottom-general bg-[#ffffff] pl-[12px] '+(configTemplateCheckbox.classIncludeHasConfigCheckBoxAll ?? 'py-[6px] libs-ui-border-bottom-general')\">\n <libs_ui-components-checkbox-single [label]=\"configCheckBox.label ?? 'i18n_all'\"\n [classLabelInclude]=\"configCheckBox.classLabelInclude || ''\"\n [checked]=\"(multiKeySelected()?.length && (multiKeySelected()?.length ||0) >= (store().length || -1)) || false\"\n [disable]=\"loading() || disable() || false\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerSelect($event.checked)\" />\n </div>\n }\n <div #elementScroll\n [class]=\"'relative h-full w-full ' +((!items() || !items().length) ? 'bg-[#ffffff]': configTemplateCheckbox.classListInclude || '')\">\n @if (items() && items().length) {\n <div LibsUiComponentsScrollOverlayDirective\n class=\"w-full\"\n [style.height]=\"heightViewPort() && !config()?.ignoreShowDataWhenNotSearch ? heightViewPort()+'px':'100%'\"\n (outScrollBottom)=\"handlerScrollBottom()\">\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n @for (item of scroll.viewPortItems; track item()[fieldKey()]; let last = $last) {\n <div [class]=\"last ? (configTemplateCheckbox.classIncludeLastViewItem || '') : ''\">\n <div #itemRef\n LibsUiComponentsListHighlightKeySearchDirective\n [isHighlight]=\"config()?.highlightTextSearchInResult\"\n [keySearch]=\"keySearch()\"\n [attr.clickExactly]=\"clickExactly\"\n [class]=\"'libs-ui-list-template-checkbox-item flex ' + (configTemplateCheckbox.classItemInclude || '')\"\n [class.w-full]=\"!configTemplateCheckbox.ignoreItemWidth100\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly()\"\n [class.libs-ui-bg-list-hover-active]=\"!clickExactly()\"\n [class.!pl-[12px]]=\"paddingLeftItem()\"\n [class.!py-[6px]]=\"clickExactly()\"\n [class.!pr-[4px]]=\"hasScroll() && configTemplateCheckbox.rows\"\n [class.!pr-[12px]]=\"!hasScroll() && configTemplateCheckbox.rows\"\n (click)=\"handlerChange($event,item())\">\n <div class=\"flex flex-col w-full\">\n @if (item().fieldLabel) {\n <libs_ui-components-checkbox-single [label]=\"item().fieldLabel\"\n [avatarConfig]=\"item().avatarConfig\"\n [linkImage]=\"configTemplateCheckbox.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateCheckbox.getImage:item()) | async) : item()[configTemplateCheckbox.fieldGetImage || '']\"\n [linkImageError]=\"configTemplateCheckbox.getImageError ? (('avatar_error' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateCheckbox.getImageError:item()) | async) : item()[configTemplateCheckbox.fieldGetLinkImageError || '']\"\n [classLabelInclude]=\"item().classLabelInclude || configTemplateCheckbox.classLabelInclude || ''\"\n [zIndexLabel]=\"configTemplateCheckbox.zIndexPopover ?? 1200\"\n [checked]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length\"\n [key]=\"item()[fieldKey()]\"\n [imgTypeIcon]=\"configTemplateCheckbox.hasAvatarGroupSocial\"\n [classInclude]=\"configTemplateCheckbox.classInclude || ''\"\n [classImageInclude]=\"configTemplateCheckbox.classIncludeImage || ''\"\n [bullet]=\"item().bullet?.()\"\n [disable]=\"loading() || disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [popover]=\"item().dataPopover\"\n [clickExactly]=\"clickExactly()\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChange('checkbox',item())\" />\n }\n @if (configTemplateCheckbox?.rows) {\n <libs_ui-components-list-templates_rows class=\"{{ !configTemplateCheckbox.ignoreItemWidth100 ? 'w-full' : '' }} {{ configTemplateCheckbox.classRowsWrapper || configTemplateCheckbox.classRows ?? '' }}\"\n [item]=\"item()\"\n [zIndex]=\"zIndex()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length) ? item()[fieldKey()] : undefined\"\n [configTemplate]=\"configTemplateCheckbox\"\n (outEvent)=\"handlerChange('checkbox',$event.item)\" />\n }\n </div>\n </div>\n </div>\n }\n </virtual-scroller>\n </div>\n }\n @if ((!items() || !items().length) && (!config()?.ignoreShowDataWhenNotSearch || keySearch())) {\n <div [class]=\"'libs-ui-font-h5r text-[#9ca2ad] '+ (config()?.textNoDataClassInclude ?? 'py-[4px] px-[12px]')\">\n @if (config()?.hasIconNoData && !loading()) {\n <div class=\"mb-[16px]\">\n <div *ngComponentOutlet=\"(keySearch() ? 'no-result' : 'no-data') | LibsUiIconsGetIconComponentPipe | async\"></div>\n </div>\n }\n @if (!keySearch() && !loading()) {\n <span>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</span>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <span>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (loading()) {\n <span>&nbsp;</span>\n }\n\n </div>\n }\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n </div>\n}\n", styles: [".libs-ui-list-template-checkbox-item{padding:6px 0 6px 16px;margin-right:8px;font-size:12px;line-height:18px;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: VirtualScrollerModule }, { kind: "component", type: i1$1.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "enableUnequalChildrenSizes", "RTL", "useMarginInsteadOfTranslate", "modifyOverflowStyleOfParentScroll", "stripedTable", "scrollbarWidth", "scrollbarHeight", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight", "ssrViewportWidth", "ssrViewportHeight", "bufferAmount", "scrollAnimationTime", "resizeBypassRefreshThreshold", "scrollThrottlingTime", "scrollDebounceTime", "checkResizeInterval", "items", "compareItems", "horizontal", "parentScroll"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsCheckboxSingleComponent, selector: "libs_ui-components-checkbox-single", inputs: ["key", "checked", "label", "classLabelInclude", "ignoreShowPopoverLabel", "typeLabelPopover", "popover", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "classInclude", "clickExactly", "disable", "disableLabel", "ignoreCheckbox", "zIndexLabel", "stillOtherOptions", "error", "showBorderError", "description", "iconImageClass", "classIconInclude", "modeBorder"], outputs: ["checkedChange", "linkImageChange", "outChange", "outEventPopover", "outClickLabel", "outChangStageFlagMousePopover"] }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "pipe", type: LibsUiIconsGetIconComponentPipe, name: "LibsUiIconsGetIconComponentPipe" }, { kind: "directive", type: LibsUiComponentsListHighlightKeySearchDirective, selector: "[LibsUiComponentsListHighlightKeySearchDirective]", inputs: ["isHighlight", "keySearch", "classHighlight"] }, { kind: "component", type: LibsUiComponentsListRowsComponent, selector: "libs_ui-components-list-templates_rows", inputs: ["configTemplate", "item", "keySelected", "fieldKey", "zIndex"], outputs: ["outChangStageFlagMousePopover", "outEvent"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
768
+ }
769
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListCheckboxComponent, decorators: [{
770
+ type: Component,
771
+ args: [{ selector: 'libs_ui-components-list-templates_checkbox', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
772
+ VirtualScrollerModule, NgComponentOutlet, AsyncPipe, TranslateModule, NgTemplateOutlet,
773
+ LibsUiComponentsButtonsButtonComponent,
774
+ LibsUiComponentsCheckboxSingleComponent,
775
+ LibsUiComponentsSpinnerComponent,
776
+ LibsUiComponentsScrollOverlayDirective,
777
+ LibsUiCheckSelectedByKeyPipe,
778
+ LibsUiIconsGetIconComponentPipe,
779
+ LibsUiComponentsListHighlightKeySearchDirective,
780
+ LibsUiComponentsListRowsComponent,
781
+ LibsUiPipesCallFunctionInTemplatePipe
782
+ ], template: "@if (configTemplateCheckbox(); as configTemplateCheckbox) {\n <div class=\"flex flex-col w-full h-full\">\n @if (items().length && configTemplateCheckbox.configButtonSelectAndUndSelectItem?.(); as configButtonSelectItem) {\n <div [class]=\"'flex items-center bg-[#ffffff] '+(configButtonSelectItem.classInclude ?? 'libs-ui-border-bottom-general')\">\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonCheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonCheckAll?.label ?? 'i18n_select_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonCheckAll?.classInclude || 'pr-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonCheckAll?.classLabel || 'libs-ui-font-h6r'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerSelect(true)\" />\n <div class=\"text-[#e6e7ea]\">|</div>\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonUncheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonUncheckAll?.label ?? 'i18n_unselect_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonUncheckAll?.classInclude || 'pl-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonUncheckAll?.classLabel || 'libs-ui-font-h6r'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerSelect(false)\" />\n </div>\n }\n @if (items().length && configTemplateCheckbox.configCheckboxCheckAll?.(); as configCheckBox) {\n <div [class]=\"'flex libs-ui-border-bottom-general bg-[#ffffff] pl-[12px] '+(configTemplateCheckbox.classIncludeHasConfigCheckBoxAll ?? 'py-[6px] libs-ui-border-bottom-general')\">\n <libs_ui-components-checkbox-single [label]=\"configCheckBox.label ?? 'i18n_all'\"\n [classLabelInclude]=\"configCheckBox.classLabelInclude || ''\"\n [checked]=\"(multiKeySelected()?.length && (multiKeySelected()?.length ||0) >= (store().length || -1)) || false\"\n [disable]=\"loading() || disable() || false\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerSelect($event.checked)\" />\n </div>\n }\n <div #elementScroll\n [class]=\"'relative h-full w-full ' +((!items() || !items().length) ? 'bg-[#ffffff]': configTemplateCheckbox.classListInclude || '')\">\n @if (items() && items().length) {\n <div LibsUiComponentsScrollOverlayDirective\n class=\"w-full\"\n [style.height]=\"heightViewPort() && !config()?.ignoreShowDataWhenNotSearch ? heightViewPort()+'px':'100%'\"\n (outScrollBottom)=\"handlerScrollBottom()\">\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n @for (item of scroll.viewPortItems; track item()[fieldKey()]; let last = $last) {\n <div [class]=\"last ? (configTemplateCheckbox.classIncludeLastViewItem || '') : ''\">\n <div #itemRef\n LibsUiComponentsListHighlightKeySearchDirective\n [isHighlight]=\"config()?.highlightTextSearchInResult\"\n [keySearch]=\"keySearch()\"\n [attr.clickExactly]=\"clickExactly\"\n [class]=\"'libs-ui-list-template-checkbox-item flex ' + (configTemplateCheckbox.classItemInclude || '')\"\n [class.w-full]=\"!configTemplateCheckbox.ignoreItemWidth100\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly()\"\n [class.libs-ui-bg-list-hover-active]=\"!clickExactly()\"\n [class.!pl-[12px]]=\"paddingLeftItem()\"\n [class.!py-[6px]]=\"clickExactly()\"\n [class.!pr-[4px]]=\"hasScroll() && configTemplateCheckbox.rows\"\n [class.!pr-[12px]]=\"!hasScroll() && configTemplateCheckbox.rows\"\n (click)=\"handlerChange($event,item())\">\n <div class=\"flex flex-col w-full\">\n @if (item().fieldLabel) {\n <libs_ui-components-checkbox-single [label]=\"item().fieldLabel\"\n [avatarConfig]=\"item().avatarConfig\"\n [linkImage]=\"configTemplateCheckbox.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateCheckbox.getImage:item()) | async) : item()[configTemplateCheckbox.fieldGetImage || '']\"\n [linkImageError]=\"configTemplateCheckbox.getImageError ? (('avatar_error' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateCheckbox.getImageError:item()) | async) : item()[configTemplateCheckbox.fieldGetLinkImageError || '']\"\n [classLabelInclude]=\"item().classLabelInclude || configTemplateCheckbox.classLabelInclude || ''\"\n [zIndexLabel]=\"configTemplateCheckbox.zIndexPopover ?? 1200\"\n [checked]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length\"\n [key]=\"item()[fieldKey()]\"\n [imgTypeIcon]=\"configTemplateCheckbox.hasAvatarGroupSocial\"\n [classInclude]=\"configTemplateCheckbox.classInclude || ''\"\n [classImageInclude]=\"configTemplateCheckbox.classIncludeImage || ''\"\n [bullet]=\"item().bullet?.()\"\n [disable]=\"loading() || disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [popover]=\"item().dataPopover\"\n [clickExactly]=\"clickExactly()\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChange('checkbox',item())\" />\n }\n @if (configTemplateCheckbox?.rows) {\n <libs_ui-components-list-templates_rows class=\"{{ !configTemplateCheckbox.ignoreItemWidth100 ? 'w-full' : '' }} {{ configTemplateCheckbox.classRowsWrapper || configTemplateCheckbox.classRows ?? '' }}\"\n [item]=\"item()\"\n [zIndex]=\"zIndex()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length) ? item()[fieldKey()] : undefined\"\n [configTemplate]=\"configTemplateCheckbox\"\n (outEvent)=\"handlerChange('checkbox',$event.item)\" />\n }\n </div>\n </div>\n </div>\n }\n </virtual-scroller>\n </div>\n }\n @if ((!items() || !items().length) && (!config()?.ignoreShowDataWhenNotSearch || keySearch())) {\n <div [class]=\"'libs-ui-font-h5r text-[#9ca2ad] '+ (config()?.textNoDataClassInclude ?? 'py-[4px] px-[12px]')\">\n @if (config()?.hasIconNoData && !loading()) {\n <div class=\"mb-[16px]\">\n <div *ngComponentOutlet=\"(keySearch() ? 'no-result' : 'no-data') | LibsUiIconsGetIconComponentPipe | async\"></div>\n </div>\n }\n @if (!keySearch() && !loading()) {\n <span>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</span>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <span>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (loading()) {\n <span>&nbsp;</span>\n }\n\n </div>\n }\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n </div>\n}\n", styles: [".libs-ui-list-template-checkbox-item{padding:6px 0 6px 16px;margin-right:8px;font-size:12px;line-height:18px;position:relative}\n"] }]
783
+ }] });
784
+
785
+ class LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe {
786
+ transform(level, maxLevel, isTreeView, isTreeViewJson, hasIcon) {
787
+ if (isTreeViewJson) {
788
+ if (level < 2) {
789
+ return 16;
790
+ }
791
+ return ((level - 2) * 24) + 16;
792
+ }
793
+ if (isTreeView) {
794
+ let leftLine = level * 16;
795
+ if (hasIcon) {
796
+ leftLine += (level - 1) * 8;
797
+ }
798
+ return leftLine;
799
+ }
800
+ if (level > 1 && maxLevel > 2) {
801
+ level -= 1;
802
+ let leftLine = level * 12;
803
+ if (hasIcon) {
804
+ leftLine += level * 8;
805
+ }
806
+ return leftLine;
807
+ }
808
+ return 0;
809
+ }
810
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
811
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe, isStandalone: true, name: "LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe" });
812
+ }
813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe, decorators: [{
814
+ type: Pipe,
815
+ args: [{
816
+ name: 'LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe',
817
+ standalone: true
818
+ }]
819
+ }] });
820
+
821
+ class LibsUiComponentsListGroupCalculatorMarginLeftItemPipe {
822
+ transform(level, maxLevel, isTreeView, isViewTreeJson, hasIcon, isViewLabelEmpty) {
823
+ if (!level) {
824
+ return 16;
825
+ }
826
+ if (isViewTreeJson) {
827
+ if (level === 1) {
828
+ return 0;
829
+ }
830
+ return ((level - 2) * 24);
831
+ }
832
+ if (!isTreeView) {
833
+ if (maxLevel > 2 && level > 2) {
834
+ let marginLeft = (level - 1) * 12;
835
+ if (hasIcon) {
836
+ marginLeft += (level - 1) * 6;
837
+ }
838
+ return marginLeft;
839
+ }
840
+ return 0;
841
+ }
842
+ let marginLeft = 24 * level + (isViewLabelEmpty ? 8 : -16);
843
+ if (maxLevel === level && !isViewLabelEmpty) {
844
+ marginLeft -= 8;
845
+ }
846
+ return marginLeft;
847
+ }
848
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorMarginLeftItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
849
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorMarginLeftItemPipe, isStandalone: true, name: "LibsUiComponentsListGroupCalculatorMarginLeftItemPipe" });
850
+ }
851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorMarginLeftItemPipe, decorators: [{
852
+ type: Pipe,
853
+ args: [{
854
+ name: 'LibsUiComponentsListGroupCalculatorMarginLeftItemPipe',
855
+ standalone: true
856
+ }]
857
+ }] });
858
+
859
+ class LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe {
860
+ transform(level, maxLevel, isTreeView, isTreeViewJson, hasChild) {
861
+ if (isTreeViewJson) {
862
+ if (level === 1 || !hasChild) {
863
+ return 16;
864
+ }
865
+ return 8;
866
+ }
867
+ if (isTreeView || level > 2) {
868
+ return 0;
869
+ }
870
+ return (level - 1) * 16;
871
+ }
872
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
873
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe, isStandalone: true, name: "LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe" });
874
+ }
875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe, decorators: [{
876
+ type: Pipe,
877
+ args: [{
878
+ name: 'LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe',
879
+ standalone: true
880
+ }]
881
+ }] });
882
+
883
+ /* eslint-disable @typescript-eslint/no-explicit-any */
884
+ /* eslint-disable @angular-eslint/component-selector */
885
+ class LibsUiComponentsListGroupItemComponent {
886
+ /* INPUT */
887
+ items = input([]);
888
+ configTemplateGroup = input();
889
+ keySearch = input();
890
+ fieldKey = input('id');
891
+ keysChecked = input([]);
892
+ keysDisableItem = input();
893
+ parentItem = input();
894
+ disable = input(undefined);
895
+ disableLabel = input(undefined);
896
+ config = input();
897
+ keysStillOtherOptions = input([]);
898
+ /* OUTPUT */
899
+ outChangeView = output();
900
+ outChange = output();
901
+ outChangStageFlagMousePopover = output();
902
+ /* FUNCTIONS */
903
+ handlerToggleExpand(e, item) {
904
+ e.stopPropagation();
905
+ item.update(current => {
906
+ current.expand = !current.expand;
907
+ return current;
908
+ });
909
+ this.outChangeView.emit(item().expand);
910
+ }
911
+ handlerChangeView(expand) {
912
+ this.outChangeView.emit(expand);
913
+ }
914
+ handlerChangeChecked(item, field_key, disable) {
915
+ if (disable || field_key && this.keysDisableItem() && this.keysDisableItem()?.length && this.keysDisableItem()?.some(key => key === field_key)) {
916
+ return;
917
+ }
918
+ if (item.level !== item.maxLevelGroup && this.configTemplateGroup()?.ignoreCheckboxItem) {
919
+ return;
920
+ }
921
+ this.outChange.emit({ item });
922
+ }
923
+ handlerEventPopover(event, item) {
924
+ if (!item || !item.dataPopover || !this.configTemplateGroup() || !this.configTemplateGroup()?.actionPopoverByItem) {
925
+ return;
926
+ }
927
+ this.configTemplateGroup()?.actionPopoverByItem?.(item, event);
928
+ }
929
+ handlerChangStageFlagMouse(flag) {
930
+ this.outChangStageFlagMousePopover.emit(flag);
931
+ }
932
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
933
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListGroupItemComponent, isStandalone: true, selector: "libs_ui-components-list-templates_group-item", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, configTemplateGroup: { classPropertyName: "configTemplateGroup", publicName: "configTemplateGroup", isSignal: true, isRequired: false, transformFunction: null }, keySearch: { classPropertyName: "keySearch", publicName: "keySearch", isSignal: true, isRequired: false, transformFunction: null }, fieldKey: { classPropertyName: "fieldKey", publicName: "fieldKey", isSignal: true, isRequired: false, transformFunction: null }, keysChecked: { classPropertyName: "keysChecked", publicName: "keysChecked", isSignal: true, isRequired: false, transformFunction: null }, keysDisableItem: { classPropertyName: "keysDisableItem", publicName: "keysDisableItem", isSignal: true, isRequired: false, transformFunction: null }, parentItem: { classPropertyName: "parentItem", publicName: "parentItem", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, disableLabel: { classPropertyName: "disableLabel", publicName: "disableLabel", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, keysStillOtherOptions: { classPropertyName: "keysStillOtherOptions", publicName: "keysStillOtherOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outChangeView: "outChangeView", outChange: "outChange", outChangStageFlagMousePopover: "outChangStageFlagMousePopover" }, ngImport: i0, template: "@if (configTemplateGroup(); as configTemplateGroup) {\n @if ((configTemplateGroup.isViewTree && !!items().length) || (parentItem().maxLevelGroup > 2 && parentItem().level > 1)) {\n <div class='libs-ui-list-group-item-line-vertical'\n [style.left.px]=\"parentItem().level | LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe:parentItem().maxLevelGroup:configTemplateGroup.isViewTree :configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem)\">\n </div>\n }\n @if (items() && items().length) {\n @for (item of items(); track item()[fieldKey()]) {\n <div>\n <div\n [style.marginLeft.px]=\"item().level | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:item().maxLevelGroup:configTemplateGroup.isViewTree: configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem)\"\n [style.paddingLeft.px]=\"item().level | LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe:item().maxLevelGroup:configTemplateGroup.isViewTree:configTemplateGroup.isViewTreeJson:!!item()[configTemplateGroup.fieldGetItems]?.()?.length\"\n [class]=\"'libs-ui-bg-list-hover py-[6px] pr-[16px] flex items-center relative libs-ui-bg-list-hover-active ' + item()?.classInclude\"\n [class.libs-ui-bg-list-active]=\"configTemplateGroup.singleSelectItem && item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [class.libs-ui-disable]=\"configTemplateGroup.allowDisableLabel && (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [class.pointer-events-none]=\"configTemplateGroup.allowDisableLabel && (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [class.cursor-pointer]=\"!disable() && !(configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup) && !(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [class.libs-ui-bg-list-active]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.hasBackgroundColorWhenItemSelected && item().isCheckManual\"\n (click)=\"handlerChangeChecked(item(), item()[fieldKey()], disable() || (configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup))\">\n @if (item().level < item().maxLevelGroup && configTemplateGroup.isViewTree) {\n <i class=\"libs-ui-icon-chevron-right\"\n [class.rotate-90]=\"item().expand\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n @if (item().level < item().maxLevelGroup && configTemplateGroup.isViewTreeJson && !!item()[configTemplateGroup.fieldGetItems]()?.length) {\n <div [class]=\"'p-[5px]'\">\n <div [class]=\"'libs-ui-list-group-json_icon-item-parent'\"\n [attr.disabled]=\"disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) || false\">\n </div>\n </div>\n }\n @if (!configTemplateGroup.isViewRadio) {\n <libs_ui-components-checkbox-single [avatarConfig]=\"item().avatarConfig\"\n [class.ml-[8px]]=\"configTemplateGroup.isViewTree || (configTemplateGroup.isViewTreeJson && !!item()[configTemplateGroup.fieldGetItems]?.()?.length)\"\n [ignoreCheckbox]=\"configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.-w-auto]=\"configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem\"\n [class.max-w-[calc(100%-12px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || configTemplateGroup.widthLabelSub24WhenNotTreeView) && configTemplateGroup.ignoreIconExpandMarginRight\"\n [class.max-w-[calc(100%-24px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || (configTemplateGroup.widthLabelSub24WhenNotTreeView && (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && (configTemplateGroup.hasIconCheckSingleSelectItem || item().isCheckedByDefaultKey))) && !configTemplateGroup.ignoreIconExpandMarginRight\"\n [clickExactly]=\"false\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? 1\"\n [disable]=\"disable() || (configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup && !configTemplateGroup.isViewTreeJson) || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) || false\"\n [label]=\"item().fieldLabel\"\n [checked]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [stillOtherOptions]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysStillOtherOptions():keysStillOtherOptions().length\"\n [classLabelInclude]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && configTemplateGroup.colorBlueWhenItemSelected && item().isCheckManual ? 'libs-ui-color-default libs-ui-font-h5r' : 'libs-ui-font-h5r'\"\n [popover]=\"item().dataPopover\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateGroup.getImage:item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n [linkImageError]=\"configTemplateGroup.getLinkImageError ? (('avatar_error' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateGroup.getLinkImageError:item()) | async) : ''\"\n [imgTypeIcon]=\"configTemplateGroup.imgTypeIcon\"\n [iconImageClass]=\"item().iconImageClass ? item().iconImageClass : undefined\"\n [classImageInclude]=\"configTemplateGroup.classImageInclude || ''\"\n (outChangStageFlagMousePopover)=\"handlerChangStageFlagMouse($event)\"\n (outEventPopover)=\"handlerEventPopover($event, item())\"\n (outChange)=\"handlerChangeChecked(item())\" />\n }\n @if (configTemplateGroup.isViewRadio) {\n <libs_ui-components-radio-single [avatarConfig]=\"item().avatarConfig\"\n [class.!ml-[8px]]=\"configTemplateGroup.isViewTree\"\n [ignoreRadio]=\"configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.w-auto]=\"configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem\"\n [class.max-w-[calc(100%-12px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || configTemplateGroup.widthLabelSub24WhenNotTreeView) && configTemplateGroup.ignoreIconExpandMarginRight\"\n [class.max-w-[calc(100%-24px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || configTemplateGroup.widthLabelSub24WhenNotTreeView) && !configTemplateGroup.ignoreIconExpandMarginRight\"\n [clickExactly]=\"false\"\n [disable]=\"disable() || (configTemplateGroup.disableItemNotLastLevel && !!item()[configTemplateGroup.fieldGetItems]?.()?.length)||(configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup) || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) || false\"\n [label]=\"item().fieldLabel\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? 1\"\n [active]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [classLabelInclude]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && configTemplateGroup.colorBlueWhenItemSelected && item().isCheckManual ? 'text-[#009cdb] libs-ui-font-h5r ': ' libs-ui-font-h5r '\"\n [popover]=\"item().dataPopover\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateGroup.getLinkImageError ? configTemplateGroup.getLinkImageError : configTemplateGroup.getImage):item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChangeChecked(item())\" />\n }\n @if ((item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && (configTemplateGroup.hasIconCheckSingleSelectItem || item().isCheckedByDefaultKey)) {\n <i class=\"libs-ui-icon-check\"\n [class.!ml-[8px]]=\"item().dataPopover\"\n [class.libs-ui-icon-check]=\"configTemplateGroup.colorBlueWhenItemSelected && item().isCheckManual\">\n </i>\n }\n @if (!!item()[configTemplateGroup.fieldGetItems]?.()?.length && !configTemplateGroup.isViewTree && !configTemplateGroup.isViewTreeJson) {\n <i class=\"libs-ui-icon-chevron-right\"\n [class.rotate-90]=\"item().expand\"\n [class.!ml-[8px]]=\"item().dataPopover\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n </div>\n @if (item().expand || configTemplateGroup.isViewTreeJson) {\n @if (item().level < item().maxLevelGroup && !item()[configTemplateGroup.fieldGetItems]?.()?.length && configTemplateGroup.isViewTree) {\n <div class=\"libs-ui-font-h5r text-[#9ca2ad] relative\"\n [style.marginLeft.px]=\"(item().level + 1) | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:(item().maxLevelGroup+1):configTemplateGroup.isViewTree: configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem):true\"\n [class.!py-[8px]]=\"configTemplateGroup.fieldGetAvatarItem\"\n [class.!py-[4px]]=\"!configTemplateGroup.fieldGetAvatarItem\">\n <div [class]=\"item().classIncludeItemNoData || ''\">\n @if (!keySearch()) {\n <span>{{ 'i18n_no_data_yet' | translate }}</span>\n }\n @if (keySearch()) {\n <span>{{ 'i18n_no_result' | translate }}</span>\n }\n </div>\n </div>\n }\n @if (!!item()[configTemplateGroup.fieldGetItems]?.()?.length) {\n <libs_ui-components-list-templates_group-item [keySearch]=\"keySearch()\"\n [items]=\"item()[configTemplateGroup.fieldGetItems]()\"\n [parentItem]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keysChecked]=\"keysChecked()\"\n [disable]=\"(disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)) && !configTemplateGroup.isViewTreeJson\"\n [keysDisableItem]=\"keysDisableItem()\"\n [configTemplateGroup]=\"configTemplateGroup\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChangeView)=\"handlerChangeView($event)\"\n (outChange)=\"handlerChangeChecked($event.item)\" />\n }\n }\n </div>\n }\n }\n\n @if ((!items() || !items().length) && (parentItem().level < parentItem().maxLevelGroup)) {\n <div class=\"libs-ui-font-h5r text-[#9ca2ad] relative\"\n [style.marginLeft.px]=\"(parentItem().level + 1) | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:(parentItem().maxLevelGroup+1):configTemplateGroup.isViewTree:configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem):true\"\n [style.paddingLeft.px]=\"(parentItem().level + 1) | LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe:(parentItem().maxLevelGroup+1):configTemplateGroup.isViewTree: configTemplateGroup.isViewTreeJson:false\"\n [class.py-[8px]]=\"configTemplateGroup.fieldGetAvatarItem\"\n [class.py-[4px]]=\"!configTemplateGroup.fieldGetAvatarItem\">\n <div [class]=\"parentItem().classIncludeItemNoData || ''\">\n @if (parentItem().iconEmptyDataInGroup) {\n <div class=\"pb-[16px]\">\n <ng-container *ngComponentOutlet=\"(keySearch() ? 'no-result' : 'no-data') | LibsUiIconsGetIconComponentPipe | async\" />\n </div>\n }\n @if (!keySearch()) {\n <span>{{ ( parentItem().textDescriptionGroupWhenNoData ?? config()?.textNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (keySearch()) {\n <span>{{ 'i18n_no_result' | translate }}</span>\n }\n </div>\n </div>\n }\n}\n", styles: [":host{position:relative}:host .libs-ui-list-group-item-line-vertical{position:absolute;width:1px;height:100%;background-color:#e6e7ea}.libs-ui--icon-check{--color: var(--libs-ui-color-default, #226FF5)}.libs-ui--icon-check:before{font-size:16px;color:var(--libs-ui-color-default, #226FF5)}[class*=libs-ui-icon-chevron]:before{color:#6a7383}.libs-ui-list-group-json_icon-item-parent{min-width:6px;min-height:6px;height:6px;width:6px;border-radius:50%;background-color:#226ff5}.libs-ui-list-group-json_icon-item-parent[disabled=true]{background-color:#6a7383!important}\n"], dependencies: [{ kind: "component", type: LibsUiComponentsListGroupItemComponent, selector: "libs_ui-components-list-templates_group-item", inputs: ["items", "configTemplateGroup", "keySearch", "fieldKey", "keysChecked", "keysDisableItem", "parentItem", "disable", "disableLabel", "config", "keysStillOtherOptions"], outputs: ["outChangeView", "outChange", "outChangStageFlagMousePopover"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe, name: "LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe" }, { kind: "pipe", type: LibsUiComponentsListGroupCalculatorMarginLeftItemPipe, name: "LibsUiComponentsListGroupCalculatorMarginLeftItemPipe" }, { kind: "pipe", type: LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe, name: "LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe" }, { kind: "pipe", type: LibsUiIconsGetIconComponentPipe, name: "LibsUiIconsGetIconComponentPipe" }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "component", type: LibsUiComponentsCheckboxSingleComponent, selector: "libs_ui-components-checkbox-single", inputs: ["key", "checked", "label", "classLabelInclude", "ignoreShowPopoverLabel", "typeLabelPopover", "popover", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "classInclude", "clickExactly", "disable", "disableLabel", "ignoreCheckbox", "zIndexLabel", "stillOtherOptions", "error", "showBorderError", "description", "iconImageClass", "classIconInclude", "modeBorder"], outputs: ["checkedChange", "linkImageChange", "outChange", "outEventPopover", "outClickLabel", "outChangStageFlagMousePopover"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "component", type: LibsUiComponentsRadioSingleComponent, selector: "libs_ui-components-radio-single", inputs: ["key", "active", "classInclude", "label", "labelInterpolateParams", "ignorePopoverLabel", "classLabelInclude", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "popover", "disable", "disableLabel", "clickExactly", "typeRadio", "ignoreRadio", "zIndexLabel", "classIncludeIcon"], outputs: ["activeChange", "outClickLabel", "outChange", "outChangStageFlagMousePopover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
934
+ }
935
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupItemComponent, decorators: [{
936
+ type: Component,
937
+ args: [{ selector: 'libs_ui-components-list-templates_group-item', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
938
+ NgComponentOutlet, AsyncPipe, TranslateModule,
939
+ LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe,
940
+ LibsUiComponentsListGroupCalculatorMarginLeftItemPipe,
941
+ LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe,
942
+ LibsUiIconsGetIconComponentPipe,
943
+ LibsUiCheckSelectedByKeyPipe,
944
+ LibsUiComponentsCheckboxSingleComponent,
945
+ LibsUiPipesCallFunctionInTemplatePipe,
946
+ LibsUiComponentsRadioSingleComponent
947
+ ], template: "@if (configTemplateGroup(); as configTemplateGroup) {\n @if ((configTemplateGroup.isViewTree && !!items().length) || (parentItem().maxLevelGroup > 2 && parentItem().level > 1)) {\n <div class='libs-ui-list-group-item-line-vertical'\n [style.left.px]=\"parentItem().level | LibsUiComponentsListGroupCalculatorLeftLineVerticalItemPipe:parentItem().maxLevelGroup:configTemplateGroup.isViewTree :configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem)\">\n </div>\n }\n @if (items() && items().length) {\n @for (item of items(); track item()[fieldKey()]) {\n <div>\n <div\n [style.marginLeft.px]=\"item().level | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:item().maxLevelGroup:configTemplateGroup.isViewTree: configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem)\"\n [style.paddingLeft.px]=\"item().level | LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe:item().maxLevelGroup:configTemplateGroup.isViewTree:configTemplateGroup.isViewTreeJson:!!item()[configTemplateGroup.fieldGetItems]?.()?.length\"\n [class]=\"'libs-ui-bg-list-hover py-[6px] pr-[16px] flex items-center relative libs-ui-bg-list-hover-active ' + item()?.classInclude\"\n [class.libs-ui-bg-list-active]=\"configTemplateGroup.singleSelectItem && item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [class.libs-ui-disable]=\"configTemplateGroup.allowDisableLabel && (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [class.pointer-events-none]=\"configTemplateGroup.allowDisableLabel && (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [class.cursor-pointer]=\"!disable() && !(configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup) && !(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [class.libs-ui-bg-list-active]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.hasBackgroundColorWhenItemSelected && item().isCheckManual\"\n (click)=\"handlerChangeChecked(item(), item()[fieldKey()], disable() || (configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup))\">\n @if (item().level < item().maxLevelGroup && configTemplateGroup.isViewTree) {\n <i class=\"libs-ui-icon-chevron-right\"\n [class.rotate-90]=\"item().expand\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n @if (item().level < item().maxLevelGroup && configTemplateGroup.isViewTreeJson && !!item()[configTemplateGroup.fieldGetItems]()?.length) {\n <div [class]=\"'p-[5px]'\">\n <div [class]=\"'libs-ui-list-group-json_icon-item-parent'\"\n [attr.disabled]=\"disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) || false\">\n </div>\n </div>\n }\n @if (!configTemplateGroup.isViewRadio) {\n <libs_ui-components-checkbox-single [avatarConfig]=\"item().avatarConfig\"\n [class.ml-[8px]]=\"configTemplateGroup.isViewTree || (configTemplateGroup.isViewTreeJson && !!item()[configTemplateGroup.fieldGetItems]?.()?.length)\"\n [ignoreCheckbox]=\"configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.-w-auto]=\"configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem\"\n [class.max-w-[calc(100%-12px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || configTemplateGroup.widthLabelSub24WhenNotTreeView) && configTemplateGroup.ignoreIconExpandMarginRight\"\n [class.max-w-[calc(100%-24px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || (configTemplateGroup.widthLabelSub24WhenNotTreeView && (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && (configTemplateGroup.hasIconCheckSingleSelectItem || item().isCheckedByDefaultKey))) && !configTemplateGroup.ignoreIconExpandMarginRight\"\n [clickExactly]=\"false\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? 1\"\n [disable]=\"disable() || (configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup && !configTemplateGroup.isViewTreeJson) || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) || false\"\n [label]=\"item().fieldLabel\"\n [checked]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [stillOtherOptions]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysStillOtherOptions():keysStillOtherOptions().length\"\n [classLabelInclude]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && configTemplateGroup.colorBlueWhenItemSelected && item().isCheckManual ? 'libs-ui-color-default libs-ui-font-h5r' : 'libs-ui-font-h5r'\"\n [popover]=\"item().dataPopover\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateGroup.getImage:item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n [linkImageError]=\"configTemplateGroup.getLinkImageError ? (('avatar_error' | LibsUiPipesCallFunctionInTemplatePipe:configTemplateGroup.getLinkImageError:item()) | async) : ''\"\n [imgTypeIcon]=\"configTemplateGroup.imgTypeIcon\"\n [iconImageClass]=\"item().iconImageClass ? item().iconImageClass : undefined\"\n [classImageInclude]=\"configTemplateGroup.classImageInclude || ''\"\n (outChangStageFlagMousePopover)=\"handlerChangStageFlagMouse($event)\"\n (outEventPopover)=\"handlerEventPopover($event, item())\"\n (outChange)=\"handlerChangeChecked(item())\" />\n }\n @if (configTemplateGroup.isViewRadio) {\n <libs_ui-components-radio-single [avatarConfig]=\"item().avatarConfig\"\n [class.!ml-[8px]]=\"configTemplateGroup.isViewTree\"\n [ignoreRadio]=\"configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.w-auto]=\"configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem\"\n [class.max-w-[calc(100%-12px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || configTemplateGroup.widthLabelSub24WhenNotTreeView) && configTemplateGroup.ignoreIconExpandMarginRight\"\n [class.max-w-[calc(100%-24px)]]=\"((configTemplateGroup.isViewTree && !configTemplateGroup.hasIconCheckSingleSelectItem) || configTemplateGroup.widthLabelSub24WhenNotTreeView) && !configTemplateGroup.ignoreIconExpandMarginRight\"\n [clickExactly]=\"false\"\n [disable]=\"disable() || (configTemplateGroup.disableItemNotLastLevel && !!item()[configTemplateGroup.fieldGetItems]?.()?.length)||(configTemplateGroup.singleSelectItem && item().level < item().maxLevelGroup) || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) || false\"\n [label]=\"item().fieldLabel\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? 1\"\n [active]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [classLabelInclude]=\"(item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && configTemplateGroup.colorBlueWhenItemSelected && item().isCheckManual ? 'text-[#009cdb] libs-ui-font-h5r ': ' libs-ui-font-h5r '\"\n [popover]=\"item().dataPopover\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateGroup.getLinkImageError ? configTemplateGroup.getLinkImageError : configTemplateGroup.getImage):item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChangeChecked(item())\" />\n }\n @if ((item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length) && configTemplateGroup.singleSelectItem && (configTemplateGroup.hasIconCheckSingleSelectItem || item().isCheckedByDefaultKey)) {\n <i class=\"libs-ui-icon-check\"\n [class.!ml-[8px]]=\"item().dataPopover\"\n [class.libs-ui-icon-check]=\"configTemplateGroup.colorBlueWhenItemSelected && item().isCheckManual\">\n </i>\n }\n @if (!!item()[configTemplateGroup.fieldGetItems]?.()?.length && !configTemplateGroup.isViewTree && !configTemplateGroup.isViewTreeJson) {\n <i class=\"libs-ui-icon-chevron-right\"\n [class.rotate-90]=\"item().expand\"\n [class.!ml-[8px]]=\"item().dataPopover\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n </div>\n @if (item().expand || configTemplateGroup.isViewTreeJson) {\n @if (item().level < item().maxLevelGroup && !item()[configTemplateGroup.fieldGetItems]?.()?.length && configTemplateGroup.isViewTree) {\n <div class=\"libs-ui-font-h5r text-[#9ca2ad] relative\"\n [style.marginLeft.px]=\"(item().level + 1) | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:(item().maxLevelGroup+1):configTemplateGroup.isViewTree: configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem):true\"\n [class.!py-[8px]]=\"configTemplateGroup.fieldGetAvatarItem\"\n [class.!py-[4px]]=\"!configTemplateGroup.fieldGetAvatarItem\">\n <div [class]=\"item().classIncludeItemNoData || ''\">\n @if (!keySearch()) {\n <span>{{ 'i18n_no_data_yet' | translate }}</span>\n }\n @if (keySearch()) {\n <span>{{ 'i18n_no_result' | translate }}</span>\n }\n </div>\n </div>\n }\n @if (!!item()[configTemplateGroup.fieldGetItems]?.()?.length) {\n <libs_ui-components-list-templates_group-item [keySearch]=\"keySearch()\"\n [items]=\"item()[configTemplateGroup.fieldGetItems]()\"\n [parentItem]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keysChecked]=\"keysChecked()\"\n [disable]=\"(disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)) && !configTemplateGroup.isViewTreeJson\"\n [keysDisableItem]=\"keysDisableItem()\"\n [configTemplateGroup]=\"configTemplateGroup\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChangeView)=\"handlerChangeView($event)\"\n (outChange)=\"handlerChangeChecked($event.item)\" />\n }\n }\n </div>\n }\n }\n\n @if ((!items() || !items().length) && (parentItem().level < parentItem().maxLevelGroup)) {\n <div class=\"libs-ui-font-h5r text-[#9ca2ad] relative\"\n [style.marginLeft.px]=\"(parentItem().level + 1) | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:(parentItem().maxLevelGroup+1):configTemplateGroup.isViewTree:configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem):true\"\n [style.paddingLeft.px]=\"(parentItem().level + 1) | LibsUiComponentsListGroupCalculatorPaddingLeftItemPipe:(parentItem().maxLevelGroup+1):configTemplateGroup.isViewTree: configTemplateGroup.isViewTreeJson:false\"\n [class.py-[8px]]=\"configTemplateGroup.fieldGetAvatarItem\"\n [class.py-[4px]]=\"!configTemplateGroup.fieldGetAvatarItem\">\n <div [class]=\"parentItem().classIncludeItemNoData || ''\">\n @if (parentItem().iconEmptyDataInGroup) {\n <div class=\"pb-[16px]\">\n <ng-container *ngComponentOutlet=\"(keySearch() ? 'no-result' : 'no-data') | LibsUiIconsGetIconComponentPipe | async\" />\n </div>\n }\n @if (!keySearch()) {\n <span>{{ ( parentItem().textDescriptionGroupWhenNoData ?? config()?.textNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (keySearch()) {\n <span>{{ 'i18n_no_result' | translate }}</span>\n }\n </div>\n </div>\n }\n}\n", styles: [":host{position:relative}:host .libs-ui-list-group-item-line-vertical{position:absolute;width:1px;height:100%;background-color:#e6e7ea}.libs-ui--icon-check{--color: var(--libs-ui-color-default, #226FF5)}.libs-ui--icon-check:before{font-size:16px;color:var(--libs-ui-color-default, #226FF5)}[class*=libs-ui-icon-chevron]:before{color:#6a7383}.libs-ui-list-group-json_icon-item-parent{min-width:6px;min-height:6px;height:6px;width:6px;border-radius:50%;background-color:#226ff5}.libs-ui-list-group-json_icon-item-parent[disabled=true]{background-color:#6a7383!important}\n"] }]
948
+ }] });
949
+
950
+ /* eslint-disable @typescript-eslint/no-explicit-any */
951
+ class LibsUiComponentsListGroupComponent extends LibsUiComponentsListTemplatesComponentAbstract {
952
+ /* PROPERTY */
953
+ configTemplateGroup = signal(undefined);
954
+ level = signal(1);
955
+ keysChecked = signal([]);
956
+ keysStillOtherOptions = signal([]);
957
+ totalItem = signal(0);
958
+ totalItemChecked = signal(0);
959
+ calculatorHeighItemSuccess = signal(false);
960
+ keyFetch = signal('');
961
+ PATTERN_FAKE_ID = 'fake-id-';
962
+ mappingItemsChecked = signal(new Map());
963
+ selectFirstItem = signal(false);
964
+ firstItemSelected = signal(undefined);
965
+ ngOnInit() {
966
+ if (!this.config()?.configTemplateGroup?.()) {
967
+ return;
968
+ }
969
+ super.ngOnInit();
970
+ this.configTemplateGroup.set(this.config()?.configTemplateGroup?.());
971
+ this.timeIntervalIntervalSetHeightViewPort.set(this.configTemplateGroup()?.timeIntervalCalculatorHeight ?? 0);
972
+ this.fieldKey.set(this.configTemplateGroup()?.fieldKey ?? this.fieldKeyDefault());
973
+ if (this.paddingLeftItem() === false) {
974
+ this.level.set(0);
975
+ }
976
+ this.selectFirstItem.set(false);
977
+ if (this.configTemplateGroup()?.onlySelectFirstItem || (!this.multiKeySelected()?.length && this.config()?.autoSelectFirstItem)) {
978
+ this.selectFirstItem.set(true);
979
+ }
980
+ this.callApiByService();
981
+ this.onUpdateMultiKeySelectedGroup()?.pipe(takeUntil(this.onDestroy)).subscribe(() => {
982
+ if (!this.store() || !this.store().length) {
983
+ return;
984
+ }
985
+ this.keysChecked.set([]);
986
+ this.mappingItemsChecked().clear();
987
+ const configTemplateGroup = this.configTemplateGroup();
988
+ if (!configTemplateGroup) {
989
+ return;
990
+ }
991
+ this.store().forEach(item => {
992
+ if (isEmpty(item()[this.fieldKey()])) {
993
+ item.update(current => {
994
+ current[this.fieldKey()] = `${this.PATTERN_FAKE_ID}${uuid()}`;
995
+ return current;
996
+ });
997
+ }
998
+ const itemGroup = item()[configTemplateGroup.fieldGetItems];
999
+ const itemMap = cloneDeep(item);
1000
+ itemMap.update(current => {
1001
+ current.ref = item;
1002
+ return current;
1003
+ });
1004
+ if (itemGroup) {
1005
+ this.checkedGroupItems(itemGroup(), item);
1006
+ }
1007
+ if (this.multiKeySelected() && this.multiKeySelected()?.length && this.multiKeySelected()?.find(key => key === item()[this.fieldKey()])) {
1008
+ this.handlerChangeChecked(true, itemMap, false, !configTemplateGroup.singleSelectItem);
1009
+ return;
1010
+ }
1011
+ });
1012
+ this.multiKeySelected.set([]);
1013
+ return;
1014
+ });
1015
+ }
1016
+ handlerCheckedOrUnCheckedAll(checked) {
1017
+ const configTemplateGroup = this.configTemplateGroup();
1018
+ if (!configTemplateGroup) {
1019
+ return;
1020
+ }
1021
+ if (!checked) {
1022
+ this.items().forEach(item => {
1023
+ this.mappingItemsChecked().delete(item()[this.fieldKey()]);
1024
+ const itemsOfGroup = item()[configTemplateGroup.fieldGetItems];
1025
+ if (itemsOfGroup && itemsOfGroup() && itemsOfGroup().length) {
1026
+ this.removeCheckedItemsChild(itemsOfGroup());
1027
+ }
1028
+ });
1029
+ this.setKeysCheckedByMappingChecked(false);
1030
+ return;
1031
+ }
1032
+ this.items().forEach(item => {
1033
+ this.mappingItemsChecked().set(item()[this.fieldKey()], item());
1034
+ const itemsOfGroup = item()[configTemplateGroup.fieldGetItems];
1035
+ if (itemsOfGroup && itemsOfGroup() && itemsOfGroup().length) {
1036
+ this.setCheckCheckedItemsChild(itemsOfGroup());
1037
+ }
1038
+ });
1039
+ this.setKeysCheckedByMappingChecked(false);
1040
+ }
1041
+ checkedGroupItems(items, parent) {
1042
+ const configTemplateGroup = this.configTemplateGroup();
1043
+ if (!configTemplateGroup || !items || !items.length) {
1044
+ return;
1045
+ }
1046
+ items.forEach(item => {
1047
+ if (isNil(item()[this.fieldKey()]) || item()[this.fieldKey()] === '') {
1048
+ item.update(current => {
1049
+ current[this.fieldKey()] = `${this.PATTERN_FAKE_ID}${uuid()}`;
1050
+ return;
1051
+ });
1052
+ }
1053
+ const itemGroup = item()[configTemplateGroup.fieldGetItems];
1054
+ const itemMap = cloneDeep(item);
1055
+ itemMap.update(current => {
1056
+ current.ref = item;
1057
+ current.parentItem = parent;
1058
+ return current;
1059
+ });
1060
+ if (itemGroup) {
1061
+ this.checkedGroupItems(itemGroup(), item);
1062
+ }
1063
+ if (this.multiKeySelected() && this.multiKeySelected()?.length && this.multiKeySelected()?.find(key => key === item()[this.fieldKey()])) {
1064
+ this.handlerChangeChecked(true, itemMap, false, !configTemplateGroup.singleSelectItem);
1065
+ return;
1066
+ }
1067
+ if (configTemplateGroup.singleSelectItem) {
1068
+ this.handlerChangeChecked(false, itemMap, false, !configTemplateGroup.singleSelectItem);
1069
+ }
1070
+ });
1071
+ }
1072
+ handlerClickButtonGroup(buttonInGroup, item) {
1073
+ buttonInGroup.action?.(item);
1074
+ }
1075
+ handlerToggleExpand(e, item, acceptEvent = true) {
1076
+ if (!acceptEvent || this.configTemplateGroup()?.ignoreClickLabelGroup) {
1077
+ return;
1078
+ }
1079
+ if (e instanceof Event) {
1080
+ e.stopPropagation();
1081
+ }
1082
+ item.update(current => {
1083
+ current.expand = !current.expand;
1084
+ return current;
1085
+ });
1086
+ this.refreshView();
1087
+ }
1088
+ handlerChangeView() {
1089
+ this.refreshView();
1090
+ }
1091
+ processKeyChangeUnSelect(item) {
1092
+ if (isNil(item()[this.fieldKey()]) || item()[this.fieldKey()] === '') {
1093
+ return;
1094
+ }
1095
+ this.handlerChangeItemChecked(item);
1096
+ }
1097
+ handlerChangeItemChecked(item) {
1098
+ const checked = !this.keysChecked().some(key => item[this.fieldKey()] === key);
1099
+ if (!checked && this.configTemplateGroup()?.isViewRadio) {
1100
+ return;
1101
+ }
1102
+ this.handlerChangeChecked(checked, signal(item), false);
1103
+ }
1104
+ handlerChangeChecked(checked, item, isClickManual, isCheckedByDefaultKey) {
1105
+ const configTemplateGroup = this.configTemplateGroup();
1106
+ if (!configTemplateGroup) {
1107
+ return;
1108
+ }
1109
+ if (!configTemplateGroup.isViewTreeJson && item().level !== item().maxLevelGroup && (configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem)) {
1110
+ return;
1111
+ }
1112
+ const refItem = (item().ref || item);
1113
+ if (configTemplateGroup.singleSelectItem) {
1114
+ checked = true;
1115
+ const mappingItemsCheckedTemp = cloneDeep(this.mappingItemsChecked);
1116
+ for (const [key, itemCheck] of mappingItemsCheckedTemp()) {
1117
+ const itemByKey = this.mappingItemsChecked().get(key);
1118
+ itemByKey.isCheckManual = false;
1119
+ delete itemByKey.ref.isCheckManual;
1120
+ if (!itemCheck.ref.isCheckedByDefaultKey) {
1121
+ this.mappingItemsChecked().delete(key);
1122
+ this.outUnSelectMultiKey.emit([key]);
1123
+ continue;
1124
+ }
1125
+ }
1126
+ if (!isCheckedByDefaultKey) {
1127
+ item.update(current => {
1128
+ current.isCheckManual = true;
1129
+ return current;
1130
+ });
1131
+ refItem.update(current => {
1132
+ current.isCheckManual = true;
1133
+ return current;
1134
+ });
1135
+ }
1136
+ }
1137
+ const itemsOfGroup = item()[configTemplateGroup.fieldGetItems];
1138
+ // bỏ chọn tất cả các item để thực hiện check lại
1139
+ if (configTemplateGroup.isViewTreeJson || (configTemplateGroup.singleSelectItemByTree && !isCheckedByDefaultKey && !configTemplateGroup.notChangeStateItemCheckOther)) {
1140
+ Array.from(this.mappingItemsChecked().values()).forEach(item => {
1141
+ delete item.isCheckManual;
1142
+ refItem.update(current => {
1143
+ delete current.isCheckManual;
1144
+ return current;
1145
+ });
1146
+ });
1147
+ this.outUnSelectMultiKey.emit(this.keysChecked());
1148
+ this.mappingItemsChecked().clear();
1149
+ this.setKeysCheckedByMappingChecked(isClickManual, item);
1150
+ }
1151
+ if (checked) {
1152
+ this.expandAllItemsInGroup(item);
1153
+ this.mappingItemsChecked().set(item()[this.fieldKey()], item());
1154
+ if (isCheckedByDefaultKey) {
1155
+ refItem.update(current => {
1156
+ current.isCheckedByDefaultKey = isCheckedByDefaultKey;
1157
+ return current;
1158
+ });
1159
+ }
1160
+ item.update(current => {
1161
+ current.isCheckedByDefaultKey = refItem().isCheckedByDefaultKey;
1162
+ return current;
1163
+ });
1164
+ if (configTemplateGroup.chooseChildThenAutoChooseParent) { // chỉ chọn các cha trên cùng tree, ko quan tâm node cha có các con đã đc tích hết chưa
1165
+ item.update(current => {
1166
+ current.isCheckManual = true;
1167
+ return current;
1168
+ });
1169
+ refItem.update(current => {
1170
+ current.isCheckManual = true;
1171
+ return current;
1172
+ });
1173
+ this.recursivelyCheckedParentByTree(item().parentItem);
1174
+ if (!configTemplateGroup.ignoreChooseParentThenAutoChooseChildren && !isCheckedByDefaultKey) {
1175
+ this.setCheckCheckedItemsChild(itemsOfGroup());
1176
+ }
1177
+ this.setKeysCheckedByMappingChecked(isClickManual, item);
1178
+ return;
1179
+ }
1180
+ if (configTemplateGroup.ignoreChooseParentThenAutoChooseChildren) { // lựa chọn node cha sẽ bỏ qua việc chọn tất cả node con
1181
+ this.setKeysCheckedByMappingChecked(isClickManual, item);
1182
+ return;
1183
+ }
1184
+ if (itemsOfGroup && itemsOfGroup() && itemsOfGroup().length && !isCheckedByDefaultKey && !configTemplateGroup.isViewTreeJson) {
1185
+ const itemsChange = configTemplateGroup.ignoreChangeChildrenDisableWhenChangeParent ?
1186
+ itemsOfGroup().filter((item) => !this.keysDisableItem()?.find(key => key === item()[this.fieldKey()])) : itemsOfGroup();
1187
+ this.setCheckCheckedItemsChild(itemsChange);
1188
+ }
1189
+ if (!configTemplateGroup.notChangeStateItemCheckOther && !configTemplateGroup.isViewTreeJson) {
1190
+ this.setCheckCheckedItemsParent(item().parentItem);
1191
+ }
1192
+ this.setKeysCheckedByMappingChecked(isClickManual, item);
1193
+ return;
1194
+ }
1195
+ item.update(current => {
1196
+ current.isCheckManual = false;
1197
+ if (isCheckedByDefaultKey) {
1198
+ current.isCheckedByDefaultKey = false;
1199
+ }
1200
+ return current;
1201
+ });
1202
+ refItem.update(current => {
1203
+ current.isCheckManual = false;
1204
+ if (isCheckedByDefaultKey) {
1205
+ current.isCheckedByDefaultKey = false;
1206
+ }
1207
+ return current;
1208
+ });
1209
+ this.mappingItemsChecked().delete(item()[this.fieldKey()]);
1210
+ this.keysChecked.set(Array.from(this.mappingItemsChecked().keys()));
1211
+ if (configTemplateGroup.notChangeStateItemCheckOther) {
1212
+ this.mappingItemsChecked().delete(item()[this.fieldKey()]);
1213
+ this.outUnSelectMultiKey.emit(!isEmpty(item()[this.fieldKey()]) ? [item()[this.fieldKey()]] : []);
1214
+ this.setKeysCheckedByMappingChecked(isClickManual, item);
1215
+ return;
1216
+ }
1217
+ if (configTemplateGroup.ignoreUnselectChildrenRemoveSelectParent) {
1218
+ this.recursivelyCheckedParentByTree(item().parentItem);
1219
+ }
1220
+ // nếu ko phải trường hơp của bank và danh mục sản phẩm thì bỏ cha sẽ bỏ con
1221
+ if (itemsOfGroup && itemsOfGroup() && itemsOfGroup().length) {
1222
+ const itemsChange = configTemplateGroup.ignoreChangeChildrenDisableWhenChangeParent ?
1223
+ itemsOfGroup().filter((item) => !this.keysDisableItem()?.find(key => key === item()[this.fieldKey()])) : itemsOfGroup();
1224
+ this.removeCheckedItemsChild(itemsChange);
1225
+ }
1226
+ if (item().parentItem && !configTemplateGroup.ignoreUnselectChildrenRemoveSelectParent) {
1227
+ this.mappingItemsChecked().delete(item().parentItem[this.fieldKey()]);
1228
+ }
1229
+ this.setKeysCheckedByMappingChecked(isClickManual, item);
1230
+ }
1231
+ getItemsOfGroup(item, stores) {
1232
+ const configTemplateGroup = this.configTemplateGroup();
1233
+ if (!configTemplateGroup || !stores || !stores.length) {
1234
+ return;
1235
+ }
1236
+ for (const group of stores()) {
1237
+ if (group()[this.fieldKey()] === item()[this.fieldKey()]) {
1238
+ return group()[configTemplateGroup.fieldGetItems];
1239
+ }
1240
+ const result = this.getItemsOfGroup(item, group()[configTemplateGroup.fieldGetItems]);
1241
+ return result;
1242
+ }
1243
+ return;
1244
+ }
1245
+ setKeysStillOtherOptions(item) {
1246
+ if (!item?.()) {
1247
+ this.keysStillOtherOptions.set([]);
1248
+ return;
1249
+ }
1250
+ const keysChecked = Array.from(this.mappingItemsChecked().keys());
1251
+ const itemParent = item().parentItem;
1252
+ const indexItem = this.keysStillOtherOptions().findIndex(key => key === item()[this.fieldKey()]);
1253
+ if (indexItem >= 0) {
1254
+ this.keysStillOtherOptions.update(current => {
1255
+ current.splice(indexItem, 1);
1256
+ return current;
1257
+ });
1258
+ }
1259
+ if (!itemParent || !itemParent()) {
1260
+ return;
1261
+ }
1262
+ const itemsOfGroupParent = this.getItemsOfGroup(itemParent, this.store);
1263
+ if (!itemsOfGroupParent || !itemsOfGroupParent() || !itemsOfGroupParent().length) {
1264
+ return;
1265
+ }
1266
+ const indexParent = this.keysStillOtherOptions().findIndex(key => key === itemParent()[this.fieldKey()]);
1267
+ if (itemsOfGroupParent().every((element) => keysChecked.includes(element()[this.fieldKey()])) && indexParent >= 0) {
1268
+ this.keysStillOtherOptions.update(current => {
1269
+ current.splice(indexItem, 1);
1270
+ return current;
1271
+ });
1272
+ return;
1273
+ }
1274
+ if (itemsOfGroupParent().some(element => keysChecked.includes(element()[this.fieldKey()])) && indexParent < 0) {
1275
+ this.keysStillOtherOptions.update(current => [...current, itemParent()[this.fieldKey()]]);
1276
+ return;
1277
+ }
1278
+ if (indexParent >= 0) {
1279
+ this.keysStillOtherOptions.update(current => {
1280
+ current.splice(indexItem, 1);
1281
+ return current;
1282
+ });
1283
+ }
1284
+ }
1285
+ setKeysCheckedByMappingChecked(isClickManual, item) {
1286
+ this.keysChecked.set(Array.from(this.mappingItemsChecked().keys()));
1287
+ this.emitMultiKeyChecked(isClickManual);
1288
+ this.setKeysStillOtherOptions(item);
1289
+ }
1290
+ emitMultiKeyChecked(isClickManual = true) {
1291
+ const configTemplateGroup = this.configTemplateGroup();
1292
+ if (!configTemplateGroup) {
1293
+ return;
1294
+ }
1295
+ const dataMultiKeyChecked = { keys: new Array(), mapKeys: new Array(), isClickManual };
1296
+ if ((configTemplateGroup.emitAllItemChecked || configTemplateGroup.chooseChildThenAutoChooseParent) && !configTemplateGroup.ignoreEmitAllItemCheckedWhenChooseChildThenAutoChooseParent) {
1297
+ for (const [key, item] of this.mappingItemsChecked()) {
1298
+ dataMultiKeyChecked.keys.push(key);
1299
+ dataMultiKeyChecked.mapKeys.push({ key, item: (item.ref?.() || item), isClickManual });
1300
+ }
1301
+ this.outSelectMultiKey.emit(dataMultiKeyChecked);
1302
+ this.totalItemChecked.set(dataMultiKeyChecked.keys.length);
1303
+ return;
1304
+ }
1305
+ for (const [key, item] of this.mappingItemsChecked()) {
1306
+ if (item[this.fieldKey()] && !String(item[this.fieldKey()]).includes(this.PATTERN_FAKE_ID) && (!item[configTemplateGroup.fieldGetItems]?.length || !item[configTemplateGroup.fieldGetItems]().some((itemGroup) => this.mappingItemsChecked().get(itemGroup()[this.fieldKey()])))) {
1307
+ dataMultiKeyChecked.keys.push(key);
1308
+ dataMultiKeyChecked.mapKeys.push({ key, item: (item.ref?.() || item), isClickManual });
1309
+ }
1310
+ }
1311
+ this.outSelectMultiKey.emit(dataMultiKeyChecked);
1312
+ this.totalItemChecked.set(dataMultiKeyChecked.keys.length);
1313
+ }
1314
+ recursivelyCheckedParentByTree(item) {
1315
+ if (!item) {
1316
+ return;
1317
+ }
1318
+ this.mappingItemsChecked().set(item[this.fieldKey()], item());
1319
+ this.recursivelyCheckedParentByTree(item.parentItem);
1320
+ }
1321
+ setCheckCheckedItemsParent(item) {
1322
+ const configTemplateGroup = this.configTemplateGroup();
1323
+ if (!configTemplateGroup || !item) {
1324
+ return;
1325
+ }
1326
+ const itemsOfGroup = item()[configTemplateGroup.fieldGetItems];
1327
+ if (!itemsOfGroup() || !itemsOfGroup().length) {
1328
+ return;
1329
+ }
1330
+ for (const itemGroup of itemsOfGroup()) {
1331
+ if (!this.mappingItemsChecked().has(itemGroup()[this.fieldKey()])) {
1332
+ return;
1333
+ }
1334
+ }
1335
+ this.mappingItemsChecked().set(item()[this.fieldKey()], item());
1336
+ if (item().parentItem) {
1337
+ this.setCheckCheckedItemsParent(item().parentItem);
1338
+ }
1339
+ }
1340
+ setCheckCheckedItemsChild(items) {
1341
+ const configTemplateGroup = this.configTemplateGroup();
1342
+ if (!configTemplateGroup || !items || !items.length) {
1343
+ return;
1344
+ }
1345
+ items.forEach(item => {
1346
+ this.mappingItemsChecked().set(item()[this.fieldKey()], item());
1347
+ const itemsOfGroup = item()[configTemplateGroup.fieldGetItems];
1348
+ if (itemsOfGroup && itemsOfGroup() && itemsOfGroup().length) {
1349
+ this.setCheckCheckedItemsChild(itemsOfGroup());
1350
+ }
1351
+ });
1352
+ }
1353
+ removeCheckedItemsChild(items) {
1354
+ const configTemplateGroup = this.configTemplateGroup();
1355
+ if (!configTemplateGroup || !items || !items.length) {
1356
+ return;
1357
+ }
1358
+ items.forEach(item => {
1359
+ item.update(current => {
1360
+ current.isCheckManual = false;
1361
+ return current;
1362
+ });
1363
+ this.mappingItemsChecked().delete(item()[this.fieldKey()]);
1364
+ this.outUnSelectMultiKey.emit([item()[this.fieldKey()]]);
1365
+ const itemsOfGroup = item()[configTemplateGroup.fieldGetItems];
1366
+ if (itemsOfGroup && itemsOfGroup() && itemsOfGroup().length) {
1367
+ this.removeCheckedItemsChild(itemsOfGroup());
1368
+ }
1369
+ });
1370
+ }
1371
+ processSearch() {
1372
+ this.processData();
1373
+ }
1374
+ processData() {
1375
+ this.totalItem.set(0);
1376
+ const configTemplateGroup = this.configTemplateGroup();
1377
+ if (!configTemplateGroup) {
1378
+ return;
1379
+ }
1380
+ let items = this.store().map((item) => {
1381
+ if (isNil(item()[this.fieldKey()]) || item()[this.fieldKey()] === '') {
1382
+ item.update(current => {
1383
+ current[this.fieldKey()] = `${this.PATTERN_FAKE_ID}${uuid()}`;
1384
+ return;
1385
+ });
1386
+ }
1387
+ const itemMap = cloneDeep(item);
1388
+ itemMap.update(current => {
1389
+ current.ref = item;
1390
+ current.isRoot = true;
1391
+ current.expand = this.keySearch() ? true : false;
1392
+ current.maxLevelGroup = this.configTemplateGroup()?.getMaxLevelGroup(item());
1393
+ current.level = this.level();
1394
+ current.textDescriptionGroupWhenNoData = this.configTemplateGroup()?.getDescriptionGroupWhenNoData?.(item());
1395
+ current.iconEmptyDataInGroup = this.configTemplateGroup()?.getIconEmptyDataInGroup?.(item());
1396
+ return current;
1397
+ });
1398
+ if ((itemMap().level === itemMap().maxLevelGroup || !this.configTemplateGroup()?.ignoreCheckboxGroup) && !String(item()[this.fieldKey()])?.includes(this.PATTERN_FAKE_ID)) {
1399
+ this.totalItem.update(current => current++);
1400
+ }
1401
+ if (!this.keySearch() && this.configTemplateGroup()?.getExpandGroup) {
1402
+ itemMap.update(current => {
1403
+ current.expand = this.configTemplateGroup()?.getExpandGroup?.(item);
1404
+ return current;
1405
+ });
1406
+ }
1407
+ if (this.configTemplateGroup()?.getPopoverGroup) {
1408
+ itemMap.update(current => {
1409
+ current.dataPopover = this.configTemplateGroup()?.getPopoverGroup?.(item);
1410
+ return current;
1411
+ });
1412
+ }
1413
+ if (this.configTemplateGroup()?.getButtonGroup) {
1414
+ itemMap.update(current => {
1415
+ current.buttonInGroup = this.configTemplateGroup()?.getButtonGroup?.(item);
1416
+ return current;
1417
+ });
1418
+ }
1419
+ const text = deleteUnicode(this.buildValueByConfig(itemMap)).toLocaleLowerCase();
1420
+ const textEscape = escapeHtml(text);
1421
+ const keySearch = deleteUnicode(escapeHtml((this.keySearch() || '').trim().toLocaleLowerCase()));
1422
+ itemMap.update(current => {
1423
+ current.displayAllChild = false;
1424
+ return current;
1425
+ });
1426
+ if (!keySearch || (this.configTemplateGroup()?.searchAllLevel && (text.includes(keySearch) || textEscape.includes(keySearch)))) {
1427
+ itemMap.update(current => {
1428
+ current.displayAllChild = false;
1429
+ current.hasDisplay = false;
1430
+ return current;
1431
+ });
1432
+ }
1433
+ const itemGroup = item()[configTemplateGroup.fieldGetItems];
1434
+ itemMap.update(current => {
1435
+ const children = current[configTemplateGroup.fieldGetItems];
1436
+ const data = this.filterItemsDisplay(this.convertDataByGroupInItem(itemGroup(), itemMap));
1437
+ children.set(data);
1438
+ if (current[configTemplateGroup.fieldGetItems]?.()) {
1439
+ current[configTemplateGroup.fieldGetItems].update((itemFields) => {
1440
+ if (!itemFields.length) {
1441
+ return itemFields;
1442
+ }
1443
+ itemFields[0].isFirst = true;
1444
+ const lastIndex = itemFields?.length - 1;
1445
+ if (lastIndex >= 0) {
1446
+ itemFields[lastIndex].isLast = true;
1447
+ }
1448
+ return itemFields;
1449
+ });
1450
+ }
1451
+ current.bonusPaddingLeft = 0;
1452
+ if (configTemplateGroup.getBonusPaddingLeftItem) {
1453
+ current.bonusPaddingLeft = configTemplateGroup.getBonusPaddingLeftItem(current);
1454
+ }
1455
+ if (configTemplateGroup.getClassIncludeItemNoData) {
1456
+ current.classIncludeItemNoData = configTemplateGroup.getClassIncludeItemNoData(current);
1457
+ }
1458
+ current.avatarConfig = configTemplateGroup.getAvatarConfig && configTemplateGroup.getAvatarConfig(current);
1459
+ return current;
1460
+ });
1461
+ if (this.multiKeySelected() && this.multiKeySelected()?.length && this.multiKeySelected()?.some(key => key === itemMap()[this.fieldKey()])) {
1462
+ this.handlerChangeChecked(true, itemMap, false, true);
1463
+ }
1464
+ this.buildValueByConfig(itemMap());
1465
+ return itemMap;
1466
+ });
1467
+ if (this.configTemplateGroup()?.searchAllLevel && this.keySearch()) {
1468
+ items = items.filter(item => item().hasDisplay);
1469
+ }
1470
+ this.config()?.sort?.(items);
1471
+ this.items.set(items);
1472
+ this.multiKeySelected.set([]);
1473
+ const callBackCalculatorHeightSuccess = () => {
1474
+ this.calculatorHeighItemSuccess.set(true);
1475
+ if (configTemplateGroup.expandFirstItem && this.items()[0]) {
1476
+ this.expandAllItemsInGroup(this.items()[0]);
1477
+ }
1478
+ this.setHeightViewPort();
1479
+ if (this.firstItemSelected && this.firstItemSelected()) {
1480
+ this.handlerChangeChecked(true, this.firstItemSelected, false);
1481
+ this.firstItemSelected.set(undefined);
1482
+ }
1483
+ };
1484
+ const checkLoadItem = (preStateHasScroll, currentHasScroll) => {
1485
+ if (this.keysHiddenItem()?.length && preStateHasScroll && !currentHasScroll && (this.isSearchOnline())) {
1486
+ this.callApiByService(false);
1487
+ }
1488
+ };
1489
+ setTimeout(() => {
1490
+ this.loading.set(false);
1491
+ this.outLoading.emit(this.loading());
1492
+ this.refreshView(callBackCalculatorHeightSuccess, checkLoadItem);
1493
+ this.outLoadItemsComplete.emit({ items: this.items() });
1494
+ });
1495
+ return;
1496
+ }
1497
+ refreshView(callBackCalculatorHeightSuccess, checkLoadItem) {
1498
+ this.setHeightViewPort(callBackCalculatorHeightSuccess);
1499
+ this.checkViewPortScroll(checkLoadItem);
1500
+ }
1501
+ expandAllItemsInGroup(item) {
1502
+ const configTemplateGroup = this.configTemplateGroup();
1503
+ if (!configTemplateGroup || !item) {
1504
+ return;
1505
+ }
1506
+ item.expand = true;
1507
+ const items = item[configTemplateGroup.fieldGetItems];
1508
+ if (!items || !items.length) {
1509
+ return;
1510
+ }
1511
+ items.forEach(itemGroup => this.expandAllItemsInGroup(itemGroup));
1512
+ }
1513
+ convertDataByGroupInItem(items, parentItem) {
1514
+ const configTemplateGroup = this.configTemplateGroup();
1515
+ if (!configTemplateGroup || !items || !items.length) {
1516
+ return [];
1517
+ }
1518
+ const itemsMap = items.map(item => {
1519
+ if (isNil(item()[this.fieldKey()]) || item()[this.fieldKey()] === '') {
1520
+ item()[this.fieldKey()] = `${this.PATTERN_FAKE_ID}${uuid()}`;
1521
+ }
1522
+ const itemMap = cloneDeep(item);
1523
+ itemMap.update(current => {
1524
+ current.ref = item;
1525
+ current.parentItem = parentItem;
1526
+ current[this.fieldKey()] = item()[this.fieldKey()];
1527
+ current.maxLevelGroup = parentItem().maxLevelGroup;
1528
+ current.level = parentItem().level + 1;
1529
+ current.arrayLevel = range(2, current.level + 1);
1530
+ if ((current.level === current.maxLevelGroup || !configTemplateGroup.ignoreCheckboxItem) && !String(item()[this.fieldKey()])?.includes(this.PATTERN_FAKE_ID)) {
1531
+ this.totalItem.update(current => current++);
1532
+ }
1533
+ current.expand = this.keySearch() ? true : false;
1534
+ if (!this.keySearch() && configTemplateGroup.getExpandItem) {
1535
+ current.expand = configTemplateGroup.getExpandItem(current);
1536
+ }
1537
+ current.displayAllChild = parentItem().displayAllChild;
1538
+ if (configTemplateGroup.getPopoverItem) {
1539
+ current.dataPopover = configTemplateGroup.getPopoverItem(current);
1540
+ }
1541
+ if (configTemplateGroup.getIconImageClass) {
1542
+ current.iconImageClass = configTemplateGroup.getIconImageClass(current);
1543
+ }
1544
+ const text = deleteUnicode(this.buildValueByConfig(current).toLocaleLowerCase());
1545
+ const keySearch = deleteUnicode(escapeHtml((this.keySearch() || '').trim().toLocaleLowerCase()));
1546
+ const textEscape = escapeHtml(text);
1547
+ if ((!this.keysHiddenItem()?.some(key => key === current[this.fieldKey()])) && ((parentItem().displayAllChild || !keySearch) || ((configTemplateGroup.searchAllLevel || !current[this.fieldKey()].includes(this.PATTERN_FAKE_ID)) && (text.includes(keySearch) || textEscape.includes(keySearch))))) {
1548
+ current.displayAllChild = true;
1549
+ this.setDisplayItem(current);
1550
+ }
1551
+ const itemGroup = current[configTemplateGroup.fieldGetItems];
1552
+ if (itemGroup?.()) {
1553
+ const data = this.filterItemsDisplay(this.convertDataByGroupInItem(itemGroup?.(), signal(current)));
1554
+ itemGroup.set(data);
1555
+ }
1556
+ if (current[configTemplateGroup.fieldGetItems]?.()) {
1557
+ current[configTemplateGroup.fieldGetItems].update((itemFields) => {
1558
+ if (!itemFields.length) {
1559
+ return itemFields;
1560
+ }
1561
+ itemFields[0].isFirst = true;
1562
+ const lastIndex = itemFields?.length - 1;
1563
+ if (lastIndex >= 0) {
1564
+ itemFields[lastIndex].isLast = true;
1565
+ }
1566
+ return itemFields;
1567
+ });
1568
+ }
1569
+ current.bonusPaddingLeft = 0;
1570
+ if (configTemplateGroup.getBonusPaddingLeftItem) {
1571
+ current.bonusPaddingLeft = configTemplateGroup.getBonusPaddingLeftItem(current, parentItem);
1572
+ }
1573
+ if (configTemplateGroup.getClassIncludeItemNoData) {
1574
+ current.classIncludeItemNoData = configTemplateGroup.getClassIncludeItemNoData(current, parentItem);
1575
+ }
1576
+ if (configTemplateGroup.getLinkImageError) {
1577
+ current.linkImageError = configTemplateGroup.getLinkImageError(current);
1578
+ }
1579
+ if (configTemplateGroup.getClassIncludeItemContent) {
1580
+ current.classInclude = configTemplateGroup.getClassIncludeItemContent(item);
1581
+ }
1582
+ current.avatarConfig = configTemplateGroup.getAvatarConfig && configTemplateGroup.getAvatarConfig(current);
1583
+ if (this.multiKeySelected() && this.multiKeySelected()?.length && this.multiKeySelected()?.some(key => key === current[this.fieldKey()])) {
1584
+ this.handlerChangeChecked(true, signal(current), false, true);
1585
+ }
1586
+ if (this.selectFirstItem() && current.level === current.maxLevelGroup) {
1587
+ this.firstItemSelected.set(current);
1588
+ this.selectFirstItem.set(false);
1589
+ }
1590
+ return current;
1591
+ });
1592
+ return itemMap;
1593
+ });
1594
+ return itemsMap;
1595
+ }
1596
+ setDisplayItem(item) {
1597
+ if (!item) {
1598
+ return;
1599
+ }
1600
+ item.hasDisplay = true;
1601
+ if (item.parentItem) {
1602
+ this.setDisplayItem(item.parentItem);
1603
+ }
1604
+ }
1605
+ filterItemsDisplay(items) {
1606
+ const configTemplateGroup = this.configTemplateGroup();
1607
+ if (!configTemplateGroup || !items || !items.length) {
1608
+ return [];
1609
+ }
1610
+ const itemsDisplay = items.filter(item => item().hasDisplay);
1611
+ itemsDisplay.forEach(item => {
1612
+ const itemGroup = item()[configTemplateGroup.fieldGetItems];
1613
+ item()[configTemplateGroup.fieldGetItems]?.set(this.filterItemsDisplay(itemGroup()));
1614
+ });
1615
+ return itemsDisplay;
1616
+ }
1617
+ getLengthItem() {
1618
+ const data = { length: this.items().length };
1619
+ if (data.length > this.maxItemShow()) {
1620
+ return data.length;
1621
+ }
1622
+ this.getLengthAllGroup(this.items(), data);
1623
+ return data.length;
1624
+ }
1625
+ getLengthAllGroup(items, data) {
1626
+ const configTemplateGroup = this.configTemplateGroup();
1627
+ if (!configTemplateGroup || !items) {
1628
+ return;
1629
+ }
1630
+ for (const item of items) {
1631
+ if (!item().expand) {
1632
+ continue;
1633
+ }
1634
+ const group = item()[configTemplateGroup.fieldGetItems];
1635
+ data.length += (group()?.length || 0);
1636
+ if ((!group() || !group().length) && item().level === 1 && (!configTemplateGroup.searchAllLevel || configTemplateGroup.autoCountWhenGroupEmptyItemLevel1)) {
1637
+ data.length += 1;
1638
+ }
1639
+ if (data.length > this.maxItemShow()) {
1640
+ return;
1641
+ }
1642
+ this.getLengthAllGroup(group(), data);
1643
+ if (data.length > this.maxItemShow()) {
1644
+ return;
1645
+ }
1646
+ }
1647
+ }
1648
+ getHeightGroupHasLine() {
1649
+ const configTemplateGroup = this.configTemplateGroup();
1650
+ if (!configTemplateGroup || configTemplateGroup?.ignoreGroupLine || !this.items()?.length) {
1651
+ return 0;
1652
+ }
1653
+ let length = 0;
1654
+ let count = 0;
1655
+ for (const item of this.items()) {
1656
+ if (length >= this.maxItemShow()) {
1657
+ break;
1658
+ }
1659
+ count += 1;
1660
+ length += 1;
1661
+ const group = item()[configTemplateGroup.fieldGetItems];
1662
+ const data = { length: item().expand ? group()?.length || 0 : 0 };
1663
+ this.getLengthAllGroup(group(), data);
1664
+ length += data.length;
1665
+ }
1666
+ const marginTopHasLine = configTemplateGroup.marginTopHasLine || 4;
1667
+ const height = count === 1 ? marginTopHasLine : (count - 1) * (marginTopHasLine * 3 + 1);
1668
+ return height;
1669
+ }
1670
+ buildValueByConfig(item) {
1671
+ const labelSearch = this.configTemplateGroup()?.getLabelSearch?.(item);
1672
+ if (item.isRoot) {
1673
+ if (this.configTemplateGroup()?.getLabelGroup) {
1674
+ item.fieldLabel = this.translateService.instant(this.configTemplateGroup()?.getLabelGroup(item) || ' ');
1675
+ return labelSearch ?? item.fieldLabel;
1676
+ }
1677
+ item.fieldLabel = this.translateService.instant(item.label || item.name || ' ');
1678
+ return item.fieldLabel;
1679
+ }
1680
+ if (this.configTemplateGroup()?.getLabelItem) {
1681
+ item.fieldLabel = this.translateService.instant(this.configTemplateGroup()?.getLabelItem(item) || ' ');
1682
+ return labelSearch ?? item.fieldLabel;
1683
+ }
1684
+ item.fieldLabel = this.translateService.instant(item.label || item.name || ' ');
1685
+ return labelSearch ?? item.fieldLabel;
1686
+ }
1687
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1688
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListGroupComponent, isStandalone: true, selector: "libs_ui-components-list-templates_group", usesInheritance: true, ngImport: i0, template: "@if (configTemplateGroup(); as configTemplateGroup) {\n <div class=\"libs-ui-list-group overflow-[hidden]\"\n [style.height]=\"heightViewPort() ? heightViewPort()+'px':'100%'\">\n <div class=\"flex flex-col w-full h-full relative min-h-[28px]\">\n @if (items().length && configTemplateGroup.configButtonSelectAndUndSelectItem?.(); as configButtonSelectItem) {\n <div [class]=\"'flex items-center bg-[#ffffff] '+(configButtonSelectItem.classInclude ?? 'libs-ui-border-bottom-general')\">\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonCheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonCheckAll?.label ?? 'i18n_select_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonCheckAll?.classInclude || 'pr-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonCheckAll?.classLabel || 'libs-ui-font-h6r'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerCheckedOrUnCheckedAll(true)\" />\n <div class=\"text-[#999999]\">|</div>\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonUncheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonUncheckAll?.label ?? 'i18n_unselect_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonUncheckAll?.classInclude || 'pl-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonUncheckAll?.classLabel || 'libs-ui-font-h6s'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerCheckedOrUnCheckedAll(false)\" />\n </div>\n }\n @if (items().length && configTemplateGroup.configCheckboxCheckAll?.(); as configCheckBox) {\n <div [class]=\"'flex libs-ui-border-bottom-general '+(configTemplateGroup.classIncludeHasConfigCheckBoxAll ?? ' bg-[#ffffff]')\">\n <libs_ui-components-checkbox-single [label]=\"configCheckBox.label ?? 'i18n_all'\"\n [classLabelInclude]=\"configCheckBox.classLabelInclude || ''\"\n [checked]=\"totalItemChecked() >= totalItem() && totalItem() > 0\"\n [disable]=\"loading() || disable() || false\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerCheckedOrUnCheckedAll($event.checked)\" />\n </div>\n }\n @if (items() && items().length) {\n <div class=\"w-full h-full relative flex\">\n <div LibsUiComponentsScrollOverlayDirective\n class=\"w-full h-full absolute top-0 left-0 {{ configTemplateGroup.classIncludeGroup ? configTemplateGroup.classIncludeGroup : '' }}\">\n @for (item of items(); track item()[fieldKey()]; let first = $first; let last = $last) {\n <div #itemRef\n [style.marginTop.px]=\"!configTemplateGroup.ignoreGroupLine ? configTemplateGroup.marginTopHasLine || 4 : 0\"\n class=\"flex flex-col relative \">\n <div class=\"flex items-center py-[6px] \"\n [class.libs-ui-bg-list-hover]=\"!configTemplateGroup.ignoreClickLabelGroup\"\n [class.libs-ui-bg-list-hover-active]=\"!configTemplateGroup.ignoreClickLabelGroup\"\n [class.!cursor-pointer]=\"!configTemplateGroup.ignoreClickLabelGroup && (configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem)\"\n [style.paddingLeft.px]=\"level()*(configTemplateGroup.isViewTree ? 8 : 16)\"\n (click)=\"(configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem) ? handlerToggleExpand($event,item) : undefined\">\n @if (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree) {\n <i class=\"cursor-pointer libs-ui-icon-chevron-right\"\n [class.rotate-90]=\"item().expand\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n <div class=\"flex\"\n [class.w-[calc(100%-32px)]]=\"configTemplateGroup.iconExpand === 'right' && !configTemplateGroup.isViewTree && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)\"\n [class.w-[calc(100%-16px)]]=\"configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree\">\n @if (!configTemplateGroup.isViewRadio) {\n <libs_ui-components-checkbox-single [avatarConfig]=\"item().avatarConfig\"\n [class.ml-[8px]]=\"configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree\"\n [ignoreCheckbox]=\"configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.w-auto]=\"configTemplateGroup.isViewTree\"\n [class.w-full]=\"!item()[configTemplateGroup.fieldGetItems]?.()?.length && !((configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)))\"\n [class.max-w-[calc(100%-24px)]]=\"(configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length))\"\n [label]=\"item().fieldLabel\"\n [popover]=\"item().dataPopover\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? zIndex()\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateGroup.getLinkImageError ? configTemplateGroup.getLinkImageError : configTemplateGroup.getImage):item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n [imgTypeIcon]=\"configTemplateGroup.imgTypeIcon\"\n [classLabelInclude]=\"(configTemplateGroup.classLabelItem ? configTemplateGroup.classLabelItem : (configTemplateGroup.isViewTree ? ' libs-ui-font-h6r ':' libs-ui-font-h6s ')) + ((configTemplateGroup.ignoreTextUppercaseLabelGroup || configTemplateGroup.isViewTree) ? '':' text-uppercase ')\"\n [disable]=\"disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [checked]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [stillOtherOptions]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysStillOtherOptions():keysStillOtherOptions().length\"\n (outChange)=\"handlerChangeChecked($event.checked,item, true)\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outClickLabel)=\"handlerToggleExpand('clickLabel',item,configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem)\" />\n }\n\n @if (configTemplateGroup.isViewRadio) {\n <libs_ui-components-radio-single [class.ml-[8px]]=\"configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree\"\n [avatarConfig]=\"item().avatarConfig\"\n [ignoreRadio]=\"configTemplateGroup.ignoreRadioGroup || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.w-auto]=\"configTemplateGroup.isViewTree\"\n [class.w-full]=\"!item()[configTemplateGroup.fieldGetItems]?.()?.length && !((configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)))\"\n [class.max-w-[calc(100%-24px)]]=\"(configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length))\"\n [label]=\"item().fieldLabel\"\n [popover]=\"item().dataPopover\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? zIndex()\"\n [imgTypeIcon]=\"configTemplateGroup.imgTypeIcon\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateGroup.getLinkImageError ? configTemplateGroup.getLinkImageError : configTemplateGroup.getImage):item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n [classLabelInclude]=\"(configTemplateGroup.classLabelItem ? configTemplateGroup.classLabelItem : 'libs-ui-font-h6s ') + (configTemplateGroup.ignoreTextUppercaseLabelGroup ? '':' uppercase')\"\n [disable]=\"disable() || (configTemplateGroup.disableItemNotLastLevel && !!item()[configTemplateGroup.fieldGetItems]?.()?.length) || configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [active]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n (outChange)=\"handlerChangeChecked($event.active,item, true)\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outClickLabel)=\"handlerToggleExpand('clickLabel',item,configTemplateGroup.ignoreRadioGroup || configTemplateGroup.singleSelectItem)\" />\n }\n\n @if (item().buttonInGroup; as buttonInGroup) {\n <libs_ui-components-buttons-button [type]=\"buttonInGroup.type || 'button-link-primary'\"\n [label]=\"buttonInGroup.label || ' '\"\n [classIconLeft]=\"(buttonInGroup.classIconLeft || '')+' flex mr-[8px] !text-[8px]'\"\n [classInclude]=\"buttonInGroup.classInclude\"\n [classLabel]=\"buttonInGroup.classLabel || 'libs-ui-font-h5r'\"\n [disable]=\"buttonInGroup.disable || disable() || false\"\n (outClick)=\"handlerClickButtonGroup(buttonInGroup,item())\" />\n }\n </div>\n\n @if (configTemplateGroup.iconExpand === 'right' && !configTemplateGroup.isViewTree && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)) {\n <i class=\"flex items-center cursor-pointer mr-[16px] libs-ui-icon-chevron-right\"\n [class.!ml-[8px]]=\"item().dataPopover\"\n [class.rotate-90]=\"item().expand\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n </div>\n @if (item().expand && calculatorHeighItemSuccess()) {\n <libs_ui-components-list-templates_group-item [keySearch]=\"keySearch()\"\n [items]=\"item()[configTemplateGroup.fieldGetItems]()\"\n [parentItem]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keysChecked]=\"keysChecked()\"\n [disable]=\"disable()\"\n [keysDisableItem]=\"keysDisableItem() || []\"\n [configTemplateGroup]=\"configTemplateGroup\"\n [config]=\"config()\"\n [keysStillOtherOptions]=\"keysStillOtherOptions()\"\n (outChangeView)=\"handlerChangeView()\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChangeItemChecked($event.item)\" />\n }\n @if (!last && !configTemplateGroup.ignoreGroupLine && calculatorHeighItemSuccess()) {\n <div class=\"libs-ui-list-group-line\"\n [style.marginTop.px]=\"!configTemplateGroup.ignoreGroupLine ? configTemplateGroup.marginTopHasLine || 4 : 0\">\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n @if (!items() || !items().length) {\n <div class=\"libs-ui-font-h5r text-[#c1c1c1] relative {{ configTemplateGroup.classIncludeNodata?configTemplateGroup.classIncludeNodata:'' }}\"\n [style.marginLeft.px]=\"0 | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:2:(configTemplateGroup.isViewTree || configTemplateGroup.iconExpand === 'left'):configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem):true\"\n [class.py-[8px]]=\"configTemplateGroup.fieldGetAvatarItem\"\n [class.py-[4px]]=\"!configTemplateGroup.fieldGetAvatarItem\">\n @if (!keySearch() && !loading()) {\n <div>{{ (config()?.textNoData ?? 'i18n_no_data_yet') | translate }}</div>\n }\n @if (keySearch() && !loading()) {\n <div>{{ (config()?.textSearchNoData ??'i18n_no_result') | translate }}</div>\n }\n </div>\n }\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n </div>\n}\n", styles: [".libs-ui-list-group{display:flex;flex-direction:column;width:100%}.libs-ui-list-group .libs-ui-list-group-line{width:100%;height:1px;background-color:#e6e7ea}.libs-ui-list-group [class*=libs-ui-icon-chevron]:before{color:#6a7383}\n"], dependencies: [{ kind: "ngmodule", type: VirtualScrollerModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsCheckboxSingleComponent, selector: "libs_ui-components-checkbox-single", inputs: ["key", "checked", "label", "classLabelInclude", "ignoreShowPopoverLabel", "typeLabelPopover", "popover", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "classInclude", "clickExactly", "disable", "disableLabel", "ignoreCheckbox", "zIndexLabel", "stillOtherOptions", "error", "showBorderError", "description", "iconImageClass", "classIconInclude", "modeBorder"], outputs: ["checkedChange", "linkImageChange", "outChange", "outEventPopover", "outClickLabel", "outChangStageFlagMousePopover"] }, { kind: "component", type: LibsUiComponentsRadioSingleComponent, selector: "libs_ui-components-radio-single", inputs: ["key", "active", "classInclude", "label", "labelInterpolateParams", "ignorePopoverLabel", "classLabelInclude", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "popover", "disable", "disableLabel", "clickExactly", "typeRadio", "ignoreRadio", "zIndexLabel", "classIncludeIcon"], outputs: ["activeChange", "outClickLabel", "outChange", "outChangStageFlagMousePopover"] }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "pipe", type: LibsUiComponentsListGroupCalculatorMarginLeftItemPipe, name: "LibsUiComponentsListGroupCalculatorMarginLeftItemPipe" }, { kind: "component", type: LibsUiComponentsListGroupItemComponent, selector: "libs_ui-components-list-templates_group-item", inputs: ["items", "configTemplateGroup", "keySearch", "fieldKey", "keysChecked", "keysDisableItem", "parentItem", "disable", "disableLabel", "config", "keysStillOtherOptions"], outputs: ["outChangeView", "outChange", "outChangStageFlagMousePopover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1689
+ }
1690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListGroupComponent, decorators: [{
1691
+ type: Component,
1692
+ args: [{ selector: 'libs_ui-components-list-templates_group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1693
+ VirtualScrollerModule, AsyncPipe, TranslateModule,
1694
+ LibsUiComponentsButtonsButtonComponent,
1695
+ LibsUiComponentsCheckboxSingleComponent,
1696
+ LibsUiComponentsRadioSingleComponent,
1697
+ LibsUiComponentsSpinnerComponent,
1698
+ LibsUiComponentsScrollOverlayDirective,
1699
+ LibsUiCheckSelectedByKeyPipe,
1700
+ LibsUiPipesCallFunctionInTemplatePipe,
1701
+ LibsUiComponentsListGroupCalculatorMarginLeftItemPipe,
1702
+ LibsUiComponentsListGroupItemComponent
1703
+ ], template: "@if (configTemplateGroup(); as configTemplateGroup) {\n <div class=\"libs-ui-list-group overflow-[hidden]\"\n [style.height]=\"heightViewPort() ? heightViewPort()+'px':'100%'\">\n <div class=\"flex flex-col w-full h-full relative min-h-[28px]\">\n @if (items().length && configTemplateGroup.configButtonSelectAndUndSelectItem?.(); as configButtonSelectItem) {\n <div [class]=\"'flex items-center bg-[#ffffff] '+(configButtonSelectItem.classInclude ?? 'libs-ui-border-bottom-general')\">\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonCheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonCheckAll?.label ?? 'i18n_select_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonCheckAll?.classInclude || 'pr-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonCheckAll?.classLabel || 'libs-ui-font-h6r'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerCheckedOrUnCheckedAll(true)\" />\n <div class=\"text-[#999999]\">|</div>\n <libs_ui-components-buttons-button [type]=\"configButtonSelectItem.buttonUncheckAll?.type ?? 'button-link-primary'\"\n [label]=\"configButtonSelectItem.buttonUncheckAll?.label ?? 'i18n_unselect_all_searched_results'\"\n [classInclude]=\"configButtonSelectItem.buttonUncheckAll?.classInclude || 'pl-[8px]'\"\n [classLabel]=\"configButtonSelectItem.buttonUncheckAll?.classLabel || 'libs-ui-font-h6s'\"\n [disable]=\"loading() || disable() || false\"\n (outClick)=\"handlerCheckedOrUnCheckedAll(false)\" />\n </div>\n }\n @if (items().length && configTemplateGroup.configCheckboxCheckAll?.(); as configCheckBox) {\n <div [class]=\"'flex libs-ui-border-bottom-general '+(configTemplateGroup.classIncludeHasConfigCheckBoxAll ?? ' bg-[#ffffff]')\">\n <libs_ui-components-checkbox-single [label]=\"configCheckBox.label ?? 'i18n_all'\"\n [classLabelInclude]=\"configCheckBox.classLabelInclude || ''\"\n [checked]=\"totalItemChecked() >= totalItem() && totalItem() > 0\"\n [disable]=\"loading() || disable() || false\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerCheckedOrUnCheckedAll($event.checked)\" />\n </div>\n }\n @if (items() && items().length) {\n <div class=\"w-full h-full relative flex\">\n <div LibsUiComponentsScrollOverlayDirective\n class=\"w-full h-full absolute top-0 left-0 {{ configTemplateGroup.classIncludeGroup ? configTemplateGroup.classIncludeGroup : '' }}\">\n @for (item of items(); track item()[fieldKey()]; let first = $first; let last = $last) {\n <div #itemRef\n [style.marginTop.px]=\"!configTemplateGroup.ignoreGroupLine ? configTemplateGroup.marginTopHasLine || 4 : 0\"\n class=\"flex flex-col relative \">\n <div class=\"flex items-center py-[6px] \"\n [class.libs-ui-bg-list-hover]=\"!configTemplateGroup.ignoreClickLabelGroup\"\n [class.libs-ui-bg-list-hover-active]=\"!configTemplateGroup.ignoreClickLabelGroup\"\n [class.!cursor-pointer]=\"!configTemplateGroup.ignoreClickLabelGroup && (configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem)\"\n [style.paddingLeft.px]=\"level()*(configTemplateGroup.isViewTree ? 8 : 16)\"\n (click)=\"(configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem) ? handlerToggleExpand($event,item) : undefined\">\n @if (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree) {\n <i class=\"cursor-pointer libs-ui-icon-chevron-right\"\n [class.rotate-90]=\"item().expand\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n <div class=\"flex\"\n [class.w-[calc(100%-32px)]]=\"configTemplateGroup.iconExpand === 'right' && !configTemplateGroup.isViewTree && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)\"\n [class.w-[calc(100%-16px)]]=\"configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree\">\n @if (!configTemplateGroup.isViewRadio) {\n <libs_ui-components-checkbox-single [avatarConfig]=\"item().avatarConfig\"\n [class.ml-[8px]]=\"configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree\"\n [ignoreCheckbox]=\"configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.w-auto]=\"configTemplateGroup.isViewTree\"\n [class.w-full]=\"!item()[configTemplateGroup.fieldGetItems]?.()?.length && !((configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)))\"\n [class.max-w-[calc(100%-24px)]]=\"(configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length))\"\n [label]=\"item().fieldLabel\"\n [popover]=\"item().dataPopover\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? zIndex()\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateGroup.getLinkImageError ? configTemplateGroup.getLinkImageError : configTemplateGroup.getImage):item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n [imgTypeIcon]=\"configTemplateGroup.imgTypeIcon\"\n [classLabelInclude]=\"(configTemplateGroup.classLabelItem ? configTemplateGroup.classLabelItem : (configTemplateGroup.isViewTree ? ' libs-ui-font-h6r ':' libs-ui-font-h6s ')) + ((configTemplateGroup.ignoreTextUppercaseLabelGroup || configTemplateGroup.isViewTree) ? '':' text-uppercase ')\"\n [disable]=\"disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [checked]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n [stillOtherOptions]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysStillOtherOptions():keysStillOtherOptions().length\"\n (outChange)=\"handlerChangeChecked($event.checked,item, true)\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outClickLabel)=\"handlerToggleExpand('clickLabel',item,configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem)\" />\n }\n\n @if (configTemplateGroup.isViewRadio) {\n <libs_ui-components-radio-single [class.ml-[8px]]=\"configTemplateGroup.iconExpand === 'left' || configTemplateGroup.isViewTree\"\n [avatarConfig]=\"item().avatarConfig\"\n [ignoreRadio]=\"configTemplateGroup.ignoreRadioGroup || configTemplateGroup.singleSelectItem\"\n [class]=\"configTemplateGroup.classIncludeItem || ''\"\n [class.w-auto]=\"configTemplateGroup.isViewTree\"\n [class.w-full]=\"!item()[configTemplateGroup.fieldGetItems]?.()?.length && !((configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)))\"\n [class.max-w-[calc(100%-24px)]]=\"(configTemplateGroup.isViewTree || configTemplateGroup.widthLabelSub24WhenNotTreeView) && (configTemplateGroup.iconExpand === 'left' || configTemplateGroup.iconExpand === 'right' && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length))\"\n [label]=\"item().fieldLabel\"\n [popover]=\"item().dataPopover\"\n [zIndexLabel]=\"configTemplateGroup.zIndexLabel ?? zIndex()\"\n [imgTypeIcon]=\"configTemplateGroup.imgTypeIcon\"\n [linkImage]=\"configTemplateGroup.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateGroup.getLinkImageError ? configTemplateGroup.getLinkImageError : configTemplateGroup.getImage):item()) | async) : item()[configTemplateGroup.fieldGetAvatarItem || '']\"\n [classLabelInclude]=\"(configTemplateGroup.classLabelItem ? configTemplateGroup.classLabelItem : 'libs-ui-font-h6s ') + (configTemplateGroup.ignoreTextUppercaseLabelGroup ? '':' uppercase')\"\n [disable]=\"disable() || (configTemplateGroup.disableItemNotLastLevel && !!item()[configTemplateGroup.fieldGetItems]?.()?.length) || configTemplateGroup.ignoreCheckboxGroup || configTemplateGroup.singleSelectItem || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [active]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysChecked():keysChecked().length\"\n (outChange)=\"handlerChangeChecked($event.active,item, true)\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outClickLabel)=\"handlerToggleExpand('clickLabel',item,configTemplateGroup.ignoreRadioGroup || configTemplateGroup.singleSelectItem)\" />\n }\n\n @if (item().buttonInGroup; as buttonInGroup) {\n <libs_ui-components-buttons-button [type]=\"buttonInGroup.type || 'button-link-primary'\"\n [label]=\"buttonInGroup.label || ' '\"\n [classIconLeft]=\"(buttonInGroup.classIconLeft || '')+' flex mr-[8px] !text-[8px]'\"\n [classInclude]=\"buttonInGroup.classInclude\"\n [classLabel]=\"buttonInGroup.classLabel || 'libs-ui-font-h5r'\"\n [disable]=\"buttonInGroup.disable || disable() || false\"\n (outClick)=\"handlerClickButtonGroup(buttonInGroup,item())\" />\n }\n </div>\n\n @if (configTemplateGroup.iconExpand === 'right' && !configTemplateGroup.isViewTree && (!configTemplateGroup.searchAllLevel || !!item()[configTemplateGroup.fieldGetItems]?.()?.length)) {\n <i class=\"flex items-center cursor-pointer mr-[16px] libs-ui-icon-chevron-right\"\n [class.!ml-[8px]]=\"item().dataPopover\"\n [class.rotate-90]=\"item().expand\"\n (click)=\"handlerToggleExpand($event,item)\">\n </i>\n }\n </div>\n @if (item().expand && calculatorHeighItemSuccess()) {\n <libs_ui-components-list-templates_group-item [keySearch]=\"keySearch()\"\n [items]=\"item()[configTemplateGroup.fieldGetItems]()\"\n [parentItem]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keysChecked]=\"keysChecked()\"\n [disable]=\"disable()\"\n [keysDisableItem]=\"keysDisableItem() || []\"\n [configTemplateGroup]=\"configTemplateGroup\"\n [config]=\"config()\"\n [keysStillOtherOptions]=\"keysStillOtherOptions()\"\n (outChangeView)=\"handlerChangeView()\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChangeItemChecked($event.item)\" />\n }\n @if (!last && !configTemplateGroup.ignoreGroupLine && calculatorHeighItemSuccess()) {\n <div class=\"libs-ui-list-group-line\"\n [style.marginTop.px]=\"!configTemplateGroup.ignoreGroupLine ? configTemplateGroup.marginTopHasLine || 4 : 0\">\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n @if (!items() || !items().length) {\n <div class=\"libs-ui-font-h5r text-[#c1c1c1] relative {{ configTemplateGroup.classIncludeNodata?configTemplateGroup.classIncludeNodata:'' }}\"\n [style.marginLeft.px]=\"0 | LibsUiComponentsListGroupCalculatorMarginLeftItemPipe:2:(configTemplateGroup.isViewTree || configTemplateGroup.iconExpand === 'left'):configTemplateGroup.isViewTreeJson:!(configTemplateGroup.ignoreCheckboxItem || configTemplateGroup.ignoreRadioItem || configTemplateGroup.singleSelectItem):true\"\n [class.py-[8px]]=\"configTemplateGroup.fieldGetAvatarItem\"\n [class.py-[4px]]=\"!configTemplateGroup.fieldGetAvatarItem\">\n @if (!keySearch() && !loading()) {\n <div>{{ (config()?.textNoData ?? 'i18n_no_data_yet') | translate }}</div>\n }\n @if (keySearch() && !loading()) {\n <div>{{ (config()?.textSearchNoData ??'i18n_no_result') | translate }}</div>\n }\n </div>\n }\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n </div>\n}\n", styles: [".libs-ui-list-group{display:flex;flex-direction:column;width:100%}.libs-ui-list-group .libs-ui-list-group-line{width:100%;height:1px;background-color:#e6e7ea}.libs-ui-list-group [class*=libs-ui-icon-chevron]:before{color:#6a7383}\n"] }]
1704
+ }] });
1705
+
1706
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1707
+ class LibsUiComponentsListRadioComponent extends LibsUiComponentsListTemplatesComponentAbstract {
1708
+ /* PROPERTY */
1709
+ configTemplateRadio = signal(undefined);
1710
+ /* VIEW CHILD */
1711
+ virtualScrollerComponent = viewChild(VirtualScrollerComponent);
1712
+ ngOnInit() {
1713
+ if (isEmpty(this.config()?.configTemplateRadio)) {
1714
+ return;
1715
+ }
1716
+ super.ngOnInit();
1717
+ this.configTemplateRadio.set(this.config()?.configTemplateRadio?.());
1718
+ this.fieldKey.set(this.configTemplateRadio()?.fieldKey ?? this.fieldKeyDefault());
1719
+ this.callApiByService();
1720
+ }
1721
+ /* FUNCTIONS */
1722
+ handlerScrollBottom() {
1723
+ if (this.loadedLastItem()) {
1724
+ this.loading.set(false);
1725
+ this.outLoading.emit(this.loading());
1726
+ return;
1727
+ }
1728
+ if (this.loading() || this.loadedLastItem()) {
1729
+ return;
1730
+ }
1731
+ this.loading.set(true);
1732
+ this.outLoading.emit(this.loading());
1733
+ this.callApiByService(false);
1734
+ }
1735
+ processSearch() {
1736
+ if (!this.isSearchOnline()) {
1737
+ return this.processData(true);
1738
+ }
1739
+ this.callApiByService(true);
1740
+ }
1741
+ processKeyChangeUnSelect(item) {
1742
+ if (isNil(item[this.fieldKey()]) || item[this.fieldKey()] === '' || this.keySelected() !== item[this.fieldKey()]) {
1743
+ return;
1744
+ }
1745
+ this.keySelected.set('');
1746
+ this.outSelectKey.emit(undefined);
1747
+ }
1748
+ handlerChange(event, item, ignoreDisable, isClickManual = true) {
1749
+ if (!item) {
1750
+ return;
1751
+ }
1752
+ if (this.disable() && !ignoreDisable) {
1753
+ return;
1754
+ }
1755
+ if (event instanceof Event) {
1756
+ if (this.clickExactly()) {
1757
+ return;
1758
+ }
1759
+ event.stopPropagation();
1760
+ this.keySelected.set(item[this.fieldKey()]);
1761
+ this.outSelectKey.emit({ key: this.keySelected(), item, isClickManual });
1762
+ return;
1763
+ }
1764
+ this.keySelected.set(item[this.fieldKey()]);
1765
+ this.outSelectKey.emit({ key: this.keySelected(), item, isClickManual });
1766
+ }
1767
+ processData(replace) {
1768
+ const itemByKeySearch = [];
1769
+ const keysHidden = this.keysHiddenItem() || [];
1770
+ if (replace) {
1771
+ this.items.set([]);
1772
+ }
1773
+ this.store().forEach((item) => {
1774
+ const dataStore = cloneDeep(item);
1775
+ dataStore.update(store => { return { ...store, ref: item() }; });
1776
+ const key = keysHidden.find(key => dataStore()[this.fieldKey()] === key);
1777
+ if (key === undefined) {
1778
+ const text = deleteUnicode(this.buildValueByConfig(dataStore, this.configTemplateRadio())).toLocaleLowerCase();
1779
+ const textEscape = escapeHtml(text);
1780
+ const keySearch = deleteUnicode(escapeHtml(this.keySearch().toLocaleLowerCase()));
1781
+ if (((this.isSearchOnline() && this.config()?.httpRequestData?.()?.serviceName && !this.config()?.httpRequestData?.()?.serviceOther) ||
1782
+ (text && (text.includes(keySearch) || textEscape.includes(keySearch)))) && (replace || (!replace && !this.items().find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()]))) && !itemByKeySearch.find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()])) {
1783
+ if (this.configTemplateRadio()?.getPopover) {
1784
+ dataStore.update(currentStore => {
1785
+ return { ...currentStore, dataTooltip: this.configTemplateRadio()?.getPopover?.(dataStore) };
1786
+ });
1787
+ }
1788
+ dataStore.update(currentStore => {
1789
+ return {
1790
+ ...currentStore,
1791
+ classLabelInclude: this.configTemplateRadio()?.getClassItem?.(dataStore()),
1792
+ avatarConfig: this.configTemplateRadio()?.getAvatarConfig?.(dataStore())
1793
+ };
1794
+ });
1795
+ itemByKeySearch.push(dataStore);
1796
+ }
1797
+ return;
1798
+ }
1799
+ const indexItemRemove = this.items().findIndex(item => item()[this.fieldKey()] === key);
1800
+ if (indexItemRemove > -1) {
1801
+ this.items.update(items => {
1802
+ items.splice(indexItemRemove, 1);
1803
+ return items;
1804
+ });
1805
+ }
1806
+ });
1807
+ const checkLoadItem = (preStateHasScroll, currentHasScroll) => {
1808
+ if (this.keysHiddenItem()?.length && preStateHasScroll && !currentHasScroll && (this.isSearchOnline())) {
1809
+ this.callApiByService(false);
1810
+ }
1811
+ };
1812
+ if (replace) {
1813
+ this.items.set(itemByKeySearch);
1814
+ this.config()?.sort?.(this.items());
1815
+ this.emitKeySelectedDefaultIfExistItem(this.items());
1816
+ this.autoSelectFirstItem(this.items());
1817
+ this.setHeightViewPort();
1818
+ this.loading.set(false);
1819
+ this.outLoading.emit(this.loading());
1820
+ this.outLoadItemsComplete.emit({ items: this.items(), paging: this.pagingStore() });
1821
+ this.checkViewPortScroll(checkLoadItem);
1822
+ this.scrollToItemSelected();
1823
+ return;
1824
+ }
1825
+ this.items.update(items => [...(items || []), ...itemByKeySearch]);
1826
+ this.config()?.sort?.(this.items());
1827
+ this.setHeightViewPort();
1828
+ this.loading.set(false);
1829
+ this.outLoading.emit(this.loading());
1830
+ this.outLoadItemsComplete.emit({ items: this.items(), paging: this.pagingStore() });
1831
+ this.checkViewPortScroll(checkLoadItem);
1832
+ this.scrollToItemSelected();
1833
+ }
1834
+ scrollToItemSelected() {
1835
+ if (!this.configTemplateRadio()?.autoScrollToItemSelected) {
1836
+ return;
1837
+ }
1838
+ clearTimeout(this.timeAutoScrollItemSelected());
1839
+ this.timeAutoScrollItemSelected.set(setTimeout(() => {
1840
+ if (!this.keySelected) {
1841
+ return;
1842
+ }
1843
+ const index = this.items().findIndex(item => item()[this.fieldKey()] === this.keySelected());
1844
+ if (index !== -1) {
1845
+ this.virtualScrollerComponent()?.scrollToIndex(index);
1846
+ }
1847
+ }));
1848
+ }
1849
+ autoSelectFirstItem(items) {
1850
+ if (this.autoSelectedFirstItemCallOutsideBefore() || this.keySelected() || !this.config()?.autoSelectFirstItem || !items || !items.length) {
1851
+ return;
1852
+ }
1853
+ this.handlerChange('radio', items[0], true, false);
1854
+ }
1855
+ emitKeySelectedDefaultIfExistItem(items) {
1856
+ const item = items.find(store => store()[this.fieldKey()] === this.keySelected());
1857
+ if (item) {
1858
+ this.handlerChange('radio', item, true, false);
1859
+ }
1860
+ }
1861
+ getLengthItem() {
1862
+ return this.items().length;
1863
+ }
1864
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1865
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListRadioComponent, isStandalone: true, selector: "libs_ui-components-list-templates_radio", viewQueries: [{ propertyName: "virtualScrollerComponent", first: true, predicate: VirtualScrollerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (configTemplateRadio(); as configTemplateRadio) {\n <div class=\"relative h-full w-full\">\n @if (items().length) {\n <div #elementScroll\n LibsUiComponentsScrollOverlayDirective\n class=\"w-full\"\n [style.height]=\"heightViewPort() ? heightViewPort()+'px':'100%'\"\n (outScrollBottom)=\"handlerScrollBottom()\">\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n @for (item of scroll.viewPortItems; track item()[fieldKey()]) {\n <div #itemRef\n [class]=\"'libs-ui-list-template-radio-item flex ' + (configTemplateRadio.classItemInclude || '')\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly()\"\n [class.libs-ui-bg-list-hover-active]=\"!clickExactly()\"\n [class.!pl-[12px]]=\"paddingLeftItem()\"\n [class.bg-[#ffffff]]=\"clickExactly()\"\n [class.!py-[2px]]=\"clickExactly()\"\n (click)=\"handlerChange($event,item())\">\n <div class=\"flex flex-col w-full\">\n @if (item().fieldLabel) {\n <libs_ui-components-radio-single [label]=\"item().fieldLabel\"\n [avatarConfig]=\"item().avatarConfig\"\n [active]=\"keySelected() === item()[fieldKey()]\"\n [key]=\"item()[fieldKey()]\"\n [imgTypeIcon]=\"configTemplateRadio.hasAvatarGroupSocial\"\n [linkImage]=\"configTemplateRadio.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateRadio.getImageError ? configTemplateRadio.getImageError : configTemplateRadio.getImage):item()) | async) : item()[configTemplateRadio.fieldGetImage || '']\"\n [classImageInclude]=\"configTemplateRadio.classIncludeImage || ''\"\n [bullet]=\"item().bullet?.()\"\n [disable]=\"loading() || disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [classLabelInclude]=\"item().classLabelInclude || ''\"\n [popover]=\"item().dataPopover\"\n [clickExactly]=\"clickExactly()\"\n [disableLabel]=\"disableLabel()\"\n [zIndexLabel]=\"configTemplateRadio.zIndexPopover ?? 1200\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChange('radio',item())\"\n (outClickLabel)=\"handlerChange('radio',item())\" />\n }\n @if (configTemplateRadio?.rows?.()) {\n <libs_ui-components-list-templates_rows class=\"w-full {{ configTemplateRadio.classRows ?? '' }}\"\n [item]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"keySelected()\"\n [configTemplate]=\"configTemplateRadio\"\n (outEvent)=\"handlerChange('radio',$event.item)\" />\n }\n </div>\n </div>\n }\n </virtual-scroller>\n </div>\n }\n @if (!items().length) {\n <div [class]=\"'libs-ui-font-h4r text-[#c1c1c1] '+ (config()?.textNoDataClassInclude ?? 'py-[4px] px-[12px]')\">\n @if (!keySearch() && !loading()) {\n <span>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</span>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <span>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (loading()) {\n <span>&nbsp;</span>\n }\n </div>\n }\n\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n}\n", styles: [".libs-ui-list-template-radio-item{padding:4px 22px 4px 1px;font-size:12px;line-height:18px;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: VirtualScrollerModule }, { kind: "component", type: i1$1.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "enableUnequalChildrenSizes", "RTL", "useMarginInsteadOfTranslate", "modifyOverflowStyleOfParentScroll", "stripedTable", "scrollbarWidth", "scrollbarHeight", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight", "ssrViewportWidth", "ssrViewportHeight", "bufferAmount", "scrollAnimationTime", "resizeBypassRefreshThreshold", "scrollThrottlingTime", "scrollDebounceTime", "checkResizeInterval", "items", "compareItems", "horizontal", "parentScroll"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "component", type: LibsUiComponentsRadioSingleComponent, selector: "libs_ui-components-radio-single", inputs: ["key", "active", "classInclude", "label", "labelInterpolateParams", "ignorePopoverLabel", "classLabelInclude", "linkImage", "linkImageError", "avatarConfig", "classImageInclude", "imgTypeIcon", "bullet", "popover", "disable", "disableLabel", "clickExactly", "typeRadio", "ignoreRadio", "zIndexLabel", "classIncludeIcon"], outputs: ["activeChange", "outClickLabel", "outChange", "outChangStageFlagMousePopover"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "component", type: LibsUiComponentsListRowsComponent, selector: "libs_ui-components-list-templates_rows", inputs: ["configTemplate", "item", "keySelected", "fieldKey", "zIndex"], outputs: ["outChangStageFlagMousePopover", "outEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1866
+ }
1867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListRadioComponent, decorators: [{
1868
+ type: Component,
1869
+ args: [{ selector: 'libs_ui-components-list-templates_radio', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1870
+ VirtualScrollerModule, AsyncPipe, TranslateModule, NgTemplateOutlet,
1871
+ LibsUiComponentsSpinnerComponent,
1872
+ LibsUiComponentsScrollOverlayDirective,
1873
+ LibsUiComponentsRadioSingleComponent,
1874
+ LibsUiPipesCallFunctionInTemplatePipe,
1875
+ LibsUiCheckSelectedByKeyPipe,
1876
+ LibsUiComponentsListRowsComponent
1877
+ ], template: "@if (configTemplateRadio(); as configTemplateRadio) {\n <div class=\"relative h-full w-full\">\n @if (items().length) {\n <div #elementScroll\n LibsUiComponentsScrollOverlayDirective\n class=\"w-full\"\n [style.height]=\"heightViewPort() ? heightViewPort()+'px':'100%'\"\n (outScrollBottom)=\"handlerScrollBottom()\">\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n @for (item of scroll.viewPortItems; track item()[fieldKey()]) {\n <div #itemRef\n [class]=\"'libs-ui-list-template-radio-item flex ' + (configTemplateRadio.classItemInclude || '')\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly()\"\n [class.libs-ui-bg-list-hover-active]=\"!clickExactly()\"\n [class.!pl-[12px]]=\"paddingLeftItem()\"\n [class.bg-[#ffffff]]=\"clickExactly()\"\n [class.!py-[2px]]=\"clickExactly()\"\n (click)=\"handlerChange($event,item())\">\n <div class=\"flex flex-col w-full\">\n @if (item().fieldLabel) {\n <libs_ui-components-radio-single [label]=\"item().fieldLabel\"\n [avatarConfig]=\"item().avatarConfig\"\n [active]=\"keySelected() === item()[fieldKey()]\"\n [key]=\"item()[fieldKey()]\"\n [imgTypeIcon]=\"configTemplateRadio.hasAvatarGroupSocial\"\n [linkImage]=\"configTemplateRadio.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateRadio.getImageError ? configTemplateRadio.getImageError : configTemplateRadio.getImage):item()) | async) : item()[configTemplateRadio.fieldGetImage || '']\"\n [classImageInclude]=\"configTemplateRadio.classIncludeImage || ''\"\n [bullet]=\"item().bullet?.()\"\n [disable]=\"loading() || disable() || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length)\"\n [classLabelInclude]=\"item().classLabelInclude || ''\"\n [popover]=\"item().dataPopover\"\n [clickExactly]=\"clickExactly()\"\n [disableLabel]=\"disableLabel()\"\n [zIndexLabel]=\"configTemplateRadio.zIndexPopover ?? 1200\"\n (outChangStageFlagMousePopover)='handlerChangStageFlagMouse($event)'\n (outChange)=\"handlerChange('radio',item())\"\n (outClickLabel)=\"handlerChange('radio',item())\" />\n }\n @if (configTemplateRadio?.rows?.()) {\n <libs_ui-components-list-templates_rows class=\"w-full {{ configTemplateRadio.classRows ?? '' }}\"\n [item]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"keySelected()\"\n [configTemplate]=\"configTemplateRadio\"\n (outEvent)=\"handlerChange('radio',$event.item)\" />\n }\n </div>\n </div>\n }\n </virtual-scroller>\n </div>\n }\n @if (!items().length) {\n <div [class]=\"'libs-ui-font-h4r text-[#c1c1c1] '+ (config()?.textNoDataClassInclude ?? 'py-[4px] px-[12px]')\">\n @if (!keySearch() && !loading()) {\n <span>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</span>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <span>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</span>\n }\n @if (loading()) {\n <span>&nbsp;</span>\n }\n </div>\n }\n\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n </div>\n}\n", styles: [".libs-ui-list-template-radio-item{padding:4px 22px 4px 1px;font-size:12px;line-height:18px;position:relative}\n"] }]
1878
+ }] });
1879
+
1880
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1881
+ class LibsUiComponentsListTagComponent extends LibsUiComponentsListTemplatesComponentAbstract {
1882
+ /* PROPERTY */
1883
+ configTemplateTag = signal(undefined);
1884
+ ngOnInit() {
1885
+ if (!this.config()?.configTemplateTag?.()) {
1886
+ return;
1887
+ }
1888
+ super.ngOnInit();
1889
+ this.configTemplateTag.set(this.config()?.configTemplateTag?.());
1890
+ this.fieldKey.set(this.configTemplateTag()?.fieldKey ?? this.fieldKeyDefault());
1891
+ this.callApiByService();
1892
+ }
1893
+ /* FUNCTIONS */
1894
+ handlerSelectItem(e, item) {
1895
+ if (e instanceof Event) {
1896
+ e.stopPropagation();
1897
+ e.preventDefault();
1898
+ }
1899
+ if (!item || (this.keysDisableItem() && this.keysDisableItem()?.some(key => key === item[this.fieldKey()]))) {
1900
+ return;
1901
+ }
1902
+ const key = item[this.fieldKey()];
1903
+ const indexOfKey = this.multiKeySelected()?.indexOf(key) ?? -1;
1904
+ if (indexOfKey < 0) {
1905
+ this.multiKeySelected.update(items => [...(items || []), key]);
1906
+ this.emitMoSelectMultiKey(this.multiKeySelected() || []);
1907
+ return;
1908
+ }
1909
+ this.multiKeySelected.update(items => {
1910
+ items?.splice(indexOfKey, 1);
1911
+ return items;
1912
+ });
1913
+ this.outUnSelectMultiKey.emit([key]);
1914
+ this.emitMoSelectMultiKey(this.multiKeySelected() || []);
1915
+ }
1916
+ async emitMoSelectMultiKey(multiKeySelected, isClickManual = true) {
1917
+ const mapKeys = new Array();
1918
+ if (!multiKeySelected || !multiKeySelected.length) {
1919
+ return this.outSelectMultiKey.emit({ keys: [], mapKeys, isClickManual });
1920
+ }
1921
+ multiKeySelected.forEach((key) => {
1922
+ const item = this.store().find(item => item()[this.fieldKey()] === key);
1923
+ mapKeys.push({ key, item, isClickManual });
1924
+ });
1925
+ this.outSelectMultiKey.emit({ keys: this.multiKeySelected() || [], mapKeys, isClickManual });
1926
+ }
1927
+ handlerScrollBottom() {
1928
+ if (this.loadedLastItem()) {
1929
+ this.loading.set(false);
1930
+ this.outLoading.emit(this.loading());
1931
+ return;
1932
+ }
1933
+ if (this.loading() || this.loadedLastItem()) {
1934
+ return;
1935
+ }
1936
+ this.loading.set(true);
1937
+ this.outLoading.emit(this.loading());
1938
+ this.callApiByService(false);
1939
+ }
1940
+ processSearch() {
1941
+ this.callApiByService(true);
1942
+ }
1943
+ processData(replace) {
1944
+ const itemByKeySearch = [];
1945
+ const keysHidden = this.keysHiddenItem() || [];
1946
+ if (replace) {
1947
+ this.items.set([]);
1948
+ }
1949
+ this.store().forEach((item) => {
1950
+ const dataStore = cloneDeep(item);
1951
+ dataStore.update(currentStore => {
1952
+ return { ...currentStore, ref: item() };
1953
+ });
1954
+ const key = keysHidden.find(key => dataStore()[this.fieldKey()] === key);
1955
+ if (key === undefined) {
1956
+ const text = this.buildValueByConfig(dataStore, this.configTemplateTag());
1957
+ if (text && deleteUnicode(text.toLocaleLowerCase()).includes(deleteUnicode(this.keySearch().toLocaleLowerCase())) && !this.items().find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()])) {
1958
+ itemByKeySearch.push(dataStore);
1959
+ dataStore.update(currentStore => {
1960
+ return {
1961
+ ...currentStore,
1962
+ classItem: item().classItem || this.configTemplateTag()?.getClassItem?.(dataStore())
1963
+ };
1964
+ });
1965
+ }
1966
+ return;
1967
+ }
1968
+ const indexItemRemove = this.items().findIndex(item => item()[this.fieldKey()] === key);
1969
+ if (indexItemRemove > -1) {
1970
+ this.items.update(items => {
1971
+ items.splice(indexItemRemove, 1);
1972
+ return items;
1973
+ });
1974
+ }
1975
+ });
1976
+ const checkLoadItem = (preStateHasScroll, currentHasScroll) => {
1977
+ if (this.keysHiddenItem()?.length && preStateHasScroll && !currentHasScroll && (this.isSearchOnline())) {
1978
+ this.callApiByService(false);
1979
+ }
1980
+ };
1981
+ if (replace) {
1982
+ this.items.set(itemByKeySearch);
1983
+ this.config()?.sort?.(this.items());
1984
+ this.setHeightViewPort();
1985
+ this.checkViewPortScroll(checkLoadItem);
1986
+ this.loading.set(false);
1987
+ this.outLoading.emit(this.loading());
1988
+ return;
1989
+ }
1990
+ this.items.update(items => [...(items || []), ...itemByKeySearch]);
1991
+ this.config()?.sort?.(this.items());
1992
+ this.setHeightViewPort();
1993
+ this.checkViewPortScroll(checkLoadItem);
1994
+ this.loading.set(false);
1995
+ this.outLoading.emit(this.loading());
1996
+ }
1997
+ getLengthItem() {
1998
+ return this.items().length;
1999
+ }
2000
+ processKeyChangeUnSelect(item) {
2001
+ if (isNil(item[this.fieldKey()]) || item[this.fieldKey()] === '' || this.keySelected() !== item[this.fieldKey()]) {
2002
+ return;
2003
+ }
2004
+ this.keySelected.set('');
2005
+ this.outSelectKey.emit(undefined);
2006
+ }
2007
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListTagComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2008
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListTagComponent, isStandalone: true, selector: "libs_ui-components-list-templates_tag", usesInheritance: true, ngImport: i0, template: "@if (configTemplateTag(); as configTemplateTag) {\n <div class=\"w-full h-full relative\"\n LibsUiComponentsScrollOverlayDirective\n (outScrollBottom)=\"handlerScrollBottom()\">\n <div class=\"relative max-h-[150px] h-full {{ configTemplateTag.classIncludeContainer }}\"\n [ngClass]=\"{'flex flex-wrap': !configTemplateTag.ignoreItemFlexWrap}\"\n [class.min-h-[45px]]=\"!loading() && (!items() || !items().length)\"\n [class.min-h-[104px]]=\"loading() && items()\">\n @for (item of items(); track item()[fieldKey()]) {\n <div [class.libs-ui-disable]=\"loading() || disable()\"\n [class.pointer-events-none]=\"loading() || disable()\"\n [class]=\"item().classContainerItem\">\n @if (item().bullet; as bullet) {\n <div [class]=\"item().classItem || 'rounded-[10px] px-[8px] py-[1px] mb-[8px] mr-[8px]'\"\n [class.w-max]=\"configTemplateTag?.ignoreItemFlexWrap\"\n [style.background-color]=\"bullet().backgroundColor\"\n [style.color]=\"bullet().color\"\n (click)=\"handlerSelectItem($event,item())\">\n <span [innerHTML]=\"item().fieldLabel\"></span>\n </div>\n } @else {\n <div (click)=\"handlerSelectItem($event, item())\"\n [class]=\"item().classItem || 'rounded-[20px] mb-[8px] mr-[8px] py-[4px] px-[8px] flex items-center cursor-pointer'\"\n [class.bg-[#e9f1fe]]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length\"\n [class.libs-ui-color-global]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length\">\n @if (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length) {\n <div class=\"mr-[8px] text-[12px] libs-ui-icon-check libs-ui-color-global\"></div>\n }\n <span class=\"libs-ui-font-h6r\"\n [innerHTML]=\"item().fieldLabel\"></span>\n </div>\n }\n </div>\n }\n @if (!items() || !items().length) {\n <div [class]=\"'libs-ui-font-h4r text-[#9ca2ad] '+ (config()?.textNoDataClassInclude ?? 'py-[4px]')\">\n @if (!keySearch() && !loading()) {\n <ng-container>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</ng-container>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</ng-container>\n }\n @if (loading()) {\n <ng-container>&nbsp;</ng-container>\n }\n </div>\n }\n </div>\n @if (loading()) {\n <div class=\"w-full h-full absolute top-0\">\n <libs_ui-components-spinner [size]=\"'medium'\" />\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: VirtualScrollerModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2009
+ }
2010
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListTagComponent, decorators: [{
2011
+ type: Component,
2012
+ args: [{ selector: 'libs_ui-components-list-templates_tag', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
2013
+ VirtualScrollerModule, NgTemplateOutlet, TranslateModule, NgClass,
2014
+ LibsUiComponentsSpinnerComponent,
2015
+ LibsUiComponentsScrollOverlayDirective,
2016
+ LibsUiCheckSelectedByKeyPipe
2017
+ ], template: "@if (configTemplateTag(); as configTemplateTag) {\n <div class=\"w-full h-full relative\"\n LibsUiComponentsScrollOverlayDirective\n (outScrollBottom)=\"handlerScrollBottom()\">\n <div class=\"relative max-h-[150px] h-full {{ configTemplateTag.classIncludeContainer }}\"\n [ngClass]=\"{'flex flex-wrap': !configTemplateTag.ignoreItemFlexWrap}\"\n [class.min-h-[45px]]=\"!loading() && (!items() || !items().length)\"\n [class.min-h-[104px]]=\"loading() && items()\">\n @for (item of items(); track item()[fieldKey()]) {\n <div [class.libs-ui-disable]=\"loading() || disable()\"\n [class.pointer-events-none]=\"loading() || disable()\"\n [class]=\"item().classContainerItem\">\n @if (item().bullet; as bullet) {\n <div [class]=\"item().classItem || 'rounded-[10px] px-[8px] py-[1px] mb-[8px] mr-[8px]'\"\n [class.w-max]=\"configTemplateTag?.ignoreItemFlexWrap\"\n [style.background-color]=\"bullet().backgroundColor\"\n [style.color]=\"bullet().color\"\n (click)=\"handlerSelectItem($event,item())\">\n <span [innerHTML]=\"item().fieldLabel\"></span>\n </div>\n } @else {\n <div (click)=\"handlerSelectItem($event, item())\"\n [class]=\"item().classItem || 'rounded-[20px] mb-[8px] mr-[8px] py-[4px] px-[8px] flex items-center cursor-pointer'\"\n [class.bg-[#e9f1fe]]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length\"\n [class.libs-ui-color-global]=\"item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length\">\n @if (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length) {\n <div class=\"mr-[8px] text-[12px] libs-ui-icon-check libs-ui-color-global\"></div>\n }\n <span class=\"libs-ui-font-h6r\"\n [innerHTML]=\"item().fieldLabel\"></span>\n </div>\n }\n </div>\n }\n @if (!items() || !items().length) {\n <div [class]=\"'libs-ui-font-h4r text-[#9ca2ad] '+ (config()?.textNoDataClassInclude ?? 'py-[4px]')\">\n @if (!keySearch() && !loading()) {\n <ng-container>{{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}</ng-container>\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container>{{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}</ng-container>\n }\n @if (loading()) {\n <ng-container>&nbsp;</ng-container>\n }\n </div>\n }\n </div>\n @if (loading()) {\n <div class=\"w-full h-full absolute top-0\">\n <libs_ui-components-spinner [size]=\"'medium'\" />\n </div>\n }\n </div>\n}\n" }]
2018
+ }] });
2019
+
2020
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2021
+ class LibsUiComponentsListTextComponent extends LibsUiComponentsListTemplatesComponentAbstract {
2022
+ /* PROPERTY */
2023
+ configTemplateText = signal(undefined);
2024
+ /* VIEW CHILD */
2025
+ virtualScrollerComponent = viewChild(VirtualScrollerComponent);
2026
+ ngOnInit() {
2027
+ if (isEmpty(this.config()?.configTemplateText?.())) {
2028
+ return;
2029
+ }
2030
+ super.ngOnInit();
2031
+ this.configTemplateText.set(this.config()?.configTemplateText?.());
2032
+ this.fieldKey.set(this.configTemplateText()?.fieldKey ?? this.fieldKeyDefault());
2033
+ this.callApiByService();
2034
+ }
2035
+ /* FUNCTIONS */
2036
+ handlerScrollBottom() {
2037
+ if (this.loadedLastItem()) {
2038
+ this.loading.set(false);
2039
+ this.outLoading.emit(this.loading());
2040
+ return;
2041
+ }
2042
+ if (this.loading() || this.loadedLastItem()) {
2043
+ return;
2044
+ }
2045
+ this.loading.set(true);
2046
+ this.outLoading.emit(this.loading());
2047
+ this.callApiByService(false);
2048
+ }
2049
+ processSearch() {
2050
+ if (!this.isSearchOnline()) {
2051
+ return this.processData(true);
2052
+ }
2053
+ this.callApiByService(true);
2054
+ }
2055
+ handlerClickRelative(e, item) {
2056
+ e.stopPropagation();
2057
+ if (this.clickExactly()) {
2058
+ return;
2059
+ }
2060
+ this.handlerSelectItem(e, item);
2061
+ }
2062
+ processKeyChangeUnSelect(item) {
2063
+ if (isNil(item[this.fieldKey()]) || item[this.fieldKey()] === '' || this.keySelected() !== item[this.fieldKey()]) {
2064
+ return;
2065
+ }
2066
+ this.keySelected.set('');
2067
+ this.outSelectKey.emit(undefined);
2068
+ }
2069
+ handlerSelectItem(e, item, action, ignoreDisable = false, isClickManual = true) {
2070
+ if (e instanceof Event) {
2071
+ e.stopPropagation();
2072
+ e.preventDefault();
2073
+ }
2074
+ if (item.disable) {
2075
+ return;
2076
+ }
2077
+ if (this.disable() && !ignoreDisable) {
2078
+ return;
2079
+ }
2080
+ if (typeof e === 'string' && e !== 'click') {
2081
+ return;
2082
+ }
2083
+ if (!item || (this.keysDisableItem() && this.keysDisableItem()?.some(key => key === item[this.fieldKey()]))) {
2084
+ return;
2085
+ }
2086
+ if (action) {
2087
+ action(item.ref);
2088
+ this.items().forEach(item => {
2089
+ this.buildValueByConfig(item, this.configTemplateText());
2090
+ });
2091
+ return;
2092
+ }
2093
+ if (this.configTemplateText()?.actionSort) {
2094
+ const currentItemSort = this.configTemplateText()?.itemSort?.();
2095
+ const mode = currentItemSort?.fieldSort !== item[this.fieldKey()] ? 'asc' : currentItemSort?.mode === 'desc' ? 'asc' : 'desc';
2096
+ const newSort = {
2097
+ fieldSort: item[this.fieldKey()],
2098
+ mode,
2099
+ modeNumber: mode === 'asc' ? 1 : 2,
2100
+ reset: () => 0
2101
+ };
2102
+ this.configTemplateText()?.itemSort?.set(newSort);
2103
+ this.outSortSingleSelect.emit(this.configTemplateText()?.itemSort?.() || newSort);
2104
+ }
2105
+ this.keySelected.set(item[this.fieldKey()]);
2106
+ this.outSelectKey.emit({ key: this.keySelected(), item, isClickManual });
2107
+ }
2108
+ handlerSort(itemSort) {
2109
+ itemSort.reset = () => 0;
2110
+ this.configTemplateText()?.itemSort?.set(itemSort);
2111
+ this.outSortSingleSelect.emit(this.configTemplateText()?.itemSort?.() || itemSort);
2112
+ }
2113
+ processData(replace) {
2114
+ const itemByKeySearch = [];
2115
+ const keysHidden = this.keysHiddenItem() || [];
2116
+ if (replace) {
2117
+ this.items.set([]);
2118
+ }
2119
+ this.store().forEach((item) => {
2120
+ const dataStore = cloneDeep(item);
2121
+ const key = keysHidden.find(key => dataStore()[this.fieldKey()] === key);
2122
+ dataStore.update(store => { return { ...store, ref: item() }; });
2123
+ if (key === undefined) {
2124
+ const text = deleteUnicode(this.buildValueByConfig(dataStore, this.configTemplateText())).toLocaleLowerCase();
2125
+ const textEscape = escapeHtml(text);
2126
+ const keySearch = deleteUnicode(escapeHtml(this.keySearch().toLocaleLowerCase()));
2127
+ if (((this.isSearchOnline() && this.config()?.httpRequestData?.()?.serviceName && !this.config()?.httpRequestData?.()?.serviceOther) ||
2128
+ (text && (text.includes(keySearch) || textEscape.includes(keySearch)))) && (replace || (!replace && !this.items().find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()]))) && !itemByKeySearch.find(dataItem => dataItem()[this.fieldKey()] === dataStore()[this.fieldKey()])) {
2129
+ dataStore.update(store => {
2130
+ return {
2131
+ ...store,
2132
+ hrefButton: this.configTemplateText()?.getHrefButton?.(store),
2133
+ classItem: item().classItem || this.configTemplateText()?.getClassItem?.(store),
2134
+ classInclude: store.classInclude || this.configTemplateText()?.getClassIncludePopover?.(store),
2135
+ buttonLeftConfig: this.configTemplateText()?.getConfigButtonLeft?.(store),
2136
+ classIconLeft: store.classIconLeft || this.configTemplateText()?.getClassIconLeft?.(store),
2137
+ hoverDanger: store.hoverDanger || this.configTemplateText()?.getConfigHoverDanger?.(store),
2138
+ avatarConfig: this.configTemplateText()?.getAvatarConfig?.(store),
2139
+ itemAlignStart: store.itemAlignStart || this.configTemplateText()?.getConfigAlignStart?.(store),
2140
+ };
2141
+ });
2142
+ itemByKeySearch.push(dataStore);
2143
+ }
2144
+ return;
2145
+ }
2146
+ const indexItemRemove = this.items().findIndex(item => item()[this.fieldKey()] === key);
2147
+ if (indexItemRemove > -1) {
2148
+ this.items.update(items => {
2149
+ items.splice(indexItemRemove, 1);
2150
+ return items;
2151
+ });
2152
+ }
2153
+ });
2154
+ const checkLoadItem = (preStateHasScroll, currentHasScroll) => {
2155
+ if (this.keysHiddenItem()?.length && preStateHasScroll && !currentHasScroll && (this.isSearchOnline())) {
2156
+ this.callApiByService(false);
2157
+ }
2158
+ };
2159
+ if (replace) {
2160
+ const items = convertObjectToSignal(itemByKeySearch)();
2161
+ this.items.set(items);
2162
+ this.config()?.sort?.(this.items());
2163
+ this.emitKeySelectedDefaultIfExistItem(this.items());
2164
+ this.autoSelectFirstItem(this.items());
2165
+ this.setHeightViewPort();
2166
+ this.loading.set(false);
2167
+ this.checkViewPortScroll(checkLoadItem);
2168
+ this.scrollToItemSelected();
2169
+ this.outLoading.emit(this.loading());
2170
+ this.outLoadItemsComplete.emit({ items: this.items(), paging: this.pagingStore() });
2171
+ return;
2172
+ }
2173
+ const itemsBySearch = convertObjectToSignal(itemByKeySearch)();
2174
+ this.items.update(items => [...items, ...itemsBySearch]);
2175
+ this.config()?.sort?.(this.items());
2176
+ this.setHeightViewPort();
2177
+ this.loading.set(false);
2178
+ this.checkViewPortScroll(checkLoadItem);
2179
+ this.scrollToItemSelected();
2180
+ this.outLoading.emit(this.loading());
2181
+ this.outLoadItemsComplete.emit({ items: this.items(), paging: this.pagingStore() });
2182
+ }
2183
+ scrollToItemSelected() {
2184
+ if (!this.configTemplateText()?.autoScrollToItemSelected) {
2185
+ return;
2186
+ }
2187
+ clearTimeout(this.timeAutoScrollItemSelected());
2188
+ this.timeAutoScrollItemSelected.set(setTimeout(() => {
2189
+ if (!this.keySelected()) {
2190
+ return;
2191
+ }
2192
+ const index = this.items().findIndex(item => item()[this.fieldKey()] === this.keySelected());
2193
+ if (index !== -1) {
2194
+ this.virtualScrollerComponent()?.scrollToIndex(index);
2195
+ }
2196
+ }));
2197
+ }
2198
+ autoSelectFirstItem(items) {
2199
+ if (this.autoSelectedFirstItemCallOutsideBefore() || this.keySelected() || !this.config()?.autoSelectFirstItem || !items || !items.length) {
2200
+ return;
2201
+ }
2202
+ this.handlerSelectItem('click', items[0](), undefined, true, false);
2203
+ }
2204
+ emitKeySelectedDefaultIfExistItem(items) {
2205
+ const item = items.find(store => store()[this.fieldKey()] === this.keySelected());
2206
+ if (item) {
2207
+ this.handlerSelectItem('click', item(), undefined, true, false);
2208
+ }
2209
+ }
2210
+ getLengthItem() {
2211
+ return this.items().length;
2212
+ }
2213
+ handlerImageError(event, item) {
2214
+ event.stopPropagation();
2215
+ item.specific_loadImgError = true;
2216
+ }
2217
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2218
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListTextComponent, isStandalone: true, selector: "libs_ui-components-list-templates_text", viewQueries: [{ propertyName: "virtualScrollerComponent", first: true, predicate: VirtualScrollerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (configTemplateText(); as configTemplateText) {\n <div class=\"relative h-full w-full\">\n @if (items() && items().length) {\n <div #elementScroll\n [style.height]=\"!configTemplateText.notUseVirtualScroll && heightViewPort() && (!config()?.ignoreShowDataWhenNotSearch || (config()?.ignoreShowDataWhenNotSearch && config()?.ignoreFixHeightShowDataWhenNotSearch)) ? heightViewPort()+'px':'100%'\"\n class=\"w-full\"\n LibsUiComponentsScrollOverlayDirective\n (outScrollBottom)=\"handlerScrollBottom()\">\n @if (!configTemplateText.notUseVirtualScroll) {\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n <ng-container *ngTemplateOutlet='listRef;context:{itemsView:scroll.viewPortItems}' />\n </virtual-scroller>\n }\n @if (configTemplateText.notUseVirtualScroll) {\n <ng-container *ngTemplateOutlet='listRef;context:{itemsView:items()}' />\n }\n </div>\n }\n @if ((!items() || !items().length) && (!config()?.ignoreShowDataWhenNotSearch || keySearch())) {\n <div [class]=\"'libs-ui-font-h5r text-[#9ca2ad] '+ (config()?.textNoDataClassInclude ?? 'py-[6px] px-[16px]')\">\n @if (!keySearch() && !loading()) {\n {{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n {{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}\n }\n @if (loading()) {\n &nbsp;\n }\n </div>\n }\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"loadingIconSize() || 'medium'\" />\n }\n </div>\n <ng-template #listRef\n let-itemsView='itemsView'>\n @for (item of itemsView; track item()[fieldKey()]) {\n <div #itemRef\n [class]=\"item().classItemWrapper || ''\">\n <div LibsUiComponentsListHighlightKeySearchDirective\n [isHighlight]=\"config()?.highlightTextSearchInResult\"\n [keySearch]=\"keySearch()\"\n [class]=\"'libs-ui-list-template-text-item libs-ui-font-h5r flex '+(item().classItem || '')\"\n [class.items-center]=\"!item().itemAlignStart\"\n [class.items-start]=\"item().itemAlignStart\"\n [class.libs-ui-bg-list-hover-danger]=\"!clickExactly() && item().hoverDanger\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly() && !item().hoverDanger\"\n [class.libs-ui-bg-list-active]=\"!clickExactly() && keySelected() === item()[fieldKey()]\"\n [class.!pl-[16px]]=\"paddingLeftItem()\"\n [class.bg-[#ffffff]]=\"clickExactly()\"\n [class.libs-ui-bg-list-hover-ffffff]=\"item().disable\"\n [class.cursor-default]=\"item().disable\"\n [class.!py-[2px]]=\"clickExactly()\"\n [class.!pr-[48px]]=\"keySelected() === item()[fieldKey()] && (!configTemplateText?.ignoreIconSelected || configTemplateText?.actionSort)&& !configTemplateText?.stylePaddingRightItemOther\"\n [ngClass]=\"{'pointer-events-none libs-ui-disable':loading() || disable() || ((item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) && !ignoreClassDisableDefaultWhenUseKeysDisableItem())}\"\n (click)=\"handlerClickRelative($event,item())\">\n @if (item().bullet; as bullet) {\n <span class=\"libs-ui-list-template-text-item-bullet flex flex-shrink-0\"\n [style.backgroundColor]=\"bullet().backgroundColor\"\n (click)=\"handlerSelectItem($event,item())\">\n </span>\n }\n @if (item().avatarConfig; as avatarConfig) {\n <libs_ui-components-avatar [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [classImageInclude]=\"avatarConfig.classImageInclude\"\n [size]='avatarConfig.size || 32'\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [textAvatar]=\"avatarConfig.textAvatar\"\n [classImageInclude]=\"avatarConfig.classImageInclude\" />\n }\n @if (configTemplateText.getImage || configTemplateText.fieldGetImage) {\n <img\n [src]=\"configTemplateText.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateText.getImageError ? configTemplateText.getImageError : configTemplateText.getImage):item()) | async) : item()[configTemplateText.fieldGetImage || '']\"\n [class]=\"'libs-ui-list-template-text-item-avatar ' + (configTemplateText.classIncludeImage ?? '')\"\n [class.w-[18px]]=\"configTemplateText.imgTypeIcon\"\n [class.h-[18px]]=\"configTemplateText.imgTypeIcon\"\n (error)=\"handlerImageError($event, item())\"\n (click)=\"handlerSelectItem($event,item())\" />\n }\n @if (item().buttonLeftConfig; as buttonLeft) {\n @if (item().hrefButton) {\n <a [class.w-full]=\"!buttonLeft.ignoreWidth100\"\n [href]=\"item().hrefButton\">\n <ng-container *ngTemplateOutlet=\"buttonLeftTemplate\" />\n </a>\n }\n @if (!item().hrefButton) {\n <div [class.w-full]=\"!buttonLeft.ignoreWidth100\">\n <ng-container *ngTemplateOutlet=\"buttonLeftTemplate\" />\n </div>\n }\n <ng-template #buttonLeftTemplate>\n <libs_ui-components-buttons-button class=\"w-full\"\n [type]=\"buttonLeft.type || 'button-link-primary'\"\n [label]=\"buttonLeft.label || ' '\"\n [zIndex]=\"buttonLeft.zIndex\"\n [disable]=\"buttonLeft.disable\"\n [classIconLeft]=\"buttonLeft.classIconLeft ? ((buttonLeft.classIconLeft || '')+' flex mr-[8px] text-[12px]') : ''\"\n [classInclude]=\"(buttonLeft.classInclude|| '')+' w-full'\"\n [classLabel]=\"(buttonLeft.classLabel ?? 'libs-ui-font-h4r')\"\n [ignoreStopPropagationEvent]=\"buttonLeft.ignoreStopPropagationEvent\"\n [styleIconLeft]=\"buttonLeft.styleIconLeft\"\n [styleButton]=\"buttonLeft.styleButton\"\n (outClick)=\"handlerSelectItem($event,item())\" />\n </ng-template>\n }\n @if (item().switchConfig) {\n <libs_ui-components-switch [active]=\"item().switchConfig.active\"\n (outSwitch)=\"handlerSelectItem('click',item())\" />\n }\n @if (item().classIconLeft) {\n <i [class]=\"item().classIconLeft + ' mr-[8px] text-[14px]'\"></i>\n }\n @if (!item().ignoreShowFieldLabel && !configTemplateText.rows) {\n <libs_ui-components-popover [type]=\"item().popoverLabel?.type || 'text'\"\n [elementRefCustom]=\"item().popoverLabel?.type === 'text'? undefined:itemRef\"\n [ignoreShowPopover]=\"item().popoverLabel?.ignoreShowPopover\"\n [config]=\"item().popoverLabel?.config || (configTemplateText?.configLabelPopover?.() || {})\"\n [innerHtml]=\"item().fieldLabel\"\n [classInclude]=\"item().classInclude\"\n (outEvent)=\"handlerSelectItem($event,item())\" />\n }\n @if (item().fieldPopover; as popover) {\n <libs_ui-components-popover class=\"{{ popover.classInclude || '' }}\"\n [config]=\"popover?.config\">\n @if (!popover.dataView) {\n <i class=\"libs-ui-icon-tooltip-outline\"></i>\n }\n @if (popover.dataView) {\n <div [innerHtml]=\"popover.dataView | translate\"></div>\n }\n </libs_ui-components-popover>\n }\n @if (configTemplateText?.rows) {\n <libs_ui-components-list-templates_rows class=\"w-full {{ configTemplateText.classRowsWrapper || configTemplateText.classRows || '' }}\"\n [item]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"keySelected()\"\n [configTemplate]=\"configTemplateText\"\n [zIndex]=\"zIndex()\"\n (outChangStageFlagMousePopover)=\"handlerChangStageFlagMouse($event)\"\n (outEvent)=\"handlerSelectItem($event.event,$event.item,$event.action)\" />\n }\n @if ((keySelected() === item()[fieldKey()] || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length) ? item()[fieldKey()] : undefined) && !configTemplateText.ignoreIconSelected && !configTemplateText.actionSort) {\n <i [class]=\"'libs-ui-icon-check '+(configTemplateText.classIncludeIconSelected || 'right-[12px]')\">\n </i>\n }\n @if (keySelected() === item()[fieldKey()] && configTemplateText.actionSort) {\n <div class=\"libs-ui-list-template-text-sort\">\n <libs_ui-components-buttons-sort-arrow [disable]=\"loading() || disable() || false\"\n [mode]=\"configTemplateText?.itemSort?.()?.mode || ''\"\n [fieldSort]=\"item()[fieldKey()]\"\n (outChange)=\"handlerSort($event)\" />\n </div>\n }\n </div>\n </div>\n }\n </ng-template>\n}\n", styles: [".libs-ui-list-template-text-item{padding:6px 16px 6px 1px;font-size:12px;line-height:18px;position:relative;cursor:pointer}.libs-ui-list-template-text-item>.libs-ui-icon-check,.libs-ui-list-template-text-item .libs-ui-list-template-text-sort{position:absolute;right:16px}.libs-ui-list-template-text-item>.libs-ui-icon-check:before,.libs-ui-list-template-text-item .libs-ui-list-template-text-sort:before{font-size:16px;color:var(--libs-ui-color-default, #226FF5)}.libs-ui-list-template-text-item-bullet{width:10px;height:10px;border-radius:50%;margin-right:8px;cursor:pointer}.libs-ui-list-template-text-item-avatar{width:24px;height:24px;border-radius:50%;margin-right:8px;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: VirtualScrollerModule }, { kind: "component", type: i1$1.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "enableUnequalChildrenSizes", "RTL", "useMarginInsteadOfTranslate", "modifyOverflowStyleOfParentScroll", "stripedTable", "scrollbarWidth", "scrollbarHeight", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight", "ssrViewportWidth", "ssrViewportHeight", "bufferAmount", "scrollAnimationTime", "resizeBypassRefreshThreshold", "scrollThrottlingTime", "scrollDebounceTime", "checkResizeInterval", "items", "compareItems", "horizontal", "parentScroll"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "component", type: LibsUiComponentsAvatarComponent, selector: "libs_ui-components-avatar", inputs: ["getLastTextAfterSpace", "typeShape", "classInclude", "size", "linkAvatar", "linkAvatarError", "idGenColor", "textAvatar", "classImageInclude"], outputs: ["outAvatarError"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "pipe", type: LibsUiCheckSelectedByKeyPipe, name: "LibsUiCheckSelectedByKeyPipe" }, { kind: "component", type: LibsUiComponentsSwitchComponent, selector: "libs_ui-components-switch", inputs: ["size", "disable", "active"], outputs: ["activeChange", "outSwitch"] }, { kind: "component", type: LibsUiComponentsButtonsSortArrowComponent, selector: "libs_ui-components-buttons-sort-arrow", inputs: ["size", "mode", "fieldSort", "disable", "ignorePopoverContent", "popoverContentAsc", "popoverContentDesc", "defaultMode", "zIndex"], outputs: ["modeChange", "outChange"] }, { kind: "directive", type: LibsUiComponentsListHighlightKeySearchDirective, selector: "[LibsUiComponentsListHighlightKeySearchDirective]", inputs: ["isHighlight", "keySearch", "classHighlight"] }, { kind: "component", type: LibsUiComponentsListRowsComponent, selector: "libs_ui-components-list-templates_rows", inputs: ["configTemplate", "item", "keySelected", "fieldKey", "zIndex"], outputs: ["outChangStageFlagMousePopover", "outEvent"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2219
+ }
2220
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListTextComponent, decorators: [{
2221
+ type: Component,
2222
+ args: [{ selector: 'libs_ui-components-list-templates_text', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
2223
+ VirtualScrollerModule, NgTemplateOutlet, TranslateModule, NgClass, AsyncPipe,
2224
+ LibsUiComponentsSpinnerComponent,
2225
+ LibsUiComponentsAvatarComponent,
2226
+ LibsUiComponentsButtonsButtonComponent,
2227
+ LibsUiComponentsPopoverComponent,
2228
+ LibsUiComponentsScrollOverlayDirective,
2229
+ LibsUiCheckSelectedByKeyPipe,
2230
+ LibsUiComponentsSwitchComponent,
2231
+ LibsUiComponentsButtonsSortArrowComponent,
2232
+ LibsUiComponentsListHighlightKeySearchDirective,
2233
+ LibsUiComponentsListRowsComponent,
2234
+ LibsUiPipesCallFunctionInTemplatePipe
2235
+ ], template: "@if (configTemplateText(); as configTemplateText) {\n <div class=\"relative h-full w-full\">\n @if (items() && items().length) {\n <div #elementScroll\n [style.height]=\"!configTemplateText.notUseVirtualScroll && heightViewPort() && (!config()?.ignoreShowDataWhenNotSearch || (config()?.ignoreShowDataWhenNotSearch && config()?.ignoreFixHeightShowDataWhenNotSearch)) ? heightViewPort()+'px':'100%'\"\n class=\"w-full\"\n LibsUiComponentsScrollOverlayDirective\n (outScrollBottom)=\"handlerScrollBottom()\">\n @if (!configTemplateText.notUseVirtualScroll) {\n <virtual-scroller #scroll\n [parentScroll]=\"elementScroll\"\n [items]=\"items()\"\n class=\"h-full\">\n <ng-container *ngTemplateOutlet='listRef;context:{itemsView:scroll.viewPortItems}' />\n </virtual-scroller>\n }\n @if (configTemplateText.notUseVirtualScroll) {\n <ng-container *ngTemplateOutlet='listRef;context:{itemsView:items()}' />\n }\n </div>\n }\n @if ((!items() || !items().length) && (!config()?.ignoreShowDataWhenNotSearch || keySearch())) {\n <div [class]=\"'libs-ui-font-h5r text-[#9ca2ad] '+ (config()?.textNoDataClassInclude ?? 'py-[6px] px-[16px]')\">\n @if (!keySearch() && !loading()) {\n {{ (config()?.textNoData ?? 'i18n_have_no_selection') | translate }}\n }\n @if (templateRefSearchNoData() && keySearch() && !loading()) {\n <ng-container *ngTemplateOutlet=\"templateRefSearchNoData() || null;context:{keySearch:keySearch()}\" />\n }\n @if (!templateRefSearchNoData() && keySearch() && !loading()) {\n {{ (config()?.textSearchNoData ?? 'i18n_no_result') | translate }}\n }\n @if (loading()) {\n &nbsp;\n }\n </div>\n }\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"loadingIconSize() || 'medium'\" />\n }\n </div>\n <ng-template #listRef\n let-itemsView='itemsView'>\n @for (item of itemsView; track item()[fieldKey()]) {\n <div #itemRef\n [class]=\"item().classItemWrapper || ''\">\n <div LibsUiComponentsListHighlightKeySearchDirective\n [isHighlight]=\"config()?.highlightTextSearchInResult\"\n [keySearch]=\"keySearch()\"\n [class]=\"'libs-ui-list-template-text-item libs-ui-font-h5r flex '+(item().classItem || '')\"\n [class.items-center]=\"!item().itemAlignStart\"\n [class.items-start]=\"item().itemAlignStart\"\n [class.libs-ui-bg-list-hover-danger]=\"!clickExactly() && item().hoverDanger\"\n [class.libs-ui-bg-list-hover]=\"!clickExactly() && !item().hoverDanger\"\n [class.libs-ui-bg-list-active]=\"!clickExactly() && keySelected() === item()[fieldKey()]\"\n [class.!pl-[16px]]=\"paddingLeftItem()\"\n [class.bg-[#ffffff]]=\"clickExactly()\"\n [class.libs-ui-bg-list-hover-ffffff]=\"item().disable\"\n [class.cursor-default]=\"item().disable\"\n [class.!py-[2px]]=\"clickExactly()\"\n [class.!pr-[48px]]=\"keySelected() === item()[fieldKey()] && (!configTemplateText?.ignoreIconSelected || configTemplateText?.actionSort)&& !configTemplateText?.stylePaddingRightItemOther\"\n [ngClass]=\"{'pointer-events-none libs-ui-disable':loading() || disable() || ((item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:keysDisableItem():keysDisableItem()?.length) && !ignoreClassDisableDefaultWhenUseKeysDisableItem())}\"\n (click)=\"handlerClickRelative($event,item())\">\n @if (item().bullet; as bullet) {\n <span class=\"libs-ui-list-template-text-item-bullet flex flex-shrink-0\"\n [style.backgroundColor]=\"bullet().backgroundColor\"\n (click)=\"handlerSelectItem($event,item())\">\n </span>\n }\n @if (item().avatarConfig; as avatarConfig) {\n <libs_ui-components-avatar [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [classImageInclude]=\"avatarConfig.classImageInclude\"\n [size]='avatarConfig.size || 32'\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [textAvatar]=\"avatarConfig.textAvatar\"\n [classImageInclude]=\"avatarConfig.classImageInclude\" />\n }\n @if (configTemplateText.getImage || configTemplateText.fieldGetImage) {\n <img\n [src]=\"configTemplateText.getImage ? (('avatar' | LibsUiPipesCallFunctionInTemplatePipe:(item().specific_loadImgError && configTemplateText.getImageError ? configTemplateText.getImageError : configTemplateText.getImage):item()) | async) : item()[configTemplateText.fieldGetImage || '']\"\n [class]=\"'libs-ui-list-template-text-item-avatar ' + (configTemplateText.classIncludeImage ?? '')\"\n [class.w-[18px]]=\"configTemplateText.imgTypeIcon\"\n [class.h-[18px]]=\"configTemplateText.imgTypeIcon\"\n (error)=\"handlerImageError($event, item())\"\n (click)=\"handlerSelectItem($event,item())\" />\n }\n @if (item().buttonLeftConfig; as buttonLeft) {\n @if (item().hrefButton) {\n <a [class.w-full]=\"!buttonLeft.ignoreWidth100\"\n [href]=\"item().hrefButton\">\n <ng-container *ngTemplateOutlet=\"buttonLeftTemplate\" />\n </a>\n }\n @if (!item().hrefButton) {\n <div [class.w-full]=\"!buttonLeft.ignoreWidth100\">\n <ng-container *ngTemplateOutlet=\"buttonLeftTemplate\" />\n </div>\n }\n <ng-template #buttonLeftTemplate>\n <libs_ui-components-buttons-button class=\"w-full\"\n [type]=\"buttonLeft.type || 'button-link-primary'\"\n [label]=\"buttonLeft.label || ' '\"\n [zIndex]=\"buttonLeft.zIndex\"\n [disable]=\"buttonLeft.disable\"\n [classIconLeft]=\"buttonLeft.classIconLeft ? ((buttonLeft.classIconLeft || '')+' flex mr-[8px] text-[12px]') : ''\"\n [classInclude]=\"(buttonLeft.classInclude|| '')+' w-full'\"\n [classLabel]=\"(buttonLeft.classLabel ?? 'libs-ui-font-h4r')\"\n [ignoreStopPropagationEvent]=\"buttonLeft.ignoreStopPropagationEvent\"\n [styleIconLeft]=\"buttonLeft.styleIconLeft\"\n [styleButton]=\"buttonLeft.styleButton\"\n (outClick)=\"handlerSelectItem($event,item())\" />\n </ng-template>\n }\n @if (item().switchConfig) {\n <libs_ui-components-switch [active]=\"item().switchConfig.active\"\n (outSwitch)=\"handlerSelectItem('click',item())\" />\n }\n @if (item().classIconLeft) {\n <i [class]=\"item().classIconLeft + ' mr-[8px] text-[14px]'\"></i>\n }\n @if (!item().ignoreShowFieldLabel && !configTemplateText.rows) {\n <libs_ui-components-popover [type]=\"item().popoverLabel?.type || 'text'\"\n [elementRefCustom]=\"item().popoverLabel?.type === 'text'? undefined:itemRef\"\n [ignoreShowPopover]=\"item().popoverLabel?.ignoreShowPopover\"\n [config]=\"item().popoverLabel?.config || (configTemplateText?.configLabelPopover?.() || {})\"\n [innerHtml]=\"item().fieldLabel\"\n [classInclude]=\"item().classInclude\"\n (outEvent)=\"handlerSelectItem($event,item())\" />\n }\n @if (item().fieldPopover; as popover) {\n <libs_ui-components-popover class=\"{{ popover.classInclude || '' }}\"\n [config]=\"popover?.config\">\n @if (!popover.dataView) {\n <i class=\"libs-ui-icon-tooltip-outline\"></i>\n }\n @if (popover.dataView) {\n <div [innerHtml]=\"popover.dataView | translate\"></div>\n }\n </libs_ui-components-popover>\n }\n @if (configTemplateText?.rows) {\n <libs_ui-components-list-templates_rows class=\"w-full {{ configTemplateText.classRowsWrapper || configTemplateText.classRows || '' }}\"\n [item]=\"item()\"\n [fieldKey]=\"fieldKey()\"\n [keySelected]=\"keySelected()\"\n [configTemplate]=\"configTemplateText\"\n [zIndex]=\"zIndex()\"\n (outChangStageFlagMousePopover)=\"handlerChangStageFlagMouse($event)\"\n (outEvent)=\"handlerSelectItem($event.event,$event.item,$event.action)\" />\n }\n @if ((keySelected() === item()[fieldKey()] || (item()[fieldKey()] | LibsUiCheckSelectedByKeyPipe:multiKeySelected():multiKeySelected()?.length) ? item()[fieldKey()] : undefined) && !configTemplateText.ignoreIconSelected && !configTemplateText.actionSort) {\n <i [class]=\"'libs-ui-icon-check '+(configTemplateText.classIncludeIconSelected || 'right-[12px]')\">\n </i>\n }\n @if (keySelected() === item()[fieldKey()] && configTemplateText.actionSort) {\n <div class=\"libs-ui-list-template-text-sort\">\n <libs_ui-components-buttons-sort-arrow [disable]=\"loading() || disable() || false\"\n [mode]=\"configTemplateText?.itemSort?.()?.mode || ''\"\n [fieldSort]=\"item()[fieldKey()]\"\n (outChange)=\"handlerSort($event)\" />\n </div>\n }\n </div>\n </div>\n }\n </ng-template>\n}\n", styles: [".libs-ui-list-template-text-item{padding:6px 16px 6px 1px;font-size:12px;line-height:18px;position:relative;cursor:pointer}.libs-ui-list-template-text-item>.libs-ui-icon-check,.libs-ui-list-template-text-item .libs-ui-list-template-text-sort{position:absolute;right:16px}.libs-ui-list-template-text-item>.libs-ui-icon-check:before,.libs-ui-list-template-text-item .libs-ui-list-template-text-sort:before{font-size:16px;color:var(--libs-ui-color-default, #226FF5)}.libs-ui-list-template-text-item-bullet{width:10px;height:10px;border-radius:50%;margin-right:8px;cursor:pointer}.libs-ui-list-template-text-item-avatar{width:24px;height:24px;border-radius:50%;margin-right:8px;cursor:pointer}\n"] }]
2236
+ }] });
2237
+
2238
+ const getComponentByType = (typeTemplate) => {
2239
+ switch (typeTemplate) {
2240
+ case 'checkbox':
2241
+ return LibsUiComponentsListCheckboxComponent;
2242
+ case 'group':
2243
+ return LibsUiComponentsListGroupComponent;
2244
+ case 'radio':
2245
+ return LibsUiComponentsListRadioComponent;
2246
+ case 'text':
2247
+ return LibsUiComponentsListTextComponent;
2248
+ case 'tag':
2249
+ return LibsUiComponentsListTagComponent;
2250
+ }
2251
+ };
2252
+ const getFieldKeyByType = (config, fieldKeyDefault) => {
2253
+ if (!config) {
2254
+ return fieldKeyDefault;
2255
+ }
2256
+ switch (config.type) {
2257
+ case 'checkbox':
2258
+ return config.configTemplateCheckbox?.()?.fieldKey || fieldKeyDefault;
2259
+ case 'group':
2260
+ return config.configTemplateGroup?.()?.fieldKey || fieldKeyDefault;
2261
+ case 'radio':
2262
+ return config.configTemplateRadio?.()?.fieldKey || fieldKeyDefault;
2263
+ case 'text':
2264
+ return config.configTemplateText?.()?.fieldKey || fieldKeyDefault;
2265
+ case 'tag':
2266
+ return config.configTemplateTag?.()?.fieldKey || fieldKeyDefault;
2267
+ }
2268
+ };
2269
+ const initConfig = (config) => {
2270
+ if (!config) {
2271
+ return;
2272
+ }
2273
+ const defaultConfig = {
2274
+ fieldKey: 'id',
2275
+ getValue: (item) => {
2276
+ if (!item) {
2277
+ return ' ';
2278
+ }
2279
+ return item.label || item.name || ' ';
2280
+ }
2281
+ };
2282
+ switch (config.type) {
2283
+ case 'checkbox':
2284
+ if (!config.configTemplateCheckbox?.()) {
2285
+ config.configTemplateCheckbox?.set(defaultConfig);
2286
+ }
2287
+ break;
2288
+ case 'group':
2289
+ break;
2290
+ case 'radio':
2291
+ if (!config.configTemplateRadio?.()) {
2292
+ config.configTemplateRadio?.set(defaultConfig);
2293
+ }
2294
+ break;
2295
+ case 'text':
2296
+ if (!config.configTemplateText?.()) {
2297
+ config.configTemplateText?.set(defaultConfig);
2298
+ }
2299
+ break;
2300
+ }
2301
+ };
2302
+
2303
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2304
+ class LibsUiComponentsListComponent {
2305
+ /* PROPERTY */
2306
+ ERROR_MESSAGE_EMPTY_VALID = ERROR_MESSAGE_EMPTY_VALID;
2307
+ disableButtonUnSelectOption = signal(true);
2308
+ isErrorRequired = signal(false);
2309
+ loading = signal(false);
2310
+ keySearchStore = signal(undefined);
2311
+ onDestroy = new Subject();
2312
+ onSearch = new Subject();
2313
+ onRefresh = new Subject();
2314
+ onSetHiddenItemByKey = new Subject();
2315
+ onItemChangeUnSelect = new Subject();
2316
+ onUpdateMultiKeySelectedGroup = new Subject();
2317
+ onRemoveItems = new Subject();
2318
+ onUpdateData = new Subject();
2319
+ cleanUpEffect;
2320
+ componentRef;
2321
+ configData = signal({
2322
+ type: 'text',
2323
+ configTemplateText: signal({
2324
+ fieldKey: 'id',
2325
+ getValue: (item) => {
2326
+ return item.label || item.name;
2327
+ }
2328
+ })
2329
+ });
2330
+ groupMultiKeySelected = signal([]);
2331
+ functionControlInputSearch = signal(undefined);
2332
+ /* INPUT */
2333
+ hiddenInputSearch = input(false, { transform: value => value ?? false });
2334
+ dropdownTabKeyActive = input();
2335
+ keySearch = input();
2336
+ itemChangeUnSelect = input();
2337
+ paddingLeftItem = input();
2338
+ config = input(this.configData(), { transform: (value) => value ?? this.configData() });
2339
+ autoSelectedFirstItemCallOutsideBefore = input(false);
2340
+ isSearchOnline = input();
2341
+ disable = input();
2342
+ disableLabel = input();
2343
+ labelConfig = input();
2344
+ searchConfig = input({}, { transform: value => value || {} });
2345
+ searchPadding = input();
2346
+ dividerClassInclude = input();
2347
+ hasDivider = input(true);
2348
+ buttonsOther = input(undefined);
2349
+ hasButtonUnSelectOption = input();
2350
+ clickExactly = input();
2351
+ backgroundListCustom = input('bg-[#ffffff]', { transform: value => value ?? 'bg-[#ffffff]' });
2352
+ maxItemShow = input();
2353
+ keySelected = input();
2354
+ multiKeySelected = input(undefined); // lưu ý khi sử dụng listview
2355
+ keysDisableItem = input(undefined); // không dùng giá trị này kết hợp với template checkbox có config chứa configCheckboxCheckAll
2356
+ keysHiddenItem = input(undefined); // không dùng giá trị này kết hợp với template checkbox có config chứa configCheckboxCheckAll
2357
+ focusInputSearch = input();
2358
+ skipFocusInputWhenKeySearchStoreUndefined = input();
2359
+ functionGetItemsAutoAddList = input(undefined);
2360
+ validRequired = input(undefined);
2361
+ showValidateBottom = input();
2362
+ zIndex = input();
2363
+ loadingIconSize = input(undefined);
2364
+ templateRefSearchNoData = input(undefined);
2365
+ resetKeyWhenSelectAllKeyDropdown = input();
2366
+ ignoreClassDisableDefaultWhenUseKeysDisableItem = input(); // bỏ chế độ disable item trên html để disable từng phần trong rows
2367
+ /* OUTPUT */
2368
+ outSelectKey = output(); // sử dụng cho type chọn 1
2369
+ outSelectMultiKey = output(); // sử dụng cho type cho phép chọn nhiều.
2370
+ outUnSelectMultiKey = output(); // sử dụng cho type cho phép chọn nhiều.
2371
+ outClickButtonOther = output();
2372
+ outFieldKey = output();
2373
+ outChangeView = output();
2374
+ outLoading = output();
2375
+ outFunctionsControl = output();
2376
+ outChangStageFlagMousePopover = output();
2377
+ outLoadItemsComplete = output();
2378
+ /* VIEW CHILD */
2379
+ listViewElementRef = viewChild('listViewContainer');
2380
+ contentElementRef = viewChild('contentContainer');
2381
+ /* INJECT */
2382
+ dynamicComponentService = inject(LibsUiDynamicComponentService);
2383
+ constructor() {
2384
+ this.cleanUpEffect = effect(() => {
2385
+ const value = this.keySearch();
2386
+ untracked(() => {
2387
+ if (this.keySearchStore() === this.keySearch()) {
2388
+ return;
2389
+ }
2390
+ this.keySearchStore.set(value);
2391
+ this.onSearch.next(value);
2392
+ });
2393
+ });
2394
+ effect(() => {
2395
+ const itemChangeUnSelect = this.itemChangeUnSelect();
2396
+ const keysDisableItem = this.keysDisableItem();
2397
+ const keysHiddenItem = this.keysHiddenItem();
2398
+ const disable = this.disable();
2399
+ untracked(() => {
2400
+ const keySelected = this.keySelected();
2401
+ const multiKeySelected = this.multiKeySelected();
2402
+ this.onItemChangeUnSelect.next(itemChangeUnSelect);
2403
+ if (!this.componentRef) {
2404
+ return;
2405
+ }
2406
+ if (!isEmpty(keysDisableItem)) {
2407
+ this.componentRef.setInput('keysDisableItem', keysDisableItem);
2408
+ }
2409
+ if (!isEmpty(keysHiddenItem)) {
2410
+ this.onSetHiddenItemByKey.next(keysHiddenItem || []);
2411
+ }
2412
+ if (!isEmpty(disable)) {
2413
+ this.componentRef.setInput('disable', disable);
2414
+ }
2415
+ if (!isEmpty(keySelected)) {
2416
+ this.componentRef.setInput('keySelected', keySelected);
2417
+ }
2418
+ if (this.configData()?.type === 'group' && !isEmpty(multiKeySelected)) {
2419
+ this.componentRef.setInput('multiKeySelected', multiKeySelected);
2420
+ this.onUpdateMultiKeySelectedGroup.next();
2421
+ }
2422
+ });
2423
+ });
2424
+ effect(this.refresh.bind(this));
2425
+ }
2426
+ ngOnInit() {
2427
+ this.outFunctionsControl.emit({
2428
+ checkIsValid: this.checkIsValid.bind(this),
2429
+ refresh: this.refresh.bind(this),
2430
+ resetKeySelected: this.handlerRemoveKeySelected.bind(this),
2431
+ getRectListView: async () => this.listViewElementRef()?.nativeElement.getBoundingClientRect(),
2432
+ removeItems: async (keys) => this.onRemoveItems.next(keys),
2433
+ updateData: async (data) => this.onUpdateData.next(data)
2434
+ });
2435
+ const config = this.config();
2436
+ if (config) {
2437
+ this.configData.set(this.cloneConfig(config));
2438
+ }
2439
+ initConfig(this.configData());
2440
+ const compClass = getComponentByType(this.configData().type);
2441
+ this.componentRef = this.dynamicComponentService.resolveComponentFactory(compClass);
2442
+ timer(0).pipe(takeUntil$1(this.onDestroy)).subscribe(() => {
2443
+ this.dynamicComponentService.addToElement(this.componentRef, this.contentElementRef()?.nativeElement);
2444
+ });
2445
+ this.componentRef.setInput('onSetHiddenItemByKey', this.onSetHiddenItemByKey);
2446
+ this.componentRef.setInput('config', this.configData());
2447
+ if (this.searchConfig()) {
2448
+ this.componentRef.setInput('searchConfig', this.searchConfig());
2449
+ }
2450
+ this.componentRef.setInput('onSearch', this.onSearch);
2451
+ this.componentRef.setInput('onRefresh', this.onRefresh);
2452
+ this.componentRef.setInput('onUpdateData', this.onUpdateData);
2453
+ this.componentRef.setInput('keySearch', this.keySearchStore() ?? '');
2454
+ this.componentRef.setInput('dropdownTabKeyActive', this.dropdownTabKeyActive());
2455
+ this.componentRef.setInput('clickExactly', this.clickExactly() || false);
2456
+ this.componentRef.setInput('disable', this.disable());
2457
+ this.componentRef.setInput('autoSelectedFirstItemCallOutsideBefore', this.autoSelectedFirstItemCallOutsideBefore());
2458
+ this.componentRef.setInput('paddingLeftItem', this.paddingLeftItem());
2459
+ this.componentRef.setInput('resetKeyWhenSelectAllKeyDropdown', this.resetKeyWhenSelectAllKeyDropdown());
2460
+ this.componentRef.setInput('ignoreClassDisableDefaultWhenUseKeysDisableItem', this.ignoreClassDisableDefaultWhenUseKeysDisableItem());
2461
+ this.componentRef.setInput('functionGetItemsAutoAddList', this.functionGetItemsAutoAddList());
2462
+ if (this.maxItemShow()) {
2463
+ this.componentRef.setInput('maxItemShow', this.maxItemShow());
2464
+ }
2465
+ this.componentRef.setInput('keySelected', this.keySelected());
2466
+ if (this.multiKeySelected()) {
2467
+ this.componentRef.setInput('multiKeySelected', this.multiKeySelected());
2468
+ }
2469
+ this.componentRef.setInput('keysDisableItem', this.keysDisableItem() || []);
2470
+ this.componentRef.setInput('keysHiddenItem', this.keysHiddenItem() || []);
2471
+ if (!isNil(this.keySelected()) || this.multiKeySelected()?.length) {
2472
+ this.disableButtonUnSelectOption.set(false);
2473
+ }
2474
+ this.componentRef.setInput('onItemChangeUnSelect', this.onItemChangeUnSelect);
2475
+ this.componentRef.setInput('onUpdateMultiKeySelectedGroup', this.onUpdateMultiKeySelectedGroup);
2476
+ this.componentRef.setInput('onRemoveItems', this.onRemoveItems);
2477
+ this.componentRef.setInput('zIndex', this.zIndex());
2478
+ this.componentRef.setInput('isSearchOnline', this.isSearchOnline());
2479
+ this.componentRef.setInput('disableLabel', this.disableLabel() || false);
2480
+ this.componentRef.setInput('loadingIconSize', this.loadingIconSize());
2481
+ this.componentRef.setInput('templateRefSearchNoData', this.templateRefSearchNoData());
2482
+ let keySearch = '';
2483
+ const instance = this.componentRef.instance;
2484
+ instance.outChangeView.subscribe(data => {
2485
+ this.outChangeView.emit(data);
2486
+ if (this.skipFocusInputWhenKeySearchStoreUndefined() && isNil(this.keySearchStore())) {
2487
+ return;
2488
+ }
2489
+ if (this.focusInputSearch() && this.keySearchStore() !== keySearch) {
2490
+ keySearch = this.keySearchStore() || '';
2491
+ this.functionControlInputSearch()?.focus();
2492
+ }
2493
+ });
2494
+ instance.outSelectKey.subscribe(data => {
2495
+ this.disableButtonUnSelectOption.set(false);
2496
+ this.outSelectKey.emit(data);
2497
+ this.checkIsValid();
2498
+ });
2499
+ instance.outFieldKey.subscribe((fieldKey) => {
2500
+ this.outFieldKey.emit(fieldKey);
2501
+ });
2502
+ instance.outLoading.subscribe((loading) => {
2503
+ this.loading.set(loading);
2504
+ this.outLoading.emit(loading);
2505
+ });
2506
+ instance.outLoadItemsComplete.subscribe((event) => {
2507
+ this.outLoadItemsComplete.emit(event);
2508
+ });
2509
+ if (this.config() && this.config()?.configTemplateText && this.config()?.configTemplateText?.()?.actionSort) {
2510
+ instance.outSortSingleSelect.subscribe(itemSort => {
2511
+ const config = this.config();
2512
+ if (config && config.configTemplateText && config.configTemplateText()?.actionSort) {
2513
+ config.configTemplateText()?.itemSort?.set(itemSort);
2514
+ config.configTemplateText()?.actionSort?.(itemSort);
2515
+ }
2516
+ });
2517
+ }
2518
+ instance.outChangStageFlagMousePopover.subscribe((flag) => {
2519
+ this.outChangStageFlagMousePopover.emit(flag);
2520
+ });
2521
+ const type = this.configData()?.type;
2522
+ if (type === 'text' || type === 'radio') {
2523
+ return;
2524
+ }
2525
+ instance.outSelectMultiKey.subscribe(data => {
2526
+ this.disableButtonUnSelectOption.set(false);
2527
+ if (type === 'group') {
2528
+ this.groupMultiKeySelected.set(data.keys);
2529
+ }
2530
+ this.outSelectMultiKey.emit(data);
2531
+ this.checkIsValid();
2532
+ });
2533
+ }
2534
+ /* FUNCTIONS */
2535
+ handlerSearch(keySearch) {
2536
+ this.keySearchStore.set(keySearch);
2537
+ this.onSearch.next(keySearch);
2538
+ }
2539
+ async handlerRemoveKeySelected() {
2540
+ if (!this.componentRef) {
2541
+ return;
2542
+ }
2543
+ this.outSelectKey.emit(undefined);
2544
+ this.outSelectMultiKey.emit(undefined);
2545
+ this.componentRef.setInput('keySelected', '');
2546
+ this.componentRef.setInput('multiKeySelected', undefined);
2547
+ this.disableButtonUnSelectOption.set(true);
2548
+ await this.checkIsValid();
2549
+ }
2550
+ handlerClickButtonOther(button) {
2551
+ this.outClickButtonOther.emit(button);
2552
+ }
2553
+ handlerFunctionControlInputSearch(event) {
2554
+ this.functionControlInputSearch.set(event);
2555
+ }
2556
+ async checkIsValid() {
2557
+ if (!this.validRequired || !this.config()?.type || !this.componentRef?.instance) {
2558
+ this.isErrorRequired.set(false);
2559
+ return true;
2560
+ }
2561
+ const type = this.config()?.type;
2562
+ let hasKey = !isEmpty(this.componentRef.instance.multiKeySelected);
2563
+ if (type === 'group') {
2564
+ hasKey = !isEmpty(this.groupMultiKeySelected);
2565
+ }
2566
+ if (type === 'text' || type === 'radio') {
2567
+ hasKey = !isNil(this.componentRef.instance.keySelected);
2568
+ }
2569
+ this.isErrorRequired.set(!hasKey);
2570
+ return hasKey;
2571
+ }
2572
+ async refresh() {
2573
+ const config = this.config();
2574
+ if (!config) {
2575
+ return;
2576
+ }
2577
+ this.dropdownTabKeyActive();
2578
+ untracked(() => {
2579
+ this.configData.set(this.cloneConfig(config));
2580
+ this.onRefresh.next();
2581
+ });
2582
+ }
2583
+ cloneConfig(configInput) {
2584
+ if (!configInput) {
2585
+ return {};
2586
+ }
2587
+ const serviceOther = configInput.httpRequestData?.()?.serviceOther;
2588
+ const serviceOtherRequestAllIdSelectOrUnSelect = configInput.configTemplateCheckbox?.()?.httpRequestAllIdSelectOrUnSelect?.()?.serviceOther;
2589
+ if (serviceOther) {
2590
+ configInput.httpRequestData?.update(current => {
2591
+ delete current.serviceOther;
2592
+ return current;
2593
+ });
2594
+ }
2595
+ if (serviceOtherRequestAllIdSelectOrUnSelect) {
2596
+ configInput.configTemplateCheckbox?.()?.httpRequestAllIdSelectOrUnSelect?.update(current => {
2597
+ delete current.serviceOther;
2598
+ return current;
2599
+ });
2600
+ }
2601
+ const config = cloneDeep(configInput);
2602
+ if (serviceOther && config.httpRequestData) {
2603
+ config.httpRequestData.update(current => {
2604
+ current.serviceOther = serviceOther;
2605
+ return current;
2606
+ });
2607
+ }
2608
+ if (serviceOtherRequestAllIdSelectOrUnSelect && config.configTemplateCheckbox) {
2609
+ config.configTemplateCheckbox?.()?.httpRequestAllIdSelectOrUnSelect?.update(current => {
2610
+ current.serviceOther = serviceOther;
2611
+ return current;
2612
+ });
2613
+ }
2614
+ return config;
2615
+ }
2616
+ ngOnDestroy() {
2617
+ this.cleanUpEffect.destroy();
2618
+ this.outLoading.emit(false);
2619
+ this.dynamicComponentService.remove(this.componentRef);
2620
+ this.onRefresh.complete();
2621
+ this.onSearch.complete();
2622
+ this.onSetHiddenItemByKey.complete();
2623
+ this.onUpdateMultiKeySelectedGroup.complete();
2624
+ this.onDestroy.next();
2625
+ this.onDestroy.complete();
2626
+ }
2627
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2628
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsListComponent, isStandalone: true, selector: "libs_ui-components-list", inputs: { hiddenInputSearch: { classPropertyName: "hiddenInputSearch", publicName: "hiddenInputSearch", isSignal: true, isRequired: false, transformFunction: null }, dropdownTabKeyActive: { classPropertyName: "dropdownTabKeyActive", publicName: "dropdownTabKeyActive", isSignal: true, isRequired: false, transformFunction: null }, keySearch: { classPropertyName: "keySearch", publicName: "keySearch", isSignal: true, isRequired: false, transformFunction: null }, itemChangeUnSelect: { classPropertyName: "itemChangeUnSelect", publicName: "itemChangeUnSelect", isSignal: true, isRequired: false, transformFunction: null }, paddingLeftItem: { classPropertyName: "paddingLeftItem", publicName: "paddingLeftItem", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, autoSelectedFirstItemCallOutsideBefore: { classPropertyName: "autoSelectedFirstItemCallOutsideBefore", publicName: "autoSelectedFirstItemCallOutsideBefore", isSignal: true, isRequired: false, transformFunction: null }, isSearchOnline: { classPropertyName: "isSearchOnline", publicName: "isSearchOnline", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, disableLabel: { classPropertyName: "disableLabel", publicName: "disableLabel", isSignal: true, isRequired: false, transformFunction: null }, labelConfig: { classPropertyName: "labelConfig", publicName: "labelConfig", isSignal: true, isRequired: false, transformFunction: null }, searchConfig: { classPropertyName: "searchConfig", publicName: "searchConfig", isSignal: true, isRequired: false, transformFunction: null }, searchPadding: { classPropertyName: "searchPadding", publicName: "searchPadding", isSignal: true, isRequired: false, transformFunction: null }, dividerClassInclude: { classPropertyName: "dividerClassInclude", publicName: "dividerClassInclude", isSignal: true, isRequired: false, transformFunction: null }, hasDivider: { classPropertyName: "hasDivider", publicName: "hasDivider", isSignal: true, isRequired: false, transformFunction: null }, buttonsOther: { classPropertyName: "buttonsOther", publicName: "buttonsOther", isSignal: true, isRequired: false, transformFunction: null }, hasButtonUnSelectOption: { classPropertyName: "hasButtonUnSelectOption", publicName: "hasButtonUnSelectOption", isSignal: true, isRequired: false, transformFunction: null }, clickExactly: { classPropertyName: "clickExactly", publicName: "clickExactly", isSignal: true, isRequired: false, transformFunction: null }, backgroundListCustom: { classPropertyName: "backgroundListCustom", publicName: "backgroundListCustom", isSignal: true, isRequired: false, transformFunction: null }, maxItemShow: { classPropertyName: "maxItemShow", publicName: "maxItemShow", isSignal: true, isRequired: false, transformFunction: null }, keySelected: { classPropertyName: "keySelected", publicName: "keySelected", isSignal: true, isRequired: false, transformFunction: null }, multiKeySelected: { classPropertyName: "multiKeySelected", publicName: "multiKeySelected", isSignal: true, isRequired: false, transformFunction: null }, keysDisableItem: { classPropertyName: "keysDisableItem", publicName: "keysDisableItem", isSignal: true, isRequired: false, transformFunction: null }, keysHiddenItem: { classPropertyName: "keysHiddenItem", publicName: "keysHiddenItem", isSignal: true, isRequired: false, transformFunction: null }, focusInputSearch: { classPropertyName: "focusInputSearch", publicName: "focusInputSearch", isSignal: true, isRequired: false, transformFunction: null }, skipFocusInputWhenKeySearchStoreUndefined: { classPropertyName: "skipFocusInputWhenKeySearchStoreUndefined", publicName: "skipFocusInputWhenKeySearchStoreUndefined", isSignal: true, isRequired: false, transformFunction: null }, functionGetItemsAutoAddList: { classPropertyName: "functionGetItemsAutoAddList", publicName: "functionGetItemsAutoAddList", isSignal: true, isRequired: false, transformFunction: null }, validRequired: { classPropertyName: "validRequired", publicName: "validRequired", isSignal: true, isRequired: false, transformFunction: null }, showValidateBottom: { classPropertyName: "showValidateBottom", publicName: "showValidateBottom", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, loadingIconSize: { classPropertyName: "loadingIconSize", publicName: "loadingIconSize", isSignal: true, isRequired: false, transformFunction: null }, templateRefSearchNoData: { classPropertyName: "templateRefSearchNoData", publicName: "templateRefSearchNoData", isSignal: true, isRequired: false, transformFunction: null }, resetKeyWhenSelectAllKeyDropdown: { classPropertyName: "resetKeyWhenSelectAllKeyDropdown", publicName: "resetKeyWhenSelectAllKeyDropdown", isSignal: true, isRequired: false, transformFunction: null }, ignoreClassDisableDefaultWhenUseKeysDisableItem: { classPropertyName: "ignoreClassDisableDefaultWhenUseKeysDisableItem", publicName: "ignoreClassDisableDefaultWhenUseKeysDisableItem", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outSelectKey: "outSelectKey", outSelectMultiKey: "outSelectMultiKey", outUnSelectMultiKey: "outUnSelectMultiKey", outClickButtonOther: "outClickButtonOther", outFieldKey: "outFieldKey", outChangeView: "outChangeView", outLoading: "outLoading", outFunctionsControl: "outFunctionsControl", outChangStageFlagMousePopover: "outChangStageFlagMousePopover", outLoadItemsComplete: "outLoadItemsComplete" }, viewQueries: [{ propertyName: "listViewElementRef", first: true, predicate: ["listViewContainer"], descendants: true, isSignal: true }, { propertyName: "contentElementRef", first: true, predicate: ["contentContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #listViewContainer\n class=\"flex flex-col\"\n [class.w-full]=\"!maxItemShow\"\n [class.h-full]=\"!maxItemShow\">\n @if (labelConfig(); as labelConfig) {\n <libs_ui-components-label [classInclude]=\"labelConfig.classInclude\"\n [labelLeft]=\"labelConfig.labelLeft\"\n [labelLeftClass]=\"labelConfig.labelLeftClass\"\n [required]=\"labelConfig.required \"\n [description]=\"labelConfig.description\"\n [descriptionClass]=\"labelConfig.descriptionClass\"\n [labelRight]=\"labelConfig.labelRight\"\n [labelRightClass]=\"labelConfig.labelRightClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [buttonsLeft]=\"labelConfig.buttonsLeft\"\n [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft || disable()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || loading() || disable()\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [buttonsDescription]=\"labelConfig.buttonsDescription\"\n [disableButtonsDescription]=\"labelConfig.disableButtonsDescription || disable()\"\n [buttonsDescriptionContainerClass]=\"labelConfig.buttonsDescriptionContainerClass\"\n [count]=\"labelConfig.count\" />\n }\n\n @if (!showValidateBottom()) {\n <ng-container *ngTemplateOutlet=\"templateValidate\" />\n }\n @if (!hiddenInputSearch()) {\n <libs_ui-components-inputs-search [searchConfig]=\"searchConfig()\"\n [class.px-[12px]]=\"searchPadding()\"\n [class]=\"searchConfig().classCoverInputSearch\"\n [disable]=\" disable() || loading() || false\"\n (outSearch)=\"handlerSearch($event)\"\n (outFunctionsControl)=\"handlerFunctionControlInputSearch($event)\" />\n }\n @if (config()?.configDescriptionGroup?.(); as description) {\n <div [class]=\"description?.classInclude\">\n <libs_ui-components-popover [config]=\"description?.tooltipDescription()\">\n <div [class]=\"description?.classTextDescriptionInclude\">{{ description.textDescription }}</div>\n </libs_ui-components-popover>\n </div>\n }\n @if (!hiddenInputSearch() && hasDivider() && (!config()?.ignoreShowDataWhenNotSearch || keySearchStore())) {\n <div class=\"libs-ui-border-top-general {{ dividerClassInclude() ? dividerClassInclude():'' }}\"\n [class.libs-ui-divider-default]=\"!!searchPadding() && !dividerClassInclude()\">\n </div>\n }\n <div class=\"flex flex-col {{ (config()?.ignoreShowDataWhenNotSearch && keySearchStore() && !config()?.ignoreFixHeightShowDataWhenNotSearch) ? 'h-[353px]' : 'h-full' }}\">\n <div #contentContainer\n class=\"w-full h-full {{ backgroundListCustom() }}\"\n [class.libs-ui-disable]=\"disable() && disableLabel()\"\n [class.pointer-events-none]=\"disable() && disableLabel()\">\n </div>\n\n @for (buttonOther of buttonsOther(); track $index) {\n <div class=\"bg-[#ffffff]\"\n [class.rounded-b-[4px]]=\"$last && !hasButtonUnSelectOption()\">\n <libs_ui-components-buttons-button [type]=\"buttonOther.type || 'button-link-primary'\"\n [label]=\"buttonOther.label || ' '\"\n [classIconLeft]=\"(buttonOther.classIconLeft || '')+' flex mr-[8px] text-[16px]'\"\n classInclude=\"w-full libs-ui-border-top-general text-left rounded-0 {{ buttonOther.classInclude ? buttonOther.classInclude:'' }}\"\n classLabel=\"libs-ui-font-h5r whitespace-normal\"\n [disable]=\"buttonOther.disable || disable() || loading() || false\"\n (outClick)=\"handlerClickButtonOther(buttonOther)\" />\n </div>\n }\n @if (hasButtonUnSelectOption()) {\n <div class=\"bg-[#ffffff] rounded-b-[4px]\">\n <libs_ui-components-buttons-button label=\"i18n_unselect_option\"\n type=\"button-link-danger-high\"\n classIconLeft=\"flex mr-[8px] libs-ui-icon-close\"\n classInclude=\"w-100 libs-ui-border-top-general text-left rounded-0\"\n classLabel=\"libs-ui-font-h5r whitespace-normal\"\n [disable]=\"disableButtonUnSelectOption() || disable() || loading() || false\"\n (outClick)=\"handlerRemoveKeySelected()\" />\n </div>\n }\n </div>\n @if (showValidateBottom()) {\n <ng-container *ngTemplateOutlet=\"templateValidate\" />\n }\n</div>\n\n<ng-template #templateValidate>\n @if (isErrorRequired()) {\n <div [class.mb-[8px]]=\"!showValidateBottom()\"\n [class.mt-[8px]]=\"showValidateBottom()\">\n <span class=\"text-[#ee2d41] libs-ui-font-h7\"\n [innerHtml]=\"(validRequired()?.message || ERROR_MESSAGE_EMPTY_VALID)| translate:validRequired()?.interpolateParams\">\n </span>\n </div>\n }\n</ng-template>\n", styles: [":host{background-color:#fff}:host ::ng-deep .libs-ui-list-view-highlight-text-search{background-color:#ffdb80;border-radius:2px;display:inline-block;overflow:unset}.libs-ui-divider-default{width:calc(100% - 24px);margin:12px auto 0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: LibsUiComponentsLabelComponent, selector: "libs_ui-components-label", inputs: ["iconPopoverClass", "classInclude", "labelLeft", "labelLeftClass", "labelLeftBehindToggleButton", "popover", "required", "buttonsLeft", "disableButtonsLeft", "buttonsRight", "disableButtonsRight", "labelRight", "labelRightClass", "labelRightRequired", "hasToggle", "toggleSize", "toggleActive", "toggleDisable", "description", "descriptionClass", "buttonsDescription", "disableButtonsDescription", "buttonsDescriptionContainerClass", "onlyShowCount", "zIndexPopover", "timerDestroyPopover", "count", "limitLength"], outputs: ["outClickButton", "outSwitchEvent", "outLabelRightClick", "outLabelLeftClick"] }, { kind: "component", type: LibsUiComponentsInputsSearchComponent, selector: "libs_ui-components-inputs-search", inputs: ["disable", "readonly", "searchConfig", "ignoreAutoComplete", "debounceTime", "ignoreStopPropagationEvent", "focusTimeOut", "blurTimeOut"], outputs: ["outSearch", "outValueChange", "outIconLeft", "outIconRight", "outFocusAndBlur", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2629
+ }
2630
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsListComponent, decorators: [{
2631
+ type: Component,
2632
+ args: [{ selector: 'libs_ui-components-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
2633
+ NgTemplateOutlet, TranslateModule,
2634
+ LibsUiComponentsLabelComponent,
2635
+ LibsUiComponentsInputsSearchComponent,
2636
+ LibsUiComponentsPopoverComponent,
2637
+ LibsUiComponentsButtonsButtonComponent
2638
+ ], template: "<div #listViewContainer\n class=\"flex flex-col\"\n [class.w-full]=\"!maxItemShow\"\n [class.h-full]=\"!maxItemShow\">\n @if (labelConfig(); as labelConfig) {\n <libs_ui-components-label [classInclude]=\"labelConfig.classInclude\"\n [labelLeft]=\"labelConfig.labelLeft\"\n [labelLeftClass]=\"labelConfig.labelLeftClass\"\n [required]=\"labelConfig.required \"\n [description]=\"labelConfig.description\"\n [descriptionClass]=\"labelConfig.descriptionClass\"\n [labelRight]=\"labelConfig.labelRight\"\n [labelRightClass]=\"labelConfig.labelRightClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [buttonsLeft]=\"labelConfig.buttonsLeft\"\n [buttonsRight]=\"labelConfig.buttonsRight\"\n [disableButtonsLeft]=\"labelConfig.disableButtonsLeft || disable()\"\n [disableButtonsRight]=\"labelConfig.disableButtonsRight || disable()\"\n [hasToggle]=\"labelConfig.hasToggle\"\n [toggleActive]=\"labelConfig.toggleActive\"\n [toggleDisable]=\"labelConfig.toggleDisable || loading() || disable()\"\n [popover]=\"labelConfig.popover\"\n [iconPopoverClass]=\"labelConfig.iconPopoverClass\"\n [onlyShowCount]=\"labelConfig.onlyShowCount\"\n [limitLength]=\"labelConfig.limitLength\"\n [buttonsDescription]=\"labelConfig.buttonsDescription\"\n [disableButtonsDescription]=\"labelConfig.disableButtonsDescription || disable()\"\n [buttonsDescriptionContainerClass]=\"labelConfig.buttonsDescriptionContainerClass\"\n [count]=\"labelConfig.count\" />\n }\n\n @if (!showValidateBottom()) {\n <ng-container *ngTemplateOutlet=\"templateValidate\" />\n }\n @if (!hiddenInputSearch()) {\n <libs_ui-components-inputs-search [searchConfig]=\"searchConfig()\"\n [class.px-[12px]]=\"searchPadding()\"\n [class]=\"searchConfig().classCoverInputSearch\"\n [disable]=\" disable() || loading() || false\"\n (outSearch)=\"handlerSearch($event)\"\n (outFunctionsControl)=\"handlerFunctionControlInputSearch($event)\" />\n }\n @if (config()?.configDescriptionGroup?.(); as description) {\n <div [class]=\"description?.classInclude\">\n <libs_ui-components-popover [config]=\"description?.tooltipDescription()\">\n <div [class]=\"description?.classTextDescriptionInclude\">{{ description.textDescription }}</div>\n </libs_ui-components-popover>\n </div>\n }\n @if (!hiddenInputSearch() && hasDivider() && (!config()?.ignoreShowDataWhenNotSearch || keySearchStore())) {\n <div class=\"libs-ui-border-top-general {{ dividerClassInclude() ? dividerClassInclude():'' }}\"\n [class.libs-ui-divider-default]=\"!!searchPadding() && !dividerClassInclude()\">\n </div>\n }\n <div class=\"flex flex-col {{ (config()?.ignoreShowDataWhenNotSearch && keySearchStore() && !config()?.ignoreFixHeightShowDataWhenNotSearch) ? 'h-[353px]' : 'h-full' }}\">\n <div #contentContainer\n class=\"w-full h-full {{ backgroundListCustom() }}\"\n [class.libs-ui-disable]=\"disable() && disableLabel()\"\n [class.pointer-events-none]=\"disable() && disableLabel()\">\n </div>\n\n @for (buttonOther of buttonsOther(); track $index) {\n <div class=\"bg-[#ffffff]\"\n [class.rounded-b-[4px]]=\"$last && !hasButtonUnSelectOption()\">\n <libs_ui-components-buttons-button [type]=\"buttonOther.type || 'button-link-primary'\"\n [label]=\"buttonOther.label || ' '\"\n [classIconLeft]=\"(buttonOther.classIconLeft || '')+' flex mr-[8px] text-[16px]'\"\n classInclude=\"w-full libs-ui-border-top-general text-left rounded-0 {{ buttonOther.classInclude ? buttonOther.classInclude:'' }}\"\n classLabel=\"libs-ui-font-h5r whitespace-normal\"\n [disable]=\"buttonOther.disable || disable() || loading() || false\"\n (outClick)=\"handlerClickButtonOther(buttonOther)\" />\n </div>\n }\n @if (hasButtonUnSelectOption()) {\n <div class=\"bg-[#ffffff] rounded-b-[4px]\">\n <libs_ui-components-buttons-button label=\"i18n_unselect_option\"\n type=\"button-link-danger-high\"\n classIconLeft=\"flex mr-[8px] libs-ui-icon-close\"\n classInclude=\"w-100 libs-ui-border-top-general text-left rounded-0\"\n classLabel=\"libs-ui-font-h5r whitespace-normal\"\n [disable]=\"disableButtonUnSelectOption() || disable() || loading() || false\"\n (outClick)=\"handlerRemoveKeySelected()\" />\n </div>\n }\n </div>\n @if (showValidateBottom()) {\n <ng-container *ngTemplateOutlet=\"templateValidate\" />\n }\n</div>\n\n<ng-template #templateValidate>\n @if (isErrorRequired()) {\n <div [class.mb-[8px]]=\"!showValidateBottom()\"\n [class.mt-[8px]]=\"showValidateBottom()\">\n <span class=\"text-[#ee2d41] libs-ui-font-h7\"\n [innerHtml]=\"(validRequired()?.message || ERROR_MESSAGE_EMPTY_VALID)| translate:validRequired()?.interpolateParams\">\n </span>\n </div>\n }\n</ng-template>\n", styles: [":host{background-color:#fff}:host ::ng-deep .libs-ui-list-view-highlight-text-search{background-color:#ffdb80;border-radius:2px;display:inline-block;overflow:unset}.libs-ui-divider-default{width:calc(100% - 24px);margin:12px auto 0}\n"] }]
2639
+ }], ctorParameters: () => [] });
2640
+
2641
+ ;
2642
+
2643
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2644
+
2645
+ /**
2646
+ * Generated bundle index. Do not edit.
2647
+ */
2648
+
2649
+ export { LibsUiComponentsListComponent, getComponentByType, getFieldKeyByType, initConfig };
2650
+ //# sourceMappingURL=libs-ui-components-list.mjs.map