@masterteam/components 0.0.275 → 0.0.277
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/assets/common.css +1 -1
- package/fesm2022/masterteam-components-entities.mjs +31 -3
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +20 -4
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +2 -2
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +29 -2
- package/types/masterteam-components-table.d.ts +19 -0
|
@@ -291,6 +291,20 @@ class TableValueResolver {
|
|
|
291
291
|
return 'text';
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Whether the filter UI should offer a control for this column.
|
|
296
|
+
*
|
|
297
|
+
* Deliberately separate from {@link getColumnFilterType}, which also drives
|
|
298
|
+
* export, sort and grouping resolution — opting a column out of the filter
|
|
299
|
+
* panel must not change how its value is exported. Hosts opt out with
|
|
300
|
+
* `filterable: false`, most usefully on lazy tables: those never filter
|
|
301
|
+
* locally, so a filter the host cannot map onto a backend query parameter
|
|
302
|
+
* would render a control that does nothing at all.
|
|
303
|
+
*/
|
|
304
|
+
static isColumnFilterable(column, row) {
|
|
305
|
+
return (column.filterable !== false &&
|
|
306
|
+
TableValueResolver.getColumnFilterType(column, row) !== null);
|
|
307
|
+
}
|
|
294
308
|
/**
|
|
295
309
|
* Returns a column with its filterConfig normalized for rendering:
|
|
296
310
|
* - `type` is resolved via `getColumnFilterType`
|
|
@@ -1063,7 +1077,7 @@ class TableFilter {
|
|
|
1063
1077
|
: '';
|
|
1064
1078
|
}, ...(ngDevMode ? [{ debugName: "filterSummary" }] : /* istanbul ignore next */ []));
|
|
1065
1079
|
filterableColumns = computed(() => this.columns()
|
|
1066
|
-
.filter((col) => TableValueResolver.
|
|
1080
|
+
.filter((col) => TableValueResolver.isColumnFilterable(col, this.data()[0]))
|
|
1067
1081
|
.map((col) => TableValueResolver.buildFilterableColumn(col, this.data())), ...(ngDevMode ? [{ debugName: "filterableColumns" }] : /* istanbul ignore next */ []));
|
|
1068
1082
|
activeFilterCount = computed(() => Object.entries(this.appliedFilters()).filter(([key, value]) =>
|
|
1069
1083
|
// `generalSearch` is the table's global search term, not a column
|
|
@@ -1998,7 +2012,7 @@ class Table {
|
|
|
1998
2012
|
const data = this.data();
|
|
1999
2013
|
const map = new Map();
|
|
2000
2014
|
this.columns().forEach((col) => {
|
|
2001
|
-
if (TableValueResolver.
|
|
2015
|
+
if (!TableValueResolver.isColumnFilterable(col, data[0])) {
|
|
2002
2016
|
return;
|
|
2003
2017
|
}
|
|
2004
2018
|
map.set(col.key, TableValueResolver.buildFilterableColumn(col, data));
|
|
@@ -2658,6 +2672,8 @@ class Table {
|
|
|
2658
2672
|
isCellClickFilterable(column, row) {
|
|
2659
2673
|
if (!this.cellClickFilter())
|
|
2660
2674
|
return false;
|
|
2675
|
+
if (column.filterable === false)
|
|
2676
|
+
return false;
|
|
2661
2677
|
if (column.type === 'boolean') {
|
|
2662
2678
|
// Editable booleans keep the toggle interaction; only readonly ones filter.
|
|
2663
2679
|
return column.readonly === true;
|
|
@@ -3350,7 +3366,7 @@ class Table {
|
|
|
3350
3366
|
return Math.trunc(normalized);
|
|
3351
3367
|
}
|
|
3352
3368
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3353
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Table, isStandalone: true, selector: "mt-table", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, stripedRows: { classPropertyName: "stripedRows", publicName: "stripedRows", isSignal: true, isRequired: false, transformFunction: null }, selectableRows: { classPropertyName: "selectableRows", publicName: "selectableRows", isSignal: true, isRequired: false, transformFunction: null }, clickableRows: { classPropertyName: "clickableRows", publicName: "clickableRows", isSignal: true, isRequired: false, transformFunction: null }, generalSearch: { classPropertyName: "generalSearch", publicName: "generalSearch", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSearch: { classPropertyName: "lazyLocalSearch", publicName: "lazyLocalSearch", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, updating: { classPropertyName: "updating", publicName: "updating", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSort: { classPropertyName: "lazyLocalSort", publicName: "lazyLocalSort", isSignal: true, isRequired: false, transformFunction: null }, lazyTotalRecords: { classPropertyName: "lazyTotalRecords", publicName: "lazyTotalRecords", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, reorderableRows: { classPropertyName: "reorderableRows", publicName: "reorderableRows", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, storageMode: { classPropertyName: "storageMode", publicName: "storageMode", isSignal: true, isRequired: false, transformFunction: null }, persistStateExclude: { classPropertyName: "persistStateExclude", publicName: "persistStateExclude", isSignal: true, isRequired: false, transformFunction: null }, exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, printable: { classPropertyName: "printable", publicName: "printable", isSignal: true, isRequired: false, transformFunction: null }, groupable: { classPropertyName: "groupable", publicName: "groupable", isSignal: true, isRequired: false, transformFunction: null }, groupCountMap: { classPropertyName: "groupCountMap", publicName: "groupCountMap", isSignal: true, isRequired: false, transformFunction: null }, cellClickFilter: { classPropertyName: "cellClickFilter", publicName: "cellClickFilter", isSignal: true, isRequired: false, transformFunction: null }, freezeActions: { classPropertyName: "freezeActions", publicName: "freezeActions", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, printTitle: { classPropertyName: "printTitle", publicName: "printTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null }, tableLayout: { classPropertyName: "tableLayout", publicName: "tableLayout", isSignal: true, isRequired: false, transformFunction: null }, noCard: { classPropertyName: "noCard", publicName: "noCard", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionLabel: { classPropertyName: "tabsOptionLabel", publicName: "tabsOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionValue: { classPropertyName: "tabsOptionValue", publicName: "tabsOptionValue", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, captionStartTemplate: { classPropertyName: "captionStartTemplate", publicName: "captionStartTemplate", isSignal: true, isRequired: false, transformFunction: null }, captionEndTemplate: { classPropertyName: "captionEndTemplate", publicName: "captionEndTemplate", isSignal: true, isRequired: false, transformFunction: null }, emptyTitle: { classPropertyName: "emptyTitle", publicName: "emptyTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyDescription: { classPropertyName: "emptyDescription", publicName: "emptyDescription", isSignal: true, isRequired: false, transformFunction: null }, emptyActionLabel: { classPropertyName: "emptyActionLabel", publicName: "emptyActionLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyActionIcon: { classPropertyName: "emptyActionIcon", publicName: "emptyActionIcon", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, alwaysShowPaginator: { classPropertyName: "alwaysShowPaginator", publicName: "alwaysShowPaginator", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, filterTerm: { classPropertyName: "filterTerm", publicName: "filterTerm", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, sortField: { classPropertyName: "sortField", publicName: "sortField", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", emptyAction: "emptyAction", rowActionsRequested: "rowActionsRequested", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange", groupBy: "groupByChange", sortField: "sortFieldChange", sortDirection: "sortDirectionChange" }, providers: [MTDateFormatPipe], queries: [{ propertyName: "captionStartContent", first: true, predicate: ["captionStart"], descendants: true, isSignal: true }, { propertyName: "captionEndContent", first: true, predicate: ["captionEnd"], descendants: true, isSignal: true }, { propertyName: "emptyContent", first: true, predicate: ["empty"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!noCard()) {\n <mt-card>\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n </mt-card>\n} @else {\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n}\n\n<ng-template #tableContent>\n <div class=\"space-y-4 rounded-lg\">\n <div>\n <mt-table-caption\n [generalSearch]=\"generalSearch()\"\n [showFilters]=\"showFilters()\"\n [filterMode]=\"filterMode()\"\n [exportable]=\"exportable()\"\n [printable]=\"printable()\"\n [groupable]=\"groupable()\"\n [columns]=\"columns()\"\n [data]=\"data()\"\n [groupColumns]=\"grouping.groupableColumns()\"\n [tabs]=\"tabs()\"\n [tabsOptionLabel]=\"tabsOptionLabel()\"\n [tabsOptionValue]=\"tabsOptionValue()\"\n [actions]=\"actions()\"\n [captionStart]=\"captionStartTemplate() ?? captionStartContent() ?? null\"\n [captionEnd]=\"captionEndTemplate() ?? captionEndContent() ?? null\"\n [(activeTab)]=\"activeTab\"\n [(filters)]=\"filters\"\n [(filterTerm)]=\"filterTerm\"\n [groupBy]=\"groupBy()\"\n (groupByChange)=\"onGroupByChange($event)\"\n (exportRequested)=\"exportExcel()\"\n (printRequested)=\"printPdf()\"\n (onTabChange)=\"tabChanged($event)\"\n (searchChange)=\"onSearchChange($event)\"\n (filterApplied)=\"onFilterApplied($event)\"\n (filterReset)=\"onFilterReset()\"\n />\n\n @if (!loading() && emptyContent() && data().length === 0) {\n <div\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\n >\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\n </div>\n } @else {\n <div\n class=\"overflow-x-auto rounded-[10px] border border-surface-200 bg-white\"\n >\n <p-table\n [value]=\"groupKeyedData()\"\n [columns]=\"renderedColumns()\"\n [size]=\"size()\"\n [showGridlines]=\"showGridlines()\"\n [stripedRows]=\"stripedRows()\"\n [lazy]=\"lazy()\"\n [totalRecords]=\"totalRecords()\"\n [reorderableColumns]=\"reorderableColumns()\"\n [reorderableRows]=\"reorderableRows()\"\n [dataKey]=\"dataKey()\"\n [first]=\"first()\"\n [rows]=\"pageSize()\"\n [exportFilename]=\"exportFilename()\"\n [rowGroupMode]=\"grouping.groupingActive() ? 'subheader' : null\"\n [groupRowsBy]=\"grouping.groupingActive() ? groupKeyField : null\"\n [sortField]=\"sortField()\"\n [sortOrder]=\"sortDirection() === 'desc' ? -1 : 1\"\n [scrollable]=\"freezeActions() || usesVirtualScroll()\"\n [virtualScroll]=\"usesVirtualScroll()\"\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"usesVirtualScroll() ? scrollHeight() : undefined\"\n (onPage)=\"onTablePage($event)\"\n (onLazyLoad)=\"handleLazyLoad($event)\"\n (onColReorder)=\"onColumnReorder($event)\"\n (onRowReorder)=\"onRowReorder($event)\"\n [paginator]=\"!virtualScroll()\"\n paginatorStyleClass=\"hidden!\"\n class=\"mt-table min-w-full align-middle text-sm\"\n [class.table-auto]=\"tableLayout() === 'auto'\"\n [class.table-fixed]=\"tableLayout() === 'fixed'\"\n >\n <ng-template\n #header\n let-columns\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\n >\n <tr>\n @if (reorderableRows()) {\n <th class=\"w-10\"></th>\n }\n @if (selectableRows()) {\n <th class=\"w-12 text-start\">\n <mt-checkbox-field\n [ngModel]=\"allSelectedOnPage()\"\n (ngModelChange)=\"toggleAllRowsOnPage()\"\n ></mt-checkbox-field>\n </th>\n }\n\n @for (col of columns; track col.key || col.label || $index) {\n @if (reorderableColumns()) {\n <th\n pReorderableColumn\n class=\"text-start text-sm font-normal text-color\"\n >\n <div class=\"flex items-center gap-2\">\n {{ col.label }}\n @if (\n isColumnFilterMode() && getFilterableColumn(col.key);\n as filterableCol\n ) {\n <mt-table-column-filter\n [column]=\"filterableCol\"\n [value]=\"filters()[col.key]\"\n (filterChange)=\"\n onColumnFilterChange(col.key, $event)\n \"\n />\n }\n <mt-button\n styleClass=\"cursor-move!\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n icon=\"general.menu-05\"\n ></mt-button>\n </div>\n </th>\n } @else {\n <th\n class=\"text-sm font-normal text-color\"\n [class]=\"getColumnAlignClass(col)\"\n [style.width]=\"getColumnWidth(col)\"\n [style.minWidth]=\"getColumnMinWidth(col)\"\n >\n <div class=\"inline-flex items-center gap-1\">\n @if (isColumnSortable(col)) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-2 cursor-pointer\"\n (click)=\"toggleSort(col)\"\n >\n <span>{{ col.label }}</span>\n <mt-icon\n [icon]=\"getSortIcon(col)\"\n class=\"text-xs text-gray-400\"\n />\n </button>\n } @else {\n {{ col.label }}\n }\n @if (\n isColumnFilterMode() && getFilterableColumn(col.key);\n as filterableCol\n ) {\n <mt-table-column-filter\n [column]=\"filterableCol\"\n [value]=\"filters()[col.key]\"\n (filterChange)=\"\n onColumnFilterChange(col.key, $event)\n \"\n />\n }\n </div>\n </th>\n }\n }\n\n @if (rowActions().length > 0) {\n <th\n class=\"mt-actions-column text-center! text-sm font-normal text-color\"\n [class.mt-frozen-actions]=\"freezeActions()\"\n [pFrozenColumn]=\"freezeActions()\"\n alignFrozen=\"right\"\n >\n {{ \"components.table.actions\" | transloco }}\n </th>\n }\n </tr>\n @if (updating()) {\n <tr>\n <th [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\n <p-progressBar\n mode=\"indeterminate\"\n [style]=\"{ height: '4px' }\"\n />\n </th>\n </tr>\n }\n </ng-template>\n <ng-template\n #body\n let-row\n let-columns=\"columns\"\n let-index=\"rowIndex\"\n class=\"divide-y divide-gray-200\"\n >\n @if (loading()) {\n <tr>\n @if (reorderableRows()) {\n <td><p-skeleton /></td>\n }\n @if (selectableRows()) {\n <td><p-skeleton /></td>\n }\n @for (col of columns; track col.key || col.label || $index) {\n <td><p-skeleton /></td>\n }\n @if (rowActions().length > 0) {\n <td><p-skeleton /></td>\n }\n </tr>\n } @else {\n <tr\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\n [class.mt-table-clickable-row]=\"clickableRows()\"\n [class.mt-table-status-entity-row]=\"\n getStatusEntityAccentColor(row)\n \"\n [style.--mt-table-status-accent]=\"\n getStatusEntityAccentColor(row)\n \"\n [class.cursor-pointer]=\"clickableRows()\"\n [pReorderableRow]=\"index\"\n (click)=\"onRowClick($event, row)\"\n >\n @if (reorderableRows()) {\n <td class=\"w-10 text-center\">\n <mt-button\n styleClass=\"cursor-move!\"\n pReorderableRowHandle\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n icon=\"general.menu-05\"\n ></mt-button>\n <!-- <mt-icon-->\n <!-- icon=\"general.menu-05\"-->\n <!-- class=\"cursor-move text-gray-500\"-->\n <!-- pReorderableRowHandle-->\n <!-- ></mt-icon>-->\n </td>\n }\n @if (selectableRows()) {\n <td class=\"w-12\">\n <mt-checkbox-field\n [ngModel]=\"isRowSelected(row)\"\n (ngModelChange)=\"toggleRow(row)\"\n ></mt-checkbox-field>\n </td>\n }\n\n @for (col of columns; track col.key || col.label || $index) {\n <td\n class=\"text-sm font-normal text-muted-color\"\n [class]=\"getColumnAlignClass(col)\"\n [style.width]=\"getColumnWidth(col)\"\n [style.minWidth]=\"getColumnMinWidth(col)\"\n >\n @switch (col.type) {\n @case (\"boolean\") {\n @if (isCellClickFilterable(col, row)) {\n <span\n data-row-click-ignore=\"true\"\n class=\"inline-flex items-center cursor-pointer px-1.5 py-0.5 rounded transition-colors\"\n [class.ring-2]=\"isCellFilterActive(row, col)\"\n [class.ring-primary-400]=\"\n isCellFilterActive(row, col)\n \"\n [class.hover:underline]=\"\n !isCellFilterActive(row, col)\n \"\n (click)=\"onCellFilterClick($event, row, col)\"\n >\n {{\n getBooleanProperty(row, col.key)\n ? (\"components.table.yes\" | transloco)\n : (\"components.table.no\" | transloco)\n }}\n </span>\n } @else {\n <mt-toggle-field\n [disabled]=\"col.readonly\"\n [ngModel]=\"getBooleanProperty(row, col.key)\"\n (ngModelChange)=\"\n onCellChange(row, col.key, $event, 'boolean')\n \"\n ></mt-toggle-field>\n }\n }\n @case (\"date\") {\n {{\n getDateProperty(row, col.key) | mtDateFormat: \"date\"\n }}\n }\n @case (\"dateTime\") {\n {{\n getDateProperty(row, col.key)\n | mtDateFormat: \"dateTime\"\n }}\n }\n @case (\"user\") {\n <ng-container\n *ngTemplateOutlet=\"\n filterableCell;\n context: { row: row, col: col }\n \"\n ></ng-container>\n }\n @case (\"status\") {\n <ng-container\n *ngTemplateOutlet=\"\n filterableCell;\n context: { row: row, col: col }\n \"\n ></ng-container>\n }\n @case (\"entity\") {\n <ng-container\n *ngTemplateOutlet=\"\n filterableCell;\n context: { row: row, col: col }\n \"\n ></ng-container>\n }\n @case (\"custom\") {\n <ng-container\n *ngTemplateOutlet=\"\n col.customCellTpl;\n context: { $implicit: row }\n \"\n >\n </ng-container>\n }\n @default {\n {{ getProperty(row, col.key) }}\n }\n }\n </td>\n }\n\n @if (rowActions().length > 0) {\n <td\n class=\"mt-actions-column text-center\"\n [class.mt-frozen-actions]=\"freezeActions()\"\n [pFrozenColumn]=\"freezeActions()\"\n alignFrozen=\"right\"\n >\n @if (actionShape() === \"popover\") {\n <div class=\"flex items-center justify-center gap-1\">\n @for (\n action of getInlineRowActions(row);\n track $index\n ) {\n <mt-button\n [icon]=\"action.icon\"\n [severity]=\"action.color\"\n [variant]=\"action.variant\"\n [size]=\"action.size || 'small'\"\n (click)=\"rowAction($event, action, row)\"\n [tooltip]=\"action.tooltip\"\n [label]=\"action.label\"\n [loading]=\"resolveActionLoading(action, row)\"\n data-row-click-ignore=\"true\"\n ></mt-button>\n }\n @if (shouldShowRowActionsPopover(row)) {\n <mt-button\n icon=\"general.dots-vertical\"\n severity=\"secondary\"\n variant=\"text\"\n size=\"large\"\n (click)=\"\n onRowActionsToggle($event, rowPopover, row)\n \"\n data-row-click-ignore=\"true\"\n ></mt-button>\n <p-popover #rowPopover appendTo=\"body\">\n <div class=\"flex flex-col min-w-40\">\n @if (isRowActionsLoading(row)) {\n <div class=\"flex flex-col gap-2 p-2\">\n <p-skeleton height=\"1.5rem\" />\n <p-skeleton height=\"1.5rem\" />\n <p-skeleton height=\"1.5rem\" />\n </div>\n } @else {\n @for (\n action of getMenuRowActions(row);\n track $index\n ) {\n @if (\n isFirstDestructiveAction(row, $index)\n ) {\n <hr\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\n />\n }\n <button\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\n [class]=\"\n action.color === 'danger'\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\n \"\n (click)=\"\n rowAction($event, action, row);\n rowPopover.hide()\n \"\n >\n @if (action.icon) {\n <mt-icon\n [icon]=\"action.icon\"\n class=\"text-base\"\n />\n }\n <span>{{\n action.label || action.tooltip\n }}</span>\n </button>\n }\n }\n </div>\n </p-popover>\n }\n </div>\n } @else {\n <div\n class=\"flex flex-wrap items-center justify-center gap-2\"\n >\n @for (action of rowActions(); track $index) {\n @let hidden = action.hidden?.(row);\n @if (!hidden) {\n <mt-button\n [icon]=\"action.icon\"\n [severity]=\"action.color\"\n [variant]=\"action.variant\"\n [size]=\"action.size || 'small'\"\n (click)=\"rowAction($event, action, row)\"\n [tooltip]=\"action.tooltip\"\n [label]=\"action.label\"\n [loading]=\"resolveActionLoading(action, row)\"\n ></mt-button>\n }\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </ng-template>\n <ng-template #filterableCell let-row=\"row\" let-col=\"col\">\n @let filterable = isCellClickFilterable(col, row);\n @let active = isCellFilterActive(row, col);\n @if (filterable) {\n <span\n data-row-click-ignore=\"true\"\n class=\"flex w-full items-center rounded px-1 transition-colors\"\n [class.mt-cell-filterable]=\"!active\"\n [class.mt-cell-filter-active]=\"active\"\n [title]=\"\n active\n ? ('components.table.clearFilter' | transloco)\n : ('components.table.filterByThis' | transloco)\n \"\n (click)=\"onCellFilterClick($event, row, col)\"\n >\n @if (resolveCellEntityData(row, col); as entityData) {\n <mt-entity-preview\n [data]=\"entityData\"\n attachmentShape=\"compact\"\n ></mt-entity-preview>\n } @else {\n {{ getProperty(row, col.key) }}\n }\n </span>\n } @else {\n @if (resolveCellEntityData(row, col); as entityData) {\n <mt-entity-preview\n [data]=\"entityData\"\n attachmentShape=\"compact\"\n ></mt-entity-preview>\n } @else {\n {{ getProperty(row, col.key) }}\n }\n }\n </ng-template>\n <ng-template #groupheader let-row>\n @if (grouping.groupingActive()) {\n <tr\n class=\"mt-group-header\"\n [style.--mt-group-accent]=\"\n grouping.getGroupAccentColor(row) ??\n 'var(--p-primary-color)'\n \"\n >\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\n <div\n class=\"mt-group-header__accent flex items-center gap-2.5 px-4 py-2.5 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700\"\n >\n @if (grouping.showsGroupColumnLabel()) {\n <span\n class=\"shrink-0 text-xs text-gray-500 dark:text-gray-400\"\n >\n {{ grouping.activeGroupColumn()?.label }}\n </span>\n <span\n class=\"shrink-0 text-gray-300 dark:text-gray-600\"\n aria-hidden=\"true\"\n >\u00B7</span\n >\n }\n <span\n class=\"truncate text-sm font-semibold text-gray-900 dark:text-gray-100\"\n >\n {{ grouping.getGroupLabel(row) }}\n </span>\n <span\n class=\"ms-auto shrink-0 inline-flex items-center rounded-full bg-surface-200/70 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-surface-700/60 dark:text-gray-300\"\n >\n {{ getDisplayGroupCount(row) }}\n </span>\n </div>\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"totalColumnSpan()\">\n <!--\n One empty state across the product (finding H-12). When a\n filter or a search term is active the table says so and\n offers to clear it, instead of the same \"No data found\" that\n a genuinely empty list shows.\n -->\n <mt-empty-state\n class=\"min-h-44\"\n [variant]=\"hasActiveFilters() ? 'filtered' : 'empty'\"\n [title]=\"emptyTitle()\"\n [description]=\"emptyDescription()\"\n [actionLabel]=\"resolvedEmptyActionLabel()\"\n [actionIcon]=\"resolvedEmptyActionIcon()\"\n (actionClick)=\"onEmptyAction()\"\n />\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n }\n </div>\n\n @if (showPaginator()) {\n <div\n class=\"flex flex-col gap-3 pb-3 px-4\"\n [class]=\"'items-' + paginatorPosition()\"\n >\n <mt-paginator\n [(rows)]=\"pageSize\"\n [(first)]=\"first\"\n [(page)]=\"currentPage\"\n [totalRecords]=\"totalRecords()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n (onPageChange)=\"onPaginatorPage($event)\"\n ></mt-paginator>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .p-datatable-header{padding:0 0 1.5rem;background:transparent;border:0}:host ::ng-deep .p-datatable-table{border-collapse:separate;border-spacing:0}:host ::ng-deep .p-datatable-thead>tr>th{padding:.9rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-color, #323232);font-size:14px;font-weight:400;line-height:20px;white-space:nowrap}:host ::ng-deep .p-datatable-tbody>tr>td{padding:.72rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-muted-color, #4b4b4b);font-size:14px;font-weight:400;line-height:20px;vertical-align:middle}:host ::ng-deep .p-datatable-tbody>tr:last-child>td{border-bottom:0}:host ::ng-deep .p-datatable-thead>tr>th:first-child{border-top-left-radius:.625rem}:host ::ng-deep .p-datatable-thead>tr>th:last-child{border-top-right-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:.625rem}.mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:var(--p-surface-50, #fafafa)}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:none}.mt-table-status-entity-row>td{background:var(--p-content-background, #ffffff)}.mt-table-status-entity-row>td:first-child:before{display:none}:host ::ng-deep tr.mt-group-header>td{padding:0!important;background:transparent}tr.mt-group-header .mt-group-header__accent{border-inline-start:3px solid var(--mt-group-accent, var(--p-primary-color))}:host ::ng-deep .mt-frozen-actions{border-inline-start:1px solid var(--p-content-border-color, #ebebf0)}:host ::ng-deep .mt-actions-column{max-width:15rem;max-inline-size:8rem}.mt-cell-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in}.mt-cell-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out}.mt-cell-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-cell-filter-active{box-shadow:inset 0 0 0 1.5px #14b8a666}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$3.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: i1$3.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$3.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$3.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$3.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Paginator, selector: "mt-paginator", inputs: ["rows", "totalRecords", "first", "page", "rowsPerPageOptions", "showFirstLastIcon", "showCurrentPageReport", "fluid", "pageLinkSize", "alwaysShow"], outputs: ["rowsChange", "firstChange", "pageChange", "onPageChange"] }, { kind: "component", type: CheckboxField, selector: "mt-checkbox-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i4.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableCaption, selector: "mt-table-caption", inputs: ["generalSearch", "showFilters", "filterMode", "exportable", "printable", "groupable", "columns", "data", "groupColumns", "tabs", "tabsOptionLabel", "tabsOptionValue", "actions", "captionStart", "captionEnd", "activeTab", "filters", "filterTerm", "groupBy"], outputs: ["activeTabChange", "filtersChange", "filterTermChange", "groupByChange", "exportRequested", "printRequested", "onTabChange", "searchChange", "filterApplied", "filterReset"] }, { kind: "component", type: TableColumnFilter, selector: "mt-table-column-filter", inputs: ["column", "value"], outputs: ["filterChange"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i1$2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: EmptyState, selector: "mt-empty-state", inputs: ["variant", "illustration", "title", "description", "actionLabel", "actionIcon"], outputs: ["actionClick"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Table, isStandalone: true, selector: "mt-table", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, stripedRows: { classPropertyName: "stripedRows", publicName: "stripedRows", isSignal: true, isRequired: false, transformFunction: null }, selectableRows: { classPropertyName: "selectableRows", publicName: "selectableRows", isSignal: true, isRequired: false, transformFunction: null }, clickableRows: { classPropertyName: "clickableRows", publicName: "clickableRows", isSignal: true, isRequired: false, transformFunction: null }, generalSearch: { classPropertyName: "generalSearch", publicName: "generalSearch", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSearch: { classPropertyName: "lazyLocalSearch", publicName: "lazyLocalSearch", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, updating: { classPropertyName: "updating", publicName: "updating", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSort: { classPropertyName: "lazyLocalSort", publicName: "lazyLocalSort", isSignal: true, isRequired: false, transformFunction: null }, lazyTotalRecords: { classPropertyName: "lazyTotalRecords", publicName: "lazyTotalRecords", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, reorderableRows: { classPropertyName: "reorderableRows", publicName: "reorderableRows", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, storageMode: { classPropertyName: "storageMode", publicName: "storageMode", isSignal: true, isRequired: false, transformFunction: null }, persistStateExclude: { classPropertyName: "persistStateExclude", publicName: "persistStateExclude", isSignal: true, isRequired: false, transformFunction: null }, exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, printable: { classPropertyName: "printable", publicName: "printable", isSignal: true, isRequired: false, transformFunction: null }, groupable: { classPropertyName: "groupable", publicName: "groupable", isSignal: true, isRequired: false, transformFunction: null }, groupCountMap: { classPropertyName: "groupCountMap", publicName: "groupCountMap", isSignal: true, isRequired: false, transformFunction: null }, cellClickFilter: { classPropertyName: "cellClickFilter", publicName: "cellClickFilter", isSignal: true, isRequired: false, transformFunction: null }, freezeActions: { classPropertyName: "freezeActions", publicName: "freezeActions", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, printTitle: { classPropertyName: "printTitle", publicName: "printTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null }, tableLayout: { classPropertyName: "tableLayout", publicName: "tableLayout", isSignal: true, isRequired: false, transformFunction: null }, noCard: { classPropertyName: "noCard", publicName: "noCard", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionLabel: { classPropertyName: "tabsOptionLabel", publicName: "tabsOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionValue: { classPropertyName: "tabsOptionValue", publicName: "tabsOptionValue", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, captionStartTemplate: { classPropertyName: "captionStartTemplate", publicName: "captionStartTemplate", isSignal: true, isRequired: false, transformFunction: null }, captionEndTemplate: { classPropertyName: "captionEndTemplate", publicName: "captionEndTemplate", isSignal: true, isRequired: false, transformFunction: null }, emptyTitle: { classPropertyName: "emptyTitle", publicName: "emptyTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyDescription: { classPropertyName: "emptyDescription", publicName: "emptyDescription", isSignal: true, isRequired: false, transformFunction: null }, emptyActionLabel: { classPropertyName: "emptyActionLabel", publicName: "emptyActionLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyActionIcon: { classPropertyName: "emptyActionIcon", publicName: "emptyActionIcon", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, alwaysShowPaginator: { classPropertyName: "alwaysShowPaginator", publicName: "alwaysShowPaginator", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, filterTerm: { classPropertyName: "filterTerm", publicName: "filterTerm", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, sortField: { classPropertyName: "sortField", publicName: "sortField", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", emptyAction: "emptyAction", rowActionsRequested: "rowActionsRequested", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange", groupBy: "groupByChange", sortField: "sortFieldChange", sortDirection: "sortDirectionChange" }, providers: [MTDateFormatPipe], queries: [{ propertyName: "captionStartContent", first: true, predicate: ["captionStart"], descendants: true, isSignal: true }, { propertyName: "captionEndContent", first: true, predicate: ["captionEnd"], descendants: true, isSignal: true }, { propertyName: "emptyContent", first: true, predicate: ["empty"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!noCard()) {\r\n <mt-card>\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-card>\r\n} @else {\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"space-y-4 rounded-lg\">\r\n <div>\r\n <mt-table-caption\r\n [generalSearch]=\"generalSearch()\"\r\n [showFilters]=\"showFilters()\"\r\n [filterMode]=\"filterMode()\"\r\n [exportable]=\"exportable()\"\r\n [printable]=\"printable()\"\r\n [groupable]=\"groupable()\"\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [tabs]=\"tabs()\"\r\n [tabsOptionLabel]=\"tabsOptionLabel()\"\r\n [tabsOptionValue]=\"tabsOptionValue()\"\r\n [actions]=\"actions()\"\r\n [captionStart]=\"captionStartTemplate() ?? captionStartContent() ?? null\"\r\n [captionEnd]=\"captionEndTemplate() ?? captionEndContent() ?? null\"\r\n [(activeTab)]=\"activeTab\"\r\n [(filters)]=\"filters\"\r\n [(filterTerm)]=\"filterTerm\"\r\n [groupBy]=\"groupBy()\"\r\n (groupByChange)=\"onGroupByChange($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n (onTabChange)=\"tabChanged($event)\"\r\n (searchChange)=\"onSearchChange($event)\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"overflow-x-auto rounded-[10px] border border-surface-200 bg-white\"\r\n >\r\n <p-table\r\n [value]=\"groupKeyedData()\"\r\n [columns]=\"renderedColumns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n [rowGroupMode]=\"grouping.groupingActive() ? 'subheader' : null\"\r\n [groupRowsBy]=\"grouping.groupingActive() ? groupKeyField : null\"\r\n [sortField]=\"sortField()\"\r\n [sortOrder]=\"sortDirection() === 'desc' ? -1 : 1\"\r\n [scrollable]=\"freezeActions() || usesVirtualScroll()\"\r\n [virtualScroll]=\"usesVirtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [scrollHeight]=\"usesVirtualScroll() ? scrollHeight() : undefined\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n [paginator]=\"!virtualScroll()\"\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"mt-table min-w-full align-middle text-sm\"\r\n [class.table-auto]=\"tableLayout() === 'auto'\"\r\n [class.table-fixed]=\"tableLayout() === 'fixed'\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start text-sm font-normal text-color\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-sm font-normal text-color\"\r\n [class]=\"getColumnAlignClass(col)\"\r\n [style.width]=\"getColumnWidth(col)\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n <div class=\"inline-flex items-center gap-1\">\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n </div>\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"mt-actions-column text-center! text-sm font-normal text-color\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n pFrozenColumn\r\n [frozen]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\r\n [class.mt-table-clickable-row]=\"clickableRows()\"\r\n [class.mt-table-status-entity-row]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [style.--mt-table-status-accent]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [class.cursor-pointer]=\"clickableRows()\"\r\n [pReorderableRow]=\"index\"\r\n [pReorderableRowDisabled]=\"!reorderableRows()\"\r\n (click)=\"onRowClick($event, row)\"\r\n >\r\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"isRowSelected(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td\r\n class=\"text-sm font-normal text-muted-color\"\r\n [class]=\"getColumnAlignClass(col)\"\r\n [style.width]=\"getColumnWidth(col)\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n @if (isCellClickFilterable(col, row)) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"inline-flex items-center cursor-pointer px-1.5 py-0.5 rounded transition-colors\"\r\n [class.ring-2]=\"isCellFilterActive(row, col)\"\r\n [class.ring-primary-400]=\"\r\n isCellFilterActive(row, col)\r\n \"\r\n [class.hover:underline]=\"\r\n !isCellFilterActive(row, col)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n {{\r\n getBooleanProperty(row, col.key)\r\n ? (\"components.table.yes\" | transloco)\r\n : (\"components.table.no\" | transloco)\r\n }}\r\n </span>\r\n } @else {\r\n <mt-toggle-field\r\n [disabled]=\"col.readonly\"\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n ></mt-toggle-field>\r\n }\r\n }\r\n @case (\"date\") {\r\n {{\r\n getDateProperty(row, col.key) | mtDateFormat: \"date\"\r\n }}\r\n }\r\n @case (\"dateTime\") {\r\n {{\r\n getDateProperty(row, col.key)\r\n | mtDateFormat: \"dateTime\"\r\n }}\r\n }\r\n @case (\"user\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"status\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"entity\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td\r\n class=\"mt-actions-column text-center\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n pFrozenColumn\r\n [frozen]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-center gap-1\">\r\n @for (\r\n action of getInlineRowActions(row);\r\n track $index\r\n ) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n }\r\n @if (shouldShowRowActionsPopover(row)) {\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"\r\n onRowActionsToggle($event, rowPopover, row)\r\n \"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @if (isRowActionsLoading(row)) {\r\n <div class=\"flex flex-col gap-2 p-2\">\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n </div>\r\n } @else {\r\n @for (\r\n action of getMenuRowActions(row);\r\n track $index\r\n ) {\r\n @if (\r\n isFirstDestructiveAction(row, $index)\r\n ) {\r\n <hr\r\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\r\n />\r\n }\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-center gap-2\"\r\n >\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #filterableCell let-row=\"row\" let-col=\"col\">\r\n @let filterable = isCellClickFilterable(col, row);\r\n @let active = isCellFilterActive(row, col);\r\n @if (filterable) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"flex w-full items-center rounded px-1 transition-colors\"\r\n [class.mt-cell-filterable]=\"!active\"\r\n [class.mt-cell-filter-active]=\"active\"\r\n [title]=\"\r\n active\r\n ? ('components.table.clearFilter' | transloco)\r\n : ('components.table.filterByThis' | transloco)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n </span>\r\n } @else {\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </ng-template>\r\n <ng-template #groupheader let-row>\r\n @if (grouping.groupingActive()) {\r\n <tr\r\n class=\"mt-group-header\"\r\n [style.--mt-group-accent]=\"\r\n grouping.getGroupAccentColor(row) ??\r\n 'var(--p-primary-color)'\r\n \"\r\n >\r\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <div\r\n class=\"mt-group-header__accent flex items-center gap-2.5 px-4 py-2.5 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700\"\r\n >\r\n @if (grouping.showsGroupColumnLabel()) {\r\n <span\r\n class=\"shrink-0 text-xs text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ grouping.activeGroupColumn()?.label }}\r\n </span>\r\n <span\r\n class=\"shrink-0 text-gray-300 dark:text-gray-600\"\r\n aria-hidden=\"true\"\r\n >\u00B7</span\r\n >\r\n }\r\n <span\r\n class=\"truncate text-sm font-semibold text-gray-900 dark:text-gray-100\"\r\n >\r\n {{ grouping.getGroupLabel(row) }}\r\n </span>\r\n <span\r\n class=\"ms-auto shrink-0 inline-flex items-center rounded-full bg-surface-200/70 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-surface-700/60 dark:text-gray-300\"\r\n >\r\n {{ getDisplayGroupCount(row) }}\r\n </span>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td [attr.colspan]=\"totalColumnSpan()\">\r\n <!--\r\n One empty state across the product (finding H-12). When a\r\n filter or a search term is active the table says so and\r\n offers to clear it, instead of the same \"No data found\" that\r\n a genuinely empty list shows.\r\n -->\r\n <mt-empty-state\r\n class=\"min-h-44\"\r\n [variant]=\"hasActiveFilters() ? 'filtered' : 'empty'\"\r\n [title]=\"emptyTitle()\"\r\n [description]=\"emptyDescription()\"\r\n [actionLabel]=\"resolvedEmptyActionLabel()\"\r\n [actionIcon]=\"resolvedEmptyActionIcon()\"\r\n (actionClick)=\"onEmptyAction()\"\r\n />\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (showPaginator()) {\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"alwaysShowPaginator()\"\r\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: [":host ::ng-deep .p-datatable-header{padding:0 0 1.5rem;background:transparent;border:0}:host ::ng-deep .p-datatable-table{border-collapse:separate;border-spacing:0}:host ::ng-deep .p-datatable-thead>tr>th{padding:.9rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-color, #323232);font-size:14px;font-weight:400;line-height:20px;white-space:nowrap}:host ::ng-deep .p-datatable-tbody>tr>td{padding:.72rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-muted-color, #4b4b4b);font-size:14px;font-weight:400;line-height:20px;vertical-align:middle}:host ::ng-deep .p-datatable-tbody>tr:last-child>td{border-bottom:0}:host ::ng-deep .p-datatable-thead>tr>th:first-child{border-top-left-radius:.625rem}:host ::ng-deep .p-datatable-thead>tr>th:last-child{border-top-right-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:.625rem}.mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:var(--p-surface-50, #fafafa)}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:none}.mt-table-status-entity-row>td{background:var(--p-content-background, #ffffff)}.mt-table-status-entity-row>td:first-child:before{display:none}:host ::ng-deep tr.mt-group-header>td{padding:0!important;background:transparent}tr.mt-group-header .mt-group-header__accent{border-inline-start:3px solid var(--mt-group-accent, var(--p-primary-color))}:host ::ng-deep .mt-frozen-actions{border-inline-start:1px solid var(--p-content-border-color, #ebebf0)}:host ::ng-deep .mt-actions-column{max-width:15rem;max-inline-size:8rem}.mt-cell-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in}.mt-cell-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out}.mt-cell-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-cell-filter-active{box-shadow:inset 0 0 0 1.5px #14b8a666}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$3.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: i1$3.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$3.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$3.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$3.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Paginator, selector: "mt-paginator", inputs: ["rows", "totalRecords", "first", "page", "rowsPerPageOptions", "showFirstLastIcon", "showCurrentPageReport", "fluid", "pageLinkSize", "alwaysShow"], outputs: ["rowsChange", "firstChange", "pageChange", "onPageChange"] }, { kind: "component", type: CheckboxField, selector: "mt-checkbox-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i4.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableCaption, selector: "mt-table-caption", inputs: ["generalSearch", "showFilters", "filterMode", "exportable", "printable", "groupable", "columns", "data", "groupColumns", "tabs", "tabsOptionLabel", "tabsOptionValue", "actions", "captionStart", "captionEnd", "activeTab", "filters", "filterTerm", "groupBy"], outputs: ["activeTabChange", "filtersChange", "filterTermChange", "groupByChange", "exportRequested", "printRequested", "onTabChange", "searchChange", "filterApplied", "filterReset"] }, { kind: "component", type: TableColumnFilter, selector: "mt-table-column-filter", inputs: ["column", "value"], outputs: ["filterChange"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i1$2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: EmptyState, selector: "mt-empty-state", inputs: ["variant", "illustration", "title", "description", "actionLabel", "actionIcon"], outputs: ["actionClick"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3354
3370
|
}
|
|
3355
3371
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Table, decorators: [{
|
|
3356
3372
|
type: Component,
|
|
@@ -3373,7 +3389,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3373
3389
|
Card,
|
|
3374
3390
|
MTDateFormatPipe,
|
|
3375
3391
|
EmptyState,
|
|
3376
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!noCard()) {\n <mt-card>\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n </mt-card>\n} @else {\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n}\n\n<ng-template #tableContent>\n <div class=\"space-y-4 rounded-lg\">\n <div>\n <mt-table-caption\n [generalSearch]=\"generalSearch()\"\n [showFilters]=\"showFilters()\"\n [filterMode]=\"filterMode()\"\n [exportable]=\"exportable()\"\n [printable]=\"printable()\"\n [groupable]=\"groupable()\"\n [columns]=\"columns()\"\n [data]=\"data()\"\n [groupColumns]=\"grouping.groupableColumns()\"\n [tabs]=\"tabs()\"\n [tabsOptionLabel]=\"tabsOptionLabel()\"\n [tabsOptionValue]=\"tabsOptionValue()\"\n [actions]=\"actions()\"\n [captionStart]=\"captionStartTemplate() ?? captionStartContent() ?? null\"\n [captionEnd]=\"captionEndTemplate() ?? captionEndContent() ?? null\"\n [(activeTab)]=\"activeTab\"\n [(filters)]=\"filters\"\n [(filterTerm)]=\"filterTerm\"\n [groupBy]=\"groupBy()\"\n (groupByChange)=\"onGroupByChange($event)\"\n (exportRequested)=\"exportExcel()\"\n (printRequested)=\"printPdf()\"\n (onTabChange)=\"tabChanged($event)\"\n (searchChange)=\"onSearchChange($event)\"\n (filterApplied)=\"onFilterApplied($event)\"\n (filterReset)=\"onFilterReset()\"\n />\n\n @if (!loading() && emptyContent() && data().length === 0) {\n <div\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\n >\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\n </div>\n } @else {\n <div\n class=\"overflow-x-auto rounded-[10px] border border-surface-200 bg-white\"\n >\n <p-table\n [value]=\"groupKeyedData()\"\n [columns]=\"renderedColumns()\"\n [size]=\"size()\"\n [showGridlines]=\"showGridlines()\"\n [stripedRows]=\"stripedRows()\"\n [lazy]=\"lazy()\"\n [totalRecords]=\"totalRecords()\"\n [reorderableColumns]=\"reorderableColumns()\"\n [reorderableRows]=\"reorderableRows()\"\n [dataKey]=\"dataKey()\"\n [first]=\"first()\"\n [rows]=\"pageSize()\"\n [exportFilename]=\"exportFilename()\"\n [rowGroupMode]=\"grouping.groupingActive() ? 'subheader' : null\"\n [groupRowsBy]=\"grouping.groupingActive() ? groupKeyField : null\"\n [sortField]=\"sortField()\"\n [sortOrder]=\"sortDirection() === 'desc' ? -1 : 1\"\n [scrollable]=\"freezeActions() || usesVirtualScroll()\"\n [virtualScroll]=\"usesVirtualScroll()\"\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\n [scrollHeight]=\"usesVirtualScroll() ? scrollHeight() : undefined\"\n (onPage)=\"onTablePage($event)\"\n (onLazyLoad)=\"handleLazyLoad($event)\"\n (onColReorder)=\"onColumnReorder($event)\"\n (onRowReorder)=\"onRowReorder($event)\"\n [paginator]=\"!virtualScroll()\"\n paginatorStyleClass=\"hidden!\"\n class=\"mt-table min-w-full align-middle text-sm\"\n [class.table-auto]=\"tableLayout() === 'auto'\"\n [class.table-fixed]=\"tableLayout() === 'fixed'\"\n >\n <ng-template\n #header\n let-columns\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\n >\n <tr>\n @if (reorderableRows()) {\n <th class=\"w-10\"></th>\n }\n @if (selectableRows()) {\n <th class=\"w-12 text-start\">\n <mt-checkbox-field\n [ngModel]=\"allSelectedOnPage()\"\n (ngModelChange)=\"toggleAllRowsOnPage()\"\n ></mt-checkbox-field>\n </th>\n }\n\n @for (col of columns; track col.key || col.label || $index) {\n @if (reorderableColumns()) {\n <th\n pReorderableColumn\n class=\"text-start text-sm font-normal text-color\"\n >\n <div class=\"flex items-center gap-2\">\n {{ col.label }}\n @if (\n isColumnFilterMode() && getFilterableColumn(col.key);\n as filterableCol\n ) {\n <mt-table-column-filter\n [column]=\"filterableCol\"\n [value]=\"filters()[col.key]\"\n (filterChange)=\"\n onColumnFilterChange(col.key, $event)\n \"\n />\n }\n <mt-button\n styleClass=\"cursor-move!\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n icon=\"general.menu-05\"\n ></mt-button>\n </div>\n </th>\n } @else {\n <th\n class=\"text-sm font-normal text-color\"\n [class]=\"getColumnAlignClass(col)\"\n [style.width]=\"getColumnWidth(col)\"\n [style.minWidth]=\"getColumnMinWidth(col)\"\n >\n <div class=\"inline-flex items-center gap-1\">\n @if (isColumnSortable(col)) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-2 cursor-pointer\"\n (click)=\"toggleSort(col)\"\n >\n <span>{{ col.label }}</span>\n <mt-icon\n [icon]=\"getSortIcon(col)\"\n class=\"text-xs text-gray-400\"\n />\n </button>\n } @else {\n {{ col.label }}\n }\n @if (\n isColumnFilterMode() && getFilterableColumn(col.key);\n as filterableCol\n ) {\n <mt-table-column-filter\n [column]=\"filterableCol\"\n [value]=\"filters()[col.key]\"\n (filterChange)=\"\n onColumnFilterChange(col.key, $event)\n \"\n />\n }\n </div>\n </th>\n }\n }\n\n @if (rowActions().length > 0) {\n <th\n class=\"mt-actions-column text-center! text-sm font-normal text-color\"\n [class.mt-frozen-actions]=\"freezeActions()\"\n [pFrozenColumn]=\"freezeActions()\"\n alignFrozen=\"right\"\n >\n {{ \"components.table.actions\" | transloco }}\n </th>\n }\n </tr>\n @if (updating()) {\n <tr>\n <th [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\n <p-progressBar\n mode=\"indeterminate\"\n [style]=\"{ height: '4px' }\"\n />\n </th>\n </tr>\n }\n </ng-template>\n <ng-template\n #body\n let-row\n let-columns=\"columns\"\n let-index=\"rowIndex\"\n class=\"divide-y divide-gray-200\"\n >\n @if (loading()) {\n <tr>\n @if (reorderableRows()) {\n <td><p-skeleton /></td>\n }\n @if (selectableRows()) {\n <td><p-skeleton /></td>\n }\n @for (col of columns; track col.key || col.label || $index) {\n <td><p-skeleton /></td>\n }\n @if (rowActions().length > 0) {\n <td><p-skeleton /></td>\n }\n </tr>\n } @else {\n <tr\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\n [class.mt-table-clickable-row]=\"clickableRows()\"\n [class.mt-table-status-entity-row]=\"\n getStatusEntityAccentColor(row)\n \"\n [style.--mt-table-status-accent]=\"\n getStatusEntityAccentColor(row)\n \"\n [class.cursor-pointer]=\"clickableRows()\"\n [pReorderableRow]=\"index\"\n (click)=\"onRowClick($event, row)\"\n >\n @if (reorderableRows()) {\n <td class=\"w-10 text-center\">\n <mt-button\n styleClass=\"cursor-move!\"\n pReorderableRowHandle\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n icon=\"general.menu-05\"\n ></mt-button>\n <!-- <mt-icon-->\n <!-- icon=\"general.menu-05\"-->\n <!-- class=\"cursor-move text-gray-500\"-->\n <!-- pReorderableRowHandle-->\n <!-- ></mt-icon>-->\n </td>\n }\n @if (selectableRows()) {\n <td class=\"w-12\">\n <mt-checkbox-field\n [ngModel]=\"isRowSelected(row)\"\n (ngModelChange)=\"toggleRow(row)\"\n ></mt-checkbox-field>\n </td>\n }\n\n @for (col of columns; track col.key || col.label || $index) {\n <td\n class=\"text-sm font-normal text-muted-color\"\n [class]=\"getColumnAlignClass(col)\"\n [style.width]=\"getColumnWidth(col)\"\n [style.minWidth]=\"getColumnMinWidth(col)\"\n >\n @switch (col.type) {\n @case (\"boolean\") {\n @if (isCellClickFilterable(col, row)) {\n <span\n data-row-click-ignore=\"true\"\n class=\"inline-flex items-center cursor-pointer px-1.5 py-0.5 rounded transition-colors\"\n [class.ring-2]=\"isCellFilterActive(row, col)\"\n [class.ring-primary-400]=\"\n isCellFilterActive(row, col)\n \"\n [class.hover:underline]=\"\n !isCellFilterActive(row, col)\n \"\n (click)=\"onCellFilterClick($event, row, col)\"\n >\n {{\n getBooleanProperty(row, col.key)\n ? (\"components.table.yes\" | transloco)\n : (\"components.table.no\" | transloco)\n }}\n </span>\n } @else {\n <mt-toggle-field\n [disabled]=\"col.readonly\"\n [ngModel]=\"getBooleanProperty(row, col.key)\"\n (ngModelChange)=\"\n onCellChange(row, col.key, $event, 'boolean')\n \"\n ></mt-toggle-field>\n }\n }\n @case (\"date\") {\n {{\n getDateProperty(row, col.key) | mtDateFormat: \"date\"\n }}\n }\n @case (\"dateTime\") {\n {{\n getDateProperty(row, col.key)\n | mtDateFormat: \"dateTime\"\n }}\n }\n @case (\"user\") {\n <ng-container\n *ngTemplateOutlet=\"\n filterableCell;\n context: { row: row, col: col }\n \"\n ></ng-container>\n }\n @case (\"status\") {\n <ng-container\n *ngTemplateOutlet=\"\n filterableCell;\n context: { row: row, col: col }\n \"\n ></ng-container>\n }\n @case (\"entity\") {\n <ng-container\n *ngTemplateOutlet=\"\n filterableCell;\n context: { row: row, col: col }\n \"\n ></ng-container>\n }\n @case (\"custom\") {\n <ng-container\n *ngTemplateOutlet=\"\n col.customCellTpl;\n context: { $implicit: row }\n \"\n >\n </ng-container>\n }\n @default {\n {{ getProperty(row, col.key) }}\n }\n }\n </td>\n }\n\n @if (rowActions().length > 0) {\n <td\n class=\"mt-actions-column text-center\"\n [class.mt-frozen-actions]=\"freezeActions()\"\n [pFrozenColumn]=\"freezeActions()\"\n alignFrozen=\"right\"\n >\n @if (actionShape() === \"popover\") {\n <div class=\"flex items-center justify-center gap-1\">\n @for (\n action of getInlineRowActions(row);\n track $index\n ) {\n <mt-button\n [icon]=\"action.icon\"\n [severity]=\"action.color\"\n [variant]=\"action.variant\"\n [size]=\"action.size || 'small'\"\n (click)=\"rowAction($event, action, row)\"\n [tooltip]=\"action.tooltip\"\n [label]=\"action.label\"\n [loading]=\"resolveActionLoading(action, row)\"\n data-row-click-ignore=\"true\"\n ></mt-button>\n }\n @if (shouldShowRowActionsPopover(row)) {\n <mt-button\n icon=\"general.dots-vertical\"\n severity=\"secondary\"\n variant=\"text\"\n size=\"large\"\n (click)=\"\n onRowActionsToggle($event, rowPopover, row)\n \"\n data-row-click-ignore=\"true\"\n ></mt-button>\n <p-popover #rowPopover appendTo=\"body\">\n <div class=\"flex flex-col min-w-40\">\n @if (isRowActionsLoading(row)) {\n <div class=\"flex flex-col gap-2 p-2\">\n <p-skeleton height=\"1.5rem\" />\n <p-skeleton height=\"1.5rem\" />\n <p-skeleton height=\"1.5rem\" />\n </div>\n } @else {\n @for (\n action of getMenuRowActions(row);\n track $index\n ) {\n @if (\n isFirstDestructiveAction(row, $index)\n ) {\n <hr\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\n />\n }\n <button\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\n [class]=\"\n action.color === 'danger'\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\n \"\n (click)=\"\n rowAction($event, action, row);\n rowPopover.hide()\n \"\n >\n @if (action.icon) {\n <mt-icon\n [icon]=\"action.icon\"\n class=\"text-base\"\n />\n }\n <span>{{\n action.label || action.tooltip\n }}</span>\n </button>\n }\n }\n </div>\n </p-popover>\n }\n </div>\n } @else {\n <div\n class=\"flex flex-wrap items-center justify-center gap-2\"\n >\n @for (action of rowActions(); track $index) {\n @let hidden = action.hidden?.(row);\n @if (!hidden) {\n <mt-button\n [icon]=\"action.icon\"\n [severity]=\"action.color\"\n [variant]=\"action.variant\"\n [size]=\"action.size || 'small'\"\n (click)=\"rowAction($event, action, row)\"\n [tooltip]=\"action.tooltip\"\n [label]=\"action.label\"\n [loading]=\"resolveActionLoading(action, row)\"\n ></mt-button>\n }\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </ng-template>\n <ng-template #filterableCell let-row=\"row\" let-col=\"col\">\n @let filterable = isCellClickFilterable(col, row);\n @let active = isCellFilterActive(row, col);\n @if (filterable) {\n <span\n data-row-click-ignore=\"true\"\n class=\"flex w-full items-center rounded px-1 transition-colors\"\n [class.mt-cell-filterable]=\"!active\"\n [class.mt-cell-filter-active]=\"active\"\n [title]=\"\n active\n ? ('components.table.clearFilter' | transloco)\n : ('components.table.filterByThis' | transloco)\n \"\n (click)=\"onCellFilterClick($event, row, col)\"\n >\n @if (resolveCellEntityData(row, col); as entityData) {\n <mt-entity-preview\n [data]=\"entityData\"\n attachmentShape=\"compact\"\n ></mt-entity-preview>\n } @else {\n {{ getProperty(row, col.key) }}\n }\n </span>\n } @else {\n @if (resolveCellEntityData(row, col); as entityData) {\n <mt-entity-preview\n [data]=\"entityData\"\n attachmentShape=\"compact\"\n ></mt-entity-preview>\n } @else {\n {{ getProperty(row, col.key) }}\n }\n }\n </ng-template>\n <ng-template #groupheader let-row>\n @if (grouping.groupingActive()) {\n <tr\n class=\"mt-group-header\"\n [style.--mt-group-accent]=\"\n grouping.getGroupAccentColor(row) ??\n 'var(--p-primary-color)'\n \"\n >\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\n <div\n class=\"mt-group-header__accent flex items-center gap-2.5 px-4 py-2.5 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700\"\n >\n @if (grouping.showsGroupColumnLabel()) {\n <span\n class=\"shrink-0 text-xs text-gray-500 dark:text-gray-400\"\n >\n {{ grouping.activeGroupColumn()?.label }}\n </span>\n <span\n class=\"shrink-0 text-gray-300 dark:text-gray-600\"\n aria-hidden=\"true\"\n >\u00B7</span\n >\n }\n <span\n class=\"truncate text-sm font-semibold text-gray-900 dark:text-gray-100\"\n >\n {{ grouping.getGroupLabel(row) }}\n </span>\n <span\n class=\"ms-auto shrink-0 inline-flex items-center rounded-full bg-surface-200/70 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-surface-700/60 dark:text-gray-300\"\n >\n {{ getDisplayGroupCount(row) }}\n </span>\n </div>\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"totalColumnSpan()\">\n <!--\n One empty state across the product (finding H-12). When a\n filter or a search term is active the table says so and\n offers to clear it, instead of the same \"No data found\" that\n a genuinely empty list shows.\n -->\n <mt-empty-state\n class=\"min-h-44\"\n [variant]=\"hasActiveFilters() ? 'filtered' : 'empty'\"\n [title]=\"emptyTitle()\"\n [description]=\"emptyDescription()\"\n [actionLabel]=\"resolvedEmptyActionLabel()\"\n [actionIcon]=\"resolvedEmptyActionIcon()\"\n (actionClick)=\"onEmptyAction()\"\n />\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n }\n </div>\n\n @if (showPaginator()) {\n <div\n class=\"flex flex-col gap-3 pb-3 px-4\"\n [class]=\"'items-' + paginatorPosition()\"\n >\n <mt-paginator\n [(rows)]=\"pageSize\"\n [(first)]=\"first\"\n [(page)]=\"currentPage\"\n [totalRecords]=\"totalRecords()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n (onPageChange)=\"onPaginatorPage($event)\"\n ></mt-paginator>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .p-datatable-header{padding:0 0 1.5rem;background:transparent;border:0}:host ::ng-deep .p-datatable-table{border-collapse:separate;border-spacing:0}:host ::ng-deep .p-datatable-thead>tr>th{padding:.9rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-color, #323232);font-size:14px;font-weight:400;line-height:20px;white-space:nowrap}:host ::ng-deep .p-datatable-tbody>tr>td{padding:.72rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-muted-color, #4b4b4b);font-size:14px;font-weight:400;line-height:20px;vertical-align:middle}:host ::ng-deep .p-datatable-tbody>tr:last-child>td{border-bottom:0}:host ::ng-deep .p-datatable-thead>tr>th:first-child{border-top-left-radius:.625rem}:host ::ng-deep .p-datatable-thead>tr>th:last-child{border-top-right-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:.625rem}.mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:var(--p-surface-50, #fafafa)}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:none}.mt-table-status-entity-row>td{background:var(--p-content-background, #ffffff)}.mt-table-status-entity-row>td:first-child:before{display:none}:host ::ng-deep tr.mt-group-header>td{padding:0!important;background:transparent}tr.mt-group-header .mt-group-header__accent{border-inline-start:3px solid var(--mt-group-accent, var(--p-primary-color))}:host ::ng-deep .mt-frozen-actions{border-inline-start:1px solid var(--p-content-border-color, #ebebf0)}:host ::ng-deep .mt-actions-column{max-width:15rem;max-inline-size:8rem}.mt-cell-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in}.mt-cell-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out}.mt-cell-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-cell-filter-active{box-shadow:inset 0 0 0 1.5px #14b8a666}\n"] }]
|
|
3392
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!noCard()) {\r\n <mt-card>\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-card>\r\n} @else {\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"space-y-4 rounded-lg\">\r\n <div>\r\n <mt-table-caption\r\n [generalSearch]=\"generalSearch()\"\r\n [showFilters]=\"showFilters()\"\r\n [filterMode]=\"filterMode()\"\r\n [exportable]=\"exportable()\"\r\n [printable]=\"printable()\"\r\n [groupable]=\"groupable()\"\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [tabs]=\"tabs()\"\r\n [tabsOptionLabel]=\"tabsOptionLabel()\"\r\n [tabsOptionValue]=\"tabsOptionValue()\"\r\n [actions]=\"actions()\"\r\n [captionStart]=\"captionStartTemplate() ?? captionStartContent() ?? null\"\r\n [captionEnd]=\"captionEndTemplate() ?? captionEndContent() ?? null\"\r\n [(activeTab)]=\"activeTab\"\r\n [(filters)]=\"filters\"\r\n [(filterTerm)]=\"filterTerm\"\r\n [groupBy]=\"groupBy()\"\r\n (groupByChange)=\"onGroupByChange($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n (onTabChange)=\"tabChanged($event)\"\r\n (searchChange)=\"onSearchChange($event)\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"overflow-x-auto rounded-[10px] border border-surface-200 bg-white\"\r\n >\r\n <p-table\r\n [value]=\"groupKeyedData()\"\r\n [columns]=\"renderedColumns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n [rowGroupMode]=\"grouping.groupingActive() ? 'subheader' : null\"\r\n [groupRowsBy]=\"grouping.groupingActive() ? groupKeyField : null\"\r\n [sortField]=\"sortField()\"\r\n [sortOrder]=\"sortDirection() === 'desc' ? -1 : 1\"\r\n [scrollable]=\"freezeActions() || usesVirtualScroll()\"\r\n [virtualScroll]=\"usesVirtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [scrollHeight]=\"usesVirtualScroll() ? scrollHeight() : undefined\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n [paginator]=\"!virtualScroll()\"\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"mt-table min-w-full align-middle text-sm\"\r\n [class.table-auto]=\"tableLayout() === 'auto'\"\r\n [class.table-fixed]=\"tableLayout() === 'fixed'\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start text-sm font-normal text-color\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-sm font-normal text-color\"\r\n [class]=\"getColumnAlignClass(col)\"\r\n [style.width]=\"getColumnWidth(col)\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n <div class=\"inline-flex items-center gap-1\">\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n </div>\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"mt-actions-column text-center! text-sm font-normal text-color\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n pFrozenColumn\r\n [frozen]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\r\n [class.mt-table-clickable-row]=\"clickableRows()\"\r\n [class.mt-table-status-entity-row]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [style.--mt-table-status-accent]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [class.cursor-pointer]=\"clickableRows()\"\r\n [pReorderableRow]=\"index\"\r\n [pReorderableRowDisabled]=\"!reorderableRows()\"\r\n (click)=\"onRowClick($event, row)\"\r\n >\r\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"isRowSelected(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td\r\n class=\"text-sm font-normal text-muted-color\"\r\n [class]=\"getColumnAlignClass(col)\"\r\n [style.width]=\"getColumnWidth(col)\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n @if (isCellClickFilterable(col, row)) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"inline-flex items-center cursor-pointer px-1.5 py-0.5 rounded transition-colors\"\r\n [class.ring-2]=\"isCellFilterActive(row, col)\"\r\n [class.ring-primary-400]=\"\r\n isCellFilterActive(row, col)\r\n \"\r\n [class.hover:underline]=\"\r\n !isCellFilterActive(row, col)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n {{\r\n getBooleanProperty(row, col.key)\r\n ? (\"components.table.yes\" | transloco)\r\n : (\"components.table.no\" | transloco)\r\n }}\r\n </span>\r\n } @else {\r\n <mt-toggle-field\r\n [disabled]=\"col.readonly\"\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n ></mt-toggle-field>\r\n }\r\n }\r\n @case (\"date\") {\r\n {{\r\n getDateProperty(row, col.key) | mtDateFormat: \"date\"\r\n }}\r\n }\r\n @case (\"dateTime\") {\r\n {{\r\n getDateProperty(row, col.key)\r\n | mtDateFormat: \"dateTime\"\r\n }}\r\n }\r\n @case (\"user\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"status\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"entity\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td\r\n class=\"mt-actions-column text-center\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n pFrozenColumn\r\n [frozen]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-center gap-1\">\r\n @for (\r\n action of getInlineRowActions(row);\r\n track $index\r\n ) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n }\r\n @if (shouldShowRowActionsPopover(row)) {\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"\r\n onRowActionsToggle($event, rowPopover, row)\r\n \"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @if (isRowActionsLoading(row)) {\r\n <div class=\"flex flex-col gap-2 p-2\">\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n </div>\r\n } @else {\r\n @for (\r\n action of getMenuRowActions(row);\r\n track $index\r\n ) {\r\n @if (\r\n isFirstDestructiveAction(row, $index)\r\n ) {\r\n <hr\r\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\r\n />\r\n }\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-center gap-2\"\r\n >\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #filterableCell let-row=\"row\" let-col=\"col\">\r\n @let filterable = isCellClickFilterable(col, row);\r\n @let active = isCellFilterActive(row, col);\r\n @if (filterable) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"flex w-full items-center rounded px-1 transition-colors\"\r\n [class.mt-cell-filterable]=\"!active\"\r\n [class.mt-cell-filter-active]=\"active\"\r\n [title]=\"\r\n active\r\n ? ('components.table.clearFilter' | transloco)\r\n : ('components.table.filterByThis' | transloco)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n </span>\r\n } @else {\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </ng-template>\r\n <ng-template #groupheader let-row>\r\n @if (grouping.groupingActive()) {\r\n <tr\r\n class=\"mt-group-header\"\r\n [style.--mt-group-accent]=\"\r\n grouping.getGroupAccentColor(row) ??\r\n 'var(--p-primary-color)'\r\n \"\r\n >\r\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <div\r\n class=\"mt-group-header__accent flex items-center gap-2.5 px-4 py-2.5 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700\"\r\n >\r\n @if (grouping.showsGroupColumnLabel()) {\r\n <span\r\n class=\"shrink-0 text-xs text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ grouping.activeGroupColumn()?.label }}\r\n </span>\r\n <span\r\n class=\"shrink-0 text-gray-300 dark:text-gray-600\"\r\n aria-hidden=\"true\"\r\n >\u00B7</span\r\n >\r\n }\r\n <span\r\n class=\"truncate text-sm font-semibold text-gray-900 dark:text-gray-100\"\r\n >\r\n {{ grouping.getGroupLabel(row) }}\r\n </span>\r\n <span\r\n class=\"ms-auto shrink-0 inline-flex items-center rounded-full bg-surface-200/70 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-surface-700/60 dark:text-gray-300\"\r\n >\r\n {{ getDisplayGroupCount(row) }}\r\n </span>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td [attr.colspan]=\"totalColumnSpan()\">\r\n <!--\r\n One empty state across the product (finding H-12). When a\r\n filter or a search term is active the table says so and\r\n offers to clear it, instead of the same \"No data found\" that\r\n a genuinely empty list shows.\r\n -->\r\n <mt-empty-state\r\n class=\"min-h-44\"\r\n [variant]=\"hasActiveFilters() ? 'filtered' : 'empty'\"\r\n [title]=\"emptyTitle()\"\r\n [description]=\"emptyDescription()\"\r\n [actionLabel]=\"resolvedEmptyActionLabel()\"\r\n [actionIcon]=\"resolvedEmptyActionIcon()\"\r\n (actionClick)=\"onEmptyAction()\"\r\n />\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (showPaginator()) {\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"alwaysShowPaginator()\"\r\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: [":host ::ng-deep .p-datatable-header{padding:0 0 1.5rem;background:transparent;border:0}:host ::ng-deep .p-datatable-table{border-collapse:separate;border-spacing:0}:host ::ng-deep .p-datatable-thead>tr>th{padding:.9rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-color, #323232);font-size:14px;font-weight:400;line-height:20px;white-space:nowrap}:host ::ng-deep .p-datatable-tbody>tr>td{padding:.72rem 1rem;background:var(--p-content-background, #ffffff);border-bottom:1px solid var(--p-content-border-color, #ebebf0);color:var(--p-text-muted-color, #4b4b4b);font-size:14px;font-weight:400;line-height:20px;vertical-align:middle}:host ::ng-deep .p-datatable-tbody>tr:last-child>td{border-bottom:0}:host ::ng-deep .p-datatable-thead>tr>th:first-child{border-top-left-radius:.625rem}:host ::ng-deep .p-datatable-thead>tr>th:last-child{border-top-right-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:.625rem}.mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:var(--p-surface-50, #fafafa)}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:none}.mt-table-status-entity-row>td{background:var(--p-content-background, #ffffff)}.mt-table-status-entity-row>td:first-child:before{display:none}:host ::ng-deep tr.mt-group-header>td{padding:0!important;background:transparent}tr.mt-group-header .mt-group-header__accent{border-inline-start:3px solid var(--mt-group-accent, var(--p-primary-color))}:host ::ng-deep .mt-frozen-actions{border-inline-start:1px solid var(--p-content-border-color, #ebebf0)}:host ::ng-deep .mt-actions-column{max-width:15rem;max-inline-size:8rem}.mt-cell-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in}.mt-cell-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out}.mt-cell-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-cell-filter-active{box-shadow:inset 0 0 0 1.5px #14b8a666}\n"] }]
|
|
3377
3393
|
}], ctorParameters: () => [], propDecorators: { selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], cellChange: [{ type: i0.Output, args: ["cellChange"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], columnReorder: [{ type: i0.Output, args: ["columnReorder"] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], emptyAction: [{ type: i0.Output, args: ["emptyAction"] }], rowActionsRequested: [{ type: i0.Output, args: ["rowActionsRequested"] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showGridlines: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGridlines", required: false }] }], stripedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "stripedRows", required: false }] }], selectableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectableRows", required: false }] }], clickableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickableRows", required: false }] }], generalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "generalSearch", required: false }] }], lazyLocalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLocalSearch", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], updating: [{ type: i0.Input, args: [{ isSignal: true, alias: "updating", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], lazyLocalSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLocalSort", required: false }] }], lazyTotalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyTotalRecords", required: false }] }], reorderableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableColumns", required: false }] }], reorderableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableRows", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], storageMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageMode", required: false }] }], persistStateExclude: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistStateExclude", required: false }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], printable: [{ type: i0.Input, args: [{ isSignal: true, alias: "printable", required: false }] }], groupable: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupable", required: false }] }], groupCountMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupCountMap", required: false }] }], cellClickFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClickFilter", required: false }] }], freezeActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "freezeActions", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualScrollItemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollItemSize", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], printTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "printTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", required: false }] }], rowActionsLoadingFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActionsLoadingFn", required: false }] }], tableLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableLayout", required: false }] }], noCard: [{ type: i0.Input, args: [{ isSignal: true, alias: "noCard", required: false }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabsOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionLabel", required: false }] }], tabsOptionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionValue", required: false }] }], activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: false }] }, { type: i0.Output, args: ["activeTabChange"] }], onTabChange: [{ type: i0.Output, args: ["onTabChange"] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], captionStartContent: [{ type: i0.ContentChild, args: ['captionStart', { isSignal: true }] }], captionEndContent: [{ type: i0.ContentChild, args: ['captionEnd', { isSignal: true }] }], captionStartTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionStartTemplate", required: false }] }], captionEndTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionEndTemplate", required: false }] }], emptyContent: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], emptyTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTitle", required: false }] }], emptyDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyDescription", required: false }] }], emptyActionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyActionLabel", required: false }] }], emptyActionIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyActionIcon", required: false }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", required: false }] }], alwaysShowPaginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "alwaysShowPaginator", required: false }] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], filterTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterTerm", required: false }] }, { type: i0.Output, args: ["filterTermChange"] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }, { type: i0.Output, args: ["groupByChange"] }], sortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortField", required: false }] }, { type: i0.Output, args: ["sortFieldChange"] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }, { type: i0.Output, args: ["sortDirectionChange"] }] } });
|
|
3378
3394
|
|
|
3379
3395
|
/**
|