@gilav21/shadcn-angular-data-table 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -25
- package/fesm2022/gilav21-shadcn-angular-data-table.mjs +568 -203
- package/fesm2022/gilav21-shadcn-angular-data-table.mjs.map +1 -1
- package/package.json +6 -2
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.cjs +169 -0
- package/schematics/ng-add/schema.json +13 -0
- package/styles.css +2 -0
- package/types/gilav21-shadcn-angular-data-table.d.ts +130 -18
- package/types/gilav21-shadcn-angular-data-table.d.ts.map +1 -1
- package/theme.css +0 -159
|
@@ -70,7 +70,7 @@ function getClippingRect(element) {
|
|
|
70
70
|
/**
|
|
71
71
|
* Check if the user prefers reduced motion via the OS-level accessibility setting.
|
|
72
72
|
*/
|
|
73
|
-
function prefersReducedMotion() {
|
|
73
|
+
function prefersReducedMotion$1() {
|
|
74
74
|
return globalThis.window?.matchMedia('(prefers-reduced-motion: reduce)').matches ?? false;
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -108,18 +108,30 @@ function parseNlFilterSpec(raw, validColumnKeys) {
|
|
|
108
108
|
}
|
|
109
109
|
return spec;
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* The window of fixed-height rows to render: every row that intersects
|
|
113
|
+
* `[scroll, scroll + viewport)` — `end` is the first row whose leading edge is at
|
|
114
|
+
* or past `scroll + viewport` — widened by `buffer` rows on each side and clamped
|
|
115
|
+
* to `[0, total]`.
|
|
116
|
+
*/
|
|
111
117
|
function computeRowRange(scrollTop, viewportHeight, rowHeight, totalRows, buffer) {
|
|
112
118
|
if (totalRows === 0 || rowHeight <= 0) {
|
|
113
119
|
return { start: 0, end: 0 };
|
|
114
120
|
}
|
|
115
121
|
const startRow = Math.floor(scrollTop / rowHeight);
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
// Measured from scrollTop, not from startRow's top edge: a partly hidden first
|
|
123
|
+
// row would otherwise use up viewport height and drop the last visible row.
|
|
124
|
+
const endRow = Math.ceil((scrollTop + viewportHeight) / rowHeight);
|
|
118
125
|
return {
|
|
119
|
-
start: Math.max(0, startRow - buffer),
|
|
126
|
+
start: Math.min(totalRows, Math.max(0, startRow - buffer)),
|
|
120
127
|
end: Math.min(totalRows, endRow + buffer),
|
|
121
128
|
};
|
|
122
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* The window of columns to render, with the same contract as
|
|
132
|
+
* {@link computeRowRange}; the paddings are the widths of the columns left out on
|
|
133
|
+
* each side.
|
|
134
|
+
*/
|
|
123
135
|
function computeColumnRange(scrollLeft, viewportWidth, columnWidths, buffer) {
|
|
124
136
|
if (columnWidths.length === 0) {
|
|
125
137
|
return { start: 0, end: 0, paddingLeft: 0, paddingRight: 0 };
|
|
@@ -136,14 +148,15 @@ function computeColumnRange(scrollLeft, viewportWidth, columnWidths, buffer) {
|
|
|
136
148
|
startCol = columnWidths.length;
|
|
137
149
|
}
|
|
138
150
|
}
|
|
151
|
+
// `offset` is startCol's left edge; walking edges up to scrollLeft + viewportWidth
|
|
152
|
+
// (rather than summing whole widths against viewportWidth) keeps the part of
|
|
153
|
+
// startCol scrolled out of view from displacing the last visible column.
|
|
154
|
+
const viewportEnd = scrollLeft + viewportWidth;
|
|
139
155
|
let endCol = startCol;
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
endCol
|
|
144
|
-
if (widthAccum >= viewportWidth) {
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
156
|
+
let edge = offset;
|
|
157
|
+
while (endCol < columnWidths.length && edge < viewportEnd) {
|
|
158
|
+
edge += columnWidths[endCol];
|
|
159
|
+
endCol++;
|
|
147
160
|
}
|
|
148
161
|
const bufferedStart = Math.max(0, startCol - buffer);
|
|
149
162
|
const bufferedEnd = Math.min(columnWidths.length, endCol + buffer);
|
|
@@ -183,6 +196,11 @@ function binarySearchPrefix(prefixSums, target, totalRows) {
|
|
|
183
196
|
}
|
|
184
197
|
return Math.min(lo, totalRows);
|
|
185
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* The window of variable-height rows to render, with the same contract as
|
|
201
|
+
* {@link computeRowRange}. Uses `prefixSums` (see {@link buildPrefixSums}) when it
|
|
202
|
+
* matches `totalRows`, otherwise walks `getRowHeight`.
|
|
203
|
+
*/
|
|
186
204
|
function computeVariableRowRange(scrollTop, viewportHeight, getRowHeight, totalRows, buffer, prefixSums) {
|
|
187
205
|
if (totalRows === 0) {
|
|
188
206
|
return { start: 0, end: 0, paddingTop: 0, paddingBottom: 0 };
|
|
@@ -225,14 +243,14 @@ function computeVariableRowRangeLinear(scrollTop, viewportHeight, getRowHeight,
|
|
|
225
243
|
startRow = totalRows;
|
|
226
244
|
}
|
|
227
245
|
}
|
|
246
|
+
// `offset` is startRow's top edge — see computeColumnRange for why the walk
|
|
247
|
+
// runs to scrollTop + viewportHeight instead of summing whole heights.
|
|
248
|
+
const viewportEnd = scrollTop + viewportHeight;
|
|
228
249
|
let endRow = startRow;
|
|
229
|
-
let
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
endRow
|
|
233
|
-
if (viewAccum >= viewportHeight) {
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
250
|
+
let edge = offset;
|
|
251
|
+
while (endRow < totalRows && edge < viewportEnd) {
|
|
252
|
+
edge += getRowHeight(endRow);
|
|
253
|
+
endRow++;
|
|
236
254
|
}
|
|
237
255
|
const bufferedStart = Math.max(0, startRow - buffer);
|
|
238
256
|
const bufferedEnd = Math.min(totalRows, endRow + buffer);
|
|
@@ -336,6 +354,11 @@ const MS_PER_DAY = 86_400_000;
|
|
|
336
354
|
function mod(n, m) {
|
|
337
355
|
return ((n % m) + m) % m;
|
|
338
356
|
}
|
|
357
|
+
/** The year, month and day of a date-only ISO string (`YYYY-MM-DD`), or `null` for any other string. */
|
|
358
|
+
function dateOnlyParts(v) {
|
|
359
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(v);
|
|
360
|
+
return match ? { y: +match[1], m: +match[2], d: +match[3] } : null;
|
|
361
|
+
}
|
|
339
362
|
function parseDateCell(v) {
|
|
340
363
|
if (v instanceof Date) {
|
|
341
364
|
return Number.isNaN(v.getTime())
|
|
@@ -343,10 +366,9 @@ function parseDateCell(v) {
|
|
|
343
366
|
: { ymd: { y: v.getFullYear(), m: v.getMonth() + 1, d: v.getDate() }, kind: 'date' };
|
|
344
367
|
}
|
|
345
368
|
if (typeof v === 'string') {
|
|
346
|
-
const
|
|
347
|
-
if (
|
|
348
|
-
return { ymd
|
|
349
|
-
}
|
|
369
|
+
const ymd = dateOnlyParts(v);
|
|
370
|
+
if (ymd)
|
|
371
|
+
return { ymd, kind: 'iso' };
|
|
350
372
|
}
|
|
351
373
|
return null;
|
|
352
374
|
}
|
|
@@ -660,16 +682,32 @@ function evaluateAdvancedFilter(group, getValue) {
|
|
|
660
682
|
* an editor that insisted on one of those would be unusable on the other two.
|
|
661
683
|
* Anything that is not a real date reads as `null` rather than as
|
|
662
684
|
* `Invalid Date`, which renders as the string "Invalid Date" if it escapes.
|
|
685
|
+
*
|
|
686
|
+
* A date-only string (`YYYY-MM-DD`) names a calendar day, so it reads as
|
|
687
|
+
* local midnight of that day — the counterpart of {@link toLocalDateString}.
|
|
688
|
+
* The `Date` parser would read it as UTC midnight: the previous day anywhere
|
|
689
|
+
* west of Greenwich. Date-time strings and epoch numbers name an instant and
|
|
690
|
+
* go to the parser.
|
|
663
691
|
*/
|
|
664
692
|
function asEditableDate(value) {
|
|
665
693
|
if (value instanceof Date)
|
|
666
694
|
return Number.isNaN(value.getTime()) ? null : value;
|
|
695
|
+
if (typeof value === 'string') {
|
|
696
|
+
const ymd = dateOnlyParts(value);
|
|
697
|
+
if (ymd)
|
|
698
|
+
return localDay(ymd);
|
|
699
|
+
}
|
|
667
700
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
668
701
|
const parsed = new Date(value);
|
|
669
702
|
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
670
703
|
}
|
|
671
704
|
return null;
|
|
672
705
|
}
|
|
706
|
+
/** Local midnight of `ymd`, or `null` when no such day exists (`2026-02-30` would roll into March). */
|
|
707
|
+
function localDay(ymd) {
|
|
708
|
+
const date = ymdToDate(ymd);
|
|
709
|
+
return date.getMonth() === ymd.m - 1 && date.getDate() === ymd.d ? date : null;
|
|
710
|
+
}
|
|
673
711
|
/**
|
|
674
712
|
* A date as `YYYY-MM-DD`, in the **local** calendar.
|
|
675
713
|
*
|
|
@@ -696,6 +734,60 @@ function toEditedDateValue(picked, previous) {
|
|
|
696
734
|
return typeof previous === 'string' ? toLocalDateString(picked) : picked;
|
|
697
735
|
}
|
|
698
736
|
|
|
737
|
+
/**
|
|
738
|
+
* Characters that make Excel, LibreOffice and Google Sheets read a cell as a
|
|
739
|
+
* formula when they lead it (OWASP "CSV Injection"). Tab and CR are on the list
|
|
740
|
+
* because some importers strip them and then see the character behind.
|
|
741
|
+
*/
|
|
742
|
+
const FORMULA_TRIGGERS = new Set(['=', '+', '-', '@', '\t', '\r']);
|
|
743
|
+
/** A whole cell that is a signed decimal number, which a spreadsheet stores as a number, never a formula. */
|
|
744
|
+
const PLAIN_NUMBER = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
745
|
+
/**
|
|
746
|
+
* Whether a cell must be quoted. A cell that already starts with the quote
|
|
747
|
+
* counts when the text behind it does, so that a genuine `'=x` is quoted to
|
|
748
|
+
* `''=x` and {@link restoreSpreadsheetText} can undo exactly what was added.
|
|
749
|
+
*/
|
|
750
|
+
function needsFormulaGuard(cell) {
|
|
751
|
+
let start = 0;
|
|
752
|
+
while (cell.charAt(start) === "'")
|
|
753
|
+
start++;
|
|
754
|
+
const text = cell.slice(start);
|
|
755
|
+
return FORMULA_TRIGGERS.has(text.charAt(0)) && !PLAIN_NUMBER.test(text);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Makes a cell safe to hand to a spreadsheet: a value that starts with `=`,
|
|
759
|
+
* `+`, `-`, `@`, a tab or a carriage return gets a leading single quote, so
|
|
760
|
+
* the spreadsheet stores it as text rather than running it as a formula (for
|
|
761
|
+
* example `=HYPERLINK(...)` or a DDE payload typed by an end user). A cell
|
|
762
|
+
* whose whole text is a plain number, such as `-12`, `+3.5` or `-1e3`, is left
|
|
763
|
+
* alone so it stays numeric.
|
|
764
|
+
*
|
|
765
|
+
* Apply it to every cell of a CSV/TSV export or a clipboard copy, before any
|
|
766
|
+
* CSV quoting. XLSX needs no guard, because it stores strings as typed string
|
|
767
|
+
* cells. {@link restoreSpreadsheetText} is its exact inverse.
|
|
768
|
+
*
|
|
769
|
+
* @example
|
|
770
|
+
* guardSpreadsheetFormula('=SUM(A1:A2)'); // "'=SUM(A1:A2)"
|
|
771
|
+
* guardSpreadsheetFormula('-12'); // "-12"
|
|
772
|
+
*/
|
|
773
|
+
function guardSpreadsheetFormula(cell) {
|
|
774
|
+
return needsFormulaGuard(cell) ? `'${cell}` : cell;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Undoes {@link guardSpreadsheetFormula}: drops the leading single quote
|
|
778
|
+
* only when the rest of the cell is something the guard would have quoted,
|
|
779
|
+
* the way a spreadsheet consumes that quote on paste. Any other text,
|
|
780
|
+
* including an ordinary value that starts with an apostrophe, is returned
|
|
781
|
+
* unchanged, so `restoreSpreadsheetText(guardSpreadsheetFormula(x)) === x`
|
|
782
|
+
* for every string.
|
|
783
|
+
*/
|
|
784
|
+
function restoreSpreadsheetText(cell) {
|
|
785
|
+
if (cell.startsWith("'") && needsFormulaGuard(cell.slice(1))) {
|
|
786
|
+
return cell.slice(1);
|
|
787
|
+
}
|
|
788
|
+
return cell;
|
|
789
|
+
}
|
|
790
|
+
|
|
699
791
|
const DATA_TABLE_LOCALES = {
|
|
700
792
|
en: {
|
|
701
793
|
code: 'en',
|
|
@@ -1017,6 +1109,20 @@ class AddonSlotRegistry {
|
|
|
1017
1109
|
class DataTableAddonHost {
|
|
1018
1110
|
}
|
|
1019
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* Media-query reads that degrade where `matchMedia` does not exist.
|
|
1114
|
+
*
|
|
1115
|
+
* SSR and jsdom (where consumers' own unit tests run) have no `matchMedia`;
|
|
1116
|
+
* every helper here answers its documented default there instead of throwing.
|
|
1117
|
+
*/
|
|
1118
|
+
/**
|
|
1119
|
+
* Check if the user prefers reduced motion via the OS-level accessibility setting.
|
|
1120
|
+
* Returns `false` where `matchMedia` does not exist, so callers animate as normal.
|
|
1121
|
+
*/
|
|
1122
|
+
function prefersReducedMotion() {
|
|
1123
|
+
return globalThis.window?.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1020
1126
|
class UiRippleDirective {
|
|
1021
1127
|
constructor() {
|
|
1022
1128
|
this.el = inject(ElementRef);
|
|
@@ -1299,6 +1405,21 @@ class ButtonComponent {
|
|
|
1299
1405
|
this.hostAriaLabel = inject(ElementRef).nativeElement.getAttribute('aria-label') ?? undefined;
|
|
1300
1406
|
/** The name actually applied to the inner `<button>`, from either spelling. */
|
|
1301
1407
|
this.resolvedAriaLabel = computed(() => this.ariaLabel() ?? this.hostAriaLabel, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1408
|
+
/**
|
|
1409
|
+
* Disclosure state for a button that shows and hides something:
|
|
1410
|
+
* `[aria-expanded]="open()"`. Lands on the inner `<button>`, where
|
|
1411
|
+
* assistive technology reads it. Unset leaves the attribute off.
|
|
1412
|
+
*/
|
|
1413
|
+
this.ariaExpanded = input(undefined, { ...(ngDevMode ? { debugName: "ariaExpanded" } : /* istanbul ignore next */ {}), alias: 'aria-expanded' });
|
|
1414
|
+
/**
|
|
1415
|
+
* Toggle state for a button that stays pressed: `[aria-pressed]="on()"`,
|
|
1416
|
+
* or `'mixed'`. Lands on the inner `<button>`. Unset leaves it off.
|
|
1417
|
+
*/
|
|
1418
|
+
this.ariaPressed = input(undefined, { ...(ngDevMode ? { debugName: "ariaPressed" } : /* istanbul ignore next */ {}), alias: 'aria-pressed' });
|
|
1419
|
+
/** Kind of popup a menu button opens: `aria-haspopup="menu"`. Lands on the inner `<button>`. */
|
|
1420
|
+
this.ariaHaspopup = input(undefined, { ...(ngDevMode ? { debugName: "ariaHaspopup" } : /* istanbul ignore next */ {}), alias: 'aria-haspopup' });
|
|
1421
|
+
/** Id of the element this button shows, hides or drives: `aria-controls="panel-id"`. Lands on the inner `<button>`. */
|
|
1422
|
+
this.ariaControls = input(undefined, { ...(ngDevMode ? { debugName: "ariaControls" } : /* istanbul ignore next */ {}), alias: 'aria-controls' });
|
|
1302
1423
|
/**
|
|
1303
1424
|
* Convenience text label. When set it replaces projected content — pass
|
|
1304
1425
|
* either this or `<ng-content>`, not both.
|
|
@@ -1320,7 +1441,7 @@ class ButtonComponent {
|
|
|
1320
1441
|
this.classes = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.loading() && 'relative', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
1321
1442
|
}
|
|
1322
1443
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1323
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ButtonComponent, isStandalone: true, selector: "ui-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, rippleColor: { classPropertyName: "rippleColor", publicName: "rippleColor", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class": "\"contents\"", "attr.data-size": "size()", "attr.aria-label": "null" } }, ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-24 rounded-md\" />\n} @else {\n <button\n uiRipple\n [uiRippleDisabled]=\"!ripple()\"\n [uiRippleColor]=\"rippleColor()\"\n [class]=\"classes()\"\n [disabled]=\"disabled() || loading()\"\n [type]=\"type()\"\n [attr.data-slot]=\"'button'\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (click)=\"clicked.emit($event)\"\n >\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center\" aria-hidden=\"true\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (label()) {\n {{ label() }}\n } @else {\n <ng-content />\n }\n </button>\n}\n", styles: [":host{--_d: var(--density-button, var(--density, 1))}@layer components{[data-slot=button]{height:calc(2.25rem * var(--_d));padding-inline:calc(1rem * var(--_d))}:host([data-size=\"sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));padding-inline:calc(.75rem * var(--_d))}:host([data-size=\"lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));padding-inline:calc(2rem * var(--_d))}:host([data-size=\"icon\"]) [data-slot=button]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d));padding:0}:host([data-size=\"icon-sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));width:calc(2rem * var(--_d));padding:0}:host([data-size=\"icon-lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));width:calc(2.5rem * var(--_d));padding:0}}\n"], dependencies: [{ kind: "directive", type: UiRippleDirective, selector: "[uiRipple]", inputs: ["uiRippleColor", "uiRippleDuration", "uiRippleDisabled"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1444
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ButtonComponent, isStandalone: true, selector: "ui-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "aria-expanded", isSignal: true, isRequired: false, transformFunction: null }, ariaPressed: { classPropertyName: "ariaPressed", publicName: "aria-pressed", isSignal: true, isRequired: false, transformFunction: null }, ariaHaspopup: { classPropertyName: "ariaHaspopup", publicName: "aria-haspopup", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "aria-controls", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, rippleColor: { classPropertyName: "rippleColor", publicName: "rippleColor", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class": "\"contents\"", "attr.data-size": "size()", "attr.aria-label": "null", "attr.aria-expanded": "null", "attr.aria-pressed": "null", "attr.aria-controls": "null", "attr.aria-haspopup": "null" } }, ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-24 rounded-md\" />\n} @else {\n <button\n uiRipple\n [uiRippleDisabled]=\"!ripple()\"\n [uiRippleColor]=\"rippleColor()\"\n [class]=\"classes()\"\n [disabled]=\"disabled() || loading()\"\n [type]=\"type()\"\n [attr.data-slot]=\"'button'\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-pressed]=\"ariaPressed() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-haspopup]=\"ariaHaspopup() ?? null\"\n (click)=\"clicked.emit($event)\"\n >\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center\" aria-hidden=\"true\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (label()) {\n {{ label() }}\n } @else {\n <ng-content />\n }\n </button>\n}\n", styles: [":host{--_d: var(--density-button, var(--density, 1))}@layer components{[data-slot=button]{height:calc(2.25rem * var(--_d));padding-inline:calc(1rem * var(--_d))}:host([data-size=\"sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));padding-inline:calc(.75rem * var(--_d))}:host([data-size=\"lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));padding-inline:calc(2rem * var(--_d))}:host([data-size=\"icon\"]) [data-slot=button]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d));padding:0}:host([data-size=\"icon-sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));width:calc(2rem * var(--_d));padding:0}:host([data-size=\"icon-lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));width:calc(2.5rem * var(--_d));padding:0}}\n"], dependencies: [{ kind: "directive", type: UiRippleDirective, selector: "[uiRipple]", inputs: ["uiRippleColor", "uiRippleDuration", "uiRippleDisabled"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1324
1445
|
}
|
|
1325
1446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
1326
1447
|
type: Component,
|
|
@@ -1332,8 +1453,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1332
1453
|
// the inner <button>, leaving it nameless (axe `button-name`). Consume it
|
|
1333
1454
|
// via the `aria-label` aliased input below and strip it from the host.
|
|
1334
1455
|
'[attr.aria-label]': 'null',
|
|
1335
|
-
|
|
1336
|
-
|
|
1456
|
+
// Same for the state attributes: a static `aria-controls="menu"` on the
|
|
1457
|
+
// host also initialises the aliased input below, so strip the copy the
|
|
1458
|
+
// host would otherwise keep.
|
|
1459
|
+
'[attr.aria-expanded]': 'null',
|
|
1460
|
+
'[attr.aria-pressed]': 'null',
|
|
1461
|
+
'[attr.aria-controls]': 'null',
|
|
1462
|
+
'[attr.aria-haspopup]': 'null',
|
|
1463
|
+
}, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-24 rounded-md\" />\n} @else {\n <button\n uiRipple\n [uiRippleDisabled]=\"!ripple()\"\n [uiRippleColor]=\"rippleColor()\"\n [class]=\"classes()\"\n [disabled]=\"disabled() || loading()\"\n [type]=\"type()\"\n [attr.data-slot]=\"'button'\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-pressed]=\"ariaPressed() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-haspopup]=\"ariaHaspopup() ?? null\"\n (click)=\"clicked.emit($event)\"\n >\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center\" aria-hidden=\"true\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (label()) {\n {{ label() }}\n } @else {\n <ng-content />\n }\n </button>\n}\n", styles: [":host{--_d: var(--density-button, var(--density, 1))}@layer components{[data-slot=button]{height:calc(2.25rem * var(--_d));padding-inline:calc(1rem * var(--_d))}:host([data-size=\"sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));padding-inline:calc(.75rem * var(--_d))}:host([data-size=\"lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));padding-inline:calc(2rem * var(--_d))}:host([data-size=\"icon\"]) [data-slot=button]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d));padding:0}:host([data-size=\"icon-sm\"]) [data-slot=button]{height:calc(2rem * var(--_d));width:calc(2rem * var(--_d));padding:0}:host([data-size=\"icon-lg\"]) [data-slot=button]{height:calc(2.5rem * var(--_d));width:calc(2.5rem * var(--_d));padding:0}}\n"] }]
|
|
1464
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-expanded", required: false }] }], ariaPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-pressed", required: false }] }], ariaHaspopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-haspopup", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-controls", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ripple: [{ type: i0.Input, args: [{ isSignal: true, alias: "ripple", required: false }] }], rippleColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "rippleColor", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], skeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeleton", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
1337
1465
|
|
|
1338
1466
|
/**
|
|
1339
1467
|
* App-wide UI locale id (BCP-47 string) exposed as a **readonly** `Signal`.
|
|
@@ -1770,6 +1898,55 @@ const COMMON_LOCALES = {
|
|
|
1770
1898
|
},
|
|
1771
1899
|
};
|
|
1772
1900
|
|
|
1901
|
+
/**
|
|
1902
|
+
* Per-instance colour presets — the same names `npx shadcn-angular change-theme`
|
|
1903
|
+
* accepts. A component that exposes a `theme` input reflects it as the
|
|
1904
|
+
* `data-ui-theme` attribute, and its own stylesheet maps each name to the
|
|
1905
|
+
* preset's tokens, so nothing global is involved.
|
|
1906
|
+
*/
|
|
1907
|
+
const THEME_NAMES = [
|
|
1908
|
+
'zinc', 'slate', 'stone', 'gray', 'neutral',
|
|
1909
|
+
'red', 'rose', 'orange', 'green', 'blue', 'yellow', 'violet', 'amber',
|
|
1910
|
+
];
|
|
1911
|
+
/** The attribute a themed host carries; overlays look it up to inherit the preset. */
|
|
1912
|
+
const THEME_ATTRIBUTE = 'data-ui-theme';
|
|
1913
|
+
/** The tokens a preset overrides — everything else stays the app's global tokens. */
|
|
1914
|
+
const THEME_TOKENS = ['--primary', '--primary-foreground', '--ring'];
|
|
1915
|
+
/**
|
|
1916
|
+
* Carries a themed component's preset onto an overlay rendered outside it.
|
|
1917
|
+
* Call it when the overlay is shown — including every re-show of a reused one.
|
|
1918
|
+
*
|
|
1919
|
+
* Custom properties inherit through the DOM tree, so anything a themed component
|
|
1920
|
+
* renders inside itself is themed for free, live. Two kinds of overlay are NOT
|
|
1921
|
+
* descendants and would silently fall back to the global tokens: one appended
|
|
1922
|
+
* to `document.body`, and one an addon directive creates through its
|
|
1923
|
+
* `ViewContainerRef`, which Angular inserts as a SIBLING of the host. Those get
|
|
1924
|
+
* the resolved tokens copied at show time (so a dark-mode toggle while one is
|
|
1925
|
+
* open is not reflected until it re-opens).
|
|
1926
|
+
*
|
|
1927
|
+
* A real descendant is left alone so it keeps inheriting live, and an overlay
|
|
1928
|
+
* whose origin is not themed (any more) has earlier copies cleared, so it
|
|
1929
|
+
* follows the global tokens.
|
|
1930
|
+
*/
|
|
1931
|
+
function inheritThemeTokens(origin, overlay) {
|
|
1932
|
+
const themed = origin.closest(`[${THEME_ATTRIBUTE}]`);
|
|
1933
|
+
if (themed?.contains(overlay))
|
|
1934
|
+
return;
|
|
1935
|
+
if (!themed) {
|
|
1936
|
+
for (const token of THEME_TOKENS)
|
|
1937
|
+
overlay.style.removeProperty(token);
|
|
1938
|
+
delete overlay.dataset['uiTheme'];
|
|
1939
|
+
return;
|
|
1940
|
+
}
|
|
1941
|
+
const computed = getComputedStyle(themed);
|
|
1942
|
+
for (const token of THEME_TOKENS) {
|
|
1943
|
+
overlay.style.setProperty(token, computed.getPropertyValue(token));
|
|
1944
|
+
}
|
|
1945
|
+
// The attribute travels too, so an overlay opened FROM this overlay (a
|
|
1946
|
+
// context submenu, a tooltip inside a popover) still finds a themed origin.
|
|
1947
|
+
overlay.dataset['uiTheme'] = themed.dataset['uiTheme'];
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1773
1950
|
const ALERT_DIALOG = new InjectionToken('ALERT_DIALOG');
|
|
1774
1951
|
class AlertDialogComponent {
|
|
1775
1952
|
constructor() {
|
|
@@ -2411,6 +2588,7 @@ class ConfirmDirective {
|
|
|
2411
2588
|
this.appRef = inject(ApplicationRef);
|
|
2412
2589
|
this.injector = inject(EnvironmentInjector);
|
|
2413
2590
|
this.elementInjector = inject(Injector);
|
|
2591
|
+
this.hostEl = inject(ElementRef);
|
|
2414
2592
|
}
|
|
2415
2593
|
/**
|
|
2416
2594
|
* Intercept the host click and open the confirmation dialog instead.
|
|
@@ -2429,6 +2607,7 @@ class ConfirmDirective {
|
|
|
2429
2607
|
ref.instance.cancelLabel.set(this.resolvedCancelLabel());
|
|
2430
2608
|
this.appRef.attachView(ref.hostView);
|
|
2431
2609
|
document.body.appendChild(ref.location.nativeElement);
|
|
2610
|
+
inheritThemeTokens(this.hostEl.nativeElement, ref.location.nativeElement);
|
|
2432
2611
|
ref.instance.show();
|
|
2433
2612
|
const confirmSub = ref.instance.confirmed.subscribe(() => {
|
|
2434
2613
|
this.confirmed.emit();
|
|
@@ -3710,7 +3889,8 @@ class DataTableColumnHeaderComponent {
|
|
|
3710
3889
|
}
|
|
3711
3890
|
/**
|
|
3712
3891
|
* Advances the asc → desc → unsorted cycle and emits {@link sort} and
|
|
3713
|
-
* {@link sortMeta}. Bound to click, Enter and
|
|
3892
|
+
* {@link sortMeta}. Bound to the native button's click only, which Enter and
|
|
3893
|
+
* Space already fire, so one key press sorts once. Holding shift sets
|
|
3714
3894
|
* `multi` on {@link sortMeta} only — the emitted direction is identical
|
|
3715
3895
|
* either way, and no local state changes (see {@link direction}).
|
|
3716
3896
|
*/
|
|
@@ -3731,7 +3911,7 @@ class DataTableColumnHeaderComponent {
|
|
|
3731
3911
|
}
|
|
3732
3912
|
}
|
|
3733
3913
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableColumnHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3734
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableColumnHeaderComponent, isStandalone: true, selector: "ui-data-table-column-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, enableSorting: { classPropertyName: "enableSorting", publicName: "enableSorting", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, sortIndex: { classPropertyName: "sortIndex", publicName: "sortIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sort: "sort", sortMeta: "sortMeta" }, ngImport: i0, template: "<div [class]=\"containerClasses()\">\n @if (!enableSorting()) {\n <div>{{ title() }}</div>\n } @else {\n <ui-button\n variant=\"ghost\"\n size=\"sm\"\n class=\"-ms-
|
|
3914
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableColumnHeaderComponent, isStandalone: true, selector: "ui-data-table-column-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, enableSorting: { classPropertyName: "enableSorting", publicName: "enableSorting", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, sortIndex: { classPropertyName: "sortIndex", publicName: "sortIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sort: "sort", sortMeta: "sortMeta" }, ngImport: i0, template: "<div [class]=\"containerClasses()\">\n @if (!enableSorting()) {\n <div>{{ title() }}</div>\n } @else {\n <ui-button\n variant=\"ghost\"\n size=\"sm\"\n class=\"-ms-2 h-8 pointer-coarse:h-11 min-w-0 pointer-coarse:min-w-11 shrink data-[state=open]:bg-accent\"\n [ariaLabel]=\"sortAriaLabel()\"\n (click)=\"toggleSort($event)\"\n >\n <span class=\"truncate\">{{ title() }}</span>\n @if (direction() === 'desc') {\n <ui-icon name=\"arrow-down\" class=\"ms-2 h-4 w-4\" />\n } @else if (direction() === 'asc') {\n <ui-icon name=\"arrow-up\" class=\"ms-2 h-4 w-4\" />\n } @else {\n <ui-icon name=\"chevrons-up-down\" class=\"ms-2 h-4 w-4\" />\n }\n @if (sortIndex() !== null) {\n <span\n class=\"ms-1 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-muted px-1 text-[10px] leading-none\"\n aria-hidden=\"true\"\n >\n {{ (sortIndex() ?? 0) + 1 }}\n </span>\n }\n </ui-button>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3735
3915
|
}
|
|
3736
3916
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableColumnHeaderComponent, decorators: [{
|
|
3737
3917
|
type: Component,
|
|
@@ -3739,10 +3919,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
3739
3919
|
CommonModule,
|
|
3740
3920
|
ButtonComponent,
|
|
3741
3921
|
IconComponent,
|
|
3742
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"containerClasses()\">\n @if (!enableSorting()) {\n <div>{{ title() }}</div>\n } @else {\n <ui-button\n variant=\"ghost\"\n size=\"sm\"\n class=\"-ms-
|
|
3922
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"containerClasses()\">\n @if (!enableSorting()) {\n <div>{{ title() }}</div>\n } @else {\n <ui-button\n variant=\"ghost\"\n size=\"sm\"\n class=\"-ms-2 h-8 pointer-coarse:h-11 min-w-0 pointer-coarse:min-w-11 shrink data-[state=open]:bg-accent\"\n [ariaLabel]=\"sortAriaLabel()\"\n (click)=\"toggleSort($event)\"\n >\n <span class=\"truncate\">{{ title() }}</span>\n @if (direction() === 'desc') {\n <ui-icon name=\"arrow-down\" class=\"ms-2 h-4 w-4\" />\n } @else if (direction() === 'asc') {\n <ui-icon name=\"arrow-up\" class=\"ms-2 h-4 w-4\" />\n } @else {\n <ui-icon name=\"chevrons-up-down\" class=\"ms-2 h-4 w-4\" />\n }\n @if (sortIndex() !== null) {\n <span\n class=\"ms-1 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-muted px-1 text-[10px] leading-none\"\n aria-hidden=\"true\"\n >\n {{ (sortIndex() ?? 0) + 1 }}\n </span>\n }\n </ui-button>\n }\n</div>\n" }]
|
|
3743
3923
|
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], enableSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSorting", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], sortIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortIndex", required: false }] }], sort: [{ type: i0.Output, args: ["sort"] }], sortMeta: [{ type: i0.Output, args: ["sortMeta"] }] } });
|
|
3744
3924
|
|
|
3745
3925
|
const SELECT = new InjectionToken('SELECT');
|
|
3926
|
+
/**
|
|
3927
|
+
* Scrolls `list` — and only `list` — until `option` is no longer hidden below
|
|
3928
|
+
* its bottom edge. Opening focuses the selected option with `preventScroll`
|
|
3929
|
+
* so the page does not jump while the popup is still being placed; without
|
|
3930
|
+
* this, an option further down than the list is tall starts out of sight. The
|
|
3931
|
+
* list is created on open at `scrollTop` 0, so an option can only be hidden
|
|
3932
|
+
* below it, never above.
|
|
3933
|
+
*/
|
|
3934
|
+
function revealSelectOption(list, option) {
|
|
3935
|
+
const listBottom = list.getBoundingClientRect().top + list.clientTop + list.clientHeight;
|
|
3936
|
+
list.scrollTop += Math.max(0, option.getBoundingClientRect().bottom - listBottom);
|
|
3937
|
+
}
|
|
3746
3938
|
class SelectComponent {
|
|
3747
3939
|
static { this.nextId = 0; }
|
|
3748
3940
|
constructor() {
|
|
@@ -3864,8 +4056,11 @@ class SelectComponent {
|
|
|
3864
4056
|
if (val == null)
|
|
3865
4057
|
return '';
|
|
3866
4058
|
if (this.isDataDriven()) {
|
|
3867
|
-
|
|
3868
|
-
|
|
4059
|
+
// Found-ness is the index, never the option's truthiness: `''`,
|
|
4060
|
+
// `0` and `false` are options too, and must show their label.
|
|
4061
|
+
const options = this.options();
|
|
4062
|
+
const index = options.findIndex(opt => this.getValue(opt) === val);
|
|
4063
|
+
return index >= 0 ? this.getDisplayValue(options[index]) : String(val);
|
|
3869
4064
|
}
|
|
3870
4065
|
return String(val);
|
|
3871
4066
|
}, ...(ngDevMode ? [{ debugName: "selectedDisplayValue" }] : /* istanbul ignore next */ []));
|
|
@@ -3922,6 +4117,7 @@ class SelectComponent {
|
|
|
3922
4117
|
const firstItem = contentEl.querySelector('[role="option"]');
|
|
3923
4118
|
if (selectedItem) {
|
|
3924
4119
|
selectedItem.focus({ preventScroll: true });
|
|
4120
|
+
revealSelectOption(contentEl, selectedItem);
|
|
3925
4121
|
}
|
|
3926
4122
|
else if (firstItem) {
|
|
3927
4123
|
firstItem.focus({ preventScroll: true });
|
|
@@ -4101,10 +4297,34 @@ class SelectComponent {
|
|
|
4101
4297
|
return startIndex; // No enabled option found, stay at current
|
|
4102
4298
|
}
|
|
4103
4299
|
/**
|
|
4104
|
-
*
|
|
4105
|
-
*
|
|
4106
|
-
*
|
|
4107
|
-
|
|
4300
|
+
* Moves the data-driven highlight ({@link focusedIndex}) to an option row and
|
|
4301
|
+
* DOM focus with it, so the row a screen reader announces is always the row
|
|
4302
|
+
* Enter/Space commits.
|
|
4303
|
+
*/
|
|
4304
|
+
highlight(index, focusOptions) {
|
|
4305
|
+
this.focusedIndex.set(index);
|
|
4306
|
+
this.contentEl?.nativeElement.querySelector(`[data-index="${index}"]`)?.focus(focusOptions);
|
|
4307
|
+
}
|
|
4308
|
+
/**
|
|
4309
|
+
* Listbox click handler for data-driven mode: commits the clicked option row.
|
|
4310
|
+
* Delegated from the listbox so pointer and keyboard commits share one owner,
|
|
4311
|
+
* as {@link onContentKeydown} does for Enter/Space.
|
|
4312
|
+
*/
|
|
4313
|
+
onContentClick(event) {
|
|
4314
|
+
if (!(event.target instanceof Element))
|
|
4315
|
+
return;
|
|
4316
|
+
const row = event.target.closest('[role="option"]');
|
|
4317
|
+
const index = Number(row?.dataset['index']);
|
|
4318
|
+
const option = this.options()[index];
|
|
4319
|
+
if (option !== undefined)
|
|
4320
|
+
this.selectOption(option);
|
|
4321
|
+
}
|
|
4322
|
+
/**
|
|
4323
|
+
* Listbox key handler for data-driven mode: arrows move the highlighted row
|
|
4324
|
+
* and focus with it ({@link highlight}; skipping {@link disabledWith}
|
|
4325
|
+
* options and stopping at the ends rather than wrapping), Enter/Space commit
|
|
4326
|
+
* it, Escape and Tab close. The only Enter/Space handler, so one key press
|
|
4327
|
+
* commits exactly once. A no-op when {@link options} is empty.
|
|
4108
4328
|
*/
|
|
4109
4329
|
onContentKeydown(event) {
|
|
4110
4330
|
const opts = this.options();
|
|
@@ -4114,16 +4334,16 @@ class SelectComponent {
|
|
|
4114
4334
|
switch (event.key) {
|
|
4115
4335
|
case 'ArrowDown':
|
|
4116
4336
|
event.preventDefault();
|
|
4117
|
-
this.
|
|
4337
|
+
this.highlight(this.findNextEnabledIndex(currentIndex, 1));
|
|
4118
4338
|
break;
|
|
4119
4339
|
case 'ArrowUp':
|
|
4120
4340
|
event.preventDefault();
|
|
4121
|
-
this.
|
|
4341
|
+
this.highlight(this.findNextEnabledIndex(currentIndex, -1));
|
|
4122
4342
|
break;
|
|
4123
4343
|
case 'Enter':
|
|
4124
4344
|
case ' ':
|
|
4125
4345
|
event.preventDefault();
|
|
4126
|
-
if (
|
|
4346
|
+
if (currentIndex >= 0 && currentIndex < opts.length) {
|
|
4127
4347
|
this.selectOption(opts[currentIndex]);
|
|
4128
4348
|
}
|
|
4129
4349
|
break;
|
|
@@ -4205,6 +4425,7 @@ class SelectComponent {
|
|
|
4205
4425
|
[class]="contentClasses()"
|
|
4206
4426
|
role="listbox"
|
|
4207
4427
|
tabindex="-1"
|
|
4428
|
+
(click)="onContentClick($event)"
|
|
4208
4429
|
(keydown)="onContentKeydown($event)"
|
|
4209
4430
|
>
|
|
4210
4431
|
<div class="p-1">
|
|
@@ -4217,9 +4438,8 @@ class SelectComponent {
|
|
|
4217
4438
|
[attr.aria-selected]="isSelected(option)"
|
|
4218
4439
|
[attr.data-state]="isSelected(option) ? 'checked' : 'unchecked'"
|
|
4219
4440
|
[attr.data-index]="i"
|
|
4220
|
-
|
|
4221
|
-
(
|
|
4222
|
-
(mouseenter)="focusedIndex.set(i)"
|
|
4441
|
+
[attr.data-slot]="'select-option'"
|
|
4442
|
+
(mouseenter)="highlight(i, { preventScroll: true })"
|
|
4223
4443
|
>
|
|
4224
4444
|
<span class="flex-1">{{ getDisplayValue(option) }}</span>
|
|
4225
4445
|
<span class="absolute flex size-3.5 items-center justify-center ltr:right-2 rtl:left-2">
|
|
@@ -4238,7 +4458,7 @@ class SelectComponent {
|
|
|
4238
4458
|
} @else {
|
|
4239
4459
|
<ng-content />
|
|
4240
4460
|
}
|
|
4241
|
-
`, isInline: true, styles: [":host{--_d: var(--density-select, var(--density, 1))}@layer components{[data-slot=select-trigger]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4461
|
+
`, isInline: true, styles: [":host{--_d: var(--density-select, var(--density, 1))}@layer components{[data-slot=select-trigger]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}}@layer components{[data-slot=select-option]{min-height:calc(2rem * var(--_d))}@media(pointer:coarse){[data-slot=select-option]{min-height:max(2.75rem,calc(2rem * var(--_d)))}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4242
4462
|
}
|
|
4243
4463
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SelectComponent, decorators: [{
|
|
4244
4464
|
type: Component,
|
|
@@ -4284,6 +4504,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4284
4504
|
[class]="contentClasses()"
|
|
4285
4505
|
role="listbox"
|
|
4286
4506
|
tabindex="-1"
|
|
4507
|
+
(click)="onContentClick($event)"
|
|
4287
4508
|
(keydown)="onContentKeydown($event)"
|
|
4288
4509
|
>
|
|
4289
4510
|
<div class="p-1">
|
|
@@ -4296,9 +4517,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4296
4517
|
[attr.aria-selected]="isSelected(option)"
|
|
4297
4518
|
[attr.data-state]="isSelected(option) ? 'checked' : 'unchecked'"
|
|
4298
4519
|
[attr.data-index]="i"
|
|
4299
|
-
|
|
4300
|
-
(
|
|
4301
|
-
(mouseenter)="focusedIndex.set(i)"
|
|
4520
|
+
[attr.data-slot]="'select-option'"
|
|
4521
|
+
(mouseenter)="highlight(i, { preventScroll: true })"
|
|
4302
4522
|
>
|
|
4303
4523
|
<span class="flex-1">{{ getDisplayValue(option) }}</span>
|
|
4304
4524
|
<span class="absolute flex size-3.5 items-center justify-center ltr:right-2 rtl:left-2">
|
|
@@ -4320,7 +4540,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4320
4540
|
`, host: { class: 'relative inline-block', '[attr.dir]': 'dir()' }, providers: [
|
|
4321
4541
|
{ provide: SELECT, useExisting: forwardRef(() => SelectComponent) },
|
|
4322
4542
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }
|
|
4323
|
-
], styles: [":host{--_d: var(--density-select, var(--density, 1))}@layer components{[data-slot=select-trigger]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}}\n"] }]
|
|
4543
|
+
], styles: [":host{--_d: var(--density-select, var(--density, 1))}@layer components{[data-slot=select-trigger]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.5rem * var(--_d));gap:calc(.5rem * var(--_d))}}@layer components{[data-slot=select-option]{min-height:calc(2rem * var(--_d))}@media(pointer:coarse){[data-slot=select-option]{min-height:max(2.75rem,calc(2rem * var(--_d)))}}}\n"] }]
|
|
4324
4544
|
}], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], displayWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayWith", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], valueAttribute: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueAttribute", required: false }] }], disabledWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledWith", required: false }] }], contentEl: [{
|
|
4325
4545
|
type: ViewChild,
|
|
4326
4546
|
args: ['contentEl']
|
|
@@ -4645,6 +4865,7 @@ class SelectContentComponent {
|
|
|
4645
4865
|
const selectedItem = content.querySelector('[data-state="checked"]');
|
|
4646
4866
|
if (selectedItem) {
|
|
4647
4867
|
selectedItem.focus({ preventScroll: true });
|
|
4868
|
+
revealSelectOption(content, selectedItem);
|
|
4648
4869
|
}
|
|
4649
4870
|
else {
|
|
4650
4871
|
content.focus({ preventScroll: true });
|
|
@@ -4777,14 +4998,11 @@ class SelectItemComponent {
|
|
|
4777
4998
|
</svg>
|
|
4778
4999
|
}
|
|
4779
5000
|
</span>
|
|
4780
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5001
|
+
`, isInline: true, styles: ["@layer components{:host{min-height:calc(2rem * var(--_d, 1))}@media(pointer:coarse){:host{min-height:max(2.75rem,calc(2rem * var(--_d, 1)))}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4781
5002
|
}
|
|
4782
5003
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SelectItemComponent, decorators: [{
|
|
4783
5004
|
type: Component,
|
|
4784
|
-
args: [{
|
|
4785
|
-
selector: 'ui-select-item',
|
|
4786
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4787
|
-
template: `
|
|
5005
|
+
args: [{ selector: 'ui-select-item', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4788
5006
|
<ng-content />
|
|
4789
5007
|
<span [class]="checkmarkClasses()">
|
|
4790
5008
|
@if (isSelected()) {
|
|
@@ -4793,8 +5011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4793
5011
|
</svg>
|
|
4794
5012
|
}
|
|
4795
5013
|
</span>
|
|
4796
|
-
`,
|
|
4797
|
-
host: {
|
|
5014
|
+
`, host: {
|
|
4798
5015
|
'[class]': 'classes()',
|
|
4799
5016
|
'[attr.role]': '"option"',
|
|
4800
5017
|
'[attr.aria-selected]': 'isSelected()',
|
|
@@ -4804,8 +5021,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4804
5021
|
'[attr.data-slot]': '"select-item"',
|
|
4805
5022
|
'[attr.tabindex]': '"-1"',
|
|
4806
5023
|
'(click)': 'onClick()',
|
|
4807
|
-
},
|
|
4808
|
-
}]
|
|
5024
|
+
}, styles: ["@layer components{:host{min-height:calc(2rem * var(--_d, 1))}@media(pointer:coarse){:host{min-height:max(2.75rem,calc(2rem * var(--_d, 1)))}}}\n"] }]
|
|
4809
5025
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4810
5026
|
|
|
4811
5027
|
class SelectGroupComponent {
|
|
@@ -5470,7 +5686,7 @@ class DataTablePaginationComponent {
|
|
|
5470
5686
|
});
|
|
5471
5687
|
}
|
|
5472
5688
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTablePaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5473
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTablePaginationComponent, isStandalone: true, selector: "ui-data-table-pagination", inputs: { total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageLabel: { classPropertyName: "rowsPerPageLabel", publicName: "rowsPerPageLabel", isSignal: true, isRequired: false, transformFunction: null }, pageLabel: { classPropertyName: "pageLabel", publicName: "pageLabel", isSignal: true, isRequired: false, transformFunction: null }, ofLabel: { classPropertyName: "ofLabel", publicName: "ofLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "<div class=\"flex flex-wrap items-center justify-between gap-y-2 px-2\">\n <div class=\"flex-1 text-sm text-muted-foreground\">\n </div>\n <div class=\"flex items-center space-x-2 sm:space-x-6 lg:space-x-8\">\n @if (showPageSizeSelector()) {\n <div class=\"flex items-center space-x-2\">\n <p class=\"hidden sm:inline text-sm font-medium\">{{ rowsPerPageLabel() }}</p>\n <ui-select\n [ngModel]=\"pageSizeString()\"\n (ngModelChange)=\"onPageSizeChange($event)\">\n <ui-select-trigger class=\"h-8 w-[70px]\">\n <ui-select-value [placeholder]=\"pageSizeString()\" />\n </ui-select-trigger>\n <ui-select-content side=\"top\">\n @for (size of pageSizeOptions(); track size) {\n <ui-select-item [value]=\"size.toString()\">\n {{ size }}\n </ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n </div>\n }\n <div class=\"flex items-center space-x-2\">\n <ui-pagination [class]=\"'mx-0 w-auto'\">\n <ui-pagination-content>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"hidden lg:flex border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canPrevious()\"\n (click)=\"onFirstPage()\"\n
|
|
5689
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTablePaginationComponent, isStandalone: true, selector: "ui-data-table-pagination", inputs: { total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageLabel: { classPropertyName: "rowsPerPageLabel", publicName: "rowsPerPageLabel", isSignal: true, isRequired: false, transformFunction: null }, pageLabel: { classPropertyName: "pageLabel", publicName: "pageLabel", isSignal: true, isRequired: false, transformFunction: null }, ofLabel: { classPropertyName: "ofLabel", publicName: "ofLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "<div class=\"flex flex-wrap items-center justify-between gap-y-2 px-2\">\n <div class=\"flex-1 text-sm text-muted-foreground\">\n </div>\n <div class=\"flex items-center space-x-2 sm:space-x-6 lg:space-x-8\">\n @if (showPageSizeSelector()) {\n <div class=\"flex items-center space-x-2\">\n <p class=\"hidden sm:inline text-sm font-medium\">{{ rowsPerPageLabel() }}</p>\n <ui-select\n [ngModel]=\"pageSizeString()\"\n (ngModelChange)=\"onPageSizeChange($event)\">\n <ui-select-trigger class=\"h-8 w-[70px]\">\n <ui-select-value [placeholder]=\"pageSizeString()\" />\n </ui-select-trigger>\n <ui-select-content side=\"top\">\n @for (size of pageSizeOptions(); track size) {\n <ui-select-item [value]=\"size.toString()\">\n {{ size }}\n </ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n </div>\n }\n <div class=\"flex items-center space-x-2\">\n <ui-pagination [class]=\"'mx-0 w-auto'\">\n <ui-pagination-content>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"hidden lg:flex border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canPrevious()\"\n (click)=\"onFirstPage()\"\n >\n <span class=\"sr-only\">Go to first page</span>\n <ui-icon [name]=\"isRtl() ? 'chevrons-right' : 'chevrons-left'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canPrevious()\"\n (click)=\"onPreviousPage()\"\n >\n <span class=\"sr-only\">Go to previous page</span>\n <ui-icon [name]=\"isRtl() ? 'chevron-right' : 'chevron-left'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n \n <div class=\"flex w-auto min-w-[80px] sm:min-w-[100px] items-center justify-center text-sm font-medium\">\n {{ pageLabel() }} {{ currentPage() }} {{ ofLabel() }} {{ totalPages() }}\n </div>\n\n <ui-pagination-item>\n <ui-pagination-link\n class=\"border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canNext()\"\n (click)=\"onNextPage()\"\n >\n <span class=\"sr-only\">Go to next page</span>\n <ui-icon [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"hidden lg:flex border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canNext()\"\n (click)=\"onLastPage()\"\n >\n <span class=\"sr-only\">Go to last page</span>\n <ui-icon [name]=\"isRtl() ? 'chevrons-left' : 'chevrons-right'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n </ui-pagination-content>\n </ui-pagination>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SelectComponent, selector: "ui-select", inputs: ["disabled", "placeholder", "ariaLabel", "ariaLabelledby", "defaultValue", "locale", "position", "options", "displayWith", "value", "valueAttribute", "disabledWith"], outputs: ["valueChange"] }, { kind: "component", type: SelectTriggerComponent, selector: "ui-select-trigger", inputs: ["class", "ariaLabel", "loading", "skeleton"] }, { kind: "component", type: SelectValueComponent, selector: "ui-select-value", inputs: ["placeholder", "displayValue"] }, { kind: "component", type: SelectContentComponent, selector: "ui-select-content", inputs: ["class", "position", "side"] }, { kind: "component", type: SelectItemComponent, selector: "ui-select-item", inputs: ["value", "disabled", "class"] }, { kind: "component", type: PaginationComponent, selector: "ui-pagination", inputs: ["class", "currentPage", "totalPages", "siblingCount", "locale"], outputs: ["pageChange"] }, { kind: "component", type: PaginationContentComponent, selector: "ui-pagination-content", inputs: ["class"] }, { kind: "component", type: PaginationItemComponent, selector: "ui-pagination-item", inputs: ["class"] }, { kind: "component", type: PaginationLinkComponent, selector: "ui-pagination-link", inputs: ["isActive", "size", "class", "disabled"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5474
5690
|
}
|
|
5475
5691
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTablePaginationComponent, decorators: [{
|
|
5476
5692
|
type: Component,
|
|
@@ -5487,7 +5703,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
5487
5703
|
PaginationItemComponent,
|
|
5488
5704
|
PaginationLinkComponent,
|
|
5489
5705
|
IconComponent,
|
|
5490
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-wrap items-center justify-between gap-y-2 px-2\">\n <div class=\"flex-1 text-sm text-muted-foreground\">\n </div>\n <div class=\"flex items-center space-x-2 sm:space-x-6 lg:space-x-8\">\n @if (showPageSizeSelector()) {\n <div class=\"flex items-center space-x-2\">\n <p class=\"hidden sm:inline text-sm font-medium\">{{ rowsPerPageLabel() }}</p>\n <ui-select\n [ngModel]=\"pageSizeString()\"\n (ngModelChange)=\"onPageSizeChange($event)\">\n <ui-select-trigger class=\"h-8 w-[70px]\">\n <ui-select-value [placeholder]=\"pageSizeString()\" />\n </ui-select-trigger>\n <ui-select-content side=\"top\">\n @for (size of pageSizeOptions(); track size) {\n <ui-select-item [value]=\"size.toString()\">\n {{ size }}\n </ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n </div>\n }\n <div class=\"flex items-center space-x-2\">\n <ui-pagination [class]=\"'mx-0 w-auto'\">\n <ui-pagination-content>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"hidden lg:flex border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canPrevious()\"\n (click)=\"onFirstPage()\"\n
|
|
5706
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-wrap items-center justify-between gap-y-2 px-2\">\n <div class=\"flex-1 text-sm text-muted-foreground\">\n </div>\n <div class=\"flex items-center space-x-2 sm:space-x-6 lg:space-x-8\">\n @if (showPageSizeSelector()) {\n <div class=\"flex items-center space-x-2\">\n <p class=\"hidden sm:inline text-sm font-medium\">{{ rowsPerPageLabel() }}</p>\n <ui-select\n [ngModel]=\"pageSizeString()\"\n (ngModelChange)=\"onPageSizeChange($event)\">\n <ui-select-trigger class=\"h-8 w-[70px]\">\n <ui-select-value [placeholder]=\"pageSizeString()\" />\n </ui-select-trigger>\n <ui-select-content side=\"top\">\n @for (size of pageSizeOptions(); track size) {\n <ui-select-item [value]=\"size.toString()\">\n {{ size }}\n </ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n </div>\n }\n <div class=\"flex items-center space-x-2\">\n <ui-pagination [class]=\"'mx-0 w-auto'\">\n <ui-pagination-content>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"hidden lg:flex border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canPrevious()\"\n (click)=\"onFirstPage()\"\n >\n <span class=\"sr-only\">Go to first page</span>\n <ui-icon [name]=\"isRtl() ? 'chevrons-right' : 'chevrons-left'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canPrevious()\"\n (click)=\"onPreviousPage()\"\n >\n <span class=\"sr-only\">Go to previous page</span>\n <ui-icon [name]=\"isRtl() ? 'chevron-right' : 'chevron-left'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n \n <div class=\"flex w-auto min-w-[80px] sm:min-w-[100px] items-center justify-center text-sm font-medium\">\n {{ pageLabel() }} {{ currentPage() }} {{ ofLabel() }} {{ totalPages() }}\n </div>\n\n <ui-pagination-item>\n <ui-pagination-link\n class=\"border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canNext()\"\n (click)=\"onNextPage()\"\n >\n <span class=\"sr-only\">Go to next page</span>\n <ui-icon [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n <ui-pagination-item>\n <ui-pagination-link\n class=\"hidden lg:flex border border-input rounded-md bg-background shadow-sm\"\n size=\"icon\"\n [disabled]=\"!canNext()\"\n (click)=\"onLastPage()\"\n >\n <span class=\"sr-only\">Go to last page</span>\n <ui-icon [name]=\"isRtl() ? 'chevrons-left' : 'chevrons-right'\" class=\"h-4 w-4\" />\n </ui-pagination-link>\n </ui-pagination-item>\n </ui-pagination-content>\n </ui-pagination>\n </div>\n </div>\n</div>\n" }]
|
|
5491
5707
|
}], propDecorators: { total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPageSizeSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSizeSelector", required: false }] }], rowsPerPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageLabel", required: false }] }], pageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLabel", required: false }] }], ofLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ofLabel", required: false }] }], paginationChange: [{ type: i0.Output, args: ["paginationChange"] }] } });
|
|
5492
5708
|
|
|
5493
5709
|
/**
|
|
@@ -5542,11 +5758,11 @@ function isSecondaryTouch(event) {
|
|
|
5542
5758
|
return event.pointerType === 'touch' && !event.isPrimary;
|
|
5543
5759
|
}
|
|
5544
5760
|
function isTouchDevice() {
|
|
5545
|
-
return globalThis.window?.matchMedia('(pointer: coarse)').matches ?? false;
|
|
5761
|
+
return globalThis.window?.matchMedia?.('(pointer: coarse)').matches ?? false;
|
|
5546
5762
|
}
|
|
5547
5763
|
/** Detect if the device supports hover (mouse/trackpad) */
|
|
5548
5764
|
function hasHover() {
|
|
5549
|
-
return globalThis.window?.matchMedia('(hover: hover)').matches ?? true;
|
|
5765
|
+
return globalThis.window?.matchMedia?.('(hover: hover)').matches ?? true;
|
|
5550
5766
|
}
|
|
5551
5767
|
/**
|
|
5552
5768
|
* Long-press detection — calls `callback` after the user holds a touch
|
|
@@ -5782,7 +5998,14 @@ function onPointerDrag(onMove, onEnd) {
|
|
|
5782
5998
|
const UI_TABLE_ROLE = new InjectionToken('UI_TABLE_ROLE');
|
|
5783
5999
|
class TableComponent {
|
|
5784
6000
|
constructor() {
|
|
5785
|
-
/**
|
|
6001
|
+
/**
|
|
6002
|
+
* Extra classes merged onto the table wrapper. It is a flex column that
|
|
6003
|
+
* scrolls horizontally, so give it a bounded height here when the body
|
|
6004
|
+
* should scroll rather than the page. Inside a container that already
|
|
6005
|
+
* scrolls, pass `overflow-visible`: the wrapper then stops being a scroll
|
|
6006
|
+
* container, so the sticky header and horizontal scrollbar belong to the
|
|
6007
|
+
* outer one.
|
|
6008
|
+
*/
|
|
5786
6009
|
this.class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
5787
6010
|
/**
|
|
5788
6011
|
* ARIA role of the table.
|
|
@@ -7117,7 +7340,7 @@ class CalendarComponent {
|
|
|
7117
7340
|
this.viewDate.set(new Date(yearNum, current.getMonth(), 1));
|
|
7118
7341
|
}
|
|
7119
7342
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7120
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CalendarComponent, isStandalone: true, selector: "ui-calendar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, showMonthSelect: { classPropertyName: "showMonthSelect", publicName: "showMonthSelect", isSignal: true, isRequired: false, transformFunction: null }, showYearSelect: { classPropertyName: "showYearSelect", publicName: "showYearSelect", isSignal: true, isRequired: false, transformFunction: null }, showTimeSelect: { classPropertyName: "showTimeSelect", publicName: "showTimeSelect", isSignal: true, isRequired: false, transformFunction: null }, timeMode: { classPropertyName: "timeMode", publicName: "timeMode", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, rtl: { classPropertyName: "rtl", publicName: "rtl", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, selectedTimeRange: { classPropertyName: "selectedTimeRange", publicName: "selectedTimeRange", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rtl: "rtlChange", selected: "selectedChange", selectedTimeRange: "selectedTimeRangeChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'calendar'\" [attr.dir]=\"dir()\">\n <!-- Header -->\n <div class=\"flex items-center justify-between px-1 relative mb-4\">\n <ui-button\n variant=\"outline\"\n size=\"icon-sm\"\n (click)=\"previousMonth()\"\n (keydown.enter)=\"previousMonth()\"\n (keydown.space)=\"previousMonth()\"\n [ariaLabel]=\"prevMonthLabel()\"\n >\n <svg class=\"h-4 w-4\" [class.rotate-180]=\"rtl()\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 19l-7-7 7-7\" />\n </svg>\n </ui-button>\n\n <div class=\"flex items-center gap-1 font-medium text-sm\">\n @if (showMonthSelect()) {\n <ui-select\n [defaultValue]=\"currentMonth().toString()\"\n position=\"popper\"\n (valueChange)=\"onMonthChange($event)\"\n >\n <ui-select-trigger class=\"h-7 w-[110px]\" ariaLabel=\"Month\">\n <ui-select-value [placeholder]=\"currentMonthName()\" [displayValue]=\"currentMonthName()\" />\n </ui-select-trigger>\n <ui-select-content>\n @for (month of monthNames(); track $index) {\n <ui-select-item [value]=\"$index.toString()\">{{ month }}</ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n } @else {\n <span>{{ currentMonthName() }}</span>\n }\n\n @if (showYearSelect()) {\n <ui-select\n [defaultValue]=\"currentYear().toString()\"\n position=\"popper\"\n (valueChange)=\"onYearChange($event)\"\n >\n <ui-select-trigger class=\"h-7 w-[80px]\" ariaLabel=\"Year\">\n <ui-select-value [placeholder]=\"currentYear().toString()\" />\n </ui-select-trigger>\n <ui-select-content class=\"max-h-60\">\n @for (year of years(); track year) {\n <ui-select-item [value]=\"year.toString()\">{{ year }}</ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n } @else {\n <span>{{ currentYear() }}</span>\n }\n </div>\n\n <ui-button\n variant=\"outline\"\n size=\"icon-sm\"\n (click)=\"nextMonth()\"\n (keydown.enter)=\"nextMonth()\"\n (keydown.space)=\"nextMonth()\"\n [ariaLabel]=\"nextMonthLabel()\"\n >\n <svg class=\"h-4 w-4\" [class.rotate-180]=\"rtl()\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </ui-button>\n </div>\n\n <!-- Day names -->\n <div class=\"mt-4 grid grid-cols-7 text-center text-xs text-muted-foreground\">\n @for (day of orderedDayNames(); track day) {\n <div class=\"py-2\">{{ day }}</div>\n }\n </div>\n\n <!-- Days grid -->\n <div class=\"grid grid-cols-7 gap-1\">\n @for (day of calendarDays(); track $index) {\n @if (day) {\n <ui-button\n [class]=\"getDayClasses(day)\"\n (click)=\"selectDay(day)\"\n (keydown.enter)=\"selectDay(day)\"\n (keydown.space)=\"selectDay(day)\"\n [disabled]=\"day.getMonth() !== currentMonth()\"\n [variant]=\"'ghost'\"\n [ariaLabel]=\"day.getDate().toString()\"\n >\n {{ day.getDate() }}\n </ui-button>\n } @else {\n <div data-slot=\"calendar-filler\"></div>\n }\n }\n </div>\n\n @if (showTimeSelect()) {\n <div class=\"mt-4 border-t pt-4\">\n @if (timeMode() === 'range') {\n <div class=\"grid grid-cols-2 gap-3\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium\" for=\"start-time\">{{ startTimeLabel() }}</label>\n <div class=\"flex items-center rounded-md border border-input focus-within:ring-1 focus-within:ring-ring\">\n <input\n type=\"time\"\n [attr.dir]=\"dir()\"\n class=\"flex-1 w-full bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground rtl:pr-0 [&::-webkit-calendar-picker-indicator]:hidden flex rtl:justify-end\"\n [value]=\"startTimeString()\"\n (change)=\"updateStartTime($event)\"\n id=\"start-time\"\n />\n <div class=\"flex items-center justify-center px-3 py-2 ltr:border-l rtl:border-r border-input bg-muted/50 text-muted-foreground\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>\n </div>\n </div>\n </div>\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium\" for=\"end-time\">{{ endTimeLabel() }}</label>\n <div class=\"flex items-center rounded-md border border-input focus-within:ring-1 focus-within:ring-ring\">\n <input\n type=\"time\"\n [attr.dir]=\"dir()\"\n class=\"flex-1 w-full bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground rtl:pr-0 [&::-webkit-calendar-picker-indicator]:hidden flex rtl:justify-end\"\n [value]=\"endTimeString()\"\n (change)=\"updateEndTime($event)\"\n id=\"end-time\"\n />\n <div class=\"flex items-center justify-center px-3 py-2 ltr:border-l rtl:border-r border-input bg-muted/50 text-muted-foreground\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>\n </div>\n </div>\n </div>\n </div>\n } @else {\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium\" for=\"time\">{{ timeLabel() }}</label>\n <div class=\"flex items-center rounded-md border border-input focus-within:ring-1 focus-within:ring-ring\">\n <input\n type=\"time\"\n [attr.dir]=\"dir()\"\n class=\"flex-1 w-full bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground rtl:pr-0 [&::-webkit-calendar-picker-indicator]:hidden flex rtl:justify-end\"\n [value]=\"selectedTimeString()\"\n (change)=\"updateTime($event)\"\n id=\"time\"\n />\n <div class=\"flex items-center justify-center px-3 py-2 ltr:border-l rtl:border-r border-input bg-muted/50 text-muted-foreground\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>\n </div>\n </div>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{--_d: var(--density-picker, var(--density, 1));--density-button: var(--_d);--density-select: var(--_d)}@layer components{ui-select-trigger{--ui-select-trigger-h: 1.75rem}[data-slot=calendar-filler]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d))}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: SelectComponent, selector: "ui-select", inputs: ["disabled", "placeholder", "ariaLabel", "ariaLabelledby", "defaultValue", "locale", "position", "options", "displayWith", "value", "valueAttribute", "disabledWith"], outputs: ["valueChange"] }, { kind: "component", type: SelectTriggerComponent, selector: "ui-select-trigger", inputs: ["class", "ariaLabel", "loading", "skeleton"] }, { kind: "component", type: SelectValueComponent, selector: "ui-select-value", inputs: ["placeholder", "displayValue"] }, { kind: "component", type: SelectContentComponent, selector: "ui-select-content", inputs: ["class", "position", "side"] }, { kind: "component", type: SelectItemComponent, selector: "ui-select-item", inputs: ["value", "disabled", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7343
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CalendarComponent, isStandalone: true, selector: "ui-calendar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, showMonthSelect: { classPropertyName: "showMonthSelect", publicName: "showMonthSelect", isSignal: true, isRequired: false, transformFunction: null }, showYearSelect: { classPropertyName: "showYearSelect", publicName: "showYearSelect", isSignal: true, isRequired: false, transformFunction: null }, showTimeSelect: { classPropertyName: "showTimeSelect", publicName: "showTimeSelect", isSignal: true, isRequired: false, transformFunction: null }, timeMode: { classPropertyName: "timeMode", publicName: "timeMode", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, rtl: { classPropertyName: "rtl", publicName: "rtl", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, selectedTimeRange: { classPropertyName: "selectedTimeRange", publicName: "selectedTimeRange", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rtl: "rtlChange", selected: "selectedChange", selectedTimeRange: "selectedTimeRangeChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'calendar'\" [attr.dir]=\"dir()\">\n <!-- Header -->\n <div class=\"flex items-center justify-between px-1 relative mb-4\">\n <ui-button\n variant=\"outline\"\n size=\"icon-sm\"\n (click)=\"previousMonth()\"\n (keydown.enter)=\"previousMonth()\"\n (keydown.space)=\"previousMonth()\"\n [ariaLabel]=\"prevMonthLabel()\"\n >\n <svg class=\"h-4 w-4\" [class.rotate-180]=\"rtl()\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 19l-7-7 7-7\" />\n </svg>\n </ui-button>\n\n <div class=\"flex items-center gap-1 font-medium text-sm\">\n @if (showMonthSelect()) {\n <ui-select\n [defaultValue]=\"currentMonth().toString()\"\n position=\"popper\"\n (valueChange)=\"onMonthChange($event)\"\n >\n <ui-select-trigger class=\"h-7 w-[110px]\" ariaLabel=\"Month\">\n <ui-select-value [placeholder]=\"currentMonthName()\" [displayValue]=\"currentMonthName()\" />\n </ui-select-trigger>\n <ui-select-content>\n @for (month of monthNames(); track $index) {\n <ui-select-item [value]=\"$index.toString()\">{{ month }}</ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n } @else {\n <span>{{ currentMonthName() }}</span>\n }\n\n @if (showYearSelect()) {\n <ui-select\n [defaultValue]=\"currentYear().toString()\"\n position=\"popper\"\n (valueChange)=\"onYearChange($event)\"\n >\n <ui-select-trigger class=\"h-7 w-[80px]\" ariaLabel=\"Year\">\n <ui-select-value [placeholder]=\"currentYear().toString()\" />\n </ui-select-trigger>\n <ui-select-content class=\"max-h-60\">\n @for (year of years(); track year) {\n <ui-select-item [value]=\"year.toString()\">{{ year }}</ui-select-item>\n }\n </ui-select-content>\n </ui-select>\n } @else {\n <span>{{ currentYear() }}</span>\n }\n </div>\n\n <ui-button\n variant=\"outline\"\n size=\"icon-sm\"\n (click)=\"nextMonth()\"\n (keydown.enter)=\"nextMonth()\"\n (keydown.space)=\"nextMonth()\"\n [ariaLabel]=\"nextMonthLabel()\"\n >\n <svg class=\"h-4 w-4\" [class.rotate-180]=\"rtl()\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </ui-button>\n </div>\n\n <!-- Day names -->\n <div class=\"mt-4 grid grid-cols-7 text-center text-xs text-muted-foreground\">\n @for (day of orderedDayNames(); track day) {\n <div class=\"py-2\">{{ day }}</div>\n }\n </div>\n\n <!-- Days grid -->\n <div class=\"grid grid-cols-7 gap-1\">\n @for (day of calendarDays(); track $index) {\n @if (day) {\n <ui-button\n [class]=\"getDayClasses(day)\"\n (click)=\"selectDay(day)\"\n (keydown.enter)=\"selectDay(day)\"\n (keydown.space)=\"selectDay(day)\"\n [disabled]=\"day.getMonth() !== currentMonth()\"\n [variant]=\"'ghost'\"\n [ariaLabel]=\"day.getDate().toString()\"\n >\n {{ day.getDate() }}\n </ui-button>\n } @else {\n <div data-slot=\"calendar-filler\"></div>\n }\n }\n </div>\n\n @if (showTimeSelect()) {\n <div class=\"mt-4 border-t pt-4\">\n @if (timeMode() === 'range') {\n <div class=\"grid grid-cols-2 gap-3\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium\" for=\"start-time\">{{ startTimeLabel() }}</label>\n <div class=\"flex items-center rounded-md border border-input focus-within:ring-1 focus-within:ring-ring\">\n <input\n type=\"time\"\n [attr.dir]=\"dir()\"\n class=\"flex-1 w-full bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground rtl:pr-0 [&::-webkit-calendar-picker-indicator]:hidden flex rtl:justify-end\"\n [value]=\"startTimeString()\"\n (change)=\"updateStartTime($event)\"\n id=\"start-time\"\n />\n <div class=\"flex items-center justify-center px-3 py-2 ltr:border-l rtl:border-r border-input bg-muted/50 text-muted-foreground\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>\n </div>\n </div>\n </div>\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium\" for=\"end-time\">{{ endTimeLabel() }}</label>\n <div class=\"flex items-center rounded-md border border-input focus-within:ring-1 focus-within:ring-ring\">\n <input\n type=\"time\"\n [attr.dir]=\"dir()\"\n class=\"flex-1 w-full bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground rtl:pr-0 [&::-webkit-calendar-picker-indicator]:hidden flex rtl:justify-end\"\n [value]=\"endTimeString()\"\n (change)=\"updateEndTime($event)\"\n id=\"end-time\"\n />\n <div class=\"flex items-center justify-center px-3 py-2 ltr:border-l rtl:border-r border-input bg-muted/50 text-muted-foreground\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>\n </div>\n </div>\n </div>\n </div>\n } @else {\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium\" for=\"time\">{{ timeLabel() }}</label>\n <div class=\"flex items-center rounded-md border border-input focus-within:ring-1 focus-within:ring-ring\">\n <input\n type=\"time\"\n [attr.dir]=\"dir()\"\n class=\"flex-1 w-full bg-transparent px-3 py-1 text-sm outline-none placeholder:text-muted-foreground rtl:pr-0 [&::-webkit-calendar-picker-indicator]:hidden flex rtl:justify-end\"\n [value]=\"selectedTimeString()\"\n (change)=\"updateTime($event)\"\n id=\"time\"\n />\n <div class=\"flex items-center justify-center px-3 py-2 ltr:border-l rtl:border-r border-input bg-muted/50 text-muted-foreground\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>\n </div>\n </div>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{--_d: var(--density-picker, var(--density, 1));--density-button: var(--_d);--density-select: var(--_d)}@layer components{ui-select-trigger{--ui-select-trigger-h: 1.75rem}[data-slot=calendar-filler]{height:calc(2.25rem * var(--_d));width:calc(2.25rem * var(--_d))}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: SelectComponent, selector: "ui-select", inputs: ["disabled", "placeholder", "ariaLabel", "ariaLabelledby", "defaultValue", "locale", "position", "options", "displayWith", "value", "valueAttribute", "disabledWith"], outputs: ["valueChange"] }, { kind: "component", type: SelectTriggerComponent, selector: "ui-select-trigger", inputs: ["class", "ariaLabel", "loading", "skeleton"] }, { kind: "component", type: SelectValueComponent, selector: "ui-select-value", inputs: ["placeholder", "displayValue"] }, { kind: "component", type: SelectContentComponent, selector: "ui-select-content", inputs: ["class", "position", "side"] }, { kind: "component", type: SelectItemComponent, selector: "ui-select-item", inputs: ["value", "disabled", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7121
7344
|
}
|
|
7122
7345
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
7123
7346
|
type: Component,
|
|
@@ -7837,6 +8060,7 @@ class PopoverContentComponent {
|
|
|
7837
8060
|
constructor() {
|
|
7838
8061
|
this.popover = inject(POPOVER, { optional: true });
|
|
7839
8062
|
this.document = inject(DOCUMENT);
|
|
8063
|
+
this.hostEl = inject(ElementRef);
|
|
7840
8064
|
/** Extra classes merged onto the panel. Keep a width constraint viewport-aware (`max-w-[calc(100vw-2rem)]`), since the panel is positioned, not laid out by its parent. */
|
|
7841
8065
|
this.class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
7842
8066
|
/** Alignment along the chosen {@link side}'s edge: `'start'`, `'center'` or `'end'`. May be flipped at runtime when {@link avoidCollisions} is on. */
|
|
@@ -8070,6 +8294,7 @@ class PopoverContentComponent {
|
|
|
8070
8294
|
this.portalHost.dataset['popoverPortal'] = 'true';
|
|
8071
8295
|
this.portalHost.style.cssText = 'display:contents';
|
|
8072
8296
|
this.document.body.appendChild(this.portalHost);
|
|
8297
|
+
inheritThemeTokens(this.hostEl.nativeElement, this.portalHost);
|
|
8073
8298
|
this.popover?.registerPortal(this.portalHost);
|
|
8074
8299
|
}
|
|
8075
8300
|
this.portalHost.appendChild(el);
|
|
@@ -8440,9 +8665,9 @@ class DataTableFilterBuilderComponent {
|
|
|
8440
8665
|
<div class="space-y-2 rounded-md border bg-background p-2" data-slot="filter-group">
|
|
8441
8666
|
<div class="flex items-center gap-2">
|
|
8442
8667
|
<div class="inline-flex shrink-0 overflow-hidden rounded-md border text-xs">
|
|
8443
|
-
<button type="button" class="px-2 py-1" [class.bg-accent]="group().combinator === 'and'"
|
|
8668
|
+
<button type="button" class="px-2 py-1 pointer-coarse:min-w-11" [class.bg-accent]="group().combinator === 'and'"
|
|
8444
8669
|
(click)="setCombinator('and')">{{ labels().and }}</button>
|
|
8445
|
-
<button type="button" class="px-2 py-1 border-s" [class.bg-accent]="group().combinator === 'or'"
|
|
8670
|
+
<button type="button" class="px-2 py-1 border-s pointer-coarse:min-w-11" [class.bg-accent]="group().combinator === 'or'"
|
|
8446
8671
|
(click)="setCombinator('or')">{{ labels().or }}</button>
|
|
8447
8672
|
</div>
|
|
8448
8673
|
<span class="text-xs text-muted-foreground">
|
|
@@ -8470,7 +8695,7 @@ class DataTableFilterBuilderComponent {
|
|
|
8470
8695
|
class="h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-sm"
|
|
8471
8696
|
[value]="asText(rule.value)" (input)="patch($index, { value: selectValue($event) })" />
|
|
8472
8697
|
}
|
|
8473
|
-
<button type="button" class="ms-auto inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive"
|
|
8698
|
+
<button type="button" class="ms-auto inline-flex h-7 w-7 pointer-coarse:size-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive"
|
|
8474
8699
|
[attr.aria-label]="labels().removeCondition" (click)="removeRule($index)">
|
|
8475
8700
|
<ui-icon name="x" size="xs" />
|
|
8476
8701
|
</button>
|
|
@@ -8486,11 +8711,11 @@ class DataTableFilterBuilderComponent {
|
|
|
8486
8711
|
}
|
|
8487
8712
|
|
|
8488
8713
|
<div class="flex flex-wrap gap-2">
|
|
8489
|
-
<ui-button size="sm" variant="outline" (click)="addCondition()">{{ labels().addCondition }}</ui-button>
|
|
8490
|
-
<ui-button size="sm" variant="ghost" (click)="addGroup()">{{ labels().addGroup }}</ui-button>
|
|
8714
|
+
<ui-button size="sm" variant="outline" class="pointer-coarse:h-11" (click)="addCondition()">{{ labels().addCondition }}</ui-button>
|
|
8715
|
+
<ui-button size="sm" variant="ghost" class="pointer-coarse:h-11" (click)="addGroup()">{{ labels().addGroup }}</ui-button>
|
|
8491
8716
|
</div>
|
|
8492
8717
|
</div>
|
|
8493
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DataTableFilterBuilderComponent, selector: "ui-data-table-filter-builder", inputs: ["group", "columns", "labels"], outputs: ["groupChange"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8718
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DataTableFilterBuilderComponent, selector: "ui-data-table-filter-builder", inputs: ["group", "columns", "labels"], outputs: ["groupChange"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8494
8719
|
}
|
|
8495
8720
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableFilterBuilderComponent, decorators: [{
|
|
8496
8721
|
type: Component,
|
|
@@ -8502,9 +8727,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8502
8727
|
<div class="space-y-2 rounded-md border bg-background p-2" data-slot="filter-group">
|
|
8503
8728
|
<div class="flex items-center gap-2">
|
|
8504
8729
|
<div class="inline-flex shrink-0 overflow-hidden rounded-md border text-xs">
|
|
8505
|
-
<button type="button" class="px-2 py-1" [class.bg-accent]="group().combinator === 'and'"
|
|
8730
|
+
<button type="button" class="px-2 py-1 pointer-coarse:min-w-11" [class.bg-accent]="group().combinator === 'and'"
|
|
8506
8731
|
(click)="setCombinator('and')">{{ labels().and }}</button>
|
|
8507
|
-
<button type="button" class="px-2 py-1 border-s" [class.bg-accent]="group().combinator === 'or'"
|
|
8732
|
+
<button type="button" class="px-2 py-1 border-s pointer-coarse:min-w-11" [class.bg-accent]="group().combinator === 'or'"
|
|
8508
8733
|
(click)="setCombinator('or')">{{ labels().or }}</button>
|
|
8509
8734
|
</div>
|
|
8510
8735
|
<span class="text-xs text-muted-foreground">
|
|
@@ -8532,7 +8757,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8532
8757
|
class="h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-sm"
|
|
8533
8758
|
[value]="asText(rule.value)" (input)="patch($index, { value: selectValue($event) })" />
|
|
8534
8759
|
}
|
|
8535
|
-
<button type="button" class="ms-auto inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive"
|
|
8760
|
+
<button type="button" class="ms-auto inline-flex h-7 w-7 pointer-coarse:size-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive"
|
|
8536
8761
|
[attr.aria-label]="labels().removeCondition" (click)="removeRule($index)">
|
|
8537
8762
|
<ui-icon name="x" size="xs" />
|
|
8538
8763
|
</button>
|
|
@@ -8548,8 +8773,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8548
8773
|
}
|
|
8549
8774
|
|
|
8550
8775
|
<div class="flex flex-wrap gap-2">
|
|
8551
|
-
<ui-button size="sm" variant="outline" (click)="addCondition()">{{ labels().addCondition }}</ui-button>
|
|
8552
|
-
<ui-button size="sm" variant="ghost" (click)="addGroup()">{{ labels().addGroup }}</ui-button>
|
|
8776
|
+
<ui-button size="sm" variant="outline" class="pointer-coarse:h-11" (click)="addCondition()">{{ labels().addCondition }}</ui-button>
|
|
8777
|
+
<ui-button size="sm" variant="ghost" class="pointer-coarse:h-11" (click)="addGroup()">{{ labels().addGroup }}</ui-button>
|
|
8553
8778
|
</div>
|
|
8554
8779
|
</div>
|
|
8555
8780
|
`,
|
|
@@ -8827,6 +9052,14 @@ const DEFAULT_GET_ROW_ID = (row) => {
|
|
|
8827
9052
|
return JSON.stringify(row);
|
|
8828
9053
|
return stringifyValue(id);
|
|
8829
9054
|
};
|
|
9055
|
+
/**
|
|
9056
|
+
* Serialises a grid as the TSV every copy path writes: one line per row, cells
|
|
9057
|
+
* formula-guarded so pasting into a spreadsheet never runs a cell as a formula.
|
|
9058
|
+
* The paste path undoes the guard with `restoreSpreadsheetText`.
|
|
9059
|
+
*/
|
|
9060
|
+
function toClipboardText(grid) {
|
|
9061
|
+
return grid.map((cells) => cells.map(guardSpreadsheetFormula).join("\t")).join("\n");
|
|
9062
|
+
}
|
|
8830
9063
|
/**
|
|
8831
9064
|
* Whether two requests describe the same page of data.
|
|
8832
9065
|
*
|
|
@@ -8845,6 +9078,61 @@ function sameQuery(a, b) {
|
|
|
8845
9078
|
a.sortStates.length === b.sortStates.length &&
|
|
8846
9079
|
a.sortStates.every((sort, i) => sameSort(sort, b.sortStates[i])));
|
|
8847
9080
|
}
|
|
9081
|
+
const CSS_NEWLINE_ESCAPES = {
|
|
9082
|
+
"\n": String.raw `\a `,
|
|
9083
|
+
"\r": String.raw `\d `,
|
|
9084
|
+
"\f": String.raw `\c `,
|
|
9085
|
+
};
|
|
9086
|
+
/**
|
|
9087
|
+
* `value` as a quoted CSS string, so an attribute selector built from it
|
|
9088
|
+
* matches exactly that value whatever characters it holds. A quoted string
|
|
9089
|
+
* needs only quotes, backslashes and line breaks escaped; unlike
|
|
9090
|
+
* `CSS.escape`, this works where the `CSS` global is missing (jsdom, SSR).
|
|
9091
|
+
*/
|
|
9092
|
+
function cssString(value) {
|
|
9093
|
+
const escaped = value
|
|
9094
|
+
.replaceAll(/["\\]/g, (ch) => `\\${ch}`)
|
|
9095
|
+
.replaceAll(/[\n\r\f]/g, (ch) => CSS_NEWLINE_ESCAPES[ch]);
|
|
9096
|
+
return `"${escaped}"`;
|
|
9097
|
+
}
|
|
9098
|
+
/**
|
|
9099
|
+
* Width of the built-in expander column on a coarse pointer: its 44px toggle
|
|
9100
|
+
* plus the cell's padding and border. A fine pointer keeps the 40px desktop
|
|
9101
|
+
* width. (The 50px actions column already holds a centred 44px button.)
|
|
9102
|
+
*/
|
|
9103
|
+
const TOUCH_EXPANDER_COLUMN_WIDTH = "64px";
|
|
9104
|
+
/** Fixed virtual row height for a mouse when {@link DataTableComponent.virtualRowHeight} is unset. */
|
|
9105
|
+
const DEFAULT_VIRTUAL_ROW_HEIGHT = 40;
|
|
9106
|
+
/**
|
|
9107
|
+
* Fixed virtual row height on a coarse pointer when `virtualRowHeight` is
|
|
9108
|
+
* unset: a 44px control, the cell's 8px padding above and below, and its border.
|
|
9109
|
+
*/
|
|
9110
|
+
const TOUCH_VIRTUAL_ROW_HEIGHT = 60;
|
|
9111
|
+
/** Whether this environment has `ResizeObserver`; jsdom and some SSR shims do not. */
|
|
9112
|
+
function hasResizeObserver() {
|
|
9113
|
+
return typeof globalThis.ResizeObserver === "function";
|
|
9114
|
+
}
|
|
9115
|
+
/**
|
|
9116
|
+
* The floor for a data column that sets no `minWidth`: an auto-width column
|
|
9117
|
+
* never shrinks below it, and resizing or auto-fit never go under it.
|
|
9118
|
+
*/
|
|
9119
|
+
const DEFAULT_COLUMN_MIN_WIDTH = "80px";
|
|
9120
|
+
/**
|
|
9121
|
+
* The column's `minWidth`, else the default floor. The built-in selection,
|
|
9122
|
+
* expander and actions columns get no floor — they carry their own width.
|
|
9123
|
+
*/
|
|
9124
|
+
function resolveColumnMinWidth(col) {
|
|
9125
|
+
if (col.minWidth)
|
|
9126
|
+
return col.minWidth;
|
|
9127
|
+
const key = col.accessorKey;
|
|
9128
|
+
const isSpecial = key === "_selection" || key === "_expander" || key === "_actions";
|
|
9129
|
+
return isSpecial ? "0px" : DEFAULT_COLUMN_MIN_WIDTH;
|
|
9130
|
+
}
|
|
9131
|
+
/** The pixel floor resize and auto-fit clamp to — `minWidth` is read as pixels. */
|
|
9132
|
+
function columnMinWidthPx(col) {
|
|
9133
|
+
const px = Number.parseFloat(col._minWidth ?? resolveColumnMinWidth(col));
|
|
9134
|
+
return Number.isFinite(px) ? px : Number.parseFloat(DEFAULT_COLUMN_MIN_WIDTH);
|
|
9135
|
+
}
|
|
8848
9136
|
class DataTableComponent {
|
|
8849
9137
|
/**
|
|
8850
9138
|
* True when the host element's resolved writing direction is RTL. Read from
|
|
@@ -9069,6 +9357,12 @@ class DataTableComponent {
|
|
|
9069
9357
|
}
|
|
9070
9358
|
return this.filteredTree_filterIncludeParents(rows, ctx);
|
|
9071
9359
|
}
|
|
9360
|
+
/** The current page of `rows`, per {@link paginationState}. */
|
|
9361
|
+
slicePage(rows) {
|
|
9362
|
+
const { pageIndex, pageSize } = this.paginationState();
|
|
9363
|
+
const start = pageIndex * pageSize;
|
|
9364
|
+
return rows.slice(start, start + pageSize);
|
|
9365
|
+
}
|
|
9072
9366
|
buildGroupRow(groupKey, groupValue, rows, collapsed) {
|
|
9073
9367
|
const aggregates = new Map();
|
|
9074
9368
|
if (this.groupAggregates()) {
|
|
@@ -9208,14 +9502,20 @@ class DataTableComponent {
|
|
|
9208
9502
|
this.data = model.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
9209
9503
|
/** @see columnHelper for a type-safe fluent builder API */
|
|
9210
9504
|
this.columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
9505
|
+
/**
|
|
9506
|
+
* Colour preset for this table and its overlays — the names `change-theme`
|
|
9507
|
+
* accepts. Unset, the table follows the app's global tokens.
|
|
9508
|
+
*/
|
|
9509
|
+
this.theme = input(...(ngDevMode ? [undefined, { debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
9211
9510
|
/** Hides the whole toolbar row (global filter, advanced filter, columns menu) when false. */
|
|
9212
9511
|
this.showToolbar = input(true, ...(ngDevMode ? [{ debugName: "showToolbar" }] : /* istanbul ignore next */ []));
|
|
9213
9512
|
/** Hides the columns popover in the toolbar; only shown when at least one column is hideable. */
|
|
9214
9513
|
this.showColumnVisibilityToggle = input(true, ...(ngDevMode ? [{ debugName: "showColumnVisibilityToggle" }] : /* istanbul ignore next */ []));
|
|
9215
9514
|
/**
|
|
9216
|
-
* Renders the pagination footer.
|
|
9217
|
-
*
|
|
9218
|
-
*
|
|
9515
|
+
* Renders the pagination footer. With {@link localPagination} on it is also
|
|
9516
|
+
* what pages the rows: hide it and every row renders, since no control
|
|
9517
|
+
* could reach a later page. It is a mode switch for virtual scroll too:
|
|
9518
|
+
* `enableVirtualScroll: "auto"` declines to virtualize while it shows.
|
|
9219
9519
|
*/
|
|
9220
9520
|
this.showPagination = input(true, ...(ngDevMode ? [{ debugName: "showPagination" }] : /* istanbul ignore next */ []));
|
|
9221
9521
|
/** Adds the horizontal rule under each row/header cell. Purely cosmetic. */
|
|
@@ -9229,9 +9529,11 @@ class DataTableComponent {
|
|
|
9229
9529
|
*/
|
|
9230
9530
|
this.localSorting = input(true, ...(ngDevMode ? [{ debugName: "localSorting" }] : /* istanbul ignore next */ []));
|
|
9231
9531
|
/**
|
|
9232
|
-
* Slice the rows in the browser
|
|
9233
|
-
*
|
|
9234
|
-
*
|
|
9532
|
+
* Slice the rows in the browser, while the footer ({@link showPagination})
|
|
9533
|
+
* is shown and virtual scroll is off. Set false for server-side paging, or
|
|
9534
|
+
* to drive paging from your own controls: supply only the current page in
|
|
9535
|
+
* {@link data}, set {@link total} to the full row count, and re-fetch from
|
|
9536
|
+
* {@link pageChange}.
|
|
9235
9537
|
*/
|
|
9236
9538
|
this.localPagination = input(true, ...(ngDevMode ? [{ debugName: "localPagination" }] : /* istanbul ignore next */ []));
|
|
9237
9539
|
/**
|
|
@@ -9383,7 +9685,9 @@ class DataTableComponent {
|
|
|
9383
9685
|
/**
|
|
9384
9686
|
* Enables the clipboard paths: `Ctrl/Cmd+C` and the
|
|
9385
9687
|
* `copy*ToClipboard` methods, all of which return early when false. The
|
|
9386
|
-
* selection, expander and actions columns are never copied.
|
|
9688
|
+
* selection, expander and actions columns are never copied. A copied cell a
|
|
9689
|
+
* spreadsheet would run as a formula (`=`, `+`, `-`, `@`, tab, CR) is written
|
|
9690
|
+
* with a leading `'`; see `guardSpreadsheetFormula`.
|
|
9387
9691
|
*/
|
|
9388
9692
|
this.enableCopy = input(true, ...(ngDevMode ? [{ debugName: "enableCopy" }] : /* istanbul ignore next */ []));
|
|
9389
9693
|
/**
|
|
@@ -9565,7 +9869,9 @@ class DataTableComponent {
|
|
|
9565
9869
|
this.fillSeries = output();
|
|
9566
9870
|
/**
|
|
9567
9871
|
* Allow pasting a clipboard grid (TSV/CSV) into cells starting at the focused
|
|
9568
|
-
* cell (`Ctrl/Cmd+V`). Only columns with a `valueSetter` are written.
|
|
9872
|
+
* cell (`Ctrl/Cmd+V`). Only columns with a `valueSetter` are written. The
|
|
9873
|
+
* formula guard's leading `'` is dropped, as a spreadsheet does, so a range
|
|
9874
|
+
* copied out of the table pastes back unchanged.
|
|
9569
9875
|
*/
|
|
9570
9876
|
this.enableClipboardPaste = input(false, ...(ngDevMode ? [{ debugName: "enableClipboardPaste" }] : /* istanbul ignore next */ []));
|
|
9571
9877
|
/** Emitted after a clipboard grid is pasted into cells. */
|
|
@@ -9647,8 +9953,15 @@ class DataTableComponent {
|
|
|
9647
9953
|
* Row height in pixels assumed by the virtual-scroll maths, and the fallback
|
|
9648
9954
|
* for unmeasured rows under {@link virtualVariableRowHeight}. If your CSS row
|
|
9649
9955
|
* height differs, the scrollbar and the rows drift apart.
|
|
9956
|
+
*
|
|
9957
|
+
* Unset, it follows the pointer: 40px for a mouse, 60px on a touch screen,
|
|
9958
|
+
* where every in-row control is a 44px target plus the cell's padding and a
|
|
9959
|
+
* fixed-height row would clip it. A value you set applies on every pointer,
|
|
9960
|
+
* so keep it at 60 or more if touch users should reach in-row controls.
|
|
9650
9961
|
*/
|
|
9651
|
-
this.virtualRowHeight = input(
|
|
9962
|
+
this.virtualRowHeight = input(undefined, ...(ngDevMode ? [{ debugName: "virtualRowHeight" }] : /* istanbul ignore next */ []));
|
|
9963
|
+
/** The row height the virtual-scroll maths use: {@link virtualRowHeight}, or the pointer's default when unset. */
|
|
9964
|
+
this.effectiveRowHeight = computed(() => this.virtualRowHeight() ?? (this.coarsePointer() ? TOUCH_VIRTUAL_ROW_HEIGHT : DEFAULT_VIRTUAL_ROW_HEIGHT), ...(ngDevMode ? [{ debugName: "effectiveRowHeight" }] : /* istanbul ignore next */ []));
|
|
9652
9965
|
/** Extra rows rendered above and below the viewport to hide scroll tearing. */
|
|
9653
9966
|
this.virtualRowBuffer = input(5, ...(ngDevMode ? [{ debugName: "virtualRowBuffer" }] : /* istanbul ignore next */ []));
|
|
9654
9967
|
/** Extra columns rendered either side of the viewport during horizontal virtualization. */
|
|
@@ -9656,7 +9969,9 @@ class DataTableComponent {
|
|
|
9656
9969
|
/**
|
|
9657
9970
|
* Measures each rendered row and uses prefix sums instead of a fixed row
|
|
9658
9971
|
* height — needed for wrapping content, at the cost of a `ResizeObserver` per
|
|
9659
|
-
* row and re-measurement as rows scroll in.
|
|
9972
|
+
* row and re-measurement as rows scroll in. Where `ResizeObserver` is
|
|
9973
|
+
* missing (jsdom, some SSR shims), rows keep the {@link virtualRowHeight}
|
|
9974
|
+
* estimate and the viewport keeps the size it had at first render.
|
|
9660
9975
|
*/
|
|
9661
9976
|
this.virtualVariableRowHeight = input(false, ...(ngDevMode ? [{ debugName: "virtualVariableRowHeight" }] : /* istanbul ignore next */ []));
|
|
9662
9977
|
/**
|
|
@@ -9735,13 +10050,13 @@ class DataTableComponent {
|
|
|
9735
10050
|
return Number.parseInt(String(w), 10) || autoWidth;
|
|
9736
10051
|
});
|
|
9737
10052
|
}, ...(ngDevMode ? [{ debugName: "scrollableColumnWidths" }] : /* istanbul ignore next */ []));
|
|
10053
|
+
/** A row's measured height, or the {@link virtualRowHeight} estimate until it has been measured. */
|
|
10054
|
+
this.rowHeightAt = (index) => this.rowHeightCache.get(index) ?? this.effectiveRowHeight();
|
|
9738
10055
|
this._prefixSums = computed(() => {
|
|
9739
10056
|
if (!this.virtualVariableRowHeight())
|
|
9740
10057
|
return undefined;
|
|
9741
10058
|
this.measurementVersion();
|
|
9742
|
-
|
|
9743
|
-
const defaultHeight = this.virtualRowHeight();
|
|
9744
|
-
return buildPrefixSums((index) => this.rowHeightCache.get(index) ?? defaultHeight, totalRows);
|
|
10059
|
+
return buildPrefixSums(this.rowHeightAt, this.virtualTotalRows());
|
|
9745
10060
|
}, ...(ngDevMode ? [{ debugName: "_prefixSums" }] : /* istanbul ignore next */ []));
|
|
9746
10061
|
this.virtualRowRange = computed(() => {
|
|
9747
10062
|
if (!this.isVirtualScrollActive()) {
|
|
@@ -9751,11 +10066,9 @@ class DataTableComponent {
|
|
|
9751
10066
|
const totalRows = this.virtualTotalRows();
|
|
9752
10067
|
const buffer = this.virtualRowBuffer();
|
|
9753
10068
|
if (this.virtualVariableRowHeight()) {
|
|
9754
|
-
|
|
9755
|
-
const getHeight = (index) => this.rowHeightCache.get(index) ?? defaultHeight;
|
|
9756
|
-
return computeVariableRowRange(this.virtualScrollTop(), this.viewportHeight(), getHeight, totalRows, buffer, this._prefixSums());
|
|
10069
|
+
return computeVariableRowRange(this.virtualScrollTop(), this.viewportHeight(), this.rowHeightAt, totalRows, buffer, this._prefixSums());
|
|
9757
10070
|
}
|
|
9758
|
-
const rowHeight = this.
|
|
10071
|
+
const rowHeight = this.effectiveRowHeight();
|
|
9759
10072
|
const range = computeRowRange(this.virtualScrollTop(), this.viewportHeight(), rowHeight, totalRows, buffer);
|
|
9760
10073
|
return {
|
|
9761
10074
|
...range,
|
|
@@ -9874,6 +10187,10 @@ class DataTableComponent {
|
|
|
9874
10187
|
/**
|
|
9875
10188
|
* Current page index and size. Two-way: the table resets `pageIndex` to 0
|
|
9876
10189
|
* whenever a filter changes, so don't assume it stays where you put it.
|
|
10190
|
+
* It slices the rows only while the table pages them itself
|
|
10191
|
+
* ({@link localPagination} with the footer shown); setting it with the
|
|
10192
|
+
* footer hidden does not page, so page from your own controls with
|
|
10193
|
+
* `localPagination` off.
|
|
9877
10194
|
*/
|
|
9878
10195
|
this.paginationState = model({ pageIndex: 0, pageSize: 10 }, ...(ngDevMode ? [{ debugName: "paginationState" }] : /* istanbul ignore next */ []));
|
|
9879
10196
|
/** Choices offered in the footer's page-size select. */
|
|
@@ -10005,45 +10322,37 @@ class DataTableComponent {
|
|
|
10005
10322
|
return data;
|
|
10006
10323
|
return data.sort(this.buildSortComparator(sorts));
|
|
10007
10324
|
}, ...(ngDevMode ? [{ debugName: "sortedData" }] : /* istanbul ignore next */ []));
|
|
10325
|
+
/**
|
|
10326
|
+
* Whether the table slices its rows into pages itself. Only while the user
|
|
10327
|
+
* can page them: with the pager hidden, or a virtual list rendering every
|
|
10328
|
+
* row, a slice would leave rows no control can reach.
|
|
10329
|
+
*/
|
|
10330
|
+
this.pagesLocally = computed(() => this.localPagination() && this.showPagination() && !this.isVirtualScrollActive(), ...(ngDevMode ? [{ debugName: "pagesLocally" }] : /* istanbul ignore next */ []));
|
|
10008
10331
|
this.processedData = computed(() => {
|
|
10009
10332
|
if (this.enableSubRows()) {
|
|
10010
10333
|
const visible = this.visibleTreeRows();
|
|
10011
|
-
if (!this.
|
|
10334
|
+
if (!this.pagesLocally())
|
|
10012
10335
|
return visible.map((tr) => tr.row);
|
|
10013
10336
|
if (this.subRowsPaginated()) {
|
|
10014
|
-
|
|
10015
|
-
const start = pageIndex * pageSize;
|
|
10016
|
-
return visible.slice(start, start + pageSize).map((tr) => tr.row);
|
|
10337
|
+
return this.slicePage(visible).map((tr) => tr.row);
|
|
10017
10338
|
}
|
|
10018
|
-
|
|
10019
|
-
const { pageIndex, pageSize } = this.paginationState();
|
|
10020
|
-
const start = pageIndex * pageSize;
|
|
10021
|
-
const rootSlice = treeData.slice(start, start + pageSize);
|
|
10022
|
-
return this.flattenTreeRowsForPage(rootSlice);
|
|
10339
|
+
return this.flattenTreeRowsForPage(this.slicePage(this.sortedTreeData()));
|
|
10023
10340
|
}
|
|
10024
10341
|
const data = this.sortedData();
|
|
10025
|
-
if (!this.
|
|
10342
|
+
if (!this.pagesLocally())
|
|
10026
10343
|
return data;
|
|
10027
|
-
|
|
10028
|
-
const start = pageIndex * pageSize;
|
|
10029
|
-
return data.slice(start, start + pageSize);
|
|
10344
|
+
return this.slicePage(data);
|
|
10030
10345
|
}, ...(ngDevMode ? [{ debugName: "processedData" }] : /* istanbul ignore next */ []));
|
|
10031
10346
|
this.processedTreeRows = computed(() => {
|
|
10032
10347
|
if (!this.enableSubRows())
|
|
10033
10348
|
return [];
|
|
10034
10349
|
const visible = this.visibleTreeRows();
|
|
10035
|
-
if (!this.
|
|
10350
|
+
if (!this.pagesLocally())
|
|
10036
10351
|
return visible;
|
|
10037
10352
|
if (this.subRowsPaginated()) {
|
|
10038
|
-
|
|
10039
|
-
const start = pageIndex * pageSize;
|
|
10040
|
-
return visible.slice(start, start + pageSize);
|
|
10353
|
+
return this.slicePage(visible);
|
|
10041
10354
|
}
|
|
10042
|
-
|
|
10043
|
-
const { pageIndex, pageSize } = this.paginationState();
|
|
10044
|
-
const start = pageIndex * pageSize;
|
|
10045
|
-
const rootSlice = treeData.slice(start, start + pageSize);
|
|
10046
|
-
return this.flattenTreeRowsForPageFull(rootSlice);
|
|
10355
|
+
return this.flattenTreeRowsForPageFull(this.slicePage(this.sortedTreeData()));
|
|
10047
10356
|
}, ...(ngDevMode ? [{ debugName: "processedTreeRows" }] : /* istanbul ignore next */ []));
|
|
10048
10357
|
this.activeTotalItems = computed(() => {
|
|
10049
10358
|
if (this.groupingActive()) {
|
|
@@ -10108,16 +10417,14 @@ class DataTableComponent {
|
|
|
10108
10417
|
*/
|
|
10109
10418
|
this.keepGroupAggregateOrder = () => 0;
|
|
10110
10419
|
/**
|
|
10111
|
-
* `groupedDisplayRows()` sliced for the current page when
|
|
10112
|
-
*
|
|
10420
|
+
* `groupedDisplayRows()` sliced for the current page when the table
|
|
10421
|
+
* {@link pagesLocally}. Group header rows count toward the page size.
|
|
10113
10422
|
*/
|
|
10114
10423
|
this.pagedGroupedDisplayRows = computed(() => {
|
|
10115
10424
|
const rows = this.groupedDisplayRows();
|
|
10116
|
-
if (!this.
|
|
10425
|
+
if (!this.pagesLocally())
|
|
10117
10426
|
return rows;
|
|
10118
|
-
|
|
10119
|
-
const start = pageIndex * pageSize;
|
|
10120
|
-
return rows.slice(start, start + pageSize);
|
|
10427
|
+
return this.slicePage(rows);
|
|
10121
10428
|
}, ...(ngDevMode ? [{ debugName: "pagedGroupedDisplayRows" }] : /* istanbul ignore next */ []));
|
|
10122
10429
|
this.filteredRowIds = computed(() => {
|
|
10123
10430
|
if (this.enableSubRows()) {
|
|
@@ -10134,6 +10441,13 @@ class DataTableComponent {
|
|
|
10134
10441
|
this.flashingCells = signal(new Map(), ...(ngDevMode ? [{ debugName: "flashingCells" }] : /* istanbul ignore next */ []));
|
|
10135
10442
|
this.flashTimers = [];
|
|
10136
10443
|
this._longPressCleanup = null;
|
|
10444
|
+
/**
|
|
10445
|
+
* Whether the primary pointer is coarse (a touch screen). The built-in
|
|
10446
|
+
* expander column widens with it, so its 44px toggles fit the cell and the
|
|
10447
|
+
* sticky offsets computed from that width stay right.
|
|
10448
|
+
*/
|
|
10449
|
+
this.coarsePointer = signal(false, ...(ngDevMode ? [{ debugName: "coarsePointer" }] : /* istanbul ignore next */ []));
|
|
10450
|
+
this._coarsePointerCleanup = null;
|
|
10137
10451
|
this.activeSorts = computed(() => {
|
|
10138
10452
|
if (this.enableMultiSort()) {
|
|
10139
10453
|
return this.multiSortState().filter((sort) => !!sort.column && !!sort.direction);
|
|
@@ -10366,16 +10680,18 @@ class DataTableComponent {
|
|
|
10366
10680
|
normal: cn("whitespace-nowrap overflow-hidden text-ellipsis", "bg-background", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"),
|
|
10367
10681
|
tree: cn("whitespace-nowrap overflow-hidden text-ellipsis", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"),
|
|
10368
10682
|
}), ...(ngDevMode ? [{ debugName: "_baseCellClass" }] : /* istanbul ignore next */ []));
|
|
10683
|
+
// `pointer-coarse:h-auto`: a header cell grows to hold its 44px touch controls
|
|
10684
|
+
// instead of clipping them at the fixed desktop header height.
|
|
10369
10685
|
this._headerClassMap = computed(() => {
|
|
10370
10686
|
const showColBorders = this.showColumnBorders();
|
|
10371
10687
|
const enableResize = this.enableColumnResize();
|
|
10372
10688
|
const map = new Map();
|
|
10373
10689
|
for (const col of this.enhancedColumns()) {
|
|
10374
|
-
map.set(String(col.accessorKey), cn("sticky top-0 bg-background shadow-sm whitespace-nowrap overflow-hidden text-ellipsis", col.sticky ? "z-30" : "z-20", showColBorders && "border-r", enableResize && "relative"));
|
|
10690
|
+
map.set(String(col.accessorKey), cn("sticky top-0 bg-background shadow-sm whitespace-nowrap overflow-hidden text-ellipsis pointer-coarse:h-auto", col.sticky ? "z-30" : "z-20", showColBorders && "border-r", enableResize && "relative"));
|
|
10375
10691
|
}
|
|
10376
10692
|
return map;
|
|
10377
10693
|
}, ...(ngDevMode ? [{ debugName: "_headerClassMap" }] : /* istanbul ignore next */ []));
|
|
10378
|
-
this._fillerHeaderClass = computed(() => cn("sticky top-0 bg-background shadow-sm whitespace-nowrap overflow-hidden text-ellipsis", "z-20", this.showColumnBorders() && "border-r"), ...(ngDevMode ? [{ debugName: "_fillerHeaderClass" }] : /* istanbul ignore next */ []));
|
|
10694
|
+
this._fillerHeaderClass = computed(() => cn("sticky top-0 bg-background shadow-sm whitespace-nowrap overflow-hidden text-ellipsis pointer-coarse:h-auto", "z-20", this.showColumnBorders() && "border-r"), ...(ngDevMode ? [{ debugName: "_fillerHeaderClass" }] : /* istanbul ignore next */ []));
|
|
10379
10695
|
this._cellStyleMap = computed(() => {
|
|
10380
10696
|
const map = new Map();
|
|
10381
10697
|
for (const col of this.enhancedColumns()) {
|
|
@@ -10601,9 +10917,11 @@ class DataTableComponent {
|
|
|
10601
10917
|
this.resizeOldWidth = "auto";
|
|
10602
10918
|
this.setupCellFlashEffect();
|
|
10603
10919
|
this.setupPaginationEffect();
|
|
10604
|
-
this.
|
|
10605
|
-
|
|
10606
|
-
|
|
10920
|
+
this.setupCoarsePointerQuery();
|
|
10921
|
+
// Without the API (jsdom, some SSR shims) rows keep the height estimate.
|
|
10922
|
+
this.rowResizeObserver = hasResizeObserver()
|
|
10923
|
+
? new ResizeObserver((entries) => this.handleRowResizes(entries))
|
|
10924
|
+
: undefined;
|
|
10607
10925
|
effect(() => {
|
|
10608
10926
|
if (!this.isVirtualScrollActive() || !this.virtualVariableRowHeight())
|
|
10609
10927
|
return;
|
|
@@ -10627,6 +10945,16 @@ class DataTableComponent {
|
|
|
10627
10945
|
this.validateConfiguration();
|
|
10628
10946
|
this.setupTouchRangeSelection();
|
|
10629
10947
|
}
|
|
10948
|
+
setupCoarsePointerQuery() {
|
|
10949
|
+
// Missing in jsdom and on the server: the desktop widths apply there.
|
|
10950
|
+
const query = this._document.defaultView?.matchMedia?.("(pointer: coarse)");
|
|
10951
|
+
if (!query)
|
|
10952
|
+
return;
|
|
10953
|
+
this.coarsePointer.set(query.matches);
|
|
10954
|
+
const onChange = (event) => this.coarsePointer.set(event.matches);
|
|
10955
|
+
query.addEventListener("change", onChange);
|
|
10956
|
+
this._coarsePointerCleanup = () => query.removeEventListener("change", onChange);
|
|
10957
|
+
}
|
|
10630
10958
|
/** Touch: long-press a cell to enter range-selection, then drag to extend. */
|
|
10631
10959
|
setupTouchRangeSelection() {
|
|
10632
10960
|
const container = this.scrollContainerRef()?.nativeElement;
|
|
@@ -10789,6 +11117,7 @@ class DataTableComponent {
|
|
|
10789
11117
|
this._document.removeEventListener('touchend', this._onFillEnd);
|
|
10790
11118
|
this._rangeDragCleanup?.();
|
|
10791
11119
|
this._longPressCleanup?.();
|
|
11120
|
+
this._coarsePointerCleanup?.();
|
|
10792
11121
|
this.viewportObserver?.disconnect();
|
|
10793
11122
|
this.rowResizeObserver?.disconnect();
|
|
10794
11123
|
}
|
|
@@ -10798,6 +11127,8 @@ class DataTableComponent {
|
|
|
10798
11127
|
return;
|
|
10799
11128
|
this.viewportHeight.set(container.clientHeight);
|
|
10800
11129
|
this.viewportWidth.set(container.clientWidth);
|
|
11130
|
+
if (!hasResizeObserver())
|
|
11131
|
+
return;
|
|
10801
11132
|
this.viewportObserver = new ResizeObserver((entries) => {
|
|
10802
11133
|
for (const entry of entries) {
|
|
10803
11134
|
const el = entry.target;
|
|
@@ -10833,8 +11164,7 @@ class DataTableComponent {
|
|
|
10833
11164
|
continue;
|
|
10834
11165
|
const index = Number.parseInt(indexStr, 10);
|
|
10835
11166
|
const newHeight = entry.borderBoxSize[0].blockSize;
|
|
10836
|
-
const
|
|
10837
|
-
const diff = newHeight - oldHeight;
|
|
11167
|
+
const diff = newHeight - this.rowHeightAt(index);
|
|
10838
11168
|
if (Math.abs(diff) < 0.5)
|
|
10839
11169
|
continue;
|
|
10840
11170
|
this.rowHeightCache.set(index, newHeight);
|
|
@@ -10987,7 +11317,8 @@ class DataTableComponent {
|
|
|
10987
11317
|
result = [{ accessorKey: '_selection', header: '', sticky: true, width: '40px' }, ...result];
|
|
10988
11318
|
}
|
|
10989
11319
|
if (this.enableRowExpansion()) {
|
|
10990
|
-
|
|
11320
|
+
const width = this.coarsePointer() ? TOUCH_EXPANDER_COLUMN_WIDTH : '40px';
|
|
11321
|
+
result = [{ accessorKey: '_expander', header: '', sticky: true, width, enableSorting: false }, ...result];
|
|
10991
11322
|
}
|
|
10992
11323
|
if (this.cellActionSlots().length > 0) {
|
|
10993
11324
|
result = [...result, { accessorKey: '_actions', header: '', width: '50px', enableSorting: false, enableHiding: false, enableReordering: false }];
|
|
@@ -11031,7 +11362,7 @@ class DataTableComponent {
|
|
|
11031
11362
|
_stickyRight: isPinnedRight ? (rightOffsets.get(index) ?? 0) : undefined,
|
|
11032
11363
|
_pin: pin,
|
|
11033
11364
|
_width: widthStr,
|
|
11034
|
-
_minWidth: col
|
|
11365
|
+
_minWidth: resolveColumnMinWidth(col),
|
|
11035
11366
|
};
|
|
11036
11367
|
return { column, nextLeft: isStickyLeft ? currentLeft + widthVal : currentLeft };
|
|
11037
11368
|
}
|
|
@@ -11236,7 +11567,7 @@ class DataTableComponent {
|
|
|
11236
11567
|
}
|
|
11237
11568
|
async pasteFromClipboard(startRow, startColumn) {
|
|
11238
11569
|
const text = await navigator.clipboard.readText();
|
|
11239
|
-
const grid = parseClipboardGrid(text);
|
|
11570
|
+
const grid = parseClipboardGrid(text).map((line) => line.map(restoreSpreadsheetText));
|
|
11240
11571
|
if (grid.length > 0)
|
|
11241
11572
|
this.pasteGridAt(startRow, startColumn, grid);
|
|
11242
11573
|
}
|
|
@@ -11394,7 +11725,8 @@ class DataTableComponent {
|
|
|
11394
11725
|
return base + " bg-primary/15";
|
|
11395
11726
|
}
|
|
11396
11727
|
if (rowIndex !== undefined && this.isCellInFillPreview(rowIndex, key)) {
|
|
11397
|
-
|
|
11728
|
+
// An outline, not a ring: a ring is a box-shadow and cannot be dashed.
|
|
11729
|
+
return base + " bg-primary/5 outline-1 outline-dashed outline-primary/40 -outline-offset-1";
|
|
11398
11730
|
}
|
|
11399
11731
|
return base;
|
|
11400
11732
|
}
|
|
@@ -11418,8 +11750,7 @@ class DataTableComponent {
|
|
|
11418
11750
|
_buildCellStyle(col, isHeader) {
|
|
11419
11751
|
const width = col._width;
|
|
11420
11752
|
const isAuto = width === "auto";
|
|
11421
|
-
const
|
|
11422
|
-
const minColWidth = isSpecial ? "0px" : "80px";
|
|
11753
|
+
const minColWidth = col._minWidth ?? resolveColumnMinWidth(col);
|
|
11423
11754
|
const style = {
|
|
11424
11755
|
width: isAuto ? "0px" : width,
|
|
11425
11756
|
"min-width": isAuto ? minColWidth : width,
|
|
@@ -12139,15 +12470,9 @@ class DataTableComponent {
|
|
|
12139
12470
|
const host = this._el.nativeElement;
|
|
12140
12471
|
if (typeof host?.querySelector !== "function")
|
|
12141
12472
|
return null;
|
|
12142
|
-
const rowId =
|
|
12143
|
-
const key =
|
|
12144
|
-
|
|
12145
|
-
try {
|
|
12146
|
-
cell = host.querySelector(`[data-row-id=${rowId}] [data-column=${key}]`);
|
|
12147
|
-
}
|
|
12148
|
-
catch {
|
|
12149
|
-
return null;
|
|
12150
|
-
}
|
|
12473
|
+
const rowId = cssString(String(this.getRowId()(row)));
|
|
12474
|
+
const key = cssString(String(column.accessorKey));
|
|
12475
|
+
const cell = host.querySelector(`[data-row-id=${rowId}] [data-column=${key}]`);
|
|
12151
12476
|
if (!cell)
|
|
12152
12477
|
return null;
|
|
12153
12478
|
return (cell.textContent ?? "").trim();
|
|
@@ -12238,7 +12563,7 @@ class DataTableComponent {
|
|
|
12238
12563
|
const row = this.processedData()[focused.rowIndex];
|
|
12239
12564
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === focused.columnKey);
|
|
12240
12565
|
if (row && col) {
|
|
12241
|
-
await navigator.clipboard.writeText(this.getCellStringValue(row, col));
|
|
12566
|
+
await navigator.clipboard.writeText(toClipboardText([[this.getCellStringValue(row, col)]]));
|
|
12242
12567
|
}
|
|
12243
12568
|
}
|
|
12244
12569
|
/**
|
|
@@ -12252,7 +12577,7 @@ class DataTableComponent {
|
|
|
12252
12577
|
col.accessorKey !== "_expander" &&
|
|
12253
12578
|
col.accessorKey !== "_actions");
|
|
12254
12579
|
const values = columns.map((col) => this.getCellStringValue(row, col));
|
|
12255
|
-
await navigator.clipboard.writeText(values
|
|
12580
|
+
await navigator.clipboard.writeText(toClipboardText([values]));
|
|
12256
12581
|
}
|
|
12257
12582
|
/**
|
|
12258
12583
|
* Copies the selected rows as TSV with a header line. Draws from the filtered
|
|
@@ -12269,9 +12594,9 @@ class DataTableComponent {
|
|
|
12269
12594
|
const rows = this.sortedData().filter((row) => selectedIds[this.getRowId()(row)]);
|
|
12270
12595
|
if (rows.length === 0)
|
|
12271
12596
|
return;
|
|
12272
|
-
const
|
|
12273
|
-
const
|
|
12274
|
-
await navigator.clipboard.writeText([
|
|
12597
|
+
const header = columns.map((col) => col.header);
|
|
12598
|
+
const body = rows.map((row) => columns.map((col) => this.getCellStringValue(row, col)));
|
|
12599
|
+
await navigator.clipboard.writeText(toClipboardText([header, ...body]));
|
|
12275
12600
|
}
|
|
12276
12601
|
/**
|
|
12277
12602
|
* Copies the whole table as TSV via {@link getExportData} — header row plus
|
|
@@ -12280,9 +12605,7 @@ class DataTableComponent {
|
|
|
12280
12605
|
async copyAllToClipboard() {
|
|
12281
12606
|
if (!this.enableCopy())
|
|
12282
12607
|
return;
|
|
12283
|
-
|
|
12284
|
-
const text = data.map((row) => row.join("\t")).join("\n");
|
|
12285
|
-
await navigator.clipboard.writeText(text);
|
|
12608
|
+
await navigator.clipboard.writeText(toClipboardText(this.getExportData()));
|
|
12286
12609
|
}
|
|
12287
12610
|
/**
|
|
12288
12611
|
* Clears the focused cell when a click lands on the table but outside any
|
|
@@ -12481,7 +12804,7 @@ class DataTableComponent {
|
|
|
12481
12804
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === focused.columnKey);
|
|
12482
12805
|
if (row && col) {
|
|
12483
12806
|
event.preventDefault();
|
|
12484
|
-
navigator.clipboard.writeText(this.getCellStringValue(row, col));
|
|
12807
|
+
navigator.clipboard.writeText(toClipboardText([[this.getCellStringValue(row, col)]]));
|
|
12485
12808
|
return true;
|
|
12486
12809
|
}
|
|
12487
12810
|
}
|
|
@@ -12507,18 +12830,17 @@ class DataTableComponent {
|
|
|
12507
12830
|
const rangeCols = colKeys.slice(range.minCol, range.maxCol + 1);
|
|
12508
12831
|
const data = this.processedData();
|
|
12509
12832
|
const columns = this.enhancedColumns();
|
|
12510
|
-
const
|
|
12833
|
+
const grid = [];
|
|
12511
12834
|
for (let r = range.minRow; r <= range.maxRow; r++) {
|
|
12512
12835
|
const row = data[r];
|
|
12513
12836
|
if (!row)
|
|
12514
12837
|
continue;
|
|
12515
|
-
|
|
12838
|
+
grid.push(rangeCols.map((key) => {
|
|
12516
12839
|
const col = columns.find((c) => String(c.accessorKey) === key);
|
|
12517
12840
|
return col ? this.getCellStringValue(row, col) : "";
|
|
12518
|
-
});
|
|
12519
|
-
lines.push(values.join("\t"));
|
|
12841
|
+
}));
|
|
12520
12842
|
}
|
|
12521
|
-
await navigator.clipboard.writeText(
|
|
12843
|
+
await navigator.clipboard.writeText(toClipboardText(grid));
|
|
12522
12844
|
}
|
|
12523
12845
|
computeNextCell(key, shiftKey, ctrlKey, rowIndex, colIndex, colKeys, totalRows) {
|
|
12524
12846
|
const nextRow = rowIndex;
|
|
@@ -12562,7 +12884,7 @@ class DataTableComponent {
|
|
|
12562
12884
|
}
|
|
12563
12885
|
getPageSize() {
|
|
12564
12886
|
const container = this.scrollContainerRef()?.nativeElement;
|
|
12565
|
-
return container ? Math.floor(container.clientHeight / this.
|
|
12887
|
+
return container ? Math.floor(container.clientHeight / this.effectiveRowHeight()) : 10;
|
|
12566
12888
|
}
|
|
12567
12889
|
handleNavigationKeydown(event) {
|
|
12568
12890
|
if (this.editingCell())
|
|
@@ -13890,8 +14212,7 @@ class DataTableComponent {
|
|
|
13890
14212
|
return;
|
|
13891
14213
|
const delta = clientX - this.resizeStartX;
|
|
13892
14214
|
const effectiveDelta = this._isRtlResize ? -delta : delta;
|
|
13893
|
-
const
|
|
13894
|
-
const newWidth = Math.max(minWidth, this.resizeStartWidth + effectiveDelta);
|
|
14215
|
+
const newWidth = Math.max(columnMinWidthPx(resizing), this.resizeStartWidth + effectiveDelta);
|
|
13895
14216
|
const key = String(resizing.accessorKey);
|
|
13896
14217
|
this.columnWidths.update((widths) => ({
|
|
13897
14218
|
...widths,
|
|
@@ -13963,7 +14284,7 @@ class DataTableComponent {
|
|
|
13963
14284
|
if (content <= 0)
|
|
13964
14285
|
return;
|
|
13965
14286
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === columnKey);
|
|
13966
|
-
const minWidth =
|
|
14287
|
+
const minWidth = col ? columnMinWidthPx(col) : 0;
|
|
13967
14288
|
const newWidth = `${Math.max(minWidth, Math.ceil(content) + 24)}px`;
|
|
13968
14289
|
const oldWidth = this.columnWidths()[columnKey] ?? col?._width ?? "auto";
|
|
13969
14290
|
this.columnWidths.update((widths) => ({ ...widths, [columnKey]: newWidth }));
|
|
@@ -14015,7 +14336,7 @@ class DataTableComponent {
|
|
|
14015
14336
|
return;
|
|
14016
14337
|
}
|
|
14017
14338
|
}
|
|
14018
|
-
container.scrollTop = index * this.
|
|
14339
|
+
container.scrollTop = index * this.effectiveRowHeight();
|
|
14019
14340
|
}
|
|
14020
14341
|
/**
|
|
14021
14342
|
* Scrolls a column to the leading edge of the viewport by summing the widths
|
|
@@ -14048,11 +14369,11 @@ class DataTableComponent {
|
|
|
14048
14369
|
this.scrollToColumn(columnKey);
|
|
14049
14370
|
}
|
|
14050
14371
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14051
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableComponent, isStandalone: true, selector: "ui-data-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, showColumnVisibilityToggle: { classPropertyName: "showColumnVisibilityToggle", publicName: "showColumnVisibilityToggle", isSignal: true, isRequired: false, transformFunction: null }, showPagination: { classPropertyName: "showPagination", publicName: "showPagination", isSignal: true, isRequired: false, transformFunction: null }, showRowBorders: { classPropertyName: "showRowBorders", publicName: "showRowBorders", isSignal: true, isRequired: false, transformFunction: null }, showColumnBorders: { classPropertyName: "showColumnBorders", publicName: "showColumnBorders", isSignal: true, isRequired: false, transformFunction: null }, localSorting: { classPropertyName: "localSorting", publicName: "localSorting", isSignal: true, isRequired: false, transformFunction: null }, localPagination: { classPropertyName: "localPagination", publicName: "localPagination", isSignal: true, isRequired: false, transformFunction: null }, localFiltering: { classPropertyName: "localFiltering", publicName: "localFiltering", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", isSignal: true, isRequired: false, transformFunction: null }, loadingVisibility: { classPropertyName: "loadingVisibility", publicName: "loadingVisibility", isSignal: true, isRequired: false, transformFunction: null }, loaderTemplate: { classPropertyName: "loaderTemplate", publicName: "loaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, loaderComponent: { classPropertyName: "loaderComponent", publicName: "loaderComponent", isSignal: true, isRequired: false, transformFunction: null }, loaderComponentInputs: { classPropertyName: "loaderComponentInputs", publicName: "loaderComponentInputs", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFn: { classPropertyName: "globalFilterFn", publicName: "globalFilterFn", isSignal: true, isRequired: false, transformFunction: null }, enableMultiSort: { classPropertyName: "enableMultiSort", publicName: "enableMultiSort", isSignal: true, isRequired: false, transformFunction: null }, maxMultiSortColumns: { classPropertyName: "maxMultiSortColumns", publicName: "maxMultiSortColumns", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, enableRowSelection: { classPropertyName: "enableRowSelection", publicName: "enableRowSelection", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, getRowId: { classPropertyName: "getRowId", publicName: "getRowId", isSignal: true, isRequired: false, transformFunction: null }, enableCopy: { classPropertyName: "enableCopy", publicName: "enableCopy", isSignal: true, isRequired: false, transformFunction: null }, isRowDisabled: { classPropertyName: "isRowDisabled", publicName: "isRowDisabled", isSignal: true, isRequired: false, transformFunction: null }, disabledRowIds: { classPropertyName: "disabledRowIds", publicName: "disabledRowIds", isSignal: true, isRequired: false, transformFunction: null }, enableRowExpansion: { classPropertyName: "enableRowExpansion", publicName: "enableRowExpansion", isSignal: true, isRequired: false, transformFunction: null }, expandedRows: { classPropertyName: "expandedRows", publicName: "expandedRows", isSignal: true, isRequired: false, transformFunction: null }, rowDetailTemplate: { classPropertyName: "rowDetailTemplate", publicName: "rowDetailTemplate", isSignal: true, isRequired: false, transformFunction: null }, rowDetailComponent: { classPropertyName: "rowDetailComponent", publicName: "rowDetailComponent", isSignal: true, isRequired: false, transformFunction: null }, rowDetailComponentInputs: { classPropertyName: "rowDetailComponentInputs", publicName: "rowDetailComponentInputs", isSignal: true, isRequired: false, transformFunction: null }, enableSubRows: { classPropertyName: "enableSubRows", publicName: "enableSubRows", isSignal: true, isRequired: false, transformFunction: null }, getChildren: { classPropertyName: "getChildren", publicName: "getChildren", isSignal: true, isRequired: false, transformFunction: null }, setChildren: { classPropertyName: "setChildren", publicName: "setChildren", isSignal: true, isRequired: false, transformFunction: null }, subRowDefaultExpanded: { classPropertyName: "subRowDefaultExpanded", publicName: "subRowDefaultExpanded", isSignal: true, isRequired: false, transformFunction: null }, subRowSelectionMode: { classPropertyName: "subRowSelectionMode", publicName: "subRowSelectionMode", isSignal: true, isRequired: false, transformFunction: null }, subRowFilterMode: { classPropertyName: "subRowFilterMode", publicName: "subRowFilterMode", isSignal: true, isRequired: false, transformFunction: null }, enableSubRowSorting: { classPropertyName: "enableSubRowSorting", publicName: "enableSubRowSorting", isSignal: true, isRequired: false, transformFunction: null }, subRowIndentSize: { classPropertyName: "subRowIndentSize", publicName: "subRowIndentSize", isSignal: true, isRequired: false, transformFunction: null }, subRowsPaginated: { classPropertyName: "subRowsPaginated", publicName: "subRowsPaginated", isSignal: true, isRequired: false, transformFunction: null }, subRowExpandedRows: { classPropertyName: "subRowExpandedRows", publicName: "subRowExpandedRows", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroups: { classPropertyName: "collapsedGroups", publicName: "collapsedGroups", isSignal: true, isRequired: false, transformFunction: null }, groupAggregates: { classPropertyName: "groupAggregates", publicName: "groupAggregates", isSignal: true, isRequired: false, transformFunction: null }, enableColumnResize: { classPropertyName: "enableColumnResize", publicName: "enableColumnResize", isSignal: true, isRequired: false, transformFunction: null }, enableColumnReorder: { classPropertyName: "enableColumnReorder", publicName: "enableColumnReorder", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, enableFloatingFilters: { classPropertyName: "enableFloatingFilters", publicName: "enableFloatingFilters", isSignal: true, isRequired: false, transformFunction: null }, enableRowDrag: { classPropertyName: "enableRowDrag", publicName: "enableRowDrag", isSignal: true, isRequired: false, transformFunction: null }, localReorder: { classPropertyName: "localReorder", publicName: "localReorder", isSignal: true, isRequired: false, transformFunction: null }, rowDragMode: { classPropertyName: "rowDragMode", publicName: "rowDragMode", isSignal: true, isRequired: false, transformFunction: null }, rowDragAllowDrop: { classPropertyName: "rowDragAllowDrop", publicName: "rowDragAllowDrop", isSignal: true, isRequired: false, transformFunction: null }, enableCellFlash: { classPropertyName: "enableCellFlash", publicName: "enableCellFlash", isSignal: true, isRequired: false, transformFunction: null }, cellFlashDuration: { classPropertyName: "cellFlashDuration", publicName: "cellFlashDuration", isSignal: true, isRequired: false, transformFunction: null }, enableCellRangeSelection: { classPropertyName: "enableCellRangeSelection", publicName: "enableCellRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, enableRangeActions: { classPropertyName: "enableRangeActions", publicName: "enableRangeActions", isSignal: true, isRequired: false, transformFunction: null }, enableFillHandle: { classPropertyName: "enableFillHandle", publicName: "enableFillHandle", isSignal: true, isRequired: false, transformFunction: null }, enableClipboardPaste: { classPropertyName: "enableClipboardPaste", publicName: "enableClipboardPaste", isSignal: true, isRequired: false, transformFunction: null }, enableEditHistory: { classPropertyName: "enableEditHistory", publicName: "enableEditHistory", isSignal: true, isRequired: false, transformFunction: null }, emptyStateComponent: { classPropertyName: "emptyStateComponent", publicName: "emptyStateComponent", isSignal: true, isRequired: false, transformFunction: null }, emptyStateComponentInputs: { classPropertyName: "emptyStateComponentInputs", publicName: "emptyStateComponentInputs", isSignal: true, isRequired: false, transformFunction: null }, fullWidthRow: { classPropertyName: "fullWidthRow", publicName: "fullWidthRow", isSignal: true, isRequired: false, transformFunction: null }, fullWidthRowTemplate: { classPropertyName: "fullWidthRowTemplate", publicName: "fullWidthRowTemplate", isSignal: true, isRequired: false, transformFunction: null }, fullWidthRowComponent: { classPropertyName: "fullWidthRowComponent", publicName: "fullWidthRowComponent", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, filterDebounce: { classPropertyName: "filterDebounce", publicName: "filterDebounce", isSignal: true, isRequired: false, transformFunction: null }, enableVirtualScroll: { classPropertyName: "enableVirtualScroll", publicName: "enableVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualRowHeight: { classPropertyName: "virtualRowHeight", publicName: "virtualRowHeight", isSignal: true, isRequired: false, transformFunction: null }, virtualRowBuffer: { classPropertyName: "virtualRowBuffer", publicName: "virtualRowBuffer", isSignal: true, isRequired: false, transformFunction: null }, virtualColumnBuffer: { classPropertyName: "virtualColumnBuffer", publicName: "virtualColumnBuffer", isSignal: true, isRequired: false, transformFunction: null }, virtualVariableRowHeight: { classPropertyName: "virtualVariableRowHeight", publicName: "virtualVariableRowHeight", isSignal: true, isRequired: false, transformFunction: null }, virtualRecycleComponents: { classPropertyName: "virtualRecycleComponents", publicName: "virtualRecycleComponents", isSignal: true, isRequired: false, transformFunction: null }, virtualAutoThreshold: { classPropertyName: "virtualAutoThreshold", publicName: "virtualAutoThreshold", isSignal: true, isRequired: false, transformFunction: null }, virtualAutoColumnWidth: { classPropertyName: "virtualAutoColumnWidth", publicName: "virtualAutoColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, globalFilter: { classPropertyName: "globalFilter", publicName: "globalFilter", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, aiProvider: { classPropertyName: "aiProvider", publicName: "aiProvider", isSignal: true, isRequired: false, transformFunction: null }, enableNlFilter: { classPropertyName: "enableNlFilter", publicName: "enableNlFilter", isSignal: true, isRequired: false, transformFunction: null }, advancedFilter: { classPropertyName: "advancedFilter", publicName: "advancedFilter", isSignal: true, isRequired: false, transformFunction: null }, enableAdvancedFilter: { classPropertyName: "enableAdvancedFilter", publicName: "enableAdvancedFilter", isSignal: true, isRequired: false, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null }, multiSortState: { classPropertyName: "multiSortState", publicName: "multiSortState", isSignal: true, isRequired: false, transformFunction: null }, paginationState: { classPropertyName: "paginationState", publicName: "paginationState", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, columnWidths: { classPropertyName: "columnWidths", publicName: "columnWidths", isSignal: true, isRequired: false, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, columnOrder: { classPropertyName: "columnOrder", publicName: "columnOrder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", sortChange: "sortChange", multiSortChange: "multiSortChange", pageChange: "pageChange", filterChange: "filterChange", query: "query", cellEdit: "cellEdit", editError: "editError", rowSelection: "rowSelectionChange", expandedRows: "expandedRowsChange", subRowExpandedRows: "subRowExpandedRowsChange", collapsedGroups: "collapsedGroupsChange", rowReorder: "rowReorder", rangeChartOpen: "rangeChartOpen", fillSeries: "fillSeries", cellsPaste: "cellsPaste", editUndo: "editUndo", editRedo: "editRedo", columnResize: "columnResize", globalFilter: "globalFilterChange", columnFilters: "columnFiltersChange", nlFilter: "nlFilter", aiFillComplete: "aiFillComplete", advancedFilter: "advancedFilterChange", sortState: "sortStateChange", multiSortState: "multiSortStateChange", paginationState: "paginationStateChange", columnWidths: "columnWidthsChange", columnVisibility: "columnVisibilityChange", columnOrder: "columnOrderChange" }, host: { properties: { "attr.dir": "dir()" }, classAttribute: "block h-full w-full" }, providers: [
|
|
14372
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableComponent, isStandalone: true, selector: "ui-data-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, showColumnVisibilityToggle: { classPropertyName: "showColumnVisibilityToggle", publicName: "showColumnVisibilityToggle", isSignal: true, isRequired: false, transformFunction: null }, showPagination: { classPropertyName: "showPagination", publicName: "showPagination", isSignal: true, isRequired: false, transformFunction: null }, showRowBorders: { classPropertyName: "showRowBorders", publicName: "showRowBorders", isSignal: true, isRequired: false, transformFunction: null }, showColumnBorders: { classPropertyName: "showColumnBorders", publicName: "showColumnBorders", isSignal: true, isRequired: false, transformFunction: null }, localSorting: { classPropertyName: "localSorting", publicName: "localSorting", isSignal: true, isRequired: false, transformFunction: null }, localPagination: { classPropertyName: "localPagination", publicName: "localPagination", isSignal: true, isRequired: false, transformFunction: null }, localFiltering: { classPropertyName: "localFiltering", publicName: "localFiltering", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", isSignal: true, isRequired: false, transformFunction: null }, loadingVisibility: { classPropertyName: "loadingVisibility", publicName: "loadingVisibility", isSignal: true, isRequired: false, transformFunction: null }, loaderTemplate: { classPropertyName: "loaderTemplate", publicName: "loaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, loaderComponent: { classPropertyName: "loaderComponent", publicName: "loaderComponent", isSignal: true, isRequired: false, transformFunction: null }, loaderComponentInputs: { classPropertyName: "loaderComponentInputs", publicName: "loaderComponentInputs", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFn: { classPropertyName: "globalFilterFn", publicName: "globalFilterFn", isSignal: true, isRequired: false, transformFunction: null }, enableMultiSort: { classPropertyName: "enableMultiSort", publicName: "enableMultiSort", isSignal: true, isRequired: false, transformFunction: null }, maxMultiSortColumns: { classPropertyName: "maxMultiSortColumns", publicName: "maxMultiSortColumns", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, enableRowSelection: { classPropertyName: "enableRowSelection", publicName: "enableRowSelection", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, getRowId: { classPropertyName: "getRowId", publicName: "getRowId", isSignal: true, isRequired: false, transformFunction: null }, enableCopy: { classPropertyName: "enableCopy", publicName: "enableCopy", isSignal: true, isRequired: false, transformFunction: null }, isRowDisabled: { classPropertyName: "isRowDisabled", publicName: "isRowDisabled", isSignal: true, isRequired: false, transformFunction: null }, disabledRowIds: { classPropertyName: "disabledRowIds", publicName: "disabledRowIds", isSignal: true, isRequired: false, transformFunction: null }, enableRowExpansion: { classPropertyName: "enableRowExpansion", publicName: "enableRowExpansion", isSignal: true, isRequired: false, transformFunction: null }, expandedRows: { classPropertyName: "expandedRows", publicName: "expandedRows", isSignal: true, isRequired: false, transformFunction: null }, rowDetailTemplate: { classPropertyName: "rowDetailTemplate", publicName: "rowDetailTemplate", isSignal: true, isRequired: false, transformFunction: null }, rowDetailComponent: { classPropertyName: "rowDetailComponent", publicName: "rowDetailComponent", isSignal: true, isRequired: false, transformFunction: null }, rowDetailComponentInputs: { classPropertyName: "rowDetailComponentInputs", publicName: "rowDetailComponentInputs", isSignal: true, isRequired: false, transformFunction: null }, enableSubRows: { classPropertyName: "enableSubRows", publicName: "enableSubRows", isSignal: true, isRequired: false, transformFunction: null }, getChildren: { classPropertyName: "getChildren", publicName: "getChildren", isSignal: true, isRequired: false, transformFunction: null }, setChildren: { classPropertyName: "setChildren", publicName: "setChildren", isSignal: true, isRequired: false, transformFunction: null }, subRowDefaultExpanded: { classPropertyName: "subRowDefaultExpanded", publicName: "subRowDefaultExpanded", isSignal: true, isRequired: false, transformFunction: null }, subRowSelectionMode: { classPropertyName: "subRowSelectionMode", publicName: "subRowSelectionMode", isSignal: true, isRequired: false, transformFunction: null }, subRowFilterMode: { classPropertyName: "subRowFilterMode", publicName: "subRowFilterMode", isSignal: true, isRequired: false, transformFunction: null }, enableSubRowSorting: { classPropertyName: "enableSubRowSorting", publicName: "enableSubRowSorting", isSignal: true, isRequired: false, transformFunction: null }, subRowIndentSize: { classPropertyName: "subRowIndentSize", publicName: "subRowIndentSize", isSignal: true, isRequired: false, transformFunction: null }, subRowsPaginated: { classPropertyName: "subRowsPaginated", publicName: "subRowsPaginated", isSignal: true, isRequired: false, transformFunction: null }, subRowExpandedRows: { classPropertyName: "subRowExpandedRows", publicName: "subRowExpandedRows", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroups: { classPropertyName: "collapsedGroups", publicName: "collapsedGroups", isSignal: true, isRequired: false, transformFunction: null }, groupAggregates: { classPropertyName: "groupAggregates", publicName: "groupAggregates", isSignal: true, isRequired: false, transformFunction: null }, enableColumnResize: { classPropertyName: "enableColumnResize", publicName: "enableColumnResize", isSignal: true, isRequired: false, transformFunction: null }, enableColumnReorder: { classPropertyName: "enableColumnReorder", publicName: "enableColumnReorder", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, enableFloatingFilters: { classPropertyName: "enableFloatingFilters", publicName: "enableFloatingFilters", isSignal: true, isRequired: false, transformFunction: null }, enableRowDrag: { classPropertyName: "enableRowDrag", publicName: "enableRowDrag", isSignal: true, isRequired: false, transformFunction: null }, localReorder: { classPropertyName: "localReorder", publicName: "localReorder", isSignal: true, isRequired: false, transformFunction: null }, rowDragMode: { classPropertyName: "rowDragMode", publicName: "rowDragMode", isSignal: true, isRequired: false, transformFunction: null }, rowDragAllowDrop: { classPropertyName: "rowDragAllowDrop", publicName: "rowDragAllowDrop", isSignal: true, isRequired: false, transformFunction: null }, enableCellFlash: { classPropertyName: "enableCellFlash", publicName: "enableCellFlash", isSignal: true, isRequired: false, transformFunction: null }, cellFlashDuration: { classPropertyName: "cellFlashDuration", publicName: "cellFlashDuration", isSignal: true, isRequired: false, transformFunction: null }, enableCellRangeSelection: { classPropertyName: "enableCellRangeSelection", publicName: "enableCellRangeSelection", isSignal: true, isRequired: false, transformFunction: null }, enableRangeActions: { classPropertyName: "enableRangeActions", publicName: "enableRangeActions", isSignal: true, isRequired: false, transformFunction: null }, enableFillHandle: { classPropertyName: "enableFillHandle", publicName: "enableFillHandle", isSignal: true, isRequired: false, transformFunction: null }, enableClipboardPaste: { classPropertyName: "enableClipboardPaste", publicName: "enableClipboardPaste", isSignal: true, isRequired: false, transformFunction: null }, enableEditHistory: { classPropertyName: "enableEditHistory", publicName: "enableEditHistory", isSignal: true, isRequired: false, transformFunction: null }, emptyStateComponent: { classPropertyName: "emptyStateComponent", publicName: "emptyStateComponent", isSignal: true, isRequired: false, transformFunction: null }, emptyStateComponentInputs: { classPropertyName: "emptyStateComponentInputs", publicName: "emptyStateComponentInputs", isSignal: true, isRequired: false, transformFunction: null }, fullWidthRow: { classPropertyName: "fullWidthRow", publicName: "fullWidthRow", isSignal: true, isRequired: false, transformFunction: null }, fullWidthRowTemplate: { classPropertyName: "fullWidthRowTemplate", publicName: "fullWidthRowTemplate", isSignal: true, isRequired: false, transformFunction: null }, fullWidthRowComponent: { classPropertyName: "fullWidthRowComponent", publicName: "fullWidthRowComponent", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, filterDebounce: { classPropertyName: "filterDebounce", publicName: "filterDebounce", isSignal: true, isRequired: false, transformFunction: null }, enableVirtualScroll: { classPropertyName: "enableVirtualScroll", publicName: "enableVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualRowHeight: { classPropertyName: "virtualRowHeight", publicName: "virtualRowHeight", isSignal: true, isRequired: false, transformFunction: null }, virtualRowBuffer: { classPropertyName: "virtualRowBuffer", publicName: "virtualRowBuffer", isSignal: true, isRequired: false, transformFunction: null }, virtualColumnBuffer: { classPropertyName: "virtualColumnBuffer", publicName: "virtualColumnBuffer", isSignal: true, isRequired: false, transformFunction: null }, virtualVariableRowHeight: { classPropertyName: "virtualVariableRowHeight", publicName: "virtualVariableRowHeight", isSignal: true, isRequired: false, transformFunction: null }, virtualRecycleComponents: { classPropertyName: "virtualRecycleComponents", publicName: "virtualRecycleComponents", isSignal: true, isRequired: false, transformFunction: null }, virtualAutoThreshold: { classPropertyName: "virtualAutoThreshold", publicName: "virtualAutoThreshold", isSignal: true, isRequired: false, transformFunction: null }, virtualAutoColumnWidth: { classPropertyName: "virtualAutoColumnWidth", publicName: "virtualAutoColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, globalFilter: { classPropertyName: "globalFilter", publicName: "globalFilter", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, aiProvider: { classPropertyName: "aiProvider", publicName: "aiProvider", isSignal: true, isRequired: false, transformFunction: null }, enableNlFilter: { classPropertyName: "enableNlFilter", publicName: "enableNlFilter", isSignal: true, isRequired: false, transformFunction: null }, advancedFilter: { classPropertyName: "advancedFilter", publicName: "advancedFilter", isSignal: true, isRequired: false, transformFunction: null }, enableAdvancedFilter: { classPropertyName: "enableAdvancedFilter", publicName: "enableAdvancedFilter", isSignal: true, isRequired: false, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null }, multiSortState: { classPropertyName: "multiSortState", publicName: "multiSortState", isSignal: true, isRequired: false, transformFunction: null }, paginationState: { classPropertyName: "paginationState", publicName: "paginationState", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, columnWidths: { classPropertyName: "columnWidths", publicName: "columnWidths", isSignal: true, isRequired: false, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, columnOrder: { classPropertyName: "columnOrder", publicName: "columnOrder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", sortChange: "sortChange", multiSortChange: "multiSortChange", pageChange: "pageChange", filterChange: "filterChange", query: "query", cellEdit: "cellEdit", editError: "editError", rowSelection: "rowSelectionChange", expandedRows: "expandedRowsChange", subRowExpandedRows: "subRowExpandedRowsChange", collapsedGroups: "collapsedGroupsChange", rowReorder: "rowReorder", rangeChartOpen: "rangeChartOpen", fillSeries: "fillSeries", cellsPaste: "cellsPaste", editUndo: "editUndo", editRedo: "editRedo", columnResize: "columnResize", globalFilter: "globalFilterChange", columnFilters: "columnFiltersChange", nlFilter: "nlFilter", aiFillComplete: "aiFillComplete", advancedFilter: "advancedFilterChange", sortState: "sortStateChange", multiSortState: "multiSortStateChange", paginationState: "paginationStateChange", columnWidths: "columnWidthsChange", columnVisibility: "columnVisibilityChange", columnOrder: "columnOrderChange" }, host: { properties: { "attr.dir": "dir()", "attr.data-ui-theme": "theme()" }, classAttribute: "block h-full w-full" }, providers: [
|
|
14052
14373
|
ComponentPoolService,
|
|
14053
14374
|
provideComponentLocale(() => DataTableComponent),
|
|
14054
14375
|
{ provide: DataTableAddonHost, useExisting: forwardRef(() => DataTableComponent) },
|
|
14055
|
-
], viewQueries: [{ propertyName: "scrollContainerRef", first: true, predicate: ["scrollContainer"], descendants: true, isSignal: true }, { propertyName: "virtualRowElements", predicate: ["virtualRow"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: " <!-- Reusable: cell content rendering (component/template/cell/default) -->\n <ng-template\n #cellContentTpl\n let-col\n let-row=\"row\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.component) {\n <div\n [uiComponentOutlet]=\"col.component\"\n [inputs]=\"\n treeRow\n ? getSubRowComponentInputs(col, treeRow)\n : col.componentInputs\n ? col.componentInputs(row)\n : EMPTY_RECORD\n \"\n [outputs]=\"\n col.componentOutputs ? col.componentOutputs(row) : EMPTY_RECORD\n \"\n [recycle]=\"recycle\"\n ></div>\n } @else if (col.template) {\n @if (treeRow) {\n <ng-container\n *ngTemplateOutlet=\"\n col.template;\n context: {\n $implicit: row,\n depth: treeRow.depth,\n parentRow: treeRow.parentRow,\n parentId: treeRow.parentId,\n path: treeRow.path,\n isLeaf: treeRow.isLeaf,\n childCount: treeRow.childCount,\n }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"col.template; context: { $implicit: row }\"\n ></ng-container>\n }\n } @else {\n @let fmt = getCellFormatting(col, row);\n @if (fmt) {\n <span\n data-slot=\"cell-formatted\"\n class=\"relative flex w-full items-center gap-1.5 {{ fmt.class }}\"\n [style]=\"fmt.style\"\n >\n @if (fmt.dataBar) {\n @if (fmt.dataBar.track; as track) {\n <span\n data-slot=\"cell-data-bar-track\"\n class=\"pointer-events-none absolute inset-x-0 inset-y-0.5 rounded-sm\"\n [style.background-color]=\"track\"\n ></span>\n }\n <span\n data-slot=\"cell-data-bar\"\n class=\"pointer-events-none absolute inset-y-0.5 start-0 rounded-sm\"\n [style.width]=\"fmt.dataBar.width\"\n [style.background-color]=\"fmt.dataBar.color\"\n ></span>\n }\n @if (fmt.icon) {\n @if (fmt.icon.name) {\n <ui-icon\n data-slot=\"cell-icon\"\n [name]=\"fmt.icon.name\"\n size=\"xs\"\n class=\"relative shrink-0 {{ fmt.icon.class }}\"\n />\n } @else if (fmt.icon.glyph) {\n <span data-slot=\"cell-icon\" class=\"relative shrink-0 {{ fmt.icon.class }}\">{{ fmt.icon.glyph }}</span>\n }\n }\n <span class=\"relative min-w-0 truncate\">\n @if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n </span>\n </span>\n } @else if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n }\n </ng-template>\n\n <!-- Reusable: full cell rendering (special columns + content) -->\n <ng-template\n #cellTpl\n let-col\n let-row=\"row\"\n let-rowIndex=\"rowIndex\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isRowSelected(row)\"\n [disabled]=\"isDisabled(row)\"\n [indeterminate]=\"\n treeRow ? isSubRowSelectionIndeterminate(row) : false\n \"\n (checkedChange)=\"treeRow ? toggleRowWithCascade(row) : toggleRow(row)\"\n ariaLabel=\"Select row\"\n />\n } @else if (col._isTreeExpanderHost && treeRow) {\n <div\n class=\"flex items-center gap-1 min-w-0\"\n [style.padding-inline-start.px]=\"treeRow.depth * subRowIndentSize()\"\n >\n @if (!treeRow.isLeaf) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n treeRow.isExpanded ? 'Collapse sub-rows' : 'Expand sub-rows'\n \"\n (click)=\"toggleSubRowExpanded(treeRow.row, $event)\"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"treeRow.isExpanded && !isRtl()\"\n [class.-rotate-90]=\"treeRow.isExpanded && isRtl()\"\n />\n </button>\n } @else {\n <span class=\"inline-block h-6 w-6 shrink-0\"></span>\n }\n <span class=\"truncate\">\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n </span>\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"isRowExpanded(row) ? 'Collapse row' : 'Expand row'\"\n [attr.aria-expanded]=\"isRowExpanded(row)\"\n (click)=\"toggleRowExpanded(row, $event)\"\n >\n @if (isRowExpanded(row)) {\n <ui-icon name=\"chevron-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevron-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n @if (!isDisabled(row)) {\n @for (slot of cellActionSlots(); track slot.id) {\n <ui-button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-8 w-8\"\n [ariaLabel]=\"slot.ariaLabel ?? 'Row actions'\"\n (click)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n (keydown.enter)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n (keydown.space)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"sm\" />\n </ui-button>\n }\n }\n } @else if (\n col.editable && isEditing(rowIndex, String(col.accessorKey))\n ) {\n <ng-container\n *ngTemplateOutlet=\"\n cellEditTpl;\n context: { $implicit: col, row: row, rowIndex: rowIndex }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n }\n </ng-template>\n\n <!-- Reusable: cell edit mode -->\n <ng-template #cellEditTpl let-col let-row=\"row\" let-rowIndex=\"rowIndex\">\n @let editErr = editErrorFor(rowIndex, col);\n @if (col.editComponent) {\n <div\n [uiComponentOutlet]=\"col.editComponent\"\n [inputs]=\"{ value: editValue(), row: row, column: col }\"\n [outputs]=\"{\n valueChange: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\"\n ></div>\n } @else if (col.editTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.editTemplate;\n context: {\n $implicit: editValue(),\n row: row,\n column: col,\n setValue: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\n \"\n ></ng-container>\n } @else if (col.editType === \"checkbox\") {\n <ui-checkbox\n [checked]=\"!!editValue()\"\n [ariaInvalid]=\"editErr ? true : undefined\"\n [ariaDescribedby]=\"editErr ? cellEditErrorId : undefined\"\n (checkedChange)=\"onEditValueChange($event); commitEdit()\"\n />\n } @else if (col.editType === \"date\") {\n <ui-date-picker\n class=\"w-full\"\n [date]=\"editDateValue()\"\n (dateChange)=\"onEditDateChange($event)\"\n />\n } @else if (col.editType === \"select\" && col.editOptions) {\n <select\n data-edit-input\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (change)=\"onEditValueChange($any($event.target).value); commitEdit()\"\n (keydown)=\"onEditKeydown($event)\"\n >\n @for (opt of col.editOptions; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n } @else {\n <input\n data-edit-input\n [type]=\"col.editType === 'number' ? 'number' : 'text'\"\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1 select-text\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (input)=\"onEditValueChange($any($event.target).value)\"\n (keydown)=\"onEditKeydown($event)\"\n (blur)=\"editingCell() ? commitEdit() : null\"\n />\n }\n @if (editErr) {\n <p\n [id]=\"cellEditErrorId\"\n class=\"mt-0.5 px-1 text-xs text-destructive\"\n role=\"alert\"\n data-slot=\"cell-edit-error\"\n >\n {{ editErr }}\n </p>\n }\n </ng-template>\n\n <!-- Reusable: row detail/expansion panel -->\n <ng-template #rowDetailTpl let-row>\n @if (rowDetailTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTemplate();\n context: { $implicit: row, row: row }\n \"\n ></ng-container>\n } @else if (rowDetailComponent()) {\n <div\n [uiComponentOutlet]=\"rowDetailComponent()!\"\n [inputs]=\"getRowDetailComponentInputs(row)\"\n ></div>\n } @else {\n <pre class=\"text-xs text-muted-foreground whitespace-pre-wrap\">{{\n row | json\n }}</pre>\n }\n </ng-template>\n\n <!-- Reusable: empty state -->\n <ng-template #emptyStateTpl>\n <ui-table-row class=\"hover:bg-transparent justify-center w-full\">\n <ui-table-cell\n class=\"h-48 sm:h-96 text-center w-full p-0 border-none justify-center\"\n >\n @if (emptyStateComponent()) {\n <ng-container\n [uiComponentOutlet]=\"emptyStateComponent()!\"\n [inputs]=\"emptyStateComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex h-full flex-col items-center justify-center py-10 text-center text-muted-foreground w-full\"\n >\n <ui-icon name=\"circle-off\" size=\"xl\" class=\"mb-4 opacity-20\" />\n <p>{{ noResultsLabel() }}</p>\n </div>\n }\n </ui-table-cell>\n </ui-table-row>\n </ng-template>\n\n @if (skeleton()) {\n <div class=\"flex flex-col w-full space-y-3\" data-slot=\"data-table-skeleton\">\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n @for (row of skeletonRowsArray(); track $index) {\n <ui-skeleton class=\"h-12 w-full rounded-md\" />\n }\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n </div>\n } @else {\n <!-- `relative`: the sr-only announcer and the sr-only cell labels below are\n position:absolute. Without a positioned ancestor their containing block\n is <html>, so they escape this table's scroll container entirely and\n stretch the document to their static position \u2014 which on a page with a\n virtual-scroll table adds a second, page-length scrollbar. -->\n <div class=\"relative flex flex-col w-full h-full space-y-4\">\n <output\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-slot=\"data-table-announcer\"\n >\n {{ srAnnouncement() }}\n </output>\n @if (showToolbar()) {\n <div class=\"flex flex-wrap items-center justify-between gap-2 flex-none\">\n <div class=\"flex flex-1 flex-wrap items-center gap-2\">\n <ui-input\n [placeholder]=\"filterPlaceholder()\"\n [ngModel]=\"globalFilter()\"\n (ngModelChange)=\"onFilterChange($event)\"\n class=\"h-8 w-full sm:w-[150px] lg:w-[250px]\"\n />\n @if (hasAi() && enableNlFilter()) {\n <div class=\"flex items-center gap-1\" data-slot=\"table-nl-filter\">\n <span aria-hidden=\"true\" class=\"text-sm\">\u2728</span>\n <ui-input\n [placeholder]=\"nlFilterPlaceholder()\"\n [ngModel]=\"aiFilterQuery()\"\n (ngModelChange)=\"aiFilterQuery.set($event)\"\n [disabled]=\"aiFilterRunning()\"\n (keydown.enter)=\"runAiFilter()\"\n class=\"h-8 w-full sm:w-[200px]\"\n />\n </div>\n }\n @if (enableAdvancedFilter()) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n data-slot=\"advanced-filter-trigger\"\n class=\"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-icon name=\"filter\" size=\"xs\" />\n <span class=\"hidden sm:inline\">{{ filterBuilderLabels().filterButton }}</span>\n @if (advancedFilterCount() > 0) {\n <span class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground\">{{ advancedFilterCount() }}</span>\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-[min(420px,calc(100vw-2rem))] p-2\">\n <div class=\"space-y-2\">\n <ui-data-table-filter-builder\n [group]=\"advancedFilterGroup()\"\n [columns]=\"filterBuilderColumns()\"\n [labels]=\"filterBuilderLabels()\"\n (groupChange)=\"onAdvancedFilterChange($event)\"\n />\n @if (advancedFilterCount() > 0) {\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-destructive\"\n (click)=\"clearAdvancedFilter()\"\n >{{ filterBuilderLabels().clearFilters }}</button>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n @if (showColumnVisibilityToggle() && hideableColumns().length > 0) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"toggleColumnsLabel()\"\n >\n {{ columnsLabel() }}\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-56 p-2\">\n <div class=\"space-y-1\">\n @for (col of hideableColumns(); track col.accessorKey) {\n <div\n class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-checkbox\n [checked]=\"isColumnVisible(col.accessorKey)\"\n (checkedChange)=\"\n setColumnVisibility(col.accessorKey, $event)\n \"\n [ariaLabel]=\"toggleColumnAriaLabel(col.header)\"\n />\n <span>{{ col.header }}</span>\n </div>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n\n <div\n #scrollContainer\n class=\"rounded-md border relative flex-1 min-h-0 overflow-auto w-full\"\n [class.contain-strict]=\"isVirtualScrollActive()\"\n [class.will-change-scroll]=\"isVirtualScrollActive()\"\n [class.select-none]=\"enableCellRangeSelection()\"\n (keydown)=\"onTableKeydown($event)\"\n (click)=\"onTableClick()\"\n (mousedown)=\"onTableMouseDown($event)\"\n (scroll)=\"isVirtualScrollActive() ? onVirtualScroll($event) : null\"\n (dragover)=\"onContainerDragOver($event)\"\n (drop)=\"onRowDrop($event)\"\n tabindex=\"0\"\n >\n @if (isLoaderVisible()) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n @if (loaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n loaderTemplate();\n context: {\n $implicit: loadingTrigger(),\n trigger: loadingTrigger(),\n }\n \"\n ></ng-container>\n } @else if (loaderComponent()) {\n <ng-container\n [uiComponentOutlet]=\"loaderComponent()!\"\n [inputs]=\"resolvedLoaderComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>Loading...</span>\n </div>\n }\n </div>\n }\n @if (busyLabel(); as label) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>{{ label }}</span>\n </div>\n </div>\n }\n <ui-table [role]=\"enableSubRows() ? 'treegrid' : 'grid'\">\n <ui-table-header class=\"bg-background\">\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [class]=\"getHeaderClass(col)\"\n class=\"group/head\"\n [class.cursor-grab]=\"isColumnDraggable(col)\"\n [class.cursor-grabbing]=\"isDraggingColumn(col)\"\n [class.opacity-70]=\"isDraggingColumn(col)\"\n [class.relative]=\"isDropTargetColumn(col)\"\n [attr.data-column-id]=\"String(col.accessorKey)\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.draggable]=\"isColumnDraggable(col) ? 'true' : null\"\n [style]=\"getHeaderCellStyle(col)\"\n (dragstart)=\"onColumnDragStart($event, col)\"\n (dragover)=\"onColumnDragOver($event, col)\"\n (drop)=\"onColumnDrop($event, col)\"\n (dragend)=\"onColumnDragEnd()\"\n >\n @if (isDropTargetColumn(col)) {\n <div\n class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/70 bg-primary/10\"\n ></div>\n }\n <div class=\"flex items-center w-full h-full\">\n <div class=\"flex-1 min-w-0\">\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isIndeterminate()\"\n (checkedChange)=\"toggleAll()\"\n ariaLabel=\"Select all\"\n />\n } @else if (col._isTreeExpanderHost) {\n <div class=\"flex items-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n isAllSubRowsExpanded()\n ? 'Collapse all sub-rows'\n : 'Expand all sub-rows'\n \"\n (click)=\"\n isAllSubRowsExpanded()\n ? collapseAllSubRows()\n : expandAllSubRows(-1)\n \"\n >\n @if (isAllSubRowsExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n @if (col.enableSorting !== false) {\n <ui-data-table-column-header\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n } @else {\n <span>{{ col.header }}</span>\n }\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n isAllExpanded()\n ? 'Collapse all rows'\n : 'Expand all rows'\n \"\n (click)=\"toggleAllExpanded()\"\n >\n @if (isAllExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n <span class=\"sr-only\">Actions</span>\n } @else if (col.headerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.headerTemplate;\n context: { $implicit: col }\n \"\n ></ng-container>\n } @else if (col.enableSorting !== false) {\n <div class=\"flex items-center gap-2\">\n <ui-data-table-column-header\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover [closeOnScroll]=\"true\">\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n } @else {\n <div class=\"flex items-center gap-2\">\n <span>{{ col.header }}</span>\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n </div>\n @if (\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @for (slot of headerActionSlots(); track slot.id) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md opacity-0 group-hover/head:opacity-100 touch-visible hover:bg-accent hover:text-accent-foreground transition-opacity\"\n [attr.aria-label]=\"'Column menu for ' + col.header\"\n (click)=\"slot.onClick($event, col)\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"xs\" />\n </button>\n }\n }\n </div>\n @if (\n enableColumnResize() &&\n col.accessorKey !== \"_selection\"\n ) {\n <div\n class=\"group/resize absolute top-0 w-4 h-full cursor-col-resize touch-none z-40 select-none\"\n [class.right-0]=\"!isRtl()\"\n [class.translate-x-1/2]=\"!isRtl()\"\n [class.left-0]=\"isRtl()\"\n [class.-translate-x-1/2]=\"isRtl()\"\n (mousedown)=\"onResizeStart($event, col)\"\n (touchstart)=\"onResizeTouchStart($event, col)\"\n (dblclick)=\"onResizeDoubleClick($event, col)\"\n role=\"separator\"\n [attr.aria-label]=\"'Resize ' + col.header + ' column (double-click to auto-fit)'\"\n >\n <div\n [class]=\"resizeLineClass(col)\"\n aria-hidden=\"true\"\n ></div>\n </div>\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none\"\n [class]=\"getHeaderClass({ _width: 'auto' })\"\n ></ui-table-head>\n }\n </ui-table-row>\n @if (enableFloatingFilters() && hasAnyFloatingFilter()) {\n <ui-table-row class=\"border-0\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [role]=\"hasFloatingFilter(col) ? 'columnheader' : 'presentation'\"\n [style]=\"getHeaderCellStyle(col)\"\n class=\"sticky top-[var(--header-height,41px)] z-20 bg-muted/50 py-1 px-1 overflow-hidden\"\n >\n @if (\n col.floatingFilter !== false &&\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @if (col.floatingFilterComponent) {\n <div\n [uiComponentOutlet]=\"col.floatingFilterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n } @else if (col.floatingFilterTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.floatingFilterTemplate;\n context: {\n $implicit: col,\n value: columnFilters()[String(col.accessorKey)],\n change: getFloatingFilterChange(col),\n }\n \"\n ></ng-container>\n } @else if (col.enableFiltering) {\n <ui-input\n class=\"h-7 text-xs\"\n [placeholder]=\"col.header\"\n [ngModel]=\"\n columnFilters()[String(col.accessorKey)] || ''\n \"\n (ngModelChange)=\"\n onColumnFilterChange(col.accessorKey, $event)\n \"\n />\n }\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none sticky top-[var(--header-height,41px)] z-20 bg-muted/50\"\n ></ui-table-head>\n }\n </ui-table-row>\n }\n </ui-table-header>\n <ui-table-body>\n @if (isVirtualScrollActive()) {\n <div\n [style.height.px]=\"virtualPaddingTop()\"\n class=\"flex-shrink-0\"\n ></div>\n @if (enableSubRows()) {\n @for (\n treeRow of virtualVisibleTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"\n isRowSelected(treeRow.row) ? 'selected' : null\n \"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"\n treeRow.isLeaf ? null : treeRow.isExpanded\n \"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : virtualRowHeight()\n \"\n class=\"border-0\"\n >\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n }\n } @else {\n @for (\n row of virtualVisibleRows();\n track getRowId()(row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, getVirtualRowIndex(i))\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : virtualRowHeight()\n \"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(getVirtualRowIndex(i))) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n @if (virtualTotalRows() === 0) {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <div\n [style.height.px]=\"virtualPaddingBottom()\"\n class=\"flex-shrink-0\"\n ></div>\n } @else if (enableSubRows()) {\n @if (processedTreeRows().length > 0) {\n @for (\n treeRow of processedTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(treeRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [class.opacity-30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-2]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-inset]=\"isRowBeingDragged(treeRow.row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(treeRow.row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"treeRow.isLeaf ? null : treeRow.isExpanded\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(treeRow.row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, treeRow.row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(i)) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i, treeRow.depth)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"onCellClick(i, col, $event)\"\n (keydown.enter)=\"onCellClick(i, col, $event)\"\n (keydown.space)=\"onCellClick(i, col, $event)\"\n (dblclick)=\"onCellDblClick(i, col, $event)\"\n (touchend)=\"onCellTouchEnd($event, i, col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: i,\n treeRow: treeRow,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(treeRow.row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: treeRow.row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (groupingActive()) {\n @if (pagedGroupedDisplayRows().length > 0) {\n @for (\n displayRow of pagedGroupedDisplayRows();\n track groupTrackBy(displayRow);\n let i = $index\n ) {\n @if (isGroupRow(displayRow)) {\n <ui-table-row\n class=\"border-0 bg-muted/40 cursor-pointer select-none\"\n data-slot=\"table-group-row\"\n [attr.data-group-key]=\"displayRow.groupKey\"\n [attr.aria-expanded]=\"!displayRow.collapsed\"\n (click)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.enter)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.space)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n >\n <ui-table-cell\n class=\"flex-1 border-b font-medium\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <div class=\"flex flex-wrap items-center gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n displayRow.collapsed ? 'Expand group' : 'Collapse group'\n \"\n (click)=\"\n $event.stopPropagation();\n toggleGroupCollapsed(displayRow.groupKey)\n \"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"!displayRow.collapsed && !isRtl()\"\n [class.-rotate-90]=\"!displayRow.collapsed && isRtl()\"\n />\n </button>\n <span class=\"truncate\">{{ groupRowValueLabel(displayRow) }}</span>\n <span class=\"text-xs text-muted-foreground\">({{ displayRow.count }})</span>\n @if (groupAggregates()) {\n @for (entry of displayRow.aggregates | keyvalue: keepGroupAggregateOrder; track entry.key) {\n <span class=\"text-xs text-muted-foreground\">\n {{ groupAggregateLabel(entry.key) }}: {{ entry.value }}\n </span>\n }\n }\n </div>\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(displayRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(displayRow.row) || null\"\n [class.opacity-50]=\"isDisabled(displayRow.row)\"\n [attr.data-row-id]=\"getRowId()(displayRow.row)\"\n data-slot=\"table-group-data-row\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: displayRow.row,\n rowIndex: i,\n treeRow: null,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (processedData().length > 0) {\n @for (\n row of (dragPreviewData() ?? processedData());\n track getRowId()(row);\n let i = $index\n ) {\n @if (isFullWidthRow(row)) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n class=\"border-0\"\n >\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n @if (fullWidthRowTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n fullWidthRowTemplate();\n context: { $implicit: row, index: i }\n \"\n ></ng-container>\n } @else if (fullWidthRowComponent()) {\n <div\n [uiComponentOutlet]=\"fullWidthRowComponent()!\"\n [inputs]=\"{ row: row, index: i }\"\n ></div>\n }\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [class.ring-2]=\"isRowBeingDragged(row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(row)\"\n [class.ring-inset]=\"isRowBeingDragged(row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell [class]=\"getCellClass(col, i)\" [attr.data-column]=\"String(col.accessorKey)\" [style]=\"getCellStyle(col)\" (click)=\"onCellClick(i, col, $event)\" (keydown.enter)=\"onCellClick(i, col, $event)\" (keydown.space)=\"onCellClick(i, col, $event)\" (dblclick)=\"onCellDblClick(i, col, $event)\" (touchend)=\"onCellTouchEnd($event, i, col)\">\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { $implicit: col, row: row, rowIndex: i, treeRow: null, recycle: false }\"></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell class=\"flex-1 pointer-events-none\" [class]=\"getCellClass({ _width: 'auto' })\"></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell class=\"flex-1 border-b\" style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\">\n <ng-container *ngTemplateOutlet=\"rowDetailTpl; context: { $implicit: row }\"></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <!-- A spacer that stretches the body to fill the container. It holds\n no data and cannot be reached, so it is hidden from assistive\n tech rather than counted as a row of the grid. -->\n <ui-table-row class=\"h-full\" aria-hidden=\"true\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col)\"\n [style]=\"getCellStyle(col)\"\n class=\"bg-background border-0 p-0\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </ui-table-body>\n @if (hasFooter()) {\n <div\n class=\"sticky bottom-0 z-20 bg-background border-t\"\n data-slot=\"table-footer\"\n >\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [style]=\"getCellStyle(col)\"\n class=\"whitespace-nowrap overflow-hidden text-ellipsis text-sm font-medium text-muted-foreground\"\n >\n @if (col.footerComponent) {\n <div\n [uiComponentOutlet]=\"col.footerComponent\"\n [inputs]=\"{\n column: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\"\n ></div>\n } @else if (col.footerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.footerTemplate;\n context: {\n $implicit: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\n \"\n ></ng-container>\n } @else {\n {{ footerValues().get(String(col.accessorKey)) || \"\" }}\n }\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </div>\n }\n </ui-table>\n\n @if (enableFillHandle() && fillHandlePosition(); as pos) {\n <span\n data-slot=\"fill-handle\"\n class=\"absolute z-20 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 cursor-crosshair rounded-[2px] border border-background bg-primary\"\n style=\"touch-action: none;\"\n aria-hidden=\"true\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n (mousedown)=\"onFillHandleStart($event)\"\n (touchstart)=\"onFillHandleStart($event)\"\n ></span>\n }\n\n @if (enableRangeActions() && rangeSelectionStats(); as stats) {\n <div\n data-slot=\"range-actions\"\n class=\"sticky bottom-0 z-20 flex max-w-[calc(100vw-2rem)] flex-wrap items-center gap-x-4 gap-y-1 border-t bg-background/95 px-3 py-1.5 text-xs backdrop-blur-sm\"\n >\n <span class=\"text-muted-foreground\">{{ rangeLabels().count }}: <span class=\"text-foreground font-medium\">{{ stats.count }}</span></span>\n @if (stats.numericCount > 0) {\n <span class=\"text-muted-foreground\">{{ rangeLabels().sum }}: <span class=\"text-foreground font-medium\">{{ stats.sum }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().avg }}: <span class=\"text-foreground font-medium\">{{ stats.avg }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().min }}: <span class=\"text-foreground font-medium\">{{ stats.min }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().max }}: <span class=\"text-foreground font-medium\">{{ stats.max }}</span></span>\n @if (rangeChartPayload()) {\n <ui-button\n size=\"sm\"\n variant=\"outline\"\n class=\"ms-auto h-6 px-2\"\n [ariaLabel]=\"rangeLabels().chart\"\n (click)=\"openRangeChart()\"\n >\n <ui-icon name=\"bar-chart-3\" size=\"xs\" class=\"me-1\" />{{ rangeLabels().chart }}\n </ui-button>\n }\n }\n </div>\n }\n </div>\n\n @if (showPagination()) {\n <ui-data-table-pagination\n class=\"flex-none\"\n [total]=\"activeTotalItems()\"\n [state]=\"paginationState()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSizeSelector]=\"showPageSizeSelector()\"\n [rowsPerPageLabel]=\"rowsPerPageLabel()\"\n [pageLabel]=\"pageLabel()\"\n [ofLabel]=\"ofLabel()\"\n (paginationChange)=\"onPaginationChange($event)\"\n />\n }\n </div>\n } <!-- end @else skeleton -->\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TableComponent, selector: "ui-table", inputs: ["class", "role"] }, { kind: "component", type: TableHeaderComponent, selector: "ui-table-header", inputs: ["class"] }, { kind: "component", type: TableBodyComponent, selector: "ui-table-body", inputs: ["class", "skeleton", "skeletonRows"] }, { kind: "component", type: TableRowComponent, selector: "ui-table-row", inputs: ["class", "selected"] }, { kind: "component", type: TableHeadComponent, selector: "ui-table-head", inputs: ["class", "role"] }, { kind: "component", type: TableCellComponent, selector: "ui-table-cell", inputs: ["class"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["type", "placeholder", "disabled", "class", "elementId", "name", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "variant", "loading", "skeleton", "autofocus", "clearable", "floating", "label", "labelClass", "inputMode", "lang", "prefix", "suffix", "value"], outputs: ["valueChange"] }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["disabled", "class", "skeleton", "elementId", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaInvalid", "checked", "indeterminate", "label"], outputs: ["checkedChange"] }, { kind: "component", type: DatePickerComponent, selector: "ui-date-picker", inputs: ["class", "placeholder", "disabled", "showTime", "locale", "date"], outputs: ["dateChange"] }, { kind: "component", type: PopoverComponent, selector: "ui-popover", inputs: ["open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger" }, { kind: "component", type: PopoverContentComponent, selector: "ui-popover-content", inputs: ["class", "align", "side", "sideOffset", "avoidCollisions", "restoreFocus", "strategy"] }, { kind: "component", type: DataTableColumnHeaderComponent, selector: "ui-data-table-column-header", inputs: ["title", "column", "direction", "enableSorting", "class", "sortIndex"], outputs: ["sort", "sortMeta"] }, { kind: "component", type: DataTablePaginationComponent, selector: "ui-data-table-pagination", inputs: ["total", "state", "pageSizeOptions", "showPageSizeSelector", "rowsPerPageLabel", "pageLabel", "ofLabel"], outputs: ["paginationChange"] }, { kind: "component", type: DataTableFilterBuilderComponent, selector: "ui-data-table-filter-builder", inputs: ["group", "columns", "labels"], outputs: ["groupChange"] }, { kind: "directive", type: UiComponentOutletDirective, selector: "[uiComponentOutlet]", inputs: ["uiComponentOutlet", "inputs", "outputs", "recycle"], outputs: ["initialized"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }, { kind: "pipe", type: i1$1.JsonPipe, name: "json" }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
14376
|
+
], viewQueries: [{ propertyName: "scrollContainerRef", first: true, predicate: ["scrollContainer"], descendants: true, isSignal: true }, { propertyName: "virtualRowElements", predicate: ["virtualRow"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: " <!-- Reusable: cell content rendering (component/template/cell/default) -->\n <ng-template\n #cellContentTpl\n let-col\n let-row=\"row\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.component) {\n <div\n [uiComponentOutlet]=\"col.component\"\n [inputs]=\"\n treeRow\n ? getSubRowComponentInputs(col, treeRow)\n : col.componentInputs\n ? col.componentInputs(row)\n : EMPTY_RECORD\n \"\n [outputs]=\"\n col.componentOutputs ? col.componentOutputs(row) : EMPTY_RECORD\n \"\n [recycle]=\"recycle\"\n ></div>\n } @else if (col.template) {\n @if (treeRow) {\n <ng-container\n *ngTemplateOutlet=\"\n col.template;\n context: {\n $implicit: row,\n depth: treeRow.depth,\n parentRow: treeRow.parentRow,\n parentId: treeRow.parentId,\n path: treeRow.path,\n isLeaf: treeRow.isLeaf,\n childCount: treeRow.childCount,\n }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"col.template; context: { $implicit: row }\"\n ></ng-container>\n }\n } @else {\n @let fmt = getCellFormatting(col, row);\n @if (fmt) {\n <span\n data-slot=\"cell-formatted\"\n class=\"relative flex w-full items-center gap-1.5 {{ fmt.class }}\"\n [style]=\"fmt.style\"\n >\n @if (fmt.dataBar) {\n @if (fmt.dataBar.track; as track) {\n <span\n data-slot=\"cell-data-bar-track\"\n class=\"pointer-events-none absolute inset-x-0 inset-y-0.5 rounded-sm\"\n [style.background-color]=\"track\"\n ></span>\n }\n <span\n data-slot=\"cell-data-bar\"\n class=\"pointer-events-none absolute inset-y-0.5 start-0 rounded-sm\"\n [style.width]=\"fmt.dataBar.width\"\n [style.background-color]=\"fmt.dataBar.color\"\n ></span>\n }\n @if (fmt.icon) {\n @if (fmt.icon.name) {\n <ui-icon\n data-slot=\"cell-icon\"\n [name]=\"fmt.icon.name\"\n size=\"xs\"\n class=\"relative shrink-0 {{ fmt.icon.class }}\"\n />\n } @else if (fmt.icon.glyph) {\n <span data-slot=\"cell-icon\" class=\"relative shrink-0 {{ fmt.icon.class }}\">{{ fmt.icon.glyph }}</span>\n }\n }\n <span class=\"relative min-w-0 truncate\">\n @if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n </span>\n </span>\n } @else if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n }\n </ng-template>\n\n <!-- Reusable: full cell rendering (special columns + content) -->\n <ng-template\n #cellTpl\n let-col\n let-row=\"row\"\n let-rowIndex=\"rowIndex\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isRowSelected(row)\"\n [disabled]=\"isDisabled(row)\"\n [indeterminate]=\"\n treeRow ? isSubRowSelectionIndeterminate(row) : false\n \"\n (checkedChange)=\"treeRow ? toggleRowWithCascade(row) : toggleRow(row)\"\n ariaLabel=\"Select row\"\n />\n } @else if (col._isTreeExpanderHost && treeRow) {\n <div\n class=\"flex items-center gap-1 min-w-0\"\n [style.padding-inline-start.px]=\"treeRow.depth * subRowIndentSize()\"\n >\n @if (!treeRow.isLeaf) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n treeRow.isExpanded ? 'Collapse sub-rows' : 'Expand sub-rows'\n \"\n (click)=\"toggleSubRowExpanded(treeRow.row, $event)\"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"treeRow.isExpanded && !isRtl()\"\n [class.-rotate-90]=\"treeRow.isExpanded && isRtl()\"\n />\n </button>\n } @else {\n <span class=\"inline-block h-6 w-6 shrink-0\"></span>\n }\n <span class=\"truncate\">\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n </span>\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"isRowExpanded(row) ? 'Collapse row' : 'Expand row'\"\n [attr.aria-expanded]=\"isRowExpanded(row)\"\n (click)=\"toggleRowExpanded(row, $event)\"\n >\n @if (isRowExpanded(row)) {\n <ui-icon name=\"chevron-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevron-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n @if (!isDisabled(row)) {\n @for (slot of cellActionSlots(); track slot.id) {\n <ui-button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-8 w-8 pointer-coarse:size-11\"\n [ariaLabel]=\"slot.ariaLabel ?? 'Row actions'\"\n (click)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"sm\" />\n </ui-button>\n }\n }\n } @else if (\n col.editable && isEditing(rowIndex, String(col.accessorKey))\n ) {\n <ng-container\n *ngTemplateOutlet=\"\n cellEditTpl;\n context: { $implicit: col, row: row, rowIndex: rowIndex }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n }\n </ng-template>\n\n <!-- Reusable: cell edit mode -->\n <ng-template #cellEditTpl let-col let-row=\"row\" let-rowIndex=\"rowIndex\">\n @let editErr = editErrorFor(rowIndex, col);\n @if (col.editComponent) {\n <div\n [uiComponentOutlet]=\"col.editComponent\"\n [inputs]=\"{ value: editValue(), row: row, column: col }\"\n [outputs]=\"{\n valueChange: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\"\n ></div>\n } @else if (col.editTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.editTemplate;\n context: {\n $implicit: editValue(),\n row: row,\n column: col,\n setValue: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\n \"\n ></ng-container>\n } @else if (col.editType === \"checkbox\") {\n <ui-checkbox\n [checked]=\"!!editValue()\"\n [ariaInvalid]=\"editErr ? true : undefined\"\n [ariaDescribedby]=\"editErr ? cellEditErrorId : undefined\"\n (checkedChange)=\"onEditValueChange($event); commitEdit()\"\n />\n } @else if (col.editType === \"date\") {\n <ui-date-picker\n class=\"w-full\"\n [date]=\"editDateValue()\"\n (dateChange)=\"onEditDateChange($event)\"\n />\n } @else if (col.editType === \"select\" && col.editOptions) {\n <select\n data-edit-input\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (change)=\"onEditValueChange($any($event.target).value); commitEdit()\"\n (keydown)=\"onEditKeydown($event)\"\n >\n @for (opt of col.editOptions; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n } @else {\n <input\n data-edit-input\n [type]=\"col.editType === 'number' ? 'number' : 'text'\"\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1 select-text\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (input)=\"onEditValueChange($any($event.target).value)\"\n (keydown)=\"onEditKeydown($event)\"\n (blur)=\"editingCell() ? commitEdit() : null\"\n />\n }\n @if (editErr) {\n <p\n [id]=\"cellEditErrorId\"\n class=\"mt-0.5 px-1 text-xs text-destructive\"\n role=\"alert\"\n data-slot=\"cell-edit-error\"\n >\n {{ editErr }}\n </p>\n }\n </ng-template>\n\n <!-- Reusable: row detail/expansion panel -->\n <ng-template #rowDetailTpl let-row>\n @if (rowDetailTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTemplate();\n context: { $implicit: row, row: row }\n \"\n ></ng-container>\n } @else if (rowDetailComponent()) {\n <div\n [uiComponentOutlet]=\"rowDetailComponent()!\"\n [inputs]=\"getRowDetailComponentInputs(row)\"\n ></div>\n } @else {\n <pre class=\"text-xs text-muted-foreground whitespace-pre-wrap\">{{\n row | json\n }}</pre>\n }\n </ng-template>\n\n <!-- Reusable: empty state -->\n <ng-template #emptyStateTpl>\n <ui-table-row class=\"hover:bg-transparent justify-center w-full\">\n <ui-table-cell\n class=\"h-48 sm:h-96 text-center w-full p-0 border-none justify-center\"\n >\n @if (emptyStateComponent()) {\n <ng-container\n [uiComponentOutlet]=\"emptyStateComponent()!\"\n [inputs]=\"emptyStateComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex h-full flex-col items-center justify-center py-10 text-center text-muted-foreground w-full\"\n >\n <ui-icon name=\"circle-off\" size=\"xl\" class=\"mb-4 opacity-20\" />\n <p>{{ noResultsLabel() }}</p>\n </div>\n }\n </ui-table-cell>\n </ui-table-row>\n </ng-template>\n\n @if (skeleton()) {\n <div class=\"flex flex-col w-full space-y-3\" data-slot=\"data-table-skeleton\">\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n @for (row of skeletonRowsArray(); track $index) {\n <ui-skeleton class=\"h-12 w-full rounded-md\" />\n }\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n </div>\n } @else {\n <!-- `relative`: the sr-only announcer and the sr-only cell labels below are\n position:absolute. Without a positioned ancestor their containing block\n is <html>, so they escape this table's scroll container entirely and\n stretch the document to their static position \u2014 which on a page with a\n virtual-scroll table adds a second, page-length scrollbar. -->\n <div class=\"relative flex flex-col w-full h-full space-y-4\">\n <output\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-slot=\"data-table-announcer\"\n >\n {{ srAnnouncement() }}\n </output>\n @if (showToolbar()) {\n <div class=\"flex flex-wrap items-center justify-between gap-2 flex-none\">\n <div class=\"flex flex-1 flex-wrap items-center gap-2\">\n <ui-input\n [placeholder]=\"filterPlaceholder()\"\n [ngModel]=\"globalFilter()\"\n (ngModelChange)=\"onFilterChange($event)\"\n class=\"h-8 w-full sm:w-[150px] lg:w-[250px]\"\n />\n @if (hasAi() && enableNlFilter()) {\n <div class=\"flex items-center gap-1\" data-slot=\"table-nl-filter\">\n <span aria-hidden=\"true\" class=\"text-sm\">\u2728</span>\n <ui-input\n [placeholder]=\"nlFilterPlaceholder()\"\n [ngModel]=\"aiFilterQuery()\"\n (ngModelChange)=\"aiFilterQuery.set($event)\"\n [disabled]=\"aiFilterRunning()\"\n (keydown.enter)=\"runAiFilter()\"\n class=\"h-8 w-full sm:w-[200px]\"\n />\n </div>\n }\n @if (enableAdvancedFilter()) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n data-slot=\"advanced-filter-trigger\"\n class=\"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 pointer-coarse:h-11 pointer-coarse:min-w-11 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-icon name=\"filter\" size=\"xs\" />\n <span class=\"hidden sm:inline\">{{ filterBuilderLabels().filterButton }}</span>\n @if (advancedFilterCount() > 0) {\n <span class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground\">{{ advancedFilterCount() }}</span>\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-[min(420px,calc(100vw-2rem))] p-2\">\n <div class=\"space-y-2\">\n <ui-data-table-filter-builder\n [group]=\"advancedFilterGroup()\"\n [columns]=\"filterBuilderColumns()\"\n [labels]=\"filterBuilderLabels()\"\n (groupChange)=\"onAdvancedFilterChange($event)\"\n />\n @if (advancedFilterCount() > 0) {\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-destructive\"\n (click)=\"clearAdvancedFilter()\"\n >{{ filterBuilderLabels().clearFilters }}</button>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n @if (showColumnVisibilityToggle() && hideableColumns().length > 0) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"toggleColumnsLabel()\"\n >\n {{ columnsLabel() }}\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-56 p-2\">\n <div class=\"space-y-1\">\n @for (col of hideableColumns(); track col.accessorKey) {\n <div\n class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-checkbox\n [checked]=\"isColumnVisible(col.accessorKey)\"\n (checkedChange)=\"\n setColumnVisibility(col.accessorKey, $event)\n \"\n [ariaLabel]=\"toggleColumnAriaLabel(col.header)\"\n />\n <span>{{ col.header }}</span>\n </div>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n\n <div\n #scrollContainer\n class=\"rounded-md border relative flex-1 min-h-0 overflow-auto w-full\"\n [class.contain-strict]=\"isVirtualScrollActive()\"\n [class.will-change-scroll]=\"isVirtualScrollActive()\"\n [class.select-none]=\"enableCellRangeSelection()\"\n (keydown)=\"onTableKeydown($event)\"\n (click)=\"onTableClick()\"\n (mousedown)=\"onTableMouseDown($event)\"\n (scroll)=\"isVirtualScrollActive() ? onVirtualScroll($event) : null\"\n (dragover)=\"onContainerDragOver($event)\"\n (drop)=\"onRowDrop($event)\"\n tabindex=\"0\"\n >\n @if (isLoaderVisible()) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n @if (loaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n loaderTemplate();\n context: {\n $implicit: loadingTrigger(),\n trigger: loadingTrigger(),\n }\n \"\n ></ng-container>\n } @else if (loaderComponent()) {\n <ng-container\n [uiComponentOutlet]=\"loaderComponent()!\"\n [inputs]=\"resolvedLoaderComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>Loading...</span>\n </div>\n }\n </div>\n }\n @if (busyLabel(); as label) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>{{ label }}</span>\n </div>\n </div>\n }\n <!-- #scrollContainer scrolls both axes. If ui-table kept its own\n overflow-x box (which forces overflow-y to auto too), the sticky\n header would stick inside it and scroll away, and its horizontal\n scrollbar would sit under the last row. -->\n <ui-table\n class=\"overflow-visible\"\n [role]=\"enableSubRows() ? 'treegrid' : 'grid'\"\n >\n <ui-table-header class=\"bg-background\">\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [class]=\"getHeaderClass(col)\"\n class=\"group/head\"\n [class.cursor-grab]=\"isColumnDraggable(col)\"\n [class.cursor-grabbing]=\"isDraggingColumn(col)\"\n [class.opacity-70]=\"isDraggingColumn(col)\"\n [class.relative]=\"isDropTargetColumn(col)\"\n [attr.data-column-id]=\"String(col.accessorKey)\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.draggable]=\"isColumnDraggable(col) ? 'true' : null\"\n [style]=\"getHeaderCellStyle(col)\"\n (dragstart)=\"onColumnDragStart($event, col)\"\n (dragover)=\"onColumnDragOver($event, col)\"\n (drop)=\"onColumnDrop($event, col)\"\n (dragend)=\"onColumnDragEnd()\"\n >\n @if (isDropTargetColumn(col)) {\n <div\n class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/70 bg-primary/10\"\n ></div>\n }\n <div class=\"flex items-center w-full h-full\">\n <div class=\"flex-1 min-w-0\">\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isIndeterminate()\"\n (checkedChange)=\"toggleAll()\"\n ariaLabel=\"Select all\"\n />\n } @else if (col._isTreeExpanderHost) {\n <!-- gap-2 offsets the sort button's -ms-2, which would otherwise pull it over the expand-all button -->\n <div class=\"flex items-center gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n isAllSubRowsExpanded()\n ? 'Collapse all sub-rows'\n : 'Expand all sub-rows'\n \"\n (click)=\"\n isAllSubRowsExpanded()\n ? collapseAllSubRows()\n : expandAllSubRows(-1)\n \"\n >\n @if (isAllSubRowsExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n @if (col.enableSorting !== false) {\n <ui-data-table-column-header\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n } @else {\n <span>{{ col.header }}</span>\n }\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n isAllExpanded()\n ? 'Collapse all rows'\n : 'Expand all rows'\n \"\n (click)=\"toggleAllExpanded()\"\n >\n @if (isAllExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n <span class=\"sr-only\">Actions</span>\n } @else if (col.headerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.headerTemplate;\n context: { $implicit: col }\n \"\n ></ng-container>\n } @else if (col.enableSorting !== false) {\n <div class=\"flex items-center gap-2\">\n <!-- min-w-0: a narrow column truncates its title instead of sliding it under the filter and menu buttons -->\n <ui-data-table-column-header\n class=\"min-w-0\"\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover [closeOnScroll]=\"true\">\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8 pointer-coarse:size-11\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n } @else {\n <div class=\"flex items-center gap-2\">\n <span>{{ col.header }}</span>\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8 pointer-coarse:size-11\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n </div>\n @if (\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @for (slot of headerActionSlots(); track slot.id) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md opacity-0 group-hover/head:opacity-100 touch-visible pointer-coarse:size-11 hover:bg-accent hover:text-accent-foreground transition-opacity\"\n [attr.aria-label]=\"'Column menu for ' + col.header\"\n (click)=\"slot.onClick($event, col)\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"xs\" />\n </button>\n }\n }\n </div>\n @if (\n enableColumnResize() &&\n col.accessorKey !== \"_selection\"\n ) {\n <div\n class=\"group/resize absolute top-0 w-4 h-full cursor-col-resize touch-none z-40 select-none\"\n [class.right-0]=\"!isRtl()\"\n [class.translate-x-1/2]=\"!isRtl()\"\n [class.left-0]=\"isRtl()\"\n [class.-translate-x-1/2]=\"isRtl()\"\n (mousedown)=\"onResizeStart($event, col)\"\n (touchstart)=\"onResizeTouchStart($event, col)\"\n (dblclick)=\"onResizeDoubleClick($event, col)\"\n role=\"separator\"\n [attr.aria-label]=\"'Resize ' + col.header + ' column (double-click to auto-fit)'\"\n >\n <div\n [class]=\"resizeLineClass(col)\"\n aria-hidden=\"true\"\n ></div>\n </div>\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none\"\n [class]=\"getHeaderClass({ _width: 'auto' })\"\n ></ui-table-head>\n }\n </ui-table-row>\n @if (enableFloatingFilters() && hasAnyFloatingFilter()) {\n <ui-table-row class=\"border-0\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [role]=\"hasFloatingFilter(col) ? 'columnheader' : 'presentation'\"\n [style]=\"getHeaderCellStyle(col)\"\n class=\"sticky top-[var(--header-height,41px)] z-20 bg-muted/50 py-1 px-1 overflow-hidden pointer-coarse:h-auto\"\n >\n @if (\n col.floatingFilter !== false &&\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @if (col.floatingFilterComponent) {\n <div\n [uiComponentOutlet]=\"col.floatingFilterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n } @else if (col.floatingFilterTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.floatingFilterTemplate;\n context: {\n $implicit: col,\n value: columnFilters()[String(col.accessorKey)],\n change: getFloatingFilterChange(col),\n }\n \"\n ></ng-container>\n } @else if (col.enableFiltering) {\n <ui-input\n class=\"h-7 text-xs\"\n [placeholder]=\"col.header\"\n [ngModel]=\"\n columnFilters()[String(col.accessorKey)] || ''\n \"\n (ngModelChange)=\"\n onColumnFilterChange(col.accessorKey, $event)\n \"\n />\n }\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none sticky top-[var(--header-height,41px)] z-20 bg-muted/50\"\n ></ui-table-head>\n }\n </ui-table-row>\n }\n </ui-table-header>\n <ui-table-body>\n @if (isVirtualScrollActive()) {\n <div\n [style.height.px]=\"virtualPaddingTop()\"\n class=\"flex-shrink-0\"\n ></div>\n @if (enableSubRows()) {\n @for (\n treeRow of virtualVisibleTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"\n isRowSelected(treeRow.row) ? 'selected' : null\n \"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"\n treeRow.isLeaf ? null : treeRow.isExpanded\n \"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : effectiveRowHeight()\n \"\n class=\"border-0\"\n >\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n }\n } @else {\n @for (\n row of virtualVisibleRows();\n track getRowId()(row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, getVirtualRowIndex(i))\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : effectiveRowHeight()\n \"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(getVirtualRowIndex(i))) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n @if (virtualTotalRows() === 0) {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <div\n [style.height.px]=\"virtualPaddingBottom()\"\n class=\"flex-shrink-0\"\n ></div>\n } @else if (enableSubRows()) {\n @if (processedTreeRows().length > 0) {\n @for (\n treeRow of processedTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(treeRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [class.opacity-30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-2]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-inset]=\"isRowBeingDragged(treeRow.row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(treeRow.row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"treeRow.isLeaf ? null : treeRow.isExpanded\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(treeRow.row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, treeRow.row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(i)) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i, treeRow.depth)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"onCellClick(i, col, $event)\"\n (keydown.enter)=\"onCellClick(i, col, $event)\"\n (keydown.space)=\"onCellClick(i, col, $event)\"\n (dblclick)=\"onCellDblClick(i, col, $event)\"\n (touchend)=\"onCellTouchEnd($event, i, col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: i,\n treeRow: treeRow,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(treeRow.row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: treeRow.row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (groupingActive()) {\n @if (pagedGroupedDisplayRows().length > 0) {\n @for (\n displayRow of pagedGroupedDisplayRows();\n track groupTrackBy(displayRow);\n let i = $index\n ) {\n @if (isGroupRow(displayRow)) {\n <ui-table-row\n class=\"border-0 bg-muted/40 cursor-pointer select-none\"\n data-slot=\"table-group-row\"\n [attr.data-group-key]=\"displayRow.groupKey\"\n [attr.aria-expanded]=\"!displayRow.collapsed\"\n (click)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.enter)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.space)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n >\n <ui-table-cell\n class=\"flex-1 border-b font-medium\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <div class=\"flex flex-wrap items-center gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n displayRow.collapsed ? 'Expand group' : 'Collapse group'\n \"\n (click)=\"\n $event.stopPropagation();\n toggleGroupCollapsed(displayRow.groupKey)\n \"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"!displayRow.collapsed && !isRtl()\"\n [class.-rotate-90]=\"!displayRow.collapsed && isRtl()\"\n />\n </button>\n <span class=\"truncate\">{{ groupRowValueLabel(displayRow) }}</span>\n <span class=\"text-xs text-muted-foreground\">({{ displayRow.count }})</span>\n @if (groupAggregates()) {\n @for (entry of displayRow.aggregates | keyvalue: keepGroupAggregateOrder; track entry.key) {\n <span class=\"text-xs text-muted-foreground\">\n {{ groupAggregateLabel(entry.key) }}: {{ entry.value }}\n </span>\n }\n }\n </div>\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(displayRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(displayRow.row) || null\"\n [class.opacity-50]=\"isDisabled(displayRow.row)\"\n [attr.data-row-id]=\"getRowId()(displayRow.row)\"\n data-slot=\"table-group-data-row\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: displayRow.row,\n rowIndex: i,\n treeRow: null,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (processedData().length > 0) {\n @for (\n row of (dragPreviewData() ?? processedData());\n track getRowId()(row);\n let i = $index\n ) {\n @if (isFullWidthRow(row)) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n class=\"border-0\"\n >\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n @if (fullWidthRowTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n fullWidthRowTemplate();\n context: { $implicit: row, index: i }\n \"\n ></ng-container>\n } @else if (fullWidthRowComponent()) {\n <div\n [uiComponentOutlet]=\"fullWidthRowComponent()!\"\n [inputs]=\"{ row: row, index: i }\"\n ></div>\n }\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [class.ring-2]=\"isRowBeingDragged(row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(row)\"\n [class.ring-inset]=\"isRowBeingDragged(row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell [class]=\"getCellClass(col, i)\" [attr.data-column]=\"String(col.accessorKey)\" [style]=\"getCellStyle(col)\" (click)=\"onCellClick(i, col, $event)\" (keydown.enter)=\"onCellClick(i, col, $event)\" (keydown.space)=\"onCellClick(i, col, $event)\" (dblclick)=\"onCellDblClick(i, col, $event)\" (touchend)=\"onCellTouchEnd($event, i, col)\">\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { $implicit: col, row: row, rowIndex: i, treeRow: null, recycle: false }\"></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell class=\"flex-1 pointer-events-none\" [class]=\"getCellClass({ _width: 'auto' })\"></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell class=\"flex-1 border-b\" style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\">\n <ng-container *ngTemplateOutlet=\"rowDetailTpl; context: { $implicit: row }\"></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <!-- A spacer that stretches the body to fill the container. It holds\n no data and cannot be reached, so it is hidden from assistive\n tech rather than counted as a row of the grid. -->\n <ui-table-row class=\"h-full\" aria-hidden=\"true\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col)\"\n [style]=\"getCellStyle(col)\"\n class=\"bg-background border-0 p-0\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </ui-table-body>\n @if (hasFooter()) {\n <div\n class=\"sticky bottom-0 z-20 bg-background border-t\"\n data-slot=\"table-footer\"\n >\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [style]=\"getCellStyle(col)\"\n class=\"whitespace-nowrap overflow-hidden text-ellipsis text-sm font-medium text-muted-foreground\"\n >\n @if (col.footerComponent) {\n <div\n [uiComponentOutlet]=\"col.footerComponent\"\n [inputs]=\"{\n column: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\"\n ></div>\n } @else if (col.footerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.footerTemplate;\n context: {\n $implicit: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\n \"\n ></ng-container>\n } @else {\n {{ footerValues().get(String(col.accessorKey)) || \"\" }}\n }\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </div>\n }\n </ui-table>\n\n @if (enableFillHandle() && fillHandlePosition(); as pos) {\n <span\n data-slot=\"fill-handle\"\n class=\"absolute z-20 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 cursor-crosshair rounded-[2px] border border-background bg-primary\"\n style=\"touch-action: none;\"\n aria-hidden=\"true\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n (mousedown)=\"onFillHandleStart($event)\"\n (touchstart)=\"onFillHandleStart($event)\"\n ></span>\n }\n\n @if (enableRangeActions() && rangeSelectionStats(); as stats) {\n <div\n data-slot=\"range-actions\"\n class=\"sticky bottom-0 z-20 flex max-w-[calc(100vw-2rem)] flex-wrap items-center gap-x-4 gap-y-1 border-t bg-background/95 px-3 py-1.5 text-xs backdrop-blur-sm\"\n >\n <span class=\"text-muted-foreground\">{{ rangeLabels().count }}: <span class=\"text-foreground font-medium\">{{ stats.count }}</span></span>\n @if (stats.numericCount > 0) {\n <span class=\"text-muted-foreground\">{{ rangeLabels().sum }}: <span class=\"text-foreground font-medium\">{{ stats.sum }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().avg }}: <span class=\"text-foreground font-medium\">{{ stats.avg }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().min }}: <span class=\"text-foreground font-medium\">{{ stats.min }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().max }}: <span class=\"text-foreground font-medium\">{{ stats.max }}</span></span>\n @if (rangeChartPayload()) {\n <ui-button\n size=\"sm\"\n variant=\"outline\"\n class=\"ms-auto h-6 px-2 pointer-coarse:h-11\"\n [ariaLabel]=\"rangeLabels().chart\"\n (click)=\"openRangeChart()\"\n >\n <ui-icon name=\"bar-chart-3\" size=\"xs\" class=\"me-1\" />{{ rangeLabels().chart }}\n </ui-button>\n }\n }\n </div>\n }\n </div>\n\n @if (showPagination()) {\n <ui-data-table-pagination\n class=\"flex-none\"\n [total]=\"activeTotalItems()\"\n [state]=\"paginationState()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSizeSelector]=\"showPageSizeSelector()\"\n [rowsPerPageLabel]=\"rowsPerPageLabel()\"\n [pageLabel]=\"pageLabel()\"\n [ofLabel]=\"ofLabel()\"\n (paginationChange)=\"onPaginationChange($event)\"\n />\n }\n </div>\n } <!-- end @else skeleton -->\n", styles: [":host([data-ui-theme=\"neutral\"]){--primary: oklch(.205 0 0);--primary-foreground: oklch(.985 0 0);--ring: oklch(.708 0 0)}:host-context(.dark)[data-ui-theme=neutral]{--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--ring: oklch(.708 0 0)}:host([data-ui-theme=\"zinc\"]){--primary: oklch(.205 0 0);--primary-foreground: oklch(.985 0 0);--ring: oklch(.708 0 0)}:host-context(.dark)[data-ui-theme=zinc]{--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--ring: oklch(.708 0 0)}:host([data-ui-theme=\"slate\"]){--primary: oklch(.208 .042 265.755);--primary-foreground: oklch(.984 .003 247.858);--ring: oklch(.704 .04 256.788)}:host-context(.dark)[data-ui-theme=slate]{--primary: oklch(.929 .013 255.508);--primary-foreground: oklch(.208 .042 265.755);--ring: oklch(.704 .04 256.788)}:host([data-ui-theme=\"stone\"]){--primary: oklch(.216 .006 56.043);--primary-foreground: oklch(.985 .001 106.423);--ring: oklch(.709 .01 56.259)}:host-context(.dark)[data-ui-theme=stone]{--primary: oklch(.923 .003 48.717);--primary-foreground: oklch(.216 .006 56.043);--ring: oklch(.553 .013 58.071)}:host([data-ui-theme=\"gray\"]){--primary: oklch(.21 .028 264.532);--primary-foreground: oklch(.985 .002 247.839);--ring: oklch(.707 .022 264.436)}:host-context(.dark)[data-ui-theme=gray]{--primary: oklch(.928 .006 264.531);--primary-foreground: oklch(.21 .028 264.532);--ring: oklch(.551 .027 264.364)}:host([data-ui-theme=\"red\"]){--primary: oklch(.577 .245 27.325);--primary-foreground: oklch(.985 0 0);--ring: oklch(.577 .245 27.325)}:host-context(.dark)[data-ui-theme=red]{--primary: oklch(.577 .245 27.325);--primary-foreground: oklch(.985 0 0);--ring: oklch(.577 .245 27.325)}:host([data-ui-theme=\"rose\"]){--primary: oklch(.645 .246 16.439);--primary-foreground: oklch(.985 0 0);--ring: oklch(.645 .246 16.439)}:host-context(.dark)[data-ui-theme=rose]{--primary: oklch(.645 .246 16.439);--primary-foreground: oklch(.985 0 0);--ring: oklch(.645 .246 16.439)}:host([data-ui-theme=\"orange\"]){--primary: oklch(.646 .222 41.116);--primary-foreground: oklch(.985 0 0);--ring: oklch(.646 .222 41.116)}:host-context(.dark)[data-ui-theme=orange]{--primary: oklch(.646 .222 41.116);--primary-foreground: oklch(.985 0 0);--ring: oklch(.646 .222 41.116)}:host([data-ui-theme=\"green\"]){--primary: oklch(.623 .214 131.655);--primary-foreground: oklch(.985 0 0);--ring: oklch(.623 .214 131.655)}:host-context(.dark)[data-ui-theme=green]{--primary: oklch(.623 .214 131.655);--primary-foreground: oklch(.985 0 0);--ring: oklch(.623 .214 131.655)}:host([data-ui-theme=\"blue\"]){--primary: oklch(.546 .245 262.881);--primary-foreground: oklch(.985 0 0);--ring: oklch(.546 .245 262.881)}:host-context(.dark)[data-ui-theme=blue]{--primary: oklch(.546 .245 262.881);--primary-foreground: oklch(.985 0 0);--ring: oklch(.546 .245 262.881)}:host([data-ui-theme=\"yellow\"]){--primary: oklch(.82 .185 84.67);--primary-foreground: oklch(.205 0 0);--ring: oklch(.82 .185 84.67)}:host-context(.dark)[data-ui-theme=yellow]{--primary: oklch(.82 .185 84.67);--primary-foreground: oklch(.205 0 0);--ring: oklch(.82 .185 84.67)}:host([data-ui-theme=\"violet\"]){--primary: oklch(.558 .288 302.321);--primary-foreground: oklch(.985 0 0);--ring: oklch(.558 .288 302.321)}:host-context(.dark)[data-ui-theme=violet]{--primary: oklch(.558 .288 302.321);--primary-foreground: oklch(.985 0 0);--ring: oklch(.558 .288 302.321)}:host([data-ui-theme=\"amber\"]){--primary: oklch(.77 .16 70);--primary-foreground: oklch(.145 0 0);--ring: oklch(.77 .16 70)}:host-context(.dark)[data-ui-theme=amber]{--primary: oklch(.77 .16 70);--primary-foreground: oklch(.145 0 0);--ring: oklch(.77 .16 70)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TableComponent, selector: "ui-table", inputs: ["class", "role"] }, { kind: "component", type: TableHeaderComponent, selector: "ui-table-header", inputs: ["class"] }, { kind: "component", type: TableBodyComponent, selector: "ui-table-body", inputs: ["class", "skeleton", "skeletonRows"] }, { kind: "component", type: TableRowComponent, selector: "ui-table-row", inputs: ["class", "selected"] }, { kind: "component", type: TableHeadComponent, selector: "ui-table-head", inputs: ["class", "role"] }, { kind: "component", type: TableCellComponent, selector: "ui-table-cell", inputs: ["class"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["type", "placeholder", "disabled", "class", "elementId", "name", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "variant", "loading", "skeleton", "autofocus", "clearable", "floating", "label", "labelClass", "inputMode", "lang", "prefix", "suffix", "value"], outputs: ["valueChange"] }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["disabled", "class", "skeleton", "elementId", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaInvalid", "checked", "indeterminate", "label"], outputs: ["checkedChange"] }, { kind: "component", type: DatePickerComponent, selector: "ui-date-picker", inputs: ["class", "placeholder", "disabled", "showTime", "locale", "date"], outputs: ["dateChange"] }, { kind: "component", type: PopoverComponent, selector: "ui-popover", inputs: ["open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger" }, { kind: "component", type: PopoverContentComponent, selector: "ui-popover-content", inputs: ["class", "align", "side", "sideOffset", "avoidCollisions", "restoreFocus", "strategy"] }, { kind: "component", type: DataTableColumnHeaderComponent, selector: "ui-data-table-column-header", inputs: ["title", "column", "direction", "enableSorting", "class", "sortIndex"], outputs: ["sort", "sortMeta"] }, { kind: "component", type: DataTablePaginationComponent, selector: "ui-data-table-pagination", inputs: ["total", "state", "pageSizeOptions", "showPageSizeSelector", "rowsPerPageLabel", "pageLabel", "ofLabel"], outputs: ["paginationChange"] }, { kind: "component", type: DataTableFilterBuilderComponent, selector: "ui-data-table-filter-builder", inputs: ["group", "columns", "labels"], outputs: ["groupChange"] }, { kind: "directive", type: UiComponentOutletDirective, selector: "[uiComponentOutlet]", inputs: ["uiComponentOutlet", "inputs", "outputs", "recycle"], outputs: ["initialized"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }, { kind: "pipe", type: i1$1.JsonPipe, name: "json" }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
14056
14377
|
}
|
|
14057
14378
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableComponent, decorators: [{
|
|
14058
14379
|
type: Component,
|
|
@@ -14085,8 +14406,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
14085
14406
|
], host: {
|
|
14086
14407
|
class: "block h-full w-full",
|
|
14087
14408
|
'[attr.dir]': 'dir()',
|
|
14088
|
-
}, template: " <!-- Reusable: cell content rendering (component/template/cell/default) -->\n <ng-template\n #cellContentTpl\n let-col\n let-row=\"row\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.component) {\n <div\n [uiComponentOutlet]=\"col.component\"\n [inputs]=\"\n treeRow\n ? getSubRowComponentInputs(col, treeRow)\n : col.componentInputs\n ? col.componentInputs(row)\n : EMPTY_RECORD\n \"\n [outputs]=\"\n col.componentOutputs ? col.componentOutputs(row) : EMPTY_RECORD\n \"\n [recycle]=\"recycle\"\n ></div>\n } @else if (col.template) {\n @if (treeRow) {\n <ng-container\n *ngTemplateOutlet=\"\n col.template;\n context: {\n $implicit: row,\n depth: treeRow.depth,\n parentRow: treeRow.parentRow,\n parentId: treeRow.parentId,\n path: treeRow.path,\n isLeaf: treeRow.isLeaf,\n childCount: treeRow.childCount,\n }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"col.template; context: { $implicit: row }\"\n ></ng-container>\n }\n } @else {\n @let fmt = getCellFormatting(col, row);\n @if (fmt) {\n <span\n data-slot=\"cell-formatted\"\n class=\"relative flex w-full items-center gap-1.5 {{ fmt.class }}\"\n [style]=\"fmt.style\"\n >\n @if (fmt.dataBar) {\n @if (fmt.dataBar.track; as track) {\n <span\n data-slot=\"cell-data-bar-track\"\n class=\"pointer-events-none absolute inset-x-0 inset-y-0.5 rounded-sm\"\n [style.background-color]=\"track\"\n ></span>\n }\n <span\n data-slot=\"cell-data-bar\"\n class=\"pointer-events-none absolute inset-y-0.5 start-0 rounded-sm\"\n [style.width]=\"fmt.dataBar.width\"\n [style.background-color]=\"fmt.dataBar.color\"\n ></span>\n }\n @if (fmt.icon) {\n @if (fmt.icon.name) {\n <ui-icon\n data-slot=\"cell-icon\"\n [name]=\"fmt.icon.name\"\n size=\"xs\"\n class=\"relative shrink-0 {{ fmt.icon.class }}\"\n />\n } @else if (fmt.icon.glyph) {\n <span data-slot=\"cell-icon\" class=\"relative shrink-0 {{ fmt.icon.class }}\">{{ fmt.icon.glyph }}</span>\n }\n }\n <span class=\"relative min-w-0 truncate\">\n @if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n </span>\n </span>\n } @else if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n }\n </ng-template>\n\n <!-- Reusable: full cell rendering (special columns + content) -->\n <ng-template\n #cellTpl\n let-col\n let-row=\"row\"\n let-rowIndex=\"rowIndex\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isRowSelected(row)\"\n [disabled]=\"isDisabled(row)\"\n [indeterminate]=\"\n treeRow ? isSubRowSelectionIndeterminate(row) : false\n \"\n (checkedChange)=\"treeRow ? toggleRowWithCascade(row) : toggleRow(row)\"\n ariaLabel=\"Select row\"\n />\n } @else if (col._isTreeExpanderHost && treeRow) {\n <div\n class=\"flex items-center gap-1 min-w-0\"\n [style.padding-inline-start.px]=\"treeRow.depth * subRowIndentSize()\"\n >\n @if (!treeRow.isLeaf) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n treeRow.isExpanded ? 'Collapse sub-rows' : 'Expand sub-rows'\n \"\n (click)=\"toggleSubRowExpanded(treeRow.row, $event)\"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"treeRow.isExpanded && !isRtl()\"\n [class.-rotate-90]=\"treeRow.isExpanded && isRtl()\"\n />\n </button>\n } @else {\n <span class=\"inline-block h-6 w-6 shrink-0\"></span>\n }\n <span class=\"truncate\">\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n </span>\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"isRowExpanded(row) ? 'Collapse row' : 'Expand row'\"\n [attr.aria-expanded]=\"isRowExpanded(row)\"\n (click)=\"toggleRowExpanded(row, $event)\"\n >\n @if (isRowExpanded(row)) {\n <ui-icon name=\"chevron-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevron-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n @if (!isDisabled(row)) {\n @for (slot of cellActionSlots(); track slot.id) {\n <ui-button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-8 w-8\"\n [ariaLabel]=\"slot.ariaLabel ?? 'Row actions'\"\n (click)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n (keydown.enter)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n (keydown.space)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"sm\" />\n </ui-button>\n }\n }\n } @else if (\n col.editable && isEditing(rowIndex, String(col.accessorKey))\n ) {\n <ng-container\n *ngTemplateOutlet=\"\n cellEditTpl;\n context: { $implicit: col, row: row, rowIndex: rowIndex }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n }\n </ng-template>\n\n <!-- Reusable: cell edit mode -->\n <ng-template #cellEditTpl let-col let-row=\"row\" let-rowIndex=\"rowIndex\">\n @let editErr = editErrorFor(rowIndex, col);\n @if (col.editComponent) {\n <div\n [uiComponentOutlet]=\"col.editComponent\"\n [inputs]=\"{ value: editValue(), row: row, column: col }\"\n [outputs]=\"{\n valueChange: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\"\n ></div>\n } @else if (col.editTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.editTemplate;\n context: {\n $implicit: editValue(),\n row: row,\n column: col,\n setValue: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\n \"\n ></ng-container>\n } @else if (col.editType === \"checkbox\") {\n <ui-checkbox\n [checked]=\"!!editValue()\"\n [ariaInvalid]=\"editErr ? true : undefined\"\n [ariaDescribedby]=\"editErr ? cellEditErrorId : undefined\"\n (checkedChange)=\"onEditValueChange($event); commitEdit()\"\n />\n } @else if (col.editType === \"date\") {\n <ui-date-picker\n class=\"w-full\"\n [date]=\"editDateValue()\"\n (dateChange)=\"onEditDateChange($event)\"\n />\n } @else if (col.editType === \"select\" && col.editOptions) {\n <select\n data-edit-input\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (change)=\"onEditValueChange($any($event.target).value); commitEdit()\"\n (keydown)=\"onEditKeydown($event)\"\n >\n @for (opt of col.editOptions; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n } @else {\n <input\n data-edit-input\n [type]=\"col.editType === 'number' ? 'number' : 'text'\"\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1 select-text\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (input)=\"onEditValueChange($any($event.target).value)\"\n (keydown)=\"onEditKeydown($event)\"\n (blur)=\"editingCell() ? commitEdit() : null\"\n />\n }\n @if (editErr) {\n <p\n [id]=\"cellEditErrorId\"\n class=\"mt-0.5 px-1 text-xs text-destructive\"\n role=\"alert\"\n data-slot=\"cell-edit-error\"\n >\n {{ editErr }}\n </p>\n }\n </ng-template>\n\n <!-- Reusable: row detail/expansion panel -->\n <ng-template #rowDetailTpl let-row>\n @if (rowDetailTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTemplate();\n context: { $implicit: row, row: row }\n \"\n ></ng-container>\n } @else if (rowDetailComponent()) {\n <div\n [uiComponentOutlet]=\"rowDetailComponent()!\"\n [inputs]=\"getRowDetailComponentInputs(row)\"\n ></div>\n } @else {\n <pre class=\"text-xs text-muted-foreground whitespace-pre-wrap\">{{\n row | json\n }}</pre>\n }\n </ng-template>\n\n <!-- Reusable: empty state -->\n <ng-template #emptyStateTpl>\n <ui-table-row class=\"hover:bg-transparent justify-center w-full\">\n <ui-table-cell\n class=\"h-48 sm:h-96 text-center w-full p-0 border-none justify-center\"\n >\n @if (emptyStateComponent()) {\n <ng-container\n [uiComponentOutlet]=\"emptyStateComponent()!\"\n [inputs]=\"emptyStateComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex h-full flex-col items-center justify-center py-10 text-center text-muted-foreground w-full\"\n >\n <ui-icon name=\"circle-off\" size=\"xl\" class=\"mb-4 opacity-20\" />\n <p>{{ noResultsLabel() }}</p>\n </div>\n }\n </ui-table-cell>\n </ui-table-row>\n </ng-template>\n\n @if (skeleton()) {\n <div class=\"flex flex-col w-full space-y-3\" data-slot=\"data-table-skeleton\">\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n @for (row of skeletonRowsArray(); track $index) {\n <ui-skeleton class=\"h-12 w-full rounded-md\" />\n }\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n </div>\n } @else {\n <!-- `relative`: the sr-only announcer and the sr-only cell labels below are\n position:absolute. Without a positioned ancestor their containing block\n is <html>, so they escape this table's scroll container entirely and\n stretch the document to their static position \u2014 which on a page with a\n virtual-scroll table adds a second, page-length scrollbar. -->\n <div class=\"relative flex flex-col w-full h-full space-y-4\">\n <output\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-slot=\"data-table-announcer\"\n >\n {{ srAnnouncement() }}\n </output>\n @if (showToolbar()) {\n <div class=\"flex flex-wrap items-center justify-between gap-2 flex-none\">\n <div class=\"flex flex-1 flex-wrap items-center gap-2\">\n <ui-input\n [placeholder]=\"filterPlaceholder()\"\n [ngModel]=\"globalFilter()\"\n (ngModelChange)=\"onFilterChange($event)\"\n class=\"h-8 w-full sm:w-[150px] lg:w-[250px]\"\n />\n @if (hasAi() && enableNlFilter()) {\n <div class=\"flex items-center gap-1\" data-slot=\"table-nl-filter\">\n <span aria-hidden=\"true\" class=\"text-sm\">\u2728</span>\n <ui-input\n [placeholder]=\"nlFilterPlaceholder()\"\n [ngModel]=\"aiFilterQuery()\"\n (ngModelChange)=\"aiFilterQuery.set($event)\"\n [disabled]=\"aiFilterRunning()\"\n (keydown.enter)=\"runAiFilter()\"\n class=\"h-8 w-full sm:w-[200px]\"\n />\n </div>\n }\n @if (enableAdvancedFilter()) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n data-slot=\"advanced-filter-trigger\"\n class=\"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-icon name=\"filter\" size=\"xs\" />\n <span class=\"hidden sm:inline\">{{ filterBuilderLabels().filterButton }}</span>\n @if (advancedFilterCount() > 0) {\n <span class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground\">{{ advancedFilterCount() }}</span>\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-[min(420px,calc(100vw-2rem))] p-2\">\n <div class=\"space-y-2\">\n <ui-data-table-filter-builder\n [group]=\"advancedFilterGroup()\"\n [columns]=\"filterBuilderColumns()\"\n [labels]=\"filterBuilderLabels()\"\n (groupChange)=\"onAdvancedFilterChange($event)\"\n />\n @if (advancedFilterCount() > 0) {\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-destructive\"\n (click)=\"clearAdvancedFilter()\"\n >{{ filterBuilderLabels().clearFilters }}</button>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n @if (showColumnVisibilityToggle() && hideableColumns().length > 0) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"toggleColumnsLabel()\"\n >\n {{ columnsLabel() }}\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-56 p-2\">\n <div class=\"space-y-1\">\n @for (col of hideableColumns(); track col.accessorKey) {\n <div\n class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-checkbox\n [checked]=\"isColumnVisible(col.accessorKey)\"\n (checkedChange)=\"\n setColumnVisibility(col.accessorKey, $event)\n \"\n [ariaLabel]=\"toggleColumnAriaLabel(col.header)\"\n />\n <span>{{ col.header }}</span>\n </div>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n\n <div\n #scrollContainer\n class=\"rounded-md border relative flex-1 min-h-0 overflow-auto w-full\"\n [class.contain-strict]=\"isVirtualScrollActive()\"\n [class.will-change-scroll]=\"isVirtualScrollActive()\"\n [class.select-none]=\"enableCellRangeSelection()\"\n (keydown)=\"onTableKeydown($event)\"\n (click)=\"onTableClick()\"\n (mousedown)=\"onTableMouseDown($event)\"\n (scroll)=\"isVirtualScrollActive() ? onVirtualScroll($event) : null\"\n (dragover)=\"onContainerDragOver($event)\"\n (drop)=\"onRowDrop($event)\"\n tabindex=\"0\"\n >\n @if (isLoaderVisible()) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n @if (loaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n loaderTemplate();\n context: {\n $implicit: loadingTrigger(),\n trigger: loadingTrigger(),\n }\n \"\n ></ng-container>\n } @else if (loaderComponent()) {\n <ng-container\n [uiComponentOutlet]=\"loaderComponent()!\"\n [inputs]=\"resolvedLoaderComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>Loading...</span>\n </div>\n }\n </div>\n }\n @if (busyLabel(); as label) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>{{ label }}</span>\n </div>\n </div>\n }\n <ui-table [role]=\"enableSubRows() ? 'treegrid' : 'grid'\">\n <ui-table-header class=\"bg-background\">\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [class]=\"getHeaderClass(col)\"\n class=\"group/head\"\n [class.cursor-grab]=\"isColumnDraggable(col)\"\n [class.cursor-grabbing]=\"isDraggingColumn(col)\"\n [class.opacity-70]=\"isDraggingColumn(col)\"\n [class.relative]=\"isDropTargetColumn(col)\"\n [attr.data-column-id]=\"String(col.accessorKey)\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.draggable]=\"isColumnDraggable(col) ? 'true' : null\"\n [style]=\"getHeaderCellStyle(col)\"\n (dragstart)=\"onColumnDragStart($event, col)\"\n (dragover)=\"onColumnDragOver($event, col)\"\n (drop)=\"onColumnDrop($event, col)\"\n (dragend)=\"onColumnDragEnd()\"\n >\n @if (isDropTargetColumn(col)) {\n <div\n class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/70 bg-primary/10\"\n ></div>\n }\n <div class=\"flex items-center w-full h-full\">\n <div class=\"flex-1 min-w-0\">\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isIndeterminate()\"\n (checkedChange)=\"toggleAll()\"\n ariaLabel=\"Select all\"\n />\n } @else if (col._isTreeExpanderHost) {\n <div class=\"flex items-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n isAllSubRowsExpanded()\n ? 'Collapse all sub-rows'\n : 'Expand all sub-rows'\n \"\n (click)=\"\n isAllSubRowsExpanded()\n ? collapseAllSubRows()\n : expandAllSubRows(-1)\n \"\n >\n @if (isAllSubRowsExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n @if (col.enableSorting !== false) {\n <ui-data-table-column-header\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n } @else {\n <span>{{ col.header }}</span>\n }\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n isAllExpanded()\n ? 'Collapse all rows'\n : 'Expand all rows'\n \"\n (click)=\"toggleAllExpanded()\"\n >\n @if (isAllExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n <span class=\"sr-only\">Actions</span>\n } @else if (col.headerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.headerTemplate;\n context: { $implicit: col }\n \"\n ></ng-container>\n } @else if (col.enableSorting !== false) {\n <div class=\"flex items-center gap-2\">\n <ui-data-table-column-header\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover [closeOnScroll]=\"true\">\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n } @else {\n <div class=\"flex items-center gap-2\">\n <span>{{ col.header }}</span>\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n </div>\n @if (\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @for (slot of headerActionSlots(); track slot.id) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md opacity-0 group-hover/head:opacity-100 touch-visible hover:bg-accent hover:text-accent-foreground transition-opacity\"\n [attr.aria-label]=\"'Column menu for ' + col.header\"\n (click)=\"slot.onClick($event, col)\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"xs\" />\n </button>\n }\n }\n </div>\n @if (\n enableColumnResize() &&\n col.accessorKey !== \"_selection\"\n ) {\n <div\n class=\"group/resize absolute top-0 w-4 h-full cursor-col-resize touch-none z-40 select-none\"\n [class.right-0]=\"!isRtl()\"\n [class.translate-x-1/2]=\"!isRtl()\"\n [class.left-0]=\"isRtl()\"\n [class.-translate-x-1/2]=\"isRtl()\"\n (mousedown)=\"onResizeStart($event, col)\"\n (touchstart)=\"onResizeTouchStart($event, col)\"\n (dblclick)=\"onResizeDoubleClick($event, col)\"\n role=\"separator\"\n [attr.aria-label]=\"'Resize ' + col.header + ' column (double-click to auto-fit)'\"\n >\n <div\n [class]=\"resizeLineClass(col)\"\n aria-hidden=\"true\"\n ></div>\n </div>\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none\"\n [class]=\"getHeaderClass({ _width: 'auto' })\"\n ></ui-table-head>\n }\n </ui-table-row>\n @if (enableFloatingFilters() && hasAnyFloatingFilter()) {\n <ui-table-row class=\"border-0\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [role]=\"hasFloatingFilter(col) ? 'columnheader' : 'presentation'\"\n [style]=\"getHeaderCellStyle(col)\"\n class=\"sticky top-[var(--header-height,41px)] z-20 bg-muted/50 py-1 px-1 overflow-hidden\"\n >\n @if (\n col.floatingFilter !== false &&\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @if (col.floatingFilterComponent) {\n <div\n [uiComponentOutlet]=\"col.floatingFilterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n } @else if (col.floatingFilterTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.floatingFilterTemplate;\n context: {\n $implicit: col,\n value: columnFilters()[String(col.accessorKey)],\n change: getFloatingFilterChange(col),\n }\n \"\n ></ng-container>\n } @else if (col.enableFiltering) {\n <ui-input\n class=\"h-7 text-xs\"\n [placeholder]=\"col.header\"\n [ngModel]=\"\n columnFilters()[String(col.accessorKey)] || ''\n \"\n (ngModelChange)=\"\n onColumnFilterChange(col.accessorKey, $event)\n \"\n />\n }\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none sticky top-[var(--header-height,41px)] z-20 bg-muted/50\"\n ></ui-table-head>\n }\n </ui-table-row>\n }\n </ui-table-header>\n <ui-table-body>\n @if (isVirtualScrollActive()) {\n <div\n [style.height.px]=\"virtualPaddingTop()\"\n class=\"flex-shrink-0\"\n ></div>\n @if (enableSubRows()) {\n @for (\n treeRow of virtualVisibleTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"\n isRowSelected(treeRow.row) ? 'selected' : null\n \"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"\n treeRow.isLeaf ? null : treeRow.isExpanded\n \"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : virtualRowHeight()\n \"\n class=\"border-0\"\n >\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n }\n } @else {\n @for (\n row of virtualVisibleRows();\n track getRowId()(row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, getVirtualRowIndex(i))\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : virtualRowHeight()\n \"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(getVirtualRowIndex(i))) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n @if (virtualTotalRows() === 0) {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <div\n [style.height.px]=\"virtualPaddingBottom()\"\n class=\"flex-shrink-0\"\n ></div>\n } @else if (enableSubRows()) {\n @if (processedTreeRows().length > 0) {\n @for (\n treeRow of processedTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(treeRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [class.opacity-30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-2]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-inset]=\"isRowBeingDragged(treeRow.row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(treeRow.row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"treeRow.isLeaf ? null : treeRow.isExpanded\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(treeRow.row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, treeRow.row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(i)) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i, treeRow.depth)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"onCellClick(i, col, $event)\"\n (keydown.enter)=\"onCellClick(i, col, $event)\"\n (keydown.space)=\"onCellClick(i, col, $event)\"\n (dblclick)=\"onCellDblClick(i, col, $event)\"\n (touchend)=\"onCellTouchEnd($event, i, col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: i,\n treeRow: treeRow,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(treeRow.row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: treeRow.row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (groupingActive()) {\n @if (pagedGroupedDisplayRows().length > 0) {\n @for (\n displayRow of pagedGroupedDisplayRows();\n track groupTrackBy(displayRow);\n let i = $index\n ) {\n @if (isGroupRow(displayRow)) {\n <ui-table-row\n class=\"border-0 bg-muted/40 cursor-pointer select-none\"\n data-slot=\"table-group-row\"\n [attr.data-group-key]=\"displayRow.groupKey\"\n [attr.aria-expanded]=\"!displayRow.collapsed\"\n (click)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.enter)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.space)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n >\n <ui-table-cell\n class=\"flex-1 border-b font-medium\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <div class=\"flex flex-wrap items-center gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"\n displayRow.collapsed ? 'Expand group' : 'Collapse group'\n \"\n (click)=\"\n $event.stopPropagation();\n toggleGroupCollapsed(displayRow.groupKey)\n \"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"!displayRow.collapsed && !isRtl()\"\n [class.-rotate-90]=\"!displayRow.collapsed && isRtl()\"\n />\n </button>\n <span class=\"truncate\">{{ groupRowValueLabel(displayRow) }}</span>\n <span class=\"text-xs text-muted-foreground\">({{ displayRow.count }})</span>\n @if (groupAggregates()) {\n @for (entry of displayRow.aggregates | keyvalue: keepGroupAggregateOrder; track entry.key) {\n <span class=\"text-xs text-muted-foreground\">\n {{ groupAggregateLabel(entry.key) }}: {{ entry.value }}\n </span>\n }\n }\n </div>\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(displayRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(displayRow.row) || null\"\n [class.opacity-50]=\"isDisabled(displayRow.row)\"\n [attr.data-row-id]=\"getRowId()(displayRow.row)\"\n data-slot=\"table-group-data-row\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: displayRow.row,\n rowIndex: i,\n treeRow: null,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (processedData().length > 0) {\n @for (\n row of (dragPreviewData() ?? processedData());\n track getRowId()(row);\n let i = $index\n ) {\n @if (isFullWidthRow(row)) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n class=\"border-0\"\n >\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n @if (fullWidthRowTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n fullWidthRowTemplate();\n context: { $implicit: row, index: i }\n \"\n ></ng-container>\n } @else if (fullWidthRowComponent()) {\n <div\n [uiComponentOutlet]=\"fullWidthRowComponent()!\"\n [inputs]=\"{ row: row, index: i }\"\n ></div>\n }\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [class.ring-2]=\"isRowBeingDragged(row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(row)\"\n [class.ring-inset]=\"isRowBeingDragged(row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell [class]=\"getCellClass(col, i)\" [attr.data-column]=\"String(col.accessorKey)\" [style]=\"getCellStyle(col)\" (click)=\"onCellClick(i, col, $event)\" (keydown.enter)=\"onCellClick(i, col, $event)\" (keydown.space)=\"onCellClick(i, col, $event)\" (dblclick)=\"onCellDblClick(i, col, $event)\" (touchend)=\"onCellTouchEnd($event, i, col)\">\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { $implicit: col, row: row, rowIndex: i, treeRow: null, recycle: false }\"></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell class=\"flex-1 pointer-events-none\" [class]=\"getCellClass({ _width: 'auto' })\"></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell class=\"flex-1 border-b\" style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\">\n <ng-container *ngTemplateOutlet=\"rowDetailTpl; context: { $implicit: row }\"></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <!-- A spacer that stretches the body to fill the container. It holds\n no data and cannot be reached, so it is hidden from assistive\n tech rather than counted as a row of the grid. -->\n <ui-table-row class=\"h-full\" aria-hidden=\"true\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col)\"\n [style]=\"getCellStyle(col)\"\n class=\"bg-background border-0 p-0\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </ui-table-body>\n @if (hasFooter()) {\n <div\n class=\"sticky bottom-0 z-20 bg-background border-t\"\n data-slot=\"table-footer\"\n >\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [style]=\"getCellStyle(col)\"\n class=\"whitespace-nowrap overflow-hidden text-ellipsis text-sm font-medium text-muted-foreground\"\n >\n @if (col.footerComponent) {\n <div\n [uiComponentOutlet]=\"col.footerComponent\"\n [inputs]=\"{\n column: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\"\n ></div>\n } @else if (col.footerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.footerTemplate;\n context: {\n $implicit: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\n \"\n ></ng-container>\n } @else {\n {{ footerValues().get(String(col.accessorKey)) || \"\" }}\n }\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </div>\n }\n </ui-table>\n\n @if (enableFillHandle() && fillHandlePosition(); as pos) {\n <span\n data-slot=\"fill-handle\"\n class=\"absolute z-20 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 cursor-crosshair rounded-[2px] border border-background bg-primary\"\n style=\"touch-action: none;\"\n aria-hidden=\"true\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n (mousedown)=\"onFillHandleStart($event)\"\n (touchstart)=\"onFillHandleStart($event)\"\n ></span>\n }\n\n @if (enableRangeActions() && rangeSelectionStats(); as stats) {\n <div\n data-slot=\"range-actions\"\n class=\"sticky bottom-0 z-20 flex max-w-[calc(100vw-2rem)] flex-wrap items-center gap-x-4 gap-y-1 border-t bg-background/95 px-3 py-1.5 text-xs backdrop-blur-sm\"\n >\n <span class=\"text-muted-foreground\">{{ rangeLabels().count }}: <span class=\"text-foreground font-medium\">{{ stats.count }}</span></span>\n @if (stats.numericCount > 0) {\n <span class=\"text-muted-foreground\">{{ rangeLabels().sum }}: <span class=\"text-foreground font-medium\">{{ stats.sum }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().avg }}: <span class=\"text-foreground font-medium\">{{ stats.avg }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().min }}: <span class=\"text-foreground font-medium\">{{ stats.min }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().max }}: <span class=\"text-foreground font-medium\">{{ stats.max }}</span></span>\n @if (rangeChartPayload()) {\n <ui-button\n size=\"sm\"\n variant=\"outline\"\n class=\"ms-auto h-6 px-2\"\n [ariaLabel]=\"rangeLabels().chart\"\n (click)=\"openRangeChart()\"\n >\n <ui-icon name=\"bar-chart-3\" size=\"xs\" class=\"me-1\" />{{ rangeLabels().chart }}\n </ui-button>\n }\n }\n </div>\n }\n </div>\n\n @if (showPagination()) {\n <ui-data-table-pagination\n class=\"flex-none\"\n [total]=\"activeTotalItems()\"\n [state]=\"paginationState()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSizeSelector]=\"showPageSizeSelector()\"\n [rowsPerPageLabel]=\"rowsPerPageLabel()\"\n [pageLabel]=\"pageLabel()\"\n [ofLabel]=\"ofLabel()\"\n (paginationChange)=\"onPaginationChange($event)\"\n />\n }\n </div>\n } <!-- end @else skeleton -->\n" }]
|
|
14089
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }, { type: i0.Output, args: ["dataChange"] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], showColumnVisibilityToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnVisibilityToggle", required: false }] }], showPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPagination", required: false }] }], showRowBorders: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowBorders", required: false }] }], showColumnBorders: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnBorders", required: false }] }], localSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "localSorting", required: false }] }], localPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "localPagination", required: false }] }], localFiltering: [{ type: i0.Input, args: [{ isSignal: true, alias: "localFiltering", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], skeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeleton", required: false }] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], loadingVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingVisibility", required: false }] }], loaderTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "loaderTemplate", required: false }] }], loaderComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "loaderComponent", required: false }] }], loaderComponentInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "loaderComponentInputs", required: false }] }], globalFilterFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFn", required: false }] }], enableMultiSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableMultiSort", required: false }] }], maxMultiSortColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxMultiSortColumns", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], multiSortChange: [{ type: i0.Output, args: ["multiSortChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], query: [{ type: i0.Output, args: ["query"] }], cellEdit: [{ type: i0.Output, args: ["cellEdit"] }], editError: [{ type: i0.Output, args: ["editError"] }], enableRowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRowSelection", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }, { type: i0.Output, args: ["rowSelectionChange"] }], getRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRowId", required: false }] }], enableCopy: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCopy", required: false }] }], isRowDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRowDisabled", required: false }] }], disabledRowIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledRowIds", required: false }] }], enableRowExpansion: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRowExpansion", required: false }] }], expandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRows", required: false }] }, { type: i0.Output, args: ["expandedRowsChange"] }], rowDetailTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailTemplate", required: false }] }], rowDetailComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailComponent", required: false }] }], rowDetailComponentInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailComponentInputs", required: false }] }], enableSubRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSubRows", required: false }] }], getChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "getChildren", required: false }] }], setChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "setChildren", required: false }] }], subRowDefaultExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowDefaultExpanded", required: false }] }], subRowSelectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowSelectionMode", required: false }] }], subRowFilterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowFilterMode", required: false }] }], enableSubRowSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSubRowSorting", required: false }] }], subRowIndentSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowIndentSize", required: false }] }], subRowsPaginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowsPaginated", required: false }] }], subRowExpandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowExpandedRows", required: false }] }, { type: i0.Output, args: ["subRowExpandedRowsChange"] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }], collapsedGroups: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroups", required: false }] }, { type: i0.Output, args: ["collapsedGroupsChange"] }], groupAggregates: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupAggregates", required: false }] }], enableColumnResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableColumnResize", required: false }] }], enableColumnReorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableColumnReorder", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], enableFloatingFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableFloatingFilters", required: false }] }], enableRowDrag: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRowDrag", required: false }] }], localReorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "localReorder", required: false }] }], rowDragMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDragMode", required: false }] }], rowDragAllowDrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDragAllowDrop", required: false }] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], enableCellFlash: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCellFlash", required: false }] }], cellFlashDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellFlashDuration", required: false }] }], enableCellRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCellRangeSelection", required: false }] }], enableRangeActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRangeActions", required: false }] }], rangeChartOpen: [{ type: i0.Output, args: ["rangeChartOpen"] }], enableFillHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableFillHandle", required: false }] }], fillSeries: [{ type: i0.Output, args: ["fillSeries"] }], enableClipboardPaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableClipboardPaste", required: false }] }], cellsPaste: [{ type: i0.Output, args: ["cellsPaste"] }], enableEditHistory: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableEditHistory", required: false }] }], editUndo: [{ type: i0.Output, args: ["editUndo"] }], editRedo: [{ type: i0.Output, args: ["editRedo"] }], columnResize: [{ type: i0.Output, args: ["columnResize"] }], emptyStateComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateComponent", required: false }] }], emptyStateComponentInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateComponentInputs", required: false }] }], fullWidthRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidthRow", required: false }] }], fullWidthRowTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidthRowTemplate", required: false }] }], fullWidthRowComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidthRowComponent", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], filterDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterDebounce", required: false }] }], enableVirtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableVirtualScroll", required: false }] }], virtualRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRowHeight", required: false }] }], virtualRowBuffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRowBuffer", required: false }] }], virtualColumnBuffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualColumnBuffer", required: false }] }], virtualVariableRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualVariableRowHeight", required: false }] }], virtualRecycleComponents: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRecycleComponents", required: false }] }], virtualAutoThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualAutoThreshold", required: false }] }], virtualAutoColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualAutoColumnWidth", required: false }] }], scrollContainerRef: [{ type: i0.ViewChild, args: ["scrollContainer", { isSignal: true }] }], virtualRowElements: [{ type: i0.ViewChildren, args: ["virtualRow", { ...{
|
|
14409
|
+
'[attr.data-ui-theme]': 'theme()',
|
|
14410
|
+
}, template: " <!-- Reusable: cell content rendering (component/template/cell/default) -->\n <ng-template\n #cellContentTpl\n let-col\n let-row=\"row\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.component) {\n <div\n [uiComponentOutlet]=\"col.component\"\n [inputs]=\"\n treeRow\n ? getSubRowComponentInputs(col, treeRow)\n : col.componentInputs\n ? col.componentInputs(row)\n : EMPTY_RECORD\n \"\n [outputs]=\"\n col.componentOutputs ? col.componentOutputs(row) : EMPTY_RECORD\n \"\n [recycle]=\"recycle\"\n ></div>\n } @else if (col.template) {\n @if (treeRow) {\n <ng-container\n *ngTemplateOutlet=\"\n col.template;\n context: {\n $implicit: row,\n depth: treeRow.depth,\n parentRow: treeRow.parentRow,\n parentId: treeRow.parentId,\n path: treeRow.path,\n isLeaf: treeRow.isLeaf,\n childCount: treeRow.childCount,\n }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"col.template; context: { $implicit: row }\"\n ></ng-container>\n }\n } @else {\n @let fmt = getCellFormatting(col, row);\n @if (fmt) {\n <span\n data-slot=\"cell-formatted\"\n class=\"relative flex w-full items-center gap-1.5 {{ fmt.class }}\"\n [style]=\"fmt.style\"\n >\n @if (fmt.dataBar) {\n @if (fmt.dataBar.track; as track) {\n <span\n data-slot=\"cell-data-bar-track\"\n class=\"pointer-events-none absolute inset-x-0 inset-y-0.5 rounded-sm\"\n [style.background-color]=\"track\"\n ></span>\n }\n <span\n data-slot=\"cell-data-bar\"\n class=\"pointer-events-none absolute inset-y-0.5 start-0 rounded-sm\"\n [style.width]=\"fmt.dataBar.width\"\n [style.background-color]=\"fmt.dataBar.color\"\n ></span>\n }\n @if (fmt.icon) {\n @if (fmt.icon.name) {\n <ui-icon\n data-slot=\"cell-icon\"\n [name]=\"fmt.icon.name\"\n size=\"xs\"\n class=\"relative shrink-0 {{ fmt.icon.class }}\"\n />\n } @else if (fmt.icon.glyph) {\n <span data-slot=\"cell-icon\" class=\"relative shrink-0 {{ fmt.icon.class }}\">{{ fmt.icon.glyph }}</span>\n }\n }\n <span class=\"relative min-w-0 truncate\">\n @if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n </span>\n </span>\n } @else if (col.cell) {\n {{ col.cell(row) }}\n } @else {\n {{ getCellValue(row, col.accessorKey, col) }}\n }\n }\n </ng-template>\n\n <!-- Reusable: full cell rendering (special columns + content) -->\n <ng-template\n #cellTpl\n let-col\n let-row=\"row\"\n let-rowIndex=\"rowIndex\"\n let-treeRow=\"treeRow\"\n let-recycle=\"recycle\"\n >\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isRowSelected(row)\"\n [disabled]=\"isDisabled(row)\"\n [indeterminate]=\"\n treeRow ? isSubRowSelectionIndeterminate(row) : false\n \"\n (checkedChange)=\"treeRow ? toggleRowWithCascade(row) : toggleRow(row)\"\n ariaLabel=\"Select row\"\n />\n } @else if (col._isTreeExpanderHost && treeRow) {\n <div\n class=\"flex items-center gap-1 min-w-0\"\n [style.padding-inline-start.px]=\"treeRow.depth * subRowIndentSize()\"\n >\n @if (!treeRow.isLeaf) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n treeRow.isExpanded ? 'Collapse sub-rows' : 'Expand sub-rows'\n \"\n (click)=\"toggleSubRowExpanded(treeRow.row, $event)\"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"treeRow.isExpanded && !isRtl()\"\n [class.-rotate-90]=\"treeRow.isExpanded && isRtl()\"\n />\n </button>\n } @else {\n <span class=\"inline-block h-6 w-6 shrink-0\"></span>\n }\n <span class=\"truncate\">\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n </span>\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"isRowExpanded(row) ? 'Collapse row' : 'Expand row'\"\n [attr.aria-expanded]=\"isRowExpanded(row)\"\n (click)=\"toggleRowExpanded(row, $event)\"\n >\n @if (isRowExpanded(row)) {\n <ui-icon name=\"chevron-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevron-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n @if (!isDisabled(row)) {\n @for (slot of cellActionSlots(); track slot.id) {\n <ui-button\n variant=\"ghost\"\n size=\"icon\"\n class=\"h-8 w-8 pointer-coarse:size-11\"\n [ariaLabel]=\"slot.ariaLabel ?? 'Row actions'\"\n (click)=\"slot.onClick($event, getRowContext(row, rowIndex))\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"sm\" />\n </ui-button>\n }\n }\n } @else if (\n col.editable && isEditing(rowIndex, String(col.accessorKey))\n ) {\n <ng-container\n *ngTemplateOutlet=\"\n cellEditTpl;\n context: { $implicit: col, row: row, rowIndex: rowIndex }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n cellContentTpl;\n context: {\n $implicit: col,\n row: row,\n treeRow: treeRow,\n recycle: recycle,\n }\n \"\n ></ng-container>\n }\n </ng-template>\n\n <!-- Reusable: cell edit mode -->\n <ng-template #cellEditTpl let-col let-row=\"row\" let-rowIndex=\"rowIndex\">\n @let editErr = editErrorFor(rowIndex, col);\n @if (col.editComponent) {\n <div\n [uiComponentOutlet]=\"col.editComponent\"\n [inputs]=\"{ value: editValue(), row: row, column: col }\"\n [outputs]=\"{\n valueChange: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\"\n ></div>\n } @else if (col.editTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.editTemplate;\n context: {\n $implicit: editValue(),\n row: row,\n column: col,\n setValue: onEditValueChange.bind(this),\n commit: commitEdit.bind(this),\n cancel: cancelEdit.bind(this),\n }\n \"\n ></ng-container>\n } @else if (col.editType === \"checkbox\") {\n <ui-checkbox\n [checked]=\"!!editValue()\"\n [ariaInvalid]=\"editErr ? true : undefined\"\n [ariaDescribedby]=\"editErr ? cellEditErrorId : undefined\"\n (checkedChange)=\"onEditValueChange($event); commitEdit()\"\n />\n } @else if (col.editType === \"date\") {\n <ui-date-picker\n class=\"w-full\"\n [date]=\"editDateValue()\"\n (dateChange)=\"onEditDateChange($event)\"\n />\n } @else if (col.editType === \"select\" && col.editOptions) {\n <select\n data-edit-input\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (change)=\"onEditValueChange($any($event.target).value); commitEdit()\"\n (keydown)=\"onEditKeydown($event)\"\n >\n @for (opt of col.editOptions; track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n } @else {\n <input\n data-edit-input\n [type]=\"col.editType === 'number' ? 'number' : 'text'\"\n class=\"w-full h-full bg-background border-0 outline-none text-sm px-1 select-text\"\n [class.ring-1]=\"editErr\"\n [class.ring-inset]=\"editErr\"\n [class.ring-destructive]=\"editErr\"\n [attr.aria-invalid]=\"editErr ? true : null\"\n [attr.aria-describedby]=\"editErr ? cellEditErrorId : null\"\n [value]=\"editValue()\"\n (input)=\"onEditValueChange($any($event.target).value)\"\n (keydown)=\"onEditKeydown($event)\"\n (blur)=\"editingCell() ? commitEdit() : null\"\n />\n }\n @if (editErr) {\n <p\n [id]=\"cellEditErrorId\"\n class=\"mt-0.5 px-1 text-xs text-destructive\"\n role=\"alert\"\n data-slot=\"cell-edit-error\"\n >\n {{ editErr }}\n </p>\n }\n </ng-template>\n\n <!-- Reusable: row detail/expansion panel -->\n <ng-template #rowDetailTpl let-row>\n @if (rowDetailTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTemplate();\n context: { $implicit: row, row: row }\n \"\n ></ng-container>\n } @else if (rowDetailComponent()) {\n <div\n [uiComponentOutlet]=\"rowDetailComponent()!\"\n [inputs]=\"getRowDetailComponentInputs(row)\"\n ></div>\n } @else {\n <pre class=\"text-xs text-muted-foreground whitespace-pre-wrap\">{{\n row | json\n }}</pre>\n }\n </ng-template>\n\n <!-- Reusable: empty state -->\n <ng-template #emptyStateTpl>\n <ui-table-row class=\"hover:bg-transparent justify-center w-full\">\n <ui-table-cell\n class=\"h-48 sm:h-96 text-center w-full p-0 border-none justify-center\"\n >\n @if (emptyStateComponent()) {\n <ng-container\n [uiComponentOutlet]=\"emptyStateComponent()!\"\n [inputs]=\"emptyStateComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex h-full flex-col items-center justify-center py-10 text-center text-muted-foreground w-full\"\n >\n <ui-icon name=\"circle-off\" size=\"xl\" class=\"mb-4 opacity-20\" />\n <p>{{ noResultsLabel() }}</p>\n </div>\n }\n </ui-table-cell>\n </ui-table-row>\n </ng-template>\n\n @if (skeleton()) {\n <div class=\"flex flex-col w-full space-y-3\" data-slot=\"data-table-skeleton\">\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n @for (row of skeletonRowsArray(); track $index) {\n <ui-skeleton class=\"h-12 w-full rounded-md\" />\n }\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n </div>\n } @else {\n <!-- `relative`: the sr-only announcer and the sr-only cell labels below are\n position:absolute. Without a positioned ancestor their containing block\n is <html>, so they escape this table's scroll container entirely and\n stretch the document to their static position \u2014 which on a page with a\n virtual-scroll table adds a second, page-length scrollbar. -->\n <div class=\"relative flex flex-col w-full h-full space-y-4\">\n <output\n class=\"sr-only\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-slot=\"data-table-announcer\"\n >\n {{ srAnnouncement() }}\n </output>\n @if (showToolbar()) {\n <div class=\"flex flex-wrap items-center justify-between gap-2 flex-none\">\n <div class=\"flex flex-1 flex-wrap items-center gap-2\">\n <ui-input\n [placeholder]=\"filterPlaceholder()\"\n [ngModel]=\"globalFilter()\"\n (ngModelChange)=\"onFilterChange($event)\"\n class=\"h-8 w-full sm:w-[150px] lg:w-[250px]\"\n />\n @if (hasAi() && enableNlFilter()) {\n <div class=\"flex items-center gap-1\" data-slot=\"table-nl-filter\">\n <span aria-hidden=\"true\" class=\"text-sm\">\u2728</span>\n <ui-input\n [placeholder]=\"nlFilterPlaceholder()\"\n [ngModel]=\"aiFilterQuery()\"\n (ngModelChange)=\"aiFilterQuery.set($event)\"\n [disabled]=\"aiFilterRunning()\"\n (keydown.enter)=\"runAiFilter()\"\n class=\"h-8 w-full sm:w-[200px]\"\n />\n </div>\n }\n @if (enableAdvancedFilter()) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n data-slot=\"advanced-filter-trigger\"\n class=\"inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 pointer-coarse:h-11 pointer-coarse:min-w-11 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-icon name=\"filter\" size=\"xs\" />\n <span class=\"hidden sm:inline\">{{ filterBuilderLabels().filterButton }}</span>\n @if (advancedFilterCount() > 0) {\n <span class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground\">{{ advancedFilterCount() }}</span>\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-[min(420px,calc(100vw-2rem))] p-2\">\n <div class=\"space-y-2\">\n <ui-data-table-filter-builder\n [group]=\"advancedFilterGroup()\"\n [columns]=\"filterBuilderColumns()\"\n [labels]=\"filterBuilderLabels()\"\n (groupChange)=\"onAdvancedFilterChange($event)\"\n />\n @if (advancedFilterCount() > 0) {\n <button\n type=\"button\"\n class=\"text-xs text-muted-foreground hover:text-destructive\"\n (click)=\"clearAdvancedFilter()\"\n >{{ filterBuilderLabels().clearFilters }}</button>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n @if (showColumnVisibilityToggle() && hideableColumns().length > 0) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-input bg-background px-3 h-8 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\"\n [attr.aria-label]=\"toggleColumnsLabel()\"\n >\n {{ columnsLabel() }}\n </button>\n </ui-popover-trigger>\n <ui-popover-content class=\"w-56 p-2\">\n <div class=\"space-y-1\">\n @for (col of hideableColumns(); track col.accessorKey) {\n <div\n class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground\"\n >\n <ui-checkbox\n [checked]=\"isColumnVisible(col.accessorKey)\"\n (checkedChange)=\"\n setColumnVisibility(col.accessorKey, $event)\n \"\n [ariaLabel]=\"toggleColumnAriaLabel(col.header)\"\n />\n <span>{{ col.header }}</span>\n </div>\n }\n </div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n\n <div\n #scrollContainer\n class=\"rounded-md border relative flex-1 min-h-0 overflow-auto w-full\"\n [class.contain-strict]=\"isVirtualScrollActive()\"\n [class.will-change-scroll]=\"isVirtualScrollActive()\"\n [class.select-none]=\"enableCellRangeSelection()\"\n (keydown)=\"onTableKeydown($event)\"\n (click)=\"onTableClick()\"\n (mousedown)=\"onTableMouseDown($event)\"\n (scroll)=\"isVirtualScrollActive() ? onVirtualScroll($event) : null\"\n (dragover)=\"onContainerDragOver($event)\"\n (drop)=\"onRowDrop($event)\"\n tabindex=\"0\"\n >\n @if (isLoaderVisible()) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n @if (loaderTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n loaderTemplate();\n context: {\n $implicit: loadingTrigger(),\n trigger: loadingTrigger(),\n }\n \"\n ></ng-container>\n } @else if (loaderComponent()) {\n <ng-container\n [uiComponentOutlet]=\"loaderComponent()!\"\n [inputs]=\"resolvedLoaderComponentInputs()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>Loading...</span>\n </div>\n }\n </div>\n }\n @if (busyLabel(); as label) {\n <div\n class=\"absolute inset-0 z-40 flex items-center justify-center bg-background/70 backdrop-blur-[1px]\"\n >\n <div\n class=\"flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground\"\n >\n <span\n class=\"inline-block h-3 w-3 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground\"\n ></span>\n <span>{{ label }}</span>\n </div>\n </div>\n }\n <!-- #scrollContainer scrolls both axes. If ui-table kept its own\n overflow-x box (which forces overflow-y to auto too), the sticky\n header would stick inside it and scroll away, and its horizontal\n scrollbar would sit under the last row. -->\n <ui-table\n class=\"overflow-visible\"\n [role]=\"enableSubRows() ? 'treegrid' : 'grid'\"\n >\n <ui-table-header class=\"bg-background\">\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [class]=\"getHeaderClass(col)\"\n class=\"group/head\"\n [class.cursor-grab]=\"isColumnDraggable(col)\"\n [class.cursor-grabbing]=\"isDraggingColumn(col)\"\n [class.opacity-70]=\"isDraggingColumn(col)\"\n [class.relative]=\"isDropTargetColumn(col)\"\n [attr.data-column-id]=\"String(col.accessorKey)\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.draggable]=\"isColumnDraggable(col) ? 'true' : null\"\n [style]=\"getHeaderCellStyle(col)\"\n (dragstart)=\"onColumnDragStart($event, col)\"\n (dragover)=\"onColumnDragOver($event, col)\"\n (drop)=\"onColumnDrop($event, col)\"\n (dragend)=\"onColumnDragEnd()\"\n >\n @if (isDropTargetColumn(col)) {\n <div\n class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/70 bg-primary/10\"\n ></div>\n }\n <div class=\"flex items-center w-full h-full\">\n <div class=\"flex-1 min-w-0\">\n @if (col.accessorKey === \"_selection\") {\n <ui-checkbox\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isIndeterminate()\"\n (checkedChange)=\"toggleAll()\"\n ariaLabel=\"Select all\"\n />\n } @else if (col._isTreeExpanderHost) {\n <!-- gap-2 offsets the sort button's -ms-2, which would otherwise pull it over the expand-all button -->\n <div class=\"flex items-center gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n isAllSubRowsExpanded()\n ? 'Collapse all sub-rows'\n : 'Expand all sub-rows'\n \"\n (click)=\"\n isAllSubRowsExpanded()\n ? collapseAllSubRows()\n : expandAllSubRows(-1)\n \"\n >\n @if (isAllSubRowsExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n @if (col.enableSorting !== false) {\n <ui-data-table-column-header\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n } @else {\n <span>{{ col.header }}</span>\n }\n </div>\n } @else if (col.accessorKey === \"_expander\") {\n <button\n type=\"button\"\n class=\"inline-flex h-7 w-7 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n isAllExpanded()\n ? 'Collapse all rows'\n : 'Expand all rows'\n \"\n (click)=\"toggleAllExpanded()\"\n >\n @if (isAllExpanded()) {\n <ui-icon name=\"chevrons-up\" size=\"xs\" />\n } @else {\n <ui-icon name=\"chevrons-down\" size=\"xs\" />\n }\n </button>\n } @else if (col.accessorKey === \"_actions\") {\n <span class=\"sr-only\">Actions</span>\n } @else if (col.headerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.headerTemplate;\n context: { $implicit: col }\n \"\n ></ng-container>\n } @else if (col.enableSorting !== false) {\n <div class=\"flex items-center gap-2\">\n <!-- min-w-0: a narrow column truncates its title instead of sliding it under the filter and menu buttons -->\n <ui-data-table-column-header\n class=\"min-w-0\"\n [title]=\"col.header\"\n [column]=\"String(col.accessorKey)\"\n [direction]=\"getSortDirection(col.accessorKey)\"\n [sortIndex]=\"getSortIndex(col.accessorKey)\"\n (sortMeta)=\"\n onSortChange(\n col.accessorKey,\n $event.direction,\n $event.multi\n )\n \"\n />\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover [closeOnScroll]=\"true\">\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8 pointer-coarse:size-11\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n } @else {\n <div class=\"flex items-center gap-2\">\n <span>{{ col.header }}</span>\n @if (col.enableFiltering && col.filterComponent) {\n <ui-popover>\n <ui-popover-trigger>\n <button\n class=\"relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground h-8 w-8 pointer-coarse:size-11\"\n [class.text-primary]=\"\n isColumnFilterActive(col)\n \"\n [attr.aria-label]=\"'Filter ' + col.header\"\n >\n @if (isColumnFilterActive(col)) {\n <ui-icon\n name=\"filter\"\n size=\"sm\"\n weight=\"solid\"\n />\n } @else {\n <ui-icon name=\"filter\" size=\"sm\" />\n }\n </button>\n </ui-popover-trigger>\n <ui-popover-content\n class=\"w-80 max-w-[calc(100vw-2rem)]\"\n strategy=\"fixed\"\n align=\"end\"\n >\n <div\n [uiComponentOutlet]=\"col.filterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n </ui-popover-content>\n </ui-popover>\n }\n </div>\n }\n </div>\n @if (\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @for (slot of headerActionSlots(); track slot.id) {\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md opacity-0 group-hover/head:opacity-100 touch-visible pointer-coarse:size-11 hover:bg-accent hover:text-accent-foreground transition-opacity\"\n [attr.aria-label]=\"'Column menu for ' + col.header\"\n (click)=\"slot.onClick($event, col)\"\n >\n <ui-icon [name]=\"slot.icon ?? 'more-vertical'\" size=\"xs\" />\n </button>\n }\n }\n </div>\n @if (\n enableColumnResize() &&\n col.accessorKey !== \"_selection\"\n ) {\n <div\n class=\"group/resize absolute top-0 w-4 h-full cursor-col-resize touch-none z-40 select-none\"\n [class.right-0]=\"!isRtl()\"\n [class.translate-x-1/2]=\"!isRtl()\"\n [class.left-0]=\"isRtl()\"\n [class.-translate-x-1/2]=\"isRtl()\"\n (mousedown)=\"onResizeStart($event, col)\"\n (touchstart)=\"onResizeTouchStart($event, col)\"\n (dblclick)=\"onResizeDoubleClick($event, col)\"\n role=\"separator\"\n [attr.aria-label]=\"'Resize ' + col.header + ' column (double-click to auto-fit)'\"\n >\n <div\n [class]=\"resizeLineClass(col)\"\n aria-hidden=\"true\"\n ></div>\n </div>\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none\"\n [class]=\"getHeaderClass({ _width: 'auto' })\"\n ></ui-table-head>\n }\n </ui-table-row>\n @if (enableFloatingFilters() && hasAnyFloatingFilter()) {\n <ui-table-row class=\"border-0\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-head\n [role]=\"hasFloatingFilter(col) ? 'columnheader' : 'presentation'\"\n [style]=\"getHeaderCellStyle(col)\"\n class=\"sticky top-[var(--header-height,41px)] z-20 bg-muted/50 py-1 px-1 overflow-hidden pointer-coarse:h-auto\"\n >\n @if (\n col.floatingFilter !== false &&\n col.accessorKey !== \"_selection\" &&\n col.accessorKey !== \"_expander\" &&\n col.accessorKey !== \"_actions\"\n ) {\n @if (col.floatingFilterComponent) {\n <div\n [uiComponentOutlet]=\"col.floatingFilterComponent\"\n [inputs]=\"getFilterInputs(col)\"\n [outputs]=\"getFilterOutputs(col)\"\n ></div>\n } @else if (col.floatingFilterTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.floatingFilterTemplate;\n context: {\n $implicit: col,\n value: columnFilters()[String(col.accessorKey)],\n change: getFloatingFilterChange(col),\n }\n \"\n ></ng-container>\n } @else if (col.enableFiltering) {\n <ui-input\n class=\"h-7 text-xs\"\n [placeholder]=\"col.header\"\n [ngModel]=\"\n columnFilters()[String(col.accessorKey)] || ''\n \"\n (ngModelChange)=\"\n onColumnFilterChange(col.accessorKey, $event)\n \"\n />\n }\n }\n </ui-table-head>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-head\n role=\"presentation\"\n class=\"flex-1 pointer-events-none sticky top-[var(--header-height,41px)] z-20 bg-muted/50\"\n ></ui-table-head>\n }\n </ui-table-row>\n }\n </ui-table-header>\n <ui-table-body>\n @if (isVirtualScrollActive()) {\n <div\n [style.height.px]=\"virtualPaddingTop()\"\n class=\"flex-shrink-0\"\n ></div>\n @if (enableSubRows()) {\n @for (\n treeRow of virtualVisibleTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"\n isRowSelected(treeRow.row) ? 'selected' : null\n \"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"\n treeRow.isLeaf ? null : treeRow.isExpanded\n \"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : effectiveRowHeight()\n \"\n class=\"border-0\"\n >\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"\n getCellClass(\n col,\n getVirtualRowIndex(i),\n treeRow.depth\n )\n \"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: treeRow,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n }\n } @else {\n @for (\n row of virtualVisibleRows();\n track getRowId()(row);\n let i = $index\n ) {\n <ui-table-row\n #virtualRow\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"getVirtualRowIndex(i)\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.data-virtual-row-index]=\"getVirtualRowIndex(i)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, getVirtualRowIndex(i))\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n [style.height.px]=\"\n virtualVariableRowHeight() ? null : effectiveRowHeight()\n \"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(getVirtualRowIndex(i))) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of pinnedLeftColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingLeft()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (\n col of virtualVisibleMiddleColumns();\n track col.accessorKey\n ) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n <div\n [style.min-width.px]=\"virtualPaddingRight()\"\n class=\"flex-shrink-0\"\n ></div>\n @for (col of pinnedRightColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, getVirtualRowIndex(i))\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n (click)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.enter)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (keydown.space)=\"\n onCellClick(getVirtualRowIndex(i), col, $event)\n \"\n (dblclick)=\"\n onCellDblClick(getVirtualRowIndex(i), col, $event)\n \"\n (touchend)=\"\n onCellTouchEnd($event, getVirtualRowIndex(i), col)\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: row,\n rowIndex: getVirtualRowIndex(i),\n treeRow: null,\n recycle: virtualRecycleComponents(),\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n @if (virtualTotalRows() === 0) {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <div\n [style.height.px]=\"virtualPaddingBottom()\"\n class=\"flex-shrink-0\"\n ></div>\n } @else if (enableSubRows()) {\n @if (processedTreeRows().length > 0) {\n @for (\n treeRow of processedTreeRows();\n track getRowId()(treeRow.row);\n let i = $index\n ) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(treeRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(treeRow.row) || null\"\n [class.opacity-50]=\"isDisabled(treeRow.row)\"\n [class.opacity-30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-2]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(treeRow.row)\"\n [class.ring-inset]=\"isRowBeingDragged(treeRow.row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(treeRow.row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(treeRow.row)\"\n [attr.data-depth]=\"treeRow.depth\"\n [attr.aria-level]=\"treeRow.depth + 1\"\n [attr.aria-expanded]=\"treeRow.isLeaf ? null : treeRow.isExpanded\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(treeRow.row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, treeRow.row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0 relative\"\n >\n @switch (getDropEdge(i)) {\n @case ('top') {\n <div class=\"pointer-events-none absolute inset-x-0 top-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('bottom') {\n <div class=\"pointer-events-none absolute inset-x-0 bottom-0 z-30 h-0.5 bg-primary shadow-[0_0_4px_0] shadow-primary\"></div>\n }\n @case ('on') {\n <div class=\"pointer-events-none absolute inset-0 z-30 border-2 border-primary/50 rounded-sm bg-primary/5\"></div>\n }\n }\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i, treeRow.depth)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getTreeCellStyle(col, treeRow.depth)\"\n (click)=\"onCellClick(i, col, $event)\"\n (keydown.enter)=\"onCellClick(i, col, $event)\"\n (keydown.space)=\"onCellClick(i, col, $event)\"\n (dblclick)=\"onCellDblClick(i, col, $event)\"\n (touchend)=\"onCellTouchEnd($event, i, col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: treeRow.row,\n rowIndex: i,\n treeRow: treeRow,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(treeRow.row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n rowDetailTpl;\n context: { $implicit: treeRow.row }\n \"\n ></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (groupingActive()) {\n @if (pagedGroupedDisplayRows().length > 0) {\n @for (\n displayRow of pagedGroupedDisplayRows();\n track groupTrackBy(displayRow);\n let i = $index\n ) {\n @if (isGroupRow(displayRow)) {\n <ui-table-row\n class=\"border-0 bg-muted/40 cursor-pointer select-none\"\n data-slot=\"table-group-row\"\n [attr.data-group-key]=\"displayRow.groupKey\"\n [attr.aria-expanded]=\"!displayRow.collapsed\"\n (click)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.enter)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n (keydown.space)=\"toggleGroupCollapsed(displayRow.groupKey)\"\n >\n <ui-table-cell\n class=\"flex-1 border-b font-medium\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n <div class=\"flex flex-wrap items-center gap-2\">\n <button\n type=\"button\"\n class=\"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11\"\n [attr.aria-label]=\"\n displayRow.collapsed ? 'Expand group' : 'Collapse group'\n \"\n (click)=\"\n $event.stopPropagation();\n toggleGroupCollapsed(displayRow.groupKey)\n \"\n >\n <ui-icon\n [name]=\"isRtl() ? 'chevron-left' : 'chevron-right'\"\n size=\"xs\"\n class=\"transition-transform duration-200\"\n [class.rotate-90]=\"!displayRow.collapsed && !isRtl()\"\n [class.-rotate-90]=\"!displayRow.collapsed && isRtl()\"\n />\n </button>\n <span class=\"truncate\">{{ groupRowValueLabel(displayRow) }}</span>\n <span class=\"text-xs text-muted-foreground\">({{ displayRow.count }})</span>\n @if (groupAggregates()) {\n @for (entry of displayRow.aggregates | keyvalue: keepGroupAggregateOrder; track entry.key) {\n <span class=\"text-xs text-muted-foreground\">\n {{ groupAggregateLabel(entry.key) }}: {{ entry.value }}\n </span>\n }\n }\n </div>\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(displayRow.row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(displayRow.row) || null\"\n [class.opacity-50]=\"isDisabled(displayRow.row)\"\n [attr.data-row-id]=\"getRowId()(displayRow.row)\"\n data-slot=\"table-group-data-row\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col, i)\"\n [attr.data-column]=\"String(col.accessorKey)\"\n [style]=\"getCellStyle(col)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTpl;\n context: {\n $implicit: col,\n row: displayRow.row,\n rowIndex: i,\n treeRow: null,\n recycle: false,\n }\n \"\n ></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n [class]=\"getCellClass({ _width: 'auto' })\"\n ></ui-table-cell>\n }\n </ui-table-row>\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n } @else if (processedData().length > 0) {\n @for (\n row of (dragPreviewData() ?? processedData());\n track getRowId()(row);\n let i = $index\n ) {\n @if (isFullWidthRow(row)) {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n class=\"border-0\"\n >\n <ui-table-cell\n class=\"flex-1 border-b\"\n style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\"\n >\n @if (fullWidthRowTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n fullWidthRowTemplate();\n context: { $implicit: row, index: i }\n \"\n ></ng-container>\n } @else if (fullWidthRowComponent()) {\n <div\n [uiComponentOutlet]=\"fullWidthRowComponent()!\"\n [inputs]=\"{ row: row, index: i }\"\n ></div>\n }\n </ui-table-cell>\n </ui-table-row>\n } @else {\n <ui-table-row\n [attr.data-state]=\"isRowSelected(row) ? 'selected' : null\"\n [attr.data-disabled]=\"isDisabled(row) || null\"\n [class.opacity-50]=\"isDisabled(row)\"\n [class.opacity-30]=\"isRowBeingDragged(row)\"\n [class.ring-2]=\"isRowBeingDragged(row)\"\n [class.ring-primary/30]=\"isRowBeingDragged(row)\"\n [class.ring-inset]=\"isRowBeingDragged(row)\"\n [class.bg-primary/5]=\"isRowBeingDragged(row)\"\n [attr.data-row-index]=\"i\"\n [attr.data-row-id]=\"getRowId()(row)\"\n [attr.draggable]=\"enableRowDrag() && !isDisabled(row) ? 'true' : null\"\n (dragstart)=\"onRowDragStart($event, row)\"\n (dragover)=\"onRowDragOver($event, i)\"\n (drop)=\"onRowDrop($event)\"\n (dragend)=\"onRowDragEnd()\"\n class=\"border-0\"\n >\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell [class]=\"getCellClass(col, i)\" [attr.data-column]=\"String(col.accessorKey)\" [style]=\"getCellStyle(col)\" (click)=\"onCellClick(i, col, $event)\" (keydown.enter)=\"onCellClick(i, col, $event)\" (keydown.space)=\"onCellClick(i, col, $event)\" (dblclick)=\"onCellDblClick(i, col, $event)\" (touchend)=\"onCellTouchEnd($event, i, col)\">\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { $implicit: col, row: row, rowIndex: i, treeRow: null, recycle: false }\"></ng-container>\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell class=\"flex-1 pointer-events-none\" [class]=\"getCellClass({ _width: 'auto' })\"></ui-table-cell>\n }\n </ui-table-row>\n @if (enableRowExpansion() && isRowExpanded(row)) {\n <ui-table-row class=\"border-0 bg-muted/20\">\n <ui-table-cell class=\"flex-1 border-b\" style=\"min-width: 0; max-width: none; width: 100%; flex-basis: 100%;\">\n <ng-container *ngTemplateOutlet=\"rowDetailTpl; context: { $implicit: row }\"></ng-container>\n </ui-table-cell>\n </ui-table-row>\n }\n }\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"emptyStateTpl\"></ng-container>\n }\n <!-- A spacer that stretches the body to fill the container. It holds\n no data and cannot be reached, so it is hidden from assistive\n tech rather than counted as a row of the grid. -->\n <ui-table-row class=\"h-full\" aria-hidden=\"true\">\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [class]=\"getCellClass(col)\"\n [style]=\"getCellStyle(col)\"\n class=\"bg-background border-0 p-0\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </ui-table-body>\n @if (hasFooter()) {\n <div\n class=\"sticky bottom-0 z-20 bg-background border-t\"\n data-slot=\"table-footer\"\n >\n <ui-table-row>\n @for (col of enhancedColumns(); track col.accessorKey) {\n <ui-table-cell\n [style]=\"getCellStyle(col)\"\n class=\"whitespace-nowrap overflow-hidden text-ellipsis text-sm font-medium text-muted-foreground\"\n >\n @if (col.footerComponent) {\n <div\n [uiComponentOutlet]=\"col.footerComponent\"\n [inputs]=\"{\n column: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\"\n ></div>\n } @else if (col.footerTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n col.footerTemplate;\n context: {\n $implicit: col,\n rows: filteredData(),\n value:\n footerValues().get(String(col.accessorKey)) || '',\n }\n \"\n ></ng-container>\n } @else {\n {{ footerValues().get(String(col.accessorKey)) || \"\" }}\n }\n </ui-table-cell>\n }\n @if (!hasFlexibleColumns()) {\n <ui-table-cell\n class=\"flex-1 pointer-events-none\"\n ></ui-table-cell>\n }\n </ui-table-row>\n </div>\n }\n </ui-table>\n\n @if (enableFillHandle() && fillHandlePosition(); as pos) {\n <span\n data-slot=\"fill-handle\"\n class=\"absolute z-20 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 cursor-crosshair rounded-[2px] border border-background bg-primary\"\n style=\"touch-action: none;\"\n aria-hidden=\"true\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n (mousedown)=\"onFillHandleStart($event)\"\n (touchstart)=\"onFillHandleStart($event)\"\n ></span>\n }\n\n @if (enableRangeActions() && rangeSelectionStats(); as stats) {\n <div\n data-slot=\"range-actions\"\n class=\"sticky bottom-0 z-20 flex max-w-[calc(100vw-2rem)] flex-wrap items-center gap-x-4 gap-y-1 border-t bg-background/95 px-3 py-1.5 text-xs backdrop-blur-sm\"\n >\n <span class=\"text-muted-foreground\">{{ rangeLabels().count }}: <span class=\"text-foreground font-medium\">{{ stats.count }}</span></span>\n @if (stats.numericCount > 0) {\n <span class=\"text-muted-foreground\">{{ rangeLabels().sum }}: <span class=\"text-foreground font-medium\">{{ stats.sum }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().avg }}: <span class=\"text-foreground font-medium\">{{ stats.avg }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().min }}: <span class=\"text-foreground font-medium\">{{ stats.min }}</span></span>\n <span class=\"text-muted-foreground\">{{ rangeLabels().max }}: <span class=\"text-foreground font-medium\">{{ stats.max }}</span></span>\n @if (rangeChartPayload()) {\n <ui-button\n size=\"sm\"\n variant=\"outline\"\n class=\"ms-auto h-6 px-2 pointer-coarse:h-11\"\n [ariaLabel]=\"rangeLabels().chart\"\n (click)=\"openRangeChart()\"\n >\n <ui-icon name=\"bar-chart-3\" size=\"xs\" class=\"me-1\" />{{ rangeLabels().chart }}\n </ui-button>\n }\n }\n </div>\n }\n </div>\n\n @if (showPagination()) {\n <ui-data-table-pagination\n class=\"flex-none\"\n [total]=\"activeTotalItems()\"\n [state]=\"paginationState()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [showPageSizeSelector]=\"showPageSizeSelector()\"\n [rowsPerPageLabel]=\"rowsPerPageLabel()\"\n [pageLabel]=\"pageLabel()\"\n [ofLabel]=\"ofLabel()\"\n (paginationChange)=\"onPaginationChange($event)\"\n />\n }\n </div>\n } <!-- end @else skeleton -->\n", styles: [":host([data-ui-theme=\"neutral\"]){--primary: oklch(.205 0 0);--primary-foreground: oklch(.985 0 0);--ring: oklch(.708 0 0)}:host-context(.dark)[data-ui-theme=neutral]{--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--ring: oklch(.708 0 0)}:host([data-ui-theme=\"zinc\"]){--primary: oklch(.205 0 0);--primary-foreground: oklch(.985 0 0);--ring: oklch(.708 0 0)}:host-context(.dark)[data-ui-theme=zinc]{--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--ring: oklch(.708 0 0)}:host([data-ui-theme=\"slate\"]){--primary: oklch(.208 .042 265.755);--primary-foreground: oklch(.984 .003 247.858);--ring: oklch(.704 .04 256.788)}:host-context(.dark)[data-ui-theme=slate]{--primary: oklch(.929 .013 255.508);--primary-foreground: oklch(.208 .042 265.755);--ring: oklch(.704 .04 256.788)}:host([data-ui-theme=\"stone\"]){--primary: oklch(.216 .006 56.043);--primary-foreground: oklch(.985 .001 106.423);--ring: oklch(.709 .01 56.259)}:host-context(.dark)[data-ui-theme=stone]{--primary: oklch(.923 .003 48.717);--primary-foreground: oklch(.216 .006 56.043);--ring: oklch(.553 .013 58.071)}:host([data-ui-theme=\"gray\"]){--primary: oklch(.21 .028 264.532);--primary-foreground: oklch(.985 .002 247.839);--ring: oklch(.707 .022 264.436)}:host-context(.dark)[data-ui-theme=gray]{--primary: oklch(.928 .006 264.531);--primary-foreground: oklch(.21 .028 264.532);--ring: oklch(.551 .027 264.364)}:host([data-ui-theme=\"red\"]){--primary: oklch(.577 .245 27.325);--primary-foreground: oklch(.985 0 0);--ring: oklch(.577 .245 27.325)}:host-context(.dark)[data-ui-theme=red]{--primary: oklch(.577 .245 27.325);--primary-foreground: oklch(.985 0 0);--ring: oklch(.577 .245 27.325)}:host([data-ui-theme=\"rose\"]){--primary: oklch(.645 .246 16.439);--primary-foreground: oklch(.985 0 0);--ring: oklch(.645 .246 16.439)}:host-context(.dark)[data-ui-theme=rose]{--primary: oklch(.645 .246 16.439);--primary-foreground: oklch(.985 0 0);--ring: oklch(.645 .246 16.439)}:host([data-ui-theme=\"orange\"]){--primary: oklch(.646 .222 41.116);--primary-foreground: oklch(.985 0 0);--ring: oklch(.646 .222 41.116)}:host-context(.dark)[data-ui-theme=orange]{--primary: oklch(.646 .222 41.116);--primary-foreground: oklch(.985 0 0);--ring: oklch(.646 .222 41.116)}:host([data-ui-theme=\"green\"]){--primary: oklch(.623 .214 131.655);--primary-foreground: oklch(.985 0 0);--ring: oklch(.623 .214 131.655)}:host-context(.dark)[data-ui-theme=green]{--primary: oklch(.623 .214 131.655);--primary-foreground: oklch(.985 0 0);--ring: oklch(.623 .214 131.655)}:host([data-ui-theme=\"blue\"]){--primary: oklch(.546 .245 262.881);--primary-foreground: oklch(.985 0 0);--ring: oklch(.546 .245 262.881)}:host-context(.dark)[data-ui-theme=blue]{--primary: oklch(.546 .245 262.881);--primary-foreground: oklch(.985 0 0);--ring: oklch(.546 .245 262.881)}:host([data-ui-theme=\"yellow\"]){--primary: oklch(.82 .185 84.67);--primary-foreground: oklch(.205 0 0);--ring: oklch(.82 .185 84.67)}:host-context(.dark)[data-ui-theme=yellow]{--primary: oklch(.82 .185 84.67);--primary-foreground: oklch(.205 0 0);--ring: oklch(.82 .185 84.67)}:host([data-ui-theme=\"violet\"]){--primary: oklch(.558 .288 302.321);--primary-foreground: oklch(.985 0 0);--ring: oklch(.558 .288 302.321)}:host-context(.dark)[data-ui-theme=violet]{--primary: oklch(.558 .288 302.321);--primary-foreground: oklch(.985 0 0);--ring: oklch(.558 .288 302.321)}:host([data-ui-theme=\"amber\"]){--primary: oklch(.77 .16 70);--primary-foreground: oklch(.145 0 0);--ring: oklch(.77 .16 70)}:host-context(.dark)[data-ui-theme=amber]{--primary: oklch(.77 .16 70);--primary-foreground: oklch(.145 0 0);--ring: oklch(.77 .16 70)}\n"] }]
|
|
14411
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }, { type: i0.Output, args: ["dataChange"] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], showColumnVisibilityToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnVisibilityToggle", required: false }] }], showPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPagination", required: false }] }], showRowBorders: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowBorders", required: false }] }], showColumnBorders: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnBorders", required: false }] }], localSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "localSorting", required: false }] }], localPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "localPagination", required: false }] }], localFiltering: [{ type: i0.Input, args: [{ isSignal: true, alias: "localFiltering", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], skeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeleton", required: false }] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], loadingVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingVisibility", required: false }] }], loaderTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "loaderTemplate", required: false }] }], loaderComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "loaderComponent", required: false }] }], loaderComponentInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "loaderComponentInputs", required: false }] }], globalFilterFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFn", required: false }] }], enableMultiSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableMultiSort", required: false }] }], maxMultiSortColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxMultiSortColumns", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], multiSortChange: [{ type: i0.Output, args: ["multiSortChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], query: [{ type: i0.Output, args: ["query"] }], cellEdit: [{ type: i0.Output, args: ["cellEdit"] }], editError: [{ type: i0.Output, args: ["editError"] }], enableRowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRowSelection", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }, { type: i0.Output, args: ["rowSelectionChange"] }], getRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRowId", required: false }] }], enableCopy: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCopy", required: false }] }], isRowDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRowDisabled", required: false }] }], disabledRowIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledRowIds", required: false }] }], enableRowExpansion: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRowExpansion", required: false }] }], expandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRows", required: false }] }, { type: i0.Output, args: ["expandedRowsChange"] }], rowDetailTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailTemplate", required: false }] }], rowDetailComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailComponent", required: false }] }], rowDetailComponentInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailComponentInputs", required: false }] }], enableSubRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSubRows", required: false }] }], getChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "getChildren", required: false }] }], setChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "setChildren", required: false }] }], subRowDefaultExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowDefaultExpanded", required: false }] }], subRowSelectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowSelectionMode", required: false }] }], subRowFilterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowFilterMode", required: false }] }], enableSubRowSorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSubRowSorting", required: false }] }], subRowIndentSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowIndentSize", required: false }] }], subRowsPaginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowsPaginated", required: false }] }], subRowExpandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "subRowExpandedRows", required: false }] }, { type: i0.Output, args: ["subRowExpandedRowsChange"] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }], collapsedGroups: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroups", required: false }] }, { type: i0.Output, args: ["collapsedGroupsChange"] }], groupAggregates: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupAggregates", required: false }] }], enableColumnResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableColumnResize", required: false }] }], enableColumnReorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableColumnReorder", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], enableFloatingFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableFloatingFilters", required: false }] }], enableRowDrag: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRowDrag", required: false }] }], localReorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "localReorder", required: false }] }], rowDragMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDragMode", required: false }] }], rowDragAllowDrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDragAllowDrop", required: false }] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], enableCellFlash: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCellFlash", required: false }] }], cellFlashDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellFlashDuration", required: false }] }], enableCellRangeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCellRangeSelection", required: false }] }], enableRangeActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableRangeActions", required: false }] }], rangeChartOpen: [{ type: i0.Output, args: ["rangeChartOpen"] }], enableFillHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableFillHandle", required: false }] }], fillSeries: [{ type: i0.Output, args: ["fillSeries"] }], enableClipboardPaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableClipboardPaste", required: false }] }], cellsPaste: [{ type: i0.Output, args: ["cellsPaste"] }], enableEditHistory: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableEditHistory", required: false }] }], editUndo: [{ type: i0.Output, args: ["editUndo"] }], editRedo: [{ type: i0.Output, args: ["editRedo"] }], columnResize: [{ type: i0.Output, args: ["columnResize"] }], emptyStateComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateComponent", required: false }] }], emptyStateComponentInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateComponentInputs", required: false }] }], fullWidthRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidthRow", required: false }] }], fullWidthRowTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidthRowTemplate", required: false }] }], fullWidthRowComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidthRowComponent", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], filterDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterDebounce", required: false }] }], enableVirtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableVirtualScroll", required: false }] }], virtualRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRowHeight", required: false }] }], virtualRowBuffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRowBuffer", required: false }] }], virtualColumnBuffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualColumnBuffer", required: false }] }], virtualVariableRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualVariableRowHeight", required: false }] }], virtualRecycleComponents: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualRecycleComponents", required: false }] }], virtualAutoThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualAutoThreshold", required: false }] }], virtualAutoColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualAutoColumnWidth", required: false }] }], scrollContainerRef: [{ type: i0.ViewChild, args: ["scrollContainer", { isSignal: true }] }], virtualRowElements: [{ type: i0.ViewChildren, args: ["virtualRow", { ...{
|
|
14090
14412
|
read: ElementRef,
|
|
14091
14413
|
}, isSignal: true }] }], globalFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilter", required: false }] }, { type: i0.Output, args: ["globalFilterChange"] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], aiProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "aiProvider", required: false }] }], nlFilter: [{ type: i0.Output, args: ["nlFilter"] }], aiFillComplete: [{ type: i0.Output, args: ["aiFillComplete"] }], enableNlFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableNlFilter", required: false }] }], advancedFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "advancedFilter", required: false }] }, { type: i0.Output, args: ["advancedFilterChange"] }], enableAdvancedFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableAdvancedFilter", required: false }] }], sortState: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortState", required: false }] }, { type: i0.Output, args: ["sortStateChange"] }], multiSortState: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSortState", required: false }] }, { type: i0.Output, args: ["multiSortStateChange"] }], paginationState: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationState", required: false }] }, { type: i0.Output, args: ["paginationStateChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPageSizeSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSizeSelector", required: false }] }], columnWidths: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidths", required: false }] }, { type: i0.Output, args: ["columnWidthsChange"] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], columnOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnOrder", required: false }] }, { type: i0.Output, args: ["columnOrderChange"] }] } });
|
|
14092
14414
|
|
|
@@ -14369,9 +14691,8 @@ class CommandService {
|
|
|
14369
14691
|
}
|
|
14370
14692
|
/**
|
|
14371
14693
|
* Mirror of {@link moveNext} for ArrowUp: steps backwards through the filtered
|
|
14372
|
-
* items and wraps from the first to the last. With nothing active it
|
|
14373
|
-
* the
|
|
14374
|
-
* not the last.
|
|
14694
|
+
* items and wraps from the first to the last. With nothing active it starts at
|
|
14695
|
+
* the last item.
|
|
14375
14696
|
*/
|
|
14376
14697
|
movePrev() {
|
|
14377
14698
|
const items = this.filteredItems();
|
|
@@ -14379,7 +14700,8 @@ class CommandService {
|
|
|
14379
14700
|
return;
|
|
14380
14701
|
const current = this.activeItemId();
|
|
14381
14702
|
const idx = current ? items.indexOf(current) : -1;
|
|
14382
|
-
|
|
14703
|
+
// idx -1 (nothing active) must not step to -2, which wraps to the second-to-last item.
|
|
14704
|
+
const prevIdx = idx <= 0 ? items.length - 1 : idx - 1;
|
|
14383
14705
|
this.activeItemId.set(items[prevIdx]);
|
|
14384
14706
|
}
|
|
14385
14707
|
/**
|
|
@@ -14851,7 +15173,12 @@ class CommandItemComponent {
|
|
|
14851
15173
|
this.id = generateId();
|
|
14852
15174
|
this.cmdService = inject(CommandService);
|
|
14853
15175
|
this.group = inject(COMMAND_GROUP, { optional: true });
|
|
14854
|
-
|
|
15176
|
+
/**
|
|
15177
|
+
* The rendered row. Scrolling targets it rather than the host, because the
|
|
15178
|
+
* host is `display: contents` — it has no box, so `scrollIntoView()` on it is a
|
|
15179
|
+
* no-op and the highlight would slide out of the list's scroll viewport.
|
|
15180
|
+
*/
|
|
15181
|
+
this.row = viewChild.required('row');
|
|
14855
15182
|
this.isActive = computed(() => this.cmdService.activeItemId() === this.id, ...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
14856
15183
|
this.classes = computed(() => cn('relative flex cursor-pointer select-none items-center rounded-sm text-sm outline-none', 'hover:bg-accent hover:text-accent-foreground', 'focus:bg-accent focus:text-accent-foreground', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', this.isActive() && 'bg-accent text-accent-foreground', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
14857
15184
|
this.isVisible = computed(() => {
|
|
@@ -14859,7 +15186,9 @@ class CommandItemComponent {
|
|
|
14859
15186
|
}, ...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
|
|
14860
15187
|
effect(() => {
|
|
14861
15188
|
if (this.isActive()) {
|
|
14862
|
-
|
|
15189
|
+
// Optional call: jsdom (a consumer's unit tests) has no scrollIntoView,
|
|
15190
|
+
// and a missing scroll must not break keyboard highlighting.
|
|
15191
|
+
this.row().nativeElement.scrollIntoView?.({ block: 'nearest' });
|
|
14863
15192
|
}
|
|
14864
15193
|
});
|
|
14865
15194
|
}
|
|
@@ -14883,8 +15212,9 @@ class CommandItemComponent {
|
|
|
14883
15212
|
}
|
|
14884
15213
|
}
|
|
14885
15214
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CommandItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14886
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CommandItemComponent, isStandalone: true, selector: "ui-command-item", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, shortcut: { classPropertyName: "shortcut", publicName: "shortcut", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectItem: "selectItem" }, host: { classAttribute: "contents" }, ngImport: i0, template: `
|
|
15215
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CommandItemComponent, isStandalone: true, selector: "ui-command-item", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, shortcut: { classPropertyName: "shortcut", publicName: "shortcut", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectItem: "selectItem" }, host: { classAttribute: "contents" }, viewQueries: [{ propertyName: "row", first: true, predicate: ["row"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
14887
15216
|
<div
|
|
15217
|
+
#row
|
|
14888
15218
|
[class]="classes()"
|
|
14889
15219
|
[attr.id]="id"
|
|
14890
15220
|
[attr.data-slot]="'command-item'"
|
|
@@ -14907,6 +15237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
14907
15237
|
type: Component,
|
|
14908
15238
|
args: [{ selector: 'ui-command-item', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
14909
15239
|
<div
|
|
15240
|
+
#row
|
|
14910
15241
|
[class]="classes()"
|
|
14911
15242
|
[attr.id]="id"
|
|
14912
15243
|
[attr.data-slot]="'command-item'"
|
|
@@ -14924,7 +15255,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
14924
15255
|
}
|
|
14925
15256
|
</div>
|
|
14926
15257
|
`, host: { class: 'contents' }, styles: [":host{--_d: var(--density-menu, var(--density, 1))}@layer components{[data-slot=command-item]{padding-inline:calc(.5rem * var(--_d));padding-block:calc(.375rem * var(--_d))}}\n"] }]
|
|
14927
|
-
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], shortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "shortcut", required: false }] }], selectItem: [{ type: i0.Output, args: ["selectItem"] }] } });
|
|
15258
|
+
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], shortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "shortcut", required: false }] }], selectItem: [{ type: i0.Output, args: ["selectItem"] }], row: [{ type: i0.ViewChild, args: ['row', { isSignal: true }] }] } });
|
|
14928
15259
|
|
|
14929
15260
|
class CommandSeparatorComponent {
|
|
14930
15261
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CommandSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -15233,7 +15564,7 @@ class DialogContentComponent {
|
|
|
15233
15564
|
}
|
|
15234
15565
|
}
|
|
15235
15566
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15236
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DialogContentComponent, isStandalone: true, selector: "ui-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute
|
|
15567
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DialogContentComponent, isStandalone: true, selector: "ui-dialog-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"], dependencies: [{ kind: "component", type: DialogHeaderComponent, selector: "ui-dialog-header" }, { kind: "component", type: DialogTitleComponent, selector: "ui-dialog-title" }, { kind: "component", type: DialogDescriptionComponent, selector: "ui-dialog-description" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15237
15568
|
}
|
|
15238
15569
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
15239
15570
|
type: Component,
|
|
@@ -15241,7 +15572,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
15241
15572
|
DialogHeaderComponent,
|
|
15242
15573
|
DialogTitleComponent,
|
|
15243
15574
|
DialogDescriptionComponent,
|
|
15244
|
-
], host: { class: 'contents' }, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute
|
|
15575
|
+
], host: { class: 'contents' }, template: "@if (dialog?.open()) {\n <div class=\"fixed inset-0 z-50 flex items-center justify-center\" [attr.dir]=\"dir()\">\n <!-- Overlay -->\n <button\n type=\"button\"\n class=\"fixed inset-0 bg-black/80 animate-in fade-in-0\"\n [attr.data-slot]=\"'dialog-overlay'\"\n [attr.aria-label]=\"t().close\"\n (click)=\"onOverlayClick()\"\n ></button>\n <!-- Content -->\n <div\n #contentEl\n [class]=\"classes()\"\n [attr.data-slot]=\"'dialog-content'\"\n (keydown)=\"onKeydown($event)\"\n tabindex=\"-1\"\n >\n @if (title()) {\n <ui-dialog-header>\n <ui-dialog-title>{{ title() }}</ui-dialog-title>\n @if (description()) {\n <ui-dialog-description>{{ description() }}</ui-dialog-description>\n }\n </ui-dialog-header>\n }\n <ng-content />\n <!-- Close button -->\n <button\n type=\"button\"\n class=\"absolute end-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none pointer-coarse:end-0.5 pointer-coarse:top-0.5 pointer-coarse:size-11\"\n [attr.aria-label]=\"t().close\"\n (click)=\"close()\"\n >\n <svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n <span class=\"sr-only\">{{ t().close }}</span>\n </button>\n </div>\n </div>\n}\n", styles: [":host{--_d: var(--density-dialog, var(--density, 1))}@layer components{[data-slot=dialog-content]{gap:calc(.75rem * var(--_d));padding:calc(1rem * var(--_d))}@media(min-width:640px){[data-slot=dialog-content]{gap:calc(1rem * var(--_d));padding:calc(1.5rem * var(--_d))}}}\n"] }]
|
|
15245
15576
|
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }] } });
|
|
15246
15577
|
|
|
15247
15578
|
class DialogFooterComponent {
|
|
@@ -16222,7 +16553,7 @@ class DataTableMultiselectFilterComponent {
|
|
|
16222
16553
|
this.filterChange.emit([...selected]);
|
|
16223
16554
|
}
|
|
16224
16555
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableMultiselectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16225
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableMultiselectFilterComponent, isStandalone: true, selector: "ui-data-table-multiselect-filter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, valueWith: { classPropertyName: "valueWith", publicName: "valueWith", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'multiselect-filter'\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-2 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n @if (selectedCount() > 0) {\n <ui-badge variant=\"secondary\" [label]=\"String(selectedCount())\" class=\"text-xs\" />\n }\n </div>\n }\n <ui-command [shouldFilter]=\"true\" [attr.dir]=\"dir()\">\n <ui-command-input [placeholder]=\"resolvedPlaceholder()\" />\n <div class=\"flex items-center gap-1 px-2 py-1.5\">\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"selectAll()\">\n {{ selectAllLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"clearAll()\">\n {{ clearAllLabel() }}\n </ui-button>\n </div>\n <ui-command-separator />\n <ui-command-list class=\"max-h-64\">\n <ui-command-empty>{{ noResultsLabel() }}</ui-command-empty>\n @for (option of options(); track trackOption(option)) {\n <ui-command-item\n [value]=\"getDisplayLabel(option)\"\n (selectItem)=\"toggleOption(option)\"\n class=\"gap-2\"\n >\n <ui-checkbox\n [checked]=\"isSelected(option)\"\n [ariaLabel]=\"getDisplayLabel(option)\"\n />\n <span>{{ getDisplayLabel(option) }}</span>\n </ui-command-item>\n }\n </ui-command-list>\n </ui-command>\n</div>\n", dependencies: [{ kind: "component", type: CommandComponent, selector: "ui-command", inputs: ["class", "shouldFilter", "search", "source", "debounce", "recentKey", "recentLimit"] }, { kind: "component", type: CommandInputComponent, selector: "ui-command-input", inputs: ["placeholder", "ariaLabel", "value", "locale"] }, { kind: "component", type: CommandListComponent, selector: "ui-command-list", inputs: ["class", "ariaLabel"] }, { kind: "component", type: CommandEmptyComponent, selector: "ui-command-empty" }, { kind: "component", type: CommandItemComponent, selector: "ui-command-item", inputs: ["class", "disabled", "selected", "value", "shortcut"], outputs: ["selectItem"] }, { kind: "component", type: CommandSeparatorComponent, selector: "ui-command-separator" }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["disabled", "class", "skeleton", "elementId", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaInvalid", "checked", "indeterminate", "label"], outputs: ["checkedChange"] }, { kind: "component", type: BadgeComponent, selector: "ui-badge", inputs: ["variant", "label", "class", "skeleton"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16556
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableMultiselectFilterComponent, isStandalone: true, selector: "ui-data-table-multiselect-filter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, valueWith: { classPropertyName: "valueWith", publicName: "valueWith", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'multiselect-filter'\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-2 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n @if (selectedCount() > 0) {\n <ui-badge variant=\"secondary\" [label]=\"String(selectedCount())\" class=\"text-xs\" />\n }\n </div>\n }\n <ui-command [shouldFilter]=\"true\" [attr.dir]=\"dir()\">\n <ui-command-input [placeholder]=\"resolvedPlaceholder()\" />\n <div class=\"flex items-center gap-1 px-2 py-1.5\">\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"selectAll()\">\n {{ selectAllLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"clearAll()\">\n {{ clearAllLabel() }}\n </ui-button>\n </div>\n <ui-command-separator />\n <ui-command-list class=\"max-h-64\">\n <ui-command-empty>{{ noResultsLabel() }}</ui-command-empty>\n @for (option of options(); track trackOption(option)) {\n <ui-command-item\n [value]=\"getDisplayLabel(option)\"\n (selectItem)=\"toggleOption(option)\"\n class=\"gap-2\"\n >\n <ui-checkbox\n [checked]=\"isSelected(option)\"\n [ariaLabel]=\"getDisplayLabel(option)\"\n />\n <span>{{ getDisplayLabel(option) }}</span>\n </ui-command-item>\n }\n </ui-command-list>\n </ui-command>\n</div>\n", dependencies: [{ kind: "component", type: CommandComponent, selector: "ui-command", inputs: ["class", "shouldFilter", "search", "source", "debounce", "recentKey", "recentLimit"] }, { kind: "component", type: CommandInputComponent, selector: "ui-command-input", inputs: ["placeholder", "ariaLabel", "value", "locale"] }, { kind: "component", type: CommandListComponent, selector: "ui-command-list", inputs: ["class", "ariaLabel"] }, { kind: "component", type: CommandEmptyComponent, selector: "ui-command-empty" }, { kind: "component", type: CommandItemComponent, selector: "ui-command-item", inputs: ["class", "disabled", "selected", "value", "shortcut"], outputs: ["selectItem"] }, { kind: "component", type: CommandSeparatorComponent, selector: "ui-command-separator" }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["disabled", "class", "skeleton", "elementId", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaInvalid", "checked", "indeterminate", "label"], outputs: ["checkedChange"] }, { kind: "component", type: BadgeComponent, selector: "ui-badge", inputs: ["variant", "label", "class", "skeleton"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16226
16557
|
}
|
|
16227
16558
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableMultiselectFilterComponent, decorators: [{
|
|
16228
16559
|
type: Component,
|
|
@@ -16236,7 +16567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
16236
16567
|
CheckboxComponent,
|
|
16237
16568
|
BadgeComponent,
|
|
16238
16569
|
ButtonComponent,
|
|
16239
|
-
], host: { class: 'contents' }, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'multiselect-filter'\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-2 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n @if (selectedCount() > 0) {\n <ui-badge variant=\"secondary\" [label]=\"String(selectedCount())\" class=\"text-xs\" />\n }\n </div>\n }\n <ui-command [shouldFilter]=\"true\" [attr.dir]=\"dir()\">\n <ui-command-input [placeholder]=\"resolvedPlaceholder()\" />\n <div class=\"flex items-center gap-1 px-2 py-1.5\">\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"selectAll()\">\n {{ selectAllLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"clearAll()\">\n {{ clearAllLabel() }}\n </ui-button>\n </div>\n <ui-command-separator />\n <ui-command-list class=\"max-h-64\">\n <ui-command-empty>{{ noResultsLabel() }}</ui-command-empty>\n @for (option of options(); track trackOption(option)) {\n <ui-command-item\n [value]=\"getDisplayLabel(option)\"\n (selectItem)=\"toggleOption(option)\"\n class=\"gap-2\"\n >\n <ui-checkbox\n [checked]=\"isSelected(option)\"\n [ariaLabel]=\"getDisplayLabel(option)\"\n />\n <span>{{ getDisplayLabel(option) }}</span>\n </ui-command-item>\n }\n </ui-command-list>\n </ui-command>\n</div>\n" }]
|
|
16570
|
+
], host: { class: 'contents' }, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'multiselect-filter'\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-2 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n @if (selectedCount() > 0) {\n <ui-badge variant=\"secondary\" [label]=\"String(selectedCount())\" class=\"text-xs\" />\n }\n </div>\n }\n <ui-command [shouldFilter]=\"true\" [attr.dir]=\"dir()\">\n <ui-command-input [placeholder]=\"resolvedPlaceholder()\" />\n <div class=\"flex items-center gap-1 px-2 py-1.5\">\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"selectAll()\">\n {{ selectAllLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"clearAll()\">\n {{ clearAllLabel() }}\n </ui-button>\n </div>\n <ui-command-separator />\n <ui-command-list class=\"max-h-64\">\n <ui-command-empty>{{ noResultsLabel() }}</ui-command-empty>\n @for (option of options(); track trackOption(option)) {\n <ui-command-item\n [value]=\"getDisplayLabel(option)\"\n (selectItem)=\"toggleOption(option)\"\n class=\"gap-2\"\n >\n <ui-checkbox\n [checked]=\"isSelected(option)\"\n [ariaLabel]=\"getDisplayLabel(option)\"\n />\n <span>{{ getDisplayLabel(option) }}</span>\n </ui-command-item>\n }\n </ui-command-list>\n </ui-command>\n</div>\n" }]
|
|
16240
16571
|
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], displayWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayWith", required: false }] }], valueWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueWith", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }] } });
|
|
16241
16572
|
function multiselectFilterFn(row, filterValue, getValue) {
|
|
16242
16573
|
if (!filterValue || filterValue.length === 0)
|
|
@@ -16246,15 +16577,6 @@ function multiselectFilterFn(row, filterValue, getValue) {
|
|
|
16246
16577
|
}
|
|
16247
16578
|
|
|
16248
16579
|
/** Shared date helpers for the data-table date filter sub-components. */
|
|
16249
|
-
function toDate(value) {
|
|
16250
|
-
if (value instanceof Date)
|
|
16251
|
-
return value;
|
|
16252
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
16253
|
-
const d = new Date(value);
|
|
16254
|
-
return Number.isNaN(d.getTime()) ? null : d;
|
|
16255
|
-
}
|
|
16256
|
-
return null;
|
|
16257
|
-
}
|
|
16258
16580
|
function toDateOnlyTimestamp(d) {
|
|
16259
16581
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
|
|
16260
16582
|
}
|
|
@@ -16326,16 +16648,16 @@ class DataTableDateFilterComponent {
|
|
|
16326
16648
|
this.filterChange.emit(null);
|
|
16327
16649
|
}
|
|
16328
16650
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16329
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableDateFilterComponent, isStandalone: true, selector: "ui-data-table-date-filter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex items-center gap-1 px-3 pb-2\">\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"selectToday()\">\n {{ todayLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"single\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onDateSelect($event)\"\n />\n</div>\n", dependencies: [{ kind: "component", type: CalendarComponent, selector: "ui-calendar", inputs: ["class", "mode", "showMonthSelect", "showYearSelect", "showTimeSelect", "timeMode", "weekStartsOn", "rtl", "locale", "selected", "selectedTimeRange"], outputs: ["rtlChange", "selectedChange", "selectedTimeRangeChange"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16651
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableDateFilterComponent, isStandalone: true, selector: "ui-data-table-date-filter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex items-center gap-1 px-3 pb-2\">\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"selectToday()\">\n {{ todayLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"single\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onDateSelect($event)\"\n />\n</div>\n", dependencies: [{ kind: "component", type: CalendarComponent, selector: "ui-calendar", inputs: ["class", "mode", "showMonthSelect", "showYearSelect", "showTimeSelect", "timeMode", "weekStartsOn", "rtl", "locale", "selected", "selectedTimeRange"], outputs: ["rtlChange", "selectedChange", "selectedTimeRangeChange"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16330
16652
|
}
|
|
16331
16653
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateFilterComponent, decorators: [{
|
|
16332
16654
|
type: Component,
|
|
16333
|
-
args: [{ selector: 'ui-data-table-date-filter', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CalendarComponent, ButtonComponent], host: { class: 'contents' }, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex items-center gap-1 px-3 pb-2\">\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"selectToday()\">\n {{ todayLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"single\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onDateSelect($event)\"\n />\n</div>\n" }]
|
|
16655
|
+
args: [{ selector: 'ui-data-table-date-filter', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CalendarComponent, ButtonComponent], host: { class: 'contents' }, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex items-center gap-1 px-3 pb-2\">\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"selectToday()\">\n {{ todayLabel() }}\n </ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"single\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onDateSelect($event)\"\n />\n</div>\n" }]
|
|
16334
16656
|
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }] } });
|
|
16335
16657
|
function dateFilterFn(row, filterValue, getValue) {
|
|
16336
16658
|
if (!filterValue)
|
|
16337
16659
|
return true;
|
|
16338
|
-
const cellDate =
|
|
16660
|
+
const cellDate = asEditableDate(getValue(row));
|
|
16339
16661
|
if (!cellDate)
|
|
16340
16662
|
return false;
|
|
16341
16663
|
return toDateOnlyTimestamp(cellDate) === toDateOnlyTimestamp(filterValue);
|
|
@@ -16429,11 +16751,11 @@ class DataTableDateRangeFilterComponent {
|
|
|
16429
16751
|
this.filterChange.emit(null);
|
|
16430
16752
|
}
|
|
16431
16753
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateRangeFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16432
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableDateRangeFilterComponent, isStandalone: true, selector: "ui-data-table-date-range-filter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-range-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex flex-wrap items-center gap-1 px-3 pb-2\">\n @for (preset of effectivePresets(); track preset.label) {\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"applyPreset(preset)\">\n {{ preset.label }}\n </ui-button>\n }\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"range\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onRangeSelect($event)\"\n />\n</div>\n", dependencies: [{ kind: "component", type: CalendarComponent, selector: "ui-calendar", inputs: ["class", "mode", "showMonthSelect", "showYearSelect", "showTimeSelect", "timeMode", "weekStartsOn", "rtl", "locale", "selected", "selectedTimeRange"], outputs: ["rtlChange", "selectedChange", "selectedTimeRangeChange"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16754
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DataTableDateRangeFilterComponent, isStandalone: true, selector: "ui-data-table-date-range-filter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, presets: { classPropertyName: "presets", publicName: "presets", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-range-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex flex-wrap items-center gap-1 px-3 pb-2\">\n @for (preset of effectivePresets(); track preset.label) {\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"applyPreset(preset)\">\n {{ preset.label }}\n </ui-button>\n }\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"range\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onRangeSelect($event)\"\n />\n</div>\n", dependencies: [{ kind: "component", type: CalendarComponent, selector: "ui-calendar", inputs: ["class", "mode", "showMonthSelect", "showYearSelect", "showTimeSelect", "timeMode", "weekStartsOn", "rtl", "locale", "selected", "selectedTimeRange"], outputs: ["rtlChange", "selectedChange", "selectedTimeRangeChange"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["variant", "size", "disabled", "type", "class", "ariaLabel", "aria-expanded", "aria-pressed", "aria-haspopup", "aria-controls", "label", "ripple", "rippleColor", "loading", "skeleton"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16433
16755
|
}
|
|
16434
16756
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateRangeFilterComponent, decorators: [{
|
|
16435
16757
|
type: Component,
|
|
16436
|
-
args: [{ selector: 'ui-data-table-date-range-filter', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CalendarComponent, ButtonComponent], host: { class: 'contents' }, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-range-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex flex-wrap items-center gap-1 px-3 pb-2\">\n @for (preset of effectivePresets(); track preset.label) {\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"applyPreset(preset)\">\n {{ preset.label }}\n </ui-button>\n }\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"range\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onRangeSelect($event)\"\n />\n</div>\n" }]
|
|
16758
|
+
args: [{ selector: 'ui-data-table-date-range-filter', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CalendarComponent, ButtonComponent], host: { class: 'contents' }, template: "<div [class]=\"classes()\" [attr.data-slot]=\"'date-range-filter'\" [attr.dir]=\"dir()\">\n @if (title()) {\n <div class=\"flex items-center justify-between px-3 pb-2\">\n <span class=\"text-sm font-medium\">{{ title() }}</span>\n </div>\n }\n <div class=\"flex flex-wrap items-center gap-1 px-3 pb-2\">\n @for (preset of effectivePresets(); track preset.label) {\n <ui-button variant=\"outline\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"applyPreset(preset)\">\n {{ preset.label }}\n </ui-button>\n }\n <ui-button variant=\"ghost\" size=\"sm\" class=\"h-7 pointer-coarse:h-11 text-xs\" (clicked)=\"clear()\">\n {{ clearLabel() }}\n </ui-button>\n </div>\n <ui-calendar\n mode=\"range\"\n [selected]=\"selectedValue()\"\n [showMonthSelect]=\"true\"\n [showYearSelect]=\"true\"\n [locale]=\"locale()\"\n class=\"border-0 rounded-none\"\n (selectedChange)=\"onRangeSelect($event)\"\n />\n</div>\n" }]
|
|
16437
16759
|
}], ctorParameters: () => [], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], presets: [{ type: i0.Input, args: [{ isSignal: true, alias: "presets", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }] } });
|
|
16438
16760
|
function buildDefaultPresets(locale) {
|
|
16439
16761
|
const today = new Date();
|
|
@@ -16471,7 +16793,7 @@ function dateRangeFilterFn(row, filterValue, getValue) {
|
|
|
16471
16793
|
return true;
|
|
16472
16794
|
if (!filterValue.start && !filterValue.end)
|
|
16473
16795
|
return true;
|
|
16474
|
-
const cellDate =
|
|
16796
|
+
const cellDate = asEditableDate(getValue(row));
|
|
16475
16797
|
if (!cellDate)
|
|
16476
16798
|
return false;
|
|
16477
16799
|
const cellTs = toDateOnlyTimestamp(cellDate);
|
|
@@ -16537,9 +16859,11 @@ class ContextMenuContentComponent {
|
|
|
16537
16859
|
* (`min-w-[8rem]`, popover colours, `max-w-[calc(100vw-16px)]` /
|
|
16538
16860
|
* `max-h-[calc(100vh-16px)]` scroll clamps, enter animation). The panel is
|
|
16539
16861
|
* portalled to `document.body` with `position: fixed` and `z-index: 9999`,
|
|
16540
|
-
* so
|
|
16541
|
-
*
|
|
16542
|
-
*
|
|
16862
|
+
* so apart from the theme tokens and the host's resolved `dir`, which are
|
|
16863
|
+
* copied onto the portal, it inherits nothing from the host — width,
|
|
16864
|
+
* padding and colours must be set here rather than on an ancestor. Avoid
|
|
16865
|
+
* overriding `position`/`left`/`top`: they are re-applied from the clamped
|
|
16866
|
+
* coordinates on every open.
|
|
16543
16867
|
*/
|
|
16544
16868
|
this.class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
16545
16869
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
@@ -16569,6 +16893,10 @@ class ContextMenuContentComponent {
|
|
|
16569
16893
|
this.portalHost = this.document.createElement('div');
|
|
16570
16894
|
this.portalHost.dataset['contextMenuPortal'] = 'true';
|
|
16571
16895
|
this.document.body.appendChild(this.portalHost);
|
|
16896
|
+
const origin = this.viewContainerRef.element.nativeElement;
|
|
16897
|
+
inheritThemeTokens(origin, this.portalHost);
|
|
16898
|
+
// Portalled to <body>, the panel would take the page's direction; it must lay out in the one its host resolves to.
|
|
16899
|
+
this.portalHost.dir = getComputedStyle(origin).direction;
|
|
16572
16900
|
this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.contentTemplate);
|
|
16573
16901
|
this.embeddedViewRef.detectChanges();
|
|
16574
16902
|
this.embeddedViewRef.rootNodes.forEach((node) => {
|
|
@@ -16609,6 +16937,8 @@ class ContextMenuContentComponent {
|
|
|
16609
16937
|
y = 8;
|
|
16610
16938
|
}
|
|
16611
16939
|
this.adjustedPosition.set({ x, y });
|
|
16940
|
+
// The signal write alone never re-renders this relocated view: the clamp never reached the panel.
|
|
16941
|
+
this.embeddedViewRef?.detectChanges();
|
|
16612
16942
|
}
|
|
16613
16943
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ContextMenuContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16614
16944
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: ContextMenuContentComponent, isStandalone: true, selector: "ui-context-menu-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, viewQueries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true, static: true }, { propertyName: "contentEl", first: true, predicate: ["contentEl"], descendants: true }], ngImport: i0, template: `
|
|
@@ -17023,6 +17353,10 @@ class ContextMenuSubContentComponent {
|
|
|
17023
17353
|
this.portalHost = this.document.createElement('div');
|
|
17024
17354
|
this.portalHost.dataset['contextMenuSubPortal'] = 'true';
|
|
17025
17355
|
this.document.body.appendChild(this.portalHost);
|
|
17356
|
+
const origin = this.viewContainerRef.element.nativeElement;
|
|
17357
|
+
inheritThemeTokens(origin, this.portalHost);
|
|
17358
|
+
// Portalled to <body>, the panel would take the page's direction; it must lay out in the one its host resolves to.
|
|
17359
|
+
this.portalHost.dir = getComputedStyle(origin).direction;
|
|
17026
17360
|
this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.subContentTemplate);
|
|
17027
17361
|
this.embeddedViewRef.detectChanges();
|
|
17028
17362
|
this.embeddedViewRef.rootNodes.forEach((node) => {
|
|
@@ -17086,6 +17420,8 @@ class ContextMenuSubContentComponent {
|
|
|
17086
17420
|
const x = this.resolveX(triggerRect, contentRect, viewportWidth, rtl);
|
|
17087
17421
|
const y = this.resolveY(triggerRect, contentRect, viewportHeight);
|
|
17088
17422
|
this.portalPosition.set({ x, y });
|
|
17423
|
+
// The signal write alone never re-renders this relocated view: the flyout stayed at 0,0.
|
|
17424
|
+
this.embeddedViewRef?.detectChanges();
|
|
17089
17425
|
}
|
|
17090
17426
|
ngOnDestroy() {
|
|
17091
17427
|
this.hidePortal();
|
|
@@ -17673,12 +18009,15 @@ class DataTableContextMenuDirective {
|
|
|
17673
18009
|
}
|
|
17674
18010
|
openRowMenu(x, y, context) {
|
|
17675
18011
|
this.rowMenu ??= this.vcr.createComponent(ContextMenuComponent);
|
|
18012
|
+
// Reused across opens, so re-applied each time: the theme may have changed.
|
|
18013
|
+
inheritThemeTokens(this.vcr.element.nativeElement, this.rowMenu.location.nativeElement);
|
|
17676
18014
|
this.rowMenu.setInput('items', this.buildRowMenuItems(context));
|
|
17677
18015
|
this.rowMenu.instance.show(x, y, context);
|
|
17678
18016
|
this.rowMenuOpen.emit(context);
|
|
17679
18017
|
}
|
|
17680
18018
|
openColumnMenu(x, y, column) {
|
|
17681
18019
|
this.columnMenu ??= this.vcr.createComponent(ContextMenuComponent);
|
|
18020
|
+
inheritThemeTokens(this.vcr.element.nativeElement, this.columnMenu.location.nativeElement);
|
|
17682
18021
|
this.columnMenu.setInput('items', this.buildColumnMenuItems(column));
|
|
17683
18022
|
this.columnMenu.instance.show(x, y, { columnKey: String(column.accessorKey), column });
|
|
17684
18023
|
this.columnMenuOpen.emit(column);
|
|
@@ -18010,7 +18349,11 @@ class DataTableExportDirective {
|
|
|
18010
18349
|
this.uiDtExportLocale = input(...(ngDevMode ? [undefined, { debugName: "uiDtExportLocale" }] : /* istanbul ignore next */ []));
|
|
18011
18350
|
this.i18n = createLocaleBindings(this.uiDtExportLocale, DATA_TABLE_EXPORT_LOCALES);
|
|
18012
18351
|
}
|
|
18013
|
-
/**
|
|
18352
|
+
/**
|
|
18353
|
+
* Export the current (or provided) rows to a downloaded CSV file. Cells a
|
|
18354
|
+
* spreadsheet would run as a formula are quoted as text; see
|
|
18355
|
+
* {@link guardSpreadsheetFormula}.
|
|
18356
|
+
*/
|
|
18014
18357
|
async exportToCsv(filename, customData) {
|
|
18015
18358
|
this.host.setBusy(this.i18n.t().exporting);
|
|
18016
18359
|
try {
|
|
@@ -18077,8 +18420,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
18077
18420
|
exportAs: 'uiDtExport',
|
|
18078
18421
|
}]
|
|
18079
18422
|
}], propDecorators: { exportDataProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportDataProvider", required: false }] }], uiDtExportLocale: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiDtExportLocale", required: false }] }] } });
|
|
18080
|
-
/**
|
|
18081
|
-
|
|
18423
|
+
/**
|
|
18424
|
+
* Encode one CSV cell: formula-guard it first (the guard's quote has to sit
|
|
18425
|
+
* inside the CSV quotes, where the spreadsheet reads it), then quote it when it
|
|
18426
|
+
* contains a delimiter, quote, or newline.
|
|
18427
|
+
*/
|
|
18428
|
+
function escapeCsvCell(value) {
|
|
18429
|
+
const cell = guardSpreadsheetFormula(value);
|
|
18082
18430
|
if (cell.includes(',') ||
|
|
18083
18431
|
cell.includes('"') ||
|
|
18084
18432
|
cell.includes('\n') ||
|
|
@@ -18093,15 +18441,27 @@ const PIVOT_TOTAL_KEY = '__total__';
|
|
|
18093
18441
|
function defaultGetValue(row, key) {
|
|
18094
18442
|
return row[key];
|
|
18095
18443
|
}
|
|
18444
|
+
/**
|
|
18445
|
+
* The cell value as a number, or `null` when it holds no number. `Number()` alone
|
|
18446
|
+
* is not enough: it turns `null`, `''`, whitespace and `false` into `0`.
|
|
18447
|
+
*/
|
|
18448
|
+
function toAggregatableNumber(value) {
|
|
18449
|
+
if (typeof value === 'number')
|
|
18450
|
+
return Number.isFinite(value) ? value : null;
|
|
18451
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
18452
|
+
return null;
|
|
18453
|
+
const n = Number(value);
|
|
18454
|
+
return Number.isFinite(n) ? n : null;
|
|
18455
|
+
}
|
|
18096
18456
|
function aggregateNumbers(values, fn) {
|
|
18097
18457
|
if (fn === 'count')
|
|
18098
18458
|
return values.length;
|
|
18099
|
-
if (values.length === 0)
|
|
18100
|
-
return 0;
|
|
18101
18459
|
const sum = values.reduce((a, b) => a + b, 0);
|
|
18460
|
+
if (fn === 'sum')
|
|
18461
|
+
return sum;
|
|
18462
|
+
if (values.length === 0)
|
|
18463
|
+
return null;
|
|
18102
18464
|
switch (fn) {
|
|
18103
|
-
case 'sum':
|
|
18104
|
-
return sum;
|
|
18105
18465
|
case 'avg':
|
|
18106
18466
|
return Math.round((sum / values.length) * 100) / 100;
|
|
18107
18467
|
case 'min':
|
|
@@ -18115,9 +18475,12 @@ function aggregateNumbers(values, fn) {
|
|
|
18115
18475
|
function aggregateCell(rows, config, getValue) {
|
|
18116
18476
|
if (config.aggregate === 'count')
|
|
18117
18477
|
return rows.length;
|
|
18118
|
-
const nums =
|
|
18119
|
-
|
|
18120
|
-
|
|
18478
|
+
const nums = [];
|
|
18479
|
+
for (const row of rows) {
|
|
18480
|
+
const n = toAggregatableNumber(getValue(row, config.value));
|
|
18481
|
+
if (n !== null)
|
|
18482
|
+
nums.push(n);
|
|
18483
|
+
}
|
|
18121
18484
|
return aggregateNumbers(nums, config.aggregate);
|
|
18122
18485
|
}
|
|
18123
18486
|
/**
|
|
@@ -18131,7 +18494,9 @@ function computePivot(data, config, getValue = defaultGetValue) {
|
|
|
18131
18494
|
const groups = new Map();
|
|
18132
18495
|
for (const row of data) {
|
|
18133
18496
|
const dimValues = config.rows.map((key) => getValue(row, key));
|
|
18134
|
-
|
|
18497
|
+
// A joined string is ambiguous ('a b' + 'c' vs 'a' + 'b c'); a JSON array is
|
|
18498
|
+
// not. Values compare as strings, the same equality the column dimension uses.
|
|
18499
|
+
const groupKey = JSON.stringify(dimValues.map(String));
|
|
18135
18500
|
let group = groups.get(groupKey);
|
|
18136
18501
|
if (!group) {
|
|
18137
18502
|
const dim = {};
|
|
@@ -18199,5 +18564,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
18199
18564
|
* Generated bundle index. Do not edit.
|
|
18200
18565
|
*/
|
|
18201
18566
|
|
|
18202
|
-
export { AddonSlotRegistry, ComponentPoolService, DATA_TABLE_EXPORT_LOCALES, DATA_TABLE_LOCALES, DATA_TABLE_VIEW_STATE_VERSION, DEFAULT_FILTER_BUILDER_LABELS, DataTableAddonHost, DataTableColumnHeaderComponent, DataTableComponent, DataTableContextMenuDirective, DataTableDateFilterComponent, DataTableDateRangeFilterComponent, DataTableExportDirective, DataTableFilterBuilderComponent, DataTableMultiselectFilterComponent, DataTablePaginationComponent, DataTablePivotDirective, asEditableDate, buildFillValues, buildPrefixSums, buildTreeFromFlat, columnHelper, computeAggregateValue, computeColumnRange, computePivot, computeRowRange, computeVariableRowRange, dateFilterFn, dateRangeFilterFn, evaluateAdvancedFilter, matchesCondition, multiselectFilterFn, parseClipboardGrid, parseNlFilterSpec, partitionIntoGroups, toEditedDateValue, toLocalDateString };
|
|
18567
|
+
export { AddonSlotRegistry, ComponentPoolService, DATA_TABLE_EXPORT_LOCALES, DATA_TABLE_LOCALES, DATA_TABLE_VIEW_STATE_VERSION, DEFAULT_FILTER_BUILDER_LABELS, DataTableAddonHost, DataTableColumnHeaderComponent, DataTableComponent, DataTableContextMenuDirective, DataTableDateFilterComponent, DataTableDateRangeFilterComponent, DataTableExportDirective, DataTableFilterBuilderComponent, DataTableMultiselectFilterComponent, DataTablePaginationComponent, DataTablePivotDirective, asEditableDate, buildFillValues, buildPrefixSums, buildTreeFromFlat, columnHelper, computeAggregateValue, computeColumnRange, computePivot, computeRowRange, computeVariableRowRange, dateFilterFn, dateRangeFilterFn, evaluateAdvancedFilter, guardSpreadsheetFormula, matchesCondition, multiselectFilterFn, parseClipboardGrid, parseNlFilterSpec, partitionIntoGroups, restoreSpreadsheetText, toEditedDateValue, toLocalDateString };
|
|
18203
18568
|
//# sourceMappingURL=gilav21-shadcn-angular-data-table.mjs.map
|