@ngx-smz/core 21.1.21 → 21.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/fesm2022/ngx-smz-core.mjs +129 -17
- package/fesm2022/ngx-smz-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngx-smz-core.d.ts +10 -0
|
@@ -13141,11 +13141,11 @@ class SmzTableContentActionsComponent {
|
|
|
13141
13141
|
constructor() { }
|
|
13142
13142
|
ngOnInit() { }
|
|
13143
13143
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableContentActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13144
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableContentActionsComponent, isStandalone: false, selector: "smz-table-content-actions", inputs: { col: "col", contentTypes: "contentTypes", item: "item", rowIndex: "rowIndex" }, host: { classAttribute: "grid grid-nogutter items-center justify-start gap-2" }, ngImport: i0, template: "@for (action of col.actions; track action) {\r\n @if (action.condition(item)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(item)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(item) : null\"></i>\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] });
|
|
13144
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableContentActionsComponent, isStandalone: false, selector: "smz-table-content-actions", inputs: { col: "col", contentTypes: "contentTypes", item: "item", rowIndex: "rowIndex" }, host: { classAttribute: "grid grid-nogutter items-center justify-start gap-2" }, ngImport: i0, template: "@for (action of col.actions; track action.icon) {\r\n @if (action.condition(item)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(item)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(item) : null\"></i>\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] });
|
|
13145
13145
|
}
|
|
13146
13146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableContentActionsComponent, decorators: [{
|
|
13147
13147
|
type: Component,
|
|
13148
|
-
args: [{ selector: 'smz-table-content-actions', host: { class: 'grid grid-nogutter items-center justify-start gap-2' }, standalone: false, template: "@for (action of col.actions; track action) {\r\n @if (action.condition(item)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(item)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(item) : null\"></i>\r\n }\r\n}" }]
|
|
13148
|
+
args: [{ selector: 'smz-table-content-actions', host: { class: 'grid grid-nogutter items-center justify-start gap-2' }, standalone: false, template: "@for (action of col.actions; track action.icon) {\r\n @if (action.condition(item)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(item)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(item) : null\"></i>\r\n }\r\n}" }]
|
|
13149
13149
|
}], ctorParameters: () => [], propDecorators: { col: [{
|
|
13150
13150
|
type: Input
|
|
13151
13151
|
}], contentTypes: [{
|
|
@@ -13266,11 +13266,11 @@ class SmzTableCaptionButtonsComponent {
|
|
|
13266
13266
|
constructor() { }
|
|
13267
13267
|
ngOnInit() { }
|
|
13268
13268
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableCaptionButtonsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13269
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableCaptionButtonsComponent, isStandalone: false, selector: "smz-table-caption-buttons", inputs: { buttons: "buttons" }, host: { classAttribute: "grid grid-nogutter items-center justify-start gap-2" }, ngImport: i0, template: "@for (action of buttons; track action) {\r\n @if (action.visibilityCondition()) {\r\n <button pButton type=\"button\" [ngClass]=\"action.styleClass\" [icon]=\"action.icon\" [label]=\"action.label\" (click)=\"action.callback()\" [disabled]=\"!(action.activationCondition() && action.claimsWithAccess | rbkCanAccess)\" [pTooltip]=\"action.tooltip != null ? action.tooltip() : null\"></button>\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: RbkCanAccessPipe, name: "rbkCanAccess" }] });
|
|
13269
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableCaptionButtonsComponent, isStandalone: false, selector: "smz-table-caption-buttons", inputs: { buttons: "buttons" }, host: { classAttribute: "grid grid-nogutter items-center justify-start gap-2" }, ngImport: i0, template: "@for (action of buttons; track action.label) {\r\n @if (action.visibilityCondition()) {\r\n <button pButton type=\"button\" [ngClass]=\"action.styleClass\" [icon]=\"action.icon\" [label]=\"action.label\" (click)=\"action.callback()\" [disabled]=\"!(action.activationCondition() && action.claimsWithAccess | rbkCanAccess)\" [pTooltip]=\"action.tooltip != null ? action.tooltip() : null\"></button>\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: RbkCanAccessPipe, name: "rbkCanAccess" }] });
|
|
13270
13270
|
}
|
|
13271
13271
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableCaptionButtonsComponent, decorators: [{
|
|
13272
13272
|
type: Component,
|
|
13273
|
-
args: [{ selector: 'smz-table-caption-buttons', host: { class: 'grid grid-nogutter items-center justify-start gap-2' }, standalone: false, template: "@for (action of buttons; track action) {\r\n @if (action.visibilityCondition()) {\r\n <button pButton type=\"button\" [ngClass]=\"action.styleClass\" [icon]=\"action.icon\" [label]=\"action.label\" (click)=\"action.callback()\" [disabled]=\"!(action.activationCondition() && action.claimsWithAccess | rbkCanAccess)\" [pTooltip]=\"action.tooltip != null ? action.tooltip() : null\"></button>\r\n }\r\n}" }]
|
|
13273
|
+
args: [{ selector: 'smz-table-caption-buttons', host: { class: 'grid grid-nogutter items-center justify-start gap-2' }, standalone: false, template: "@for (action of buttons; track action.label) {\r\n @if (action.visibilityCondition()) {\r\n <button pButton type=\"button\" [ngClass]=\"action.styleClass\" [icon]=\"action.icon\" [label]=\"action.label\" (click)=\"action.callback()\" [disabled]=\"!(action.activationCondition() && action.claimsWithAccess | rbkCanAccess)\" [pTooltip]=\"action.tooltip != null ? action.tooltip() : null\"></button>\r\n }\r\n}" }]
|
|
13274
13274
|
}], ctorParameters: () => [], propDecorators: { buttons: [{
|
|
13275
13275
|
type: Input
|
|
13276
13276
|
}] } });
|
|
@@ -13281,11 +13281,11 @@ class SmzTableHeaderActionsComponent {
|
|
|
13281
13281
|
constructor() { }
|
|
13282
13282
|
ngOnInit() { }
|
|
13283
13283
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableHeaderActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13284
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableHeaderActionsComponent, isStandalone: false, selector: "smz-table-header-actions", inputs: { col: "col" }, host: { classAttribute: "grid grid-nogutter items-center justify-start gap-2" }, ngImport: i0, template: "@for (action of col.headerActions; track action) {\r\n @if (action.condition(col)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(col)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(col) : null\"></i>\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] });
|
|
13284
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableHeaderActionsComponent, isStandalone: false, selector: "smz-table-header-actions", inputs: { col: "col" }, host: { classAttribute: "grid grid-nogutter items-center justify-start gap-2" }, ngImport: i0, template: "@for (action of col.headerActions; track action.icon) {\r\n @if (action.condition(col)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(col)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(col) : null\"></i>\r\n }\r\n}", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] });
|
|
13285
13285
|
}
|
|
13286
13286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableHeaderActionsComponent, decorators: [{
|
|
13287
13287
|
type: Component,
|
|
13288
|
-
args: [{ selector: 'smz-table-header-actions', host: { class: 'grid grid-nogutter items-center justify-start gap-2' }, standalone: false, template: "@for (action of col.headerActions; track action) {\r\n @if (action.condition(col)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(col)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(col) : null\"></i>\r\n }\r\n}" }]
|
|
13288
|
+
args: [{ selector: 'smz-table-header-actions', host: { class: 'grid grid-nogutter items-center justify-start gap-2' }, standalone: false, template: "@for (action of col.headerActions; track action.icon) {\r\n @if (action.condition(col)) {\r\n <i [ngClass]=\"action.icon + ' ' + action.styleClass\" class=\"cursor-pointer\" (click)=\"action.callback(col)\" [pTooltip]=\"action.tooltip != null ? action.tooltip(col) : null\"></i>\r\n }\r\n}" }]
|
|
13289
13289
|
}], ctorParameters: () => [], propDecorators: { col: [{
|
|
13290
13290
|
type: Input
|
|
13291
13291
|
}] } });
|
|
@@ -16320,6 +16320,23 @@ class SmzTableBuilder extends SmzBuilderUtilities {
|
|
|
16320
16320
|
throw Error('You cannot set any column width with percentage while using scrollable table.');
|
|
16321
16321
|
}
|
|
16322
16322
|
});
|
|
16323
|
+
if (this.tableState.viewport.state.persistance !== 'none'
|
|
16324
|
+
&& this.tableState.viewport.state.data != null
|
|
16325
|
+
&& this.tableState.pagination?.isVisible) {
|
|
16326
|
+
if (this.tableState.viewport.state.data.pagination != null) {
|
|
16327
|
+
this.tableState.pagination.state = {
|
|
16328
|
+
first: this.tableState.viewport.state.data.pagination.first,
|
|
16329
|
+
rows: this.tableState.viewport.state.data.pagination.rows,
|
|
16330
|
+
};
|
|
16331
|
+
this.tableState.pagination.rows = this.tableState.viewport.state.data.pagination.rows;
|
|
16332
|
+
}
|
|
16333
|
+
}
|
|
16334
|
+
if (this.tableState.viewport.state.persistance !== 'none'
|
|
16335
|
+
&& this.tableState.viewport.state.data != null
|
|
16336
|
+
&& this.tableState.viewport.state.data.sort?.field != null) {
|
|
16337
|
+
this.tableState.sort.field = this.tableState.viewport.state.data.sort.field;
|
|
16338
|
+
this.tableState.sort.order = this.tableState.viewport.state.data.sort.order;
|
|
16339
|
+
}
|
|
16323
16340
|
const selectionWidth = this.tableState.caption.rowSelection.columnWidth;
|
|
16324
16341
|
this.tableState.caption.rowSelection.ngStyle = applyTableContentNgStyle(this.tableState, null, selectionWidth);
|
|
16325
16342
|
const customWidth = this.tableState.actions.customActions.columnWidth;
|
|
@@ -16738,6 +16755,8 @@ class SmzTableComponent {
|
|
|
16738
16755
|
showSkeleton = false;
|
|
16739
16756
|
documentClickListener = null;
|
|
16740
16757
|
isViewInit = false;
|
|
16758
|
+
isRestoringViewport = false;
|
|
16759
|
+
isViewportInitializing = false;
|
|
16741
16760
|
contentTypes = {
|
|
16742
16761
|
currency: SmzContentType.CURRENCY,
|
|
16743
16762
|
calendar: SmzContentType.CALENDAR,
|
|
@@ -16780,6 +16799,43 @@ class SmzTableComponent {
|
|
|
16780
16799
|
this.editableService.deleteEvent = this.delete;
|
|
16781
16800
|
}
|
|
16782
16801
|
ngOnInit() {
|
|
16802
|
+
if (!this.shouldRestorePersistedViewport()) {
|
|
16803
|
+
return;
|
|
16804
|
+
}
|
|
16805
|
+
this.isViewportInitializing = true;
|
|
16806
|
+
this.hydratePersistedViewportPreview(this.state.viewport.state.data);
|
|
16807
|
+
}
|
|
16808
|
+
shouldRestorePersistedViewport() {
|
|
16809
|
+
const viewportState = this.state?.viewport?.state;
|
|
16810
|
+
if (viewportState?.isEnabled !== true || viewportState.persistance === 'none') {
|
|
16811
|
+
return false;
|
|
16812
|
+
}
|
|
16813
|
+
if (viewportState.data != null) {
|
|
16814
|
+
return true;
|
|
16815
|
+
}
|
|
16816
|
+
if (viewportState.persistance === 'auto') {
|
|
16817
|
+
return localStorage.getItem(viewportState.auto.key) != null;
|
|
16818
|
+
}
|
|
16819
|
+
if (viewportState.persistance === 'manual') {
|
|
16820
|
+
return true;
|
|
16821
|
+
}
|
|
16822
|
+
return false;
|
|
16823
|
+
}
|
|
16824
|
+
hydratePersistedViewportPreview(viewportData) {
|
|
16825
|
+
if (viewportData == null || this.state == null) {
|
|
16826
|
+
return;
|
|
16827
|
+
}
|
|
16828
|
+
const globalFilter = viewportData.filters?.['global'];
|
|
16829
|
+
if (globalFilter != null) {
|
|
16830
|
+
this.globalSearchInput = globalFilter.value;
|
|
16831
|
+
}
|
|
16832
|
+
this.state.columns.forEach(column => {
|
|
16833
|
+
const visibilityData = viewportData.visibility?.find(x => x.key === column.field);
|
|
16834
|
+
if (visibilityData != null) {
|
|
16835
|
+
column.isVisible = visibilityData.isVisible;
|
|
16836
|
+
}
|
|
16837
|
+
});
|
|
16838
|
+
this.populateColumnVisibility(this.state);
|
|
16783
16839
|
}
|
|
16784
16840
|
hasFilters() {
|
|
16785
16841
|
for (const key in this.table?.filters) {
|
|
@@ -16827,9 +16883,7 @@ class SmzTableComponent {
|
|
|
16827
16883
|
this.selectedColumns = this.selectedColumns.filter(x => x.field !== column.field);
|
|
16828
16884
|
}
|
|
16829
16885
|
ngAfterViewInit() {
|
|
16830
|
-
|
|
16831
|
-
this.initializeState();
|
|
16832
|
-
}, 0);
|
|
16886
|
+
this.initializeState();
|
|
16833
16887
|
}
|
|
16834
16888
|
initializeState() {
|
|
16835
16889
|
if (this.state == null) {
|
|
@@ -16856,18 +16910,37 @@ class SmzTableComponent {
|
|
|
16856
16910
|
this.editableService.state = this.state;
|
|
16857
16911
|
this.formsService.state = this.state;
|
|
16858
16912
|
this.editableService.setupAccess();
|
|
16913
|
+
const needsDeferredPaginationSync = this.state.viewport?.state?.isEnabled
|
|
16914
|
+
&& this.state.viewport.state.data?.pagination != null
|
|
16915
|
+
&& this.state.pagination?.isVisible;
|
|
16916
|
+
if (needsDeferredPaginationSync) {
|
|
16917
|
+
setTimeout(() => {
|
|
16918
|
+
this.applyPersistedPagination(this.state.viewport.state.data);
|
|
16919
|
+
this.isViewportInitializing = false;
|
|
16920
|
+
this.cdr.markForCheck();
|
|
16921
|
+
}, 0);
|
|
16922
|
+
}
|
|
16923
|
+
else {
|
|
16924
|
+
this.isViewportInitializing = false;
|
|
16925
|
+
}
|
|
16859
16926
|
this.isViewInit = true;
|
|
16860
16927
|
this.cdr.markForCheck();
|
|
16861
16928
|
}
|
|
16862
16929
|
extractViewportStateData() {
|
|
16863
16930
|
const results = {
|
|
16864
16931
|
filters: this.table.filters,
|
|
16865
|
-
visibility: this.state.columns.map(x => {
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
}),
|
|
16932
|
+
visibility: this.state.columns.map(x => ({
|
|
16933
|
+
key: x.field,
|
|
16934
|
+
isVisible: x.isVisible,
|
|
16935
|
+
})),
|
|
16869
16936
|
sort: { mode: 'single', field: this.table.sortField, order: this.table.sortOrder }
|
|
16870
16937
|
};
|
|
16938
|
+
if (this.state.pagination?.isVisible) {
|
|
16939
|
+
results.pagination = {
|
|
16940
|
+
first: this.state.pagination.state.first,
|
|
16941
|
+
rows: this.state.pagination.state.rows,
|
|
16942
|
+
};
|
|
16943
|
+
}
|
|
16871
16944
|
return results;
|
|
16872
16945
|
}
|
|
16873
16946
|
initViewportState() {
|
|
@@ -16896,7 +16969,7 @@ class SmzTableComponent {
|
|
|
16896
16969
|
});
|
|
16897
16970
|
// Popular a variavel contendo as colunas visiveis
|
|
16898
16971
|
this.populateColumnVisibility(this.state);
|
|
16899
|
-
if (state.data.sort != null) {
|
|
16972
|
+
if (state.data.sort != null && state.data.sort.field != null) {
|
|
16900
16973
|
this.table.sortMode = 'single';
|
|
16901
16974
|
this.table.sortField = state.data.sort.field;
|
|
16902
16975
|
this.table.sortOrder = state.data.sort.order;
|
|
@@ -16909,6 +16982,38 @@ class SmzTableComponent {
|
|
|
16909
16982
|
}
|
|
16910
16983
|
this.table.sortSingle();
|
|
16911
16984
|
}
|
|
16985
|
+
this.applyPersistedPagination(state.data);
|
|
16986
|
+
}
|
|
16987
|
+
applyPersistedPagination(viewportData) {
|
|
16988
|
+
if (!this.state.pagination?.isVisible) {
|
|
16989
|
+
return;
|
|
16990
|
+
}
|
|
16991
|
+
if (viewportData.pagination != null) {
|
|
16992
|
+
this.state.pagination.state = {
|
|
16993
|
+
first: viewportData.pagination.first,
|
|
16994
|
+
rows: viewportData.pagination.rows,
|
|
16995
|
+
};
|
|
16996
|
+
this.state.pagination.rows = viewportData.pagination.rows;
|
|
16997
|
+
}
|
|
16998
|
+
else {
|
|
16999
|
+
this.state.pagination.state = {
|
|
17000
|
+
first: 0,
|
|
17001
|
+
rows: this.state.pagination.rows,
|
|
17002
|
+
};
|
|
17003
|
+
}
|
|
17004
|
+
this.syncPaginationToTable();
|
|
17005
|
+
}
|
|
17006
|
+
syncPaginationToTable() {
|
|
17007
|
+
if (this.table == null) {
|
|
17008
|
+
return;
|
|
17009
|
+
}
|
|
17010
|
+
this.isRestoringViewport = true;
|
|
17011
|
+
this.table.first = this.state.pagination.state.first;
|
|
17012
|
+
this.table.rows = this.state.pagination.state.rows;
|
|
17013
|
+
if (this.table.onPageChange != null) {
|
|
17014
|
+
this.table.onPageChange(this.state.pagination.state);
|
|
17015
|
+
}
|
|
17016
|
+
this.isRestoringViewport = false;
|
|
16912
17017
|
}
|
|
16913
17018
|
ngOnChanges(changes) {
|
|
16914
17019
|
if (changes['state'] != null) {
|
|
@@ -16930,9 +17035,12 @@ class SmzTableComponent {
|
|
|
16930
17035
|
}
|
|
16931
17036
|
if (changes['items'] != null) {
|
|
16932
17037
|
setTimeout(() => {
|
|
17038
|
+
if (this.isViewportInitializing) {
|
|
17039
|
+
return;
|
|
17040
|
+
}
|
|
16933
17041
|
if (this.table != null && this.table.onPageChange != null) {
|
|
16934
17042
|
// ATUALIZAR PAGINA ATUAL NO PAGINADOR DO PRIME
|
|
16935
|
-
this.
|
|
17043
|
+
this.syncPaginationToTable();
|
|
16936
17044
|
// PROPAGAR ALTERAÇÕES
|
|
16937
17045
|
this.cdr.markForCheck();
|
|
16938
17046
|
}
|
|
@@ -17184,6 +17292,10 @@ class SmzTableComponent {
|
|
|
17184
17292
|
}
|
|
17185
17293
|
onPage(event) {
|
|
17186
17294
|
this.state.pagination.state = event;
|
|
17295
|
+
this.state.pagination.rows = event.rows;
|
|
17296
|
+
if (!this.isRestoringViewport) {
|
|
17297
|
+
this.viewportChange();
|
|
17298
|
+
}
|
|
17187
17299
|
}
|
|
17188
17300
|
emitSelection(event) {
|
|
17189
17301
|
this.selectionChange.emit(event);
|
|
@@ -17256,11 +17368,11 @@ class SmzTableComponent {
|
|
|
17256
17368
|
this.tableHelper.clear(this.tableKey);
|
|
17257
17369
|
}
|
|
17258
17370
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: TableEditableService }, { token: TableFormsService }, { token: TableHelperService }, { token: i1$6.Store }, { token: SmzExcelService }], target: i0.ɵɵFactoryTarget.Component });
|
|
17259
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableComponent, isStandalone: false, selector: "smz-ui-table", inputs: { state: "state", items: "items", loading: "loading" }, outputs: { selectionChange: "selectionChange", filterChange: "filterChange", columnVisibilityChange: "columnVisibilityChange", create: "create", update: "update", delete: "delete" }, providers: [TableEditableService, TableFormsService], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "table", first: true, predicate: ["dt"], descendants: true }, { propertyName: "columnMultiselect", first: true, predicate: ["columnMultiselect"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (state | tableContext; as context) {\r\n @if ((context.state.emptyFeedback != null && (context.state.emptyFeedback.extraInfo || context.state.emptyFeedback.image || context.state.emptyFeedback.actionButtons)) && (items != null && items.length === 0) && context.state.emptyFeedback.isFeatured) {\r\n <smz-data-info\r\n [image]=\"context.state.emptyFeedback.image\"\r\n [message]=\"context.state.emptyFeedback.message\"\r\n [callbackInfo]=\"context.state.emptyFeedback.extraInfo\"\r\n [actions]=\"context.state.emptyFeedback.actionButtons\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n <ng-container *ngVar=\"state.source?.items$ != null ? (state.source.items$ | async) : null as observableSource\">\r\n <ng-container *ngVar=\"state.source?.signalItems != null ? state.source.signalItems() : null as signalSource\">\r\n @if (((observableSource ?? signalSource ?? items) | cloneTableItems : context: tableKey: context.state.rowExpansion.sincronize); as clonedData) {\r\n <p-table #dt\r\n dataKey=\"id\"\r\n editMode=\"row\"\r\n [stripedRows]=\"context.state.styles.striped\"\r\n [value]=\"clonedData.items\"\r\n [(selection)]=\"selectedItems\"\r\n [tableStyleClass]=\"context.state.styles.tableStyleClass\"\r\n [styleClass]=\"'p-datatable-smz-ui-table' + (context.state.styles.showGrid ? ' p-datatable-gridlines' : '') + (context.state.styles.size === 'extra-small' ? ' p-datatable-xs' : '') + (context.state.styles.size === 'small' ? ' p-datatable-sm' : '') + (context.state.styles.size === 'large' ? ' p-datatable-lg' : '')\"\r\n [rowHover]=\"context.state.actions.rowBehavior.hoverable\"\r\n [rows]=\"context.state.pagination.rows\"\r\n [showCurrentPageReport]=\"context.state.pagination.pageReport.isVisible\"\r\n [rowsPerPageOptions]=\"context.state.pagination.rowsPerPageOptions\"\r\n [loading]=\"loading\"\r\n [paginator]=\"context.state.pagination.isVisible\"\r\n paginatorDropdownAppendTo=\"body\"\r\n [currentPageReportTemplate]=\"context.state.locale.paginator.template\"\r\n [sortField]=\"context.state.sort.field\"\r\n [sortMode]=\"context.state.sort.mode\"\r\n [sortOrder]=\"context.state.sort.order\"\r\n [multiSortMeta]=\"context.state.sort.multiSortMeta\"\r\n [scrollable]=\"context.state.viewport.scrollable\"\r\n [scrollHeight]=\"context.state.viewport.scrollHeight\"\r\n [filterDelay]=\"0\"\r\n [globalFilterFields]=\"context.globalFilter\"\r\n [columns]=\"context.visibleColumns\"\r\n [frozenColumns]=\"context.frozenColumns\"\r\n [frozenWidth]=\"context.state.frozen.isEnabled ? context.state.frozen.width : null\"\r\n [resizableColumns]=\"context.state.viewport.resizableColumns\"\r\n [columnResizeMode]=\"context.state.viewport.columnResizeMode\"\r\n (onPage)=\"onPage($event)\"\r\n (onFilter)=\"onFilter($event)\"\r\n (selectionChange)=\"emitSelection($event)\"\r\n >\r\n @if (context.state.caption.isVisible) {\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"grid grid-nogutter items-center gap-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n @if (context.state.caption.title != null) {\r\n <div class=\"col database-title\" [innerHTML]=\"context.state.caption.title\"></div>\r\n }\r\n <ng-container *ngTemplateOutlet=\"captionTemplate; context: { $implicit: dt }\"></ng-container>\r\n <smz-table-caption-buttons [buttons]=\"context.state.caption.buttons\"></smz-table-caption-buttons>\r\n @if (context.state.caption.exportToPdf.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToPdf.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-pdf\" (click)=\"exportToPdf(context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.exportToExcel.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToExcel.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-excel\" (click)=\"exportToExcel(table, context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.editable.creation.isButtonVisible) {\r\n <button pButton [label]=\"context.state.editable.creation.buttonLabel\" class=\"p-button-outlined\" icon=\"fa-solid fa-plus\" (click)=\"editableService.onRowCreateInit(table, context.columns)\" [disabled]=\"clonedData.showSkeleton || editableService.isEditing || editableService.isCreating || context.state.editable.creation.isButtonDisabled\"></button>\r\n }\r\n @if (context.state.caption.rowSelection.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.rowSelection.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-check-double\" (click)=\"onRowSelection(context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.clearFilters.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.columnVisibility.showDropdownSelector) {\r\n <p-multiSelect\r\n #columnMultiselect\r\n class=\"ml-2 col-12 md:col-2\"\r\n styleClass=\"w-full\"\r\n [options]=\"context.hideableColumns\"\r\n [(ngModel)]=\"selectedColumns\"\r\n [placeholder]=\"context.state.locale.columnVisibility.placeholder\"\r\n [selectedItemsLabel]=\"context.state.locale.columnVisibility.selectedItemsLabel\"\r\n optionLabel=\"name\"\r\n dataKey=\"field\"\r\n optionLabel=\"header\"\r\n [filter]=\"true\"\r\n (onPanelHide)=\"updateColumnsVisibility(true)\"\r\n [pTooltip]=\"context.state.locale.columnVisibility.pTooltip\">\r\n </p-multiSelect>\r\n }\r\n @if (context.state.caption.globalFilter.isVisible) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"{ 'md:col-2': !context.state.caption.globalFilter.expanded }\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal [(ngModel)]=\"globalSearchInput\" pInputText type=\"text\" styleClass=\"database-global-search\" (input)=\"updateGlobalFilter(inputGlobal.value)\" [disabled]=\"clonedData.showSkeleton\" [placeholder]=\"context.state.locale.globalFilter.placeholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </ng-template>\r\n }\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr [ngClass]=\"{ 'invisible-header': !context.state.header.isVisible }\">\r\n @if (context.state.caption.rowSelection.isEnabled) {\r\n <th [ngStyle]=\"context.state.caption.rowSelection.ngStyle\">\r\n @if (!context.state.actions.batchActions.isVisible) {\r\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\r\n }\r\n </th>\r\n }\r\n @if (context.state.rowExpansion.isEnabled) {\r\n <th [ngStyle]=\"context.state.rowExpansion.ngStyle\"></th>\r\n }\r\n @for (col of columns; track col) {\r\n @if (context.state.viewport.resizableColumns) {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n } @else {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n }\r\n <ng-template #headerContent>\r\n <div class=\"flex justify-start items-center\">\r\n <span class=\"mr-1\">{{ col.header }}</span>\r\n @if (col.showHeaderActions) {\r\n <smz-table-header-actions clickStopPropagation class=\"ml-1 mt-1\" [col]=\"col\"></smz-table-header-actions>\r\n }\r\n @if (!clonedData.showSkeleton && col.isOrderable) {\r\n <p-sortIcon [field]=\"col.sortField\"></p-sortIcon>\r\n }\r\n @if (!clonedData.showSkeleton) {\r\n @switch (col.filter.type) {\r\n @case (filterTypes.currency) {\r\n <smz-column-filter type=\"numeric\" currency=\"BRL\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.numeric) {\r\n <smz-column-filter type=\"numeric\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.date) {\r\n <smz-column-filter type=\"date\" [field]=\"col.filterField\" [showTime]=\"col.filter.showTime\"></smz-column-filter>\r\n }\r\n @case (filterTypes.text) {\r\n <smz-column-filter type=\"text\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.boolean) {\r\n <smz-column-filter type=\"boolean\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.dropdown) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField + '.id'\" matchMode=\"dropdown\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-select appendTo=\"body\" [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-select>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"in\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_array) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"array-some\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : true\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_string) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"multiselectByString\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField : filterField : null : true : false : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n }\r\n }\r\n @if (context.state.caption.columnVisibility.showColumnHideButton) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-eye-slash\" class=\"p-button-rounded p-button-text p-button-plain\" (click)=\"hideColumn(col, context)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible|| context.state.editable.isEditable) {\r\n <th [ngStyle]=\"context.state.editable.isEditable ? context.state.editable.ngStyle : context.state.actions.customActions.ngStyle\"></th>\r\n }\r\n </tr>\r\n @if (context.state.actions.batchActions.isVisible) {\r\n <tr>\r\n <th [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\"\r\n [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <p-tableHeaderCheckbox class=\"mr-4\"></p-tableHeaderCheckbox>\r\n @if (selectedItems?.length > 0) {\r\n @for (batchItem of context.state.actions.batchActions.items; track batchItem) {\r\n @if (batchItem.visible) {\r\n <button pButton [label]=\"batchItem.label\" class=\"p-button-rounded p-button-text p-button-plain animate__animated animate__fadeIn\" [ngClass]=\"batchItem.styleClass\" [icon]=\"batchItem.icon\" (click)=\"batchItem.command(selectedItems); selectedItems = [];\" [disabled]=\"batchItem.disabled\" [pTooltip]=\"batchItem.tooltip\"></button>\r\n }\r\n }\r\n }\r\n </div>\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-item let-editing=\"editing\" let-rowIndex=\"rowIndex\" let-columns=\"columns\">\r\n <tr #editableRowElement\r\n [pEditableRow]=\"item\"\r\n tableItemAction\r\n [isClickable]=\"context.state.actions.rowBehavior.isClickable\"\r\n [callback]=\"context.state.actions.rowBehavior.clickCallback\"\r\n [expandRowOnClick]=\"context.state.actions.rowBehavior.expandRowOnClick\"\r\n [item]=\"item\"\r\n class=\"p-selectable-row\"\r\n [ngClass]=\"{ 'highlight-row': item?.id === state.actions.rowBehavior.highlights, 'preserve-in-small': state.actions.rowBehavior.preserveLayoutInSmallDevices }\"\r\n >\r\n @if (context.state.caption.rowSelection.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\"\r\n [ngStyle]=\"context.state.caption.rowSelection.ngStyle\"\r\n >\r\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\r\n </td>\r\n }\r\n @if (context.state.rowExpansion.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading, 'grid grid-nogutter justify-start items-center gap-2': context.state.rowExpansion.highlightNewItems && item._isNew }\"\r\n [ngStyle]=\"context.state.rowExpansion.ngStyle\"\r\n >\r\n <p-toggleButton [(ngModel)]=\"item._isExpanded\" [onIcon]=\"'fa-solid fa-chevron-down'\" [offIcon]=\"'fa-solid fa-chevron-right'\" (onChange)=\"item._isNew = false\"></p-toggleButton>\r\n @if (context.state.rowExpansion.highlightNewItems && item._isNew) {\r\n <div class=\"rounded bg-cyan-400 text-sm text-white px-2 py-0 smz-table-new-tag\" (click)=\"item._isNew = false\">{{ context.state.rowExpansion.highlightLabel }}</div>\r\n }\r\n </td>\r\n }\r\n @for (col of columns; track col) {\r\n @if (clonedData.showSkeleton) {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngStyle]=\"col.content.ngStyle\"><p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton></td>\r\n } @else {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\" [ngStyle]=\"col.content.ngStyle\">\r\n <span class=\"p-column-title\">{{ col.header }}</span>\r\n <p-cellEditor>\r\n <!-- CELULAR COM EDITOR -->\r\n <ng-template pTemplate=\"input\">\r\n @switch (col.editable.type) {\r\n @case (editableTypes.none) {\r\n <smz-table-content class=\"cursor-default\" [ngClass]=\"col.content.contentStyleClass\" [col]=\"col\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\"></smz-table-content>\r\n }\r\n @case (editableTypes.custom) {\r\n <ng-container *ngTemplateOutlet=\"editableTemplate; context: { $implicit: item, col: col }\"></ng-container>\r\n }\r\n <!-- INPUT TEXT -->\r\n @case (editableTypes.text) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <input pInputText type=\"text\" [formControl]=\"$any(control)\" style=\"width: 100%;\">\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT NUMBER -->\r\n @case (editableTypes.number) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-inputNumber\r\n *ngVar=\"col.editable.data as numberData\"\r\n [formControl]=\"$any(control)\"\r\n [mode]=\"numberData.mode\"\r\n [minFractionDigits]=\"numberData.minFractionDigits\"\r\n [maxFractionDigits]=\"numberData.maxFractionDigits\"\r\n [currency]=\"numberData.currency\"\r\n [useGrouping]=\"numberData.useGrouping\"\r\n [allowEmpty]=\"numberData.allowEmpty\"\r\n [showClear]=\"numberData.showClear\"\r\n [showButtons]=\"numberData.showButtons\"\r\n [prefix]=\"numberData.prefix\"\r\n [suffix]=\"numberData.suffix\">\r\n </p-inputNumber>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT SWITCH -->\r\n @case (editableTypes.switch) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-toggleswitch [formControl]=\"$any(control)\"></p-toggleswitch>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT TEXT AREA -->\r\n @case (editableTypes.area) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <textarea pInputTextarea type=\"text\" [formControl]=\"$any(control)\" [rows]=\"$any(col.editable.data).rows\" required style=\"width: 100%;\"></textarea>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT DROPDOWN -->\r\n @case (editableTypes.dropdown) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-select appendTo=\"body\" [formControl]=\"$any(control)\" styleClass=\"w-full\" [options]=\"col.editable.data | editableSource\" optionLabel=\"name\" dataKey=\"id\" [placeholder]=\"$any(col.editable.data).placeholder\" [showClear]=\"!col.editable.validatorsPreset?.isRequired\" [filter]=\"true\"></p-select>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT CALENDAR -->\r\n @case (editableTypes.calendar) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-datepicker [formControl]=\"$any(control)\" appendTo=\"body\" styleClass=\"w-full\" [ngClass]=\"{ 'pl-5': !control.valid }\"></p-datepicker>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n </ng-template>\r\n <!-- CELULAR COM CONTE\u00DADO -->\r\n <ng-template pTemplate=\"output\">\r\n <smz-table-content\r\n [col]=\"col\"\r\n [pTooltip]=\"col.content.tooltip != null ? col.content.tooltip(item) : null\"\r\n tooltipPosition=\"left\"\r\n [ngClass]=\"col.content.contentStyleClass\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\">\r\n </smz-table-content>\r\n </ng-template>\r\n </p-cellEditor>\r\n </td>\r\n }\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) {\r\n <td [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-center\">\r\n @if (clonedData.showSkeleton) {\r\n <div class=\"w-full\">\r\n <p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton>\r\n </div>\r\n } @else {\r\n <!-- SEM EDITAR -->\r\n @if (!editing) {\r\n @if (context.state.editable.update.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-pencil\" (click)=\"editableService.onRowEditInit(item)\" class=\"p-button-rounded p-button-text mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.update.isButtonDisabled || (!context.state.editable.update.condition(item))\" pInitEditableRow></button>\r\n }\r\n @if (context.state.editable.remove.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-trash\" (click)=\"editableService.onRowRemove($event, table, item)\" class=\"p-button-rounded p-button-text p-button-secondary mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.remove.isButtonDisabled || (!context.state.editable.remove.condition(item))\"></button>\r\n }\r\n }\r\n <!-- EDITANDO -->\r\n @if (editing) {\r\n @if (editableService.context[item.id]; as editableContext) {\r\n <!-- COM LOADING -->\r\n @if (editableContext.isLoading) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-rotate fa-spin\" [disabled]=\"true\" class=\"p-button-rounded p-button-text p-button-info mr-2\"></button>\r\n }\r\n <!-- SEM LOADING -->\r\n @if (!editableContext.isLoading) {\r\n <!-- EDITANDO -->\r\n @if (!editableContext.hasErrors) {\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowCreateSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowEditSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n <!-- COM ERRORS -->\r\n @if (editableContext.hasErrors) {\r\n <p-popover #errorsOverlay appendTo=\"body\" [style]=\"{ width: '450px' }\">\r\n <div [innerHtml]=\"editableContext.errors | contentErrors\"></div>\r\n </p-popover>\r\n <button pButton type=\"button\" icon=\"fas fa-exclamation-triangle\" [disabled]=\"false\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger mr-2\" (click)=\"errorsOverlay.toggle($event)\"></button>\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n }\r\n }\r\n }\r\n <!-- CUSTOM MENU -->\r\n @if (context.state.actions.customActions.isVisible && !editing) {\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: item }\"></ng-container>\r\n }\r\n <!-- MENU -->\r\n @if (context.state.actions.menu.isVisible && !editing) {\r\n <smz-menu [callback]=\"context.state.actions.menu.callback\" [items]=\"context.state.actions.menu.items\" [data]=\"item\" [behavior]=\"context.state.actions.menu.behavior\" [ngClass]=\"{ 'ml-2': context.state.actions.customActions.isVisible }\" [icon]=\"context.state.actions.menu.styles.icon\" [styleClass]=\"context.state.actions.menu.styles.styleClass\" [buttonClass]=\"context.state.actions.menu.styles.buttonClass\"></smz-menu>\r\n }\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (item?._isExpanded) {\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\">\r\n <ng-container *ngTemplateOutlet=\"rowContentTemplate; context: { $implicit: item }\"></ng-container>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" let-columns>\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\" [ngStyle]=\"{ 'text-align': 'center' }\">\r\n <div [innerHtml]=\"context.state.emptyFeedback.message\"></div>\r\n @if (context.state.caption.clearFilters.isButtonVisible && hasFilters()) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined mt-3\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\"></button>\r\n }\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n }\r\n </ng-container>\r\n </ng-container>\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$7.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i8.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i8.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "component", type: i8.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i8.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i8.TableCheckbox, selector: "p-tableCheckbox", inputs: ["value", "disabled", "required", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i8.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i8.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i8.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i3$5.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i4$1.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i1$2.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TableItemActionsDirective, selector: "[tableItemAction]", inputs: ["isClickable", "item", "callback", "expandRowOnClick"] }, { kind: "directive", type: ClickStopPropagationDirective, selector: "[clickStopPropagation]" }, { kind: "component", type: SmzDataInfoComponent, selector: "smz-data-info", inputs: ["image", "message", "actions", "callbackInfo", "callbackLabel"], outputs: ["clicked"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i19.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: i2$4.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["pTextareaPT", "pTextareaUnstyled", "autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "component", type: i3.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2$3.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "component", type: i3$3.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: SmzMenuComponent, selector: "smz-menu", inputs: ["items", "callback", "data", "buttonClass", "styleClass", "icon", "behavior"] }, { kind: "component", type: i25.ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "directive", type: NgVar, selector: "[ngVar]", inputs: ["ngVar"] }, { kind: "component", type: i27.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i28.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "component", type: SmzColumnFilterComponent, selector: "smz-column-filter", inputs: ["currency", "display", "field", "matchMode", "showAddButton", "showMatchModes", "showOperator", "type", "showTime"] }, { kind: "component", type: SmzTableValidationMessagesComponent, selector: "smz-table-validation-messages", inputs: ["errors", "messages", "isFormInvalid", "isFormDirty"] }, { kind: "component", type: SmzTableContentComponent, selector: "smz-table-content", inputs: ["col", "contentTypes", "item", "rowIndex", "contentTemplate"] }, { kind: "component", type: SmzTableCaptionButtonsComponent, selector: "smz-table-caption-buttons", inputs: ["buttons"] }, { kind: "component", type: SmzTableHeaderActionsComponent, selector: "smz-table-header-actions", inputs: ["col"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: UniqueFilterPipe, name: "uniqueFilter" }, { kind: "pipe", type: SmzTableContextPipe, name: "tableContext" }, { kind: "pipe", type: SmzFilterObjectPipe, name: "filterObject" }, { kind: "pipe", type: SmzCloneTableItemsPipe, name: "cloneTableItems" }, { kind: "pipe", type: SmzEditableSourcePipe, name: "editableSource" }, { kind: "pipe", type: SmzContentErrorsPipe, name: "contentErrors" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
17371
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: SmzTableComponent, isStandalone: false, selector: "smz-ui-table", inputs: { state: "state", items: "items", loading: "loading" }, outputs: { selectionChange: "selectionChange", filterChange: "filterChange", columnVisibilityChange: "columnVisibilityChange", create: "create", update: "update", delete: "delete" }, providers: [TableEditableService, TableFormsService], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "table", first: true, predicate: ["dt"], descendants: true }, { propertyName: "columnMultiselect", first: true, predicate: ["columnMultiselect"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (state | tableContext; as context) {\r\n @if ((context.state.emptyFeedback != null && (context.state.emptyFeedback.extraInfo || context.state.emptyFeedback.image || context.state.emptyFeedback.actionButtons)) && (items != null && items.length === 0) && context.state.emptyFeedback.isFeatured) {\r\n <smz-data-info\r\n [image]=\"context.state.emptyFeedback.image\"\r\n [message]=\"context.state.emptyFeedback.message\"\r\n [callbackInfo]=\"context.state.emptyFeedback.extraInfo\"\r\n [actions]=\"context.state.emptyFeedback.actionButtons\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n <ng-container *ngVar=\"state.source?.items$ != null ? (state.source.items$ | async) : null as observableSource\">\r\n <ng-container *ngVar=\"state.source?.signalItems != null ? state.source.signalItems() : null as signalSource\">\r\n @if (((observableSource ?? signalSource ?? items) | cloneTableItems : context: tableKey: context.state.rowExpansion.sincronize); as clonedData) {\r\n <p-table #dt\r\n dataKey=\"id\"\r\n editMode=\"row\"\r\n [stripedRows]=\"context.state.styles.striped\"\r\n [value]=\"clonedData.items\"\r\n [(selection)]=\"selectedItems\"\r\n [tableStyleClass]=\"context.state.styles.tableStyleClass\"\r\n [styleClass]=\"'p-datatable-smz-ui-table' + (context.state.styles.showGrid ? ' p-datatable-gridlines' : '') + (context.state.styles.size === 'extra-small' ? ' p-datatable-xs' : '') + (context.state.styles.size === 'small' ? ' p-datatable-sm' : '') + (context.state.styles.size === 'large' ? ' p-datatable-lg' : '')\"\r\n [rowHover]=\"context.state.actions.rowBehavior.hoverable\"\r\n [rows]=\"context.state.pagination.rows\"\r\n [first]=\"context.state.pagination.state.first\"\r\n [showCurrentPageReport]=\"context.state.pagination.pageReport.isVisible\"\r\n [rowsPerPageOptions]=\"context.state.pagination.rowsPerPageOptions\"\r\n [loading]=\"loading || isViewportInitializing\"\r\n [style.visibility]=\"isViewportInitializing ? 'hidden' : null\"\r\n [paginator]=\"context.state.pagination.isVisible\"\r\n paginatorDropdownAppendTo=\"body\"\r\n [currentPageReportTemplate]=\"context.state.locale.paginator.template\"\r\n [sortField]=\"context.state.sort.field\"\r\n [sortMode]=\"context.state.sort.mode\"\r\n [sortOrder]=\"context.state.sort.order\"\r\n [multiSortMeta]=\"context.state.sort.multiSortMeta\"\r\n [scrollable]=\"context.state.viewport.scrollable\"\r\n [scrollHeight]=\"context.state.viewport.scrollHeight\"\r\n [filterDelay]=\"0\"\r\n [globalFilterFields]=\"context.globalFilter\"\r\n [columns]=\"context.visibleColumns\"\r\n [frozenColumns]=\"context.frozenColumns\"\r\n [frozenWidth]=\"context.state.frozen.isEnabled ? context.state.frozen.width : null\"\r\n [resizableColumns]=\"context.state.viewport.resizableColumns\"\r\n [columnResizeMode]=\"context.state.viewport.columnResizeMode\"\r\n (onPage)=\"onPage($event)\"\r\n (onFilter)=\"onFilter($event)\"\r\n (selectionChange)=\"emitSelection($event)\"\r\n >\r\n @if (context.state.caption.isVisible) {\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"grid grid-nogutter items-center gap-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n @if (context.state.caption.title != null) {\r\n <div class=\"col database-title\" [innerHTML]=\"context.state.caption.title\"></div>\r\n }\r\n <ng-container *ngTemplateOutlet=\"captionTemplate; context: { $implicit: dt }\"></ng-container>\r\n <smz-table-caption-buttons [buttons]=\"context.state.caption.buttons\"></smz-table-caption-buttons>\r\n @if (context.state.caption.exportToPdf.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToPdf.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-pdf\" (click)=\"exportToPdf(context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.exportToExcel.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToExcel.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-excel\" (click)=\"exportToExcel(table, context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.editable.creation.isButtonVisible) {\r\n <button pButton [label]=\"context.state.editable.creation.buttonLabel\" class=\"p-button-outlined\" icon=\"fa-solid fa-plus\" (click)=\"editableService.onRowCreateInit(table, context.columns)\" [disabled]=\"clonedData.showSkeleton || editableService.isEditing || editableService.isCreating || context.state.editable.creation.isButtonDisabled\"></button>\r\n }\r\n @if (context.state.caption.rowSelection.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.rowSelection.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-check-double\" (click)=\"onRowSelection(context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.clearFilters.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.columnVisibility.showDropdownSelector) {\r\n <p-multiSelect\r\n #columnMultiselect\r\n class=\"ml-2 col-12 md:col-2\"\r\n styleClass=\"w-full\"\r\n [options]=\"context.hideableColumns\"\r\n [(ngModel)]=\"selectedColumns\"\r\n [placeholder]=\"context.state.locale.columnVisibility.placeholder\"\r\n [selectedItemsLabel]=\"context.state.locale.columnVisibility.selectedItemsLabel\"\r\n optionLabel=\"name\"\r\n dataKey=\"field\"\r\n optionLabel=\"header\"\r\n [filter]=\"true\"\r\n (onPanelHide)=\"updateColumnsVisibility(true)\"\r\n [pTooltip]=\"context.state.locale.columnVisibility.pTooltip\">\r\n </p-multiSelect>\r\n }\r\n @if (context.state.caption.globalFilter.isVisible) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"{ 'md:col-2': !context.state.caption.globalFilter.expanded }\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal [(ngModel)]=\"globalSearchInput\" pInputText type=\"text\" styleClass=\"database-global-search\" (input)=\"updateGlobalFilter(inputGlobal.value)\" [disabled]=\"clonedData.showSkeleton\" [placeholder]=\"context.state.locale.globalFilter.placeholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </ng-template>\r\n }\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr [ngClass]=\"{ 'invisible-header': !context.state.header.isVisible }\">\r\n @if (context.state.caption.rowSelection.isEnabled) {\r\n <th [ngStyle]=\"context.state.caption.rowSelection.ngStyle\">\r\n @if (!context.state.actions.batchActions.isVisible) {\r\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\r\n }\r\n </th>\r\n }\r\n @if (context.state.rowExpansion.isEnabled) {\r\n <th [ngStyle]=\"context.state.rowExpansion.ngStyle\"></th>\r\n }\r\n @for (col of columns; track col.field) {\r\n @if (context.state.viewport.resizableColumns) {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n } @else {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n }\r\n <ng-template #headerContent>\r\n <div class=\"flex justify-start items-center\">\r\n <span class=\"mr-1\">{{ col.header }}</span>\r\n @if (col.showHeaderActions) {\r\n <smz-table-header-actions clickStopPropagation class=\"ml-1 mt-1\" [col]=\"col\"></smz-table-header-actions>\r\n }\r\n @if (!clonedData.showSkeleton && col.isOrderable) {\r\n <p-sortIcon [field]=\"col.sortField\"></p-sortIcon>\r\n }\r\n @if (!clonedData.showSkeleton) {\r\n @switch (col.filter.type) {\r\n @case (filterTypes.currency) {\r\n <smz-column-filter type=\"numeric\" currency=\"BRL\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.numeric) {\r\n <smz-column-filter type=\"numeric\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.date) {\r\n <smz-column-filter type=\"date\" [field]=\"col.filterField\" [showTime]=\"col.filter.showTime\"></smz-column-filter>\r\n }\r\n @case (filterTypes.text) {\r\n <smz-column-filter type=\"text\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.boolean) {\r\n <smz-column-filter type=\"boolean\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.dropdown) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField + '.id'\" matchMode=\"dropdown\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-select appendTo=\"body\" [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-select>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"in\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_array) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"array-some\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : true\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_string) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"multiselectByString\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField : filterField : null : true : false : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n }\r\n }\r\n @if (context.state.caption.columnVisibility.showColumnHideButton) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-eye-slash\" class=\"p-button-rounded p-button-text p-button-plain\" (click)=\"hideColumn(col, context)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible|| context.state.editable.isEditable) {\r\n <th [ngStyle]=\"context.state.editable.isEditable ? context.state.editable.ngStyle : context.state.actions.customActions.ngStyle\"></th>\r\n }\r\n </tr>\r\n @if (context.state.actions.batchActions.isVisible) {\r\n <tr>\r\n <th [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\"\r\n [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <p-tableHeaderCheckbox class=\"mr-4\"></p-tableHeaderCheckbox>\r\n @if (selectedItems?.length > 0) {\r\n @for (batchItem of context.state.actions.batchActions.items; track batchItem.label) {\r\n @if (batchItem.visible) {\r\n <button pButton [label]=\"batchItem.label\" class=\"p-button-rounded p-button-text p-button-plain animate__animated animate__fadeIn\" [ngClass]=\"batchItem.styleClass\" [icon]=\"batchItem.icon\" (click)=\"batchItem.command(selectedItems); selectedItems = [];\" [disabled]=\"batchItem.disabled\" [pTooltip]=\"batchItem.tooltip\"></button>\r\n }\r\n }\r\n }\r\n </div>\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-item let-editing=\"editing\" let-rowIndex=\"rowIndex\" let-columns=\"columns\">\r\n <tr #editableRowElement\r\n [pEditableRow]=\"item\"\r\n tableItemAction\r\n [isClickable]=\"context.state.actions.rowBehavior.isClickable\"\r\n [callback]=\"context.state.actions.rowBehavior.clickCallback\"\r\n [expandRowOnClick]=\"context.state.actions.rowBehavior.expandRowOnClick\"\r\n [item]=\"item\"\r\n class=\"p-selectable-row\"\r\n [ngClass]=\"{ 'highlight-row': item?.id === state.actions.rowBehavior.highlights, 'preserve-in-small': state.actions.rowBehavior.preserveLayoutInSmallDevices }\"\r\n >\r\n @if (context.state.caption.rowSelection.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\"\r\n [ngStyle]=\"context.state.caption.rowSelection.ngStyle\"\r\n >\r\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\r\n </td>\r\n }\r\n @if (context.state.rowExpansion.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading, 'grid grid-nogutter justify-start items-center gap-2': context.state.rowExpansion.highlightNewItems && item._isNew }\"\r\n [ngStyle]=\"context.state.rowExpansion.ngStyle\"\r\n >\r\n <p-toggleButton [(ngModel)]=\"item._isExpanded\" [onIcon]=\"'fa-solid fa-chevron-down'\" [offIcon]=\"'fa-solid fa-chevron-right'\" (onChange)=\"item._isNew = false\"></p-toggleButton>\r\n @if (context.state.rowExpansion.highlightNewItems && item._isNew) {\r\n <div class=\"rounded bg-cyan-400 text-sm text-white px-2 py-0 smz-table-new-tag\" (click)=\"item._isNew = false\">{{ context.state.rowExpansion.highlightLabel }}</div>\r\n }\r\n </td>\r\n }\r\n @for (col of columns; track col.field) {\r\n @if (clonedData.showSkeleton) {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngStyle]=\"col.content.ngStyle\"><p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton></td>\r\n } @else {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\" [ngStyle]=\"col.content.ngStyle\">\r\n <span class=\"p-column-title\">{{ col.header }}</span>\r\n <p-cellEditor>\r\n <!-- CELULAR COM EDITOR -->\r\n <ng-template pTemplate=\"input\">\r\n @switch (col.editable.type) {\r\n @case (editableTypes.none) {\r\n <smz-table-content class=\"cursor-default\" [ngClass]=\"col.content.contentStyleClass\" [col]=\"col\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\"></smz-table-content>\r\n }\r\n @case (editableTypes.custom) {\r\n <ng-container *ngTemplateOutlet=\"editableTemplate; context: { $implicit: item, col: col }\"></ng-container>\r\n }\r\n <!-- INPUT TEXT -->\r\n @case (editableTypes.text) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <input pInputText type=\"text\" [formControl]=\"$any(control)\" style=\"width: 100%;\">\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT NUMBER -->\r\n @case (editableTypes.number) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-inputNumber\r\n *ngVar=\"col.editable.data as numberData\"\r\n [formControl]=\"$any(control)\"\r\n [mode]=\"numberData.mode\"\r\n [minFractionDigits]=\"numberData.minFractionDigits\"\r\n [maxFractionDigits]=\"numberData.maxFractionDigits\"\r\n [currency]=\"numberData.currency\"\r\n [useGrouping]=\"numberData.useGrouping\"\r\n [allowEmpty]=\"numberData.allowEmpty\"\r\n [showClear]=\"numberData.showClear\"\r\n [showButtons]=\"numberData.showButtons\"\r\n [prefix]=\"numberData.prefix\"\r\n [suffix]=\"numberData.suffix\">\r\n </p-inputNumber>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT SWITCH -->\r\n @case (editableTypes.switch) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-toggleswitch [formControl]=\"$any(control)\"></p-toggleswitch>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT TEXT AREA -->\r\n @case (editableTypes.area) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <textarea pInputTextarea type=\"text\" [formControl]=\"$any(control)\" [rows]=\"$any(col.editable.data).rows\" required style=\"width: 100%;\"></textarea>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT DROPDOWN -->\r\n @case (editableTypes.dropdown) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-select appendTo=\"body\" [formControl]=\"$any(control)\" styleClass=\"w-full\" [options]=\"col.editable.data | editableSource\" optionLabel=\"name\" dataKey=\"id\" [placeholder]=\"$any(col.editable.data).placeholder\" [showClear]=\"!col.editable.validatorsPreset?.isRequired\" [filter]=\"true\"></p-select>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT CALENDAR -->\r\n @case (editableTypes.calendar) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-datepicker [formControl]=\"$any(control)\" appendTo=\"body\" styleClass=\"w-full\" [ngClass]=\"{ 'pl-5': !control.valid }\"></p-datepicker>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n </ng-template>\r\n <!-- CELULAR COM CONTE\u00DADO -->\r\n <ng-template pTemplate=\"output\">\r\n <smz-table-content\r\n [col]=\"col\"\r\n [pTooltip]=\"col.content.tooltip != null ? col.content.tooltip(item) : null\"\r\n tooltipPosition=\"left\"\r\n [ngClass]=\"col.content.contentStyleClass\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\">\r\n </smz-table-content>\r\n </ng-template>\r\n </p-cellEditor>\r\n </td>\r\n }\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) {\r\n <td [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-center\">\r\n @if (clonedData.showSkeleton) {\r\n <div class=\"w-full\">\r\n <p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton>\r\n </div>\r\n } @else {\r\n <!-- SEM EDITAR -->\r\n @if (!editing) {\r\n @if (context.state.editable.update.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-pencil\" (click)=\"editableService.onRowEditInit(item)\" class=\"p-button-rounded p-button-text mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.update.isButtonDisabled || (!context.state.editable.update.condition(item))\" pInitEditableRow></button>\r\n }\r\n @if (context.state.editable.remove.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-trash\" (click)=\"editableService.onRowRemove($event, table, item)\" class=\"p-button-rounded p-button-text p-button-secondary mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.remove.isButtonDisabled || (!context.state.editable.remove.condition(item))\"></button>\r\n }\r\n }\r\n <!-- EDITANDO -->\r\n @if (editing) {\r\n @if (editableService.context[item.id]; as editableContext) {\r\n <!-- COM LOADING -->\r\n @if (editableContext.isLoading) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-rotate fa-spin\" [disabled]=\"true\" class=\"p-button-rounded p-button-text p-button-info mr-2\"></button>\r\n }\r\n <!-- SEM LOADING -->\r\n @if (!editableContext.isLoading) {\r\n <!-- EDITANDO -->\r\n @if (!editableContext.hasErrors) {\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowCreateSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowEditSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n <!-- COM ERRORS -->\r\n @if (editableContext.hasErrors) {\r\n <p-popover #errorsOverlay appendTo=\"body\" [style]=\"{ width: '450px' }\">\r\n <div [innerHtml]=\"editableContext.errors | contentErrors\"></div>\r\n </p-popover>\r\n <button pButton type=\"button\" icon=\"fas fa-exclamation-triangle\" [disabled]=\"false\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger mr-2\" (click)=\"errorsOverlay.toggle($event)\"></button>\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n }\r\n }\r\n }\r\n <!-- CUSTOM MENU -->\r\n @if (context.state.actions.customActions.isVisible && !editing) {\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: item }\"></ng-container>\r\n }\r\n <!-- MENU -->\r\n @if (context.state.actions.menu.isVisible && !editing) {\r\n <smz-menu [callback]=\"context.state.actions.menu.callback\" [items]=\"context.state.actions.menu.items\" [data]=\"item\" [behavior]=\"context.state.actions.menu.behavior\" [ngClass]=\"{ 'ml-2': context.state.actions.customActions.isVisible }\" [icon]=\"context.state.actions.menu.styles.icon\" [styleClass]=\"context.state.actions.menu.styles.styleClass\" [buttonClass]=\"context.state.actions.menu.styles.buttonClass\"></smz-menu>\r\n }\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (item?._isExpanded) {\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\">\r\n <ng-container *ngTemplateOutlet=\"rowContentTemplate; context: { $implicit: item }\"></ng-container>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" let-columns>\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\" [ngStyle]=\"{ 'text-align': 'center' }\">\r\n <div [innerHtml]=\"context.state.emptyFeedback.message\"></div>\r\n @if (context.state.caption.clearFilters.isButtonVisible && hasFilters()) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined mt-3\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\"></button>\r\n }\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n }\r\n </ng-container>\r\n </ng-container>\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$7.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i8.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i8.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "component", type: i8.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i8.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i8.TableCheckbox, selector: "p-tableCheckbox", inputs: ["value", "disabled", "required", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i8.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i8.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i8.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i2.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i3$5.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i4$1.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i1$2.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TableItemActionsDirective, selector: "[tableItemAction]", inputs: ["isClickable", "item", "callback", "expandRowOnClick"] }, { kind: "directive", type: ClickStopPropagationDirective, selector: "[clickStopPropagation]" }, { kind: "component", type: SmzDataInfoComponent, selector: "smz-data-info", inputs: ["image", "message", "actions", "callbackInfo", "callbackLabel"], outputs: ["clicked"] }, { kind: "directive", type: i1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i19.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: i2$4.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["pTextareaPT", "pTextareaUnstyled", "autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "component", type: i3.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2$3.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "component", type: i3$3.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: SmzMenuComponent, selector: "smz-menu", inputs: ["items", "callback", "data", "buttonClass", "styleClass", "icon", "behavior"] }, { kind: "component", type: i25.ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "directive", type: NgVar, selector: "[ngVar]", inputs: ["ngVar"] }, { kind: "component", type: i27.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i28.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "component", type: SmzColumnFilterComponent, selector: "smz-column-filter", inputs: ["currency", "display", "field", "matchMode", "showAddButton", "showMatchModes", "showOperator", "type", "showTime"] }, { kind: "component", type: SmzTableValidationMessagesComponent, selector: "smz-table-validation-messages", inputs: ["errors", "messages", "isFormInvalid", "isFormDirty"] }, { kind: "component", type: SmzTableContentComponent, selector: "smz-table-content", inputs: ["col", "contentTypes", "item", "rowIndex", "contentTemplate"] }, { kind: "component", type: SmzTableCaptionButtonsComponent, selector: "smz-table-caption-buttons", inputs: ["buttons"] }, { kind: "component", type: SmzTableHeaderActionsComponent, selector: "smz-table-header-actions", inputs: ["col"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: UniqueFilterPipe, name: "uniqueFilter" }, { kind: "pipe", type: SmzTableContextPipe, name: "tableContext" }, { kind: "pipe", type: SmzFilterObjectPipe, name: "filterObject" }, { kind: "pipe", type: SmzCloneTableItemsPipe, name: "cloneTableItems" }, { kind: "pipe", type: SmzEditableSourcePipe, name: "editableSource" }, { kind: "pipe", type: SmzContentErrorsPipe, name: "contentErrors" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
17260
17372
|
}
|
|
17261
17373
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: SmzTableComponent, decorators: [{
|
|
17262
17374
|
type: Component,
|
|
17263
|
-
args: [{ selector: 'smz-ui-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableEditableService, TableFormsService], standalone: false, template: "@if (state | tableContext; as context) {\r\n @if ((context.state.emptyFeedback != null && (context.state.emptyFeedback.extraInfo || context.state.emptyFeedback.image || context.state.emptyFeedback.actionButtons)) && (items != null && items.length === 0) && context.state.emptyFeedback.isFeatured) {\r\n <smz-data-info\r\n [image]=\"context.state.emptyFeedback.image\"\r\n [message]=\"context.state.emptyFeedback.message\"\r\n [callbackInfo]=\"context.state.emptyFeedback.extraInfo\"\r\n [actions]=\"context.state.emptyFeedback.actionButtons\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n <ng-container *ngVar=\"state.source?.items$ != null ? (state.source.items$ | async) : null as observableSource\">\r\n <ng-container *ngVar=\"state.source?.signalItems != null ? state.source.signalItems() : null as signalSource\">\r\n @if (((observableSource ?? signalSource ?? items) | cloneTableItems : context: tableKey: context.state.rowExpansion.sincronize); as clonedData) {\r\n <p-table #dt\r\n dataKey=\"id\"\r\n editMode=\"row\"\r\n [stripedRows]=\"context.state.styles.striped\"\r\n [value]=\"clonedData.items\"\r\n [(selection)]=\"selectedItems\"\r\n [tableStyleClass]=\"context.state.styles.tableStyleClass\"\r\n [styleClass]=\"'p-datatable-smz-ui-table' + (context.state.styles.showGrid ? ' p-datatable-gridlines' : '') + (context.state.styles.size === 'extra-small' ? ' p-datatable-xs' : '') + (context.state.styles.size === 'small' ? ' p-datatable-sm' : '') + (context.state.styles.size === 'large' ? ' p-datatable-lg' : '')\"\r\n [rowHover]=\"context.state.actions.rowBehavior.hoverable\"\r\n [rows]=\"context.state.pagination.rows\"\r\n [showCurrentPageReport]=\"context.state.pagination.pageReport.isVisible\"\r\n [rowsPerPageOptions]=\"context.state.pagination.rowsPerPageOptions\"\r\n [loading]=\"loading\"\r\n [paginator]=\"context.state.pagination.isVisible\"\r\n paginatorDropdownAppendTo=\"body\"\r\n [currentPageReportTemplate]=\"context.state.locale.paginator.template\"\r\n [sortField]=\"context.state.sort.field\"\r\n [sortMode]=\"context.state.sort.mode\"\r\n [sortOrder]=\"context.state.sort.order\"\r\n [multiSortMeta]=\"context.state.sort.multiSortMeta\"\r\n [scrollable]=\"context.state.viewport.scrollable\"\r\n [scrollHeight]=\"context.state.viewport.scrollHeight\"\r\n [filterDelay]=\"0\"\r\n [globalFilterFields]=\"context.globalFilter\"\r\n [columns]=\"context.visibleColumns\"\r\n [frozenColumns]=\"context.frozenColumns\"\r\n [frozenWidth]=\"context.state.frozen.isEnabled ? context.state.frozen.width : null\"\r\n [resizableColumns]=\"context.state.viewport.resizableColumns\"\r\n [columnResizeMode]=\"context.state.viewport.columnResizeMode\"\r\n (onPage)=\"onPage($event)\"\r\n (onFilter)=\"onFilter($event)\"\r\n (selectionChange)=\"emitSelection($event)\"\r\n >\r\n @if (context.state.caption.isVisible) {\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"grid grid-nogutter items-center gap-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n @if (context.state.caption.title != null) {\r\n <div class=\"col database-title\" [innerHTML]=\"context.state.caption.title\"></div>\r\n }\r\n <ng-container *ngTemplateOutlet=\"captionTemplate; context: { $implicit: dt }\"></ng-container>\r\n <smz-table-caption-buttons [buttons]=\"context.state.caption.buttons\"></smz-table-caption-buttons>\r\n @if (context.state.caption.exportToPdf.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToPdf.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-pdf\" (click)=\"exportToPdf(context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.exportToExcel.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToExcel.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-excel\" (click)=\"exportToExcel(table, context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.editable.creation.isButtonVisible) {\r\n <button pButton [label]=\"context.state.editable.creation.buttonLabel\" class=\"p-button-outlined\" icon=\"fa-solid fa-plus\" (click)=\"editableService.onRowCreateInit(table, context.columns)\" [disabled]=\"clonedData.showSkeleton || editableService.isEditing || editableService.isCreating || context.state.editable.creation.isButtonDisabled\"></button>\r\n }\r\n @if (context.state.caption.rowSelection.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.rowSelection.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-check-double\" (click)=\"onRowSelection(context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.clearFilters.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.columnVisibility.showDropdownSelector) {\r\n <p-multiSelect\r\n #columnMultiselect\r\n class=\"ml-2 col-12 md:col-2\"\r\n styleClass=\"w-full\"\r\n [options]=\"context.hideableColumns\"\r\n [(ngModel)]=\"selectedColumns\"\r\n [placeholder]=\"context.state.locale.columnVisibility.placeholder\"\r\n [selectedItemsLabel]=\"context.state.locale.columnVisibility.selectedItemsLabel\"\r\n optionLabel=\"name\"\r\n dataKey=\"field\"\r\n optionLabel=\"header\"\r\n [filter]=\"true\"\r\n (onPanelHide)=\"updateColumnsVisibility(true)\"\r\n [pTooltip]=\"context.state.locale.columnVisibility.pTooltip\">\r\n </p-multiSelect>\r\n }\r\n @if (context.state.caption.globalFilter.isVisible) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"{ 'md:col-2': !context.state.caption.globalFilter.expanded }\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal [(ngModel)]=\"globalSearchInput\" pInputText type=\"text\" styleClass=\"database-global-search\" (input)=\"updateGlobalFilter(inputGlobal.value)\" [disabled]=\"clonedData.showSkeleton\" [placeholder]=\"context.state.locale.globalFilter.placeholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </ng-template>\r\n }\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr [ngClass]=\"{ 'invisible-header': !context.state.header.isVisible }\">\r\n @if (context.state.caption.rowSelection.isEnabled) {\r\n <th [ngStyle]=\"context.state.caption.rowSelection.ngStyle\">\r\n @if (!context.state.actions.batchActions.isVisible) {\r\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\r\n }\r\n </th>\r\n }\r\n @if (context.state.rowExpansion.isEnabled) {\r\n <th [ngStyle]=\"context.state.rowExpansion.ngStyle\"></th>\r\n }\r\n @for (col of columns; track col) {\r\n @if (context.state.viewport.resizableColumns) {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n } @else {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n }\r\n <ng-template #headerContent>\r\n <div class=\"flex justify-start items-center\">\r\n <span class=\"mr-1\">{{ col.header }}</span>\r\n @if (col.showHeaderActions) {\r\n <smz-table-header-actions clickStopPropagation class=\"ml-1 mt-1\" [col]=\"col\"></smz-table-header-actions>\r\n }\r\n @if (!clonedData.showSkeleton && col.isOrderable) {\r\n <p-sortIcon [field]=\"col.sortField\"></p-sortIcon>\r\n }\r\n @if (!clonedData.showSkeleton) {\r\n @switch (col.filter.type) {\r\n @case (filterTypes.currency) {\r\n <smz-column-filter type=\"numeric\" currency=\"BRL\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.numeric) {\r\n <smz-column-filter type=\"numeric\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.date) {\r\n <smz-column-filter type=\"date\" [field]=\"col.filterField\" [showTime]=\"col.filter.showTime\"></smz-column-filter>\r\n }\r\n @case (filterTypes.text) {\r\n <smz-column-filter type=\"text\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.boolean) {\r\n <smz-column-filter type=\"boolean\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.dropdown) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField + '.id'\" matchMode=\"dropdown\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-select appendTo=\"body\" [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-select>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"in\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_array) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"array-some\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : true\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_string) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"multiselectByString\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField : filterField : null : true : false : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n }\r\n }\r\n @if (context.state.caption.columnVisibility.showColumnHideButton) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-eye-slash\" class=\"p-button-rounded p-button-text p-button-plain\" (click)=\"hideColumn(col, context)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible|| context.state.editable.isEditable) {\r\n <th [ngStyle]=\"context.state.editable.isEditable ? context.state.editable.ngStyle : context.state.actions.customActions.ngStyle\"></th>\r\n }\r\n </tr>\r\n @if (context.state.actions.batchActions.isVisible) {\r\n <tr>\r\n <th [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\"\r\n [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <p-tableHeaderCheckbox class=\"mr-4\"></p-tableHeaderCheckbox>\r\n @if (selectedItems?.length > 0) {\r\n @for (batchItem of context.state.actions.batchActions.items; track batchItem) {\r\n @if (batchItem.visible) {\r\n <button pButton [label]=\"batchItem.label\" class=\"p-button-rounded p-button-text p-button-plain animate__animated animate__fadeIn\" [ngClass]=\"batchItem.styleClass\" [icon]=\"batchItem.icon\" (click)=\"batchItem.command(selectedItems); selectedItems = [];\" [disabled]=\"batchItem.disabled\" [pTooltip]=\"batchItem.tooltip\"></button>\r\n }\r\n }\r\n }\r\n </div>\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-item let-editing=\"editing\" let-rowIndex=\"rowIndex\" let-columns=\"columns\">\r\n <tr #editableRowElement\r\n [pEditableRow]=\"item\"\r\n tableItemAction\r\n [isClickable]=\"context.state.actions.rowBehavior.isClickable\"\r\n [callback]=\"context.state.actions.rowBehavior.clickCallback\"\r\n [expandRowOnClick]=\"context.state.actions.rowBehavior.expandRowOnClick\"\r\n [item]=\"item\"\r\n class=\"p-selectable-row\"\r\n [ngClass]=\"{ 'highlight-row': item?.id === state.actions.rowBehavior.highlights, 'preserve-in-small': state.actions.rowBehavior.preserveLayoutInSmallDevices }\"\r\n >\r\n @if (context.state.caption.rowSelection.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\"\r\n [ngStyle]=\"context.state.caption.rowSelection.ngStyle\"\r\n >\r\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\r\n </td>\r\n }\r\n @if (context.state.rowExpansion.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading, 'grid grid-nogutter justify-start items-center gap-2': context.state.rowExpansion.highlightNewItems && item._isNew }\"\r\n [ngStyle]=\"context.state.rowExpansion.ngStyle\"\r\n >\r\n <p-toggleButton [(ngModel)]=\"item._isExpanded\" [onIcon]=\"'fa-solid fa-chevron-down'\" [offIcon]=\"'fa-solid fa-chevron-right'\" (onChange)=\"item._isNew = false\"></p-toggleButton>\r\n @if (context.state.rowExpansion.highlightNewItems && item._isNew) {\r\n <div class=\"rounded bg-cyan-400 text-sm text-white px-2 py-0 smz-table-new-tag\" (click)=\"item._isNew = false\">{{ context.state.rowExpansion.highlightLabel }}</div>\r\n }\r\n </td>\r\n }\r\n @for (col of columns; track col) {\r\n @if (clonedData.showSkeleton) {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngStyle]=\"col.content.ngStyle\"><p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton></td>\r\n } @else {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\" [ngStyle]=\"col.content.ngStyle\">\r\n <span class=\"p-column-title\">{{ col.header }}</span>\r\n <p-cellEditor>\r\n <!-- CELULAR COM EDITOR -->\r\n <ng-template pTemplate=\"input\">\r\n @switch (col.editable.type) {\r\n @case (editableTypes.none) {\r\n <smz-table-content class=\"cursor-default\" [ngClass]=\"col.content.contentStyleClass\" [col]=\"col\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\"></smz-table-content>\r\n }\r\n @case (editableTypes.custom) {\r\n <ng-container *ngTemplateOutlet=\"editableTemplate; context: { $implicit: item, col: col }\"></ng-container>\r\n }\r\n <!-- INPUT TEXT -->\r\n @case (editableTypes.text) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <input pInputText type=\"text\" [formControl]=\"$any(control)\" style=\"width: 100%;\">\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT NUMBER -->\r\n @case (editableTypes.number) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-inputNumber\r\n *ngVar=\"col.editable.data as numberData\"\r\n [formControl]=\"$any(control)\"\r\n [mode]=\"numberData.mode\"\r\n [minFractionDigits]=\"numberData.minFractionDigits\"\r\n [maxFractionDigits]=\"numberData.maxFractionDigits\"\r\n [currency]=\"numberData.currency\"\r\n [useGrouping]=\"numberData.useGrouping\"\r\n [allowEmpty]=\"numberData.allowEmpty\"\r\n [showClear]=\"numberData.showClear\"\r\n [showButtons]=\"numberData.showButtons\"\r\n [prefix]=\"numberData.prefix\"\r\n [suffix]=\"numberData.suffix\">\r\n </p-inputNumber>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT SWITCH -->\r\n @case (editableTypes.switch) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-toggleswitch [formControl]=\"$any(control)\"></p-toggleswitch>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT TEXT AREA -->\r\n @case (editableTypes.area) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <textarea pInputTextarea type=\"text\" [formControl]=\"$any(control)\" [rows]=\"$any(col.editable.data).rows\" required style=\"width: 100%;\"></textarea>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT DROPDOWN -->\r\n @case (editableTypes.dropdown) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-select appendTo=\"body\" [formControl]=\"$any(control)\" styleClass=\"w-full\" [options]=\"col.editable.data | editableSource\" optionLabel=\"name\" dataKey=\"id\" [placeholder]=\"$any(col.editable.data).placeholder\" [showClear]=\"!col.editable.validatorsPreset?.isRequired\" [filter]=\"true\"></p-select>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT CALENDAR -->\r\n @case (editableTypes.calendar) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-datepicker [formControl]=\"$any(control)\" appendTo=\"body\" styleClass=\"w-full\" [ngClass]=\"{ 'pl-5': !control.valid }\"></p-datepicker>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n </ng-template>\r\n <!-- CELULAR COM CONTE\u00DADO -->\r\n <ng-template pTemplate=\"output\">\r\n <smz-table-content\r\n [col]=\"col\"\r\n [pTooltip]=\"col.content.tooltip != null ? col.content.tooltip(item) : null\"\r\n tooltipPosition=\"left\"\r\n [ngClass]=\"col.content.contentStyleClass\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\">\r\n </smz-table-content>\r\n </ng-template>\r\n </p-cellEditor>\r\n </td>\r\n }\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) {\r\n <td [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-center\">\r\n @if (clonedData.showSkeleton) {\r\n <div class=\"w-full\">\r\n <p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton>\r\n </div>\r\n } @else {\r\n <!-- SEM EDITAR -->\r\n @if (!editing) {\r\n @if (context.state.editable.update.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-pencil\" (click)=\"editableService.onRowEditInit(item)\" class=\"p-button-rounded p-button-text mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.update.isButtonDisabled || (!context.state.editable.update.condition(item))\" pInitEditableRow></button>\r\n }\r\n @if (context.state.editable.remove.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-trash\" (click)=\"editableService.onRowRemove($event, table, item)\" class=\"p-button-rounded p-button-text p-button-secondary mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.remove.isButtonDisabled || (!context.state.editable.remove.condition(item))\"></button>\r\n }\r\n }\r\n <!-- EDITANDO -->\r\n @if (editing) {\r\n @if (editableService.context[item.id]; as editableContext) {\r\n <!-- COM LOADING -->\r\n @if (editableContext.isLoading) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-rotate fa-spin\" [disabled]=\"true\" class=\"p-button-rounded p-button-text p-button-info mr-2\"></button>\r\n }\r\n <!-- SEM LOADING -->\r\n @if (!editableContext.isLoading) {\r\n <!-- EDITANDO -->\r\n @if (!editableContext.hasErrors) {\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowCreateSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowEditSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n <!-- COM ERRORS -->\r\n @if (editableContext.hasErrors) {\r\n <p-popover #errorsOverlay appendTo=\"body\" [style]=\"{ width: '450px' }\">\r\n <div [innerHtml]=\"editableContext.errors | contentErrors\"></div>\r\n </p-popover>\r\n <button pButton type=\"button\" icon=\"fas fa-exclamation-triangle\" [disabled]=\"false\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger mr-2\" (click)=\"errorsOverlay.toggle($event)\"></button>\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n }\r\n }\r\n }\r\n <!-- CUSTOM MENU -->\r\n @if (context.state.actions.customActions.isVisible && !editing) {\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: item }\"></ng-container>\r\n }\r\n <!-- MENU -->\r\n @if (context.state.actions.menu.isVisible && !editing) {\r\n <smz-menu [callback]=\"context.state.actions.menu.callback\" [items]=\"context.state.actions.menu.items\" [data]=\"item\" [behavior]=\"context.state.actions.menu.behavior\" [ngClass]=\"{ 'ml-2': context.state.actions.customActions.isVisible }\" [icon]=\"context.state.actions.menu.styles.icon\" [styleClass]=\"context.state.actions.menu.styles.styleClass\" [buttonClass]=\"context.state.actions.menu.styles.buttonClass\"></smz-menu>\r\n }\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (item?._isExpanded) {\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\">\r\n <ng-container *ngTemplateOutlet=\"rowContentTemplate; context: { $implicit: item }\"></ng-container>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" let-columns>\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\" [ngStyle]=\"{ 'text-align': 'center' }\">\r\n <div [innerHtml]=\"context.state.emptyFeedback.message\"></div>\r\n @if (context.state.caption.clearFilters.isButtonVisible && hasFilters()) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined mt-3\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\"></button>\r\n }\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n }\r\n </ng-container>\r\n </ng-container>\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n" }]
|
|
17375
|
+
args: [{ selector: 'smz-ui-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableEditableService, TableFormsService], standalone: false, template: "@if (state | tableContext; as context) {\r\n @if ((context.state.emptyFeedback != null && (context.state.emptyFeedback.extraInfo || context.state.emptyFeedback.image || context.state.emptyFeedback.actionButtons)) && (items != null && items.length === 0) && context.state.emptyFeedback.isFeatured) {\r\n <smz-data-info\r\n [image]=\"context.state.emptyFeedback.image\"\r\n [message]=\"context.state.emptyFeedback.message\"\r\n [callbackInfo]=\"context.state.emptyFeedback.extraInfo\"\r\n [actions]=\"context.state.emptyFeedback.actionButtons\">\r\n <ng-template pTemplate=\"actions\">\r\n <ng-container *ngTemplateOutlet=\"emptyActionsTemplate; context: { $implicit: {} }\"></ng-container>\r\n </ng-template>\r\n </smz-data-info>\r\n } @else {\r\n <ng-container *ngVar=\"state.source?.items$ != null ? (state.source.items$ | async) : null as observableSource\">\r\n <ng-container *ngVar=\"state.source?.signalItems != null ? state.source.signalItems() : null as signalSource\">\r\n @if (((observableSource ?? signalSource ?? items) | cloneTableItems : context: tableKey: context.state.rowExpansion.sincronize); as clonedData) {\r\n <p-table #dt\r\n dataKey=\"id\"\r\n editMode=\"row\"\r\n [stripedRows]=\"context.state.styles.striped\"\r\n [value]=\"clonedData.items\"\r\n [(selection)]=\"selectedItems\"\r\n [tableStyleClass]=\"context.state.styles.tableStyleClass\"\r\n [styleClass]=\"'p-datatable-smz-ui-table' + (context.state.styles.showGrid ? ' p-datatable-gridlines' : '') + (context.state.styles.size === 'extra-small' ? ' p-datatable-xs' : '') + (context.state.styles.size === 'small' ? ' p-datatable-sm' : '') + (context.state.styles.size === 'large' ? ' p-datatable-lg' : '')\"\r\n [rowHover]=\"context.state.actions.rowBehavior.hoverable\"\r\n [rows]=\"context.state.pagination.rows\"\r\n [first]=\"context.state.pagination.state.first\"\r\n [showCurrentPageReport]=\"context.state.pagination.pageReport.isVisible\"\r\n [rowsPerPageOptions]=\"context.state.pagination.rowsPerPageOptions\"\r\n [loading]=\"loading || isViewportInitializing\"\r\n [style.visibility]=\"isViewportInitializing ? 'hidden' : null\"\r\n [paginator]=\"context.state.pagination.isVisible\"\r\n paginatorDropdownAppendTo=\"body\"\r\n [currentPageReportTemplate]=\"context.state.locale.paginator.template\"\r\n [sortField]=\"context.state.sort.field\"\r\n [sortMode]=\"context.state.sort.mode\"\r\n [sortOrder]=\"context.state.sort.order\"\r\n [multiSortMeta]=\"context.state.sort.multiSortMeta\"\r\n [scrollable]=\"context.state.viewport.scrollable\"\r\n [scrollHeight]=\"context.state.viewport.scrollHeight\"\r\n [filterDelay]=\"0\"\r\n [globalFilterFields]=\"context.globalFilter\"\r\n [columns]=\"context.visibleColumns\"\r\n [frozenColumns]=\"context.frozenColumns\"\r\n [frozenWidth]=\"context.state.frozen.isEnabled ? context.state.frozen.width : null\"\r\n [resizableColumns]=\"context.state.viewport.resizableColumns\"\r\n [columnResizeMode]=\"context.state.viewport.columnResizeMode\"\r\n (onPage)=\"onPage($event)\"\r\n (onFilter)=\"onFilter($event)\"\r\n (selectionChange)=\"emitSelection($event)\"\r\n >\r\n @if (context.state.caption.isVisible) {\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"grid grid-nogutter items-center gap-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n @if (context.state.caption.title != null) {\r\n <div class=\"col database-title\" [innerHTML]=\"context.state.caption.title\"></div>\r\n }\r\n <ng-container *ngTemplateOutlet=\"captionTemplate; context: { $implicit: dt }\"></ng-container>\r\n <smz-table-caption-buttons [buttons]=\"context.state.caption.buttons\"></smz-table-caption-buttons>\r\n @if (context.state.caption.exportToPdf.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToPdf.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-pdf\" (click)=\"exportToPdf(context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.exportToExcel.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.exportToExcel.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-file-excel\" (click)=\"exportToExcel(table, context, clonedData.items)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.editable.creation.isButtonVisible) {\r\n <button pButton [label]=\"context.state.editable.creation.buttonLabel\" class=\"p-button-outlined\" icon=\"fa-solid fa-plus\" (click)=\"editableService.onRowCreateInit(table, context.columns)\" [disabled]=\"clonedData.showSkeleton || editableService.isEditing || editableService.isCreating || context.state.editable.creation.isButtonDisabled\"></button>\r\n }\r\n @if (context.state.caption.rowSelection.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.rowSelection.label\" class=\"p-button-outlined\" icon=\"fa-solid fa-check-double\" (click)=\"onRowSelection(context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.clearFilters.isButtonVisible) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\" [disabled]=\"clonedData.showSkeleton\"></button>\r\n }\r\n @if (context.state.caption.columnVisibility.showDropdownSelector) {\r\n <p-multiSelect\r\n #columnMultiselect\r\n class=\"ml-2 col-12 md:col-2\"\r\n styleClass=\"w-full\"\r\n [options]=\"context.hideableColumns\"\r\n [(ngModel)]=\"selectedColumns\"\r\n [placeholder]=\"context.state.locale.columnVisibility.placeholder\"\r\n [selectedItemsLabel]=\"context.state.locale.columnVisibility.selectedItemsLabel\"\r\n optionLabel=\"name\"\r\n dataKey=\"field\"\r\n optionLabel=\"header\"\r\n [filter]=\"true\"\r\n (onPanelHide)=\"updateColumnsVisibility(true)\"\r\n [pTooltip]=\"context.state.locale.columnVisibility.pTooltip\">\r\n </p-multiSelect>\r\n }\r\n @if (context.state.caption.globalFilter.isVisible) {\r\n <p-iconfield class=\"col-12\" [ngClass]=\"{ 'md:col-2': !context.state.caption.globalFilter.expanded }\">\r\n <p-inputicon styleClass=\"pi pi-search\" />\r\n <input #inputGlobal [(ngModel)]=\"globalSearchInput\" pInputText type=\"text\" styleClass=\"database-global-search\" (input)=\"updateGlobalFilter(inputGlobal.value)\" [disabled]=\"clonedData.showSkeleton\" [placeholder]=\"context.state.locale.globalFilter.placeholder\" />\r\n </p-iconfield>\r\n }\r\n </div>\r\n @if (toolbarTemplate != null) {\r\n <div class=\"grid grid-nogutter items-center mt-2\" [ngClass]=\"'justify-' + context.state.caption.toolbarAlignment\">\r\n <ng-container *ngTemplateOutlet=\"toolbarTemplate; context: { $implicit: dt }\"></ng-container>\r\n </div>\r\n }\r\n </ng-template>\r\n }\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr [ngClass]=\"{ 'invisible-header': !context.state.header.isVisible }\">\r\n @if (context.state.caption.rowSelection.isEnabled) {\r\n <th [ngStyle]=\"context.state.caption.rowSelection.ngStyle\">\r\n @if (!context.state.actions.batchActions.isVisible) {\r\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\r\n }\r\n </th>\r\n }\r\n @if (context.state.rowExpansion.isEnabled) {\r\n <th [ngStyle]=\"context.state.rowExpansion.ngStyle\"></th>\r\n }\r\n @for (col of columns; track col.field) {\r\n @if (context.state.viewport.resizableColumns) {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th pResizableColumn [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n } @else {\r\n @if (col.isOrderable) {\r\n <th [pSortableColumn]=\"col.sortField\" [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n @if (!col.isOrderable) {\r\n <th [ngStyle]=\"col.content.ngStyle\" [ngClass]=\"col.headerStyleClass\">\r\n <ng-container *ngTemplateOutlet=\"headerContent\"></ng-container>\r\n </th>\r\n }\r\n }\r\n <ng-template #headerContent>\r\n <div class=\"flex justify-start items-center\">\r\n <span class=\"mr-1\">{{ col.header }}</span>\r\n @if (col.showHeaderActions) {\r\n <smz-table-header-actions clickStopPropagation class=\"ml-1 mt-1\" [col]=\"col\"></smz-table-header-actions>\r\n }\r\n @if (!clonedData.showSkeleton && col.isOrderable) {\r\n <p-sortIcon [field]=\"col.sortField\"></p-sortIcon>\r\n }\r\n @if (!clonedData.showSkeleton) {\r\n @switch (col.filter.type) {\r\n @case (filterTypes.currency) {\r\n <smz-column-filter type=\"numeric\" currency=\"BRL\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.numeric) {\r\n <smz-column-filter type=\"numeric\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.date) {\r\n <smz-column-filter type=\"date\" [field]=\"col.filterField\" [showTime]=\"col.filter.showTime\"></smz-column-filter>\r\n }\r\n @case (filterTypes.text) {\r\n <smz-column-filter type=\"text\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.boolean) {\r\n <smz-column-filter type=\"boolean\" [field]=\"col.filterField\"></smz-column-filter>\r\n }\r\n @case (filterTypes.dropdown) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField + '.id'\" matchMode=\"dropdown\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-select appendTo=\"body\" [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-select>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"in\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_array) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"array-some\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField + '.id' : filterField : null : 'name' : true\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" optionLabel=\"name\" dataKey=\"id\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n @case (filterTypes.multiselect_string) {\r\n @if (col.filterField | filterObject; as filterField) {\r\n <smz-column-filter [field]=\"filterField\" matchMode=\"multiselectByString\" [showMatchModes]=\"false\" [showOperator]=\"false\" [showAddButton]=\"false\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"px-3 pt-3 pb-0\">\r\n <span class=\"p-text-bold\">{{ col.header }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"filter\" let-value let-filter=\"filter\">\r\n <p-multiSelect [ngModel]=\"value\" [options]=\"(clonedData.items != null ? clonedData.items : []) | uniqueFilter : filterField : filterField : null : true : false : false\" [placeholder]=\"context.state.locale.dropdownFilter.placeholder\" (onChange)=\"filter($event.value)\" [maxSelectedLabels]=\"2\" [selectedItemsLabel]=\"'{0}'\"></p-multiSelect>\r\n </ng-template>\r\n </smz-column-filter>\r\n }\r\n }\r\n }\r\n }\r\n @if (context.state.caption.columnVisibility.showColumnHideButton) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-eye-slash\" class=\"p-button-rounded p-button-text p-button-plain\" (click)=\"hideColumn(col, context)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible|| context.state.editable.isEditable) {\r\n <th [ngStyle]=\"context.state.editable.isEditable ? context.state.editable.ngStyle : context.state.actions.customActions.ngStyle\"></th>\r\n }\r\n </tr>\r\n @if (context.state.actions.batchActions.isVisible) {\r\n <tr>\r\n <th [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\"\r\n [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-start\">\r\n <p-tableHeaderCheckbox class=\"mr-4\"></p-tableHeaderCheckbox>\r\n @if (selectedItems?.length > 0) {\r\n @for (batchItem of context.state.actions.batchActions.items; track batchItem.label) {\r\n @if (batchItem.visible) {\r\n <button pButton [label]=\"batchItem.label\" class=\"p-button-rounded p-button-text p-button-plain animate__animated animate__fadeIn\" [ngClass]=\"batchItem.styleClass\" [icon]=\"batchItem.icon\" (click)=\"batchItem.command(selectedItems); selectedItems = [];\" [disabled]=\"batchItem.disabled\" [pTooltip]=\"batchItem.tooltip\"></button>\r\n }\r\n }\r\n }\r\n </div>\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-item let-editing=\"editing\" let-rowIndex=\"rowIndex\" let-columns=\"columns\">\r\n <tr #editableRowElement\r\n [pEditableRow]=\"item\"\r\n tableItemAction\r\n [isClickable]=\"context.state.actions.rowBehavior.isClickable\"\r\n [callback]=\"context.state.actions.rowBehavior.clickCallback\"\r\n [expandRowOnClick]=\"context.state.actions.rowBehavior.expandRowOnClick\"\r\n [item]=\"item\"\r\n class=\"p-selectable-row\"\r\n [ngClass]=\"{ 'highlight-row': item?.id === state.actions.rowBehavior.highlights, 'preserve-in-small': state.actions.rowBehavior.preserveLayoutInSmallDevices }\"\r\n >\r\n @if (context.state.caption.rowSelection.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\"\r\n [ngStyle]=\"context.state.caption.rowSelection.ngStyle\"\r\n >\r\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\r\n </td>\r\n }\r\n @if (context.state.rowExpansion.isEnabled && !clonedData.showSkeleton) {\r\n <td\r\n clickStopPropagation\r\n class=\"{{ state.actions.rowBehavior.cellStyleClass }}\"\r\n [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading, 'grid grid-nogutter justify-start items-center gap-2': context.state.rowExpansion.highlightNewItems && item._isNew }\"\r\n [ngStyle]=\"context.state.rowExpansion.ngStyle\"\r\n >\r\n <p-toggleButton [(ngModel)]=\"item._isExpanded\" [onIcon]=\"'fa-solid fa-chevron-down'\" [offIcon]=\"'fa-solid fa-chevron-right'\" (onChange)=\"item._isNew = false\"></p-toggleButton>\r\n @if (context.state.rowExpansion.highlightNewItems && item._isNew) {\r\n <div class=\"rounded bg-cyan-400 text-sm text-white px-2 py-0 smz-table-new-tag\" (click)=\"item._isNew = false\">{{ context.state.rowExpansion.highlightLabel }}</div>\r\n }\r\n </td>\r\n }\r\n @for (col of columns; track col.field) {\r\n @if (clonedData.showSkeleton) {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngStyle]=\"col.content.ngStyle\"><p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton></td>\r\n } @else {\r\n <td class=\"{{ state.actions.rowBehavior.cellStyleClass }}\" [ngClass]=\"{ 'opacity-50 pointer-events-none': editableService.context[item.id]?.hasErrors || editableService.context[item.id]?.isLoading }\" [ngStyle]=\"col.content.ngStyle\">\r\n <span class=\"p-column-title\">{{ col.header }}</span>\r\n <p-cellEditor>\r\n <!-- CELULAR COM EDITOR -->\r\n <ng-template pTemplate=\"input\">\r\n @switch (col.editable.type) {\r\n @case (editableTypes.none) {\r\n <smz-table-content class=\"cursor-default\" [ngClass]=\"col.content.contentStyleClass\" [col]=\"col\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\"></smz-table-content>\r\n }\r\n @case (editableTypes.custom) {\r\n <ng-container *ngTemplateOutlet=\"editableTemplate; context: { $implicit: item, col: col }\"></ng-container>\r\n }\r\n <!-- INPUT TEXT -->\r\n @case (editableTypes.text) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <input pInputText type=\"text\" [formControl]=\"$any(control)\" style=\"width: 100%;\">\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT NUMBER -->\r\n @case (editableTypes.number) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-inputNumber\r\n *ngVar=\"col.editable.data as numberData\"\r\n [formControl]=\"$any(control)\"\r\n [mode]=\"numberData.mode\"\r\n [minFractionDigits]=\"numberData.minFractionDigits\"\r\n [maxFractionDigits]=\"numberData.maxFractionDigits\"\r\n [currency]=\"numberData.currency\"\r\n [useGrouping]=\"numberData.useGrouping\"\r\n [allowEmpty]=\"numberData.allowEmpty\"\r\n [showClear]=\"numberData.showClear\"\r\n [showButtons]=\"numberData.showButtons\"\r\n [prefix]=\"numberData.prefix\"\r\n [suffix]=\"numberData.suffix\">\r\n </p-inputNumber>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT SWITCH -->\r\n @case (editableTypes.switch) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-toggleswitch [formControl]=\"$any(control)\"></p-toggleswitch>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT TEXT AREA -->\r\n @case (editableTypes.area) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <textarea pInputTextarea type=\"text\" [formControl]=\"$any(control)\" [rows]=\"$any(col.editable.data).rows\" required style=\"width: 100%;\"></textarea>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT DROPDOWN -->\r\n @case (editableTypes.dropdown) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-select appendTo=\"body\" [formControl]=\"$any(control)\" styleClass=\"w-full\" [options]=\"col.editable.data | editableSource\" optionLabel=\"name\" dataKey=\"id\" [placeholder]=\"$any(col.editable.data).placeholder\" [showClear]=\"!col.editable.validatorsPreset?.isRequired\" [filter]=\"true\"></p-select>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n <!-- INPUT CALENDAR -->\r\n @case (editableTypes.calendar) {\r\n @if (editableService.context[item.id]?.form; as form) {\r\n @if (form.controls[col.editable.property]; as control) {\r\n <div class=\"relative w-full\">\r\n <p-datepicker [formControl]=\"$any(control)\" appendTo=\"body\" styleClass=\"w-full\" [ngClass]=\"{ 'pl-5': !control.valid }\"></p-datepicker>\r\n <smz-table-validation-messages [errors]=\"control.errors\" [messages]=\"uiConfig.dialogs.forms.validationMessages\" [isFormInvalid]=\"form.invalid\" [isFormDirty]=\"form.dirty\"></smz-table-validation-messages>\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n </ng-template>\r\n <!-- CELULAR COM CONTE\u00DADO -->\r\n <ng-template pTemplate=\"output\">\r\n <smz-table-content\r\n [col]=\"col\"\r\n [pTooltip]=\"col.content.tooltip != null ? col.content.tooltip(item) : null\"\r\n tooltipPosition=\"left\"\r\n [ngClass]=\"col.content.contentStyleClass\" [contentTypes]=\"contentTypes\" [item]=\"item\" [rowIndex]=\"rowIndex\" [contentTemplate]=\"contentTemplate\">\r\n </smz-table-content>\r\n </ng-template>\r\n </p-cellEditor>\r\n </td>\r\n }\r\n }\r\n @if (context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) {\r\n <td [ngStyle]=\"context.state.actions.customActions.ngStyle\" class=\"px-0\">\r\n <div class=\"grid grid-nogutter items-center justify-center\">\r\n @if (clonedData.showSkeleton) {\r\n <div class=\"w-full\">\r\n <p-skeleton width=\"100%\" height=\"1rem\"></p-skeleton>\r\n </div>\r\n } @else {\r\n <!-- SEM EDITAR -->\r\n @if (!editing) {\r\n @if (context.state.editable.update.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-pencil\" (click)=\"editableService.onRowEditInit(item)\" class=\"p-button-rounded p-button-text mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.update.isButtonDisabled || (!context.state.editable.update.condition(item))\" pInitEditableRow></button>\r\n }\r\n @if (context.state.editable.remove.isButtonVisible) {\r\n <button pButton type=\"button\" icon=\"pi pi-trash\" (click)=\"editableService.onRowRemove($event, table, item)\" class=\"p-button-rounded p-button-text p-button-secondary mx-1\" [disabled]=\"editableService.isEditing || editableService.isCreating || context.state.editable.remove.isButtonDisabled || (!context.state.editable.remove.condition(item))\"></button>\r\n }\r\n }\r\n <!-- EDITANDO -->\r\n @if (editing) {\r\n @if (editableService.context[item.id]; as editableContext) {\r\n <!-- COM LOADING -->\r\n @if (editableContext.isLoading) {\r\n <button pButton type=\"button\" icon=\"fa-solid fa-rotate fa-spin\" [disabled]=\"true\" class=\"p-button-rounded p-button-text p-button-info mr-2\"></button>\r\n }\r\n <!-- SEM LOADING -->\r\n @if (!editableContext.isLoading) {\r\n <!-- EDITANDO -->\r\n @if (!editableContext.hasErrors) {\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowCreateSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-check\" (click)=\"editableService.onRowEditSave($event, table, editableRowElement, item)\" [disabled]=\"!editableContext.hasChanged || !editableService.context[item.id]?.form.valid\" class=\"p-button-rounded p-button-text p-button-success mr-2\"></button>\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n <!-- COM ERRORS -->\r\n @if (editableContext.hasErrors) {\r\n <p-popover #errorsOverlay appendTo=\"body\" [style]=\"{ width: '450px' }\">\r\n <div [innerHtml]=\"editableContext.errors | contentErrors\"></div>\r\n </p-popover>\r\n <button pButton type=\"button\" icon=\"fas fa-exclamation-triangle\" [disabled]=\"false\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger mr-2\" (click)=\"errorsOverlay.toggle($event)\"></button>\r\n <!-- CRIANDO -->\r\n @if (item._context?.isCreating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowCreateCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n <!-- ATUALIZANDO -->\r\n @if (item._context?.isUpdating) {\r\n <button pButton type=\"button\" icon=\"pi pi-times\" (click)=\"editableService.onRowEditCancel($event, table, item)\" class=\"p-button-sm p-button-rounded p-button-text p-button-danger\"></button>\r\n }\r\n }\r\n }\r\n }\r\n }\r\n <!-- CUSTOM MENU -->\r\n @if (context.state.actions.customActions.isVisible && !editing) {\r\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: { $implicit: item }\"></ng-container>\r\n }\r\n <!-- MENU -->\r\n @if (context.state.actions.menu.isVisible && !editing) {\r\n <smz-menu [callback]=\"context.state.actions.menu.callback\" [items]=\"context.state.actions.menu.items\" [data]=\"item\" [behavior]=\"context.state.actions.menu.behavior\" [ngClass]=\"{ 'ml-2': context.state.actions.customActions.isVisible }\" [icon]=\"context.state.actions.menu.styles.icon\" [styleClass]=\"context.state.actions.menu.styles.styleClass\" [buttonClass]=\"context.state.actions.menu.styles.buttonClass\"></smz-menu>\r\n }\r\n }\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n @if (item?._isExpanded) {\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\">\r\n <ng-container *ngTemplateOutlet=\"rowContentTemplate; context: { $implicit: item }\"></ng-container>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" let-columns>\r\n <tr>\r\n <td [attr.colspan]=\"columns.length + ((context.state.actions.menu.isVisible || context.state.actions.customActions.isVisible || context.state.editable.isEditable) ? 1 : 0) + (context.state.caption.rowSelection.isEnabled ? 1 : 0) + (context.state.rowExpansion.isEnabled ? 1 : 0)\" [ngStyle]=\"{ 'text-align': 'center' }\">\r\n <div [innerHtml]=\"context.state.emptyFeedback.message\"></div>\r\n @if (context.state.caption.clearFilters.isButtonVisible && hasFilters()) {\r\n <button pButton [label]=\"context.state.locale.clearFilters.label\" class=\"p-button-outlined mt-3\" icon=\"pi pi-filter-slash\" (click)=\"clear(table, context)\"></button>\r\n }\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n }\r\n </ng-container>\r\n </ng-container>\r\n }\r\n} @else {\r\n @if (emptyStateTemplate != null) {\r\n <ng-container *ngTemplateOutlet=\"emptyStateTemplate; context: { $implicit: {} }\"></ng-container>\r\n }\r\n}\r\n\r\n" }]
|
|
17264
17376
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: TableEditableService }, { type: TableFormsService }, { type: TableHelperService }, { type: i1$6.Store }, { type: SmzExcelService }], propDecorators: { templates: [{
|
|
17265
17377
|
type: ContentChildren,
|
|
17266
17378
|
args: [PrimeTemplate]
|