@masterteam/client-components 0.0.104 → 0.0.106
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/client-components.css +1 -1
- package/fesm2022/masterteam-client-components-client-instance-preview.mjs +2 -2
- package/fesm2022/masterteam-client-components-client-instance-preview.mjs.map +1 -1
- package/fesm2022/masterteam-client-components-client-list.mjs +465 -29
- package/fesm2022/masterteam-client-components-client-list.mjs.map +1 -1
- package/package.json +6 -4
- package/types/masterteam-client-components-client-list.d.ts +19 -9
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import { MT_TABLE_RENDERER, TableExportService, TableValueResolver, Table, TableGroupingController, TableCaption } from '@masterteam/components/table';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable, signal, computed, untracked, input,
|
|
3
|
+
import { inject, Injectable, signal, computed, untracked, input, ChangeDetectionStrategy, Component, output, effect, viewChild } from '@angular/core';
|
|
3
4
|
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
5
6
|
import * as i4 from '@jsverse/transloco';
|
|
6
7
|
import { TranslocoService, TranslocoModule, TranslocoPipe } from '@jsverse/transloco';
|
|
7
8
|
import { Button } from '@masterteam/components/button';
|
|
8
9
|
import { provideEntityListTablePreview } from '@masterteam/components/business-fields';
|
|
9
10
|
import { RuntimeActionRunner, resolveActionLabel } from '@masterteam/components/runtime-action';
|
|
10
11
|
import { HttpClient } from '@angular/common/http';
|
|
11
|
-
import { switchMap, map, forkJoin, catchError,
|
|
12
|
+
import { switchMap, of, range, concatMap, reduce, map, forkJoin, catchError, shareReplay, Observable, share, take } from 'rxjs';
|
|
12
13
|
import { isSectionKey, mergeStakeholderNameEntities, resolveLocalizedLabel, readEntityValueColor, serializeEntityRawValue, EntitiesPreview } from '@masterteam/components/entities';
|
|
13
|
-
import {
|
|
14
|
+
import { applyGridViewState, captureGridViewState, AUTO_GROUP_COLUMN_ID, MtDataGridComponent } from '@masterteam/data-grid';
|
|
15
|
+
import { mtEntityExportValue, mtEntityColumn } from '@masterteam/data-table';
|
|
16
|
+
import { MtTableText, MtTablePreferences, mtTablePrintConfiguration } from '@masterteam/data-table/legacy';
|
|
17
|
+
import { ConfirmationService } from '@masterteam/components/confirmation';
|
|
18
|
+
import * as i3 from 'primeng/popover';
|
|
19
|
+
import { Popover, PopoverModule } from 'primeng/popover';
|
|
14
20
|
import * as i2 from 'primeng/skeleton';
|
|
15
21
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
16
22
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
@@ -18,10 +24,7 @@ import { Card } from '@masterteam/components/card';
|
|
|
18
24
|
import { EmptyState } from '@masterteam/components/empty-state';
|
|
19
25
|
import { Tooltip } from '@masterteam/components/tooltip';
|
|
20
26
|
import { Icon } from '@masterteam/icons';
|
|
21
|
-
import { ConfirmationService } from '@masterteam/components/confirmation';
|
|
22
27
|
import { MTDateFormatPipe, readableTextOn } from '@masterteam/components';
|
|
23
|
-
import * as i3 from 'primeng/popover';
|
|
24
|
-
import { PopoverModule } from 'primeng/popover';
|
|
25
28
|
import { DashboardViewer } from '@masterteam/dashboard-builder';
|
|
26
29
|
|
|
27
30
|
const CLIENT_LIST_RECORD_STATE_KEY = '__clientListRecordState';
|
|
@@ -48,6 +51,78 @@ class ClientListApiService {
|
|
|
48
51
|
informativeBaseUrl = 'LevelData';
|
|
49
52
|
/** Card layouts already read back, keyed by context. See {@link getCardLayout}. */
|
|
50
53
|
cardLayouts = new Map();
|
|
54
|
+
/** Native grids analyse a complete matching array; page boundaries must never change the result. */
|
|
55
|
+
getAllRows(contextKey, query, filters = [], hierarchy) {
|
|
56
|
+
return this.getRows(contextKey, { ...query, skip: 0, take: 500 }, filters, hierarchy).pipe(switchMap((first) => {
|
|
57
|
+
const page = first.response.data;
|
|
58
|
+
if (!page)
|
|
59
|
+
return of(first);
|
|
60
|
+
const total = page.pagination?.totalCount;
|
|
61
|
+
const size = page.pagination?.pageSize;
|
|
62
|
+
if (total == null || !size || size < 1)
|
|
63
|
+
throw new Error('The table response is missing its pagination contract.');
|
|
64
|
+
const records = [...(page.records ?? [])];
|
|
65
|
+
const seen = new Set(records.map((record) => record.id));
|
|
66
|
+
if (seen.size !== records.length)
|
|
67
|
+
throw new Error('The table response contains duplicate records.');
|
|
68
|
+
const groups = new Map((page.projectionMeta?.sourceGroups ?? []).map((group) => [
|
|
69
|
+
group.source.contextKey + ':' + group.source.levelDataId,
|
|
70
|
+
{ ...group, recordIds: [...group.recordIds] },
|
|
71
|
+
]));
|
|
72
|
+
const pages = Math.ceil(total / size);
|
|
73
|
+
return range(1, Math.max(0, pages - 1)).pipe(concatMap((index) => this.getRows(contextKey, { ...query, skip: index * size, take: size }, filters, hierarchy)), reduce((result, next) => {
|
|
74
|
+
const data = next.response.data;
|
|
75
|
+
if (!data ||
|
|
76
|
+
data.pagination?.totalCount !== total ||
|
|
77
|
+
data.pagination.pageSize !== size)
|
|
78
|
+
throw new Error('The table changed while loading. Refresh to try again.');
|
|
79
|
+
for (const group of data.projectionMeta?.sourceGroups ?? []) {
|
|
80
|
+
const key = group.source.contextKey + ':' + group.source.levelDataId;
|
|
81
|
+
const existing = groups.get(key);
|
|
82
|
+
groups.set(key, {
|
|
83
|
+
...group,
|
|
84
|
+
recordIds: [
|
|
85
|
+
...new Set([
|
|
86
|
+
...(existing?.recordIds ?? []),
|
|
87
|
+
...group.recordIds,
|
|
88
|
+
]),
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
for (const record of data.records ?? []) {
|
|
93
|
+
if (seen.has(record.id))
|
|
94
|
+
throw new Error('The table response contains overlapping pages.');
|
|
95
|
+
seen.add(record.id);
|
|
96
|
+
records.push(record);
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}, first), map((result) => {
|
|
100
|
+
if (records.length !== total)
|
|
101
|
+
throw new Error('The table result is incomplete. Refresh to try again.');
|
|
102
|
+
return {
|
|
103
|
+
...result,
|
|
104
|
+
response: {
|
|
105
|
+
...result.response,
|
|
106
|
+
data: {
|
|
107
|
+
...page,
|
|
108
|
+
records,
|
|
109
|
+
projectionMeta: page.projectionMeta
|
|
110
|
+
? {
|
|
111
|
+
...page.projectionMeta,
|
|
112
|
+
sourceGroups: [...groups.values()],
|
|
113
|
+
}
|
|
114
|
+
: undefined,
|
|
115
|
+
pagination: {
|
|
116
|
+
page: 1,
|
|
117
|
+
pageSize: records.length || size,
|
|
118
|
+
totalCount: total,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}));
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
51
126
|
/**
|
|
52
127
|
* Fetches a table page. Resolves to the response **and** the `propertyKeys`
|
|
53
128
|
* the request carried, because a write that wants its record projected the
|
|
@@ -268,12 +343,9 @@ class ClientListApiService {
|
|
|
268
343
|
}
|
|
269
344
|
toEffectiveColumnKeys(columns) {
|
|
270
345
|
const keys = (columns ?? [])
|
|
271
|
-
.filter((column) =>
|
|
272
|
-
.sort((a, b) =>
|
|
273
|
-
(
|
|
274
|
-
.map((column) => typeof column === 'string'
|
|
275
|
-
? column
|
|
276
|
-
: (column.key ?? column.propertyKey ?? ''))
|
|
346
|
+
.filter((column) => column.isVisible)
|
|
347
|
+
.sort((a, b) => a.order - b.order)
|
|
348
|
+
.map((column) => column.columnKey)
|
|
277
349
|
.filter((key) => key.length > 0);
|
|
278
350
|
return keys.length ? keys : undefined;
|
|
279
351
|
}
|
|
@@ -578,7 +650,7 @@ class ClientListStateService {
|
|
|
578
650
|
},
|
|
579
651
|
});
|
|
580
652
|
}
|
|
581
|
-
setRowsResult(key, response, config, skip, take) {
|
|
653
|
+
setRowsResult(key, response, config, skip, take, complete = false) {
|
|
582
654
|
const target = this.itemsByKey()[key];
|
|
583
655
|
if (!target ||
|
|
584
656
|
target.type === 'informative' ||
|
|
@@ -654,6 +726,7 @@ class ClientListStateService {
|
|
|
654
726
|
skip,
|
|
655
727
|
take,
|
|
656
728
|
totalCount,
|
|
729
|
+
complete,
|
|
657
730
|
error: null,
|
|
658
731
|
rawData: response,
|
|
659
732
|
},
|
|
@@ -812,6 +885,7 @@ class ClientListStateService {
|
|
|
812
885
|
// Keep the page the size the paginator promises — the row pushed off
|
|
813
886
|
// the end now lives on the next page.
|
|
814
887
|
if (config.isPaginated &&
|
|
888
|
+
!target.complete &&
|
|
815
889
|
target.take > 0 &&
|
|
816
890
|
records.length > target.take) {
|
|
817
891
|
records.length = target.take;
|
|
@@ -1495,9 +1569,367 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1495
1569
|
args: [{ providedIn: 'root' }]
|
|
1496
1570
|
}] });
|
|
1497
1571
|
|
|
1572
|
+
/** Operations remain owned by ClientList; the grid only hosts this ordinary cell renderer. */
|
|
1573
|
+
class ClientListActionsCell {
|
|
1574
|
+
params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
|
|
1575
|
+
confirmation = inject(ConfirmationService);
|
|
1576
|
+
label = computed(() => String(this.params()['label']), ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1577
|
+
actions = computed(() => {
|
|
1578
|
+
const { data, node } = this.params();
|
|
1579
|
+
return data && !node.group && !node.footer
|
|
1580
|
+
? this.params()['actions'].filter((action) => !action.hidden?.(data))
|
|
1581
|
+
: [];
|
|
1582
|
+
}, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
1583
|
+
inline = computed(() => this.actions().filter((action) => this.params()['shape'] !== 'popover' || action.placement === 'inline'), ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
|
|
1584
|
+
menu = computed(() => this.actions().filter((action) => this.params()['shape'] === 'popover' && action.placement !== 'inline'), ...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
|
|
1585
|
+
hasMenu = computed(() => !this.params().node.group &&
|
|
1586
|
+
!this.params().node.footer &&
|
|
1587
|
+
this.params()['shape'] === 'popover' &&
|
|
1588
|
+
(!!this.params()['requestActions'] || this.menu().length > 0), ...(ngDevMode ? [{ debugName: "hasMenu" }] : /* istanbul ignore next */ []));
|
|
1589
|
+
loading() {
|
|
1590
|
+
return (this.params()['loading']?.(this.params().data) ?? false);
|
|
1591
|
+
}
|
|
1592
|
+
busy(action) {
|
|
1593
|
+
return typeof action.loading === 'function'
|
|
1594
|
+
? action.loading(this.params().data)
|
|
1595
|
+
: !!action.loading;
|
|
1596
|
+
}
|
|
1597
|
+
open(event, popover) {
|
|
1598
|
+
this.params()['requestActions']?.(this.params().data);
|
|
1599
|
+
popover.toggle(event);
|
|
1600
|
+
}
|
|
1601
|
+
run(action, event) {
|
|
1602
|
+
const row = this.params().data;
|
|
1603
|
+
if (action.hidden?.(row) || this.busy(action) || this.loading())
|
|
1604
|
+
return;
|
|
1605
|
+
const accept = () => {
|
|
1606
|
+
if (!action.hidden?.(row) && !this.busy(action) && !this.loading())
|
|
1607
|
+
action.action(row);
|
|
1608
|
+
};
|
|
1609
|
+
if (!action.confirmation) {
|
|
1610
|
+
accept();
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
const config = { ...action.confirmation, event, accept };
|
|
1614
|
+
if (action.confirmation.confirmationType === 'delete')
|
|
1615
|
+
this.confirmation.confirmDelete(config);
|
|
1616
|
+
else
|
|
1617
|
+
this.confirmation.confirm(config);
|
|
1618
|
+
}
|
|
1619
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListActionsCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1620
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListActionsCell, isStandalone: true, selector: "mt-client-list-actions-cell", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "pointerdown": "$event.stopPropagation()" } }, ngImport: i0, template: `
|
|
1621
|
+
@for (action of inline(); track $index) {
|
|
1622
|
+
<mt-button
|
|
1623
|
+
[icon]="action.icon"
|
|
1624
|
+
[label]="action.label"
|
|
1625
|
+
[ariaLabel]="action.tooltip || action.label || label()"
|
|
1626
|
+
[tooltip]="action.tooltip"
|
|
1627
|
+
[severity]="action.color || 'secondary'"
|
|
1628
|
+
[variant]="action.variant || 'text'"
|
|
1629
|
+
size="small"
|
|
1630
|
+
[loading]="busy(action)"
|
|
1631
|
+
(click)="run(action, $event)"
|
|
1632
|
+
/>
|
|
1633
|
+
}
|
|
1634
|
+
@if (hasMenu()) {
|
|
1635
|
+
<mt-button
|
|
1636
|
+
icon="general.dots-vertical"
|
|
1637
|
+
severity="secondary"
|
|
1638
|
+
variant="text"
|
|
1639
|
+
size="small"
|
|
1640
|
+
[ariaLabel]="label()"
|
|
1641
|
+
(click)="open($event, popover)"
|
|
1642
|
+
/>
|
|
1643
|
+
<p-popover #popover appendTo="body">
|
|
1644
|
+
<div class="flex min-w-40 flex-col gap-1" [attr.aria-label]="label()">
|
|
1645
|
+
@if (loading()) {
|
|
1646
|
+
<span role="status" class="p-2">{{
|
|
1647
|
+
params()['loadingLabel']
|
|
1648
|
+
}}</span>
|
|
1649
|
+
} @else {
|
|
1650
|
+
@for (action of menu(); track $index) {
|
|
1651
|
+
<mt-button
|
|
1652
|
+
[icon]="action.icon"
|
|
1653
|
+
[label]="action.label || action.tooltip"
|
|
1654
|
+
[severity]="action.color || 'secondary'"
|
|
1655
|
+
variant="text"
|
|
1656
|
+
size="small"
|
|
1657
|
+
[loading]="busy(action)"
|
|
1658
|
+
(click)="run(action, $event); popover.hide()"
|
|
1659
|
+
/>
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
</div>
|
|
1663
|
+
</p-popover>
|
|
1664
|
+
}
|
|
1665
|
+
`, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:center;gap:4px;height:100%}\n"], dependencies: [{ kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1666
|
+
}
|
|
1667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListActionsCell, decorators: [{
|
|
1668
|
+
type: Component,
|
|
1669
|
+
args: [{ selector: 'mt-client-list-actions-cell', imports: [Button, Popover], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1670
|
+
'(click)': '$event.stopPropagation()',
|
|
1671
|
+
'(pointerdown)': '$event.stopPropagation()',
|
|
1672
|
+
}, template: `
|
|
1673
|
+
@for (action of inline(); track $index) {
|
|
1674
|
+
<mt-button
|
|
1675
|
+
[icon]="action.icon"
|
|
1676
|
+
[label]="action.label"
|
|
1677
|
+
[ariaLabel]="action.tooltip || action.label || label()"
|
|
1678
|
+
[tooltip]="action.tooltip"
|
|
1679
|
+
[severity]="action.color || 'secondary'"
|
|
1680
|
+
[variant]="action.variant || 'text'"
|
|
1681
|
+
size="small"
|
|
1682
|
+
[loading]="busy(action)"
|
|
1683
|
+
(click)="run(action, $event)"
|
|
1684
|
+
/>
|
|
1685
|
+
}
|
|
1686
|
+
@if (hasMenu()) {
|
|
1687
|
+
<mt-button
|
|
1688
|
+
icon="general.dots-vertical"
|
|
1689
|
+
severity="secondary"
|
|
1690
|
+
variant="text"
|
|
1691
|
+
size="small"
|
|
1692
|
+
[ariaLabel]="label()"
|
|
1693
|
+
(click)="open($event, popover)"
|
|
1694
|
+
/>
|
|
1695
|
+
<p-popover #popover appendTo="body">
|
|
1696
|
+
<div class="flex min-w-40 flex-col gap-1" [attr.aria-label]="label()">
|
|
1697
|
+
@if (loading()) {
|
|
1698
|
+
<span role="status" class="p-2">{{
|
|
1699
|
+
params()['loadingLabel']
|
|
1700
|
+
}}</span>
|
|
1701
|
+
} @else {
|
|
1702
|
+
@for (action of menu(); track $index) {
|
|
1703
|
+
<mt-button
|
|
1704
|
+
[icon]="action.icon"
|
|
1705
|
+
[label]="action.label || action.tooltip"
|
|
1706
|
+
[severity]="action.color || 'secondary'"
|
|
1707
|
+
variant="text"
|
|
1708
|
+
size="small"
|
|
1709
|
+
[loading]="busy(action)"
|
|
1710
|
+
(click)="run(action, $event); popover.hide()"
|
|
1711
|
+
/>
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
</div>
|
|
1715
|
+
</p-popover>
|
|
1716
|
+
}
|
|
1717
|
+
`, styles: [":host{display:flex;align-items:center;justify-content:center;gap:4px;height:100%}\n"] }]
|
|
1718
|
+
}], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
|
|
1719
|
+
|
|
1720
|
+
class ClientListTemplateCell {
|
|
1721
|
+
params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
|
|
1722
|
+
template() {
|
|
1723
|
+
return this.params()['template'];
|
|
1724
|
+
}
|
|
1725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListTemplateCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1726
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListTemplateCell, isStandalone: true, selector: "mt-client-list-template-cell", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `@if (!params().node.group && !params().node.footer) {
|
|
1727
|
+
<ng-container
|
|
1728
|
+
[ngTemplateOutlet]="template()"
|
|
1729
|
+
[ngTemplateOutletContext]="{ $implicit: params().data }"
|
|
1730
|
+
/>
|
|
1731
|
+
} @else {
|
|
1732
|
+
{{ params().valueFormatted }}
|
|
1733
|
+
}`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1734
|
+
}
|
|
1735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListTemplateCell, decorators: [{
|
|
1736
|
+
type: Component,
|
|
1737
|
+
args: [{
|
|
1738
|
+
selector: 'mt-client-list-template-cell',
|
|
1739
|
+
imports: [NgTemplateOutlet],
|
|
1740
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1741
|
+
template: `@if (!params().node.group && !params().node.footer) {
|
|
1742
|
+
<ng-container
|
|
1743
|
+
[ngTemplateOutlet]="template()"
|
|
1744
|
+
[ngTemplateOutletContext]="{ $implicit: params().data }"
|
|
1745
|
+
/>
|
|
1746
|
+
} @else {
|
|
1747
|
+
{{ params().valueFormatted }}
|
|
1748
|
+
}`,
|
|
1749
|
+
}]
|
|
1750
|
+
}], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
|
|
1751
|
+
|
|
1498
1752
|
const DEFAULT_GRID_COLUMNS$2 = 12;
|
|
1499
1753
|
class ClientListTableView {
|
|
1500
1754
|
toolbar = inject(ClientListToolbarService);
|
|
1755
|
+
nativeGrid = inject(MT_TABLE_RENDERER, { optional: true }) !== null;
|
|
1756
|
+
text = inject(MtTableText);
|
|
1757
|
+
preferences = inject(MtTablePreferences);
|
|
1758
|
+
printService = inject(TableExportService);
|
|
1759
|
+
nativeGridReady = output();
|
|
1760
|
+
ready = signal(null, ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
1761
|
+
hydrated;
|
|
1762
|
+
restoring = false;
|
|
1763
|
+
rowId = (row) => String(row['Id']);
|
|
1764
|
+
exportParams = {
|
|
1765
|
+
processCellCallback: (mtEntityExportValue),
|
|
1766
|
+
};
|
|
1767
|
+
statusBar = {
|
|
1768
|
+
panels: ['selectedRowCount', 'aggregation'],
|
|
1769
|
+
};
|
|
1770
|
+
columns = computed(() => {
|
|
1771
|
+
const rows = this.table().rows;
|
|
1772
|
+
const columns = this.table().columns.map((column) => {
|
|
1773
|
+
const base = {
|
|
1774
|
+
colId: column.key,
|
|
1775
|
+
headerName: column.label,
|
|
1776
|
+
width: column.width ? parseFloat(column.width) : 220,
|
|
1777
|
+
minWidth: 100,
|
|
1778
|
+
sortable: column.sortable !== false,
|
|
1779
|
+
};
|
|
1780
|
+
if (column.customCellTpl)
|
|
1781
|
+
return {
|
|
1782
|
+
...base,
|
|
1783
|
+
cellRenderer: ClientListTemplateCell,
|
|
1784
|
+
cellRendererParams: { template: column.customCellTpl },
|
|
1785
|
+
valueGetter: ({ data }) => column.exportValue
|
|
1786
|
+
? column.exportValue(data)
|
|
1787
|
+
: TableValueResolver.getProperty(data, column.key),
|
|
1788
|
+
filter: 'text',
|
|
1789
|
+
enableRowGroup: true,
|
|
1790
|
+
};
|
|
1791
|
+
return mtEntityColumn({
|
|
1792
|
+
...base,
|
|
1793
|
+
viewType: (column.viewType ??
|
|
1794
|
+
rows[0]?.[column.key]?.viewType ??
|
|
1795
|
+
'Text'),
|
|
1796
|
+
entity: (row) => row[column.key],
|
|
1797
|
+
});
|
|
1798
|
+
});
|
|
1799
|
+
if (this.rowActions().length || this.rowActionsLoadingFn())
|
|
1800
|
+
columns.push({
|
|
1801
|
+
colId: '$actions',
|
|
1802
|
+
headerName: this.text.text('actions'),
|
|
1803
|
+
width: 100,
|
|
1804
|
+
minWidth: 100,
|
|
1805
|
+
maxWidth: 100,
|
|
1806
|
+
suppressSizeToFit: true,
|
|
1807
|
+
resizable: false,
|
|
1808
|
+
pinned: this.text.language().startsWith('ar') ? 'left' : 'right',
|
|
1809
|
+
lockPinned: true,
|
|
1810
|
+
lockVisible: true,
|
|
1811
|
+
sortable: false,
|
|
1812
|
+
suppressHeaderMenuButton: true,
|
|
1813
|
+
excludeFromQuickFilter: true,
|
|
1814
|
+
cellRenderer: ClientListActionsCell,
|
|
1815
|
+
cellRendererParams: {
|
|
1816
|
+
actions: this.rowActions(),
|
|
1817
|
+
shape: this.actionShape(),
|
|
1818
|
+
loading: this.rowActionsLoadingFn(),
|
|
1819
|
+
label: this.text.text('actions'),
|
|
1820
|
+
loadingLabel: this.text.text('loading'),
|
|
1821
|
+
requestActions: this.rowActionsLoadingFn()
|
|
1822
|
+
? (row) => this.rowActionsRequested.emit(row)
|
|
1823
|
+
: undefined,
|
|
1824
|
+
},
|
|
1825
|
+
});
|
|
1826
|
+
return columns;
|
|
1827
|
+
}, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1828
|
+
view() {
|
|
1829
|
+
return {
|
|
1830
|
+
level: this.tableStorageKey() ?? this.state().key,
|
|
1831
|
+
role: 'client-list-native',
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
constructor() {
|
|
1835
|
+
effect(() => {
|
|
1836
|
+
const api = this.ready(), view = this.view(), key = this.preferences.key(view);
|
|
1837
|
+
const stamp = JSON.stringify([
|
|
1838
|
+
key,
|
|
1839
|
+
this.table().columns.map((column) => column.key),
|
|
1840
|
+
]);
|
|
1841
|
+
if (!api || !this.table().columns.length || stamp === this.hydrated)
|
|
1842
|
+
return;
|
|
1843
|
+
untracked(() => {
|
|
1844
|
+
this.restoring = true;
|
|
1845
|
+
try {
|
|
1846
|
+
const saved = this.preferences.read(view);
|
|
1847
|
+
if (saved)
|
|
1848
|
+
applyGridViewState(api, saved);
|
|
1849
|
+
else {
|
|
1850
|
+
const group = this.bucket().groupBy();
|
|
1851
|
+
if (group)
|
|
1852
|
+
api.setRowGroupColumns([group]);
|
|
1853
|
+
const field = this.bucket().sortField(), sort = this.bucket().sortDirection();
|
|
1854
|
+
if (field && sort)
|
|
1855
|
+
api.setSortModel([{ colId: field, sort }]);
|
|
1856
|
+
}
|
|
1857
|
+
this.hydrated = stamp;
|
|
1858
|
+
}
|
|
1859
|
+
finally {
|
|
1860
|
+
this.restoring = false;
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
onReady(event) {
|
|
1866
|
+
this.ready.set(event.api);
|
|
1867
|
+
this.nativeGridReady.emit(event);
|
|
1868
|
+
}
|
|
1869
|
+
changed() {
|
|
1870
|
+
const api = this.ready();
|
|
1871
|
+
if (!api || this.restoring)
|
|
1872
|
+
return;
|
|
1873
|
+
this.bucket().filterTerm.set(api.getQuickFilter() ?? '');
|
|
1874
|
+
this.bucket().groupBy.set(api.getRowGroupColumns()[0] ?? null);
|
|
1875
|
+
const sort = api.getSortModel()[0];
|
|
1876
|
+
this.bucket().sortField.set(sort?.colId ?? null);
|
|
1877
|
+
this.bucket().sortDirection.set(sort?.sort ?? null);
|
|
1878
|
+
if (this.hydrated) {
|
|
1879
|
+
const state = captureGridViewState(api), exclude = this.table().config.table.persistStateExclude;
|
|
1880
|
+
this.preferences.write(this.view(), {
|
|
1881
|
+
...state,
|
|
1882
|
+
sort: exclude.includes('sort') ? [] : state.sort,
|
|
1883
|
+
rowGroups: exclude.includes('groupBy') ? [] : state.rowGroups,
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
contextMenu = (params) => {
|
|
1888
|
+
const columns = [
|
|
1889
|
+
...(params.api.getRowGroupColumns().length ? [AUTO_GROUP_COLUMN_ID] : []),
|
|
1890
|
+
...(params.api.getPivotResultColumns().length
|
|
1891
|
+
? params.api.getPivotResultColumns()
|
|
1892
|
+
: params.api
|
|
1893
|
+
.getColumnState()
|
|
1894
|
+
.filter((column) => !column.hide && column.colId !== '$actions')
|
|
1895
|
+
.map((column) => column.colId)),
|
|
1896
|
+
];
|
|
1897
|
+
return params.defaultItems.flatMap((item) => item !== 'export'
|
|
1898
|
+
? [item]
|
|
1899
|
+
: this.table().config.table.exportable
|
|
1900
|
+
? [
|
|
1901
|
+
{
|
|
1902
|
+
name: this.text.text('export'),
|
|
1903
|
+
icon: 'export',
|
|
1904
|
+
subMenu: [
|
|
1905
|
+
{
|
|
1906
|
+
name: this.text.text('csv'),
|
|
1907
|
+
icon: 'csv',
|
|
1908
|
+
action: () => params.api.exportDataAsCsv({
|
|
1909
|
+
...this.exportParams,
|
|
1910
|
+
columnKeys: columns,
|
|
1911
|
+
}),
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
name: this.text.text('excel'),
|
|
1915
|
+
icon: 'excel',
|
|
1916
|
+
action: () => {
|
|
1917
|
+
void params.api.exportDataAsExcel({
|
|
1918
|
+
...this.exportParams,
|
|
1919
|
+
columnKeys: columns,
|
|
1920
|
+
});
|
|
1921
|
+
},
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
name: this.text.text('pdf'),
|
|
1925
|
+
icon: 'pdf',
|
|
1926
|
+
action: () => this.printService.printPdf(mtTablePrintConfiguration(params.api, this.columns().filter((column) => column.colId !== '$actions'), this.table().title)),
|
|
1927
|
+
},
|
|
1928
|
+
],
|
|
1929
|
+
},
|
|
1930
|
+
]
|
|
1931
|
+
: []);
|
|
1932
|
+
};
|
|
1501
1933
|
state = input.required(...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
1502
1934
|
rowActions = input([], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
|
|
1503
1935
|
actionShape = input(undefined, ...(ngDevMode ? [{ debugName: "actionShape" }] : /* istanbul ignore next */ []));
|
|
@@ -1557,12 +1989,12 @@ class ClientListTableView {
|
|
|
1557
1989
|
};
|
|
1558
1990
|
}
|
|
1559
1991
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListTableView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1560
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListTableView, isStandalone: true, selector: "mt-client-list-table-view", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { lazyLoad: "lazyLoad", rowClick: "rowClick", rowActionsRequested: "rowActionsRequested" }, ngImport: i0, template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n @if (table().config.contentStart) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.startSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentStart\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.tableSpan)\">\r\n @if (table().loading && table().rows.length === 0) {\r\n <div class=\"flex flex-col gap-3 py-3\">\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n </div>\r\n } @else if (table().error) {\r\n <div\r\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ table().error }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"table().rows\"\r\n [columns]=\"table().columns\"\r\n dataKey=\"Id\"\r\n [storageKey]=\"tableStorageKey()\"\r\n [persistStateExclude]=\"table().config.table.persistStateExclude\"\r\n [captionStartTemplate]=\"table().config.toolbarStart ?? null\"\r\n [captionEndTemplate]=\"table().config.toolbarEnd ?? null\"\r\n [rowActions]=\"rowActions()\"\r\n [actionShape]=\"actionShape()\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFn()\"\r\n (rowActionsRequested)=\"rowActionsRequested.emit($event)\"\r\n [generalSearch]=\"table().config.table.searchable\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [cellClickFilter]=\"true\"\r\n [freezeActions]=\"true\"\r\n [exportable]=\"table().config.table.exportable\"\r\n [loading]=\"table().loading\"\r\n [clickableRows]=\"true\"\r\n [lazy]=\"table().config.isPaginated\"\r\n [lazyTotalRecords]=\"table().totalCount\"\r\n [virtualScroll]=\"!table().config.isPaginated\"\r\n [virtualScrollItemSize]=\"56\"\r\n scrollHeight=\"520px\"\r\n [pageSize]=\"pageSize()\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [sortField]=\"bucket().sortField()\"\r\n (sortFieldChange)=\"bucket().sortField.set($event)\"\r\n [sortDirection]=\"bucket().sortDirection()\"\r\n (sortDirectionChange)=\"bucket().sortDirection.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (lazyLoad)=\"lazyLoad.emit($event)\"\r\n (rowClick)=\"rowClick.emit($event)\"\r\n />\r\n }\r\n </div>\r\n\r\n @if (table().config.contentEnd) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.endSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
1992
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListTableView, isStandalone: true, selector: "mt-client-list-table-view", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nativeGridReady: "nativeGridReady", lazyLoad: "lazyLoad", rowClick: "rowClick", rowActionsRequested: "rowActionsRequested" }, ngImport: i0, template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n @if (table().config.contentStart) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.startSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentStart\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.tableSpan)\">\r\n @if (!nativeGrid && table().loading && table().rows.length === 0) {\r\n <div class=\"flex flex-col gap-3 py-3\">\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n </div>\r\n } @else if (table().error) {\r\n <div\r\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ table().error }}\r\n </div>\r\n } @else {\r\n @if (nativeGrid) {\r\n @if (table().config.toolbarStart || table().config.toolbarEnd) {\r\n <div class=\"mb-3 flex flex-wrap items-center justify-between gap-3\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.toolbarStart ?? null\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.toolbarEnd ?? null\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n <mt-data-grid\r\n [rowData]=\"table().rows\"\r\n [columnDefs]=\"columns()\"\r\n [autoSizeStrategy]=\"{ type: 'fitGridWidth' }\"\r\n groupDisplayType=\"groupRows\"\r\n paginationPanelShow=\"whenNeeded\"\r\n [getRowId]=\"rowId\"\r\n [height]=\"520\"\r\n [rowHeight]=\"52\"\r\n [ariaLabel]=\"table().title\"\r\n [loading]=\"table().loading\"\r\n [direction]=\"text.language().startsWith('ar') ? 'rtl' : 'ltr'\"\r\n [localeText]=\"text.gridLocale()\"\r\n [quickFilterText]=\"bucket().filterTerm()\"\r\n [showQuickFilter]=\"table().config.table.searchable\"\r\n rowGroupPanelShow=\"always\"\r\n pivotPanelShow=\"never\"\r\n [sideBar]=\"{\r\n toolPanels: ['columns', 'filters'],\r\n position: text.language().startsWith('ar') ? 'left' : 'right',\r\n }\"\r\n [cellSelection]=\"true\"\r\n [enableCharts]=\"true\"\r\n [suppressCutToClipboard]=\"true\"\r\n [pagination]=\"table().config.isPaginated\"\r\n [paginationPageSize]=\"pageSize()\"\r\n [statusBar]=\"statusBar\"\r\n [suppressPdfExport]=\"true\"\r\n [getContextMenuItems]=\"contextMenu\"\r\n [defaultCsvExportParams]=\"exportParams\"\r\n [defaultExcelExportParams]=\"exportParams\"\r\n (gridReady)=\"onReady($event)\"\r\n (filterChanged)=\"changed()\"\r\n (sortChanged)=\"changed()\"\r\n (columnVisible)=\"changed()\"\r\n (columnMoved)=\"changed()\"\r\n (columnPinned)=\"changed()\"\r\n (columnResized)=\"$event.finished && changed()\"\r\n (columnRowGroupChanged)=\"changed()\"\r\n (columnValueChanged)=\"changed()\"\r\n (columnPivotChanged)=\"changed()\"\r\n (rowClicked)=\"\r\n !$event.node.group &&\r\n !$event.node.footer &&\r\n $event.node.data &&\r\n rowClick.emit($event.node.data)\r\n \"\r\n />\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"table().rows\"\r\n [columns]=\"table().columns\"\r\n dataKey=\"Id\"\r\n [storageKey]=\"tableStorageKey()\"\r\n [persistStateExclude]=\"table().config.table.persistStateExclude\"\r\n [captionStartTemplate]=\"table().config.toolbarStart ?? null\"\r\n [captionEndTemplate]=\"table().config.toolbarEnd ?? null\"\r\n [rowActions]=\"rowActions()\"\r\n [actionShape]=\"actionShape() ?? 'flat'\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFn()\"\r\n (rowActionsRequested)=\"rowActionsRequested.emit($event)\"\r\n [generalSearch]=\"table().config.table.searchable\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [cellClickFilter]=\"true\"\r\n [freezeActions]=\"true\"\r\n [exportable]=\"table().config.table.exportable\"\r\n [loading]=\"table().loading\"\r\n [clickableRows]=\"true\"\r\n [lazy]=\"table().config.isPaginated\"\r\n [lazyTotalRecords]=\"table().totalCount\"\r\n [virtualScroll]=\"!table().config.isPaginated\"\r\n [virtualScrollItemSize]=\"56\"\r\n scrollHeight=\"520px\"\r\n [pageSize]=\"pageSize()\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [sortField]=\"bucket().sortField()\"\r\n (sortFieldChange)=\"bucket().sortField.set($event)\"\r\n [sortDirection]=\"bucket().sortDirection()\"\r\n (sortDirectionChange)=\"bucket().sortDirection.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (lazyLoad)=\"lazyLoad.emit($event)\"\r\n (rowClick)=\"rowClick.emit($event)\"\r\n />\r\n }\r\n }\r\n </div>\r\n\r\n @if (table().config.contentEnd) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.endSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showHeader", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "groupHeaderTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: MtDataGridComponent, selector: "mt-data-grid", inputs: ["rowData", "dataProcessing", "columnDefs", "getRowId", "height", "autoHeight", "autoHeightMaxRows", "autoHeightMinRows", "rowHeight", "animateRows", "headerHeight", "groupHeaderHeight", "direction", "localeText", "localeTextResolver", "ariaLabel", "loading", "noRowsText", "loadingText", "noRowsTemplate", "autoSizeStrategy", "columnMenu", "mainMenuItems", "autoSizePadding", "quickFilterText", "showQuickFilter", "includeHiddenColumnsInQuickFilter", "quickFilterParser", "quickFilterMatcher", "cacheQuickFilter", "applyQuickFilterBeforePivotOrAgg", "filtersToolPanelDef", "isExternalFilterPresent", "doesExternalFilterPass", "floatingFiltersHeight", "rowSelection", "selectionColumnDef", "rowNumbers", "rowDragManaged", "rowDragEntireRow", "rowDragMultiRow", "suppressMoveWhenRowDragging", "cellSelection", "statusBar", "suppressContextMenu", "allowContextMenuWithControlKey", "preventDefaultOnContextMenu", "getContextMenuItems", "suppressCsvExport", "suppressExcelExport", "suppressPdfExport", "defaultPdfExportParams", "excelStyles", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "copySelectedRows", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressCutToClipboard", "defaultCsvExportParams", "defaultExcelExportParams", "groupDisplayType", "groupRowRenderer", "groupRowRendererParams", "suppressGroupRowsSticky", "groupHideOpenParents", "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "showOpenedGroup", "groupAggFiltering", "suppressAggFilteredOnly", "aggregateOnlyChangedColumns", "suppressColumnMoveAnimation", "pivotRowTotals", "pivotColumnGroupTotals", "pivotMaxGeneratedColumns", "pivotDefaultExpanded", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "processPivotResultColDef", "processPivotResultColGroupDef", "processUnpinnedColumns", "rowGroupPanelShow", "pivotPanelShow", "pivotPanelHint", "groupDefaultExpanded", "autoGroupColumnDef", "groupTotalRow", "grandTotalRow", "aggFuncs", "suppressRowGroupHidesColumns", "suppressMakeColumnVisibleAfterUnGroup", "sideBar", "pivotMode", "suppressAggFuncInHeader", "enableCharts", "chartThemes", "customChartThemes", "chartToolPanelsDef", "chartThemeOverrides", "chartContext", "chartRecordsLabel", "getChartToolbarItems", "groupMaintainOrder", "treeData", "getDataPath", "masterDetail", "isRowMaster", "detailCellRenderer", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "singleClickEdit", "suppressClickEdit", "stopEditingWhenCellsLoseFocus", "undoRedoCellEditing", "undoRedoCellEditingLimit", "pagination", "paginationPanelShow", "paginationPageSize", "paginationTotalRows", "paginationCurrentPage", "paginationPageSizeSelector", "rowGroupPanelSuppressSort"], outputs: ["displayedColumnsChanged", "columnEverythingChanged", "pivotMaxColumnsExceeded", "gridReady", "sortChanged", "cellFocused", "columnResized", "columnMoved", "columnPinned", "columnVisible", "columnGroupOpened", "filterChanged", "filterModified", "filterOpened", "rowSelected", "selectionChanged", "rowClicked", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "cellSelectionChanged", "contextMenuVisibleChanged", "rowGroupOpened", "columnRowGroupChanged", "expandOrCollapseAll", "cellEditingStarted", "cellEditingStopped", "cellValueChanged", "pasteStart", "pasteEnd", "fillStart", "fillEnd", "paginationChanged", "toolPanelVisibleChanged", "toolPanelSizeChanged", "columnValueChanged", "columnPivotChanged", "columnPivotModeChanged", "chartCreated", "chartDestroyed", "chartRangeSelectionChanged", "chartOptionsChanged"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
1561
1993
|
}
|
|
1562
1994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListTableView, decorators: [{
|
|
1563
1995
|
type: Component,
|
|
1564
|
-
args: [{ selector: 'mt-client-list-table-view', standalone: true, imports: [CommonModule, Table, SkeletonModule], template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n @if (table().config.contentStart) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.startSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentStart\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.tableSpan)\">\r\n @if (table().loading && table().rows.length === 0) {\r\n <div class=\"flex flex-col gap-3 py-3\">\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n </div>\r\n } @else if (table().error) {\r\n <div\r\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ table().error }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n
|
|
1565
|
-
}], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", required: false }] }], rowActionsLoadingFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActionsLoadingFn", required: false }] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowActionsRequested: [{ type: i0.Output, args: ["rowActionsRequested"] }] } });
|
|
1996
|
+
args: [{ selector: 'mt-client-list-table-view', standalone: true, imports: [CommonModule, Table, MtDataGridComponent, SkeletonModule], template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n @if (table().config.contentStart) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.startSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentStart\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.tableSpan)\">\r\n @if (!nativeGrid && table().loading && table().rows.length === 0) {\r\n <div class=\"flex flex-col gap-3 py-3\">\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n <p-skeleton height=\"3rem\" />\r\n </div>\r\n } @else if (table().error) {\r\n <div\r\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ table().error }}\r\n </div>\r\n } @else {\r\n @if (nativeGrid) {\r\n @if (table().config.toolbarStart || table().config.toolbarEnd) {\r\n <div class=\"mb-3 flex flex-wrap items-center justify-between gap-3\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.toolbarStart ?? null\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.toolbarEnd ?? null\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n <mt-data-grid\r\n [rowData]=\"table().rows\"\r\n [columnDefs]=\"columns()\"\r\n [autoSizeStrategy]=\"{ type: 'fitGridWidth' }\"\r\n groupDisplayType=\"groupRows\"\r\n paginationPanelShow=\"whenNeeded\"\r\n [getRowId]=\"rowId\"\r\n [height]=\"520\"\r\n [rowHeight]=\"52\"\r\n [ariaLabel]=\"table().title\"\r\n [loading]=\"table().loading\"\r\n [direction]=\"text.language().startsWith('ar') ? 'rtl' : 'ltr'\"\r\n [localeText]=\"text.gridLocale()\"\r\n [quickFilterText]=\"bucket().filterTerm()\"\r\n [showQuickFilter]=\"table().config.table.searchable\"\r\n rowGroupPanelShow=\"always\"\r\n pivotPanelShow=\"never\"\r\n [sideBar]=\"{\r\n toolPanels: ['columns', 'filters'],\r\n position: text.language().startsWith('ar') ? 'left' : 'right',\r\n }\"\r\n [cellSelection]=\"true\"\r\n [enableCharts]=\"true\"\r\n [suppressCutToClipboard]=\"true\"\r\n [pagination]=\"table().config.isPaginated\"\r\n [paginationPageSize]=\"pageSize()\"\r\n [statusBar]=\"statusBar\"\r\n [suppressPdfExport]=\"true\"\r\n [getContextMenuItems]=\"contextMenu\"\r\n [defaultCsvExportParams]=\"exportParams\"\r\n [defaultExcelExportParams]=\"exportParams\"\r\n (gridReady)=\"onReady($event)\"\r\n (filterChanged)=\"changed()\"\r\n (sortChanged)=\"changed()\"\r\n (columnVisible)=\"changed()\"\r\n (columnMoved)=\"changed()\"\r\n (columnPinned)=\"changed()\"\r\n (columnResized)=\"$event.finished && changed()\"\r\n (columnRowGroupChanged)=\"changed()\"\r\n (columnValueChanged)=\"changed()\"\r\n (columnPivotChanged)=\"changed()\"\r\n (rowClicked)=\"\r\n !$event.node.group &&\r\n !$event.node.footer &&\r\n $event.node.data &&\r\n rowClick.emit($event.node.data)\r\n \"\r\n />\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"table().rows\"\r\n [columns]=\"table().columns\"\r\n dataKey=\"Id\"\r\n [storageKey]=\"tableStorageKey()\"\r\n [persistStateExclude]=\"table().config.table.persistStateExclude\"\r\n [captionStartTemplate]=\"table().config.toolbarStart ?? null\"\r\n [captionEndTemplate]=\"table().config.toolbarEnd ?? null\"\r\n [rowActions]=\"rowActions()\"\r\n [actionShape]=\"actionShape() ?? 'flat'\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFn()\"\r\n (rowActionsRequested)=\"rowActionsRequested.emit($event)\"\r\n [generalSearch]=\"table().config.table.searchable\"\r\n [showFilters]=\"true\"\r\n filterMode=\"column\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [cellClickFilter]=\"true\"\r\n [freezeActions]=\"true\"\r\n [exportable]=\"table().config.table.exportable\"\r\n [loading]=\"table().loading\"\r\n [clickableRows]=\"true\"\r\n [lazy]=\"table().config.isPaginated\"\r\n [lazyTotalRecords]=\"table().totalCount\"\r\n [virtualScroll]=\"!table().config.isPaginated\"\r\n [virtualScrollItemSize]=\"56\"\r\n scrollHeight=\"520px\"\r\n [pageSize]=\"pageSize()\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [sortField]=\"bucket().sortField()\"\r\n (sortFieldChange)=\"bucket().sortField.set($event)\"\r\n [sortDirection]=\"bucket().sortDirection()\"\r\n (sortDirectionChange)=\"bucket().sortDirection.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (lazyLoad)=\"lazyLoad.emit($event)\"\r\n (rowClick)=\"rowClick.emit($event)\"\r\n />\r\n }\r\n }\r\n </div>\r\n\r\n @if (table().config.contentEnd) {\r\n <div [style.gridColumn]=\"slotGridSpan(table().config.layout.endSpan)\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"table().config.contentEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(table())\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n" }]
|
|
1997
|
+
}], ctorParameters: () => [], propDecorators: { nativeGridReady: [{ type: i0.Output, args: ["nativeGridReady"] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", required: false }] }], rowActionsLoadingFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActionsLoadingFn", required: false }] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowActionsRequested: [{ type: i0.Output, args: ["rowActionsRequested"] }] } });
|
|
1566
1998
|
|
|
1567
1999
|
const EMPTY_KEY_SET = new Set();
|
|
1568
2000
|
/** Shared fallback so cards without an entry keep a stable identity. */
|
|
@@ -2273,7 +2705,7 @@ class ClientListCardsView {
|
|
|
2273
2705
|
});
|
|
2274
2706
|
}
|
|
2275
2707
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListCardsView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2276
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListCardsView, isStandalone: true, selector: "mt-client-list-cards-view", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { lazyLoad: "lazyLoad", loadMore: "loadMore", cardClick: "cardClick", rowActionsRequested: "rowActionsRequested" }, providers: [MTDateFormatPipe], viewQueries: [{ propertyName: "loadMoreSentinel", first: true, predicate: ["loadMoreSentinel"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-table-caption\r\n [generalSearch]=\"true\"\r\n [showFilters]=\"true\"\r\n filterMode=\"popover\"\r\n [filterCloseOnOutsideClick]=\"cardsState().config.filterCloseOnOutsideClick\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [exportable]=\"true\"\r\n [columns]=\"columns()\"\r\n [data]=\"rowRepresentations()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [actions]=\"toolbarActions()\"\r\n [captionStart]=\"cardsState().config.toolbarStart ?? null\"\r\n [captionEnd]=\"cardsState().config.toolbarEnd ?? null\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n/>\r\n\r\n@if (badgeLegend().length > 0) {\r\n <!--\r\n Decodes the coloured count pills on the cards below. Rendered once for the\r\n whole board rather than per card, so it costs one line of vertical space\r\n instead of repeating a key inside every tile (finding M-04).\r\n -->\r\n <div\r\n class=\"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-1\"\r\n role=\"list\"\r\n [attr.aria-label]=\"\r\n 'components.clientComponents.list.badgeLegend' | transloco\r\n \"\r\n >\r\n <span class=\"text-xs font-medium text-gray-500 dark:text-gray-400\">\r\n {{ \"components.clientComponents.list.badgeLegend\" | transloco }}\r\n </span>\r\n @for (entry of badgeLegend(); track entry.key) {\r\n <span class=\"flex items-center gap-1.5\" role=\"listitem\">\r\n <span\r\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded text-[10px] font-bold\"\r\n [style.background-color]=\"entry.color\"\r\n [style.color]=\"entry.textColor\"\r\n aria-hidden=\"true\"\r\n >\r\n #\r\n </span>\r\n <span class=\"text-xs text-gray-600 dark:text-gray-300\">{{\r\n entry.label\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n@if (cardsState().loading && cardsState().cards.length === 0) {\r\n <div class=\"mt-cards-grid\">\r\n @for (i of [1, 2, 3, 4, 5, 6]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n} @else if (cardsState().error) {\r\n <div class=\"rounded-lg border border-red-200 bg-red-50 p-6 text-red-600\">\r\n {{ cardsState().error }}\r\n </div>\r\n} @else if (visibleCards().length === 0) {\r\n <!--\r\n The same empty state the tables use, so a board and a list stop looking like\r\n two products (finding H-12). A board narrowed by a search or a filter says\r\n so and offers to clear it, instead of the bare grey \"No cards found.\"\r\n -->\r\n <mt-empty-state\r\n [variant]=\"hasActiveCardFilters() ? 'filtered' : 'empty'\"\r\n [title]=\"\r\n hasActiveCardFilters()\r\n ? ''\r\n : ('components.clientComponents.list.noCardsFound' | transloco)\r\n \"\r\n [actionLabel]=\"\r\n hasActiveCardFilters()\r\n ? ('components.emptyState.clearFilters' | transloco)\r\n : ''\r\n \"\r\n actionIcon=\"general.x-close\"\r\n (actionClick)=\"clearCardFilters()\"\r\n />\r\n} @else if (grouping.groupingActive()) {\r\n <div class=\"flex flex-col gap-6\">\r\n @for (group of groupedCards(); track group.key) {\r\n <section class=\"flex flex-col gap-3\">\r\n <header\r\n class=\"flex items-center gap-3 px-2 py-2 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700 rounded\"\r\n [style.--mt-group-accent]=\"group.accent ?? 'var(--p-primary-color)'\"\r\n >\r\n <span\r\n class=\"inline-block w-1 h-5 rounded-full\"\r\n [style.background]=\"'var(--mt-group-accent)'\"\r\n ></span>\r\n <span\r\n class=\"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ group.columnLabel }}\r\n </span>\r\n <span class=\"text-sm font-semibold text-gray-900 dark:text-gray-100\">\r\n {{ group.label }}\r\n </span>\r\n <span\r\n class=\"ml-auto inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-primary-50 text-primary-700 dark:bg-primary-950 dark:text-primary-300\"\r\n >\r\n {{ group.count }}\r\n </span>\r\n </header>\r\n <div class=\"mt-cards-grid\">\r\n @for (card of group.cards; track card.id) {\r\n <mt-card\r\n class=\"relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </div>\r\n} @else {\r\n <div class=\"mt-cards-grid\">\r\n @for (card of visibleCards(); track card.id) {\r\n @defer (on viewport) {\r\n <mt-card\r\n class=\"relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n } @placeholder {\r\n <div class=\"min-h-[20rem]\">\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n </div>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n Infinite-scroll trigger. Deliberately outside the @if/@else chain above:\r\n inside it the element would be torn down and rebuilt every time the view\r\n swapped branch (error, empty filter result, group-by), and the observer\r\n would be left watching a detached node. Kept in the DOM and hidden via CSS\r\n when there is nothing left to load, so appending a page never recreates it.\r\n It also has to sit outside so infinite scroll keeps working while a\r\n group-by is active \u2014 grouping is a pure FE view over whatever has been\r\n fetched, not a reason to stop fetching.\r\n-->\r\n<div\r\n #loadMoreSentinel\r\n class=\"mt-cards-grid py-4\"\r\n [class.hidden]=\"!hasMoreCards()\"\r\n>\r\n @for (i of [1, 2, 3]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n</div>\r\n\r\n<!--\r\n Per-card escalation marker, host status indicators and 3-dots actions menu.\r\n The compact corner cover only indicates active escalation state; its preview\r\n action lives in the menu so the marker never displaces or competes with the\r\n menu trigger.\r\n-->\r\n<ng-template #cardActionsMenu let-card>\r\n @let escalationAction = escalationMarkerAction(card);\r\n @if (escalationAction) {\r\n <span\r\n class=\"mt-escalation-marker absolute end-0 top-0 z-10 h-[18px] w-[20px]\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"escalationLabel()\"\r\n [mtTooltip]=\"escalationLabel()\"\r\n tooltipPosition=\"top\"\r\n ></span>\r\n }\r\n @if (hasCardCornerContent(card)) {\r\n <div\r\n class=\"absolute end-2 top-2 z-20 flex items-center gap-1\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!-- Host status indicators (`config.cardIndicators`), beside the menu. -->\r\n @for (indicator of indicatorsForCard(card); track $index) {\r\n <span\r\n class=\"flex h-7 w-7 items-center justify-center rounded-md text-base text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [style.color]=\"indicator.color\"\r\n [attr.aria-label]=\"indicator.tooltip\"\r\n [mtTooltip]=\"indicator.tooltip\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon [icon]=\"indicator.icon\" class=\"text-base\" />\r\n </span>\r\n }\r\n @for (action of inlineActionsForCard(card); track $index) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"actionSize(action) || 'small'\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, card)\"\r\n (onClick)=\"runCardAction($event, action, card)\"\r\n />\r\n }\r\n @if (showCardActionsMenu(card)) {\r\n <button\r\n type=\"button\"\r\n class=\"flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-base text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300 dark:hover:bg-surface-700 dark:hover:text-gray-100\"\r\n [attr.aria-label]=\"actionsLabel()\"\r\n [mtTooltip]=\"actionsLabel()\"\r\n tooltipPosition=\"top\"\r\n (click)=\"onCardActionsToggle($event, cardPopover, card)\"\r\n >\r\n <mt-icon icon=\"general.dots-vertical\" class=\"text-base\" />\r\n </button>\r\n <p-popover #cardPopover appendTo=\"body\">\r\n <div class=\"flex min-w-44 flex-col gap-1 p-1\">\r\n @if (isCardActionsLoading(card)) {\r\n <div class=\"flex flex-col gap-2 p-1\">\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n </div>\r\n } @else {\r\n @for (action of menuActionsForCard(card); track $index) {\r\n @if (isFirstDestructiveCardAction(card, $index)) {\r\n <hr\r\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\r\n />\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"flex cursor-pointer items-center gap-2 rounded px-2 py-2 text-start text-sm 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 : action.color === 'warn'\r\n ? 'text-orange-600 hover:bg-orange-50 dark:text-orange-400 dark:hover:bg-orange-950'\r\n : 'text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n runCardAction($event, action, card); cardPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon [icon]=\"action.icon\" class=\"text-base\" />\r\n }\r\n <span>{{ action.label || action.tooltip }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".mt-cards-grid{--mt-cards-gap: 1rem;--mt-cards-min: 335px;--mt-cards-track: max( var(--mt-cards-min), (100% - 3 * var(--mt-cards-gap)) / 4 );display:grid;gap:var(--mt-cards-gap);grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--mt-cards-track)),1fr))}.mt-cards-grid.hidden,.mt-cards-grid[hidden]{display:none}.mt-escalation-marker{border-start-end-radius:.5rem;background:var(--p-button-text-warn-color, var(--p-orange-500, #f59e0b));clip-path:polygon(0 0,100% 0,100% 100%);transition:filter .15s ease}.mt-escalation-marker:dir(rtl){clip-path:polygon(0 0,100% 0,0 100%)}.mt-escalation-marker:hover{filter:brightness(.92)}.mt-escalation-marker:focus-visible{filter:brightness(.92) drop-shadow(0 0 2px var(--p-button-text-warn-color, #f59e0b));outline:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities", "attachmentShape", "stackOnNarrow", "clickableKeys", "activeKeys", "clickableTooltip", "activeTooltip"], outputs: ["entityClick"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i3.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: TableCaption, selector: "mt-table-caption", inputs: ["generalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "exportable", "printable", "groupable", "columns", "data", "groupColumns", "tabs", "tabsOptionLabel", "tabsOptionValue", "actions", "captionStart", "captionEnd", "activeTab", "filters", "filterTerm", "groupBy"], outputs: ["activeTabChange", "filtersChange", "filterTermChange", "groupByChange", "exportRequested", "printRequested", "onTabChange", "searchChange", "filterApplied", "filterReset"] }, { kind: "component", type: EmptyState, selector: "mt-empty-state", inputs: ["variant", "illustration", "title", "description", "actionLabel", "actionIcon"], outputs: ["actionClick"] }, { kind: "pipe", type: i4.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [i1.NgTemplateOutlet, Card,
|
|
2708
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListCardsView, isStandalone: true, selector: "mt-client-list-cards-view", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { lazyLoad: "lazyLoad", loadMore: "loadMore", cardClick: "cardClick", rowActionsRequested: "rowActionsRequested" }, providers: [MTDateFormatPipe], viewQueries: [{ propertyName: "loadMoreSentinel", first: true, predicate: ["loadMoreSentinel"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-table-caption\r\n [generalSearch]=\"true\"\r\n [showFilters]=\"true\"\r\n filterMode=\"popover\"\r\n [filterCloseOnOutsideClick]=\"cardsState().config.filterCloseOnOutsideClick\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [exportable]=\"true\"\r\n [columns]=\"columns()\"\r\n [data]=\"rowRepresentations()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [actions]=\"toolbarActions()\"\r\n [captionStart]=\"cardsState().config.toolbarStart ?? null\"\r\n [captionEnd]=\"cardsState().config.toolbarEnd ?? null\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n/>\r\n\r\n@if (badgeLegend().length > 0) {\r\n <!--\r\n Decodes the coloured count pills on the cards below. Rendered once for the\r\n whole board rather than per card, so it costs one line of vertical space\r\n instead of repeating a key inside every tile (finding M-04).\r\n -->\r\n <div\r\n class=\"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-1\"\r\n role=\"list\"\r\n [attr.aria-label]=\"\r\n 'components.clientComponents.list.badgeLegend' | transloco\r\n \"\r\n >\r\n <span class=\"text-xs font-medium text-gray-500 dark:text-gray-400\">\r\n {{ \"components.clientComponents.list.badgeLegend\" | transloco }}\r\n </span>\r\n @for (entry of badgeLegend(); track entry.key) {\r\n <span class=\"flex items-center gap-1.5\" role=\"listitem\">\r\n <span\r\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded text-[10px] font-bold\"\r\n [style.background-color]=\"entry.color\"\r\n [style.color]=\"entry.textColor\"\r\n aria-hidden=\"true\"\r\n >\r\n #\r\n </span>\r\n <span class=\"text-xs text-gray-600 dark:text-gray-300\">{{\r\n entry.label\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n@if (cardsState().loading && cardsState().cards.length === 0) {\r\n <div class=\"mt-cards-grid\">\r\n @for (i of [1, 2, 3, 4, 5, 6]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n} @else if (cardsState().error) {\r\n <div class=\"rounded-lg border border-red-200 bg-red-50 p-6 text-red-600\">\r\n {{ cardsState().error }}\r\n </div>\r\n} @else if (visibleCards().length === 0) {\r\n <!--\r\n The same empty state the tables use, so a board and a list stop looking like\r\n two products (finding H-12). A board narrowed by a search or a filter says\r\n so and offers to clear it, instead of the bare grey \"No cards found.\"\r\n -->\r\n <mt-empty-state\r\n [variant]=\"hasActiveCardFilters() ? 'filtered' : 'empty'\"\r\n [title]=\"\r\n hasActiveCardFilters()\r\n ? ''\r\n : ('components.clientComponents.list.noCardsFound' | transloco)\r\n \"\r\n [actionLabel]=\"\r\n hasActiveCardFilters()\r\n ? ('components.emptyState.clearFilters' | transloco)\r\n : ''\r\n \"\r\n actionIcon=\"general.x-close\"\r\n (actionClick)=\"clearCardFilters()\"\r\n />\r\n} @else if (grouping.groupingActive()) {\r\n <div class=\"flex flex-col gap-6\">\r\n @for (group of groupedCards(); track group.key) {\r\n <section class=\"flex flex-col gap-3\">\r\n <header\r\n class=\"flex items-center gap-3 px-2 py-2 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700 rounded\"\r\n [style.--mt-group-accent]=\"group.accent ?? 'var(--p-primary-color)'\"\r\n >\r\n <span\r\n class=\"inline-block w-1 h-5 rounded-full\"\r\n [style.background]=\"'var(--mt-group-accent)'\"\r\n ></span>\r\n <span\r\n class=\"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ group.columnLabel }}\r\n </span>\r\n <span class=\"text-sm font-semibold text-gray-900 dark:text-gray-100\">\r\n {{ group.label }}\r\n </span>\r\n <span\r\n class=\"ml-auto inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-primary-50 text-primary-700 dark:bg-primary-950 dark:text-primary-300\"\r\n >\r\n {{ group.count }}\r\n </span>\r\n </header>\r\n <div class=\"mt-cards-grid\">\r\n @for (card of group.cards; track card.id) {\r\n <mt-card\r\n class=\"mt-card-tile relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </div>\r\n} @else {\r\n <div class=\"mt-cards-grid\">\r\n @for (card of visibleCards(); track card.id) {\r\n @defer (on viewport) {\r\n <mt-card\r\n class=\"mt-card-tile relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n } @placeholder {\r\n <div class=\"min-h-[20rem]\">\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n </div>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n Infinite-scroll trigger. Deliberately outside the @if/@else chain above:\r\n inside it the element would be torn down and rebuilt every time the view\r\n swapped branch (error, empty filter result, group-by), and the observer\r\n would be left watching a detached node. Kept in the DOM and hidden via CSS\r\n when there is nothing left to load, so appending a page never recreates it.\r\n It also has to sit outside so infinite scroll keeps working while a\r\n group-by is active \u2014 grouping is a pure FE view over whatever has been\r\n fetched, not a reason to stop fetching.\r\n-->\r\n<div\r\n #loadMoreSentinel\r\n class=\"mt-cards-grid py-4\"\r\n [class.hidden]=\"!hasMoreCards()\"\r\n>\r\n @for (i of [1, 2, 3]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n</div>\r\n\r\n<!--\r\n Per-card escalation marker, host status indicators and 3-dots actions menu.\r\n The compact corner cover only indicates active escalation state; its preview\r\n action lives in the menu so the marker never displaces or competes with the\r\n menu trigger.\r\n-->\r\n<ng-template #cardActionsMenu let-card>\r\n @let escalationAction = escalationMarkerAction(card);\r\n @if (escalationAction) {\r\n <span\r\n class=\"mt-escalation-marker absolute end-0 top-0 z-10 h-[18px] w-[20px]\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"escalationLabel()\"\r\n [mtTooltip]=\"escalationLabel()\"\r\n tooltipPosition=\"top\"\r\n ></span>\r\n }\r\n @if (hasCardCornerContent(card)) {\r\n <div\r\n class=\"absolute end-2 top-2 z-20 flex items-center gap-1\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!-- Host status indicators (`config.cardIndicators`), beside the menu. -->\r\n @for (indicator of indicatorsForCard(card); track $index) {\r\n <span\r\n class=\"flex h-7 w-7 items-center justify-center rounded-md text-base text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [style.color]=\"indicator.color\"\r\n [attr.aria-label]=\"indicator.tooltip\"\r\n [mtTooltip]=\"indicator.tooltip\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon [icon]=\"indicator.icon\" class=\"text-base\" />\r\n </span>\r\n }\r\n @for (action of inlineActionsForCard(card); track $index) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"actionSize(action) || 'small'\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, card)\"\r\n (onClick)=\"runCardAction($event, action, card)\"\r\n />\r\n }\r\n @if (showCardActionsMenu(card)) {\r\n <button\r\n type=\"button\"\r\n class=\"flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-base text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300 dark:hover:bg-surface-700 dark:hover:text-gray-100\"\r\n [attr.aria-label]=\"actionsLabel()\"\r\n [mtTooltip]=\"actionsLabel()\"\r\n tooltipPosition=\"top\"\r\n (click)=\"onCardActionsToggle($event, cardPopover, card)\"\r\n >\r\n <mt-icon icon=\"general.dots-vertical\" class=\"text-base\" />\r\n </button>\r\n <p-popover #cardPopover appendTo=\"body\">\r\n <div class=\"flex min-w-44 flex-col gap-1 p-1\">\r\n @if (isCardActionsLoading(card)) {\r\n <div class=\"flex flex-col gap-2 p-1\">\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n </div>\r\n } @else {\r\n @for (action of menuActionsForCard(card); track $index) {\r\n @if (isFirstDestructiveCardAction(card, $index)) {\r\n <hr\r\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\r\n />\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"flex cursor-pointer items-center gap-2 rounded px-2 py-2 text-start text-sm 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 : action.color === 'warn'\r\n ? 'text-orange-600 hover:bg-orange-50 dark:text-orange-400 dark:hover:bg-orange-950'\r\n : 'text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n runCardAction($event, action, card); cardPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon [icon]=\"action.icon\" class=\"text-base\" />\r\n }\r\n <span>{{ action.label || action.tooltip }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".mt-cards-grid{--mt-cards-gap: 1rem;--mt-cards-min: 335px;--mt-cards-track: max( var(--mt-cards-min), (100% - 3 * var(--mt-cards-gap)) / 4 );display:grid;gap:var(--mt-cards-gap);grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--mt-cards-track)),1fr))}.mt-cards-grid.hidden,.mt-cards-grid[hidden]{display:none}.mt-card-tile{--mt-entity-header-bleed-top: 1.25rem;--mt-entity-header-bleed-x: 1.25rem;--mt-entity-header-radius: calc(.5rem - 1px) calc(.5rem - 1px) 0 0}.mt-escalation-marker{border-start-end-radius:.5rem;background:var(--p-button-text-warn-color, var(--p-orange-500, #f59e0b));clip-path:polygon(0 0,100% 0,100% 100%);transition:filter .15s ease}.mt-escalation-marker:dir(rtl){clip-path:polygon(0 0,100% 0,0 100%)}.mt-escalation-marker:hover{filter:brightness(.92)}.mt-escalation-marker:focus-visible{filter:brightness(.92) drop-shadow(0 0 2px var(--p-button-text-warn-color, #f59e0b));outline:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities", "attachmentShape", "stackOnNarrow", "clickableKeys", "activeKeys", "clickableTooltip", "activeTooltip"], outputs: ["entityClick"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i3.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: TableCaption, selector: "mt-table-caption", inputs: ["generalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "exportable", "printable", "groupable", "columns", "data", "groupColumns", "tabs", "tabsOptionLabel", "tabsOptionValue", "actions", "captionStart", "captionEnd", "activeTab", "filters", "filterTerm", "groupBy"], outputs: ["activeTabChange", "filtersChange", "filterTermChange", "groupByChange", "exportRequested", "printRequested", "onTabChange", "searchChange", "filterApplied", "filterReset"] }, { kind: "component", type: EmptyState, selector: "mt-empty-state", inputs: ["variant", "illustration", "title", "description", "actionLabel", "actionIcon"], outputs: ["actionClick"] }, { kind: "pipe", type: i4.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [i1.NgTemplateOutlet, Card,
|
|
2277
2709
|
EntitiesPreview]] });
|
|
2278
2710
|
}
|
|
2279
2711
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListCardsView, decorators: [{
|
|
@@ -2290,7 +2722,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
2290
2722
|
PopoverModule,
|
|
2291
2723
|
TableCaption,
|
|
2292
2724
|
EmptyState,
|
|
2293
|
-
], providers: [MTDateFormatPipe], template: "<mt-table-caption\r\n [generalSearch]=\"true\"\r\n [showFilters]=\"true\"\r\n filterMode=\"popover\"\r\n [filterCloseOnOutsideClick]=\"cardsState().config.filterCloseOnOutsideClick\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [exportable]=\"true\"\r\n [columns]=\"columns()\"\r\n [data]=\"rowRepresentations()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [actions]=\"toolbarActions()\"\r\n [captionStart]=\"cardsState().config.toolbarStart ?? null\"\r\n [captionEnd]=\"cardsState().config.toolbarEnd ?? null\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n/>\r\n\r\n@if (badgeLegend().length > 0) {\r\n <!--\r\n Decodes the coloured count pills on the cards below. Rendered once for the\r\n whole board rather than per card, so it costs one line of vertical space\r\n instead of repeating a key inside every tile (finding M-04).\r\n -->\r\n <div\r\n class=\"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-1\"\r\n role=\"list\"\r\n [attr.aria-label]=\"\r\n 'components.clientComponents.list.badgeLegend' | transloco\r\n \"\r\n >\r\n <span class=\"text-xs font-medium text-gray-500 dark:text-gray-400\">\r\n {{ \"components.clientComponents.list.badgeLegend\" | transloco }}\r\n </span>\r\n @for (entry of badgeLegend(); track entry.key) {\r\n <span class=\"flex items-center gap-1.5\" role=\"listitem\">\r\n <span\r\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded text-[10px] font-bold\"\r\n [style.background-color]=\"entry.color\"\r\n [style.color]=\"entry.textColor\"\r\n aria-hidden=\"true\"\r\n >\r\n #\r\n </span>\r\n <span class=\"text-xs text-gray-600 dark:text-gray-300\">{{\r\n entry.label\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n@if (cardsState().loading && cardsState().cards.length === 0) {\r\n <div class=\"mt-cards-grid\">\r\n @for (i of [1, 2, 3, 4, 5, 6]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n} @else if (cardsState().error) {\r\n <div class=\"rounded-lg border border-red-200 bg-red-50 p-6 text-red-600\">\r\n {{ cardsState().error }}\r\n </div>\r\n} @else if (visibleCards().length === 0) {\r\n <!--\r\n The same empty state the tables use, so a board and a list stop looking like\r\n two products (finding H-12). A board narrowed by a search or a filter says\r\n so and offers to clear it, instead of the bare grey \"No cards found.\"\r\n -->\r\n <mt-empty-state\r\n [variant]=\"hasActiveCardFilters() ? 'filtered' : 'empty'\"\r\n [title]=\"\r\n hasActiveCardFilters()\r\n ? ''\r\n : ('components.clientComponents.list.noCardsFound' | transloco)\r\n \"\r\n [actionLabel]=\"\r\n hasActiveCardFilters()\r\n ? ('components.emptyState.clearFilters' | transloco)\r\n : ''\r\n \"\r\n actionIcon=\"general.x-close\"\r\n (actionClick)=\"clearCardFilters()\"\r\n />\r\n} @else if (grouping.groupingActive()) {\r\n <div class=\"flex flex-col gap-6\">\r\n @for (group of groupedCards(); track group.key) {\r\n <section class=\"flex flex-col gap-3\">\r\n <header\r\n class=\"flex items-center gap-3 px-2 py-2 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700 rounded\"\r\n [style.--mt-group-accent]=\"group.accent ?? 'var(--p-primary-color)'\"\r\n >\r\n <span\r\n class=\"inline-block w-1 h-5 rounded-full\"\r\n [style.background]=\"'var(--mt-group-accent)'\"\r\n ></span>\r\n <span\r\n class=\"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ group.columnLabel }}\r\n </span>\r\n <span class=\"text-sm font-semibold text-gray-900 dark:text-gray-100\">\r\n {{ group.label }}\r\n </span>\r\n <span\r\n class=\"ml-auto inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-primary-50 text-primary-700 dark:bg-primary-950 dark:text-primary-300\"\r\n >\r\n {{ group.count }}\r\n </span>\r\n </header>\r\n <div class=\"mt-cards-grid\">\r\n @for (card of group.cards; track card.id) {\r\n <mt-card\r\n class=\"relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </div>\r\n} @else {\r\n <div class=\"mt-cards-grid\">\r\n @for (card of visibleCards(); track card.id) {\r\n @defer (on viewport) {\r\n <mt-card\r\n class=\"relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n } @placeholder {\r\n <div class=\"min-h-[20rem]\">\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n </div>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n Infinite-scroll trigger. Deliberately outside the @if/@else chain above:\r\n inside it the element would be torn down and rebuilt every time the view\r\n swapped branch (error, empty filter result, group-by), and the observer\r\n would be left watching a detached node. Kept in the DOM and hidden via CSS\r\n when there is nothing left to load, so appending a page never recreates it.\r\n It also has to sit outside so infinite scroll keeps working while a\r\n group-by is active \u2014 grouping is a pure FE view over whatever has been\r\n fetched, not a reason to stop fetching.\r\n-->\r\n<div\r\n #loadMoreSentinel\r\n class=\"mt-cards-grid py-4\"\r\n [class.hidden]=\"!hasMoreCards()\"\r\n>\r\n @for (i of [1, 2, 3]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n</div>\r\n\r\n<!--\r\n Per-card escalation marker, host status indicators and 3-dots actions menu.\r\n The compact corner cover only indicates active escalation state; its preview\r\n action lives in the menu so the marker never displaces or competes with the\r\n menu trigger.\r\n-->\r\n<ng-template #cardActionsMenu let-card>\r\n @let escalationAction = escalationMarkerAction(card);\r\n @if (escalationAction) {\r\n <span\r\n class=\"mt-escalation-marker absolute end-0 top-0 z-10 h-[18px] w-[20px]\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"escalationLabel()\"\r\n [mtTooltip]=\"escalationLabel()\"\r\n tooltipPosition=\"top\"\r\n ></span>\r\n }\r\n @if (hasCardCornerContent(card)) {\r\n <div\r\n class=\"absolute end-2 top-2 z-20 flex items-center gap-1\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!-- Host status indicators (`config.cardIndicators`), beside the menu. -->\r\n @for (indicator of indicatorsForCard(card); track $index) {\r\n <span\r\n class=\"flex h-7 w-7 items-center justify-center rounded-md text-base text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [style.color]=\"indicator.color\"\r\n [attr.aria-label]=\"indicator.tooltip\"\r\n [mtTooltip]=\"indicator.tooltip\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon [icon]=\"indicator.icon\" class=\"text-base\" />\r\n </span>\r\n }\r\n @for (action of inlineActionsForCard(card); track $index) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"actionSize(action) || 'small'\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, card)\"\r\n (onClick)=\"runCardAction($event, action, card)\"\r\n />\r\n }\r\n @if (showCardActionsMenu(card)) {\r\n <button\r\n type=\"button\"\r\n class=\"flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-base text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300 dark:hover:bg-surface-700 dark:hover:text-gray-100\"\r\n [attr.aria-label]=\"actionsLabel()\"\r\n [mtTooltip]=\"actionsLabel()\"\r\n tooltipPosition=\"top\"\r\n (click)=\"onCardActionsToggle($event, cardPopover, card)\"\r\n >\r\n <mt-icon icon=\"general.dots-vertical\" class=\"text-base\" />\r\n </button>\r\n <p-popover #cardPopover appendTo=\"body\">\r\n <div class=\"flex min-w-44 flex-col gap-1 p-1\">\r\n @if (isCardActionsLoading(card)) {\r\n <div class=\"flex flex-col gap-2 p-1\">\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n </div>\r\n } @else {\r\n @for (action of menuActionsForCard(card); track $index) {\r\n @if (isFirstDestructiveCardAction(card, $index)) {\r\n <hr\r\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\r\n />\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"flex cursor-pointer items-center gap-2 rounded px-2 py-2 text-start text-sm 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 : action.color === 'warn'\r\n ? 'text-orange-600 hover:bg-orange-50 dark:text-orange-400 dark:hover:bg-orange-950'\r\n : 'text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n runCardAction($event, action, card); cardPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon [icon]=\"action.icon\" class=\"text-base\" />\r\n }\r\n <span>{{ action.label || action.tooltip }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".mt-cards-grid{--mt-cards-gap: 1rem;--mt-cards-min: 335px;--mt-cards-track: max( var(--mt-cards-min), (100% - 3 * var(--mt-cards-gap)) / 4 );display:grid;gap:var(--mt-cards-gap);grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--mt-cards-track)),1fr))}.mt-cards-grid.hidden,.mt-cards-grid[hidden]{display:none}.mt-escalation-marker{border-start-end-radius:.5rem;background:var(--p-button-text-warn-color, var(--p-orange-500, #f59e0b));clip-path:polygon(0 0,100% 0,100% 100%);transition:filter .15s ease}.mt-escalation-marker:dir(rtl){clip-path:polygon(0 0,100% 0,0 100%)}.mt-escalation-marker:hover{filter:brightness(.92)}.mt-escalation-marker:focus-visible{filter:brightness(.92) drop-shadow(0 0 2px var(--p-button-text-warn-color, #f59e0b));outline:none}\n"] }]
|
|
2725
|
+
], providers: [MTDateFormatPipe], template: "<mt-table-caption\r\n [generalSearch]=\"true\"\r\n [showFilters]=\"true\"\r\n filterMode=\"popover\"\r\n [filterCloseOnOutsideClick]=\"cardsState().config.filterCloseOnOutsideClick\"\r\n [printable]=\"true\"\r\n [groupable]=\"true\"\r\n [exportable]=\"true\"\r\n [columns]=\"columns()\"\r\n [data]=\"rowRepresentations()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [actions]=\"toolbarActions()\"\r\n [captionStart]=\"cardsState().config.toolbarStart ?? null\"\r\n [captionEnd]=\"cardsState().config.toolbarEnd ?? null\"\r\n [filters]=\"bucket().filters()\"\r\n (filtersChange)=\"bucket().filters.set($event)\"\r\n [filterTerm]=\"bucket().filterTerm()\"\r\n (filterTermChange)=\"bucket().filterTerm.set($event)\"\r\n [groupBy]=\"bucket().groupBy()\"\r\n (groupByChange)=\"bucket().groupBy.set($event)\"\r\n [activeTab]=\"bucket().activeTab()\"\r\n (activeTabChange)=\"bucket().activeTab.set($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n/>\r\n\r\n@if (badgeLegend().length > 0) {\r\n <!--\r\n Decodes the coloured count pills on the cards below. Rendered once for the\r\n whole board rather than per card, so it costs one line of vertical space\r\n instead of repeating a key inside every tile (finding M-04).\r\n -->\r\n <div\r\n class=\"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-1\"\r\n role=\"list\"\r\n [attr.aria-label]=\"\r\n 'components.clientComponents.list.badgeLegend' | transloco\r\n \"\r\n >\r\n <span class=\"text-xs font-medium text-gray-500 dark:text-gray-400\">\r\n {{ \"components.clientComponents.list.badgeLegend\" | transloco }}\r\n </span>\r\n @for (entry of badgeLegend(); track entry.key) {\r\n <span class=\"flex items-center gap-1.5\" role=\"listitem\">\r\n <span\r\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded text-[10px] font-bold\"\r\n [style.background-color]=\"entry.color\"\r\n [style.color]=\"entry.textColor\"\r\n aria-hidden=\"true\"\r\n >\r\n #\r\n </span>\r\n <span class=\"text-xs text-gray-600 dark:text-gray-300\">{{\r\n entry.label\r\n }}</span>\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n@if (cardsState().loading && cardsState().cards.length === 0) {\r\n <div class=\"mt-cards-grid\">\r\n @for (i of [1, 2, 3, 4, 5, 6]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n </div>\r\n} @else if (cardsState().error) {\r\n <div class=\"rounded-lg border border-red-200 bg-red-50 p-6 text-red-600\">\r\n {{ cardsState().error }}\r\n </div>\r\n} @else if (visibleCards().length === 0) {\r\n <!--\r\n The same empty state the tables use, so a board and a list stop looking like\r\n two products (finding H-12). A board narrowed by a search or a filter says\r\n so and offers to clear it, instead of the bare grey \"No cards found.\"\r\n -->\r\n <mt-empty-state\r\n [variant]=\"hasActiveCardFilters() ? 'filtered' : 'empty'\"\r\n [title]=\"\r\n hasActiveCardFilters()\r\n ? ''\r\n : ('components.clientComponents.list.noCardsFound' | transloco)\r\n \"\r\n [actionLabel]=\"\r\n hasActiveCardFilters()\r\n ? ('components.emptyState.clearFilters' | transloco)\r\n : ''\r\n \"\r\n actionIcon=\"general.x-close\"\r\n (actionClick)=\"clearCardFilters()\"\r\n />\r\n} @else if (grouping.groupingActive()) {\r\n <div class=\"flex flex-col gap-6\">\r\n @for (group of groupedCards(); track group.key) {\r\n <section class=\"flex flex-col gap-3\">\r\n <header\r\n class=\"flex items-center gap-3 px-2 py-2 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700 rounded\"\r\n [style.--mt-group-accent]=\"group.accent ?? 'var(--p-primary-color)'\"\r\n >\r\n <span\r\n class=\"inline-block w-1 h-5 rounded-full\"\r\n [style.background]=\"'var(--mt-group-accent)'\"\r\n ></span>\r\n <span\r\n class=\"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ group.columnLabel }}\r\n </span>\r\n <span class=\"text-sm font-semibold text-gray-900 dark:text-gray-100\">\r\n {{ group.label }}\r\n </span>\r\n <span\r\n class=\"ml-auto inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-primary-50 text-primary-700 dark:bg-primary-950 dark:text-primary-300\"\r\n >\r\n {{ group.count }}\r\n </span>\r\n </header>\r\n <div class=\"mt-cards-grid\">\r\n @for (card of group.cards; track card.id) {\r\n <mt-card\r\n class=\"mt-card-tile relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n }\r\n </div>\r\n </section>\r\n }\r\n </div>\r\n} @else {\r\n <div class=\"mt-cards-grid\">\r\n @for (card of visibleCards(); track card.id) {\r\n @defer (on viewport) {\r\n <mt-card\r\n class=\"mt-card-tile relative cursor-pointer p-5 shadow-sm transition-shadow hover:shadow-md\"\r\n (click)=\"cardClick.emit(card)\"\r\n >\r\n <ng-template #headless>\r\n <ng-container\r\n [ngTemplateOutlet]=\"cardActionsMenu\"\r\n [ngTemplateOutletContext]=\"{ $implicit: card }\"\r\n />\r\n <mt-entities-preview\r\n [entities]=\"card.entities\"\r\n attachmentShape=\"compact\"\r\n [stackOnNarrow]=\"false\"\r\n [clickableKeys]=\"clickableEntityKeys()\"\r\n [activeKeys]=\"activeKeysForCard(card)\"\r\n [clickableTooltip]=\"filterByThisLabel()\"\r\n [activeTooltip]=\"clearFilterLabel()\"\r\n (entityClick)=\"onEntityFilterClick(card, $event)\"\r\n />\r\n </ng-template>\r\n </mt-card>\r\n } @placeholder {\r\n <div class=\"min-h-[20rem]\">\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n </div>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n Infinite-scroll trigger. Deliberately outside the @if/@else chain above:\r\n inside it the element would be torn down and rebuilt every time the view\r\n swapped branch (error, empty filter result, group-by), and the observer\r\n would be left watching a detached node. Kept in the DOM and hidden via CSS\r\n when there is nothing left to load, so appending a page never recreates it.\r\n It also has to sit outside so infinite scroll keeps working while a\r\n group-by is active \u2014 grouping is a pure FE view over whatever has been\r\n fetched, not a reason to stop fetching.\r\n-->\r\n<div\r\n #loadMoreSentinel\r\n class=\"mt-cards-grid py-4\"\r\n [class.hidden]=\"!hasMoreCards()\"\r\n>\r\n @for (i of [1, 2, 3]; track i) {\r\n <p-skeleton height=\"20rem\" class=\"rounded-lg\" />\r\n }\r\n</div>\r\n\r\n<!--\r\n Per-card escalation marker, host status indicators and 3-dots actions menu.\r\n The compact corner cover only indicates active escalation state; its preview\r\n action lives in the menu so the marker never displaces or competes with the\r\n menu trigger.\r\n-->\r\n<ng-template #cardActionsMenu let-card>\r\n @let escalationAction = escalationMarkerAction(card);\r\n @if (escalationAction) {\r\n <span\r\n class=\"mt-escalation-marker absolute end-0 top-0 z-10 h-[18px] w-[20px]\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"escalationLabel()\"\r\n [mtTooltip]=\"escalationLabel()\"\r\n tooltipPosition=\"top\"\r\n ></span>\r\n }\r\n @if (hasCardCornerContent(card)) {\r\n <div\r\n class=\"absolute end-2 top-2 z-20 flex items-center gap-1\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!-- Host status indicators (`config.cardIndicators`), beside the menu. -->\r\n @for (indicator of indicatorsForCard(card); track $index) {\r\n <span\r\n class=\"flex h-7 w-7 items-center justify-center rounded-md text-base text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n [style.color]=\"indicator.color\"\r\n [attr.aria-label]=\"indicator.tooltip\"\r\n [mtTooltip]=\"indicator.tooltip\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon [icon]=\"indicator.icon\" class=\"text-base\" />\r\n </span>\r\n }\r\n @for (action of inlineActionsForCard(card); track $index) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"actionSize(action) || 'small'\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, card)\"\r\n (onClick)=\"runCardAction($event, action, card)\"\r\n />\r\n }\r\n @if (showCardActionsMenu(card)) {\r\n <button\r\n type=\"button\"\r\n class=\"flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-base text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 dark:text-gray-300 dark:hover:bg-surface-700 dark:hover:text-gray-100\"\r\n [attr.aria-label]=\"actionsLabel()\"\r\n [mtTooltip]=\"actionsLabel()\"\r\n tooltipPosition=\"top\"\r\n (click)=\"onCardActionsToggle($event, cardPopover, card)\"\r\n >\r\n <mt-icon icon=\"general.dots-vertical\" class=\"text-base\" />\r\n </button>\r\n <p-popover #cardPopover appendTo=\"body\">\r\n <div class=\"flex min-w-44 flex-col gap-1 p-1\">\r\n @if (isCardActionsLoading(card)) {\r\n <div class=\"flex flex-col gap-2 p-1\">\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n <p-skeleton height=\"1.75rem\" />\r\n </div>\r\n } @else {\r\n @for (action of menuActionsForCard(card); track $index) {\r\n @if (isFirstDestructiveCardAction(card, $index)) {\r\n <hr\r\n class=\"my-1 border-0 border-t border-surface-200 dark:border-surface-700\"\r\n />\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"flex cursor-pointer items-center gap-2 rounded px-2 py-2 text-start text-sm 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 : action.color === 'warn'\r\n ? 'text-orange-600 hover:bg-orange-50 dark:text-orange-400 dark:hover:bg-orange-950'\r\n : 'text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n runCardAction($event, action, card); cardPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon [icon]=\"action.icon\" class=\"text-base\" />\r\n }\r\n <span>{{ action.label || action.tooltip }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: [".mt-cards-grid{--mt-cards-gap: 1rem;--mt-cards-min: 335px;--mt-cards-track: max( var(--mt-cards-min), (100% - 3 * var(--mt-cards-gap)) / 4 );display:grid;gap:var(--mt-cards-gap);grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--mt-cards-track)),1fr))}.mt-cards-grid.hidden,.mt-cards-grid[hidden]{display:none}.mt-card-tile{--mt-entity-header-bleed-top: 1.25rem;--mt-entity-header-bleed-x: 1.25rem;--mt-entity-header-radius: calc(.5rem - 1px) calc(.5rem - 1px) 0 0}.mt-escalation-marker{border-start-end-radius:.5rem;background:var(--p-button-text-warn-color, var(--p-orange-500, #f59e0b));clip-path:polygon(0 0,100% 0,100% 100%);transition:filter .15s ease}.mt-escalation-marker:dir(rtl){clip-path:polygon(0 0,100% 0,0 100%)}.mt-escalation-marker:hover{filter:brightness(.92)}.mt-escalation-marker:focus-visible{filter:brightness(.92) drop-shadow(0 0 2px var(--p-button-text-warn-color, #f59e0b));outline:none}\n"] }]
|
|
2294
2726
|
}], ctorParameters: () => [], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], rowActionsLoadingFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActionsLoadingFn", required: false }] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], loadMore: [{ type: i0.Output, args: ["loadMore"] }], cardClick: [{ type: i0.Output, args: ["cardClick"] }], rowActionsRequested: [{ type: i0.Output, args: ["rowActionsRequested"] }], loadMoreSentinel: [{ type: i0.ViewChild, args: ['loadMoreSentinel', { isSignal: true }] }] } });
|
|
2295
2727
|
|
|
2296
2728
|
const DEFAULT_GRID_COLUMNS$1 = 12;
|
|
@@ -2315,11 +2747,11 @@ class ClientListInformativeView {
|
|
|
2315
2747
|
};
|
|
2316
2748
|
}
|
|
2317
2749
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListInformativeView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2318
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListInformativeView, isStandalone: true, selector: "mt-client-list-informative-view", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\n @if (informativeState().config.contentStart) {\n <div\n [style.gridColumn]=\"\n slotGridSpan(informativeState().config.layout.startSpan)\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"informativeState().config.contentStart\"\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\n />\n </div>\n }\n\n <div\n [style.gridColumn]=\"\n slotGridSpan(informativeState().config.layout.tableSpan)\n \"\n >\n <mt-card>\n @if (\n informativeState().loading &&\n !informativeState().dashboardData?.charts?.length\n ) {\n <div class=\"flex flex-col gap-3 py-3\">\n <p-skeleton height=\"6rem\" />\n <p-skeleton height=\"12rem\" />\n <p-skeleton height=\"12rem\" />\n </div>\n } @else if (informativeState().error) {\n <div\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\n >\n {{ informativeState().error }}\n </div>\n } @else if (!informativeState().dashboardData?.charts?.length) {\n <div class=\"p-6 text-center text-gray-400\">\n {{\n \"components.clientComponents.list.noInformativeDashboard\"\n | transloco\n }}\n </div>\n } @else {\n <div class=\"min-h-[420px]\">\n <mt-dashboard-viewer\n [isPage]=\"false\"\n [showFilters]=\"false\"\n [dashboardData]=\"informativeState().dashboardData\"\n [extraFilters]=\"dashboardExtraFilters()\"\n />\n </div>\n }\n </mt-card>\n </div>\n\n @if (informativeState().config.contentEnd) {\n <div\n [style.gridColumn]=\"\n slotGridSpan(informativeState().config.layout.endSpan)\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"informativeState().config.contentEnd\"\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: DashboardViewer, selector: "mt-dashboard-viewer", inputs: ["isPage", "pageTitle", "backButton", "pageId", "dashboardData", "chartsData", "dialogsData", "filtersData", "extraFilters", "lookups", "statuses", "levelsSchema", "levelLogsResolver", "showFilters", "showFilterTrigger", "ignoreQueryFilter"], outputs: ["pageLoaded", "onBack", "chartClick"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
|
|
2750
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientListInformativeView, isStandalone: true, selector: "mt-client-list-informative-view", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n @if (informativeState().config.contentStart) {\r\n <div\r\n [style.gridColumn]=\"\r\n slotGridSpan(informativeState().config.layout.startSpan)\r\n \"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"informativeState().config.contentStart\"\r\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\r\n />\r\n </div>\r\n }\r\n\r\n <div\r\n [style.gridColumn]=\"\r\n slotGridSpan(informativeState().config.layout.tableSpan)\r\n \"\r\n >\r\n <mt-card>\r\n @if (\r\n informativeState().loading &&\r\n !informativeState().dashboardData?.charts?.length\r\n ) {\r\n <div class=\"flex flex-col gap-3 py-3\">\r\n <p-skeleton height=\"6rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n </div>\r\n } @else if (informativeState().error) {\r\n <div\r\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ informativeState().error }}\r\n </div>\r\n } @else if (!informativeState().dashboardData?.charts?.length) {\r\n <div class=\"p-6 text-center text-gray-400\">\r\n {{\r\n \"components.clientComponents.list.noInformativeDashboard\"\r\n | transloco\r\n }}\r\n </div>\r\n } @else {\r\n <div class=\"min-h-[420px]\">\r\n <mt-dashboard-viewer\r\n [isPage]=\"false\"\r\n [showFilters]=\"false\"\r\n [dashboardData]=\"informativeState().dashboardData\"\r\n [extraFilters]=\"dashboardExtraFilters()\"\r\n />\r\n </div>\r\n }\r\n </mt-card>\r\n </div>\r\n\r\n @if (informativeState().config.contentEnd) {\r\n <div\r\n [style.gridColumn]=\"\r\n slotGridSpan(informativeState().config.layout.endSpan)\r\n \"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"informativeState().config.contentEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: DashboardViewer, selector: "mt-dashboard-viewer", inputs: ["isPage", "pageTitle", "backButton", "pageId", "dashboardData", "chartsData", "dialogsData", "filtersData", "extraFilters", "lookups", "statuses", "levelsSchema", "levelLogsResolver", "showFilters", "showFilterTrigger", "ignoreQueryFilter"], outputs: ["pageLoaded", "onBack", "chartClick"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }] });
|
|
2319
2751
|
}
|
|
2320
2752
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientListInformativeView, decorators: [{
|
|
2321
2753
|
type: Component,
|
|
2322
|
-
args: [{ selector: 'mt-client-list-informative-view', standalone: true, imports: [CommonModule, Card, DashboardViewer, SkeletonModule, TranslocoPipe], template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\n @if (informativeState().config.contentStart) {\n <div\n [style.gridColumn]=\"\n slotGridSpan(informativeState().config.layout.startSpan)\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"informativeState().config.contentStart\"\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\n />\n </div>\n }\n\n <div\n [style.gridColumn]=\"\n slotGridSpan(informativeState().config.layout.tableSpan)\n \"\n >\n <mt-card>\n @if (\n informativeState().loading &&\n !informativeState().dashboardData?.charts?.length\n ) {\n <div class=\"flex flex-col gap-3 py-3\">\n <p-skeleton height=\"6rem\" />\n <p-skeleton height=\"12rem\" />\n <p-skeleton height=\"12rem\" />\n </div>\n } @else if (informativeState().error) {\n <div\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\n >\n {{ informativeState().error }}\n </div>\n } @else if (!informativeState().dashboardData?.charts?.length) {\n <div class=\"p-6 text-center text-gray-400\">\n {{\n \"components.clientComponents.list.noInformativeDashboard\"\n | transloco\n }}\n </div>\n } @else {\n <div class=\"min-h-[420px]\">\n <mt-dashboard-viewer\n [isPage]=\"false\"\n [showFilters]=\"false\"\n [dashboardData]=\"informativeState().dashboardData\"\n [extraFilters]=\"dashboardExtraFilters()\"\n />\n </div>\n }\n </mt-card>\n </div>\n\n @if (informativeState().config.contentEnd) {\n <div\n [style.gridColumn]=\"\n slotGridSpan(informativeState().config.layout.endSpan)\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"informativeState().config.contentEnd\"\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\n />\n </div>\n }\n</div>\n" }]
|
|
2754
|
+
args: [{ selector: 'mt-client-list-informative-view', standalone: true, imports: [CommonModule, Card, DashboardViewer, SkeletonModule, TranslocoPipe], template: "<div class=\"grid gap-4\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n @if (informativeState().config.contentStart) {\r\n <div\r\n [style.gridColumn]=\"\r\n slotGridSpan(informativeState().config.layout.startSpan)\r\n \"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"informativeState().config.contentStart\"\r\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\r\n />\r\n </div>\r\n }\r\n\r\n <div\r\n [style.gridColumn]=\"\r\n slotGridSpan(informativeState().config.layout.tableSpan)\r\n \"\r\n >\r\n <mt-card>\r\n @if (\r\n informativeState().loading &&\r\n !informativeState().dashboardData?.charts?.length\r\n ) {\r\n <div class=\"flex flex-col gap-3 py-3\">\r\n <p-skeleton height=\"6rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n <p-skeleton height=\"12rem\" />\r\n </div>\r\n } @else if (informativeState().error) {\r\n <div\r\n class=\"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700\"\r\n >\r\n {{ informativeState().error }}\r\n </div>\r\n } @else if (!informativeState().dashboardData?.charts?.length) {\r\n <div class=\"p-6 text-center text-gray-400\">\r\n {{\r\n \"components.clientComponents.list.noInformativeDashboard\"\r\n | transloco\r\n }}\r\n </div>\r\n } @else {\r\n <div class=\"min-h-[420px]\">\r\n <mt-dashboard-viewer\r\n [isPage]=\"false\"\r\n [showFilters]=\"false\"\r\n [dashboardData]=\"informativeState().dashboardData\"\r\n [extraFilters]=\"dashboardExtraFilters()\"\r\n />\r\n </div>\r\n }\r\n </mt-card>\r\n </div>\r\n\r\n @if (informativeState().config.contentEnd) {\r\n <div\r\n [style.gridColumn]=\"\r\n slotGridSpan(informativeState().config.layout.endSpan)\r\n \"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"informativeState().config.contentEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(informativeState())\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n" }]
|
|
2323
2755
|
}], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }] } });
|
|
2324
2756
|
|
|
2325
2757
|
function mergeRuntimeFilters(configured = [], runtime = {}, columns = []) {
|
|
@@ -2502,6 +2934,7 @@ const ESCALATION_STATE_KEY = 'escalation';
|
|
|
2502
2934
|
const VIEW_ESCALATION_ACTION_KEY = 'viewEscalation';
|
|
2503
2935
|
const VIEW_ESCALATION_OPERATION_KEY = 'ViewEscalation';
|
|
2504
2936
|
class ClientList {
|
|
2937
|
+
nativeGrid = inject(MT_TABLE_RENDERER, { optional: true }) !== null;
|
|
2505
2938
|
api = inject(ClientListApiService);
|
|
2506
2939
|
state = inject(ClientListStateService);
|
|
2507
2940
|
runtimeActions = inject(ClientListRuntimeActionsService);
|
|
@@ -2509,6 +2942,8 @@ class ClientList {
|
|
|
2509
2942
|
transloco = inject(TranslocoService);
|
|
2510
2943
|
configurations = input.required(...(ngDevMode ? [{ debugName: "configurations" }] : /* istanbul ignore next */ []));
|
|
2511
2944
|
defaultTake = input(DEFAULT_SERVER_PAGE_SIZE, ...(ngDevMode ? [{ debugName: "defaultTake" }] : /* istanbul ignore next */ []));
|
|
2945
|
+
/** Native API access for product-specific features; no grid options are hidden behind ClientList. */
|
|
2946
|
+
gridReady = output();
|
|
2512
2947
|
loaded = output();
|
|
2513
2948
|
errored = output();
|
|
2514
2949
|
itemClicked = output();
|
|
@@ -3213,14 +3648,15 @@ class ClientList {
|
|
|
3213
3648
|
this.inFlightRequestSignatures.set(key, requestSignature);
|
|
3214
3649
|
this.state.setLoading(key, true);
|
|
3215
3650
|
this.state.setError(key, null);
|
|
3216
|
-
const
|
|
3217
|
-
.
|
|
3218
|
-
.
|
|
3651
|
+
const request = this.nativeGrid
|
|
3652
|
+
? this.api.getAllRows(config.contextKey, query, filters, config.hierarchy)
|
|
3653
|
+
: this.api.getRows(config.contextKey, query, filters, config.hierarchy);
|
|
3654
|
+
const sub = request.subscribe({
|
|
3219
3655
|
next: ({ response, propertyKeys }) => {
|
|
3220
3656
|
let hasLoadedData = false;
|
|
3221
3657
|
if (response.data) {
|
|
3222
3658
|
this.requestPropertyKeys.set(key, propertyKeys);
|
|
3223
|
-
this.state.setRowsResult(key, response.data, config, query.skip, query.take);
|
|
3659
|
+
this.state.setRowsResult(key, response.data, config, query.skip, query.take, this.nativeGrid);
|
|
3224
3660
|
this.fulfilledRequestSignatures.set(key, requestSignature);
|
|
3225
3661
|
hasLoadedData = true;
|
|
3226
3662
|
}
|
|
@@ -3658,7 +4094,7 @@ class ClientList {
|
|
|
3658
4094
|
return mergeRuntimeFilters(config.filters, this.runtimeFilters.get(key), this.state.itemsByKey()[key]?.columns);
|
|
3659
4095
|
}
|
|
3660
4096
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3661
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientList, isStandalone: true, selector: "mt-client-list", inputs: { configurations: { classPropertyName: "configurations", publicName: "configurations", isSignal: true, isRequired: true, transformFunction: null }, defaultTake: { classPropertyName: "defaultTake", publicName: "defaultTake", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", errored: "errored", itemClicked: "itemClicked" }, providers: [
|
|
4097
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientList, isStandalone: true, selector: "mt-client-list", inputs: { configurations: { classPropertyName: "configurations", publicName: "configurations", isSignal: true, isRequired: true, transformFunction: null }, defaultTake: { classPropertyName: "defaultTake", publicName: "defaultTake", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridReady: "gridReady", loaded: "loaded", errored: "errored", itemClicked: "itemClicked" }, providers: [
|
|
3662
4098
|
ClientListStateService,
|
|
3663
4099
|
ClientListRuntimeActionsService,
|
|
3664
4100
|
ClientListToolbarService,
|
|
@@ -3668,7 +4104,7 @@ class ClientList {
|
|
|
3668
4104
|
// value instead (`EntityData.runtimeContext`), and the table opens only
|
|
3669
4105
|
// in the drawer.
|
|
3670
4106
|
provideEntityListTablePreview(),
|
|
3671
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\n @for (item of items(); track item.key) {\n <section class=\"flex flex-col gap-4\">\n @if (item.config.showHeader) {\n <div class=\"flex w-full items-center gap-2\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\n @if (item.config.collapse.enabled) {\n <mt-button\n variant=\"text\"\n severity=\"secondary\"\n [icon]=\"\n item.expanded\n ? item.config.collapse.collapseIcon\n : item.config.collapse.expandIcon\n \"\n (onClick)=\"toggleExpanded(item.key)\"\n />\n }\n <h3 class=\"m-0 text-lg font-semibold\">\n {{ item.title || item.moduleKey || defaultTitle(item) }}\n </h3>\n @if (item.config.headerStart) {\n <div class=\"flex items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"item.config.headerStart\"\n [ngTemplateOutletContext]=\"templateContext(item)\"\n />\n </div>\n }\n </div>\n @if (item.config.headerEnd) {\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"item.config.headerEnd\"\n [ngTemplateOutletContext]=\"templateContext(item)\"\n />\n </div>\n }\n </div>\n }\n\n @if (item.expanded || !item.config.collapse.enabled) {\n @if (item.config.templateContent) {\n <ng-container\n [ngTemplateOutlet]=\"item.config.templateContent\"\n [ngTemplateOutletContext]=\"templateContext(item)\"\n />\n } @else if (item.type === \"informative\") {\n <mt-client-list-informative-view [state]=\"item\" />\n } @else if (item.areaType === \"table\") {\n <mt-client-list-table-view\n [state]=\"item\"\n [rowActions]=\"rowActionsFor(item)\"\n [actionShape]=\"item.config.actionShape\"\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\n (rowClick)=\"onTableRowClick(item, $event)\"\n />\n } @else {\n <mt-client-list-cards-view\n [state]=\"item\"\n [rowActions]=\"rowActionsFor(item)\"\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\n (loadMore)=\"loadMoreCards(item.key)\"\n (cardClick)=\"onCardClick(item, $event)\"\n />\n }\n }\n </section>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ClientListTableView, selector: "mt-client-list-table-view", inputs: ["state", "rowActions", "actionShape", "rowActionsLoadingFn"], outputs: ["lazyLoad", "rowClick", "rowActionsRequested"] }, { kind: "component", type: ClientListCardsView, selector: "mt-client-list-cards-view", inputs: ["state", "rowActions", "rowActionsLoadingFn"], outputs: ["lazyLoad", "loadMore", "cardClick", "rowActionsRequested"] }, { kind: "component", type: ClientListInformativeView, selector: "mt-client-list-informative-view", inputs: ["state"] }] });
|
|
4107
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\r\n @for (item of items(); track item.key) {\r\n <section class=\"flex flex-col gap-4\">\r\n @if (item.config.showHeader) {\r\n <div class=\"flex w-full items-center gap-2\">\r\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\r\n @if (item.config.collapse.enabled) {\r\n <mt-button\r\n variant=\"text\"\r\n severity=\"secondary\"\r\n [icon]=\"\r\n item.expanded\r\n ? item.config.collapse.collapseIcon\r\n : item.config.collapse.expandIcon\r\n \"\r\n (onClick)=\"toggleExpanded(item.key)\"\r\n />\r\n }\r\n <h3 class=\"m-0 text-lg font-semibold\">\r\n {{ item.title || item.moduleKey || defaultTitle(item) }}\r\n </h3>\r\n @if (item.config.headerStart) {\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"item.config.headerStart\"\r\n [ngTemplateOutletContext]=\"templateContext(item)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n @if (item.config.headerEnd) {\r\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"item.config.headerEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(item)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (item.expanded || !item.config.collapse.enabled) {\r\n @if (item.config.templateContent) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"item.config.templateContent\"\r\n [ngTemplateOutletContext]=\"templateContext(item)\"\r\n />\r\n } @else if (item.type === \"informative\") {\r\n <mt-client-list-informative-view [state]=\"item\" />\r\n } @else if (item.areaType === \"table\") {\r\n <mt-client-list-table-view\r\n [state]=\"item\"\r\n [rowActions]=\"rowActionsFor(item)\"\r\n [actionShape]=\"item.config.actionShape\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\r\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\r\n (nativeGridReady)=\"gridReady.emit({ key: item.key, event: $event })\"\r\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\r\n (rowClick)=\"onTableRowClick(item, $event)\"\r\n />\r\n } @else {\r\n <mt-client-list-cards-view\r\n [state]=\"item\"\r\n [rowActions]=\"rowActionsFor(item)\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\r\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\r\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\r\n (loadMore)=\"loadMoreCards(item.key)\"\r\n (cardClick)=\"onCardClick(item, $event)\"\r\n />\r\n }\r\n }\r\n </section>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ClientListTableView, selector: "mt-client-list-table-view", inputs: ["state", "rowActions", "actionShape", "rowActionsLoadingFn"], outputs: ["nativeGridReady", "lazyLoad", "rowClick", "rowActionsRequested"] }, { kind: "component", type: ClientListCardsView, selector: "mt-client-list-cards-view", inputs: ["state", "rowActions", "rowActionsLoadingFn"], outputs: ["lazyLoad", "loadMore", "cardClick", "rowActionsRequested"] }, { kind: "component", type: ClientListInformativeView, selector: "mt-client-list-informative-view", inputs: ["state"] }] });
|
|
3672
4108
|
}
|
|
3673
4109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientList, decorators: [{
|
|
3674
4110
|
type: Component,
|
|
@@ -3688,8 +4124,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3688
4124
|
// value instead (`EntityData.runtimeContext`), and the table opens only
|
|
3689
4125
|
// in the drawer.
|
|
3690
4126
|
provideEntityListTablePreview(),
|
|
3691
|
-
], template: "<div class=\"flex flex-col gap-4\">\n @for (item of items(); track item.key) {\n <section class=\"flex flex-col gap-4\">\n @if (item.config.showHeader) {\n <div class=\"flex w-full items-center gap-2\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\n @if (item.config.collapse.enabled) {\n <mt-button\n variant=\"text\"\n severity=\"secondary\"\n [icon]=\"\n item.expanded\n ? item.config.collapse.collapseIcon\n : item.config.collapse.expandIcon\n \"\n (onClick)=\"toggleExpanded(item.key)\"\n />\n }\n <h3 class=\"m-0 text-lg font-semibold\">\n {{ item.title || item.moduleKey || defaultTitle(item) }}\n </h3>\n @if (item.config.headerStart) {\n <div class=\"flex items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"item.config.headerStart\"\n [ngTemplateOutletContext]=\"templateContext(item)\"\n />\n </div>\n }\n </div>\n @if (item.config.headerEnd) {\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"item.config.headerEnd\"\n [ngTemplateOutletContext]=\"templateContext(item)\"\n />\n </div>\n }\n </div>\n }\n\n @if (item.expanded || !item.config.collapse.enabled) {\n @if (item.config.templateContent) {\n <ng-container\n [ngTemplateOutlet]=\"item.config.templateContent\"\n [ngTemplateOutletContext]=\"templateContext(item)\"\n />\n } @else if (item.type === \"informative\") {\n <mt-client-list-informative-view [state]=\"item\" />\n } @else if (item.areaType === \"table\") {\n <mt-client-list-table-view\n [state]=\"item\"\n [rowActions]=\"rowActionsFor(item)\"\n [actionShape]=\"item.config.actionShape\"\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\n (rowClick)=\"onTableRowClick(item, $event)\"\n />\n } @else {\n <mt-client-list-cards-view\n [state]=\"item\"\n [rowActions]=\"rowActionsFor(item)\"\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\n (loadMore)=\"loadMoreCards(item.key)\"\n (cardClick)=\"onCardClick(item, $event)\"\n />\n }\n }\n </section>\n }\n</div>\n" }]
|
|
3692
|
-
}], ctorParameters: () => [], propDecorators: { configurations: [{ type: i0.Input, args: [{ isSignal: true, alias: "configurations", required: true }] }], defaultTake: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultTake", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], errored: [{ type: i0.Output, args: ["errored"] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }] } });
|
|
4127
|
+
], template: "<div class=\"flex flex-col gap-4\">\r\n @for (item of items(); track item.key) {\r\n <section class=\"flex flex-col gap-4\">\r\n @if (item.config.showHeader) {\r\n <div class=\"flex w-full items-center gap-2\">\r\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\r\n @if (item.config.collapse.enabled) {\r\n <mt-button\r\n variant=\"text\"\r\n severity=\"secondary\"\r\n [icon]=\"\r\n item.expanded\r\n ? item.config.collapse.collapseIcon\r\n : item.config.collapse.expandIcon\r\n \"\r\n (onClick)=\"toggleExpanded(item.key)\"\r\n />\r\n }\r\n <h3 class=\"m-0 text-lg font-semibold\">\r\n {{ item.title || item.moduleKey || defaultTitle(item) }}\r\n </h3>\r\n @if (item.config.headerStart) {\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"item.config.headerStart\"\r\n [ngTemplateOutletContext]=\"templateContext(item)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n @if (item.config.headerEnd) {\r\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"item.config.headerEnd\"\r\n [ngTemplateOutletContext]=\"templateContext(item)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (item.expanded || !item.config.collapse.enabled) {\r\n @if (item.config.templateContent) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"item.config.templateContent\"\r\n [ngTemplateOutletContext]=\"templateContext(item)\"\r\n />\r\n } @else if (item.type === \"informative\") {\r\n <mt-client-list-informative-view [state]=\"item\" />\r\n } @else if (item.areaType === \"table\") {\r\n <mt-client-list-table-view\r\n [state]=\"item\"\r\n [rowActions]=\"rowActionsFor(item)\"\r\n [actionShape]=\"item.config.actionShape\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\r\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\r\n (nativeGridReady)=\"gridReady.emit({ key: item.key, event: $event })\"\r\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\r\n (rowClick)=\"onTableRowClick(item, $event)\"\r\n />\r\n } @else {\r\n <mt-client-list-cards-view\r\n [state]=\"item\"\r\n [rowActions]=\"rowActionsFor(item)\"\r\n [rowActionsLoadingFn]=\"rowActionsLoadingFnFor(item)\"\r\n (rowActionsRequested)=\"onRowActionsRequested(item, $event)\"\r\n (lazyLoad)=\"onLazyLoad(item.key, $event)\"\r\n (loadMore)=\"loadMoreCards(item.key)\"\r\n (cardClick)=\"onCardClick(item, $event)\"\r\n />\r\n }\r\n }\r\n </section>\r\n }\r\n</div>\r\n" }]
|
|
4128
|
+
}], ctorParameters: () => [], propDecorators: { configurations: [{ type: i0.Input, args: [{ isSignal: true, alias: "configurations", required: true }] }], defaultTake: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultTake", required: false }] }], gridReady: [{ type: i0.Output, args: ["gridReady"] }], loaded: [{ type: i0.Output, args: ["loaded"] }], errored: [{ type: i0.Output, args: ["errored"] }], itemClicked: [{ type: i0.Output, args: ["itemClicked"] }] } });
|
|
3693
4129
|
|
|
3694
4130
|
/**
|
|
3695
4131
|
* Generated bundle index. Do not edit.
|