@gilav21/shadcn-angular-data-table 0.2.0 → 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/fesm2022/gilav21-shadcn-angular-data-table.mjs +504 -203
- package/fesm2022/gilav21-shadcn-angular-data-table.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
- package/types/gilav21-shadcn-angular-data-table.d.ts +124 -17
- package/types/gilav21-shadcn-angular-data-table.d.ts.map +1 -1
|
@@ -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`.
|
|
@@ -3761,7 +3889,8 @@ class DataTableColumnHeaderComponent {
|
|
|
3761
3889
|
}
|
|
3762
3890
|
/**
|
|
3763
3891
|
* Advances the asc → desc → unsorted cycle and emits {@link sort} and
|
|
3764
|
-
* {@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
|
|
3765
3894
|
* `multi` on {@link sortMeta} only — the emitted direction is identical
|
|
3766
3895
|
* either way, and no local state changes (see {@link direction}).
|
|
3767
3896
|
*/
|
|
@@ -3782,7 +3911,7 @@ class DataTableColumnHeaderComponent {
|
|
|
3782
3911
|
}
|
|
3783
3912
|
}
|
|
3784
3913
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableColumnHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3785
|
-
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 }); }
|
|
3786
3915
|
}
|
|
3787
3916
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableColumnHeaderComponent, decorators: [{
|
|
3788
3917
|
type: Component,
|
|
@@ -3790,10 +3919,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
3790
3919
|
CommonModule,
|
|
3791
3920
|
ButtonComponent,
|
|
3792
3921
|
IconComponent,
|
|
3793
|
-
], 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" }]
|
|
3794
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"] }] } });
|
|
3795
3924
|
|
|
3796
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
|
+
}
|
|
3797
3938
|
class SelectComponent {
|
|
3798
3939
|
static { this.nextId = 0; }
|
|
3799
3940
|
constructor() {
|
|
@@ -3915,8 +4056,11 @@ class SelectComponent {
|
|
|
3915
4056
|
if (val == null)
|
|
3916
4057
|
return '';
|
|
3917
4058
|
if (this.isDataDriven()) {
|
|
3918
|
-
|
|
3919
|
-
|
|
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);
|
|
3920
4064
|
}
|
|
3921
4065
|
return String(val);
|
|
3922
4066
|
}, ...(ngDevMode ? [{ debugName: "selectedDisplayValue" }] : /* istanbul ignore next */ []));
|
|
@@ -3973,6 +4117,7 @@ class SelectComponent {
|
|
|
3973
4117
|
const firstItem = contentEl.querySelector('[role="option"]');
|
|
3974
4118
|
if (selectedItem) {
|
|
3975
4119
|
selectedItem.focus({ preventScroll: true });
|
|
4120
|
+
revealSelectOption(contentEl, selectedItem);
|
|
3976
4121
|
}
|
|
3977
4122
|
else if (firstItem) {
|
|
3978
4123
|
firstItem.focus({ preventScroll: true });
|
|
@@ -4152,10 +4297,34 @@ class SelectComponent {
|
|
|
4152
4297
|
return startIndex; // No enabled option found, stay at current
|
|
4153
4298
|
}
|
|
4154
4299
|
/**
|
|
4155
|
-
*
|
|
4156
|
-
*
|
|
4157
|
-
*
|
|
4158
|
-
|
|
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.
|
|
4159
4328
|
*/
|
|
4160
4329
|
onContentKeydown(event) {
|
|
4161
4330
|
const opts = this.options();
|
|
@@ -4165,16 +4334,16 @@ class SelectComponent {
|
|
|
4165
4334
|
switch (event.key) {
|
|
4166
4335
|
case 'ArrowDown':
|
|
4167
4336
|
event.preventDefault();
|
|
4168
|
-
this.
|
|
4337
|
+
this.highlight(this.findNextEnabledIndex(currentIndex, 1));
|
|
4169
4338
|
break;
|
|
4170
4339
|
case 'ArrowUp':
|
|
4171
4340
|
event.preventDefault();
|
|
4172
|
-
this.
|
|
4341
|
+
this.highlight(this.findNextEnabledIndex(currentIndex, -1));
|
|
4173
4342
|
break;
|
|
4174
4343
|
case 'Enter':
|
|
4175
4344
|
case ' ':
|
|
4176
4345
|
event.preventDefault();
|
|
4177
|
-
if (
|
|
4346
|
+
if (currentIndex >= 0 && currentIndex < opts.length) {
|
|
4178
4347
|
this.selectOption(opts[currentIndex]);
|
|
4179
4348
|
}
|
|
4180
4349
|
break;
|
|
@@ -4256,6 +4425,7 @@ class SelectComponent {
|
|
|
4256
4425
|
[class]="contentClasses()"
|
|
4257
4426
|
role="listbox"
|
|
4258
4427
|
tabindex="-1"
|
|
4428
|
+
(click)="onContentClick($event)"
|
|
4259
4429
|
(keydown)="onContentKeydown($event)"
|
|
4260
4430
|
>
|
|
4261
4431
|
<div class="p-1">
|
|
@@ -4268,9 +4438,8 @@ class SelectComponent {
|
|
|
4268
4438
|
[attr.aria-selected]="isSelected(option)"
|
|
4269
4439
|
[attr.data-state]="isSelected(option) ? 'checked' : 'unchecked'"
|
|
4270
4440
|
[attr.data-index]="i"
|
|
4271
|
-
|
|
4272
|
-
(
|
|
4273
|
-
(mouseenter)="focusedIndex.set(i)"
|
|
4441
|
+
[attr.data-slot]="'select-option'"
|
|
4442
|
+
(mouseenter)="highlight(i, { preventScroll: true })"
|
|
4274
4443
|
>
|
|
4275
4444
|
<span class="flex-1">{{ getDisplayValue(option) }}</span>
|
|
4276
4445
|
<span class="absolute flex size-3.5 items-center justify-center ltr:right-2 rtl:left-2">
|
|
@@ -4289,7 +4458,7 @@ class SelectComponent {
|
|
|
4289
4458
|
} @else {
|
|
4290
4459
|
<ng-content />
|
|
4291
4460
|
}
|
|
4292
|
-
`, 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 }); }
|
|
4293
4462
|
}
|
|
4294
4463
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SelectComponent, decorators: [{
|
|
4295
4464
|
type: Component,
|
|
@@ -4335,6 +4504,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4335
4504
|
[class]="contentClasses()"
|
|
4336
4505
|
role="listbox"
|
|
4337
4506
|
tabindex="-1"
|
|
4507
|
+
(click)="onContentClick($event)"
|
|
4338
4508
|
(keydown)="onContentKeydown($event)"
|
|
4339
4509
|
>
|
|
4340
4510
|
<div class="p-1">
|
|
@@ -4347,9 +4517,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4347
4517
|
[attr.aria-selected]="isSelected(option)"
|
|
4348
4518
|
[attr.data-state]="isSelected(option) ? 'checked' : 'unchecked'"
|
|
4349
4519
|
[attr.data-index]="i"
|
|
4350
|
-
|
|
4351
|
-
(
|
|
4352
|
-
(mouseenter)="focusedIndex.set(i)"
|
|
4520
|
+
[attr.data-slot]="'select-option'"
|
|
4521
|
+
(mouseenter)="highlight(i, { preventScroll: true })"
|
|
4353
4522
|
>
|
|
4354
4523
|
<span class="flex-1">{{ getDisplayValue(option) }}</span>
|
|
4355
4524
|
<span class="absolute flex size-3.5 items-center justify-center ltr:right-2 rtl:left-2">
|
|
@@ -4371,7 +4540,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4371
4540
|
`, host: { class: 'relative inline-block', '[attr.dir]': 'dir()' }, providers: [
|
|
4372
4541
|
{ provide: SELECT, useExisting: forwardRef(() => SelectComponent) },
|
|
4373
4542
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }
|
|
4374
|
-
], 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"] }]
|
|
4375
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: [{
|
|
4376
4545
|
type: ViewChild,
|
|
4377
4546
|
args: ['contentEl']
|
|
@@ -4696,6 +4865,7 @@ class SelectContentComponent {
|
|
|
4696
4865
|
const selectedItem = content.querySelector('[data-state="checked"]');
|
|
4697
4866
|
if (selectedItem) {
|
|
4698
4867
|
selectedItem.focus({ preventScroll: true });
|
|
4868
|
+
revealSelectOption(content, selectedItem);
|
|
4699
4869
|
}
|
|
4700
4870
|
else {
|
|
4701
4871
|
content.focus({ preventScroll: true });
|
|
@@ -4828,14 +4998,11 @@ class SelectItemComponent {
|
|
|
4828
4998
|
</svg>
|
|
4829
4999
|
}
|
|
4830
5000
|
</span>
|
|
4831
|
-
`, 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 }); }
|
|
4832
5002
|
}
|
|
4833
5003
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SelectItemComponent, decorators: [{
|
|
4834
5004
|
type: Component,
|
|
4835
|
-
args: [{
|
|
4836
|
-
selector: 'ui-select-item',
|
|
4837
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4838
|
-
template: `
|
|
5005
|
+
args: [{ selector: 'ui-select-item', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4839
5006
|
<ng-content />
|
|
4840
5007
|
<span [class]="checkmarkClasses()">
|
|
4841
5008
|
@if (isSelected()) {
|
|
@@ -4844,8 +5011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4844
5011
|
</svg>
|
|
4845
5012
|
}
|
|
4846
5013
|
</span>
|
|
4847
|
-
`,
|
|
4848
|
-
host: {
|
|
5014
|
+
`, host: {
|
|
4849
5015
|
'[class]': 'classes()',
|
|
4850
5016
|
'[attr.role]': '"option"',
|
|
4851
5017
|
'[attr.aria-selected]': 'isSelected()',
|
|
@@ -4855,8 +5021,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
4855
5021
|
'[attr.data-slot]': '"select-item"',
|
|
4856
5022
|
'[attr.tabindex]': '"-1"',
|
|
4857
5023
|
'(click)': 'onClick()',
|
|
4858
|
-
},
|
|
4859
|
-
}]
|
|
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"] }]
|
|
4860
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 }] }] } });
|
|
4861
5026
|
|
|
4862
5027
|
class SelectGroupComponent {
|
|
@@ -5521,7 +5686,7 @@ class DataTablePaginationComponent {
|
|
|
5521
5686
|
});
|
|
5522
5687
|
}
|
|
5523
5688
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTablePaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5524
|
-
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 }); }
|
|
5525
5690
|
}
|
|
5526
5691
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTablePaginationComponent, decorators: [{
|
|
5527
5692
|
type: Component,
|
|
@@ -5538,7 +5703,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
5538
5703
|
PaginationItemComponent,
|
|
5539
5704
|
PaginationLinkComponent,
|
|
5540
5705
|
IconComponent,
|
|
5541
|
-
], 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" }]
|
|
5542
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"] }] } });
|
|
5543
5708
|
|
|
5544
5709
|
/**
|
|
@@ -5593,11 +5758,11 @@ function isSecondaryTouch(event) {
|
|
|
5593
5758
|
return event.pointerType === 'touch' && !event.isPrimary;
|
|
5594
5759
|
}
|
|
5595
5760
|
function isTouchDevice() {
|
|
5596
|
-
return globalThis.window?.matchMedia('(pointer: coarse)').matches ?? false;
|
|
5761
|
+
return globalThis.window?.matchMedia?.('(pointer: coarse)').matches ?? false;
|
|
5597
5762
|
}
|
|
5598
5763
|
/** Detect if the device supports hover (mouse/trackpad) */
|
|
5599
5764
|
function hasHover() {
|
|
5600
|
-
return globalThis.window?.matchMedia('(hover: hover)').matches ?? true;
|
|
5765
|
+
return globalThis.window?.matchMedia?.('(hover: hover)').matches ?? true;
|
|
5601
5766
|
}
|
|
5602
5767
|
/**
|
|
5603
5768
|
* Long-press detection — calls `callback` after the user holds a touch
|
|
@@ -5833,7 +5998,14 @@ function onPointerDrag(onMove, onEnd) {
|
|
|
5833
5998
|
const UI_TABLE_ROLE = new InjectionToken('UI_TABLE_ROLE');
|
|
5834
5999
|
class TableComponent {
|
|
5835
6000
|
constructor() {
|
|
5836
|
-
/**
|
|
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
|
+
*/
|
|
5837
6009
|
this.class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
5838
6010
|
/**
|
|
5839
6011
|
* ARIA role of the table.
|
|
@@ -7168,7 +7340,7 @@ class CalendarComponent {
|
|
|
7168
7340
|
this.viewDate.set(new Date(yearNum, current.getMonth(), 1));
|
|
7169
7341
|
}
|
|
7170
7342
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7171
|
-
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 }); }
|
|
7172
7344
|
}
|
|
7173
7345
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
7174
7346
|
type: Component,
|
|
@@ -8493,9 +8665,9 @@ class DataTableFilterBuilderComponent {
|
|
|
8493
8665
|
<div class="space-y-2 rounded-md border bg-background p-2" data-slot="filter-group">
|
|
8494
8666
|
<div class="flex items-center gap-2">
|
|
8495
8667
|
<div class="inline-flex shrink-0 overflow-hidden rounded-md border text-xs">
|
|
8496
|
-
<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'"
|
|
8497
8669
|
(click)="setCombinator('and')">{{ labels().and }}</button>
|
|
8498
|
-
<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'"
|
|
8499
8671
|
(click)="setCombinator('or')">{{ labels().or }}</button>
|
|
8500
8672
|
</div>
|
|
8501
8673
|
<span class="text-xs text-muted-foreground">
|
|
@@ -8523,7 +8695,7 @@ class DataTableFilterBuilderComponent {
|
|
|
8523
8695
|
class="h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-sm"
|
|
8524
8696
|
[value]="asText(rule.value)" (input)="patch($index, { value: selectValue($event) })" />
|
|
8525
8697
|
}
|
|
8526
|
-
<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"
|
|
8527
8699
|
[attr.aria-label]="labels().removeCondition" (click)="removeRule($index)">
|
|
8528
8700
|
<ui-icon name="x" size="xs" />
|
|
8529
8701
|
</button>
|
|
@@ -8539,11 +8711,11 @@ class DataTableFilterBuilderComponent {
|
|
|
8539
8711
|
}
|
|
8540
8712
|
|
|
8541
8713
|
<div class="flex flex-wrap gap-2">
|
|
8542
|
-
<ui-button size="sm" variant="outline" (click)="addCondition()">{{ labels().addCondition }}</ui-button>
|
|
8543
|
-
<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>
|
|
8544
8716
|
</div>
|
|
8545
8717
|
</div>
|
|
8546
|
-
`, 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 }); }
|
|
8547
8719
|
}
|
|
8548
8720
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableFilterBuilderComponent, decorators: [{
|
|
8549
8721
|
type: Component,
|
|
@@ -8555,9 +8727,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8555
8727
|
<div class="space-y-2 rounded-md border bg-background p-2" data-slot="filter-group">
|
|
8556
8728
|
<div class="flex items-center gap-2">
|
|
8557
8729
|
<div class="inline-flex shrink-0 overflow-hidden rounded-md border text-xs">
|
|
8558
|
-
<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'"
|
|
8559
8731
|
(click)="setCombinator('and')">{{ labels().and }}</button>
|
|
8560
|
-
<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'"
|
|
8561
8733
|
(click)="setCombinator('or')">{{ labels().or }}</button>
|
|
8562
8734
|
</div>
|
|
8563
8735
|
<span class="text-xs text-muted-foreground">
|
|
@@ -8585,7 +8757,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8585
8757
|
class="h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-sm"
|
|
8586
8758
|
[value]="asText(rule.value)" (input)="patch($index, { value: selectValue($event) })" />
|
|
8587
8759
|
}
|
|
8588
|
-
<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"
|
|
8589
8761
|
[attr.aria-label]="labels().removeCondition" (click)="removeRule($index)">
|
|
8590
8762
|
<ui-icon name="x" size="xs" />
|
|
8591
8763
|
</button>
|
|
@@ -8601,8 +8773,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8601
8773
|
}
|
|
8602
8774
|
|
|
8603
8775
|
<div class="flex flex-wrap gap-2">
|
|
8604
|
-
<ui-button size="sm" variant="outline" (click)="addCondition()">{{ labels().addCondition }}</ui-button>
|
|
8605
|
-
<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>
|
|
8606
8778
|
</div>
|
|
8607
8779
|
</div>
|
|
8608
8780
|
`,
|
|
@@ -8880,6 +9052,14 @@ const DEFAULT_GET_ROW_ID = (row) => {
|
|
|
8880
9052
|
return JSON.stringify(row);
|
|
8881
9053
|
return stringifyValue(id);
|
|
8882
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
|
+
}
|
|
8883
9063
|
/**
|
|
8884
9064
|
* Whether two requests describe the same page of data.
|
|
8885
9065
|
*
|
|
@@ -8898,6 +9078,61 @@ function sameQuery(a, b) {
|
|
|
8898
9078
|
a.sortStates.length === b.sortStates.length &&
|
|
8899
9079
|
a.sortStates.every((sort, i) => sameSort(sort, b.sortStates[i])));
|
|
8900
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
|
+
}
|
|
8901
9136
|
class DataTableComponent {
|
|
8902
9137
|
/**
|
|
8903
9138
|
* True when the host element's resolved writing direction is RTL. Read from
|
|
@@ -9122,6 +9357,12 @@ class DataTableComponent {
|
|
|
9122
9357
|
}
|
|
9123
9358
|
return this.filteredTree_filterIncludeParents(rows, ctx);
|
|
9124
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
|
+
}
|
|
9125
9366
|
buildGroupRow(groupKey, groupValue, rows, collapsed) {
|
|
9126
9367
|
const aggregates = new Map();
|
|
9127
9368
|
if (this.groupAggregates()) {
|
|
@@ -9271,9 +9512,10 @@ class DataTableComponent {
|
|
|
9271
9512
|
/** Hides the columns popover in the toolbar; only shown when at least one column is hideable. */
|
|
9272
9513
|
this.showColumnVisibilityToggle = input(true, ...(ngDevMode ? [{ debugName: "showColumnVisibilityToggle" }] : /* istanbul ignore next */ []));
|
|
9273
9514
|
/**
|
|
9274
|
-
* Renders the pagination footer.
|
|
9275
|
-
*
|
|
9276
|
-
*
|
|
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.
|
|
9277
9519
|
*/
|
|
9278
9520
|
this.showPagination = input(true, ...(ngDevMode ? [{ debugName: "showPagination" }] : /* istanbul ignore next */ []));
|
|
9279
9521
|
/** Adds the horizontal rule under each row/header cell. Purely cosmetic. */
|
|
@@ -9287,9 +9529,11 @@ class DataTableComponent {
|
|
|
9287
9529
|
*/
|
|
9288
9530
|
this.localSorting = input(true, ...(ngDevMode ? [{ debugName: "localSorting" }] : /* istanbul ignore next */ []));
|
|
9289
9531
|
/**
|
|
9290
|
-
* Slice the rows in the browser
|
|
9291
|
-
*
|
|
9292
|
-
*
|
|
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}.
|
|
9293
9537
|
*/
|
|
9294
9538
|
this.localPagination = input(true, ...(ngDevMode ? [{ debugName: "localPagination" }] : /* istanbul ignore next */ []));
|
|
9295
9539
|
/**
|
|
@@ -9441,7 +9685,9 @@ class DataTableComponent {
|
|
|
9441
9685
|
/**
|
|
9442
9686
|
* Enables the clipboard paths: `Ctrl/Cmd+C` and the
|
|
9443
9687
|
* `copy*ToClipboard` methods, all of which return early when false. The
|
|
9444
|
-
* 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`.
|
|
9445
9691
|
*/
|
|
9446
9692
|
this.enableCopy = input(true, ...(ngDevMode ? [{ debugName: "enableCopy" }] : /* istanbul ignore next */ []));
|
|
9447
9693
|
/**
|
|
@@ -9623,7 +9869,9 @@ class DataTableComponent {
|
|
|
9623
9869
|
this.fillSeries = output();
|
|
9624
9870
|
/**
|
|
9625
9871
|
* Allow pasting a clipboard grid (TSV/CSV) into cells starting at the focused
|
|
9626
|
-
* 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.
|
|
9627
9875
|
*/
|
|
9628
9876
|
this.enableClipboardPaste = input(false, ...(ngDevMode ? [{ debugName: "enableClipboardPaste" }] : /* istanbul ignore next */ []));
|
|
9629
9877
|
/** Emitted after a clipboard grid is pasted into cells. */
|
|
@@ -9705,8 +9953,15 @@ class DataTableComponent {
|
|
|
9705
9953
|
* Row height in pixels assumed by the virtual-scroll maths, and the fallback
|
|
9706
9954
|
* for unmeasured rows under {@link virtualVariableRowHeight}. If your CSS row
|
|
9707
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.
|
|
9708
9961
|
*/
|
|
9709
|
-
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 */ []));
|
|
9710
9965
|
/** Extra rows rendered above and below the viewport to hide scroll tearing. */
|
|
9711
9966
|
this.virtualRowBuffer = input(5, ...(ngDevMode ? [{ debugName: "virtualRowBuffer" }] : /* istanbul ignore next */ []));
|
|
9712
9967
|
/** Extra columns rendered either side of the viewport during horizontal virtualization. */
|
|
@@ -9714,7 +9969,9 @@ class DataTableComponent {
|
|
|
9714
9969
|
/**
|
|
9715
9970
|
* Measures each rendered row and uses prefix sums instead of a fixed row
|
|
9716
9971
|
* height — needed for wrapping content, at the cost of a `ResizeObserver` per
|
|
9717
|
-
* 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.
|
|
9718
9975
|
*/
|
|
9719
9976
|
this.virtualVariableRowHeight = input(false, ...(ngDevMode ? [{ debugName: "virtualVariableRowHeight" }] : /* istanbul ignore next */ []));
|
|
9720
9977
|
/**
|
|
@@ -9793,13 +10050,13 @@ class DataTableComponent {
|
|
|
9793
10050
|
return Number.parseInt(String(w), 10) || autoWidth;
|
|
9794
10051
|
});
|
|
9795
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();
|
|
9796
10055
|
this._prefixSums = computed(() => {
|
|
9797
10056
|
if (!this.virtualVariableRowHeight())
|
|
9798
10057
|
return undefined;
|
|
9799
10058
|
this.measurementVersion();
|
|
9800
|
-
|
|
9801
|
-
const defaultHeight = this.virtualRowHeight();
|
|
9802
|
-
return buildPrefixSums((index) => this.rowHeightCache.get(index) ?? defaultHeight, totalRows);
|
|
10059
|
+
return buildPrefixSums(this.rowHeightAt, this.virtualTotalRows());
|
|
9803
10060
|
}, ...(ngDevMode ? [{ debugName: "_prefixSums" }] : /* istanbul ignore next */ []));
|
|
9804
10061
|
this.virtualRowRange = computed(() => {
|
|
9805
10062
|
if (!this.isVirtualScrollActive()) {
|
|
@@ -9809,11 +10066,9 @@ class DataTableComponent {
|
|
|
9809
10066
|
const totalRows = this.virtualTotalRows();
|
|
9810
10067
|
const buffer = this.virtualRowBuffer();
|
|
9811
10068
|
if (this.virtualVariableRowHeight()) {
|
|
9812
|
-
|
|
9813
|
-
const getHeight = (index) => this.rowHeightCache.get(index) ?? defaultHeight;
|
|
9814
|
-
return computeVariableRowRange(this.virtualScrollTop(), this.viewportHeight(), getHeight, totalRows, buffer, this._prefixSums());
|
|
10069
|
+
return computeVariableRowRange(this.virtualScrollTop(), this.viewportHeight(), this.rowHeightAt, totalRows, buffer, this._prefixSums());
|
|
9815
10070
|
}
|
|
9816
|
-
const rowHeight = this.
|
|
10071
|
+
const rowHeight = this.effectiveRowHeight();
|
|
9817
10072
|
const range = computeRowRange(this.virtualScrollTop(), this.viewportHeight(), rowHeight, totalRows, buffer);
|
|
9818
10073
|
return {
|
|
9819
10074
|
...range,
|
|
@@ -9932,6 +10187,10 @@ class DataTableComponent {
|
|
|
9932
10187
|
/**
|
|
9933
10188
|
* Current page index and size. Two-way: the table resets `pageIndex` to 0
|
|
9934
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.
|
|
9935
10194
|
*/
|
|
9936
10195
|
this.paginationState = model({ pageIndex: 0, pageSize: 10 }, ...(ngDevMode ? [{ debugName: "paginationState" }] : /* istanbul ignore next */ []));
|
|
9937
10196
|
/** Choices offered in the footer's page-size select. */
|
|
@@ -10063,45 +10322,37 @@ class DataTableComponent {
|
|
|
10063
10322
|
return data;
|
|
10064
10323
|
return data.sort(this.buildSortComparator(sorts));
|
|
10065
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 */ []));
|
|
10066
10331
|
this.processedData = computed(() => {
|
|
10067
10332
|
if (this.enableSubRows()) {
|
|
10068
10333
|
const visible = this.visibleTreeRows();
|
|
10069
|
-
if (!this.
|
|
10334
|
+
if (!this.pagesLocally())
|
|
10070
10335
|
return visible.map((tr) => tr.row);
|
|
10071
10336
|
if (this.subRowsPaginated()) {
|
|
10072
|
-
|
|
10073
|
-
const start = pageIndex * pageSize;
|
|
10074
|
-
return visible.slice(start, start + pageSize).map((tr) => tr.row);
|
|
10337
|
+
return this.slicePage(visible).map((tr) => tr.row);
|
|
10075
10338
|
}
|
|
10076
|
-
|
|
10077
|
-
const { pageIndex, pageSize } = this.paginationState();
|
|
10078
|
-
const start = pageIndex * pageSize;
|
|
10079
|
-
const rootSlice = treeData.slice(start, start + pageSize);
|
|
10080
|
-
return this.flattenTreeRowsForPage(rootSlice);
|
|
10339
|
+
return this.flattenTreeRowsForPage(this.slicePage(this.sortedTreeData()));
|
|
10081
10340
|
}
|
|
10082
10341
|
const data = this.sortedData();
|
|
10083
|
-
if (!this.
|
|
10342
|
+
if (!this.pagesLocally())
|
|
10084
10343
|
return data;
|
|
10085
|
-
|
|
10086
|
-
const start = pageIndex * pageSize;
|
|
10087
|
-
return data.slice(start, start + pageSize);
|
|
10344
|
+
return this.slicePage(data);
|
|
10088
10345
|
}, ...(ngDevMode ? [{ debugName: "processedData" }] : /* istanbul ignore next */ []));
|
|
10089
10346
|
this.processedTreeRows = computed(() => {
|
|
10090
10347
|
if (!this.enableSubRows())
|
|
10091
10348
|
return [];
|
|
10092
10349
|
const visible = this.visibleTreeRows();
|
|
10093
|
-
if (!this.
|
|
10350
|
+
if (!this.pagesLocally())
|
|
10094
10351
|
return visible;
|
|
10095
10352
|
if (this.subRowsPaginated()) {
|
|
10096
|
-
|
|
10097
|
-
const start = pageIndex * pageSize;
|
|
10098
|
-
return visible.slice(start, start + pageSize);
|
|
10353
|
+
return this.slicePage(visible);
|
|
10099
10354
|
}
|
|
10100
|
-
|
|
10101
|
-
const { pageIndex, pageSize } = this.paginationState();
|
|
10102
|
-
const start = pageIndex * pageSize;
|
|
10103
|
-
const rootSlice = treeData.slice(start, start + pageSize);
|
|
10104
|
-
return this.flattenTreeRowsForPageFull(rootSlice);
|
|
10355
|
+
return this.flattenTreeRowsForPageFull(this.slicePage(this.sortedTreeData()));
|
|
10105
10356
|
}, ...(ngDevMode ? [{ debugName: "processedTreeRows" }] : /* istanbul ignore next */ []));
|
|
10106
10357
|
this.activeTotalItems = computed(() => {
|
|
10107
10358
|
if (this.groupingActive()) {
|
|
@@ -10166,16 +10417,14 @@ class DataTableComponent {
|
|
|
10166
10417
|
*/
|
|
10167
10418
|
this.keepGroupAggregateOrder = () => 0;
|
|
10168
10419
|
/**
|
|
10169
|
-
* `groupedDisplayRows()` sliced for the current page when
|
|
10170
|
-
*
|
|
10420
|
+
* `groupedDisplayRows()` sliced for the current page when the table
|
|
10421
|
+
* {@link pagesLocally}. Group header rows count toward the page size.
|
|
10171
10422
|
*/
|
|
10172
10423
|
this.pagedGroupedDisplayRows = computed(() => {
|
|
10173
10424
|
const rows = this.groupedDisplayRows();
|
|
10174
|
-
if (!this.
|
|
10425
|
+
if (!this.pagesLocally())
|
|
10175
10426
|
return rows;
|
|
10176
|
-
|
|
10177
|
-
const start = pageIndex * pageSize;
|
|
10178
|
-
return rows.slice(start, start + pageSize);
|
|
10427
|
+
return this.slicePage(rows);
|
|
10179
10428
|
}, ...(ngDevMode ? [{ debugName: "pagedGroupedDisplayRows" }] : /* istanbul ignore next */ []));
|
|
10180
10429
|
this.filteredRowIds = computed(() => {
|
|
10181
10430
|
if (this.enableSubRows()) {
|
|
@@ -10192,6 +10441,13 @@ class DataTableComponent {
|
|
|
10192
10441
|
this.flashingCells = signal(new Map(), ...(ngDevMode ? [{ debugName: "flashingCells" }] : /* istanbul ignore next */ []));
|
|
10193
10442
|
this.flashTimers = [];
|
|
10194
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;
|
|
10195
10451
|
this.activeSorts = computed(() => {
|
|
10196
10452
|
if (this.enableMultiSort()) {
|
|
10197
10453
|
return this.multiSortState().filter((sort) => !!sort.column && !!sort.direction);
|
|
@@ -10424,16 +10680,18 @@ class DataTableComponent {
|
|
|
10424
10680
|
normal: cn("whitespace-nowrap overflow-hidden text-ellipsis", "bg-background", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"),
|
|
10425
10681
|
tree: cn("whitespace-nowrap overflow-hidden text-ellipsis", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"),
|
|
10426
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.
|
|
10427
10685
|
this._headerClassMap = computed(() => {
|
|
10428
10686
|
const showColBorders = this.showColumnBorders();
|
|
10429
10687
|
const enableResize = this.enableColumnResize();
|
|
10430
10688
|
const map = new Map();
|
|
10431
10689
|
for (const col of this.enhancedColumns()) {
|
|
10432
|
-
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"));
|
|
10433
10691
|
}
|
|
10434
10692
|
return map;
|
|
10435
10693
|
}, ...(ngDevMode ? [{ debugName: "_headerClassMap" }] : /* istanbul ignore next */ []));
|
|
10436
|
-
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 */ []));
|
|
10437
10695
|
this._cellStyleMap = computed(() => {
|
|
10438
10696
|
const map = new Map();
|
|
10439
10697
|
for (const col of this.enhancedColumns()) {
|
|
@@ -10659,9 +10917,11 @@ class DataTableComponent {
|
|
|
10659
10917
|
this.resizeOldWidth = "auto";
|
|
10660
10918
|
this.setupCellFlashEffect();
|
|
10661
10919
|
this.setupPaginationEffect();
|
|
10662
|
-
this.
|
|
10663
|
-
|
|
10664
|
-
|
|
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;
|
|
10665
10925
|
effect(() => {
|
|
10666
10926
|
if (!this.isVirtualScrollActive() || !this.virtualVariableRowHeight())
|
|
10667
10927
|
return;
|
|
@@ -10685,6 +10945,16 @@ class DataTableComponent {
|
|
|
10685
10945
|
this.validateConfiguration();
|
|
10686
10946
|
this.setupTouchRangeSelection();
|
|
10687
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
|
+
}
|
|
10688
10958
|
/** Touch: long-press a cell to enter range-selection, then drag to extend. */
|
|
10689
10959
|
setupTouchRangeSelection() {
|
|
10690
10960
|
const container = this.scrollContainerRef()?.nativeElement;
|
|
@@ -10847,6 +11117,7 @@ class DataTableComponent {
|
|
|
10847
11117
|
this._document.removeEventListener('touchend', this._onFillEnd);
|
|
10848
11118
|
this._rangeDragCleanup?.();
|
|
10849
11119
|
this._longPressCleanup?.();
|
|
11120
|
+
this._coarsePointerCleanup?.();
|
|
10850
11121
|
this.viewportObserver?.disconnect();
|
|
10851
11122
|
this.rowResizeObserver?.disconnect();
|
|
10852
11123
|
}
|
|
@@ -10856,6 +11127,8 @@ class DataTableComponent {
|
|
|
10856
11127
|
return;
|
|
10857
11128
|
this.viewportHeight.set(container.clientHeight);
|
|
10858
11129
|
this.viewportWidth.set(container.clientWidth);
|
|
11130
|
+
if (!hasResizeObserver())
|
|
11131
|
+
return;
|
|
10859
11132
|
this.viewportObserver = new ResizeObserver((entries) => {
|
|
10860
11133
|
for (const entry of entries) {
|
|
10861
11134
|
const el = entry.target;
|
|
@@ -10891,8 +11164,7 @@ class DataTableComponent {
|
|
|
10891
11164
|
continue;
|
|
10892
11165
|
const index = Number.parseInt(indexStr, 10);
|
|
10893
11166
|
const newHeight = entry.borderBoxSize[0].blockSize;
|
|
10894
|
-
const
|
|
10895
|
-
const diff = newHeight - oldHeight;
|
|
11167
|
+
const diff = newHeight - this.rowHeightAt(index);
|
|
10896
11168
|
if (Math.abs(diff) < 0.5)
|
|
10897
11169
|
continue;
|
|
10898
11170
|
this.rowHeightCache.set(index, newHeight);
|
|
@@ -11045,7 +11317,8 @@ class DataTableComponent {
|
|
|
11045
11317
|
result = [{ accessorKey: '_selection', header: '', sticky: true, width: '40px' }, ...result];
|
|
11046
11318
|
}
|
|
11047
11319
|
if (this.enableRowExpansion()) {
|
|
11048
|
-
|
|
11320
|
+
const width = this.coarsePointer() ? TOUCH_EXPANDER_COLUMN_WIDTH : '40px';
|
|
11321
|
+
result = [{ accessorKey: '_expander', header: '', sticky: true, width, enableSorting: false }, ...result];
|
|
11049
11322
|
}
|
|
11050
11323
|
if (this.cellActionSlots().length > 0) {
|
|
11051
11324
|
result = [...result, { accessorKey: '_actions', header: '', width: '50px', enableSorting: false, enableHiding: false, enableReordering: false }];
|
|
@@ -11089,7 +11362,7 @@ class DataTableComponent {
|
|
|
11089
11362
|
_stickyRight: isPinnedRight ? (rightOffsets.get(index) ?? 0) : undefined,
|
|
11090
11363
|
_pin: pin,
|
|
11091
11364
|
_width: widthStr,
|
|
11092
|
-
_minWidth: col
|
|
11365
|
+
_minWidth: resolveColumnMinWidth(col),
|
|
11093
11366
|
};
|
|
11094
11367
|
return { column, nextLeft: isStickyLeft ? currentLeft + widthVal : currentLeft };
|
|
11095
11368
|
}
|
|
@@ -11294,7 +11567,7 @@ class DataTableComponent {
|
|
|
11294
11567
|
}
|
|
11295
11568
|
async pasteFromClipboard(startRow, startColumn) {
|
|
11296
11569
|
const text = await navigator.clipboard.readText();
|
|
11297
|
-
const grid = parseClipboardGrid(text);
|
|
11570
|
+
const grid = parseClipboardGrid(text).map((line) => line.map(restoreSpreadsheetText));
|
|
11298
11571
|
if (grid.length > 0)
|
|
11299
11572
|
this.pasteGridAt(startRow, startColumn, grid);
|
|
11300
11573
|
}
|
|
@@ -11452,7 +11725,8 @@ class DataTableComponent {
|
|
|
11452
11725
|
return base + " bg-primary/15";
|
|
11453
11726
|
}
|
|
11454
11727
|
if (rowIndex !== undefined && this.isCellInFillPreview(rowIndex, key)) {
|
|
11455
|
-
|
|
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";
|
|
11456
11730
|
}
|
|
11457
11731
|
return base;
|
|
11458
11732
|
}
|
|
@@ -11476,8 +11750,7 @@ class DataTableComponent {
|
|
|
11476
11750
|
_buildCellStyle(col, isHeader) {
|
|
11477
11751
|
const width = col._width;
|
|
11478
11752
|
const isAuto = width === "auto";
|
|
11479
|
-
const
|
|
11480
|
-
const minColWidth = isSpecial ? "0px" : "80px";
|
|
11753
|
+
const minColWidth = col._minWidth ?? resolveColumnMinWidth(col);
|
|
11481
11754
|
const style = {
|
|
11482
11755
|
width: isAuto ? "0px" : width,
|
|
11483
11756
|
"min-width": isAuto ? minColWidth : width,
|
|
@@ -12197,15 +12470,9 @@ class DataTableComponent {
|
|
|
12197
12470
|
const host = this._el.nativeElement;
|
|
12198
12471
|
if (typeof host?.querySelector !== "function")
|
|
12199
12472
|
return null;
|
|
12200
|
-
const rowId =
|
|
12201
|
-
const key =
|
|
12202
|
-
|
|
12203
|
-
try {
|
|
12204
|
-
cell = host.querySelector(`[data-row-id=${rowId}] [data-column=${key}]`);
|
|
12205
|
-
}
|
|
12206
|
-
catch {
|
|
12207
|
-
return null;
|
|
12208
|
-
}
|
|
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}]`);
|
|
12209
12476
|
if (!cell)
|
|
12210
12477
|
return null;
|
|
12211
12478
|
return (cell.textContent ?? "").trim();
|
|
@@ -12296,7 +12563,7 @@ class DataTableComponent {
|
|
|
12296
12563
|
const row = this.processedData()[focused.rowIndex];
|
|
12297
12564
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === focused.columnKey);
|
|
12298
12565
|
if (row && col) {
|
|
12299
|
-
await navigator.clipboard.writeText(this.getCellStringValue(row, col));
|
|
12566
|
+
await navigator.clipboard.writeText(toClipboardText([[this.getCellStringValue(row, col)]]));
|
|
12300
12567
|
}
|
|
12301
12568
|
}
|
|
12302
12569
|
/**
|
|
@@ -12310,7 +12577,7 @@ class DataTableComponent {
|
|
|
12310
12577
|
col.accessorKey !== "_expander" &&
|
|
12311
12578
|
col.accessorKey !== "_actions");
|
|
12312
12579
|
const values = columns.map((col) => this.getCellStringValue(row, col));
|
|
12313
|
-
await navigator.clipboard.writeText(values
|
|
12580
|
+
await navigator.clipboard.writeText(toClipboardText([values]));
|
|
12314
12581
|
}
|
|
12315
12582
|
/**
|
|
12316
12583
|
* Copies the selected rows as TSV with a header line. Draws from the filtered
|
|
@@ -12327,9 +12594,9 @@ class DataTableComponent {
|
|
|
12327
12594
|
const rows = this.sortedData().filter((row) => selectedIds[this.getRowId()(row)]);
|
|
12328
12595
|
if (rows.length === 0)
|
|
12329
12596
|
return;
|
|
12330
|
-
const
|
|
12331
|
-
const
|
|
12332
|
-
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]));
|
|
12333
12600
|
}
|
|
12334
12601
|
/**
|
|
12335
12602
|
* Copies the whole table as TSV via {@link getExportData} — header row plus
|
|
@@ -12338,9 +12605,7 @@ class DataTableComponent {
|
|
|
12338
12605
|
async copyAllToClipboard() {
|
|
12339
12606
|
if (!this.enableCopy())
|
|
12340
12607
|
return;
|
|
12341
|
-
|
|
12342
|
-
const text = data.map((row) => row.join("\t")).join("\n");
|
|
12343
|
-
await navigator.clipboard.writeText(text);
|
|
12608
|
+
await navigator.clipboard.writeText(toClipboardText(this.getExportData()));
|
|
12344
12609
|
}
|
|
12345
12610
|
/**
|
|
12346
12611
|
* Clears the focused cell when a click lands on the table but outside any
|
|
@@ -12539,7 +12804,7 @@ class DataTableComponent {
|
|
|
12539
12804
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === focused.columnKey);
|
|
12540
12805
|
if (row && col) {
|
|
12541
12806
|
event.preventDefault();
|
|
12542
|
-
navigator.clipboard.writeText(this.getCellStringValue(row, col));
|
|
12807
|
+
navigator.clipboard.writeText(toClipboardText([[this.getCellStringValue(row, col)]]));
|
|
12543
12808
|
return true;
|
|
12544
12809
|
}
|
|
12545
12810
|
}
|
|
@@ -12565,18 +12830,17 @@ class DataTableComponent {
|
|
|
12565
12830
|
const rangeCols = colKeys.slice(range.minCol, range.maxCol + 1);
|
|
12566
12831
|
const data = this.processedData();
|
|
12567
12832
|
const columns = this.enhancedColumns();
|
|
12568
|
-
const
|
|
12833
|
+
const grid = [];
|
|
12569
12834
|
for (let r = range.minRow; r <= range.maxRow; r++) {
|
|
12570
12835
|
const row = data[r];
|
|
12571
12836
|
if (!row)
|
|
12572
12837
|
continue;
|
|
12573
|
-
|
|
12838
|
+
grid.push(rangeCols.map((key) => {
|
|
12574
12839
|
const col = columns.find((c) => String(c.accessorKey) === key);
|
|
12575
12840
|
return col ? this.getCellStringValue(row, col) : "";
|
|
12576
|
-
});
|
|
12577
|
-
lines.push(values.join("\t"));
|
|
12841
|
+
}));
|
|
12578
12842
|
}
|
|
12579
|
-
await navigator.clipboard.writeText(
|
|
12843
|
+
await navigator.clipboard.writeText(toClipboardText(grid));
|
|
12580
12844
|
}
|
|
12581
12845
|
computeNextCell(key, shiftKey, ctrlKey, rowIndex, colIndex, colKeys, totalRows) {
|
|
12582
12846
|
const nextRow = rowIndex;
|
|
@@ -12620,7 +12884,7 @@ class DataTableComponent {
|
|
|
12620
12884
|
}
|
|
12621
12885
|
getPageSize() {
|
|
12622
12886
|
const container = this.scrollContainerRef()?.nativeElement;
|
|
12623
|
-
return container ? Math.floor(container.clientHeight / this.
|
|
12887
|
+
return container ? Math.floor(container.clientHeight / this.effectiveRowHeight()) : 10;
|
|
12624
12888
|
}
|
|
12625
12889
|
handleNavigationKeydown(event) {
|
|
12626
12890
|
if (this.editingCell())
|
|
@@ -13948,8 +14212,7 @@ class DataTableComponent {
|
|
|
13948
14212
|
return;
|
|
13949
14213
|
const delta = clientX - this.resizeStartX;
|
|
13950
14214
|
const effectiveDelta = this._isRtlResize ? -delta : delta;
|
|
13951
|
-
const
|
|
13952
|
-
const newWidth = Math.max(minWidth, this.resizeStartWidth + effectiveDelta);
|
|
14215
|
+
const newWidth = Math.max(columnMinWidthPx(resizing), this.resizeStartWidth + effectiveDelta);
|
|
13953
14216
|
const key = String(resizing.accessorKey);
|
|
13954
14217
|
this.columnWidths.update((widths) => ({
|
|
13955
14218
|
...widths,
|
|
@@ -14021,7 +14284,7 @@ class DataTableComponent {
|
|
|
14021
14284
|
if (content <= 0)
|
|
14022
14285
|
return;
|
|
14023
14286
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === columnKey);
|
|
14024
|
-
const minWidth =
|
|
14287
|
+
const minWidth = col ? columnMinWidthPx(col) : 0;
|
|
14025
14288
|
const newWidth = `${Math.max(minWidth, Math.ceil(content) + 24)}px`;
|
|
14026
14289
|
const oldWidth = this.columnWidths()[columnKey] ?? col?._width ?? "auto";
|
|
14027
14290
|
this.columnWidths.update((widths) => ({ ...widths, [columnKey]: newWidth }));
|
|
@@ -14073,7 +14336,7 @@ class DataTableComponent {
|
|
|
14073
14336
|
return;
|
|
14074
14337
|
}
|
|
14075
14338
|
}
|
|
14076
|
-
container.scrollTop = index * this.
|
|
14339
|
+
container.scrollTop = index * this.effectiveRowHeight();
|
|
14077
14340
|
}
|
|
14078
14341
|
/**
|
|
14079
14342
|
* Scrolls a column to the leading edge of the viewport by summing the widths
|
|
@@ -14110,7 +14373,7 @@ class DataTableComponent {
|
|
|
14110
14373
|
ComponentPoolService,
|
|
14111
14374
|
provideComponentLocale(() => DataTableComponent),
|
|
14112
14375
|
{ provide: DataTableAddonHost, useExisting: forwardRef(() => DataTableComponent) },
|
|
14113
|
-
], 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", 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", "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 }); }
|
|
14114
14377
|
}
|
|
14115
14378
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableComponent, decorators: [{
|
|
14116
14379
|
type: Component,
|
|
@@ -14144,7 +14407,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
14144
14407
|
class: "block h-full w-full",
|
|
14145
14408
|
'[attr.dir]': 'dir()',
|
|
14146
14409
|
'[attr.data-ui-theme]': 'theme()',
|
|
14147
|
-
}, 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", 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"] }]
|
|
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"] }]
|
|
14148
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", { ...{
|
|
14149
14412
|
read: ElementRef,
|
|
14150
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"] }] } });
|
|
@@ -14428,9 +14691,8 @@ class CommandService {
|
|
|
14428
14691
|
}
|
|
14429
14692
|
/**
|
|
14430
14693
|
* Mirror of {@link moveNext} for ArrowUp: steps backwards through the filtered
|
|
14431
|
-
* items and wraps from the first to the last. With nothing active it
|
|
14432
|
-
* the
|
|
14433
|
-
* not the last.
|
|
14694
|
+
* items and wraps from the first to the last. With nothing active it starts at
|
|
14695
|
+
* the last item.
|
|
14434
14696
|
*/
|
|
14435
14697
|
movePrev() {
|
|
14436
14698
|
const items = this.filteredItems();
|
|
@@ -14438,7 +14700,8 @@ class CommandService {
|
|
|
14438
14700
|
return;
|
|
14439
14701
|
const current = this.activeItemId();
|
|
14440
14702
|
const idx = current ? items.indexOf(current) : -1;
|
|
14441
|
-
|
|
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;
|
|
14442
14705
|
this.activeItemId.set(items[prevIdx]);
|
|
14443
14706
|
}
|
|
14444
14707
|
/**
|
|
@@ -14910,7 +15173,12 @@ class CommandItemComponent {
|
|
|
14910
15173
|
this.id = generateId();
|
|
14911
15174
|
this.cmdService = inject(CommandService);
|
|
14912
15175
|
this.group = inject(COMMAND_GROUP, { optional: true });
|
|
14913
|
-
|
|
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');
|
|
14914
15182
|
this.isActive = computed(() => this.cmdService.activeItemId() === this.id, ...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
14915
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 */ []));
|
|
14916
15184
|
this.isVisible = computed(() => {
|
|
@@ -14918,7 +15186,9 @@ class CommandItemComponent {
|
|
|
14918
15186
|
}, ...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
|
|
14919
15187
|
effect(() => {
|
|
14920
15188
|
if (this.isActive()) {
|
|
14921
|
-
|
|
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' });
|
|
14922
15192
|
}
|
|
14923
15193
|
});
|
|
14924
15194
|
}
|
|
@@ -14942,8 +15212,9 @@ class CommandItemComponent {
|
|
|
14942
15212
|
}
|
|
14943
15213
|
}
|
|
14944
15214
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CommandItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14945
|
-
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: `
|
|
14946
15216
|
<div
|
|
15217
|
+
#row
|
|
14947
15218
|
[class]="classes()"
|
|
14948
15219
|
[attr.id]="id"
|
|
14949
15220
|
[attr.data-slot]="'command-item'"
|
|
@@ -14966,6 +15237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
14966
15237
|
type: Component,
|
|
14967
15238
|
args: [{ selector: 'ui-command-item', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
14968
15239
|
<div
|
|
15240
|
+
#row
|
|
14969
15241
|
[class]="classes()"
|
|
14970
15242
|
[attr.id]="id"
|
|
14971
15243
|
[attr.data-slot]="'command-item'"
|
|
@@ -14983,7 +15255,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
14983
15255
|
}
|
|
14984
15256
|
</div>
|
|
14985
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"] }]
|
|
14986
|
-
}], 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 }] }] } });
|
|
14987
15259
|
|
|
14988
15260
|
class CommandSeparatorComponent {
|
|
14989
15261
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CommandSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -15292,7 +15564,7 @@ class DialogContentComponent {
|
|
|
15292
15564
|
}
|
|
15293
15565
|
}
|
|
15294
15566
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15295
|
-
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 }); }
|
|
15296
15568
|
}
|
|
15297
15569
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
15298
15570
|
type: Component,
|
|
@@ -15300,7 +15572,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
15300
15572
|
DialogHeaderComponent,
|
|
15301
15573
|
DialogTitleComponent,
|
|
15302
15574
|
DialogDescriptionComponent,
|
|
15303
|
-
], 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"] }]
|
|
15304
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 }] }] } });
|
|
15305
15577
|
|
|
15306
15578
|
class DialogFooterComponent {
|
|
@@ -16281,7 +16553,7 @@ class DataTableMultiselectFilterComponent {
|
|
|
16281
16553
|
this.filterChange.emit([...selected]);
|
|
16282
16554
|
}
|
|
16283
16555
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableMultiselectFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16284
|
-
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 }); }
|
|
16285
16557
|
}
|
|
16286
16558
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableMultiselectFilterComponent, decorators: [{
|
|
16287
16559
|
type: Component,
|
|
@@ -16295,7 +16567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
16295
16567
|
CheckboxComponent,
|
|
16296
16568
|
BadgeComponent,
|
|
16297
16569
|
ButtonComponent,
|
|
16298
|
-
], 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" }]
|
|
16299
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"] }] } });
|
|
16300
16572
|
function multiselectFilterFn(row, filterValue, getValue) {
|
|
16301
16573
|
if (!filterValue || filterValue.length === 0)
|
|
@@ -16305,15 +16577,6 @@ function multiselectFilterFn(row, filterValue, getValue) {
|
|
|
16305
16577
|
}
|
|
16306
16578
|
|
|
16307
16579
|
/** Shared date helpers for the data-table date filter sub-components. */
|
|
16308
|
-
function toDate(value) {
|
|
16309
|
-
if (value instanceof Date)
|
|
16310
|
-
return value;
|
|
16311
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
16312
|
-
const d = new Date(value);
|
|
16313
|
-
return Number.isNaN(d.getTime()) ? null : d;
|
|
16314
|
-
}
|
|
16315
|
-
return null;
|
|
16316
|
-
}
|
|
16317
16580
|
function toDateOnlyTimestamp(d) {
|
|
16318
16581
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
|
|
16319
16582
|
}
|
|
@@ -16385,16 +16648,16 @@ class DataTableDateFilterComponent {
|
|
|
16385
16648
|
this.filterChange.emit(null);
|
|
16386
16649
|
}
|
|
16387
16650
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16388
|
-
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 }); }
|
|
16389
16652
|
}
|
|
16390
16653
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateFilterComponent, decorators: [{
|
|
16391
16654
|
type: Component,
|
|
16392
|
-
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" }]
|
|
16393
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"] }] } });
|
|
16394
16657
|
function dateFilterFn(row, filterValue, getValue) {
|
|
16395
16658
|
if (!filterValue)
|
|
16396
16659
|
return true;
|
|
16397
|
-
const cellDate =
|
|
16660
|
+
const cellDate = asEditableDate(getValue(row));
|
|
16398
16661
|
if (!cellDate)
|
|
16399
16662
|
return false;
|
|
16400
16663
|
return toDateOnlyTimestamp(cellDate) === toDateOnlyTimestamp(filterValue);
|
|
@@ -16488,11 +16751,11 @@ class DataTableDateRangeFilterComponent {
|
|
|
16488
16751
|
this.filterChange.emit(null);
|
|
16489
16752
|
}
|
|
16490
16753
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateRangeFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16491
|
-
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 }); }
|
|
16492
16755
|
}
|
|
16493
16756
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableDateRangeFilterComponent, decorators: [{
|
|
16494
16757
|
type: Component,
|
|
16495
|
-
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" }]
|
|
16496
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"] }] } });
|
|
16497
16760
|
function buildDefaultPresets(locale) {
|
|
16498
16761
|
const today = new Date();
|
|
@@ -16530,7 +16793,7 @@ function dateRangeFilterFn(row, filterValue, getValue) {
|
|
|
16530
16793
|
return true;
|
|
16531
16794
|
if (!filterValue.start && !filterValue.end)
|
|
16532
16795
|
return true;
|
|
16533
|
-
const cellDate =
|
|
16796
|
+
const cellDate = asEditableDate(getValue(row));
|
|
16534
16797
|
if (!cellDate)
|
|
16535
16798
|
return false;
|
|
16536
16799
|
const cellTs = toDateOnlyTimestamp(cellDate);
|
|
@@ -16596,9 +16859,11 @@ class ContextMenuContentComponent {
|
|
|
16596
16859
|
* (`min-w-[8rem]`, popover colours, `max-w-[calc(100vw-16px)]` /
|
|
16597
16860
|
* `max-h-[calc(100vh-16px)]` scroll clamps, enter animation). The panel is
|
|
16598
16861
|
* portalled to `document.body` with `position: fixed` and `z-index: 9999`,
|
|
16599
|
-
* so
|
|
16600
|
-
*
|
|
16601
|
-
*
|
|
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.
|
|
16602
16867
|
*/
|
|
16603
16868
|
this.class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
16604
16869
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
@@ -16628,7 +16893,10 @@ class ContextMenuContentComponent {
|
|
|
16628
16893
|
this.portalHost = this.document.createElement('div');
|
|
16629
16894
|
this.portalHost.dataset['contextMenuPortal'] = 'true';
|
|
16630
16895
|
this.document.body.appendChild(this.portalHost);
|
|
16631
|
-
|
|
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;
|
|
16632
16900
|
this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.contentTemplate);
|
|
16633
16901
|
this.embeddedViewRef.detectChanges();
|
|
16634
16902
|
this.embeddedViewRef.rootNodes.forEach((node) => {
|
|
@@ -16669,6 +16937,8 @@ class ContextMenuContentComponent {
|
|
|
16669
16937
|
y = 8;
|
|
16670
16938
|
}
|
|
16671
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();
|
|
16672
16942
|
}
|
|
16673
16943
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ContextMenuContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16674
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: `
|
|
@@ -17083,7 +17353,10 @@ class ContextMenuSubContentComponent {
|
|
|
17083
17353
|
this.portalHost = this.document.createElement('div');
|
|
17084
17354
|
this.portalHost.dataset['contextMenuSubPortal'] = 'true';
|
|
17085
17355
|
this.document.body.appendChild(this.portalHost);
|
|
17086
|
-
|
|
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;
|
|
17087
17360
|
this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.subContentTemplate);
|
|
17088
17361
|
this.embeddedViewRef.detectChanges();
|
|
17089
17362
|
this.embeddedViewRef.rootNodes.forEach((node) => {
|
|
@@ -17147,6 +17420,8 @@ class ContextMenuSubContentComponent {
|
|
|
17147
17420
|
const x = this.resolveX(triggerRect, contentRect, viewportWidth, rtl);
|
|
17148
17421
|
const y = this.resolveY(triggerRect, contentRect, viewportHeight);
|
|
17149
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();
|
|
17150
17425
|
}
|
|
17151
17426
|
ngOnDestroy() {
|
|
17152
17427
|
this.hidePortal();
|
|
@@ -18074,7 +18349,11 @@ class DataTableExportDirective {
|
|
|
18074
18349
|
this.uiDtExportLocale = input(...(ngDevMode ? [undefined, { debugName: "uiDtExportLocale" }] : /* istanbul ignore next */ []));
|
|
18075
18350
|
this.i18n = createLocaleBindings(this.uiDtExportLocale, DATA_TABLE_EXPORT_LOCALES);
|
|
18076
18351
|
}
|
|
18077
|
-
/**
|
|
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
|
+
*/
|
|
18078
18357
|
async exportToCsv(filename, customData) {
|
|
18079
18358
|
this.host.setBusy(this.i18n.t().exporting);
|
|
18080
18359
|
try {
|
|
@@ -18141,8 +18420,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
18141
18420
|
exportAs: 'uiDtExport',
|
|
18142
18421
|
}]
|
|
18143
18422
|
}], propDecorators: { exportDataProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportDataProvider", required: false }] }], uiDtExportLocale: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiDtExportLocale", required: false }] }] } });
|
|
18144
|
-
/**
|
|
18145
|
-
|
|
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);
|
|
18146
18430
|
if (cell.includes(',') ||
|
|
18147
18431
|
cell.includes('"') ||
|
|
18148
18432
|
cell.includes('\n') ||
|
|
@@ -18157,15 +18441,27 @@ const PIVOT_TOTAL_KEY = '__total__';
|
|
|
18157
18441
|
function defaultGetValue(row, key) {
|
|
18158
18442
|
return row[key];
|
|
18159
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
|
+
}
|
|
18160
18456
|
function aggregateNumbers(values, fn) {
|
|
18161
18457
|
if (fn === 'count')
|
|
18162
18458
|
return values.length;
|
|
18163
|
-
if (values.length === 0)
|
|
18164
|
-
return 0;
|
|
18165
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;
|
|
18166
18464
|
switch (fn) {
|
|
18167
|
-
case 'sum':
|
|
18168
|
-
return sum;
|
|
18169
18465
|
case 'avg':
|
|
18170
18466
|
return Math.round((sum / values.length) * 100) / 100;
|
|
18171
18467
|
case 'min':
|
|
@@ -18179,9 +18475,12 @@ function aggregateNumbers(values, fn) {
|
|
|
18179
18475
|
function aggregateCell(rows, config, getValue) {
|
|
18180
18476
|
if (config.aggregate === 'count')
|
|
18181
18477
|
return rows.length;
|
|
18182
|
-
const nums =
|
|
18183
|
-
|
|
18184
|
-
|
|
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
|
+
}
|
|
18185
18484
|
return aggregateNumbers(nums, config.aggregate);
|
|
18186
18485
|
}
|
|
18187
18486
|
/**
|
|
@@ -18195,7 +18494,9 @@ function computePivot(data, config, getValue = defaultGetValue) {
|
|
|
18195
18494
|
const groups = new Map();
|
|
18196
18495
|
for (const row of data) {
|
|
18197
18496
|
const dimValues = config.rows.map((key) => getValue(row, key));
|
|
18198
|
-
|
|
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));
|
|
18199
18500
|
let group = groups.get(groupKey);
|
|
18200
18501
|
if (!group) {
|
|
18201
18502
|
const dim = {};
|
|
@@ -18263,5 +18564,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
18263
18564
|
* Generated bundle index. Do not edit.
|
|
18264
18565
|
*/
|
|
18265
18566
|
|
|
18266
|
-
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 };
|
|
18267
18568
|
//# sourceMappingURL=gilav21-shadcn-angular-data-table.mjs.map
|