@masterteam/components 0.0.134 → 0.0.136
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-business-fields.mjs +1 -1
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-color-picker-field.mjs +2 -2
- package/fesm2022/masterteam-components-color-picker-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +407 -39
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/fesm2022/masterteam-components-module-summary-card.mjs +1 -1
- package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -1
- package/fesm2022/masterteam-components-slider-field.mjs +61 -50
- package/fesm2022/masterteam-components-slider-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +231 -22
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-toggle-field.mjs +15 -3
- package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-tree.mjs +22 -9
- package/fesm2022/masterteam-components-tree.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-formula.d.ts +76 -13
- package/types/masterteam-components-slider-field.d.ts +15 -22
- package/types/masterteam-components-table.d.ts +22 -2
- package/types/masterteam-components-toggle-field.d.ts +4 -1
- package/types/masterteam-components-tree.d.ts +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, model, booleanAttribute, contentChild, viewChild, inject } from '@angular/core';
|
|
2
|
+
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, model, booleanAttribute, contentChild, viewChild, inject, effect } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, DatePipe } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
@@ -423,6 +423,8 @@ class Table {
|
|
|
423
423
|
reorderableColumns = input(false, { ...(ngDevMode ? { debugName: "reorderableColumns" } : {}), transform: booleanAttribute });
|
|
424
424
|
reorderableRows = input(false, { ...(ngDevMode ? { debugName: "reorderableRows" } : {}), transform: booleanAttribute });
|
|
425
425
|
dataKey = input(...(ngDevMode ? [undefined, { debugName: "dataKey" }] : []));
|
|
426
|
+
storageKey = input(null, ...(ngDevMode ? [{ debugName: "storageKey" }] : []));
|
|
427
|
+
storageMode = input('local', ...(ngDevMode ? [{ debugName: "storageMode" }] : []));
|
|
426
428
|
exportable = input(false, { ...(ngDevMode ? { debugName: "exportable" } : {}), transform: booleanAttribute });
|
|
427
429
|
exportFilename = input('download', ...(ngDevMode ? [{ debugName: "exportFilename" }] : []));
|
|
428
430
|
actionShape = input('flat', ...(ngDevMode ? [{ debugName: "actionShape" }] : []));
|
|
@@ -441,6 +443,7 @@ class Table {
|
|
|
441
443
|
// Table reference for export
|
|
442
444
|
tableRef = viewChild('dt', ...(ngDevMode ? [{ debugName: "tableRef" }] : []));
|
|
443
445
|
paginatorPosition = input('end', ...(ngDevMode ? [{ debugName: "paginatorPosition" }] : []));
|
|
446
|
+
rowsPerPageOptions = input([5, 10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "rowsPerPageOptions" }] : []));
|
|
444
447
|
pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
445
448
|
currentPage = model(0, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
446
449
|
first = model(0, ...(ngDevMode ? [{ debugName: "first" }] : []));
|
|
@@ -448,7 +451,10 @@ class Table {
|
|
|
448
451
|
sortField = signal(null, ...(ngDevMode ? [{ debugName: "sortField" }] : []));
|
|
449
452
|
sortDirection = signal(null, ...(ngDevMode ? [{ debugName: "sortDirection" }] : []));
|
|
450
453
|
confirmationService = inject(ConfirmationService);
|
|
451
|
-
|
|
454
|
+
selectedRowKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "selectedRowKeys" }] : []));
|
|
455
|
+
transientSelectedRows = signal(new Set(), ...(ngDevMode ? [{ debugName: "transientSelectedRows" }] : []));
|
|
456
|
+
hydratedStorageKey = signal(null, ...(ngDevMode ? [{ debugName: "hydratedStorageKey" }] : []));
|
|
457
|
+
storageHydrated = signal(false, ...(ngDevMode ? [{ debugName: "storageHydrated" }] : []));
|
|
452
458
|
// Map columns for PrimeNG export (key -> field)
|
|
453
459
|
exportColumns = computed(() => this.columns()
|
|
454
460
|
.filter((col) => col.type !== 'custom')
|
|
@@ -502,8 +508,43 @@ class Table {
|
|
|
502
508
|
const pageData = this.paginatedData();
|
|
503
509
|
if (pageData.length === 0)
|
|
504
510
|
return false;
|
|
505
|
-
return pageData.every((row) => this.
|
|
511
|
+
return pageData.every((row) => this.isRowSelected(row));
|
|
506
512
|
}, ...(ngDevMode ? [{ debugName: "allSelectedOnPage" }] : []));
|
|
513
|
+
constructor() {
|
|
514
|
+
effect(() => {
|
|
515
|
+
const storageKey = this.getNormalizedStorageKey();
|
|
516
|
+
const storage = this.getStorage();
|
|
517
|
+
const previousStorageKey = this.hydratedStorageKey();
|
|
518
|
+
this.storageHydrated.set(false);
|
|
519
|
+
if (!storageKey || !storage) {
|
|
520
|
+
this.hydratedStorageKey.set(storageKey);
|
|
521
|
+
this.storageHydrated.set(true);
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
if (previousStorageKey === storageKey) {
|
|
525
|
+
this.storageHydrated.set(true);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const persistedState = this.readPersistedState(storage, storageKey);
|
|
529
|
+
this.applyPersistedState(persistedState);
|
|
530
|
+
this.hydratedStorageKey.set(storageKey);
|
|
531
|
+
this.storageHydrated.set(true);
|
|
532
|
+
if (this.lazy() && this.shouldEmitLazyLoadAfterRestore(persistedState)) {
|
|
533
|
+
queueMicrotask(() => this.emitLazyLoad({}));
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
effect(() => {
|
|
537
|
+
const storageKey = this.getNormalizedStorageKey();
|
|
538
|
+
const storage = this.getStorage();
|
|
539
|
+
if (!storageKey ||
|
|
540
|
+
!storage ||
|
|
541
|
+
!this.storageHydrated() ||
|
|
542
|
+
this.hydratedStorageKey() !== storageKey) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
this.writePersistedState(storage, storageKey, this.buildPersistedState());
|
|
546
|
+
});
|
|
547
|
+
}
|
|
507
548
|
onFilterApplied(filters) {
|
|
508
549
|
this.filters.set(filters);
|
|
509
550
|
this.first.set(0);
|
|
@@ -582,26 +623,55 @@ class Table {
|
|
|
582
623
|
return normalizedFilterValue === filterValue;
|
|
583
624
|
}
|
|
584
625
|
toggleRow(row) {
|
|
585
|
-
const
|
|
586
|
-
if (
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
626
|
+
const rowKey = this.getRowSelectionKey(row);
|
|
627
|
+
if (rowKey !== null) {
|
|
628
|
+
const nextSelection = new Set(this.selectedRowKeys());
|
|
629
|
+
if (nextSelection.has(rowKey)) {
|
|
630
|
+
nextSelection.delete(rowKey);
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
nextSelection.add(rowKey);
|
|
634
|
+
}
|
|
635
|
+
this.selectedRowKeys.set(nextSelection);
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
const nextSelection = new Set(this.transientSelectedRows());
|
|
639
|
+
if (nextSelection.has(row)) {
|
|
640
|
+
nextSelection.delete(row);
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
nextSelection.add(row);
|
|
644
|
+
}
|
|
645
|
+
this.transientSelectedRows.set(nextSelection);
|
|
646
|
+
}
|
|
647
|
+
this.emitSelectionChange();
|
|
592
648
|
}
|
|
593
649
|
toggleAllRowsOnPage() {
|
|
594
|
-
const currentSelection = new Set(this.selectedRows());
|
|
595
650
|
const pageData = this.paginatedData();
|
|
596
651
|
const allSelected = this.allSelectedOnPage();
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
652
|
+
const nextSelectedRowKeys = new Set(this.selectedRowKeys());
|
|
653
|
+
const nextTransientSelection = new Set(this.transientSelectedRows());
|
|
654
|
+
pageData.forEach((row) => {
|
|
655
|
+
const rowKey = this.getRowSelectionKey(row);
|
|
656
|
+
if (rowKey !== null) {
|
|
657
|
+
if (allSelected) {
|
|
658
|
+
nextSelectedRowKeys.delete(rowKey);
|
|
659
|
+
}
|
|
660
|
+
else {
|
|
661
|
+
nextSelectedRowKeys.add(rowKey);
|
|
662
|
+
}
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
if (allSelected) {
|
|
666
|
+
nextTransientSelection.delete(row);
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
nextTransientSelection.add(row);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
this.selectedRowKeys.set(nextSelectedRowKeys);
|
|
673
|
+
this.transientSelectedRows.set(nextTransientSelection);
|
|
674
|
+
this.emitSelectionChange();
|
|
605
675
|
}
|
|
606
676
|
getProperty(obj, key) {
|
|
607
677
|
return TableValueResolver.getProperty(obj, key);
|
|
@@ -1119,8 +1189,147 @@ class Table {
|
|
|
1119
1189
|
return exportRow;
|
|
1120
1190
|
});
|
|
1121
1191
|
}
|
|
1192
|
+
isRowSelected(row) {
|
|
1193
|
+
const rowKey = this.getRowSelectionKey(row);
|
|
1194
|
+
if (rowKey !== null) {
|
|
1195
|
+
return this.selectedRowKeys().has(rowKey);
|
|
1196
|
+
}
|
|
1197
|
+
return this.transientSelectedRows().has(row);
|
|
1198
|
+
}
|
|
1199
|
+
emitSelectionChange() {
|
|
1200
|
+
this.selectionChange.emit(this.getSelectedRows());
|
|
1201
|
+
}
|
|
1202
|
+
getSelectedRows() {
|
|
1203
|
+
const dataKey = this.dataKey();
|
|
1204
|
+
if (!dataKey) {
|
|
1205
|
+
return Array.from(this.transientSelectedRows());
|
|
1206
|
+
}
|
|
1207
|
+
const selectedRowKeys = this.selectedRowKeys();
|
|
1208
|
+
return this.data().filter((row) => {
|
|
1209
|
+
const rowKey = this.getRowSelectionKey(row);
|
|
1210
|
+
return rowKey !== null && selectedRowKeys.has(rowKey);
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
getRowSelectionKey(row) {
|
|
1214
|
+
const dataKey = this.dataKey();
|
|
1215
|
+
if (!dataKey) {
|
|
1216
|
+
return null;
|
|
1217
|
+
}
|
|
1218
|
+
const value = this.getProperty(row, dataKey);
|
|
1219
|
+
if (value === null || value === undefined || value === '') {
|
|
1220
|
+
return null;
|
|
1221
|
+
}
|
|
1222
|
+
return String(value);
|
|
1223
|
+
}
|
|
1224
|
+
getNormalizedStorageKey() {
|
|
1225
|
+
const storageKey = this.storageKey()?.trim();
|
|
1226
|
+
return storageKey ? storageKey : null;
|
|
1227
|
+
}
|
|
1228
|
+
getStorage() {
|
|
1229
|
+
if (typeof window === 'undefined') {
|
|
1230
|
+
return null;
|
|
1231
|
+
}
|
|
1232
|
+
return this.storageMode() === 'session'
|
|
1233
|
+
? window.sessionStorage
|
|
1234
|
+
: window.localStorage;
|
|
1235
|
+
}
|
|
1236
|
+
buildPersistedState() {
|
|
1237
|
+
return {
|
|
1238
|
+
pageSize: this.pageSize(),
|
|
1239
|
+
first: this.first(),
|
|
1240
|
+
currentPage: this.currentPage(),
|
|
1241
|
+
filterTerm: this.filterTerm(),
|
|
1242
|
+
filters: this.filters(),
|
|
1243
|
+
sortField: this.sortField(),
|
|
1244
|
+
sortDirection: this.sortDirection(),
|
|
1245
|
+
selectedRowKeys: this.dataKey() ? Array.from(this.selectedRowKeys()) : [],
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
applyPersistedState(persistedState) {
|
|
1249
|
+
this.transientSelectedRows.set(new Set());
|
|
1250
|
+
if (!persistedState) {
|
|
1251
|
+
this.selectedRowKeys.set(new Set());
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
const pageSize = this.toPositiveInteger(persistedState.pageSize);
|
|
1255
|
+
if (pageSize !== null) {
|
|
1256
|
+
this.pageSize.set(pageSize);
|
|
1257
|
+
}
|
|
1258
|
+
const first = this.toNonNegativeInteger(persistedState.first);
|
|
1259
|
+
if (first !== null) {
|
|
1260
|
+
this.first.set(first);
|
|
1261
|
+
}
|
|
1262
|
+
const currentPage = this.toNonNegativeInteger(persistedState.currentPage);
|
|
1263
|
+
if (currentPage !== null) {
|
|
1264
|
+
this.currentPage.set(currentPage);
|
|
1265
|
+
}
|
|
1266
|
+
else if (first !== null && pageSize !== null) {
|
|
1267
|
+
this.currentPage.set(Math.floor(first / pageSize));
|
|
1268
|
+
}
|
|
1269
|
+
if (typeof persistedState.filterTerm === 'string') {
|
|
1270
|
+
this.filterTerm.set(persistedState.filterTerm);
|
|
1271
|
+
}
|
|
1272
|
+
if (persistedState.filters && typeof persistedState.filters === 'object') {
|
|
1273
|
+
this.filters.set(persistedState.filters);
|
|
1274
|
+
}
|
|
1275
|
+
this.sortField.set(typeof persistedState.sortField === 'string'
|
|
1276
|
+
? persistedState.sortField
|
|
1277
|
+
: null);
|
|
1278
|
+
this.sortDirection.set(persistedState.sortDirection === 'asc' ||
|
|
1279
|
+
persistedState.sortDirection === 'desc'
|
|
1280
|
+
? persistedState.sortDirection
|
|
1281
|
+
: null);
|
|
1282
|
+
this.selectedRowKeys.set(new Set(Array.isArray(persistedState.selectedRowKeys)
|
|
1283
|
+
? persistedState.selectedRowKeys
|
|
1284
|
+
: []));
|
|
1285
|
+
}
|
|
1286
|
+
shouldEmitLazyLoadAfterRestore(persistedState) {
|
|
1287
|
+
if (!persistedState) {
|
|
1288
|
+
return false;
|
|
1289
|
+
}
|
|
1290
|
+
return (persistedState.pageSize !== undefined ||
|
|
1291
|
+
persistedState.first !== undefined ||
|
|
1292
|
+
persistedState.currentPage !== undefined ||
|
|
1293
|
+
persistedState.filterTerm !== undefined ||
|
|
1294
|
+
persistedState.filters !== undefined);
|
|
1295
|
+
}
|
|
1296
|
+
readPersistedState(storage, storageKey) {
|
|
1297
|
+
try {
|
|
1298
|
+
const raw = storage.getItem(storageKey);
|
|
1299
|
+
if (!raw) {
|
|
1300
|
+
return null;
|
|
1301
|
+
}
|
|
1302
|
+
const parsed = JSON.parse(raw);
|
|
1303
|
+
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
1304
|
+
}
|
|
1305
|
+
catch {
|
|
1306
|
+
return null;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
writePersistedState(storage, storageKey, state) {
|
|
1310
|
+
try {
|
|
1311
|
+
storage.setItem(storageKey, JSON.stringify(state));
|
|
1312
|
+
}
|
|
1313
|
+
catch {
|
|
1314
|
+
// Ignore storage write failures.
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
toPositiveInteger(value) {
|
|
1318
|
+
const normalized = Number(value);
|
|
1319
|
+
if (!Number.isFinite(normalized) || normalized <= 0) {
|
|
1320
|
+
return null;
|
|
1321
|
+
}
|
|
1322
|
+
return Math.trunc(normalized);
|
|
1323
|
+
}
|
|
1324
|
+
toNonNegativeInteger(value) {
|
|
1325
|
+
const normalized = Number(value);
|
|
1326
|
+
if (!Number.isFinite(normalized) || normalized < 0) {
|
|
1327
|
+
return null;
|
|
1328
|
+
}
|
|
1329
|
+
return Math.trunc(normalized);
|
|
1330
|
+
}
|
|
1122
1331
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1123
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 }, 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 }, exportable: { classPropertyName: "exportable", publicName: "exportable", 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 }, 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 }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", 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 } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange" }, 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 }], viewQueries: [{ propertyName: "tableRef", first: true, predicate: ["dt"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\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 class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\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 [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-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 font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\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-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\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 </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\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\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\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 (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]=\"selectedRows().has(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-gray-700 dark:text-gray-100\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n {{ getProperty(row, col.key) | date: \"mediumDate\" }}\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(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 @case (\"status\") {\r\n @if (getEntityPreviewData(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 @case (\"entity\") {\r\n @if (getEntityColumnData(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 @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 class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\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)=\"rowPopover.toggle($event)\"\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 @for (\r\n action of getVisibleRowActions(row);\r\n track $index\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 </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\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 #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\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 <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]=\"false\"\r\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".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:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:3px solid var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{border-inline-start:none}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.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$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.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", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.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"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }, { 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: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3$1.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: TableFilter, selector: "mt-table-filter", inputs: ["columns", "data"], outputs: ["filterApplied", "filterReset"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i2.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: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: i3.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1332
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 }, 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 }, exportable: { classPropertyName: "exportable", publicName: "exportable", 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 }, 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 }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", 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 } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange" }, 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 }], viewQueries: [{ propertyName: "tableRef", first: true, predicate: ["dt"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\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 class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\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 [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-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 font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\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-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\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 </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\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\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\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 (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-gray-700 dark:text-gray-100\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n {{ getProperty(row, col.key) | date: \"mediumDate\" }}\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(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 @case (\"status\") {\r\n @if (getEntityPreviewData(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 @case (\"entity\") {\r\n @if (getEntityColumnData(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 @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 class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\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)=\"rowPopover.toggle($event)\"\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 @for (\r\n action of getVisibleRowActions(row);\r\n track $index\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 </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\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 #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\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 <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]=\"false\"\r\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".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:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:3px solid var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{border-inline-start:none}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.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$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.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"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }, { 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: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3$1.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: TableFilter, selector: "mt-table-filter", inputs: ["columns", "data"], outputs: ["filterApplied", "filterReset"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i2.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: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: i3.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1124
1333
|
}
|
|
1125
1334
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Table, decorators: [{
|
|
1126
1335
|
type: Component,
|
|
@@ -1142,8 +1351,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
1142
1351
|
EntityPreview,
|
|
1143
1352
|
PopoverModule,
|
|
1144
1353
|
Icon,
|
|
1145
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\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 class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\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 [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-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 font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\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-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\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 </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\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\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\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 (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]=\"selectedRows().has(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-gray-700 dark:text-gray-100\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n {{ getProperty(row, col.key) | date: \"mediumDate\" }}\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(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 @case (\"status\") {\r\n @if (getEntityPreviewData(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 @case (\"entity\") {\r\n @if (getEntityColumnData(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 @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 class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\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)=\"rowPopover.toggle($event)\"\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 @for (\r\n action of getVisibleRowActions(row);\r\n track $index\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 </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\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 #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\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 <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]=\"false\"\r\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".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:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:3px solid var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{border-inline-start:none}\n"] }]
|
|
1146
|
-
}], 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"] }], 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 }] }], 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 }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", 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 }] }], emptyContent: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], tableRef: [{ type: i0.ViewChild, args: ['dt', { isSignal: true }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", 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"] }] } });
|
|
1354
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\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 class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\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 [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-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 font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\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-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\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 </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\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\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\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 (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-gray-700 dark:text-gray-100\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n {{ getProperty(row, col.key) | date: \"mediumDate\" }}\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(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 @case (\"status\") {\r\n @if (getEntityPreviewData(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 @case (\"entity\") {\r\n @if (getEntityColumnData(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 @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 class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\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)=\"rowPopover.toggle($event)\"\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 @for (\r\n action of getVisibleRowActions(row);\r\n track $index\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 </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\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 #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\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 <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]=\"false\"\r\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".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:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:3px solid var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{border-inline-start:none}\n"] }]
|
|
1355
|
+
}], 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"] }], 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 }] }], 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 }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", 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 }] }], emptyContent: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], tableRef: [{ type: i0.ViewChild, args: ['dt', { isSignal: true }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", 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"] }] } });
|
|
1147
1356
|
|
|
1148
1357
|
/**
|
|
1149
1358
|
* Generated bundle index. Do not edit.
|