@libs-ui/components-table 0.1.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -0
- package/esm2022/index.mjs +3 -0
- package/esm2022/interfaces/button-action-event.interface.mjs +3 -0
- package/esm2022/interfaces/button-bar-event.interface.mjs +3 -0
- package/esm2022/interfaces/function-control-event.interface.mjs +2 -0
- package/esm2022/interfaces/hover-button-action-event.interface.mjs +2 -0
- package/esm2022/interfaces/index.mjs +11 -0
- package/esm2022/interfaces/load-more-event.interface.mjs +2 -0
- package/esm2022/interfaces/no-data-config.interface.mjs +2 -0
- package/esm2022/interfaces/sort-event.interface.mjs +2 -0
- package/esm2022/interfaces/table-config.interface.mjs +2 -0
- package/esm2022/interfaces/table.type.mjs +2 -0
- package/esm2022/interfaces/template-config.interface.mjs +3 -0
- package/esm2022/libs-ui-components-table.mjs +5 -0
- package/esm2022/pipes/calculator-column.pipe.mjs +83 -0
- package/esm2022/table.component.mjs +714 -0
- package/esm2022/templates/templates.component.mjs +122 -0
- package/fesm2022/libs-ui-components-table.mjs +918 -0
- package/fesm2022/libs-ui-components-table.mjs.map +1 -0
- package/index.d.ts +2 -0
- package/interfaces/button-action-event.interface.d.ts +12 -0
- package/interfaces/button-bar-event.interface.d.ts +7 -0
- package/interfaces/function-control-event.interface.d.ts +14 -0
- package/interfaces/hover-button-action-event.interface.d.ts +4 -0
- package/interfaces/index.d.ts +10 -0
- package/interfaces/load-more-event.interface.d.ts +4 -0
- package/interfaces/no-data-config.interface.d.ts +9 -0
- package/interfaces/sort-event.interface.d.ts +5 -0
- package/interfaces/table-config.interface.d.ts +92 -0
- package/interfaces/table.type.d.ts +13 -0
- package/interfaces/template-config.interface.d.ts +57 -0
- package/package.json +52 -0
- package/pipes/calculator-column.pipe.d.ts +12 -0
- package/table.component.d.ts +173 -0
- package/templates/templates.component.d.ts +28 -0
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
import { NgStyle, NgClass, AsyncPipe, NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { HttpParams } from '@angular/common/http';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Pipe, input, ChangeDetectionStrategy, Component, computed, signal, output, viewChild, inject, DestroyRef, ChangeDetectorRef, effect, untracked } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import * as i2 from '@iharbeck/ngx-virtual-scroller';
|
|
7
|
+
import { VirtualScrollerModule } from '@iharbeck/ngx-virtual-scroller';
|
|
8
|
+
import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
|
|
9
|
+
import { LibsUiComponentsButtonsSortArrowComponent } from '@libs-ui/components-buttons-sort';
|
|
10
|
+
import { LibsUiComponentsCheckboxSingleComponent } from '@libs-ui/components-checkbox-single';
|
|
11
|
+
import { LibsUiComponentsDropdownComponent } from '@libs-ui/components-dropdown';
|
|
12
|
+
import { LibsUiComponentsPaginationComponent } from '@libs-ui/components-pagination';
|
|
13
|
+
import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
|
|
14
|
+
import { LibsUiComponentsScrollOverlayDirective } from '@libs-ui/components-scroll-overlay';
|
|
15
|
+
import { LibsUiComponentsSpinnerComponent } from '@libs-ui/components-spinner';
|
|
16
|
+
import { LibsUiIconsGetIconComponentPipe } from '@libs-ui/icons';
|
|
17
|
+
import { LibsUiPipesCallFunctionInTemplatePipe } from '@libs-ui/pipes-call-function-in-template';
|
|
18
|
+
import { LibsUiPipesCheckSelectedByKeyPipe } from '@libs-ui/pipes-check-selected-by-key';
|
|
19
|
+
import { LibsUiPipesConvertObjectToSignalPipe } from '@libs-ui/pipes-convert-object-to-signal';
|
|
20
|
+
import { returnListObject, LibsUiHttpRequestService } from '@libs-ui/services-http-request';
|
|
21
|
+
import { get, convertObjectToSignal, viewDataNumberByLanguage, cloneDeep, deleteUnicode, set } from '@libs-ui/utils';
|
|
22
|
+
import * as i1 from '@ngx-translate/core';
|
|
23
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
24
|
+
import { fromEvent, of, lastValueFrom, timer } from 'rxjs';
|
|
25
|
+
import { LibsUiComponentsAvatarComponent } from '@libs-ui/components-avatar';
|
|
26
|
+
import { LibsUiComponentsBadgeComponent } from '@libs-ui/components-badge';
|
|
27
|
+
import { LibsUiComponentsButtonsStatusComponent } from '@libs-ui/components-buttons-status';
|
|
28
|
+
import { LibsUiComponentsLineClampComponent } from '@libs-ui/components-line-clamp';
|
|
29
|
+
import { LibsUiComponentsSwitchComponent } from '@libs-ui/components-switch';
|
|
30
|
+
import { LibsUiPipesCloneObjectPipe } from '@libs-ui/pipes-clone-object';
|
|
31
|
+
import { LibsUiPipesGetValueOfObjectPipe } from '@libs-ui/pipes-get-value-of-object';
|
|
32
|
+
import { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';
|
|
33
|
+
|
|
34
|
+
class LibsUiTableCalculatorColumnPipe {
|
|
35
|
+
transform(header, ignoreCalculatorWidthHeader, offsetWidth, headerLeftConfig, headerRightConfig) {
|
|
36
|
+
if (!header?.ngStyle) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
if (ignoreCalculatorWidthHeader) {
|
|
40
|
+
return header.ngStyle;
|
|
41
|
+
}
|
|
42
|
+
const mixHeaderConfig = [...(headerLeftConfig || []), ...(headerRightConfig || [])];
|
|
43
|
+
let totalPxWidthHeader = mixHeaderConfig.reduce((acc, curr) => acc + this.getWidthPxOfStyle(curr), 0);
|
|
44
|
+
const totalPercentWidthHeader = mixHeaderConfig.reduce((acc, curr) => acc + this.getWidthPercentOfStyle(curr), 0);
|
|
45
|
+
const totalWidthIsPxColumnIfTableWidthGrandTotalColumnsHeader = mixHeaderConfig.reduce((acc, curr) => acc + (curr.keepWidthIsPxColumnIfTableWidthGrandTotalColumnsHeader ? this.getWidthPxOfStyle(curr) : 0), 0);
|
|
46
|
+
if (mixHeaderConfig.some((header) => header.isShowIndexOnRow)) {
|
|
47
|
+
offsetWidth -= 50;
|
|
48
|
+
}
|
|
49
|
+
if (totalWidthIsPxColumnIfTableWidthGrandTotalColumnsHeader) {
|
|
50
|
+
offsetWidth -= totalWidthIsPxColumnIfTableWidthGrandTotalColumnsHeader;
|
|
51
|
+
totalPxWidthHeader -= totalWidthIsPxColumnIfTableWidthGrandTotalColumnsHeader;
|
|
52
|
+
}
|
|
53
|
+
let percent = this.getWidthPercentOfStyle(header);
|
|
54
|
+
if (percent) {
|
|
55
|
+
offsetWidth -= totalPxWidthHeader;
|
|
56
|
+
const percentDivide = (totalPercentWidthHeader - 100) / mixHeaderConfig.length;
|
|
57
|
+
percent -= percentDivide;
|
|
58
|
+
const widthCalculator = (percent / 100) * offsetWidth;
|
|
59
|
+
return this.getStyleUpdate(widthCalculator, header.ngStyle);
|
|
60
|
+
}
|
|
61
|
+
const width = this.getWidthPxOfStyle(header);
|
|
62
|
+
if (totalPxWidthHeader > offsetWidth || header.keepWidthIsPxColumnIfTableWidthGrandTotalColumnsHeader || totalPercentWidthHeader) {
|
|
63
|
+
return this.getStyleUpdate(width, header.ngStyle);
|
|
64
|
+
}
|
|
65
|
+
const widthCalculator = (width / totalPxWidthHeader) * offsetWidth;
|
|
66
|
+
return this.getStyleUpdate(widthCalculator, header.ngStyle);
|
|
67
|
+
}
|
|
68
|
+
getWidthPxOfStyle(headerGetWidth) {
|
|
69
|
+
let { flex, width, maxWidth } = headerGetWidth.ngStyle || {};
|
|
70
|
+
if (flex?.includes('%') || width?.includes('%') || maxWidth?.includes('%')) {
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
width = parseInt(width || '0');
|
|
74
|
+
maxWidth = parseInt(maxWidth || '0');
|
|
75
|
+
flex = parseInt((flex || '0').split(' ').pop() || '0');
|
|
76
|
+
if (!flex && !width && !maxWidth) {
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
const widthMax = Math.max(width, maxWidth, flex);
|
|
80
|
+
return widthMax;
|
|
81
|
+
}
|
|
82
|
+
getWidthPercentOfStyle(headerGetWidth) {
|
|
83
|
+
let { flex, width, maxWidth } = headerGetWidth.ngStyle || {};
|
|
84
|
+
if (flex?.includes('px') || width?.includes('px') || maxWidth?.includes('px')) {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
width = parseInt(width || '0');
|
|
88
|
+
maxWidth = parseInt(maxWidth || '0');
|
|
89
|
+
flex = parseInt((flex || '0').split(' ').pop() || '0');
|
|
90
|
+
if (!flex && !width && !maxWidth) {
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
const widthMax = Math.max(width, maxWidth, flex);
|
|
94
|
+
return widthMax;
|
|
95
|
+
}
|
|
96
|
+
getStyleUpdate(widthCalculator, ngStyle) {
|
|
97
|
+
return {
|
|
98
|
+
...ngStyle,
|
|
99
|
+
flex: `0 0 ${widthCalculator}px`,
|
|
100
|
+
width: `${widthCalculator}px`,
|
|
101
|
+
maxWidth: `${widthCalculator}px`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiTableCalculatorColumnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
105
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: LibsUiTableCalculatorColumnPipe, isStandalone: true, name: "LibsUiTableCalculatorColumnPipe" });
|
|
106
|
+
}
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiTableCalculatorColumnPipe, decorators: [{
|
|
108
|
+
type: Pipe,
|
|
109
|
+
args: [{
|
|
110
|
+
name: 'LibsUiTableCalculatorColumnPipe',
|
|
111
|
+
standalone: true,
|
|
112
|
+
}]
|
|
113
|
+
}] });
|
|
114
|
+
|
|
115
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
116
|
+
class LibsUiComponentsTableTemplatesComponent {
|
|
117
|
+
lockClick;
|
|
118
|
+
functionControls = new Map();
|
|
119
|
+
isImageError;
|
|
120
|
+
isHover = input();
|
|
121
|
+
configs = input();
|
|
122
|
+
templateCssWrapper = input();
|
|
123
|
+
item = input.required();
|
|
124
|
+
async handlerItemClick(event, config) {
|
|
125
|
+
if (event instanceof Event) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
}
|
|
129
|
+
if (typeof event === 'string' && event !== 'click') {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
await this.handleLockClick(async () => {
|
|
133
|
+
if (config && config.action) {
|
|
134
|
+
config.action(get(this.item(), config.field), this.item());
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async clickButtonAction(button) {
|
|
139
|
+
await this.handleLockClick(async () => {
|
|
140
|
+
button.action?.({ item: this.item() });
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async handlerSwitch(switchItem, config) {
|
|
144
|
+
await this.handleLockClick(async () => {
|
|
145
|
+
config?.switchAction?.(switchItem, this.item());
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async handlerSelectItemDropdown(fieldConfig, index, data) {
|
|
149
|
+
if (!data) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
await this.handleLockClick(async () => {
|
|
153
|
+
fieldConfig?.action?.(data.key, data.item, this.item());
|
|
154
|
+
this.functionControls?.get(index)?.reset();
|
|
155
|
+
this.functionControls?.get(index)?.removeList();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async handlerSelectItemsDropdown(fieldConfig, index, data) {
|
|
159
|
+
if (!data) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
await this.handleLockClick(async () => {
|
|
163
|
+
fieldConfig?.action?.(data.keys, convertObjectToSignal(data.mapKeys, false), this.item());
|
|
164
|
+
this.functionControls?.get(index)?.reset();
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async handlerImageError(event) {
|
|
168
|
+
event.stopPropagation();
|
|
169
|
+
this.isImageError = true;
|
|
170
|
+
}
|
|
171
|
+
async handlerFunctionControl(event, index) {
|
|
172
|
+
this.functionControls.set(index, event);
|
|
173
|
+
}
|
|
174
|
+
async handleLockClick(callback) {
|
|
175
|
+
if (this.lockClick)
|
|
176
|
+
return;
|
|
177
|
+
this.lockClick = true;
|
|
178
|
+
try {
|
|
179
|
+
await callback();
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
console.error(error);
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
setTimeout(() => {
|
|
186
|
+
this.lockClick = false;
|
|
187
|
+
}, 250);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
ngOnDestroy() {
|
|
191
|
+
this.functionControls.clear();
|
|
192
|
+
}
|
|
193
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsTableTemplatesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
194
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsTableTemplatesComponent, isStandalone: true, selector: "libs_ui-components-table-templates", inputs: { isHover: { classPropertyName: "isHover", publicName: "isHover", isSignal: true, isRequired: false, transformFunction: null }, configs: { classPropertyName: "configs", publicName: "configs", isSignal: true, isRequired: false, transformFunction: null }, templateCssWrapper: { classPropertyName: "templateCssWrapper", publicName: "templateCssWrapper", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (configs(); as configs) {\n @if (item(); as item) {\n <div class=\"libs-ui-table-template {{ templateCssWrapper() || '' }}\">\n @for (config of configs; track config) {\n @if (config.fieldsConfig) {\n <div [class]=\"config.cssWrapper\">\n @for (fieldConfig of config.fieldsConfig; track fieldConfig; let index = $index) {\n @let constHtmlNgStyle = fieldConfig.getNgStyle ? (item()[fieldConfig.field] | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getNgStyle : item() | async) : fieldConfig.ngStyle || {};\n @let constHtmlNgClass = fieldConfig.getNgClass ? (item()[fieldConfig.field] | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getNgClass : item() | async) : fieldConfig.ngClass || {};\n @if (!fieldConfig.rows && !fieldConfig.getComponentOutlet) {\n @switch (fieldConfig.instance) {\n @case ('tooltip') {\n @if (fieldConfig.tooltip || {}; as tooltip) {\n <span\n LibsUiComponentsPopoverDirective\n [type]=\"tooltip.type || 'text'\"\n [mode]=\"tooltip.mode || 'hover'\"\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [classInclude]=\"tooltip.classInclude || ' '\"\n [ignoreShowPopover]=\"tooltip.ignoreShowPopover || false\"\n [config]=\"\n (fieldConfig.getTooltipConfig\n ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getTooltipConfig : item() | async)\n : (tooltip.config | LibsUiPipesCloneObjectPipe)\n ) | translate\n \"\n [innerHTML]=\"\n (fieldConfig.field ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true) : tooltip.dataView) | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate\n \"\n (outEvent)=\"handlerItemClick($event, fieldConfig)\"></span>\n }\n }\n @case ('image') {\n @if (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getImageSrc : item() : isImageError | async; as linkImage) {\n @if (linkImage !== ' ') {\n <img\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [src]=\"linkImage\"\n (error)=\"handlerImageError($event)\"\n (click)=\"handlerItemClick($event, fieldConfig)\" />\n }\n }\n }\n\n @case ('avatar') {\n @if (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getAvatarConfig : item() | async; as avatarConfig) {\n <libs_ui-components-avatar\n [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [size]=\"avatarConfig.size || 32\"\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [getLastTextAfterSpace]=\"avatarConfig.getLastTextAfterSpace\"\n [textAvatar]=\"avatarConfig.textAvatar\" />\n }\n }\n\n @case ('buttons') {\n @if ((fieldConfig.buttons && fieldConfig.buttons.length) || fieldConfig.getButtonsByItem) {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [class.invisible]=\"!isHover() && fieldConfig.showButtonHoverMode\">\n @for (button of fieldConfig.buttons || (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getButtonsByItem : item() | async); track button) {\n <libs_ui-components-buttons-button\n [type]=\"button().type || 'button-primary'\"\n [sizeButton]=\"button().sizeButton || 'smaller'\"\n [disable]=\"\n (button().disable ?? fieldConfig.getDisable) ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDisable : item() | async) : false\n \"\n [label]=\"button().label || ' '\"\n [classIconLeft]=\"button().classIconLeft || ''\"\n [classIconRight]=\"button().classIconRight || ''\"\n [popover]=\"button().popover || {}\"\n [classInclude]=\"button().classInclude || ''\"\n [ignorePointerEvent]=\"button().ignorePointerEvent\"\n [iconOnlyType]=\"button().iconOnlyType\"\n (outClick)=\"clickButtonAction(button())\" />\n }\n </div>\n }\n }\n\n @case ('button-status') {\n <libs_ui-components-buttons-status\n [config]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async\"\n (click)=\"handlerItemClick($event, fieldConfig)\" />\n }\n\n @case ('switch') {\n <libs_ui-components-switch\n [active]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getActiveValueSwitch : item() | async\"\n [disable]=\"fieldConfig.getDisableValueSwitch ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDisableValueSwitch : item() | async) : false\"\n (outSwitch)=\"handlerSwitch($event, fieldConfig)\" />\n }\n\n @case (fieldConfig.instance === 'other-action-show-popup' || fieldConfig.instance === 'badge' || fieldConfig.instance === 'button-action-show-popup' ? fieldConfig.instance : '') {\n @if ((item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async) !== ' ') {\n @let constHtmlDisableDropdown =\n (fieldConfig.dropdownConfig?.disable ?? fieldConfig.getDisable)\n ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDisable : item() | async)\n : false;\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [class.ml-[8px]]=\"!fieldConfig.ignoreClassMarginLeft\">\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{\n widthByParent: false,\n ignoreArrow: fieldConfig.dropdownConfig?.ignoreArrow || false,\n maxHeight: fieldConfig.dropdownConfig?.maxHeight || 2048,\n paddingLeftItem: fieldConfig.dropdownConfig?.paddingLeftItem ?? true,\n classInclude: fieldConfig.dropdownConfig?.classIncludePopup || 'w-[250px]',\n position: fieldConfig.dropdownConfig?.position || {\n mode: 'center',\n distance: 0,\n },\n }\"\n [zIndex]=\"fieldConfig.dropdownConfig?.zIndex\"\n [listConfig]=\"\n fieldConfig.dropdownConfig?.getListConfig\n ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.dropdownConfig?.getListConfig : item() | async)\n : fieldConfig.dropdownConfig?.listConfig\n \"\n [listBackgroundCustom]=\"fieldConfig.dropdownConfig?.listBackgroundListCustom\"\n [listMaxItemShow]=\"fieldConfig.dropdownConfig?.listMaxItemShow || 5\"\n [listKeysDisable]=\"fieldConfig.dropdownConfig?.listKeysDisableItem\"\n [listHiddenInputSearch]=\"fieldConfig.dropdownConfig?.listHiddenInputSearch\"\n [disable]=\"constHtmlDisableDropdown\"\n (outFunctionsControl)=\"handlerFunctionControl($event, index)\"\n (outSelectKey)=\"handlerSelectItemDropdown(fieldConfig, index, $event)\"\n (outSelectMultiKey)=\"handlerSelectItemsDropdown(fieldConfig, index, $event)\">\n @if (fieldConfig.instance === 'other-action-show-popup') {\n <div [innerHtml]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate\"></div>\n }\n @if (fieldConfig.instance === 'badge') {\n @let constHtmlDataBadge = item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async;\n @if (constHtmlDataBadge > 0) {\n <libs_ui-components-badge\n [active]=\"true\"\n [ignoreMarginDefault]=\"true\"\n mode=\"+x\"\n [count]=\"constHtmlDataBadge\"\n [maxCount]=\"99\" />\n }\n }\n @if (fieldConfig.instance === 'button-action-show-popup') {\n <libs_ui-components-buttons-button\n [type]=\"fieldConfig?.dropdownConfig?.button()?.type || 'button-primary'\"\n [sizeButton]=\"fieldConfig?.dropdownConfig?.button()?.sizeButton || 'smaller'\"\n [disable]=\"fieldConfig?.dropdownConfig?.button()?.disable ?? constHtmlDisableDropdown\"\n [label]=\"fieldConfig?.dropdownConfig?.button()?.label || ' '\"\n [classIconLeft]=\"fieldConfig?.dropdownConfig?.button()?.classIconLeft || 'libs-ui-icon-more-vertical rotate-[90deg] mr-0'\"\n [classIconRight]=\"fieldConfig?.dropdownConfig?.button()?.classIconRight || ''\"\n [popover]=\"fieldConfig?.dropdownConfig?.button()?.popover || {}\"\n [classInclude]=\"fieldConfig?.dropdownConfig?.button()?.classInclude || ''\"\n [ignoreStopPropagationEvent]=\"true\" />\n }\n </libs_ui-components-dropdown>\n </div>\n }\n }\n\n @case ('line-clamp') {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\">\n @if (fieldConfig.lineClampConfig; as lineClampConfig) {\n <libs_ui-components-line_clamp\n [ignoreShowButtonCollapseExpand]=\"lineClampConfig.ignoreShowButtonCollapseExpand ?? true\"\n [showTooltip]=\"lineClampConfig.showTooltip ?? true\"\n [maxHeight]=\"lineClampConfig.maxHeight || 36\"\n [maxWidthTooltip]=\"lineClampConfig.maxWidthTooltip || 200\"\n [maxHeightTooltip]=\"lineClampConfig.maxHeightTooltip || 100\"\n [ngClassObject]=\"lineClampConfig.ngClassObject ?? { 'libs-ui-line-clamp-content libs-ui-font-h5r': true }\"\n [isInnerText]=\"lineClampConfig.isInnerText || false\"\n [ignoreStopPropagationTooltipEvent]=\"true\"\n [content]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async\"\n (click)=\"handlerItemClick($event, fieldConfig)\" />\n }\n </div>\n }\n\n @case ('shape-style') {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [innerHTML]=\"\n item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate | LibsUiPipesSecurityTrustPipe: 'html' : true | async\n \"\n (click)=\"handlerItemClick($event, fieldConfig)\"></div>\n }\n @default {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [innerHTML]=\"\n item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate | LibsUiPipesSecurityTrustPipe: 'html' : true | async\n \"\n (click)=\"handlerItemClick($event, fieldConfig)\"></div>\n }\n }\n } @else {\n @if (fieldConfig.rows) {\n <div\n class=\"w-full flex relative {{ fieldConfig.rowsTemplateCssWrapper }}\"\n [style.height.px]=\"rowRef.clientHeight\">\n <div\n #rowRef\n class=\"w-full flex absolute {{ fieldConfig.rowsTemplateCssWrapper }}\">\n <libs_ui-components-table-templates\n class=\"flex w-full\"\n [item]=\"item\"\n [configs]=\"fieldConfig.rows\" />\n </div>\n </div>\n } @else {\n <ng-container\n *ngComponentOutlet=\"\n item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getComponentOutlet : item() | async;\n inputs: undefined | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDataComponentOutlet : item() : fieldConfig.field : { valueIsEmpty: { item: item() } } | async\n \" />\n }\n }\n }\n </div>\n }\n }\n </div>\n }\n}\n", styles: [":host{width:100%;height:100%}:host .libs-ui-table-template{color:#071631;font-size:12px;font-weight:400;width:100%;height:inherit}\n"], dependencies: [{ kind: "component", type: LibsUiComponentsTableTemplatesComponent, selector: "libs_ui-components-table-templates", inputs: ["isHover", "configs", "templateCssWrapper", "item"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "pipe", type: LibsUiPipesGetValueOfObjectPipe, name: "LibsUiPipesGetValueOfObjectPipe" }, { kind: "component", type: LibsUiComponentsAvatarComponent, selector: "libs_ui-components-avatar", inputs: ["typeShape", "classInclude", "size", "linkAvatar", "linkAvatarError", "classImageInclude", "zIndexPreviewImage", "clickPreviewImage", "idGenColor", "getLastTextAfterSpace", "textAvatar", "textAvatarClassInclude", "containertextAvatarClassInclude"], outputs: ["outAvatarError", "outEventPreviewImage"] }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsStatusComponent, selector: "libs_ui-components-buttons-status", inputs: ["config"] }, { kind: "component", type: LibsUiComponentsSwitchComponent, selector: "libs_ui-components-switch", inputs: ["size", "disable", "active"], outputs: ["activeChange", "outSwitch"] }, { kind: "pipe", type: LibsUiPipesCloneObjectPipe, name: "LibsUiPipesCloneObjectPipe" }, { 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", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsLineClampComponent, selector: "libs_ui-components-line_clamp", inputs: ["content", "lengthLimitDisplay", "maxHeight", "ignoreShowButtonCollapseExpand", "ignoreShowButtonCollapse", "showTooltip", "timeHidePopoverOnMouseout", "maxWidthTooltip", "maxHeightTooltip", "zIndexPopover", "isInnerText", "classClassLabelButtonCollapseExpand", "classClassIncludeButtonCollapseExpand", "ignoreStopPropagationTooltipEvent", "ngClassObject", "hasBackgroundGradient", "labelButtonViewMore", "labelButtonCollapse", "directionTooltip", "useXssFilter", "defaultIsCollapse"], outputs: ["outDisplayLineClamp", "outAction", "outClick", "outFunctionControl"] }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { kind: "component", type: LibsUiComponentsBadgeComponent, selector: "libs_ui-components-badge", inputs: ["popoverConfig", "active", "count", "mode", "maxCount", "ignoreMarginDefault", "classCircle", "ignoreStopPropagationEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
195
|
+
}
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsTableTemplatesComponent, decorators: [{
|
|
197
|
+
type: Component,
|
|
198
|
+
args: [{ selector: 'libs_ui-components-table-templates', standalone: true, imports: [
|
|
199
|
+
NgStyle,
|
|
200
|
+
NgClass,
|
|
201
|
+
TranslateModule,
|
|
202
|
+
AsyncPipe,
|
|
203
|
+
NgComponentOutlet,
|
|
204
|
+
LibsUiPipesGetValueOfObjectPipe,
|
|
205
|
+
LibsUiComponentsAvatarComponent,
|
|
206
|
+
LibsUiPipesCallFunctionInTemplatePipe,
|
|
207
|
+
LibsUiPipesSecurityTrustPipe,
|
|
208
|
+
LibsUiComponentsPopoverComponent,
|
|
209
|
+
LibsUiComponentsButtonsStatusComponent,
|
|
210
|
+
LibsUiComponentsSwitchComponent,
|
|
211
|
+
LibsUiPipesCloneObjectPipe,
|
|
212
|
+
LibsUiComponentsButtonsButtonComponent,
|
|
213
|
+
LibsUiComponentsLineClampComponent,
|
|
214
|
+
LibsUiComponentsDropdownComponent,
|
|
215
|
+
LibsUiComponentsBadgeComponent,
|
|
216
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (configs(); as configs) {\n @if (item(); as item) {\n <div class=\"libs-ui-table-template {{ templateCssWrapper() || '' }}\">\n @for (config of configs; track config) {\n @if (config.fieldsConfig) {\n <div [class]=\"config.cssWrapper\">\n @for (fieldConfig of config.fieldsConfig; track fieldConfig; let index = $index) {\n @let constHtmlNgStyle = fieldConfig.getNgStyle ? (item()[fieldConfig.field] | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getNgStyle : item() | async) : fieldConfig.ngStyle || {};\n @let constHtmlNgClass = fieldConfig.getNgClass ? (item()[fieldConfig.field] | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getNgClass : item() | async) : fieldConfig.ngClass || {};\n @if (!fieldConfig.rows && !fieldConfig.getComponentOutlet) {\n @switch (fieldConfig.instance) {\n @case ('tooltip') {\n @if (fieldConfig.tooltip || {}; as tooltip) {\n <span\n LibsUiComponentsPopoverDirective\n [type]=\"tooltip.type || 'text'\"\n [mode]=\"tooltip.mode || 'hover'\"\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [classInclude]=\"tooltip.classInclude || ' '\"\n [ignoreShowPopover]=\"tooltip.ignoreShowPopover || false\"\n [config]=\"\n (fieldConfig.getTooltipConfig\n ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getTooltipConfig : item() | async)\n : (tooltip.config | LibsUiPipesCloneObjectPipe)\n ) | translate\n \"\n [innerHTML]=\"\n (fieldConfig.field ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true) : tooltip.dataView) | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate\n \"\n (outEvent)=\"handlerItemClick($event, fieldConfig)\"></span>\n }\n }\n @case ('image') {\n @if (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getImageSrc : item() : isImageError | async; as linkImage) {\n @if (linkImage !== ' ') {\n <img\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [src]=\"linkImage\"\n (error)=\"handlerImageError($event)\"\n (click)=\"handlerItemClick($event, fieldConfig)\" />\n }\n }\n }\n\n @case ('avatar') {\n @if (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getAvatarConfig : item() | async; as avatarConfig) {\n <libs_ui-components-avatar\n [typeShape]=\"avatarConfig.typeShape || 'circle'\"\n [classInclude]=\"avatarConfig.classInclude\"\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [size]=\"avatarConfig.size || 32\"\n [linkAvatar]=\"avatarConfig.linkAvatar\"\n [linkAvatarError]=\"avatarConfig.linkAvatarError\"\n [idGenColor]=\"avatarConfig.idGenColor\"\n [getLastTextAfterSpace]=\"avatarConfig.getLastTextAfterSpace\"\n [textAvatar]=\"avatarConfig.textAvatar\" />\n }\n }\n\n @case ('buttons') {\n @if ((fieldConfig.buttons && fieldConfig.buttons.length) || fieldConfig.getButtonsByItem) {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [class.invisible]=\"!isHover() && fieldConfig.showButtonHoverMode\">\n @for (button of fieldConfig.buttons || (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getButtonsByItem : item() | async); track button) {\n <libs_ui-components-buttons-button\n [type]=\"button().type || 'button-primary'\"\n [sizeButton]=\"button().sizeButton || 'smaller'\"\n [disable]=\"\n (button().disable ?? fieldConfig.getDisable) ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDisable : item() | async) : false\n \"\n [label]=\"button().label || ' '\"\n [classIconLeft]=\"button().classIconLeft || ''\"\n [classIconRight]=\"button().classIconRight || ''\"\n [popover]=\"button().popover || {}\"\n [classInclude]=\"button().classInclude || ''\"\n [ignorePointerEvent]=\"button().ignorePointerEvent\"\n [iconOnlyType]=\"button().iconOnlyType\"\n (outClick)=\"clickButtonAction(button())\" />\n }\n </div>\n }\n }\n\n @case ('button-status') {\n <libs_ui-components-buttons-status\n [config]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async\"\n (click)=\"handlerItemClick($event, fieldConfig)\" />\n }\n\n @case ('switch') {\n <libs_ui-components-switch\n [active]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getActiveValueSwitch : item() | async\"\n [disable]=\"fieldConfig.getDisableValueSwitch ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDisableValueSwitch : item() | async) : false\"\n (outSwitch)=\"handlerSwitch($event, fieldConfig)\" />\n }\n\n @case (fieldConfig.instance === 'other-action-show-popup' || fieldConfig.instance === 'badge' || fieldConfig.instance === 'button-action-show-popup' ? fieldConfig.instance : '') {\n @if ((item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async) !== ' ') {\n @let constHtmlDisableDropdown =\n (fieldConfig.dropdownConfig?.disable ?? fieldConfig.getDisable)\n ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDisable : item() | async)\n : false;\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [class.ml-[8px]]=\"!fieldConfig.ignoreClassMarginLeft\">\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{\n widthByParent: false,\n ignoreArrow: fieldConfig.dropdownConfig?.ignoreArrow || false,\n maxHeight: fieldConfig.dropdownConfig?.maxHeight || 2048,\n paddingLeftItem: fieldConfig.dropdownConfig?.paddingLeftItem ?? true,\n classInclude: fieldConfig.dropdownConfig?.classIncludePopup || 'w-[250px]',\n position: fieldConfig.dropdownConfig?.position || {\n mode: 'center',\n distance: 0,\n },\n }\"\n [zIndex]=\"fieldConfig.dropdownConfig?.zIndex\"\n [listConfig]=\"\n fieldConfig.dropdownConfig?.getListConfig\n ? (item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.dropdownConfig?.getListConfig : item() | async)\n : fieldConfig.dropdownConfig?.listConfig\n \"\n [listBackgroundCustom]=\"fieldConfig.dropdownConfig?.listBackgroundListCustom\"\n [listMaxItemShow]=\"fieldConfig.dropdownConfig?.listMaxItemShow || 5\"\n [listKeysDisable]=\"fieldConfig.dropdownConfig?.listKeysDisableItem\"\n [listHiddenInputSearch]=\"fieldConfig.dropdownConfig?.listHiddenInputSearch\"\n [disable]=\"constHtmlDisableDropdown\"\n (outFunctionsControl)=\"handlerFunctionControl($event, index)\"\n (outSelectKey)=\"handlerSelectItemDropdown(fieldConfig, index, $event)\"\n (outSelectMultiKey)=\"handlerSelectItemsDropdown(fieldConfig, index, $event)\">\n @if (fieldConfig.instance === 'other-action-show-popup') {\n <div [innerHtml]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate\"></div>\n }\n @if (fieldConfig.instance === 'badge') {\n @let constHtmlDataBadge = item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async;\n @if (constHtmlDataBadge > 0) {\n <libs_ui-components-badge\n [active]=\"true\"\n [ignoreMarginDefault]=\"true\"\n mode=\"+x\"\n [count]=\"constHtmlDataBadge\"\n [maxCount]=\"99\" />\n }\n }\n @if (fieldConfig.instance === 'button-action-show-popup') {\n <libs_ui-components-buttons-button\n [type]=\"fieldConfig?.dropdownConfig?.button()?.type || 'button-primary'\"\n [sizeButton]=\"fieldConfig?.dropdownConfig?.button()?.sizeButton || 'smaller'\"\n [disable]=\"fieldConfig?.dropdownConfig?.button()?.disable ?? constHtmlDisableDropdown\"\n [label]=\"fieldConfig?.dropdownConfig?.button()?.label || ' '\"\n [classIconLeft]=\"fieldConfig?.dropdownConfig?.button()?.classIconLeft || 'libs-ui-icon-more-vertical rotate-[90deg] mr-0'\"\n [classIconRight]=\"fieldConfig?.dropdownConfig?.button()?.classIconRight || ''\"\n [popover]=\"fieldConfig?.dropdownConfig?.button()?.popover || {}\"\n [classInclude]=\"fieldConfig?.dropdownConfig?.button()?.classInclude || ''\"\n [ignoreStopPropagationEvent]=\"true\" />\n }\n </libs_ui-components-dropdown>\n </div>\n }\n }\n\n @case ('line-clamp') {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\">\n @if (fieldConfig.lineClampConfig; as lineClampConfig) {\n <libs_ui-components-line_clamp\n [ignoreShowButtonCollapseExpand]=\"lineClampConfig.ignoreShowButtonCollapseExpand ?? true\"\n [showTooltip]=\"lineClampConfig.showTooltip ?? true\"\n [maxHeight]=\"lineClampConfig.maxHeight || 36\"\n [maxWidthTooltip]=\"lineClampConfig.maxWidthTooltip || 200\"\n [maxHeightTooltip]=\"lineClampConfig.maxHeightTooltip || 100\"\n [ngClassObject]=\"lineClampConfig.ngClassObject ?? { 'libs-ui-line-clamp-content libs-ui-font-h5r': true }\"\n [isInnerText]=\"lineClampConfig.isInnerText || false\"\n [ignoreStopPropagationTooltipEvent]=\"true\"\n [content]=\"item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async\"\n (click)=\"handlerItemClick($event, fieldConfig)\" />\n }\n </div>\n }\n\n @case ('shape-style') {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [innerHTML]=\"\n item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate | LibsUiPipesSecurityTrustPipe: 'html' : true | async\n \"\n (click)=\"handlerItemClick($event, fieldConfig)\"></div>\n }\n @default {\n <div\n [ngStyle]=\"constHtmlNgStyle\"\n [ngClass]=\"constHtmlNgClass\"\n [innerHTML]=\"\n item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.parseValue : item() | async | translate | LibsUiPipesSecurityTrustPipe: 'html' : true | async\n \"\n (click)=\"handlerItemClick($event, fieldConfig)\"></div>\n }\n }\n } @else {\n @if (fieldConfig.rows) {\n <div\n class=\"w-full flex relative {{ fieldConfig.rowsTemplateCssWrapper }}\"\n [style.height.px]=\"rowRef.clientHeight\">\n <div\n #rowRef\n class=\"w-full flex absolute {{ fieldConfig.rowsTemplateCssWrapper }}\">\n <libs_ui-components-table-templates\n class=\"flex w-full\"\n [item]=\"item\"\n [configs]=\"fieldConfig.rows\" />\n </div>\n </div>\n } @else {\n <ng-container\n *ngComponentOutlet=\"\n item() | LibsUiPipesGetValueOfObjectPipe: fieldConfig.field : undefined : true | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getComponentOutlet : item() | async;\n inputs: undefined | LibsUiPipesCallFunctionInTemplatePipe: fieldConfig.getDataComponentOutlet : item() : fieldConfig.field : { valueIsEmpty: { item: item() } } | async\n \" />\n }\n }\n }\n </div>\n }\n }\n </div>\n }\n}\n", styles: [":host{width:100%;height:100%}:host .libs-ui-table-template{color:#071631;font-size:12px;font-weight:400;width:100%;height:inherit}\n"] }]
|
|
217
|
+
}] });
|
|
218
|
+
|
|
219
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
220
|
+
class LibsUiComponentsTableComponent {
|
|
221
|
+
/** PROPERTY */
|
|
222
|
+
classHeaderContainer = computed(() => `libs-ui-table-header-container w-full absolute flex shrink-0 ${this.ignoreClassBgHeader() ? '' : 'bg-white'} overflow-x-hidden z-[1] items-center ${this.classHeaderContainerInclude() || ''}`);
|
|
223
|
+
classHeaderLeftContainer = computed(() => `h-full flex sticky top-0 left-0 z-[1] ${this.ignoreClassBgHeader() ? '' : 'bg-white'} ${this.classHeaderLeftInclude() || ''}`);
|
|
224
|
+
keysSelected = signal([]);
|
|
225
|
+
loading = signal(false);
|
|
226
|
+
stores = signal([]);
|
|
227
|
+
items = signal([]);
|
|
228
|
+
itemFooter = signal(undefined);
|
|
229
|
+
itemOfIndexHover;
|
|
230
|
+
keySearch = signal('');
|
|
231
|
+
totalItemInBackend = signal(0);
|
|
232
|
+
hasItemHightLight = signal(false);
|
|
233
|
+
totalItemDisplay = computed(() => viewDataNumberByLanguage(this.totalItem() ?? this.totalItemInBackend(), false));
|
|
234
|
+
listConfigMoreItem = computed(() => {
|
|
235
|
+
return {
|
|
236
|
+
type: 'text',
|
|
237
|
+
configTemplateText: signal({
|
|
238
|
+
fieldKey: 'key',
|
|
239
|
+
ignoreIconSelected: true,
|
|
240
|
+
getValue: this.configSelectMoreItem()?.getValue,
|
|
241
|
+
configLabelPopover: signal({
|
|
242
|
+
zIndex: 1200,
|
|
243
|
+
}),
|
|
244
|
+
}),
|
|
245
|
+
httpRequestData: signal({
|
|
246
|
+
objectInstance: returnListObject(this.configSelectMoreItem()?.listOption),
|
|
247
|
+
functionName: 'list',
|
|
248
|
+
argumentsValue: [],
|
|
249
|
+
}),
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
hasScroll = signal(false);
|
|
253
|
+
instanceSort = signal(undefined);
|
|
254
|
+
hasActionButtonDropdownContent = signal(false);
|
|
255
|
+
pagingStore = signal(undefined);
|
|
256
|
+
loadedLastItem = signal(false);
|
|
257
|
+
storeParamsCallApi = signal({});
|
|
258
|
+
timeoutLeaveItem = signal(undefined);
|
|
259
|
+
functionControlSelectMoreItem;
|
|
260
|
+
mouseEnterHeader = signal(false);
|
|
261
|
+
/** INPUT */
|
|
262
|
+
timeHighlighNewItem = input(2000, { transform: (val) => val ?? 2000 });
|
|
263
|
+
headerLeft = input([], { transform: (val) => val ?? [] });
|
|
264
|
+
headerRight = input([], { transform: (val) => val ?? [] });
|
|
265
|
+
ignoreCalculatorWidthHeader = input();
|
|
266
|
+
configTemplateItemCollapseExpand = input();
|
|
267
|
+
showFooter = input();
|
|
268
|
+
ignoreBorderFooter = input();
|
|
269
|
+
customPositionFooter = input('bottom', { transform: (val) => val ?? 'bottom' });
|
|
270
|
+
footerLeft = input();
|
|
271
|
+
footerRight = input();
|
|
272
|
+
disableCheckbox = input(false, { transform: (val) => val ?? false });
|
|
273
|
+
enableUnequalChildrenSizes = input(false, { transform: (val) => val ?? false });
|
|
274
|
+
bufferAmount = input(5, { transform: (val) => (val ? (val > 25 ? 25 : val) : 5) });
|
|
275
|
+
totalItem = input();
|
|
276
|
+
isDashBorder = input();
|
|
277
|
+
classHeaderContainerInclude = input();
|
|
278
|
+
classHeaderLeftInclude = input();
|
|
279
|
+
classBodyInclude = input('', { transform: (val) => val ?? '' });
|
|
280
|
+
classFooterInclude = input('', { transform: (val) => val ?? '' });
|
|
281
|
+
classTableContainerInclude = input('', { transform: (val) => val ?? '' });
|
|
282
|
+
classBarInclude = input('justify-between mb-[16px]');
|
|
283
|
+
fieldKey = input('id', { transform: (val) => val || 'id' }); // tên field định danh item của listDatas
|
|
284
|
+
defaultKeysSelected = input();
|
|
285
|
+
labelBarNoSelectItem = input(`i18n_total_quantity`); // sử dụng để hiên thị khi tích chọn item
|
|
286
|
+
labelBarButtons = input('i18n_number_item_selected', { transform: (val) => val || 'i18n_number_item_selected' }); // sử dụng để hiên thị khi tích chọn item
|
|
287
|
+
classLabelBarButtons = input('', { transform: (val) => val ?? '' }); // sử dụng để hiên thị khi tích chọn item
|
|
288
|
+
barButtons = input();
|
|
289
|
+
sortLocal = input(); // trường hợp nếu sortLocal này không đáp ứng được nghiệp vụ thì mới cân nhắc sử dụng filterLocal
|
|
290
|
+
filterOrSortLocal = input();
|
|
291
|
+
httpRequestData = input();
|
|
292
|
+
httpRequestDataFooter = input();
|
|
293
|
+
newData = input();
|
|
294
|
+
filter = input({ filterData: {} }, { transform: (val) => val ?? { filterData: {} } });
|
|
295
|
+
ignoreBar = input();
|
|
296
|
+
classLabelBarNoSelectItem = input();
|
|
297
|
+
ignoreClassBgHeader = input();
|
|
298
|
+
noDataConfig = input({ textNoData: 'i18n_no_data_yet', textSearchNoData: 'i18n_no_result' });
|
|
299
|
+
showScrollTablePinnedIfNoData = input();
|
|
300
|
+
ignoreBorderItemLast = input();
|
|
301
|
+
isHiddenHeaderWhenNodata = input();
|
|
302
|
+
maxItemSelected = input(100, { transform: (val) => val ?? 100 });
|
|
303
|
+
configSelectMoreItem = input();
|
|
304
|
+
onlyShowNoResult = input();
|
|
305
|
+
ignoreBorderItem = input();
|
|
306
|
+
activityLoadData = input('scroll-infinity', { transform: (val) => val ?? 'scroll-infinity' });
|
|
307
|
+
paginationSetting = input();
|
|
308
|
+
templateNoData = input();
|
|
309
|
+
templateNoResult = input();
|
|
310
|
+
/** OUTPUT */
|
|
311
|
+
outLoadMore = output();
|
|
312
|
+
outScrollIsGone = output();
|
|
313
|
+
outLoading = output();
|
|
314
|
+
outClickButtonAction = output();
|
|
315
|
+
outSort = output();
|
|
316
|
+
outClickBarButton = output();
|
|
317
|
+
outHoverButtonAction = output();
|
|
318
|
+
outKeysSelected = output();
|
|
319
|
+
outFunctionsControl = output();
|
|
320
|
+
outLoadDataComplete = output();
|
|
321
|
+
outTotalItem = output();
|
|
322
|
+
outLoadDataError = output();
|
|
323
|
+
/**VIEW CHILD */
|
|
324
|
+
headerElementRef = viewChild('headerElementRef');
|
|
325
|
+
footerElementRef = viewChild('footerElementRef');
|
|
326
|
+
footerLeftElementRef = viewChild('footerLeftElementRef');
|
|
327
|
+
bodyElementRef = viewChild('bodyElementRef');
|
|
328
|
+
bodyComponentRef = viewChild('bodyComponentRef');
|
|
329
|
+
/**INJECT */
|
|
330
|
+
httpRequestService = inject(LibsUiHttpRequestService);
|
|
331
|
+
destroyRef = inject(DestroyRef);
|
|
332
|
+
cdr = inject(ChangeDetectorRef);
|
|
333
|
+
constructor() {
|
|
334
|
+
effect(() => {
|
|
335
|
+
if (this.defaultKeysSelected()?.length) {
|
|
336
|
+
untracked(() => this.keysSelected.update((keys) => [...keys, ...(this.defaultKeysSelected() || [])]));
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
effect(() => {
|
|
340
|
+
if (this.showFooter()) {
|
|
341
|
+
untracked(() => this.callApiByServiceFooter());
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
effect(() => {
|
|
345
|
+
if (this.newData()?.data().length) {
|
|
346
|
+
untracked(() => this.addItems(this.newData()?.data, !this.newData()?.addToLastList));
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
effect(() => {
|
|
350
|
+
if (!this.filter().filterData || this.filter().ignoreCallApiAuto) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
untracked(() => {
|
|
354
|
+
this.keySearch.set(get(this.filter().filterData, 'keySearch', ''));
|
|
355
|
+
this.storeParamsCallApi.set(cloneDeep(this.filter().filterData));
|
|
356
|
+
if (this.filter()?.filterData && !this.filter().filterData['instanceSort'] && this.instanceSort()) {
|
|
357
|
+
this.storeParamsCallApi.update((data) => ({ ...data, instanceSort: this.instanceSort() }));
|
|
358
|
+
}
|
|
359
|
+
if (this.filterOrSortLocal() && this.stores().length) {
|
|
360
|
+
this.items.set(this.filterOrSortLocal()?.(signal([...this.stores()]), { ...(this.filter().filterData || {}), instanceSort: this.instanceSort() }) || []);
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
this.resetScroll();
|
|
364
|
+
this.callApiByService(true);
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
ngOnInit() {
|
|
369
|
+
this.outFunctionsControl.emit(this.FunctionsControl);
|
|
370
|
+
fromEvent(window, 'resize')
|
|
371
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
372
|
+
.subscribe(() => {
|
|
373
|
+
this.cdr.detectChanges();
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
get FunctionsControl() {
|
|
377
|
+
return {
|
|
378
|
+
reset: this.reset.bind(this),
|
|
379
|
+
callApiByService: this.callApiByService.bind(this),
|
|
380
|
+
resetScroll: this.resetScroll.bind(this),
|
|
381
|
+
addItems: this.addItems.bind(this),
|
|
382
|
+
removeItems: this.removeItems.bind(this),
|
|
383
|
+
getCount: this.getCount.bind(this),
|
|
384
|
+
getScrollContainer: this.getScrollContainer.bind(this),
|
|
385
|
+
hideToolBarBottom: () => {
|
|
386
|
+
return;
|
|
387
|
+
},
|
|
388
|
+
resetKeySelected: () => this.keysSelected.set([]),
|
|
389
|
+
detectChanges: () => this.cdr.detectChanges(),
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
getIndexRow = (data) => {
|
|
393
|
+
return of(this.items().findIndex((item) => item === data.value) + 1);
|
|
394
|
+
};
|
|
395
|
+
getScrollContainer() {
|
|
396
|
+
return this.bodyComponentRef();
|
|
397
|
+
}
|
|
398
|
+
async callApiByService(firstCall, resetAfterCallApi) {
|
|
399
|
+
try {
|
|
400
|
+
if (firstCall) {
|
|
401
|
+
this.loadedLastItem.set(false);
|
|
402
|
+
}
|
|
403
|
+
if (!this.httpRequestData() || this.loading() || this.loadedLastItem()) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
this.loading.set(true);
|
|
407
|
+
this.outLoading.emit(this.loading());
|
|
408
|
+
this.resetIndexHover();
|
|
409
|
+
const { argumentsValue, guideAutoUpdateArgumentsValue } = this.httpRequestData();
|
|
410
|
+
if (guideAutoUpdateArgumentsValue && !guideAutoUpdateArgumentsValue.sortOrderBy && this.instanceSort()) {
|
|
411
|
+
guideAutoUpdateArgumentsValue.sortOrderBy = {
|
|
412
|
+
fieldGetValue: 'storeParamsCallApi.instanceSort.fieldSort',
|
|
413
|
+
fieldUpdate: '[0]',
|
|
414
|
+
subFieldUpdate: 'order_by',
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
if (guideAutoUpdateArgumentsValue && !guideAutoUpdateArgumentsValue.sortOrderType && this.instanceSort()) {
|
|
418
|
+
guideAutoUpdateArgumentsValue.sortOrderType = {
|
|
419
|
+
fieldGetValue: 'storeParamsCallApi.instanceSort.mode',
|
|
420
|
+
fieldUpdate: '[0]',
|
|
421
|
+
subFieldUpdate: 'order_type',
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
if (firstCall) {
|
|
425
|
+
if (!resetAfterCallApi) {
|
|
426
|
+
this.hasScroll.set(false);
|
|
427
|
+
this.stores.set([]);
|
|
428
|
+
this.items.set([]);
|
|
429
|
+
}
|
|
430
|
+
this.loadedLastItem.set(this.httpRequestService.updateArguments(argumentsValue, { ...this.fakeResponseApi(), storeParamsCallApi: this.storeParamsCallApi() }, this.pagingStore() || {}, this.keySearch(), true, this.loadedLastItem(), guideAutoUpdateArgumentsValue));
|
|
431
|
+
}
|
|
432
|
+
const result = await this.httpRequestService.callApi(this.httpRequestData());
|
|
433
|
+
if (firstCall && resetAfterCallApi) {
|
|
434
|
+
this.hasScroll.set(false);
|
|
435
|
+
this.stores.set([]);
|
|
436
|
+
this.items.set([]);
|
|
437
|
+
}
|
|
438
|
+
this.pagingStore.set(result.paging);
|
|
439
|
+
this.totalItemInBackend.set(result.paging?.total_items || 0);
|
|
440
|
+
this.outTotalItem.emit(this.totalItemInBackend());
|
|
441
|
+
if (!this.pagingStore()) {
|
|
442
|
+
this.loadedLastItem.set(true);
|
|
443
|
+
}
|
|
444
|
+
this.loadedLastItem.set(this.httpRequestService.updateArguments(argumentsValue, { ...result, storeParamsCallApi: this.storeParamsCallApi() }, this.pagingStore() || {}, this.keySearch(), true, this.loadedLastItem(), guideAutoUpdateArgumentsValue));
|
|
445
|
+
await this.addItems(convertObjectToSignal(result.data || []), false, true);
|
|
446
|
+
this.outLoadDataComplete.emit(this.stores);
|
|
447
|
+
}
|
|
448
|
+
catch (error) {
|
|
449
|
+
console.log(error);
|
|
450
|
+
this.outLoadDataError.emit(error);
|
|
451
|
+
}
|
|
452
|
+
finally {
|
|
453
|
+
this.loading.set(false);
|
|
454
|
+
this.outLoading.emit(this.loading());
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
fakeResponseApi() {
|
|
458
|
+
this.loadedLastItem.set(false);
|
|
459
|
+
if (this.activityLoadData() === 'scroll-infinity') {
|
|
460
|
+
this.pagingStore.set({});
|
|
461
|
+
}
|
|
462
|
+
return this.httpRequestService.fakeResponsePagingApi();
|
|
463
|
+
}
|
|
464
|
+
async callApiByServiceFooter() {
|
|
465
|
+
if (!this.httpRequestDataFooter() || !this.showFooter()) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
const { argumentsValue, guideAutoUpdateArgumentsValue } = this.httpRequestDataFooter();
|
|
469
|
+
this.httpRequestService.updateArguments(argumentsValue, { storeParamsCallApi: this.storeParamsCallApi() }, this.pagingStore() || {}, this.keySearch(), true, false, guideAutoUpdateArgumentsValue);
|
|
470
|
+
const result = await this.httpRequestService.callApi(this.httpRequestDataFooter());
|
|
471
|
+
this.itemFooter.set(convertObjectToSignal(result.data));
|
|
472
|
+
}
|
|
473
|
+
async addItems(items, addFirst, ignoreHightLight, ignoreReCallFooter, autoCountNewItem) {
|
|
474
|
+
if (!items() || !items().length) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
const itemsAdd = [];
|
|
478
|
+
items().forEach((item) => {
|
|
479
|
+
if (!this.checkExistItem(item)) {
|
|
480
|
+
itemsAdd.push(item);
|
|
481
|
+
if (!ignoreHightLight) {
|
|
482
|
+
this.hasItemHightLight.set(true);
|
|
483
|
+
item.update((data) => ({ ...data, specificHightLight: true }));
|
|
484
|
+
}
|
|
485
|
+
if (addFirst) {
|
|
486
|
+
this.items.update((data) => [item, ...data]);
|
|
487
|
+
this.stores.update((data) => [item, ...data]);
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
this.items.update((data) => [...data, item]);
|
|
491
|
+
this.stores.update((data) => [...data, item]);
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
if (autoCountNewItem && itemsAdd.length) {
|
|
495
|
+
this.totalItemInBackend.update((value) => value + itemsAdd.length);
|
|
496
|
+
}
|
|
497
|
+
if (!ignoreHightLight) {
|
|
498
|
+
setTimeout(() => {
|
|
499
|
+
itemsAdd.forEach((item) => item.update((data) => ({ ...data, specificHightLight: false })));
|
|
500
|
+
this.hasItemHightLight.set(false);
|
|
501
|
+
}, this.timeHighlighNewItem());
|
|
502
|
+
}
|
|
503
|
+
await this.checkScroll();
|
|
504
|
+
if (!ignoreReCallFooter) {
|
|
505
|
+
await this.callApiByServiceFooter();
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
checkExistItem(itemNew) {
|
|
509
|
+
return this.items().find((item) => `${item()[this.fieldKey()]}` === `${itemNew()[this.fieldKey()]}`) ? true : false;
|
|
510
|
+
}
|
|
511
|
+
async removeItems(keys, ignoreReCallFooter) {
|
|
512
|
+
this.resetIndexHover();
|
|
513
|
+
if (!this.items().length) {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
keys.forEach((key) => {
|
|
517
|
+
this.items.update((items) => {
|
|
518
|
+
let isUpdate = false;
|
|
519
|
+
const newItems = items.filter((item) => {
|
|
520
|
+
if (`${item()[this.fieldKey()]}` === `${key}`) {
|
|
521
|
+
isUpdate = true;
|
|
522
|
+
return false;
|
|
523
|
+
}
|
|
524
|
+
return true;
|
|
525
|
+
});
|
|
526
|
+
return isUpdate ? newItems : items;
|
|
527
|
+
});
|
|
528
|
+
this.stores.update((items) => {
|
|
529
|
+
let isUpdate = false;
|
|
530
|
+
const newItems = items.filter((item) => {
|
|
531
|
+
if (`${item()[this.fieldKey()]}` === `${key}`) {
|
|
532
|
+
isUpdate = true;
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
return true;
|
|
536
|
+
});
|
|
537
|
+
return isUpdate ? newItems : items;
|
|
538
|
+
});
|
|
539
|
+
if (!this.keysSelected() || !this.keysSelected().length) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
this.keysSelected.update((keys) => keys.filter((keySelected) => keySelected !== key));
|
|
543
|
+
});
|
|
544
|
+
this.totalItemInBackend.update((value) => value - keys.length);
|
|
545
|
+
await this.checkScroll();
|
|
546
|
+
if (!ignoreReCallFooter) {
|
|
547
|
+
await this.callApiByServiceFooter();
|
|
548
|
+
}
|
|
549
|
+
this.outKeysSelected.emit({ keys: this.keysSelected() });
|
|
550
|
+
}
|
|
551
|
+
getCount() {
|
|
552
|
+
if (this.httpRequestData()) {
|
|
553
|
+
return this.pagingStore()?.total_items || this.items().length;
|
|
554
|
+
}
|
|
555
|
+
return this.items().length;
|
|
556
|
+
}
|
|
557
|
+
loadMoreSuccess(data) {
|
|
558
|
+
this.addItems(data, false);
|
|
559
|
+
this.loading.set(false);
|
|
560
|
+
this.outLoading.emit(this.loading());
|
|
561
|
+
}
|
|
562
|
+
handlerChangeAllChecked() {
|
|
563
|
+
this.keysSelected.set([]);
|
|
564
|
+
this.outKeysSelected.emit({ keys: this.keysSelected() });
|
|
565
|
+
}
|
|
566
|
+
handlerChangeCheckedAllItems(event) {
|
|
567
|
+
if (event.checked) {
|
|
568
|
+
this.keysSelected.set(this.items()
|
|
569
|
+
.filter(async (item) => !(await this.checkCancelConditionCheckedItem(item)))
|
|
570
|
+
.map((item) => `${item()[this.fieldKey()]}`));
|
|
571
|
+
this.outKeysSelected.emit({ keys: this.keysSelected() });
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
this.keysSelected.set([]);
|
|
575
|
+
this.outKeysSelected.emit({ keys: this.keysSelected() });
|
|
576
|
+
}
|
|
577
|
+
async checkCancelConditionCheckedItem(item) {
|
|
578
|
+
let isCancelCheck = false;
|
|
579
|
+
if (!isCancelCheck && this.headerLeft().length && this.headerLeft()[0].checkConditionCheckBoxHidden) {
|
|
580
|
+
isCancelCheck = (await lastValueFrom(this.headerLeft()[0].checkConditionCheckBoxHidden({ item: item() }))) || false;
|
|
581
|
+
}
|
|
582
|
+
if (!isCancelCheck && this.headerRight().length && this.headerRight()[0].checkConditionCheckBoxHidden) {
|
|
583
|
+
isCancelCheck = (await lastValueFrom(this.headerRight()[0].checkConditionCheckBoxHidden({ item: item() }))) || false;
|
|
584
|
+
}
|
|
585
|
+
return isCancelCheck;
|
|
586
|
+
}
|
|
587
|
+
handlerChangeItemChecked(event, item) {
|
|
588
|
+
const key = item[this.fieldKey()];
|
|
589
|
+
const keys = new Set(this.keysSelected());
|
|
590
|
+
keys.add(key);
|
|
591
|
+
if (!event.checked) {
|
|
592
|
+
keys.delete(key);
|
|
593
|
+
}
|
|
594
|
+
this.keysSelected.set(Array.from(keys));
|
|
595
|
+
this.outKeysSelected.emit({ keys: this.keysSelected() });
|
|
596
|
+
}
|
|
597
|
+
async handlerChangeSort(sort) {
|
|
598
|
+
const scrollLeft = this.headerElementRef()?.nativeElement.scrollLeft || 0;
|
|
599
|
+
if (this.instanceSort && this.instanceSort()?.fieldSort !== sort.fieldSort) {
|
|
600
|
+
this.instanceSort()?.reset();
|
|
601
|
+
}
|
|
602
|
+
this.instanceSort.set(sort);
|
|
603
|
+
if (this.sortLocal()) {
|
|
604
|
+
this.handlerSortLocal(sort, scrollLeft);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
this.storeParamsCallApi.update((data) => ({ ...data, instanceSort: this.instanceSort() }));
|
|
608
|
+
this.outSort.emit({
|
|
609
|
+
sort: sort,
|
|
610
|
+
onSortSuccess: () => this.onSortSuccess(scrollLeft),
|
|
611
|
+
});
|
|
612
|
+
try {
|
|
613
|
+
await this.callApiByService(true);
|
|
614
|
+
this.onSortSuccess(scrollLeft);
|
|
615
|
+
}
|
|
616
|
+
catch (error) {
|
|
617
|
+
console.log(error);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
handlerSortLocal(sort, scrollLeft) {
|
|
621
|
+
if (this.filterOrSortLocal() && this.stores().length) {
|
|
622
|
+
this.items.set(this.filterOrSortLocal()?.(signal([...this.stores()]), { ...this.storeParamsCallApi(), instanceSort: sort }) || []);
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
const { fieldSort, mode } = sort;
|
|
626
|
+
this.items.update((items) => {
|
|
627
|
+
items.sort((itemA, itemB) => {
|
|
628
|
+
let value1 = mode === 'asc' ? itemA()[fieldSort] : itemB()[fieldSort];
|
|
629
|
+
let value2 = mode === 'asc' ? itemB()[fieldSort] : itemA()[fieldSort];
|
|
630
|
+
if (typeof value1 === 'string' && typeof value2 === 'string') {
|
|
631
|
+
value1 = deleteUnicode(value1).toLocaleLowerCase();
|
|
632
|
+
value2 = deleteUnicode(value2).toLocaleLowerCase();
|
|
633
|
+
}
|
|
634
|
+
if (value1 === value2) {
|
|
635
|
+
return 0;
|
|
636
|
+
}
|
|
637
|
+
return value1 > value2 ? 1 : -1;
|
|
638
|
+
});
|
|
639
|
+
return [...items];
|
|
640
|
+
});
|
|
641
|
+
this.onSortSuccess(scrollLeft);
|
|
642
|
+
}
|
|
643
|
+
handlerFunctionControlMoreSelectItem(functionControl) {
|
|
644
|
+
this.functionControlSelectMoreItem = functionControl;
|
|
645
|
+
}
|
|
646
|
+
handlerSelectedMoreItem(event) {
|
|
647
|
+
if (!event || !event.key || !this.configSelectMoreItem()) {
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
this.functionControlSelectMoreItem?.reset();
|
|
651
|
+
const perPage = Number(event.key).valueOf();
|
|
652
|
+
const currentPerPage = Number(this.setPerPageSelectMoreItem(perPage)).valueOf();
|
|
653
|
+
const isPagingNumber = this.configSelectMoreItem()?.pagingNumber;
|
|
654
|
+
if (currentPerPage > perPage || this.items.length >= perPage) {
|
|
655
|
+
if (!isPagingNumber) {
|
|
656
|
+
this.setPerPageSelectMoreItem(currentPerPage);
|
|
657
|
+
}
|
|
658
|
+
this.keysSelected.set(this.items()
|
|
659
|
+
.slice(0, perPage)
|
|
660
|
+
.map((item) => `${item()[this.fieldKey()]}`));
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
this.callApiByService(true, true);
|
|
664
|
+
const sub = this.outLoadDataComplete.subscribe(() => {
|
|
665
|
+
sub.unsubscribe();
|
|
666
|
+
if (!isPagingNumber) {
|
|
667
|
+
this.setPerPageSelectMoreItem(currentPerPage);
|
|
668
|
+
}
|
|
669
|
+
this.keysSelected.set(this.items()
|
|
670
|
+
.slice(0, perPage)
|
|
671
|
+
.map((item) => `${item()[this.fieldKey()]}`));
|
|
672
|
+
});
|
|
673
|
+
this.outLoadDataError.subscribe(() => {
|
|
674
|
+
this.setPerPageSelectMoreItem(currentPerPage);
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
setPerPageSelectMoreItem(perPage) {
|
|
678
|
+
const argumentsValue = this.httpRequestData()?.argumentsValue;
|
|
679
|
+
if (!argumentsValue || !this.configSelectMoreItem()) {
|
|
680
|
+
return '-1';
|
|
681
|
+
}
|
|
682
|
+
const keyPerPage = this.configSelectMoreItem()?.keyPerPage || 'per_page';
|
|
683
|
+
for (let i = 0; i < argumentsValue.length; i++) {
|
|
684
|
+
let argument = argumentsValue[i];
|
|
685
|
+
if (argument instanceof HttpParams && argument.has(keyPerPage)) {
|
|
686
|
+
const currentPerPage = get(argument, keyPerPage, '25');
|
|
687
|
+
argument = argument.set(keyPerPage, perPage);
|
|
688
|
+
set(argumentsValue, `${i}`, argument);
|
|
689
|
+
return currentPerPage;
|
|
690
|
+
}
|
|
691
|
+
if (argument instanceof Object && Object.keys(argument).includes(keyPerPage)) {
|
|
692
|
+
const currentPerPage = get(argument, keyPerPage, '25');
|
|
693
|
+
set(argument, keyPerPage, perPage);
|
|
694
|
+
return currentPerPage;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
return '-1';
|
|
698
|
+
}
|
|
699
|
+
onSortSuccess(scrollLeft) {
|
|
700
|
+
this.resetScroll(scrollLeft, 0);
|
|
701
|
+
this.loading.set(false);
|
|
702
|
+
this.outLoading.emit(this.loading());
|
|
703
|
+
}
|
|
704
|
+
handlerButtonClick(type, buttonDropdownData, button) {
|
|
705
|
+
// buttonOrigin chỉ sử dụng khi dùng buttonActions có button-dropdown
|
|
706
|
+
if (type === 'button') {
|
|
707
|
+
return this.outClickButtonAction.emit({ item: this.itemOfIndexHover, button: button });
|
|
708
|
+
}
|
|
709
|
+
this.outClickButtonAction.emit({ item: this.itemOfIndexHover, button, buttonDropdownData });
|
|
710
|
+
}
|
|
711
|
+
handlerBarButtonClick(button) {
|
|
712
|
+
const items = [];
|
|
713
|
+
this.keysSelected().forEach((key) => {
|
|
714
|
+
const item = this.items().find((item) => `${item()[this.fieldKey()]}` === `${key}`);
|
|
715
|
+
if (item) {
|
|
716
|
+
items.push(item);
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
return this.outClickBarButton.emit({
|
|
720
|
+
button,
|
|
721
|
+
items,
|
|
722
|
+
keys: this.keysSelected(),
|
|
723
|
+
hiddenBarButtons: () => {
|
|
724
|
+
return;
|
|
725
|
+
},
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
handlerButtonDropdownEvent(eventName) {
|
|
729
|
+
this.hasActionButtonDropdownContent.set(true);
|
|
730
|
+
if (eventName === 'remove' || eventName === 'mouseleave-content') {
|
|
731
|
+
this.hasActionButtonDropdownContent.set(false);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
setIndexHover(e, item) {
|
|
735
|
+
e.stopPropagation();
|
|
736
|
+
if (!this.items().length) {
|
|
737
|
+
this.resetIndexHover();
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
this.itemOfIndexHover = item;
|
|
741
|
+
}
|
|
742
|
+
resetIndexHoverWhenMouseLeave(e) {
|
|
743
|
+
e?.stopPropagation();
|
|
744
|
+
const currentIndexItemHover = this.itemOfIndexHover;
|
|
745
|
+
clearTimeout(this.timeoutLeaveItem());
|
|
746
|
+
this.timeoutLeaveItem.set(setTimeout(() => {
|
|
747
|
+
if (this.itemOfIndexHover && this.itemOfIndexHover !== currentIndexItemHover) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
this.resetIndexHover(e);
|
|
751
|
+
}));
|
|
752
|
+
}
|
|
753
|
+
resetIndexHover(e) {
|
|
754
|
+
e?.stopPropagation();
|
|
755
|
+
if (this.hasActionButtonDropdownContent()) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
this.itemOfIndexHover = undefined;
|
|
759
|
+
}
|
|
760
|
+
handlerMouseLeaveContainer(event) {
|
|
761
|
+
event.stopPropagation();
|
|
762
|
+
this.resetIndexHover(event);
|
|
763
|
+
}
|
|
764
|
+
handlerMouseEnterHeader(event) {
|
|
765
|
+
event.stopPropagation();
|
|
766
|
+
this.mouseEnterHeader.set(true);
|
|
767
|
+
this.resetIndexHover(event);
|
|
768
|
+
}
|
|
769
|
+
handlerMouseLeaveHeader(event) {
|
|
770
|
+
event.stopPropagation();
|
|
771
|
+
this.mouseEnterHeader.set(false);
|
|
772
|
+
this.resetIndexHover(event);
|
|
773
|
+
}
|
|
774
|
+
handlerMouseEnterFooter(event) {
|
|
775
|
+
event.stopPropagation();
|
|
776
|
+
this.resetIndexHover(event);
|
|
777
|
+
if (this.classFooterInclude()) {
|
|
778
|
+
this.footerElementRef()?.nativeElement?.classList.remove('bg-[#f8f9fa]');
|
|
779
|
+
this.footerLeftElementRef()?.nativeElement?.classList.remove('bg-[#f8f9fa]');
|
|
780
|
+
this.footerElementRef()?.nativeElement?.classList.add(this.classFooterInclude());
|
|
781
|
+
this.footerLeftElementRef()?.nativeElement?.classList.add(this.classFooterInclude());
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
handlerMouseLeaveFooter(event) {
|
|
785
|
+
event.stopPropagation();
|
|
786
|
+
if (this.classFooterInclude()) {
|
|
787
|
+
this.footerElementRef()?.nativeElement?.classList.remove(this.classFooterInclude());
|
|
788
|
+
this.footerLeftElementRef()?.nativeElement?.classList.remove(this.classFooterInclude());
|
|
789
|
+
this.footerElementRef()?.nativeElement?.classList.add('bg-[#f8f9fa]');
|
|
790
|
+
this.footerLeftElementRef()?.nativeElement?.classList.add('bg-[#f8f9fa]');
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
handlerScrollHeader(e) {
|
|
794
|
+
e.stopPropagation();
|
|
795
|
+
if (!this.mouseEnterHeader()) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
this.bodyElementRef().nativeElement.scrollLeft = e.target.scrollLeft;
|
|
799
|
+
if (this.footerElementRef()) {
|
|
800
|
+
this.footerElementRef().nativeElement.scrollLeft = e.target.scrollLeft;
|
|
801
|
+
}
|
|
802
|
+
this.resetIndexHover(e);
|
|
803
|
+
}
|
|
804
|
+
handlerScrollBody(e) {
|
|
805
|
+
e.stopPropagation();
|
|
806
|
+
if (this.mouseEnterHeader()) {
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
this.headerElementRef().nativeElement.scrollLeft = e.target.scrollLeft;
|
|
810
|
+
if (this.footerElementRef()) {
|
|
811
|
+
this.footerElementRef().nativeElement.scrollLeft = e.target.scrollLeft;
|
|
812
|
+
}
|
|
813
|
+
this.resetIndexHover(e);
|
|
814
|
+
}
|
|
815
|
+
handlerScrollBottom(e) {
|
|
816
|
+
e.stopPropagation();
|
|
817
|
+
if (this.loading() || this.activityLoadData() !== 'scroll-infinity') {
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
this.outLoadMore.emit({ loadMoreSuccess: this.loadMoreSuccess.bind(this) });
|
|
821
|
+
this.callApiByService(false);
|
|
822
|
+
}
|
|
823
|
+
handlerChangePage(page) {
|
|
824
|
+
this.pagingStore.update((data) => ({ ...(data || {}), page }));
|
|
825
|
+
this.callApiByService(true);
|
|
826
|
+
}
|
|
827
|
+
resetScroll(scrollPositionLeft, scrollPositionTop) {
|
|
828
|
+
if (this.headerElementRef()) {
|
|
829
|
+
this.headerElementRef().nativeElement.scrollLeft = scrollPositionLeft || 0;
|
|
830
|
+
}
|
|
831
|
+
if (this.BodyElement) {
|
|
832
|
+
this.BodyElement.scrollTop = scrollPositionTop || 0;
|
|
833
|
+
this.BodyElement.scrollLeft = scrollPositionLeft || 0;
|
|
834
|
+
}
|
|
835
|
+
if (this.footerElementRef()) {
|
|
836
|
+
this.footerElementRef().nativeElement.scrollLeft = scrollPositionLeft || 0;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
reset(clearSort) {
|
|
840
|
+
if (clearSort) {
|
|
841
|
+
this.instanceSort()?.reset();
|
|
842
|
+
this.instanceSort.set(undefined);
|
|
843
|
+
}
|
|
844
|
+
this.hasScroll.set(false);
|
|
845
|
+
this.loading.set(false);
|
|
846
|
+
this.outLoading.emit(this.loading());
|
|
847
|
+
this.items.set([]);
|
|
848
|
+
this.stores.set([]);
|
|
849
|
+
this.fakeResponseApi();
|
|
850
|
+
this.resetScroll();
|
|
851
|
+
}
|
|
852
|
+
async checkScroll() {
|
|
853
|
+
const hasScroll = this.hasScroll();
|
|
854
|
+
return new Promise((resolve) => {
|
|
855
|
+
timer(500)
|
|
856
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
857
|
+
.subscribe(() => {
|
|
858
|
+
if (this.BodyElement) {
|
|
859
|
+
this.hasScroll.set(this.BodyElement.scrollHeight > this.BodyElement.offsetHeight);
|
|
860
|
+
}
|
|
861
|
+
if (hasScroll && !this.hasScroll()) {
|
|
862
|
+
this.outScrollIsGone.emit({});
|
|
863
|
+
if (!this.filterOrSortLocal()) {
|
|
864
|
+
this.callApiByService(true);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
resolve();
|
|
868
|
+
});
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
get BodyElement() {
|
|
872
|
+
return this.bodyElementRef()?.nativeElement;
|
|
873
|
+
}
|
|
874
|
+
ngOnDestroy() {
|
|
875
|
+
clearTimeout(this.timeoutLeaveItem());
|
|
876
|
+
}
|
|
877
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
878
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsTableComponent, isStandalone: true, selector: "libs_ui-components-table", inputs: { timeHighlighNewItem: { classPropertyName: "timeHighlighNewItem", publicName: "timeHighlighNewItem", isSignal: true, isRequired: false, transformFunction: null }, headerLeft: { classPropertyName: "headerLeft", publicName: "headerLeft", isSignal: true, isRequired: false, transformFunction: null }, headerRight: { classPropertyName: "headerRight", publicName: "headerRight", isSignal: true, isRequired: false, transformFunction: null }, ignoreCalculatorWidthHeader: { classPropertyName: "ignoreCalculatorWidthHeader", publicName: "ignoreCalculatorWidthHeader", isSignal: true, isRequired: false, transformFunction: null }, configTemplateItemCollapseExpand: { classPropertyName: "configTemplateItemCollapseExpand", publicName: "configTemplateItemCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, ignoreBorderFooter: { classPropertyName: "ignoreBorderFooter", publicName: "ignoreBorderFooter", isSignal: true, isRequired: false, transformFunction: null }, customPositionFooter: { classPropertyName: "customPositionFooter", publicName: "customPositionFooter", isSignal: true, isRequired: false, transformFunction: null }, footerLeft: { classPropertyName: "footerLeft", publicName: "footerLeft", isSignal: true, isRequired: false, transformFunction: null }, footerRight: { classPropertyName: "footerRight", publicName: "footerRight", isSignal: true, isRequired: false, transformFunction: null }, disableCheckbox: { classPropertyName: "disableCheckbox", publicName: "disableCheckbox", isSignal: true, isRequired: false, transformFunction: null }, enableUnequalChildrenSizes: { classPropertyName: "enableUnequalChildrenSizes", publicName: "enableUnequalChildrenSizes", isSignal: true, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: true, isRequired: false, transformFunction: null }, totalItem: { classPropertyName: "totalItem", publicName: "totalItem", isSignal: true, isRequired: false, transformFunction: null }, isDashBorder: { classPropertyName: "isDashBorder", publicName: "isDashBorder", isSignal: true, isRequired: false, transformFunction: null }, classHeaderContainerInclude: { classPropertyName: "classHeaderContainerInclude", publicName: "classHeaderContainerInclude", isSignal: true, isRequired: false, transformFunction: null }, classHeaderLeftInclude: { classPropertyName: "classHeaderLeftInclude", publicName: "classHeaderLeftInclude", isSignal: true, isRequired: false, transformFunction: null }, classBodyInclude: { classPropertyName: "classBodyInclude", publicName: "classBodyInclude", isSignal: true, isRequired: false, transformFunction: null }, classFooterInclude: { classPropertyName: "classFooterInclude", publicName: "classFooterInclude", isSignal: true, isRequired: false, transformFunction: null }, classTableContainerInclude: { classPropertyName: "classTableContainerInclude", publicName: "classTableContainerInclude", isSignal: true, isRequired: false, transformFunction: null }, classBarInclude: { classPropertyName: "classBarInclude", publicName: "classBarInclude", isSignal: true, isRequired: false, transformFunction: null }, fieldKey: { classPropertyName: "fieldKey", publicName: "fieldKey", isSignal: true, isRequired: false, transformFunction: null }, defaultKeysSelected: { classPropertyName: "defaultKeysSelected", publicName: "defaultKeysSelected", isSignal: true, isRequired: false, transformFunction: null }, labelBarNoSelectItem: { classPropertyName: "labelBarNoSelectItem", publicName: "labelBarNoSelectItem", isSignal: true, isRequired: false, transformFunction: null }, labelBarButtons: { classPropertyName: "labelBarButtons", publicName: "labelBarButtons", isSignal: true, isRequired: false, transformFunction: null }, classLabelBarButtons: { classPropertyName: "classLabelBarButtons", publicName: "classLabelBarButtons", isSignal: true, isRequired: false, transformFunction: null }, barButtons: { classPropertyName: "barButtons", publicName: "barButtons", isSignal: true, isRequired: false, transformFunction: null }, sortLocal: { classPropertyName: "sortLocal", publicName: "sortLocal", isSignal: true, isRequired: false, transformFunction: null }, filterOrSortLocal: { classPropertyName: "filterOrSortLocal", publicName: "filterOrSortLocal", isSignal: true, isRequired: false, transformFunction: null }, httpRequestData: { classPropertyName: "httpRequestData", publicName: "httpRequestData", isSignal: true, isRequired: false, transformFunction: null }, httpRequestDataFooter: { classPropertyName: "httpRequestDataFooter", publicName: "httpRequestDataFooter", isSignal: true, isRequired: false, transformFunction: null }, newData: { classPropertyName: "newData", publicName: "newData", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, ignoreBar: { classPropertyName: "ignoreBar", publicName: "ignoreBar", isSignal: true, isRequired: false, transformFunction: null }, classLabelBarNoSelectItem: { classPropertyName: "classLabelBarNoSelectItem", publicName: "classLabelBarNoSelectItem", isSignal: true, isRequired: false, transformFunction: null }, ignoreClassBgHeader: { classPropertyName: "ignoreClassBgHeader", publicName: "ignoreClassBgHeader", isSignal: true, isRequired: false, transformFunction: null }, noDataConfig: { classPropertyName: "noDataConfig", publicName: "noDataConfig", isSignal: true, isRequired: false, transformFunction: null }, showScrollTablePinnedIfNoData: { classPropertyName: "showScrollTablePinnedIfNoData", publicName: "showScrollTablePinnedIfNoData", isSignal: true, isRequired: false, transformFunction: null }, ignoreBorderItemLast: { classPropertyName: "ignoreBorderItemLast", publicName: "ignoreBorderItemLast", isSignal: true, isRequired: false, transformFunction: null }, isHiddenHeaderWhenNodata: { classPropertyName: "isHiddenHeaderWhenNodata", publicName: "isHiddenHeaderWhenNodata", isSignal: true, isRequired: false, transformFunction: null }, maxItemSelected: { classPropertyName: "maxItemSelected", publicName: "maxItemSelected", isSignal: true, isRequired: false, transformFunction: null }, configSelectMoreItem: { classPropertyName: "configSelectMoreItem", publicName: "configSelectMoreItem", isSignal: true, isRequired: false, transformFunction: null }, onlyShowNoResult: { classPropertyName: "onlyShowNoResult", publicName: "onlyShowNoResult", isSignal: true, isRequired: false, transformFunction: null }, ignoreBorderItem: { classPropertyName: "ignoreBorderItem", publicName: "ignoreBorderItem", isSignal: true, isRequired: false, transformFunction: null }, activityLoadData: { classPropertyName: "activityLoadData", publicName: "activityLoadData", isSignal: true, isRequired: false, transformFunction: null }, paginationSetting: { classPropertyName: "paginationSetting", publicName: "paginationSetting", isSignal: true, isRequired: false, transformFunction: null }, templateNoData: { classPropertyName: "templateNoData", publicName: "templateNoData", isSignal: true, isRequired: false, transformFunction: null }, templateNoResult: { classPropertyName: "templateNoResult", publicName: "templateNoResult", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outLoadMore: "outLoadMore", outScrollIsGone: "outScrollIsGone", outLoading: "outLoading", outClickButtonAction: "outClickButtonAction", outSort: "outSort", outClickBarButton: "outClickBarButton", outHoverButtonAction: "outHoverButtonAction", outKeysSelected: "outKeysSelected", outFunctionsControl: "outFunctionsControl", outLoadDataComplete: "outLoadDataComplete", outTotalItem: "outTotalItem", outLoadDataError: "outLoadDataError" }, viewQueries: [{ propertyName: "headerElementRef", first: true, predicate: ["headerElementRef"], descendants: true, isSignal: true }, { propertyName: "footerElementRef", first: true, predicate: ["footerElementRef"], descendants: true, isSignal: true }, { propertyName: "footerLeftElementRef", first: true, predicate: ["footerLeftElementRef"], descendants: true, isSignal: true }, { propertyName: "bodyElementRef", first: true, predicate: ["bodyElementRef"], descendants: true, isSignal: true }, { propertyName: "bodyComponentRef", first: true, predicate: ["bodyComponentRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col w-full h-full\">\n @if (!ignoreBar()) {\n <div\n class=\"flex items-center relative z-[1] bottom-0 left-0 w-full bg-white libs-ui-table-shadow-bottom {{ classBarInclude() }}\"\n [class.px-[16px]]=\"keysSelected().length || labelBarNoSelectItem()\"\n [class.py-[6px]]=\"keysSelected().length || labelBarNoSelectItem()\"\n (mouseenter)=\"resetIndexHover($event)\">\n <ng-content select=\"div.libs-ui-table-bar-left\"></ng-content>\n @if (!keysSelected().length && labelBarNoSelectItem()) {\n <div\n class=\"{{ classLabelBarNoSelectItem() ?? 'px-[12px] py-[5px]' }}\"\n [innerHtml]=\"labelBarNoSelectItem() | translate: { value: totalItemDisplay() }\"></div>\n }\n @if (keysSelected().length) {\n <div class=\"flex items-center pl-[12px]\">\n <div class=\"flex items-center h-full mt-[-2px]\">\n <libs_ui-components-checkbox-single\n [checked]=\"true\"\n [disable]=\"loading() || disableCheckbox()\"\n (outChange)=\"handlerChangeAllChecked()\" />\n </div>\n <div class=\"libs-ui-font-h5m text-[#071631] mr-[8px] {{ classLabelBarButtons() }}\">\n {{ labelBarButtons() | translate: { value: keysSelected().length } }}\n </div>\n @if (configSelectMoreItem()) {\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{\n widthByParent: false,\n ignoreArrow: true,\n maxHeight: 2048,\n classInclude: '!w-[121px]',\n position: {\n mode: 'start',\n distance: 0,\n },\n }\"\n [listConfig]=\"listConfigMoreItem()\"\n [listHiddenInputSearch]=\"true\"\n [listMaxItemShow]=\"5\"\n class=\"!w-[16px] h-[16px] mr-[8px]\"\n (outSelectKey)=\"handlerSelectedMoreItem($event)\"\n (outFunctionsControl)=\"handlerFunctionControlMoreSelectItem($event)\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classInclude]=\"'!p-0 m-0'\"\n [classIconLeft]=\"'before:!text-[16px] libs-ui-icon-move-right rotate-90 mr-[6px]'\"\n [popover]=\"{ config: { content: 'i18n_more_select' } }\"\n [ignoreStopPropagationEvent]=\"true\" />\n </libs_ui-components-dropdown>\n }\n <div class=\"h-[16px] libs-ui-border-left-general ml-[16px]\"></div>\n @if (barButtons()?.length) {\n @for (button of barButtons(); track button) {\n @let constHtmlLabel = button.label || ' ';\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-link-primary'\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [classInclude]=\"button.classInclude || ''\"\n [label]=\"constHtmlLabel | translate\"\n (outClick)=\"handlerBarButtonClick(button)\" />\n }\n }\n </div>\n }\n <ng-content select=\"div.libs-ui-table-bar-right\"></ng-content>\n </div>\n }\n\n <div\n #tableContainerElementRef\n class=\"libs-ui-table flex flex-col w-full h-full relative {{ classTableContainerInclude() }}\"\n [class.px-[16px]]=\"!ignoreBar()\"\n (mouseleave)=\"handlerMouseLeaveContainer($event)\">\n <div\n class=\"relative w-full shrink-0\"\n [style.height.px]=\"headerElementRef.offsetHeight\">\n <div\n #headerElementRef\n LibsUiComponentsScrollOverlayDirective\n [options]=\"{ scrollbarWidth: 0 }\"\n [class.libs-ui-border-bottom-dashed-general]=\"!hasItemHightLight() && isDashBorder()\"\n [class.libs-ui-border-bottom-general]=\"!hasItemHightLight() && !isDashBorder()\"\n [class.!hidden]=\"!items().length && isHiddenHeaderWhenNodata()\"\n [class]=\"classHeaderContainer()\"\n (outScroll)=\"handlerScrollHeader($event)\"\n (mouseenter)=\"handlerMouseEnterHeader($event)\"\n (mouseleave)=\"handlerMouseLeaveHeader($event)\">\n @if (headerLeft().length) {\n <div [class]=\"classHeaderLeftContainer()\">\n @for (header of headerLeft(); track header) {\n <ng-container *ngTemplateOutlet=\"templateHeaderRef; context: { headerItem: header, isHeaderLeft: true }\" />\n }\n </div>\n }\n @if (headerRight().length) {\n @for (header of headerRight(); track header) {\n <ng-container *ngTemplateOutlet=\"templateHeaderRef; context: { headerItem: header, isHeaderLeft: false }\" />\n }\n }\n </div>\n </div>\n @if (showFooter() && itemFooter() && customPositionFooter() === 'top') {\n <ng-container *ngTemplateOutlet=\"templateFooterRef\" />\n }\n <div class=\"relative flex flex-col w-full h-full overflow-x-hidden bg-white {{ classBodyInclude() || '' }}\">\n <div\n #bodyElementRef\n class=\"flex h-full w-full relative\"\n LibsUiComponentsScrollOverlayDirective\n (outScroll)=\"handlerScrollBody($event)\"\n (outScrollBottom)=\"handlerScrollBottom($event)\">\n @if (items().length) {\n <virtual-scroller\n #bodyComponentRef\n [items]=\"items()\"\n [enableUnequalChildrenSizes]=\"enableUnequalChildrenSizes()\"\n class=\"h-full\"\n [style.width.px]=\"headerElementRef.scrollWidth > (bodyElementRef ? bodyElementRef.scrollWidth : 0) ? headerElementRef.scrollWidth : undefined\"\n [parentScroll]=\"bodyElementRef\"\n [bufferAmount]=\"bufferAmount()\">\n @for (data of bodyComponentRef.viewPortItems; track data()) {\n <div\n #elementHover\n class=\"flex\"\n [class.bg-[#f3fcfc]]=\"data().specificHightLight\"\n [class.libs-ui-border-top-1px-36d3d3]=\"data().specificHightLight && $first && !ignoreBorderItem()\"\n [class.libs-ui-border-bottom-1px-36d3d3]=\"data().specificHightLight && !ignoreBorderItem()\"\n [ngClass]=\"\n data().specificHightLight || ($last && ignoreBorderItemLast())\n ? 'libs-ui-border-radius-bottom-left-4px libs-ui-border-radius-bottom-right-4px'\n : ignoreBorderItem()\n ? ''\n : isDashBorder()\n ? 'libs-ui-border-bottom-dashed-general'\n : 'libs-ui-border-bottom-general'\n \"\n [style.width.px]=\"headerElementRef.scrollWidth\"\n [class.bg-[#f8f9fa]]=\"itemOfIndexHover === data && !data().specificHightLight\"\n (mouseenter)=\"setIndexHover($event, data)\"\n (mouseleave)=\"resetIndexHoverWhenMouseLeave($event)\">\n @if (headerLeft().length || headerRight().length) {\n <div class=\"flex flex-col w-full\">\n <div class=\"flex w-full\">\n @if (headerLeft().length) {\n <div\n class=\"flex sticky top-0 left-0 z-[1]\"\n [class.bg-white]=\"!data().specificHightLight\"\n [class.bg-[#f3fcfc]]=\"data().specificHightLight\">\n @for (header of headerLeft(); track header) {\n <div\n class=\"relative flex px-[12px] py-[8px] {{ header.ignoreBorderRight ? '' : 'libs-ui-border-right-general' }}\"\n [class.bg-[#f8f9fa]]=\"itemOfIndexHover === data && !data().specificHightLight\"\n [ngStyle]=\"\n (header | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerLeft || false : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n \"\n [ngClass]=\"header.ngClass || {}\">\n <ng-container *ngTemplateOutlet=\"templateBodyRef; context: { header: header, data: data }\" />\n </div>\n }\n </div>\n }\n @if (headerRight().length) {\n @for (header of headerRight(); track header) {\n <div\n class=\"relative flex px-[12px] py-[8px]\"\n [ngStyle]=\"\n (header | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerRight || false : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n \"\n [ngClass]=\"header.ngClass || {}\">\n <ng-container *ngTemplateOutlet=\"templateBodyRef; context: { header: header, data: data }\" />\n </div>\n }\n }\n </div>\n @if (configTemplateItemCollapseExpand() && data().specificExpand && data()[configTemplateItemCollapseExpand()?.fieldGetDataExpand || 'specificDataExpand']) {\n <div [class]=\"configTemplateItemCollapseExpand()?.cssWrapper || 'flex w-full'\">\n @for (dataExpand of data()[configTemplateItemCollapseExpand()?.fieldGetDataExpand || 'specificDataExpand'](); track $index) {\n @if (configTemplateItemCollapseExpand()?.colTemplateConfig) {\n <libs_ui-components-table-templates\n [item]=\"dataExpand\"\n [templateCssWrapper]=\"configTemplateItemCollapseExpand()?.templateCssWrapper\"\n [configs]=\"configTemplateItemCollapseExpand()?.colTemplateConfig\" />\n }\n } @empty {\n <div class=\"relative h-[100px]\">\n <ng-container *ngTemplateOutlet=\"templateNodataRef\" />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n </virtual-scroller>\n } @else if (!loading()) {\n <div class=\"sticky left-0 top-0 z-[1] h-[calc(100%-10px)] w-full\">\n <ng-container *ngTemplateOutlet=\"templateNodataRef\" />\n </div>\n @if (showScrollTablePinnedIfNoData()) {\n <div\n class=\"absolute h-[1px] bg-transparent top-0 left-0 z-[1]\"\n [style.width.px]=\"headerElementRef.scrollWidth\"></div>\n }\n }\n </div>\n\n @if (showFooter() && itemFooter() && customPositionFooter() === 'bottom') {\n <ng-container *ngTemplateOutlet=\"templateFooterRef\" />\n }\n\n @if (loading()) {\n <div class=\"absolute w-full h-full z-[2] flex items-center content-center\">\n <libs_ui-components-spinner />\n </div>\n }\n </div>\n\n @if (activityLoadData() === 'click-pagination') {\n <div class=\"flex w-full mt-[12px]\">\n <libs_ui-components-pagination\n [modeDisplayTotalPageAndGotoPage]=\"paginationSetting()?.modeDisplayTotalPageAndGotoPage || 'bottom'\"\n [classDisplayTotalPageAndGotoPage]=\"paginationSetting()?.classDisplayTotalPageAndGotoPage || ''\"\n [classIncludeItem]=\"paginationSetting()?.classIncludeItem || ''\"\n [classIncludeContainer]=\"paginationSetting()?.classIncludeContainer || '!items-end'\"\n [disable]=\"paginationSetting()?.disable || loading() || !items().length\"\n [numberPageDispaly]=\"paginationSetting()?.numberPageDispaly || 5\"\n [showTotalPage]=\"paginationSetting()?.showTotalPage || false\"\n [showInputGotoPage]=\"paginationSetting()?.showInputGotoPage || false\"\n [totalItems]=\"pagingStore()?.total_items || (pagingStore()?.total_pages || 0) * (pagingStore()?.per_page || 0)\"\n [perPage]=\"pagingStore()?.per_page || 0\"\n [currentPage]=\"pagingStore()?.page || 0\"\n (outPageSelect)=\"handlerChangePage($event)\" />\n </div>\n }\n </div>\n</div>\n\n<ng-template\n #templateHeaderRef\n let-header=\"headerItem\"\n let-isHeaderLeft=\"isHeaderLeft\">\n <div\n [class]=\"'relative flex ' + (header.paddingLeftRightHeaderContainer ?? ' px-[12px] ') + (isHeaderLeft && !header.ignoreBorderRight ? ' libs-ui-border-right-general ' : ' ') + ' libs-ui-table-header-col '\"\n [class.flex-col]=\"header.rowsConfig\"\n [class.py-[8px]]=\"!header.ignorePyDefault\"\n [ngStyle]=\"\n (header | LibsUiTableCalculatorColumnPipe: (isHeaderLeft ? ignoreCalculatorWidthHeader()?.headerLeft || false : ignoreCalculatorWidthHeader()?.headerRight || false) : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n \"\n [ngClass]=\"header.ngClass || {}\">\n @if (!header.rowsConfig) {\n <ng-container *ngTemplateOutlet=\"templateHeaderContentRef; context: { headerItem: header, isColRender: false, isHeaderLeft: isHeaderLeft }\" />\n }\n @if (header.rowsConfig; as rowsConfig) {\n @for (row of rowsConfig.rows; track row) {\n <div [class]=\"row.classRow\">\n @for (col of row.cols; track col) {\n <ng-container *ngTemplateOutlet=\"templateHeaderContentRef; context: { headerItem: col, isColRender: true, isHeaderLeft: isHeaderLeft }\" />\n }\n </div>\n }\n }\n </div>\n</ng-template>\n\n<ng-template\n #templateHeaderContentRef\n let-header=\"headerItem\"\n let-isColRender=\"isColRender\"\n let-isHeaderLeft=\"isHeaderLeft\">\n <div\n #itemHeaderRef\n class=\"flex libs-ui-font-h6m min-h-[18px] text-[#6a7383] max-w-full\"\n [class.items-center]=\"header.contentHeaderAlignCenter ?? true\"\n [class.justify-end]=\"header.contentHeaderJustifyContentEnd\"\n [class.w-full]=\"header.isShowIndexOnRow\"\n [ngStyle]=\"\n isColRender\n ? (header | LibsUiTableCalculatorColumnPipe: (isHeaderLeft ? ignoreCalculatorWidthHeader()?.headerLeft || false : ignoreCalculatorWidthHeader()?.headerRight || false) : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n : {}\n \"\n [ngClass]=\"isColRender ? header.ngClass || {} : {}\">\n @if (header.hasCheckbox) {\n @if (header.hasCheckboxAll) {\n <div\n class=\"flex h-full {{ header.checkboxAllClassInclude || 'mr-[16px]' }}\"\n [class.items-center]=\"header.checkboxAlignCenter\">\n <libs_ui-components-checkbox-single\n [key]=\"'all'\"\n [stillOtherOptions]=\"!!keysSelected().length && keysSelected().length !== items().length\"\n [checked]=\"!!keysSelected().length && keysSelected().length === items().length\"\n [disable]=\"loading()\"\n [classInclude]=\"header.checkboxClassInclude\"\n (outChange)=\"handlerChangeCheckedAllItems($event)\" />\n </div>\n } @else {\n <div class=\"flex h-full ml-[24px] {{ header.checkboxClassInclude }}\"></div>\n }\n }\n @for (tooltip of header.tooltipsLeft; track tooltip) {\n <div class=\"mr-[4px]\">\n @let constHtmlTooltip = tooltip.dataView || ' ';\n <libs_ui-components-popover\n [type]=\"tooltip?.type || 'other'\"\n [mode]=\"tooltip?.mode || 'hover'\"\n [classInclude]=\"tooltip.classInclude || 'text-[#6a7383]'\"\n [ignoreShowPopover]=\"tooltip.ignoreShowTooltip || false\"\n [config]=\"\n tooltip.config || {\n content: constHtmlTooltip | translate,\n position: {\n mode: 'center',\n distance: 0,\n autoUpdatePosition: {\n endDistance: 12,\n startDistance: -12,\n },\n },\n }\n \"\n [innerHTML]=\"tooltip.dataView\" />\n </div>\n }\n\n @if (header.isShowIndexOnRow) {\n <div class=\"flex w-full h-full items-center justify-center {{ header.classIncludeIndexOnRow || '' }}\">\n {{ header.label ?? '#' }}\n </div>\n } @else {\n @if (header.label | LibsUiPipesCallFunctionInTemplatePipe: header.parseValue : header | async | translate; as labelHeaderColumn) {\n <libs_ui-components-popover\n [type]=\"header?.labelConfig?.type || 'text'\"\n [mode]=\"header?.labelConfig?.mode || 'hover'\"\n [classInclude]=\"header?.labelConfig?.classInclude || ''\"\n [ignoreShowPopover]=\"header?.labelConfig?.ignoreShowTooltip || false\"\n [config]=\"header.labelConfig?.config || { content: labelHeaderColumn }\"\n [innerHTML]=\"labelHeaderColumn\" />\n }\n }\n\n @for (tooltip of header.tooltipsRight; track tooltip) {\n <div class=\"ml-[4px]\">\n @let constHtmlTooltip = tooltip.dataView || ' ';\n <libs_ui-components-popover\n [type]=\"tooltip?.type || 'other'\"\n [mode]=\"tooltip?.mode || 'hover'\"\n [classInclude]=\"tooltip.classInclude || 'text-[#6a7383]'\"\n [ignoreShowPopover]=\"tooltip.ignoreShowTooltip || false\"\n [config]=\"\n tooltip.config || {\n content: constHtmlTooltip | translate,\n position: {\n mode: 'center',\n distance: 0,\n autoUpdatePosition: {\n endDistance: 12,\n startDistance: -12,\n },\n },\n }\n \"\n [innerHTML]=\"tooltip.dataView\" />\n </div>\n }\n\n @if (header.hasSort && header.orderby) {\n <div class=\"ml-[4px]\">\n <libs_ui-components-buttons-sort-arrow\n [disable]=\"loading() || !items().length\"\n [fieldSort]=\"header.orderby\"\n [ignorePopoverContent]=\"header.sortIgnoreTooltipContent ?? true\"\n [popoverContentAsc]=\"header.sortTooltipContentAsc\"\n [popoverContentDesc]=\"header.sortTooltipContentDesc\"\n [defaultMode]=\"header.defaultMode\"\n [zIndex]=\"header.zIndexTooltipSort\"\n (outChange)=\"handlerChangeSort($event)\" />\n </div>\n }\n </div>\n @if (header.labelDescription) {\n <div class=\"flex\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"header.labelDescription.classInclude || ''\"\n [config]=\"{ content: header.labelDescription.content | translate }\"\n [innerHTML]=\"header.labelDescription.content | translate\" />\n </div>\n }\n</ng-template>\n\n<ng-template\n #templateBodyRef\n let-header=\"header\"\n let-data=\"data\">\n <div class=\"flex w-full h-full\">\n @if (header.hasCheckbox) {\n <div\n class=\"flex h-full\"\n [class.invisible]=\"header.checkConditionCheckBoxHidden && (data() | LibsUiPipesCallFunctionInTemplatePipe: header.checkConditionCheckBoxHidden : data() | async)\"\n [class.items-center]=\"header.checkboxAlignCenter\">\n <libs_ui-components-checkbox-single\n [key]=\"data()[fieldKey()]\"\n [classInclude]=\"header.checkboxClassInclude\"\n [checked]=\"data()[fieldKey()] | LibsUiPipesCheckSelectedByKeyPipe: keysSelected() : keysSelected().length\"\n [disable]=\"loading() || disableCheckbox() || !!(maxItemSelected() && !(data()[fieldKey()] | LibsUiPipesCheckSelectedByKeyPipe: keysSelected() : keysSelected().length) && keysSelected().length >= maxItemSelected())\"\n (outChange)=\"handlerChangeItemChecked($event, data())\" />\n </div>\n }\n\n @if (header.isShowIndexOnRow; as config) {\n <div class=\"w-full flex items-center justify-center libs-ui-font-h4r{{ config.classIncludeIndexOnRow || '' }}\">\n <div\n LibsUiComponentsPopoverDirective\n [type]=\"'text'\"\n [config]=\"{}\"\n [innerHTML]=\"data | LibsUiPipesCallFunctionInTemplatePipe: getIndexRow | async\"></div>\n </div>\n }\n\n @if (header.colTemplateConfig) {\n <libs_ui-components-table-templates\n [isHover]=\"itemOfIndexHover === data && !data.specificHightLight\"\n [class]=\"header.templateCssWrapperHost || ''\"\n [item]=\"data\"\n [templateCssWrapper]=\"header.templateCssWrapper\"\n [configs]=\"header.colTemplateConfig\" />\n }\n </div>\n</ng-template>\n\n<ng-template #templateFooterRef>\n @if (!isHiddenHeaderWhenNodata() || (isHiddenHeaderWhenNodata() && items().length)) {\n <div\n #footerElementRef\n class=\"flex w-full bg-[#f8f9fa] overflow-x-hidden z-[1] {{ ignoreBorderFooter() ? '' : customPositionFooter() === 'top' ? 'libs-ui-border-bottom-general' : 'libs-ui-table-shadow-top libs-ui-border-top-general' }} min-h-[35px]\"\n (mouseenter)=\"handlerMouseEnterFooter($event)\"\n (mouseleave)=\"handlerMouseLeaveFooter($event)\">\n @if (footerLeft()) {\n <div\n #footerLeftElementRef\n class=\"flex sticky top-0 left-0 z-[1] bg-[#f8f9fa]\">\n @for (footer of footerLeft(); track footer) {\n <div\n class=\"flex items-center px-[12px] py-[8px] {{ footer.ignoreBorderRight ? '' : 'libs-ui-border-right-general' }}\"\n [ngStyle]=\"(footer | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerLeft || false : headerElementRef.clientWidth : footerLeft() : footerRight()) || {}\"\n [ngClass]=\"footer.ngClass || {}\">\n @if (footer.colTemplateConfig && itemFooter()) {\n <libs_ui-components-table-templates\n [item]=\"itemFooter | LibsUiPipesConvertObjectToSignalPipe\"\n [templateCssWrapper]=\"footer.templateCssWrapper\"\n [configs]=\"footer.colTemplateConfig\" />\n }\n </div>\n }\n </div>\n }\n @if (footerRight()) {\n @for (footer of footerRight(); track footer) {\n <div\n class=\"flex items-center px-[12px] py-[8px]\"\n [ngStyle]=\"(footer | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerRight || false : headerElementRef.clientWidth : footerLeft() : footerRight()) || {}\"\n [ngClass]=\"footer.ngClass || {}\">\n @if (footer.colTemplateConfig && itemFooter()) {\n <libs_ui-components-table-templates\n [item]=\"itemFooter | LibsUiPipesConvertObjectToSignalPipe\"\n [templateCssWrapper]=\"footer.templateCssWrapper\"\n [configs]=\"footer.colTemplateConfig\" />\n }\n </div>\n }\n }\n </div>\n }\n</ng-template>\n\n<ng-template #templateNodataRef>\n @if (!keySearch() && templateNoData(); as templateNoData) {\n <ng-container *ngTemplateOutlet=\"templateNoData\" />\n }\n @if (keySearch() && templateNoResult(); as templateNoResult) {\n <ng-container *ngTemplateOutlet=\"templateNoResult\" />\n }\n @if (!templateNoData() && !templateNoResult() && noDataConfig(); as config) {\n <div class=\"flex items-center justify-center w-full h-full absolute left-0 top-0 z-[1]\">\n <div class=\"flex flex-col items-center justify-center w-full h-full shrink-0\">\n @if (!keySearch() && !onlyShowNoResult()) {\n <ng-container *ngComponentOutlet=\"'no-data' | LibsUiIconsGetIconComponentPipe | async; inputs: { size: 64 }\" />\n <div\n class=\"libs-ui-table-no-data-config-text\"\n [ngStyle]=\"config.ngStyle || {}\"\n [ngClass]=\"config.ngClass || {}\"\n [innerHtml]=\"config.textNoData | translate\"></div>\n }\n @if (keySearch() || onlyShowNoResult()) {\n <ng-container *ngComponentOutlet=\"'no-result' | LibsUiIconsGetIconComponentPipe | async; inputs: { size: 64 }\" />\n <div\n class=\"libs-ui-table-no-data-config-text\"\n [ngStyle]=\"config.ngStyle || {}\"\n [ngClass]=\"config.ngClass || {}\"\n [innerHtml]=\"config.textSearchNoData | translate\"></div>\n }\n </div>\n </div>\n }\n</ng-template>\n", styles: [".libs-ui-table-header-container{height:33px;flex-shrink:0}.libs-ui-table-header-col{height:100%;width:100%;align-items:center}.libs-ui-table-no-data-config-text{margin-top:16px;font-size:12px;color:#9ca2ad;font-family:var(--libs-ui-font-family-name, \"Arial\");font-weight:400}.libs-ui-table-no-data-config-icon{margin-bottom:12px}.libs-ui-table-no-data-config-icon:before{font-size:84px;color:#c1c1c1}.libs-ui-table-shadow-bottom{box-shadow:0 1px 1px #00143305,0 4px 8px #0014330a}@media only screen and (min-width: 1921px){.libs-ui-border-bottom-general{border-bottom:solid 2px #e6e8ed!important}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "component", type: LibsUiComponentsTableTemplatesComponent, selector: "libs_ui-components-table-templates", inputs: ["isHover", "configs", "templateCssWrapper", "item"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: VirtualScrollerModule }, { kind: "component", type: i2.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: "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", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "pipe", type: LibsUiPipesConvertObjectToSignalPipe, name: "LibsUiPipesConvertObjectToSignalPipe" }, { kind: "component", type: LibsUiComponentsDropdownComponent, selector: "libs_ui-components-dropdown", inputs: ["useXssFilter", "popoverElementRefCustom", "classInclude", "ignoreStopPropagationEvent", "flagMouse", "flagMouseContent", "popoverCustomConfig", "isNgContent", "zIndex", "convertItemSelected", "getPopoverItemSelected", "httpRequestDetailItemById", "lengthKeys", "textDisplayWhenNoSelect", "textDisplayWhenMultiSelect", "classIncludeTextDisplayWhenNoSelect", "fieldLabel", "fieldGetLabel", "labelPopoverConfig", "labelPopoverFullWidth", "hasContentUnitRight", "listSearchNoDataTemplateRef", "fieldGetImage", "imageSize", "typeShape", "fieldGetIcon", "fieldGetTextAvatar", "fieldGetColorAvatar", "classAvatarInclude", "getLastTextAfterSpace", "linkImageError", "showError", "showBorderError", "disable", "readonly", "labelConfig", "disableLabel", "listSearchConfig", "isSearchOnline", "listHiddenInputSearch", "listSearchPadding", "listKeySearch", "listDividerClassInclude", "listConfig", "listButtonsOther", "listHasButtonUnSelectOption", "listClickExactly", "listBackgroundCustom", "listMaxItemShow", "listKeySelected", "listMultiKeySelected", "listKeysDisable", "listKeysHidden", "validRequired", "validMaxItemSelected", "changeValidUndefinedResetError", "allowSelectItemMultiple", "focusInputSearch", "onlyEmitDataWhenReset", "resetKeyWhenSelectAllKey", "listConfigHasDivider", "classIncludeIcon", "classIncludeContent", "listIgnoreClassDisableDefaultWhenUseKeysDisableItem", "tabKeyActive", "tabsConfig", "ignoreBorderBottom"], outputs: ["flagMouseChange", "flagMouseContentChange", "lengthKeysChange", "showBorderErrorChange", "listKeySelectedChange", "listMultiKeySelectedChange", "tabKeyActiveChange", "outSelectKey", "outSelectMultiKey", "outFunctionsControl", "outValidEvent", "outChangStageFlagMouse", "outDataChange", "outClickButtonOther", "outShowList", "outChangeTabKeyActive"] }, { 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: "component", type: LibsUiComponentsPaginationComponent, selector: "libs_ui-components-pagination", inputs: ["showTotalPage", "showInputGotoPage", "modeDisplayTotalPageAndGotoPage", "classDisplayTotalPageAndGotoPage", "classIncludeContainer", "classIncludeItem", "disable", "numberPageDispaly", "totalItems", "perPage", "currentPage"], outputs: ["currentPageChange", "outPageSelect"] }, { 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", "dataComponentOutlet", "componentOutlet"], outputs: ["checkedChange", "linkImageChange", "outChange", "outEventPopover", "outClickLabel", "outChangStageFlagMousePopover"] }, { kind: "pipe", type: LibsUiTableCalculatorColumnPipe, name: "LibsUiTableCalculatorColumnPipe" }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "directive", type: LibsUiComponentsScrollOverlayDirective, selector: "[LibsUiComponentsScrollOverlayDirective]", inputs: ["debugMode", "ignoreInit", "classContainer", "options", "elementCheckScrollX", "elementCheckScrollY", "elementScroll"], outputs: ["outScroll", "outScrollX", "outScrollY", "outScrollTop", "outScrollBottom"] }, { kind: "pipe", type: LibsUiIconsGetIconComponentPipe, name: "LibsUiIconsGetIconComponentPipe" }, { kind: "pipe", type: LibsUiPipesCallFunctionInTemplatePipe, name: "LibsUiPipesCallFunctionInTemplatePipe" }, { kind: "pipe", type: LibsUiPipesCheckSelectedByKeyPipe, name: "LibsUiPipesCheckSelectedByKeyPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
879
|
+
}
|
|
880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsTableComponent, decorators: [{
|
|
881
|
+
type: Component,
|
|
882
|
+
args: [{ selector: 'libs_ui-components-table', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
883
|
+
NgClass,
|
|
884
|
+
NgStyle,
|
|
885
|
+
AsyncPipe,
|
|
886
|
+
NgTemplateOutlet,
|
|
887
|
+
NgComponentOutlet,
|
|
888
|
+
LibsUiComponentsTableTemplatesComponent,
|
|
889
|
+
TranslateModule,
|
|
890
|
+
VirtualScrollerModule,
|
|
891
|
+
LibsUiComponentsButtonsButtonComponent,
|
|
892
|
+
LibsUiPipesConvertObjectToSignalPipe,
|
|
893
|
+
LibsUiComponentsDropdownComponent,
|
|
894
|
+
LibsUiComponentsButtonsSortArrowComponent,
|
|
895
|
+
LibsUiComponentsPaginationComponent,
|
|
896
|
+
LibsUiComponentsCheckboxSingleComponent,
|
|
897
|
+
LibsUiTableCalculatorColumnPipe,
|
|
898
|
+
LibsUiComponentsSpinnerComponent,
|
|
899
|
+
LibsUiComponentsPopoverComponent,
|
|
900
|
+
LibsUiComponentsScrollOverlayDirective,
|
|
901
|
+
LibsUiIconsGetIconComponentPipe,
|
|
902
|
+
LibsUiPipesCallFunctionInTemplatePipe,
|
|
903
|
+
LibsUiPipesCheckSelectedByKeyPipe,
|
|
904
|
+
], template: "<div class=\"flex flex-col w-full h-full\">\n @if (!ignoreBar()) {\n <div\n class=\"flex items-center relative z-[1] bottom-0 left-0 w-full bg-white libs-ui-table-shadow-bottom {{ classBarInclude() }}\"\n [class.px-[16px]]=\"keysSelected().length || labelBarNoSelectItem()\"\n [class.py-[6px]]=\"keysSelected().length || labelBarNoSelectItem()\"\n (mouseenter)=\"resetIndexHover($event)\">\n <ng-content select=\"div.libs-ui-table-bar-left\"></ng-content>\n @if (!keysSelected().length && labelBarNoSelectItem()) {\n <div\n class=\"{{ classLabelBarNoSelectItem() ?? 'px-[12px] py-[5px]' }}\"\n [innerHtml]=\"labelBarNoSelectItem() | translate: { value: totalItemDisplay() }\"></div>\n }\n @if (keysSelected().length) {\n <div class=\"flex items-center pl-[12px]\">\n <div class=\"flex items-center h-full mt-[-2px]\">\n <libs_ui-components-checkbox-single\n [checked]=\"true\"\n [disable]=\"loading() || disableCheckbox()\"\n (outChange)=\"handlerChangeAllChecked()\" />\n </div>\n <div class=\"libs-ui-font-h5m text-[#071631] mr-[8px] {{ classLabelBarButtons() }}\">\n {{ labelBarButtons() | translate: { value: keysSelected().length } }}\n </div>\n @if (configSelectMoreItem()) {\n <libs_ui-components-dropdown\n [isNgContent]=\"true\"\n [popoverCustomConfig]=\"{\n widthByParent: false,\n ignoreArrow: true,\n maxHeight: 2048,\n classInclude: '!w-[121px]',\n position: {\n mode: 'start',\n distance: 0,\n },\n }\"\n [listConfig]=\"listConfigMoreItem()\"\n [listHiddenInputSearch]=\"true\"\n [listMaxItemShow]=\"5\"\n class=\"!w-[16px] h-[16px] mr-[8px]\"\n (outSelectKey)=\"handlerSelectedMoreItem($event)\"\n (outFunctionsControl)=\"handlerFunctionControlMoreSelectItem($event)\">\n <libs_ui-components-buttons-button\n [type]=\"'button-link-primary'\"\n [classInclude]=\"'!p-0 m-0'\"\n [classIconLeft]=\"'before:!text-[16px] libs-ui-icon-move-right rotate-90 mr-[6px]'\"\n [popover]=\"{ config: { content: 'i18n_more_select' } }\"\n [ignoreStopPropagationEvent]=\"true\" />\n </libs_ui-components-dropdown>\n }\n <div class=\"h-[16px] libs-ui-border-left-general ml-[16px]\"></div>\n @if (barButtons()?.length) {\n @for (button of barButtons(); track button) {\n @let constHtmlLabel = button.label || ' ';\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-link-primary'\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [classInclude]=\"button.classInclude || ''\"\n [label]=\"constHtmlLabel | translate\"\n (outClick)=\"handlerBarButtonClick(button)\" />\n }\n }\n </div>\n }\n <ng-content select=\"div.libs-ui-table-bar-right\"></ng-content>\n </div>\n }\n\n <div\n #tableContainerElementRef\n class=\"libs-ui-table flex flex-col w-full h-full relative {{ classTableContainerInclude() }}\"\n [class.px-[16px]]=\"!ignoreBar()\"\n (mouseleave)=\"handlerMouseLeaveContainer($event)\">\n <div\n class=\"relative w-full shrink-0\"\n [style.height.px]=\"headerElementRef.offsetHeight\">\n <div\n #headerElementRef\n LibsUiComponentsScrollOverlayDirective\n [options]=\"{ scrollbarWidth: 0 }\"\n [class.libs-ui-border-bottom-dashed-general]=\"!hasItemHightLight() && isDashBorder()\"\n [class.libs-ui-border-bottom-general]=\"!hasItemHightLight() && !isDashBorder()\"\n [class.!hidden]=\"!items().length && isHiddenHeaderWhenNodata()\"\n [class]=\"classHeaderContainer()\"\n (outScroll)=\"handlerScrollHeader($event)\"\n (mouseenter)=\"handlerMouseEnterHeader($event)\"\n (mouseleave)=\"handlerMouseLeaveHeader($event)\">\n @if (headerLeft().length) {\n <div [class]=\"classHeaderLeftContainer()\">\n @for (header of headerLeft(); track header) {\n <ng-container *ngTemplateOutlet=\"templateHeaderRef; context: { headerItem: header, isHeaderLeft: true }\" />\n }\n </div>\n }\n @if (headerRight().length) {\n @for (header of headerRight(); track header) {\n <ng-container *ngTemplateOutlet=\"templateHeaderRef; context: { headerItem: header, isHeaderLeft: false }\" />\n }\n }\n </div>\n </div>\n @if (showFooter() && itemFooter() && customPositionFooter() === 'top') {\n <ng-container *ngTemplateOutlet=\"templateFooterRef\" />\n }\n <div class=\"relative flex flex-col w-full h-full overflow-x-hidden bg-white {{ classBodyInclude() || '' }}\">\n <div\n #bodyElementRef\n class=\"flex h-full w-full relative\"\n LibsUiComponentsScrollOverlayDirective\n (outScroll)=\"handlerScrollBody($event)\"\n (outScrollBottom)=\"handlerScrollBottom($event)\">\n @if (items().length) {\n <virtual-scroller\n #bodyComponentRef\n [items]=\"items()\"\n [enableUnequalChildrenSizes]=\"enableUnequalChildrenSizes()\"\n class=\"h-full\"\n [style.width.px]=\"headerElementRef.scrollWidth > (bodyElementRef ? bodyElementRef.scrollWidth : 0) ? headerElementRef.scrollWidth : undefined\"\n [parentScroll]=\"bodyElementRef\"\n [bufferAmount]=\"bufferAmount()\">\n @for (data of bodyComponentRef.viewPortItems; track data()) {\n <div\n #elementHover\n class=\"flex\"\n [class.bg-[#f3fcfc]]=\"data().specificHightLight\"\n [class.libs-ui-border-top-1px-36d3d3]=\"data().specificHightLight && $first && !ignoreBorderItem()\"\n [class.libs-ui-border-bottom-1px-36d3d3]=\"data().specificHightLight && !ignoreBorderItem()\"\n [ngClass]=\"\n data().specificHightLight || ($last && ignoreBorderItemLast())\n ? 'libs-ui-border-radius-bottom-left-4px libs-ui-border-radius-bottom-right-4px'\n : ignoreBorderItem()\n ? ''\n : isDashBorder()\n ? 'libs-ui-border-bottom-dashed-general'\n : 'libs-ui-border-bottom-general'\n \"\n [style.width.px]=\"headerElementRef.scrollWidth\"\n [class.bg-[#f8f9fa]]=\"itemOfIndexHover === data && !data().specificHightLight\"\n (mouseenter)=\"setIndexHover($event, data)\"\n (mouseleave)=\"resetIndexHoverWhenMouseLeave($event)\">\n @if (headerLeft().length || headerRight().length) {\n <div class=\"flex flex-col w-full\">\n <div class=\"flex w-full\">\n @if (headerLeft().length) {\n <div\n class=\"flex sticky top-0 left-0 z-[1]\"\n [class.bg-white]=\"!data().specificHightLight\"\n [class.bg-[#f3fcfc]]=\"data().specificHightLight\">\n @for (header of headerLeft(); track header) {\n <div\n class=\"relative flex px-[12px] py-[8px] {{ header.ignoreBorderRight ? '' : 'libs-ui-border-right-general' }}\"\n [class.bg-[#f8f9fa]]=\"itemOfIndexHover === data && !data().specificHightLight\"\n [ngStyle]=\"\n (header | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerLeft || false : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n \"\n [ngClass]=\"header.ngClass || {}\">\n <ng-container *ngTemplateOutlet=\"templateBodyRef; context: { header: header, data: data }\" />\n </div>\n }\n </div>\n }\n @if (headerRight().length) {\n @for (header of headerRight(); track header) {\n <div\n class=\"relative flex px-[12px] py-[8px]\"\n [ngStyle]=\"\n (header | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerRight || false : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n \"\n [ngClass]=\"header.ngClass || {}\">\n <ng-container *ngTemplateOutlet=\"templateBodyRef; context: { header: header, data: data }\" />\n </div>\n }\n }\n </div>\n @if (configTemplateItemCollapseExpand() && data().specificExpand && data()[configTemplateItemCollapseExpand()?.fieldGetDataExpand || 'specificDataExpand']) {\n <div [class]=\"configTemplateItemCollapseExpand()?.cssWrapper || 'flex w-full'\">\n @for (dataExpand of data()[configTemplateItemCollapseExpand()?.fieldGetDataExpand || 'specificDataExpand'](); track $index) {\n @if (configTemplateItemCollapseExpand()?.colTemplateConfig) {\n <libs_ui-components-table-templates\n [item]=\"dataExpand\"\n [templateCssWrapper]=\"configTemplateItemCollapseExpand()?.templateCssWrapper\"\n [configs]=\"configTemplateItemCollapseExpand()?.colTemplateConfig\" />\n }\n } @empty {\n <div class=\"relative h-[100px]\">\n <ng-container *ngTemplateOutlet=\"templateNodataRef\" />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n </virtual-scroller>\n } @else if (!loading()) {\n <div class=\"sticky left-0 top-0 z-[1] h-[calc(100%-10px)] w-full\">\n <ng-container *ngTemplateOutlet=\"templateNodataRef\" />\n </div>\n @if (showScrollTablePinnedIfNoData()) {\n <div\n class=\"absolute h-[1px] bg-transparent top-0 left-0 z-[1]\"\n [style.width.px]=\"headerElementRef.scrollWidth\"></div>\n }\n }\n </div>\n\n @if (showFooter() && itemFooter() && customPositionFooter() === 'bottom') {\n <ng-container *ngTemplateOutlet=\"templateFooterRef\" />\n }\n\n @if (loading()) {\n <div class=\"absolute w-full h-full z-[2] flex items-center content-center\">\n <libs_ui-components-spinner />\n </div>\n }\n </div>\n\n @if (activityLoadData() === 'click-pagination') {\n <div class=\"flex w-full mt-[12px]\">\n <libs_ui-components-pagination\n [modeDisplayTotalPageAndGotoPage]=\"paginationSetting()?.modeDisplayTotalPageAndGotoPage || 'bottom'\"\n [classDisplayTotalPageAndGotoPage]=\"paginationSetting()?.classDisplayTotalPageAndGotoPage || ''\"\n [classIncludeItem]=\"paginationSetting()?.classIncludeItem || ''\"\n [classIncludeContainer]=\"paginationSetting()?.classIncludeContainer || '!items-end'\"\n [disable]=\"paginationSetting()?.disable || loading() || !items().length\"\n [numberPageDispaly]=\"paginationSetting()?.numberPageDispaly || 5\"\n [showTotalPage]=\"paginationSetting()?.showTotalPage || false\"\n [showInputGotoPage]=\"paginationSetting()?.showInputGotoPage || false\"\n [totalItems]=\"pagingStore()?.total_items || (pagingStore()?.total_pages || 0) * (pagingStore()?.per_page || 0)\"\n [perPage]=\"pagingStore()?.per_page || 0\"\n [currentPage]=\"pagingStore()?.page || 0\"\n (outPageSelect)=\"handlerChangePage($event)\" />\n </div>\n }\n </div>\n</div>\n\n<ng-template\n #templateHeaderRef\n let-header=\"headerItem\"\n let-isHeaderLeft=\"isHeaderLeft\">\n <div\n [class]=\"'relative flex ' + (header.paddingLeftRightHeaderContainer ?? ' px-[12px] ') + (isHeaderLeft && !header.ignoreBorderRight ? ' libs-ui-border-right-general ' : ' ') + ' libs-ui-table-header-col '\"\n [class.flex-col]=\"header.rowsConfig\"\n [class.py-[8px]]=\"!header.ignorePyDefault\"\n [ngStyle]=\"\n (header | LibsUiTableCalculatorColumnPipe: (isHeaderLeft ? ignoreCalculatorWidthHeader()?.headerLeft || false : ignoreCalculatorWidthHeader()?.headerRight || false) : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n \"\n [ngClass]=\"header.ngClass || {}\">\n @if (!header.rowsConfig) {\n <ng-container *ngTemplateOutlet=\"templateHeaderContentRef; context: { headerItem: header, isColRender: false, isHeaderLeft: isHeaderLeft }\" />\n }\n @if (header.rowsConfig; as rowsConfig) {\n @for (row of rowsConfig.rows; track row) {\n <div [class]=\"row.classRow\">\n @for (col of row.cols; track col) {\n <ng-container *ngTemplateOutlet=\"templateHeaderContentRef; context: { headerItem: col, isColRender: true, isHeaderLeft: isHeaderLeft }\" />\n }\n </div>\n }\n }\n </div>\n</ng-template>\n\n<ng-template\n #templateHeaderContentRef\n let-header=\"headerItem\"\n let-isColRender=\"isColRender\"\n let-isHeaderLeft=\"isHeaderLeft\">\n <div\n #itemHeaderRef\n class=\"flex libs-ui-font-h6m min-h-[18px] text-[#6a7383] max-w-full\"\n [class.items-center]=\"header.contentHeaderAlignCenter ?? true\"\n [class.justify-end]=\"header.contentHeaderJustifyContentEnd\"\n [class.w-full]=\"header.isShowIndexOnRow\"\n [ngStyle]=\"\n isColRender\n ? (header | LibsUiTableCalculatorColumnPipe: (isHeaderLeft ? ignoreCalculatorWidthHeader()?.headerLeft || false : ignoreCalculatorWidthHeader()?.headerRight || false) : headerElementRef.clientWidth : headerLeft() : headerRight()) ||\n (header.isShowIndexOnRow ? { width: '50px', 'flex-shirk': '0', padding: '8px' } : {})\n : {}\n \"\n [ngClass]=\"isColRender ? header.ngClass || {} : {}\">\n @if (header.hasCheckbox) {\n @if (header.hasCheckboxAll) {\n <div\n class=\"flex h-full {{ header.checkboxAllClassInclude || 'mr-[16px]' }}\"\n [class.items-center]=\"header.checkboxAlignCenter\">\n <libs_ui-components-checkbox-single\n [key]=\"'all'\"\n [stillOtherOptions]=\"!!keysSelected().length && keysSelected().length !== items().length\"\n [checked]=\"!!keysSelected().length && keysSelected().length === items().length\"\n [disable]=\"loading()\"\n [classInclude]=\"header.checkboxClassInclude\"\n (outChange)=\"handlerChangeCheckedAllItems($event)\" />\n </div>\n } @else {\n <div class=\"flex h-full ml-[24px] {{ header.checkboxClassInclude }}\"></div>\n }\n }\n @for (tooltip of header.tooltipsLeft; track tooltip) {\n <div class=\"mr-[4px]\">\n @let constHtmlTooltip = tooltip.dataView || ' ';\n <libs_ui-components-popover\n [type]=\"tooltip?.type || 'other'\"\n [mode]=\"tooltip?.mode || 'hover'\"\n [classInclude]=\"tooltip.classInclude || 'text-[#6a7383]'\"\n [ignoreShowPopover]=\"tooltip.ignoreShowTooltip || false\"\n [config]=\"\n tooltip.config || {\n content: constHtmlTooltip | translate,\n position: {\n mode: 'center',\n distance: 0,\n autoUpdatePosition: {\n endDistance: 12,\n startDistance: -12,\n },\n },\n }\n \"\n [innerHTML]=\"tooltip.dataView\" />\n </div>\n }\n\n @if (header.isShowIndexOnRow) {\n <div class=\"flex w-full h-full items-center justify-center {{ header.classIncludeIndexOnRow || '' }}\">\n {{ header.label ?? '#' }}\n </div>\n } @else {\n @if (header.label | LibsUiPipesCallFunctionInTemplatePipe: header.parseValue : header | async | translate; as labelHeaderColumn) {\n <libs_ui-components-popover\n [type]=\"header?.labelConfig?.type || 'text'\"\n [mode]=\"header?.labelConfig?.mode || 'hover'\"\n [classInclude]=\"header?.labelConfig?.classInclude || ''\"\n [ignoreShowPopover]=\"header?.labelConfig?.ignoreShowTooltip || false\"\n [config]=\"header.labelConfig?.config || { content: labelHeaderColumn }\"\n [innerHTML]=\"labelHeaderColumn\" />\n }\n }\n\n @for (tooltip of header.tooltipsRight; track tooltip) {\n <div class=\"ml-[4px]\">\n @let constHtmlTooltip = tooltip.dataView || ' ';\n <libs_ui-components-popover\n [type]=\"tooltip?.type || 'other'\"\n [mode]=\"tooltip?.mode || 'hover'\"\n [classInclude]=\"tooltip.classInclude || 'text-[#6a7383]'\"\n [ignoreShowPopover]=\"tooltip.ignoreShowTooltip || false\"\n [config]=\"\n tooltip.config || {\n content: constHtmlTooltip | translate,\n position: {\n mode: 'center',\n distance: 0,\n autoUpdatePosition: {\n endDistance: 12,\n startDistance: -12,\n },\n },\n }\n \"\n [innerHTML]=\"tooltip.dataView\" />\n </div>\n }\n\n @if (header.hasSort && header.orderby) {\n <div class=\"ml-[4px]\">\n <libs_ui-components-buttons-sort-arrow\n [disable]=\"loading() || !items().length\"\n [fieldSort]=\"header.orderby\"\n [ignorePopoverContent]=\"header.sortIgnoreTooltipContent ?? true\"\n [popoverContentAsc]=\"header.sortTooltipContentAsc\"\n [popoverContentDesc]=\"header.sortTooltipContentDesc\"\n [defaultMode]=\"header.defaultMode\"\n [zIndex]=\"header.zIndexTooltipSort\"\n (outChange)=\"handlerChangeSort($event)\" />\n </div>\n }\n </div>\n @if (header.labelDescription) {\n <div class=\"flex\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [classInclude]=\"header.labelDescription.classInclude || ''\"\n [config]=\"{ content: header.labelDescription.content | translate }\"\n [innerHTML]=\"header.labelDescription.content | translate\" />\n </div>\n }\n</ng-template>\n\n<ng-template\n #templateBodyRef\n let-header=\"header\"\n let-data=\"data\">\n <div class=\"flex w-full h-full\">\n @if (header.hasCheckbox) {\n <div\n class=\"flex h-full\"\n [class.invisible]=\"header.checkConditionCheckBoxHidden && (data() | LibsUiPipesCallFunctionInTemplatePipe: header.checkConditionCheckBoxHidden : data() | async)\"\n [class.items-center]=\"header.checkboxAlignCenter\">\n <libs_ui-components-checkbox-single\n [key]=\"data()[fieldKey()]\"\n [classInclude]=\"header.checkboxClassInclude\"\n [checked]=\"data()[fieldKey()] | LibsUiPipesCheckSelectedByKeyPipe: keysSelected() : keysSelected().length\"\n [disable]=\"loading() || disableCheckbox() || !!(maxItemSelected() && !(data()[fieldKey()] | LibsUiPipesCheckSelectedByKeyPipe: keysSelected() : keysSelected().length) && keysSelected().length >= maxItemSelected())\"\n (outChange)=\"handlerChangeItemChecked($event, data())\" />\n </div>\n }\n\n @if (header.isShowIndexOnRow; as config) {\n <div class=\"w-full flex items-center justify-center libs-ui-font-h4r{{ config.classIncludeIndexOnRow || '' }}\">\n <div\n LibsUiComponentsPopoverDirective\n [type]=\"'text'\"\n [config]=\"{}\"\n [innerHTML]=\"data | LibsUiPipesCallFunctionInTemplatePipe: getIndexRow | async\"></div>\n </div>\n }\n\n @if (header.colTemplateConfig) {\n <libs_ui-components-table-templates\n [isHover]=\"itemOfIndexHover === data && !data.specificHightLight\"\n [class]=\"header.templateCssWrapperHost || ''\"\n [item]=\"data\"\n [templateCssWrapper]=\"header.templateCssWrapper\"\n [configs]=\"header.colTemplateConfig\" />\n }\n </div>\n</ng-template>\n\n<ng-template #templateFooterRef>\n @if (!isHiddenHeaderWhenNodata() || (isHiddenHeaderWhenNodata() && items().length)) {\n <div\n #footerElementRef\n class=\"flex w-full bg-[#f8f9fa] overflow-x-hidden z-[1] {{ ignoreBorderFooter() ? '' : customPositionFooter() === 'top' ? 'libs-ui-border-bottom-general' : 'libs-ui-table-shadow-top libs-ui-border-top-general' }} min-h-[35px]\"\n (mouseenter)=\"handlerMouseEnterFooter($event)\"\n (mouseleave)=\"handlerMouseLeaveFooter($event)\">\n @if (footerLeft()) {\n <div\n #footerLeftElementRef\n class=\"flex sticky top-0 left-0 z-[1] bg-[#f8f9fa]\">\n @for (footer of footerLeft(); track footer) {\n <div\n class=\"flex items-center px-[12px] py-[8px] {{ footer.ignoreBorderRight ? '' : 'libs-ui-border-right-general' }}\"\n [ngStyle]=\"(footer | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerLeft || false : headerElementRef.clientWidth : footerLeft() : footerRight()) || {}\"\n [ngClass]=\"footer.ngClass || {}\">\n @if (footer.colTemplateConfig && itemFooter()) {\n <libs_ui-components-table-templates\n [item]=\"itemFooter | LibsUiPipesConvertObjectToSignalPipe\"\n [templateCssWrapper]=\"footer.templateCssWrapper\"\n [configs]=\"footer.colTemplateConfig\" />\n }\n </div>\n }\n </div>\n }\n @if (footerRight()) {\n @for (footer of footerRight(); track footer) {\n <div\n class=\"flex items-center px-[12px] py-[8px]\"\n [ngStyle]=\"(footer | LibsUiTableCalculatorColumnPipe: ignoreCalculatorWidthHeader()?.headerRight || false : headerElementRef.clientWidth : footerLeft() : footerRight()) || {}\"\n [ngClass]=\"footer.ngClass || {}\">\n @if (footer.colTemplateConfig && itemFooter()) {\n <libs_ui-components-table-templates\n [item]=\"itemFooter | LibsUiPipesConvertObjectToSignalPipe\"\n [templateCssWrapper]=\"footer.templateCssWrapper\"\n [configs]=\"footer.colTemplateConfig\" />\n }\n </div>\n }\n }\n </div>\n }\n</ng-template>\n\n<ng-template #templateNodataRef>\n @if (!keySearch() && templateNoData(); as templateNoData) {\n <ng-container *ngTemplateOutlet=\"templateNoData\" />\n }\n @if (keySearch() && templateNoResult(); as templateNoResult) {\n <ng-container *ngTemplateOutlet=\"templateNoResult\" />\n }\n @if (!templateNoData() && !templateNoResult() && noDataConfig(); as config) {\n <div class=\"flex items-center justify-center w-full h-full absolute left-0 top-0 z-[1]\">\n <div class=\"flex flex-col items-center justify-center w-full h-full shrink-0\">\n @if (!keySearch() && !onlyShowNoResult()) {\n <ng-container *ngComponentOutlet=\"'no-data' | LibsUiIconsGetIconComponentPipe | async; inputs: { size: 64 }\" />\n <div\n class=\"libs-ui-table-no-data-config-text\"\n [ngStyle]=\"config.ngStyle || {}\"\n [ngClass]=\"config.ngClass || {}\"\n [innerHtml]=\"config.textNoData | translate\"></div>\n }\n @if (keySearch() || onlyShowNoResult()) {\n <ng-container *ngComponentOutlet=\"'no-result' | LibsUiIconsGetIconComponentPipe | async; inputs: { size: 64 }\" />\n <div\n class=\"libs-ui-table-no-data-config-text\"\n [ngStyle]=\"config.ngStyle || {}\"\n [ngClass]=\"config.ngClass || {}\"\n [innerHtml]=\"config.textSearchNoData | translate\"></div>\n }\n </div>\n </div>\n }\n</ng-template>\n", styles: [".libs-ui-table-header-container{height:33px;flex-shrink:0}.libs-ui-table-header-col{height:100%;width:100%;align-items:center}.libs-ui-table-no-data-config-text{margin-top:16px;font-size:12px;color:#9ca2ad;font-family:var(--libs-ui-font-family-name, \"Arial\");font-weight:400}.libs-ui-table-no-data-config-icon{margin-bottom:12px}.libs-ui-table-no-data-config-icon:before{font-size:84px;color:#c1c1c1}.libs-ui-table-shadow-bottom{box-shadow:0 1px 1px #00143305,0 4px 8px #0014330a}@media only screen and (min-width: 1921px){.libs-ui-border-bottom-general{border-bottom:solid 2px #e6e8ed!important}}\n"] }]
|
|
905
|
+
}], ctorParameters: () => [] });
|
|
906
|
+
|
|
907
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
908
|
+
|
|
909
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
910
|
+
|
|
911
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Generated bundle index. Do not edit.
|
|
915
|
+
*/
|
|
916
|
+
|
|
917
|
+
export { LibsUiComponentsTableComponent };
|
|
918
|
+
//# sourceMappingURL=libs-ui-components-table.mjs.map
|