@gilav21/shadcn-angular-data-table 0.3.4 → 0.3.6
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 +654 -135
- 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 +146 -14
- package/types/gilav21-shadcn-angular-data-table.d.ts.map +1 -1
|
@@ -269,10 +269,22 @@ function computeVariableRowRangeLinear(scrollTop, viewportHeight, getRowHeight,
|
|
|
269
269
|
paddingBottom,
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Nests a flat list by parent id. Every row appears exactly once: a row whose
|
|
274
|
+
* parent id names no row surfaces at the root (list order), and a parent cycle
|
|
275
|
+
* (including a row that is its own parent) is broken at its first row in list
|
|
276
|
+
* order. The input rows are not mutated.
|
|
277
|
+
*/
|
|
272
278
|
function buildTreeFromFlat(rows, getId, getParentId, setChildren) {
|
|
279
|
+
const ids = new Set(rows.map(getId));
|
|
280
|
+
const roots = [];
|
|
273
281
|
const childrenMap = new Map();
|
|
274
282
|
for (const row of rows) {
|
|
275
283
|
const parentId = getParentId(row);
|
|
284
|
+
if (parentId === null || !ids.has(parentId)) {
|
|
285
|
+
roots.push(row);
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
276
288
|
const siblings = childrenMap.get(parentId);
|
|
277
289
|
if (siblings) {
|
|
278
290
|
siblings.push(row);
|
|
@@ -281,16 +293,20 @@ function buildTreeFromFlat(rows, getId, getParentId, setChildren) {
|
|
|
281
293
|
childrenMap.set(parentId, [row]);
|
|
282
294
|
}
|
|
283
295
|
}
|
|
296
|
+
const placed = new Set();
|
|
284
297
|
function attachChildren(row) {
|
|
285
298
|
const id = getId(row);
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
299
|
+
placed.add(id);
|
|
300
|
+
const children = (childrenMap.get(id) ?? []).filter((child) => !placed.has(getId(child)));
|
|
301
|
+
return children.length > 0 ? setChildren(row, children.map(attachChildren)) : row;
|
|
302
|
+
}
|
|
303
|
+
const tree = roots.map(attachChildren);
|
|
304
|
+
// Whatever is still unplaced hangs off a cycle and has no root of its own.
|
|
305
|
+
for (const row of rows) {
|
|
306
|
+
if (!placed.has(getId(row)))
|
|
307
|
+
tree.push(attachChildren(row));
|
|
291
308
|
}
|
|
292
|
-
|
|
293
|
-
return roots.map(attachChildren);
|
|
309
|
+
return tree;
|
|
294
310
|
}
|
|
295
311
|
function toNumberSeries(source) {
|
|
296
312
|
const nums = [];
|
|
@@ -536,59 +552,108 @@ function buildFillValues(source, count) {
|
|
|
536
552
|
return fillTrailingNumbers(trailing, count);
|
|
537
553
|
return cycleValues(source, count);
|
|
538
554
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
555
|
+
/** A closing quote must be the last character of its cell; anything after it means the field was never quoted. */
|
|
556
|
+
function endsCell(text, index, delimiter) {
|
|
557
|
+
return index >= text.length || text[index] === delimiter || text[index] === '\n';
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Splits clipboard text into rows of cells with one quote-aware pass. A cell
|
|
561
|
+
* that STARTS with a quote may hold the delimiter, doubled quotes and line
|
|
562
|
+
* breaks (how Excel and Sheets write them); a quote anywhere else is literal.
|
|
563
|
+
* Line endings are already normalised to LF. Returns `null` when a quote opens
|
|
564
|
+
* and never closes properly (a lone `"5 inch`, or `"quoted" text`): that text
|
|
565
|
+
* did not come from a quoting writer, and honouring the quote would swallow
|
|
566
|
+
* the rest.
|
|
567
|
+
*/
|
|
568
|
+
function parseDelimited(text, delimiter) {
|
|
569
|
+
const rows = [];
|
|
570
|
+
let row = [];
|
|
571
|
+
let cell = '';
|
|
572
|
+
let quoted = false;
|
|
543
573
|
let i = 0;
|
|
544
|
-
while (i <
|
|
545
|
-
const ch =
|
|
546
|
-
if (
|
|
547
|
-
if (
|
|
548
|
-
|
|
574
|
+
while (i < text.length) {
|
|
575
|
+
const ch = text[i];
|
|
576
|
+
if (quoted) {
|
|
577
|
+
if (ch !== '"') {
|
|
578
|
+
cell += ch;
|
|
579
|
+
}
|
|
580
|
+
else if (text[i + 1] === '"') {
|
|
581
|
+
cell += '"';
|
|
549
582
|
i++;
|
|
550
583
|
}
|
|
584
|
+
else if (endsCell(text, i + 1, delimiter)) {
|
|
585
|
+
quoted = false;
|
|
586
|
+
}
|
|
551
587
|
else {
|
|
552
|
-
|
|
588
|
+
return null;
|
|
553
589
|
}
|
|
554
590
|
}
|
|
555
|
-
else if (ch === '
|
|
556
|
-
|
|
557
|
-
|
|
591
|
+
else if (ch === '"' && cell === '') {
|
|
592
|
+
quoted = true;
|
|
593
|
+
}
|
|
594
|
+
else if (ch === delimiter) {
|
|
595
|
+
row.push(cell);
|
|
596
|
+
cell = '';
|
|
597
|
+
}
|
|
598
|
+
else if (ch === '\n') {
|
|
599
|
+
row.push(cell);
|
|
600
|
+
rows.push(row);
|
|
601
|
+
row = [];
|
|
602
|
+
cell = '';
|
|
558
603
|
}
|
|
559
604
|
else {
|
|
560
|
-
|
|
605
|
+
cell += ch;
|
|
561
606
|
}
|
|
562
607
|
i++;
|
|
563
608
|
}
|
|
564
|
-
|
|
565
|
-
|
|
609
|
+
if (quoted)
|
|
610
|
+
return null;
|
|
611
|
+
row.push(cell);
|
|
612
|
+
rows.push(row);
|
|
613
|
+
return rows;
|
|
614
|
+
}
|
|
615
|
+
function splitPlain(text, delimiter) {
|
|
616
|
+
return text.split('\n').map((line) => line.split(delimiter));
|
|
566
617
|
}
|
|
567
618
|
/**
|
|
568
|
-
* Parse clipboard text into a grid of cell strings. Tab-separated when
|
|
569
|
-
*
|
|
570
|
-
*
|
|
619
|
+
* Parse clipboard text into a grid of cell strings. Tab-separated when that
|
|
620
|
+
* yields more than one column (Excel / the table's own copy-out), otherwise
|
|
621
|
+
* comma-separated. Quoted cells may contain the delimiter, `""` and line
|
|
622
|
+
* breaks. A single trailing newline is dropped.
|
|
571
623
|
*/
|
|
572
624
|
function parseClipboardGrid(text) {
|
|
573
625
|
if (text === '')
|
|
574
626
|
return [];
|
|
575
627
|
const normalized = text.replaceAll(/\r\n?/g, '\n');
|
|
576
628
|
const body = normalized.endsWith('\n') ? normalized.slice(0, -1) : normalized;
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
579
|
-
return
|
|
580
|
-
|
|
581
|
-
|
|
629
|
+
const tabs = parseDelimited(body, '\t') ?? splitPlain(body, '\t');
|
|
630
|
+
if (tabs.some((cells) => cells.length > 1))
|
|
631
|
+
return tabs;
|
|
632
|
+
return parseDelimited(body, ',') ?? splitPlain(body, ',');
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* The cell value as a number, or `null` when it holds none. `Number()` alone
|
|
636
|
+
* turns `null`, `''`, whitespace and `false` into `0`, which would let an empty
|
|
637
|
+
* cell pass for a zero.
|
|
638
|
+
*/
|
|
639
|
+
function toAggregatableNumber$1(value) {
|
|
640
|
+
if (typeof value === 'number')
|
|
641
|
+
return Number.isFinite(value) ? value : null;
|
|
642
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
643
|
+
return null;
|
|
644
|
+
const n = Number(value);
|
|
645
|
+
return Number.isFinite(n) ? n : null;
|
|
582
646
|
}
|
|
583
647
|
/**
|
|
584
648
|
* Reduce a list of cell values to a single aggregate string. Shared by column
|
|
585
649
|
* footers and the range-selection readout so both compute identically.
|
|
586
|
-
* `count` counts all values; the numeric aggregates ignore
|
|
650
|
+
* `count` counts all values; the numeric aggregates ignore values holding no
|
|
651
|
+
* number (`null`, `undefined`, blank strings, text).
|
|
587
652
|
*/
|
|
588
653
|
function computeAggregateValue(values, fn) {
|
|
589
654
|
if (typeof fn === 'function')
|
|
590
655
|
return fn(values);
|
|
591
|
-
const nums = values.map(
|
|
656
|
+
const nums = values.map(toAggregatableNumber$1).filter((n) => n !== null);
|
|
592
657
|
if (nums.length === 0 && fn !== 'count')
|
|
593
658
|
return '';
|
|
594
659
|
switch (fn) {
|
|
@@ -646,29 +711,41 @@ function renumberDataRows(rows) {
|
|
|
646
711
|
});
|
|
647
712
|
}
|
|
648
713
|
// ── Advanced filter evaluation (A5) ──
|
|
649
|
-
|
|
714
|
+
/**
|
|
715
|
+
* A cell as text for matching. `stringifyValue` would JSON-quote a Date
|
|
716
|
+
* (`"2024-03-05T..."`), so `startsWith` and `equals` could never match one.
|
|
717
|
+
*/
|
|
718
|
+
function cellText(value) {
|
|
719
|
+
if (value instanceof Date)
|
|
720
|
+
return Number.isNaN(value.getTime()) ? '' : value.toISOString();
|
|
650
721
|
return stringifyValue(value);
|
|
651
722
|
}
|
|
723
|
+
/** An empty cell is no number, so it never satisfies a numeric comparison (only `isEmpty` selects blanks). */
|
|
724
|
+
function compareNumbers(cell, value, test) {
|
|
725
|
+
const a = toAggregatableNumber$1(cell);
|
|
726
|
+
const b = toAggregatableNumber$1(value);
|
|
727
|
+
return a !== null && b !== null && test(a, b);
|
|
728
|
+
}
|
|
652
729
|
function looseEquals(cell, value) {
|
|
653
|
-
const a =
|
|
654
|
-
const b =
|
|
655
|
-
if (
|
|
730
|
+
const a = toAggregatableNumber$1(cell);
|
|
731
|
+
const b = toAggregatableNumber$1(value);
|
|
732
|
+
if (a !== null && b !== null)
|
|
656
733
|
return a === b;
|
|
657
|
-
return
|
|
734
|
+
return cellText(cell).toLowerCase() === cellText(value).toLowerCase();
|
|
658
735
|
}
|
|
659
736
|
const FILTER_OPS = {
|
|
660
|
-
isEmpty: (cell) =>
|
|
661
|
-
isNotEmpty: (cell) =>
|
|
737
|
+
isEmpty: (cell) => cellText(cell).trim() === '',
|
|
738
|
+
isNotEmpty: (cell) => cellText(cell).trim() !== '',
|
|
662
739
|
equals: (cell, value) => looseEquals(cell, value),
|
|
663
740
|
notEquals: (cell, value) => !looseEquals(cell, value),
|
|
664
|
-
contains: (cell, value) =>
|
|
665
|
-
notContains: (cell, value) => !
|
|
666
|
-
startsWith: (cell, value) =>
|
|
667
|
-
endsWith: (cell, value) =>
|
|
668
|
-
gt: (cell, value) =>
|
|
669
|
-
gte: (cell, value) =>
|
|
670
|
-
lt: (cell, value) =>
|
|
671
|
-
lte: (cell, value) =>
|
|
741
|
+
contains: (cell, value) => cellText(cell).toLowerCase().includes(cellText(value).toLowerCase()),
|
|
742
|
+
notContains: (cell, value) => !cellText(cell).toLowerCase().includes(cellText(value).toLowerCase()),
|
|
743
|
+
startsWith: (cell, value) => cellText(cell).toLowerCase().startsWith(cellText(value).toLowerCase()),
|
|
744
|
+
endsWith: (cell, value) => cellText(cell).toLowerCase().endsWith(cellText(value).toLowerCase()),
|
|
745
|
+
gt: (cell, value) => compareNumbers(cell, value, (a, b) => a > b),
|
|
746
|
+
gte: (cell, value) => compareNumbers(cell, value, (a, b) => a >= b),
|
|
747
|
+
lt: (cell, value) => compareNumbers(cell, value, (a, b) => a < b),
|
|
748
|
+
lte: (cell, value) => compareNumbers(cell, value, (a, b) => a <= b),
|
|
672
749
|
};
|
|
673
750
|
/** Test a single cell value against an advanced-filter operator. */
|
|
674
751
|
function matchesCondition(cell, operator, value) {
|
|
@@ -6873,6 +6950,18 @@ const inputVariants = cva('border-input aria-invalid:ring-destructive/20 dark:ar
|
|
|
6873
6950
|
variant: 'outline',
|
|
6874
6951
|
},
|
|
6875
6952
|
});
|
|
6953
|
+
const containerVariants = cva('relative flex w-full items-center bg-transparent transition-[color,border-color,box-shadow]', {
|
|
6954
|
+
variants: {
|
|
6955
|
+
variant: {
|
|
6956
|
+
outline: 'rounded-lg border border-input shadow-xs dark:bg-input/30 has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-ring/50',
|
|
6957
|
+
underline: 'rounded-none border-b border-input has-[input:focus-visible]:border-ring',
|
|
6958
|
+
ghost: '',
|
|
6959
|
+
},
|
|
6960
|
+
},
|
|
6961
|
+
defaultVariants: {
|
|
6962
|
+
variant: 'outline',
|
|
6963
|
+
},
|
|
6964
|
+
});
|
|
6876
6965
|
let nextInputId = 0;
|
|
6877
6966
|
class InputComponent {
|
|
6878
6967
|
constructor() {
|
|
@@ -6995,10 +7084,29 @@ class InputComponent {
|
|
|
6995
7084
|
this.isFloating = computed(() => this.floating() && !!this.label(), ...(ngDevMode ? [{ debugName: "isFloating" }] : /* istanbul ignore next */ []));
|
|
6996
7085
|
this.labelIsActive = computed(() => this.isFocused() || !!this.value(), ...(ngDevMode ? [{ debugName: "labelIsActive" }] : /* istanbul ignore next */ []));
|
|
6997
7086
|
this.classes = computed(() => cn(inputVariants({ variant: this.effectiveVariant() }), this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
6998
|
-
|
|
7087
|
+
/**
|
|
7088
|
+
* The container's frame follows the same effective variant as a plain input, so
|
|
7089
|
+
* inside a group (variant `ghost`) it draws nothing and the group owns the one border.
|
|
7090
|
+
*/
|
|
7091
|
+
this.containerClasses = computed(() => cn(containerVariants({ variant: this.effectiveVariant() }), this.isDisabled() && 'opacity-50 pointer-events-none cursor-not-allowed', this.class()), ...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
|
|
7092
|
+
/**
|
|
7093
|
+
* Whether a frame sits on the container's start and end edges: its own outline
|
|
7094
|
+
* frame or, inside a group, the group's, which only an `outline` group draws. Text
|
|
7095
|
+
* and affixes are inset from a frame; with none (a standalone ghost/underline, or a
|
|
7096
|
+
* ghost/underline group) the container stays flush like a plain input.
|
|
7097
|
+
*/
|
|
7098
|
+
this.framed = computed(() => {
|
|
7099
|
+
if (this.group !== null)
|
|
7100
|
+
return (this.group.variant() ?? 'outline') === 'outline';
|
|
7101
|
+
return this.effectiveVariant() === 'outline';
|
|
7102
|
+
}, ...(ngDevMode ? [{ debugName: "framed" }] : /* istanbul ignore next */ []));
|
|
6999
7103
|
this.innerClasses = computed(() => cn(inputVariants({ variant: 'ghost' }), 'flex-1 h-full',
|
|
7000
|
-
// Ghost is flush (px-0); without a prefix the text would sit on the
|
|
7001
|
-
!this.prefix() && String.raw `ps-[calc(0.75rem*var(--\_d))]`), ...(ngDevMode ? [{ debugName: "innerClasses" }] : /* istanbul ignore next */ []));
|
|
7104
|
+
// Ghost is flush (px-0); without a prefix the text would sit on the frame (see `framed`). `\_` keeps Tailwind from reading `_` as a space, and String.raw keeps the single backslash its class scanner needs in source.
|
|
7105
|
+
!this.prefix() && this.framed() && String.raw `ps-[calc(0.75rem*var(--\_d))]`), ...(ngDevMode ? [{ debugName: "innerClasses" }] : /* istanbul ignore next */ []));
|
|
7106
|
+
this.prefixClasses = computed(() => cn('text-muted-foreground flex shrink-0 items-center pe-1 text-sm select-none', this.framed() && 'ps-3'), ...(ngDevMode ? [{ debugName: "prefixClasses" }] : /* istanbul ignore next */ []));
|
|
7107
|
+
this.suffixClasses = computed(() => cn('text-muted-foreground flex shrink-0 items-center ps-1 text-sm select-none', this.framed() && 'pe-3'), ...(ngDevMode ? [{ debugName: "suffixClasses" }] : /* istanbul ignore next */ []));
|
|
7108
|
+
this.clearButtonClasses = computed(() => cn('flex shrink-0 items-center justify-center text-muted-foreground hover:text-foreground', this.framed() && 'pe-2'), ...(ngDevMode ? [{ debugName: "clearButtonClasses" }] : /* istanbul ignore next */ []));
|
|
7109
|
+
this.spinnerClasses = computed(() => cn('flex shrink-0 items-center pointer-events-none', this.framed() && 'pe-2'), ...(ngDevMode ? [{ debugName: "spinnerClasses" }] : /* istanbul ignore next */ []));
|
|
7002
7110
|
this.floatingLabelClasses = computed(() => cn('pointer-events-none absolute select-none text-muted-foreground transition-all duration-150',
|
|
7003
7111
|
// Resting = uniform placeholder; on float it transforms to the (optionally
|
|
7004
7112
|
// dev-customized via labelClass) heading font.
|
|
@@ -7060,7 +7168,7 @@ class InputComponent {
|
|
|
7060
7168
|
useExisting: forwardRef(() => InputComponent),
|
|
7061
7169
|
multi: true,
|
|
7062
7170
|
},
|
|
7063
|
-
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n} @else if (isFloating()) {\n <div class=\"relative\" [attr.data-slot]=\"'input-floating'\" [attr.data-variant]=\"effectiveVariant()\">\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"labelIsActive() ? placeholder() : ''\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <label [for]=\"resolvedId()\" [class]=\"floatingLabelClasses()\" [attr.data-active]=\"labelIsActive() ? '' : null\">{{ label() }}</label>\n </div>\n} @else if (needsContainer()) {\n <div [class]=\"containerClasses()\" [attr.data-slot]=\"'input-container'\">\n @if (prefix()) {\n <span class=\"
|
|
7171
|
+
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n} @else if (isFloating()) {\n <div class=\"relative\" [attr.data-slot]=\"'input-floating'\" [attr.data-variant]=\"effectiveVariant()\">\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"labelIsActive() ? placeholder() : ''\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <label [for]=\"resolvedId()\" [class]=\"floatingLabelClasses()\" [attr.data-active]=\"labelIsActive() ? '' : null\">{{ label() }}</label>\n </div>\n} @else if (needsContainer()) {\n <div [class]=\"containerClasses()\" [attr.data-slot]=\"'input-container'\">\n @if (prefix()) {\n <span [class]=\"prefixClasses()\">{{ prefix() }}</span>\n }\n <input\n [class]=\"innerClasses()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n @if (clearable() && value()) {\n <button\n type=\"button\"\n (click)=\"clearValue()\"\n tabindex=\"-1\"\n [class]=\"clearButtonClasses()\"\n aria-label=\"Clear\"\n >\n <ui-icon name=\"x\" class=\"size-3.5\" />\n </button>\n }\n @if (loading()) {\n <div [class]=\"spinnerClasses()\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (suffix() && !loading()) {\n <span [class]=\"suffixClasses()\">{{ suffix() }}</span>\n }\n </div>\n} @else {\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n}\n", styles: [":host{--_d: var(--density-input, var(--density, 1))}@layer components{[data-slot=input]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.25rem * var(--_d))}[data-slot=input-container]{height:calc(2.25rem * var(--_d))}[data-slot=input-floating]{padding-top:calc(1.5rem * var(--_d))}[data-slot=input-floating]>label{inset-inline-start:calc(.75rem * var(--_d));top:calc(2.625rem * var(--_d));transform:translateY(-50%)}[data-slot=input-floating][data-variant=underline]>label,[data-slot=input-floating][data-variant=ghost]>label{inset-inline-start:0}[data-slot=input-floating]>label[data-active]{inset-inline-start:0;top:calc(1.125rem * var(--_d));transform:translateY(-100%)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "size", "customSize", "variant", "label"] }, { kind: "component", type: SkeletonComponent, selector: "ui-skeleton", inputs: ["class", "variant"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["name", "class", "size", "weight", "strokeWidth", "color", "fillColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7064
7172
|
}
|
|
7065
7173
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: InputComponent, decorators: [{
|
|
7066
7174
|
type: Component,
|
|
@@ -7073,7 +7181,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
7073
7181
|
], host: {
|
|
7074
7182
|
'[class]': '"contents"',
|
|
7075
7183
|
'[attr.id]': 'null',
|
|
7076
|
-
}, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n} @else if (isFloating()) {\n <div class=\"relative\" [attr.data-slot]=\"'input-floating'\" [attr.data-variant]=\"effectiveVariant()\">\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"labelIsActive() ? placeholder() : ''\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <label [for]=\"resolvedId()\" [class]=\"floatingLabelClasses()\" [attr.data-active]=\"labelIsActive() ? '' : null\">{{ label() }}</label>\n </div>\n} @else if (needsContainer()) {\n <div [class]=\"containerClasses()\" [attr.data-slot]=\"'input-container'\">\n @if (prefix()) {\n <span class=\"
|
|
7184
|
+
}, template: "@if (skeleton()) {\n <ui-skeleton class=\"h-9 w-full rounded-md\" />\n} @else if (isFloating()) {\n <div class=\"relative\" [attr.data-slot]=\"'input-floating'\" [attr.data-variant]=\"effectiveVariant()\">\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"labelIsActive() ? placeholder() : ''\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n <label [for]=\"resolvedId()\" [class]=\"floatingLabelClasses()\" [attr.data-active]=\"labelIsActive() ? '' : null\">{{ label() }}</label>\n </div>\n} @else if (needsContainer()) {\n <div [class]=\"containerClasses()\" [attr.data-slot]=\"'input-container'\">\n @if (prefix()) {\n <span [class]=\"prefixClasses()\">{{ prefix() }}</span>\n }\n <input\n [class]=\"innerClasses()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n @if (clearable() && value()) {\n <button\n type=\"button\"\n (click)=\"clearValue()\"\n tabindex=\"-1\"\n [class]=\"clearButtonClasses()\"\n aria-label=\"Clear\"\n >\n <ui-icon name=\"x\" class=\"size-3.5\" />\n </button>\n }\n @if (loading()) {\n <div [class]=\"spinnerClasses()\">\n <ui-spinner size=\"xs\" />\n </div>\n }\n @if (suffix() && !loading()) {\n <span [class]=\"suffixClasses()\">{{ suffix() }}</span>\n }\n </div>\n} @else {\n <input\n [class]=\"classes()\"\n [type]=\"type()\"\n [disabled]=\"isDisabled()\"\n [placeholder]=\"placeholder()\"\n [attr.id]=\"resolvedId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.inputmode]=\"inputMode()\"\n [attr.lang]=\"lang()\"\n [attr.data-slot]=\"'input'\"\n #inputRef\n [ngModel]=\"value()\"\n (ngModelChange)=\"onValueChange($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n}\n", styles: [":host{--_d: var(--density-input, var(--density, 1))}@layer components{[data-slot=input]{height:calc(2.25rem * var(--_d));padding-inline:calc(.75rem * var(--_d));padding-block:calc(.25rem * var(--_d))}[data-slot=input-container]{height:calc(2.25rem * var(--_d))}[data-slot=input-floating]{padding-top:calc(1.5rem * var(--_d))}[data-slot=input-floating]>label{inset-inline-start:calc(.75rem * var(--_d));top:calc(2.625rem * var(--_d));transform:translateY(-50%)}[data-slot=input-floating][data-variant=underline]>label,[data-slot=input-floating][data-variant=ghost]>label{inset-inline-start:0}[data-slot=input-floating]>label[data-active]{inset-inline-start:0;top:calc(1.125rem * var(--_d));transform:translateY(-100%)}}\n"] }]
|
|
7077
7185
|
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], elementId: [{ type: i0.Input, args: [{ isSignal: true, alias: "elementId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], skeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeleton", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], floating: [{ type: i0.Input, args: [{ isSignal: true, alias: "floating", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputMode", required: false }] }], lang: [{ type: i0.Input, args: [{ isSignal: true, alias: "lang", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputRef: [{ type: i0.ViewChild, args: ['inputRef', { isSignal: true }] }] } });
|
|
7078
7186
|
|
|
7079
7187
|
class CheckboxComponent {
|
|
@@ -9642,20 +9750,114 @@ function runAiTask(provider, request) {
|
|
|
9642
9750
|
const EMPTY_RECORD = Object.freeze({});
|
|
9643
9751
|
/** Per-instance counter for unique element ids (e.g. inline edit-error links). */
|
|
9644
9752
|
let dataTableUid = 0;
|
|
9753
|
+
/** Ids for rows that have no `id` and cannot be serialised (circular, BigInt-holding). Stable per row object. */
|
|
9754
|
+
const identityRowIds = new WeakMap();
|
|
9755
|
+
let identityRowIdSeq = 0;
|
|
9756
|
+
/** A row without an `id` is identified by its content; it must never throw, whatever the row holds. */
|
|
9757
|
+
function contentRowId(row) {
|
|
9758
|
+
try {
|
|
9759
|
+
return JSON.stringify(row, (...[, value]) => (typeof value === "bigint" ? value.toString() : value)) ?? "";
|
|
9760
|
+
}
|
|
9761
|
+
catch {
|
|
9762
|
+
// Circular structure: JSON cannot describe it, so fall back to the row's identity.
|
|
9763
|
+
if (typeof row !== "object" || row === null)
|
|
9764
|
+
return String(row);
|
|
9765
|
+
let id = identityRowIds.get(row);
|
|
9766
|
+
if (id === undefined) {
|
|
9767
|
+
id = `row-identity-${identityRowIdSeq++}`;
|
|
9768
|
+
identityRowIds.set(row, id);
|
|
9769
|
+
}
|
|
9770
|
+
return id;
|
|
9771
|
+
}
|
|
9772
|
+
}
|
|
9645
9773
|
const DEFAULT_GET_ROW_ID = (row) => {
|
|
9646
9774
|
const rec = row;
|
|
9647
|
-
const id = rec[
|
|
9775
|
+
const id = rec["id"];
|
|
9648
9776
|
if (id == null)
|
|
9649
|
-
return
|
|
9777
|
+
return contentRowId(row);
|
|
9650
9778
|
return stringifyValue(id);
|
|
9651
9779
|
};
|
|
9780
|
+
/**
|
|
9781
|
+
* What the inline text or number field shows for a cell value: the string form of a string, number, boolean or bigint,
|
|
9782
|
+
* a Date as `Date.toString()`, an array as its items joined by commas, and nothing for null, undefined or anything else
|
|
9783
|
+
* (an object has no text to edit).
|
|
9784
|
+
*/
|
|
9785
|
+
function editorTextFor(value) {
|
|
9786
|
+
if (isScalarOptionValue(value))
|
|
9787
|
+
return String(value);
|
|
9788
|
+
if (Array.isArray(value))
|
|
9789
|
+
return value.map((item) => (isScalarOptionValue(item) ? String(item) : '')).join(',');
|
|
9790
|
+
return value instanceof Date ? value.toString() : '';
|
|
9791
|
+
}
|
|
9792
|
+
/** A select option's value that has a string form to match against (data from JSON stores 1 as '1'). */
|
|
9793
|
+
function isScalarOptionValue(value) {
|
|
9794
|
+
return ['string', 'number', 'boolean', 'bigint'].includes(typeof value);
|
|
9795
|
+
}
|
|
9796
|
+
/** Inputs whose keys are not the control's own: a checkbox or button has no arrows, caret or undo (a range and a radio do). */
|
|
9797
|
+
const NON_TEXT_INPUT_TYPES = new Set(['checkbox', 'button', 'submit', 'reset', 'image', 'file', 'color', 'hidden']);
|
|
9798
|
+
/** The columns the grid draws itself (selection, expander, actions), as opposed to data columns. */
|
|
9799
|
+
function isGridColumnKey(key) {
|
|
9800
|
+
return key === '_selection' || key === '_expander' || key === '_actions';
|
|
9801
|
+
}
|
|
9802
|
+
/** Widget roles whose keys (arrows, Home/End, Enter, type-ahead, Escape) belong to the widget. The grid's own roles are not here. */
|
|
9803
|
+
const KEY_OWNING_ROLES = [
|
|
9804
|
+
'textbox', 'combobox', 'searchbox', 'spinbutton', 'slider', 'listbox', 'option', 'menu', 'menuitem',
|
|
9805
|
+
'menuitemcheckbox', 'menuitemradio', 'menubar', 'radiogroup', 'radio', 'tablist', 'tab', 'tree', 'treeitem',
|
|
9806
|
+
'scrollbar', 'dialog', 'application', 'toolbar',
|
|
9807
|
+
].map((role) => `[role="${role}"]`).join(', ');
|
|
9808
|
+
/**
|
|
9809
|
+
* Whether a key comes from a control that owns its keys: caret movement, the arrows of a slider, radio group, list,
|
|
9810
|
+
* menu or tree, Enter, its own undo and copy, type-ahead, Escape. `path` is the event's composed path, origin
|
|
9811
|
+
* first, so a control inside a shadow root is seen and the role search stops at `boundary`: a grid embedded in a
|
|
9812
|
+
* textbox or combobox of the host page is not itself one.
|
|
9813
|
+
*/
|
|
9814
|
+
function ownsItsKeys(path, boundary) {
|
|
9815
|
+
const origin = path[0];
|
|
9816
|
+
if (origin instanceof HTMLTextAreaElement || origin instanceof HTMLSelectElement)
|
|
9817
|
+
return true;
|
|
9818
|
+
if (origin instanceof HTMLInputElement && !NON_TEXT_INPUT_TYPES.has(origin.type))
|
|
9819
|
+
return true;
|
|
9820
|
+
for (const node of path) {
|
|
9821
|
+
if (node === boundary)
|
|
9822
|
+
break;
|
|
9823
|
+
if (!(node instanceof Element))
|
|
9824
|
+
continue;
|
|
9825
|
+
// isContentEditable is inherited from outside the grid too, so the attribute is read on the way up.
|
|
9826
|
+
const editable = node instanceof HTMLElement && (node.contentEditable === 'true' || node.contentEditable === 'plaintext-only');
|
|
9827
|
+
if (editable || node.matches(KEY_OWNING_ROLES))
|
|
9828
|
+
return true;
|
|
9829
|
+
}
|
|
9830
|
+
return false;
|
|
9831
|
+
}
|
|
9832
|
+
/** Mirrors a data row's selection to assistive tech, and clears it when the grid stops being selectable. */
|
|
9833
|
+
function stampRowSelection(row, selectable) {
|
|
9834
|
+
if (!(row instanceof HTMLElement) || row.dataset['rowIndex'] === undefined)
|
|
9835
|
+
return;
|
|
9836
|
+
if (selectable)
|
|
9837
|
+
row.setAttribute('aria-selected', String(row.dataset['state'] === 'selected'));
|
|
9838
|
+
else
|
|
9839
|
+
row.removeAttribute('aria-selected');
|
|
9840
|
+
}
|
|
9841
|
+
/**
|
|
9842
|
+
* Quotes a cell holding a tab, line break or quote the way Excel does, so
|
|
9843
|
+
* parseClipboardGrid reads our own copy back into the same cells.
|
|
9844
|
+
*/
|
|
9845
|
+
function toClipboardCell(cell, quotedChars) {
|
|
9846
|
+
const guarded = guardSpreadsheetFormula(cell);
|
|
9847
|
+
return quotedChars.test(guarded) ? `"${guarded.replaceAll('"', '""')}"` : guarded;
|
|
9848
|
+
}
|
|
9849
|
+
// A one-column copy has no tab for parseClipboardGrid to find, so it reads the text as CSV: a comma in a
|
|
9850
|
+
// cell must be quoted there or the paste splits that cell in two.
|
|
9851
|
+
const QUOTED_IN_TSV = /[\t\r\n"]/;
|
|
9852
|
+
const QUOTED_IN_SINGLE_COLUMN = /[\t\r\n",]/;
|
|
9652
9853
|
/**
|
|
9653
9854
|
* Serialises a grid as the TSV every copy path writes: one line per row, cells
|
|
9654
9855
|
* formula-guarded so pasting into a spreadsheet never runs a cell as a formula.
|
|
9655
9856
|
* The paste path undoes the guard with `restoreSpreadsheetText`.
|
|
9656
9857
|
*/
|
|
9657
9858
|
function toClipboardText(grid) {
|
|
9658
|
-
|
|
9859
|
+
const quotedChars = grid.every((cells) => cells.length === 1) ? QUOTED_IN_SINGLE_COLUMN : QUOTED_IN_TSV;
|
|
9860
|
+
return grid.map((cells) => cells.map((cell) => toClipboardCell(cell, quotedChars)).join("\t")).join("\n");
|
|
9659
9861
|
}
|
|
9660
9862
|
/**
|
|
9661
9863
|
* Whether two requests describe the same page of data.
|
|
@@ -9722,7 +9924,7 @@ function resolveColumnMinWidth(col) {
|
|
|
9722
9924
|
if (col.minWidth)
|
|
9723
9925
|
return col.minWidth;
|
|
9724
9926
|
const key = col.accessorKey;
|
|
9725
|
-
const isSpecial = key
|
|
9927
|
+
const isSpecial = isGridColumnKey(key);
|
|
9726
9928
|
return isSpecial ? "0px" : DEFAULT_COLUMN_MIN_WIDTH;
|
|
9727
9929
|
}
|
|
9728
9930
|
/** The pixel floor resize and auto-fit clamp to — `minWidth` is read as pixels. */
|
|
@@ -9797,9 +9999,7 @@ class DataTableComponent {
|
|
|
9797
9999
|
}));
|
|
9798
10000
|
}
|
|
9799
10001
|
applyGlobalFilterToData(data, globalFilterValue) {
|
|
9800
|
-
const columns = this.enhancedColumns().filter((col) => col.accessorKey
|
|
9801
|
-
col.accessorKey !== "_expander" &&
|
|
9802
|
-
col.accessorKey !== "_actions");
|
|
10002
|
+
const columns = this.enhancedColumns().filter((col) => !isGridColumnKey(col.accessorKey));
|
|
9803
10003
|
const globalFilterFn = this.globalFilterFn();
|
|
9804
10004
|
if (globalFilterFn) {
|
|
9805
10005
|
return data.filter((row) => globalFilterFn(row, globalFilterValue, columns));
|
|
@@ -9807,7 +10007,7 @@ class DataTableComponent {
|
|
|
9807
10007
|
const globallyFilterableColumns = columns.filter((col) => col.enableGlobalFilter !== false);
|
|
9808
10008
|
return data.filter((row) => globallyFilterableColumns.some((col) => {
|
|
9809
10009
|
const value = this.getCellValue(row, col.accessorKey, col);
|
|
9810
|
-
return
|
|
10010
|
+
return cellText(value).toLowerCase().includes(globalFilterValue);
|
|
9811
10011
|
}));
|
|
9812
10012
|
}
|
|
9813
10013
|
applyColumnFiltersToData(data) {
|
|
@@ -9875,7 +10075,7 @@ class DataTableComponent {
|
|
|
9875
10075
|
const globallyFilterable = columns.filter((col) => col.enableGlobalFilter !== false);
|
|
9876
10076
|
return globallyFilterable.some((col) => {
|
|
9877
10077
|
const value = this.getCellValue(row, col.accessorKey, col);
|
|
9878
|
-
return
|
|
10078
|
+
return cellText(value).toLowerCase().includes(globalFilterValue);
|
|
9879
10079
|
});
|
|
9880
10080
|
}
|
|
9881
10081
|
filteredTree_matchesColumns(row, colFilters, columns) {
|
|
@@ -10088,7 +10288,7 @@ class DataTableComponent {
|
|
|
10088
10288
|
this.EMPTY_RECORD = EMPTY_RECORD;
|
|
10089
10289
|
this._document = inject(DOCUMENT);
|
|
10090
10290
|
this._el = inject(ElementRef);
|
|
10091
|
-
this.
|
|
10291
|
+
this._resizeGrowthSign = 1;
|
|
10092
10292
|
/**
|
|
10093
10293
|
* The row array. A `model`, and the table *does* write back to it: inline
|
|
10094
10294
|
* edits committed through a column `valueSetter`, fill-handle, paste and
|
|
@@ -10262,6 +10462,17 @@ class DataTableComponent {
|
|
|
10262
10462
|
this.editError = output();
|
|
10263
10463
|
this.editingCell = signal(null, ...(ngDevMode ? [{ debugName: "editingCell" }] : /* istanbul ignore next */ []));
|
|
10264
10464
|
this.editValue = signal(null, ...(ngDevMode ? [{ debugName: "editValue" }] : /* istanbul ignore next */ []));
|
|
10465
|
+
/**
|
|
10466
|
+
* The text the number or text input shows: what it started with ({@link editorTextFor}), then the text of each
|
|
10467
|
+
* keystroke that is a value. The input is bound to this, not to {@link editValue}: typing "-0" parses to -0, and
|
|
10468
|
+
* writing that back would turn the field into "0" and lose the minus sign. It stays in step with
|
|
10469
|
+
* {@link editValue}, so a re-created input shows what commits.
|
|
10470
|
+
* The binding is the input's `value` ATTRIBUTE (its default text), never its `value` property: a property write
|
|
10471
|
+
* from a render that lags a keystroke replaces the field's live text ("1." becomes "1", the caret jumps to the
|
|
10472
|
+
* start and the next keys land in front), while a field the user has typed in ignores a changed default. The one
|
|
10473
|
+
* place the model changes behind the field's back is re-opening the cell being edited: {@link resetEditField}.
|
|
10474
|
+
*/
|
|
10475
|
+
this.editText = signal('', ...(ngDevMode ? [{ debugName: "editText" }] : /* istanbul ignore next */ []));
|
|
10265
10476
|
this.cellEditError = signal(null, ...(ngDevMode ? [{ debugName: "cellEditError" }] : /* istanbul ignore next */ []));
|
|
10266
10477
|
/** Stable id for the inline edit-error message, linked via `aria-describedby`. */
|
|
10267
10478
|
this.cellEditErrorId = `ui-data-table-cell-edit-error-${dataTableUid++}`;
|
|
@@ -10863,9 +11074,7 @@ class DataTableComponent {
|
|
|
10863
11074
|
return this.data();
|
|
10864
11075
|
const globalFilterValue = this.globalFilter().toLowerCase();
|
|
10865
11076
|
const colFilters = this.columnFilters();
|
|
10866
|
-
const columns = this.enhancedColumns().filter((col) => col.accessorKey
|
|
10867
|
-
col.accessorKey !== "_expander" &&
|
|
10868
|
-
col.accessorKey !== "_actions");
|
|
11077
|
+
const columns = this.enhancedColumns().filter((col) => !isGridColumnKey(col.accessorKey));
|
|
10869
11078
|
const hasGlobalFilter = !!globalFilterValue;
|
|
10870
11079
|
const hasColumnFilters = Object.keys(colFilters).some((k) => !this.isFilterValueEmpty(colFilters[k]));
|
|
10871
11080
|
if (!hasGlobalFilter && !hasColumnFilters)
|
|
@@ -11082,6 +11291,16 @@ class DataTableComponent {
|
|
|
11082
11291
|
}
|
|
11083
11292
|
return map;
|
|
11084
11293
|
}, ...(ngDevMode ? [{ debugName: "_sortLookup" }] : /* istanbul ignore next */ []));
|
|
11294
|
+
/** Every column the table was given, hidden ones included, by accessor key (the first wins a duplicate). */
|
|
11295
|
+
this.columnsByKey = computed(() => {
|
|
11296
|
+
const byKey = new Map();
|
|
11297
|
+
for (const col of this.columns()) {
|
|
11298
|
+
const key = String(col.accessorKey);
|
|
11299
|
+
if (!byKey.has(key))
|
|
11300
|
+
byKey.set(key, col);
|
|
11301
|
+
}
|
|
11302
|
+
return byKey;
|
|
11303
|
+
}, ...(ngDevMode ? [{ debugName: "columnsByKey" }] : /* istanbul ignore next */ []));
|
|
11085
11304
|
this.enhancedColumns = computed(() => {
|
|
11086
11305
|
const cols = this.columns();
|
|
11087
11306
|
const widths = this.columnWidths();
|
|
@@ -11214,9 +11433,20 @@ class DataTableComponent {
|
|
|
11214
11433
|
this.processedData();
|
|
11215
11434
|
this.enhancedColumns();
|
|
11216
11435
|
this.virtualTotalRows();
|
|
11436
|
+
this.rowSelection();
|
|
11437
|
+
this.enableRowSelection();
|
|
11217
11438
|
this.stampGridSemantics();
|
|
11218
11439
|
});
|
|
11219
11440
|
// protected, not private: nothing reads this handle; the field only creates the effect in field order.
|
|
11441
|
+
this._focusedCellDomEffect = afterRenderEffect(() => {
|
|
11442
|
+
this.focusedCell();
|
|
11443
|
+
this.virtualRowRange();
|
|
11444
|
+
this.processedData();
|
|
11445
|
+
this.enhancedColumns();
|
|
11446
|
+
this.editingCell();
|
|
11447
|
+
this.syncFocusedCellDom();
|
|
11448
|
+
});
|
|
11449
|
+
// protected, not private: nothing reads this handle; the field only creates the effect in field order.
|
|
11220
11450
|
this._renderedRowsEffect = effect(() => {
|
|
11221
11451
|
const rows = this.processedData();
|
|
11222
11452
|
untracked(() => this.reconcileIndexedState(rows));
|
|
@@ -11296,10 +11526,7 @@ class DataTableComponent {
|
|
|
11296
11526
|
}
|
|
11297
11527
|
return map;
|
|
11298
11528
|
}, ...(ngDevMode ? [{ debugName: "footerValues" }] : /* istanbul ignore next */ []));
|
|
11299
|
-
this._baseCellClass = computed(() => ({
|
|
11300
|
-
normal: cn("whitespace-nowrap overflow-hidden text-ellipsis", "bg-background", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"),
|
|
11301
|
-
tree: cn("whitespace-nowrap overflow-hidden text-ellipsis", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"),
|
|
11302
|
-
}), ...(ngDevMode ? [{ debugName: "_baseCellClass" }] : /* istanbul ignore next */ []));
|
|
11529
|
+
this._baseCellClass = computed(() => cn("whitespace-nowrap overflow-hidden text-ellipsis", this.showRowBorders() && "border-b", this.showColumnBorders() && "border-r"), ...(ngDevMode ? [{ debugName: "_baseCellClass" }] : /* istanbul ignore next */ []));
|
|
11303
11530
|
// `pointer-coarse:h-auto`: a header cell grows to hold its 44px touch controls
|
|
11304
11531
|
// instead of clipping them at the fixed desktop header height.
|
|
11305
11532
|
this._headerClassMap = computed(() => {
|
|
@@ -11428,9 +11655,7 @@ class DataTableComponent {
|
|
|
11428
11655
|
this._lastTapColumnKey = "";
|
|
11429
11656
|
this.navigableColumnKeys = computed(() => {
|
|
11430
11657
|
return this.enhancedColumns()
|
|
11431
|
-
.filter((c) => c.accessorKey
|
|
11432
|
-
c.accessorKey !== "_expander" &&
|
|
11433
|
-
c.accessorKey !== "_actions")
|
|
11658
|
+
.filter((c) => !isGridColumnKey(c.accessorKey))
|
|
11434
11659
|
.map((c) => String(c.accessorKey));
|
|
11435
11660
|
}, ...(ngDevMode ? [{ debugName: "navigableColumnKeys" }] : /* istanbul ignore next */ []));
|
|
11436
11661
|
this.totalVisibleRows = computed(() => {
|
|
@@ -11849,8 +12074,7 @@ class DataTableComponent {
|
|
|
11849
12074
|
/** ARIA `aria-sort` value for a header cell — `null` for non-sortable columns. */
|
|
11850
12075
|
getAriaSort(col) {
|
|
11851
12076
|
const key = String(col.accessorKey);
|
|
11852
|
-
|
|
11853
|
-
if (isSpecialColumn || col.enableSorting === false) {
|
|
12077
|
+
if (isGridColumnKey(key) || col.enableSorting === false) {
|
|
11854
12078
|
return null;
|
|
11855
12079
|
}
|
|
11856
12080
|
const direction = this.getSortDirection(col.accessorKey);
|
|
@@ -11976,7 +12200,7 @@ class DataTableComponent {
|
|
|
11976
12200
|
const hasUserTreeExpander = allCols.some(c => c.treeExpander);
|
|
11977
12201
|
const targetIdx = hasUserTreeExpander
|
|
11978
12202
|
? cols.findIndex(c => c.treeExpander)
|
|
11979
|
-
: cols.findIndex(c => c.accessorKey
|
|
12203
|
+
: cols.findIndex(c => !isGridColumnKey(c.accessorKey));
|
|
11980
12204
|
if (targetIdx !== -1) {
|
|
11981
12205
|
cols[targetIdx] = { ...cols[targetIdx], _isTreeExpanderHost: true };
|
|
11982
12206
|
}
|
|
@@ -12035,9 +12259,7 @@ class DataTableComponent {
|
|
|
12035
12259
|
hasFloatingFilter(col) {
|
|
12036
12260
|
if (col.floatingFilter === false)
|
|
12037
12261
|
return false;
|
|
12038
|
-
if (col.accessorKey
|
|
12039
|
-
col.accessorKey === '_expander' ||
|
|
12040
|
-
col.accessorKey === '_actions') {
|
|
12262
|
+
if (isGridColumnKey(col.accessorKey)) {
|
|
12041
12263
|
return false;
|
|
12042
12264
|
}
|
|
12043
12265
|
if (col.floatingFilterComponent)
|
|
@@ -12284,12 +12506,19 @@ class DataTableComponent {
|
|
|
12284
12506
|
* `aria-colindex` is a gap; a wrong one sends the user to the wrong column.
|
|
12285
12507
|
*/
|
|
12286
12508
|
const columnsWindowed = this.virtualVisibleMiddleColumns().length < this.scrollableColumns().length;
|
|
12509
|
+
// Selection state is already drawn as data-state on every data-row branch; mirror it for assistive tech.
|
|
12510
|
+
const selectable = this.enableRowSelection();
|
|
12511
|
+
if (selectable)
|
|
12512
|
+
grid.setAttribute('aria-multiselectable', 'true');
|
|
12513
|
+
else
|
|
12514
|
+
grid.removeAttribute('aria-multiselectable');
|
|
12287
12515
|
let dataRow = 0;
|
|
12288
12516
|
for (const [position, row] of rows.entries()) {
|
|
12289
12517
|
const index = isHeaderRow(row)
|
|
12290
12518
|
? position + 1
|
|
12291
12519
|
: headerRows + offset + ++dataRow;
|
|
12292
12520
|
row.setAttribute('aria-rowindex', String(index));
|
|
12521
|
+
stampRowSelection(row, selectable);
|
|
12293
12522
|
if (columnsWindowed)
|
|
12294
12523
|
continue;
|
|
12295
12524
|
const cells = Array.from(row.children).filter(cell => !isDecorative(cell));
|
|
@@ -12303,6 +12532,49 @@ class DataTableComponent {
|
|
|
12303
12532
|
grid.setAttribute('aria-rowcount', String(headerRows + dataRows));
|
|
12304
12533
|
grid.setAttribute('aria-colcount', String(this.enhancedColumns().length));
|
|
12305
12534
|
}
|
|
12535
|
+
/**
|
|
12536
|
+
* Roving tabindex: the focused cell is the one tab stop inside the grid and
|
|
12537
|
+
* holds real DOM focus, so assistive tech announces it and the context-menu
|
|
12538
|
+
* key targets it. Done on the rendered DOM for the same reason as
|
|
12539
|
+
* {@link stampGridSemantics}: rows come from many template branches.
|
|
12540
|
+
*
|
|
12541
|
+
* DOM focus only follows when focus is already on the scroller or a data
|
|
12542
|
+
* row, so a programmatic `focusedCell` change never steals it from a filter
|
|
12543
|
+
* input, an editor or the rest of the page. The scroller stays the tab stop
|
|
12544
|
+
* while no focused cell is rendered (none picked yet, or scrolled out of the
|
|
12545
|
+
* virtual window), so the grid is never unreachable.
|
|
12546
|
+
*/
|
|
12547
|
+
syncFocusedCellDom() {
|
|
12548
|
+
const container = this.scrollContainerRef()?.nativeElement;
|
|
12549
|
+
if (!container)
|
|
12550
|
+
return;
|
|
12551
|
+
// Read before stripping tabindex: removing it from the focused cell blurs it.
|
|
12552
|
+
const active = this._document.activeElement;
|
|
12553
|
+
for (const stale of Array.from(container.querySelectorAll('[data-row-index] [data-column][tabindex]'))) {
|
|
12554
|
+
stale.removeAttribute('tabindex');
|
|
12555
|
+
}
|
|
12556
|
+
const focused = this.focusedCell();
|
|
12557
|
+
const cell = focused === null ? undefined : this.renderedCell(container, focused);
|
|
12558
|
+
container.tabIndex = cell ? -1 : 0;
|
|
12559
|
+
if (!cell)
|
|
12560
|
+
return;
|
|
12561
|
+
cell.tabIndex = 0;
|
|
12562
|
+
const focusIsInGrid = active === container || (active !== null && active !== cell && container.contains(active) && active.closest('[data-row-index]') !== null);
|
|
12563
|
+
if (focusIsInGrid && this.editingCell() === null && !active?.closest('input,textarea,select,[contenteditable]')) {
|
|
12564
|
+
cell.focus({ preventScroll: true });
|
|
12565
|
+
}
|
|
12566
|
+
}
|
|
12567
|
+
renderedCell(container, target) {
|
|
12568
|
+
for (const row of Array.from(container.querySelectorAll('[data-row-index]'))) {
|
|
12569
|
+
if (row.dataset['rowIndex'] !== String(target.rowIndex))
|
|
12570
|
+
continue;
|
|
12571
|
+
for (const cell of Array.from(row.querySelectorAll('[data-column]'))) {
|
|
12572
|
+
if (cell.dataset['column'] === target.columnKey)
|
|
12573
|
+
return cell;
|
|
12574
|
+
}
|
|
12575
|
+
}
|
|
12576
|
+
return undefined;
|
|
12577
|
+
}
|
|
12306
12578
|
/**
|
|
12307
12579
|
* Rendered indexes move when rows are collapsed, paged away, sorted or
|
|
12308
12580
|
* replaced. The editor holds a pending draft for one row, so it follows that
|
|
@@ -12411,9 +12683,11 @@ class DataTableComponent {
|
|
|
12411
12683
|
* the depth indent itself comes from {@link getTreeCellStyle}.
|
|
12412
12684
|
*/
|
|
12413
12685
|
getCellClass(col, rowIndex, treeDepth) {
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12686
|
+
// A cell paints over its row, so a plain cell stays transparent or the row's hover and selected tint would
|
|
12687
|
+
// never show. A pinned cell must be opaque so scrolled columns do not show through; its row tint is layered
|
|
12688
|
+
// on by data-table.component.css (.pinned-cell).
|
|
12689
|
+
const pinnedClass = col.sticky || col._pin ? " bg-background pinned-cell" : "";
|
|
12690
|
+
const base = treeDepth === undefined ? this._baseCellClass() + pinnedClass : this._baseCellClass();
|
|
12417
12691
|
const key = String(col.accessorKey);
|
|
12418
12692
|
const focused = this.focusedCell();
|
|
12419
12693
|
if (rowIndex !== undefined &&
|
|
@@ -13042,8 +13316,10 @@ class DataTableComponent {
|
|
|
13042
13316
|
* the first null/undefined link rather than throwing.
|
|
13043
13317
|
*/
|
|
13044
13318
|
getCellValue(row, key, column) {
|
|
13045
|
-
|
|
13046
|
-
|
|
13319
|
+
// An addon (the pivot) asks by key alone; the column's accessorFn is still the cell's value, hidden or not.
|
|
13320
|
+
const resolved = column ?? this.columnsByKey().get(String(key));
|
|
13321
|
+
if (resolved?.accessorFn) {
|
|
13322
|
+
return resolved.accessorFn(row);
|
|
13047
13323
|
}
|
|
13048
13324
|
if (typeof key === "string" && key.includes(".")) {
|
|
13049
13325
|
return key.split(".").reduce((value, segment) => {
|
|
@@ -13191,12 +13467,8 @@ class DataTableComponent {
|
|
|
13191
13467
|
const onlyVisible = options?.onlyVisible !== false;
|
|
13192
13468
|
const onlyFiltered = options?.onlyFiltered !== false;
|
|
13193
13469
|
const columns = onlyVisible
|
|
13194
|
-
? this.enhancedColumns().filter((col) => col.accessorKey
|
|
13195
|
-
|
|
13196
|
-
col.accessorKey !== "_actions")
|
|
13197
|
-
: this.columns().filter((col) => col.accessorKey !== "_selection" &&
|
|
13198
|
-
col.accessorKey !== "_expander" &&
|
|
13199
|
-
col.accessorKey !== "_actions");
|
|
13470
|
+
? this.enhancedColumns().filter((col) => !isGridColumnKey(col.accessorKey))
|
|
13471
|
+
: this.columns().filter((col) => !isGridColumnKey(col.accessorKey));
|
|
13200
13472
|
const rows = customRows ?? (onlyFiltered ? this.sortedData() : this.data());
|
|
13201
13473
|
const result = [];
|
|
13202
13474
|
if (includeHeaders) {
|
|
@@ -13275,9 +13547,7 @@ class DataTableComponent {
|
|
|
13275
13547
|
async copyRowToClipboard(row) {
|
|
13276
13548
|
if (!this.enableCopy())
|
|
13277
13549
|
return;
|
|
13278
|
-
const columns = this.enhancedColumns().filter((col) => col.accessorKey
|
|
13279
|
-
col.accessorKey !== "_expander" &&
|
|
13280
|
-
col.accessorKey !== "_actions");
|
|
13550
|
+
const columns = this.enhancedColumns().filter((col) => !isGridColumnKey(col.accessorKey));
|
|
13281
13551
|
const values = columns.map((col) => this.getCellStringValue(row, col));
|
|
13282
13552
|
await navigator.clipboard.writeText(toClipboardText([values]));
|
|
13283
13553
|
}
|
|
@@ -13289,9 +13559,7 @@ class DataTableComponent {
|
|
|
13289
13559
|
async copySelectedToClipboard() {
|
|
13290
13560
|
if (!this.enableCopy())
|
|
13291
13561
|
return;
|
|
13292
|
-
const columns = this.enhancedColumns().filter((col) => col.accessorKey
|
|
13293
|
-
col.accessorKey !== "_expander" &&
|
|
13294
|
-
col.accessorKey !== "_actions");
|
|
13562
|
+
const columns = this.enhancedColumns().filter((col) => !isGridColumnKey(col.accessorKey));
|
|
13295
13563
|
const selectedIds = this.rowSelection();
|
|
13296
13564
|
// Grouping reorders the rows on screen; the copy follows the screen, collapsed groups included.
|
|
13297
13565
|
const inDrawnOrder = this.groupingActive()
|
|
@@ -13329,9 +13597,13 @@ class DataTableComponent {
|
|
|
13329
13597
|
*/
|
|
13330
13598
|
onCellClick(rowIndex, col, event) {
|
|
13331
13599
|
const key = String(col.accessorKey);
|
|
13332
|
-
if (key
|
|
13600
|
+
if (isGridColumnKey(key))
|
|
13333
13601
|
return;
|
|
13334
|
-
|
|
13602
|
+
// A click must not reach onTableClick (it clears the focus), and a key from a control inside the cell stays
|
|
13603
|
+
// with that control. Only Enter on the cell itself goes on to onTableKeydown, where it opens the editor.
|
|
13604
|
+
const passesToGrid = 'key' in event && event.key === 'Enter' && event.target === event.currentTarget;
|
|
13605
|
+
if (!passesToGrid)
|
|
13606
|
+
event.stopPropagation();
|
|
13335
13607
|
// When range selection is on, focus + range are managed by the pointer-drag
|
|
13336
13608
|
// handler (onTableMouseDown); a plain click just focuses here for keyboard.
|
|
13337
13609
|
this.focusedCell.set({ rowIndex, columnKey: key });
|
|
@@ -13348,7 +13620,7 @@ class DataTableComponent {
|
|
|
13348
13620
|
const rowIndex = Number(rawRow);
|
|
13349
13621
|
if (!Number.isFinite(rowIndex))
|
|
13350
13622
|
return null;
|
|
13351
|
-
const special = columnKey
|
|
13623
|
+
const special = isGridColumnKey(columnKey);
|
|
13352
13624
|
return special ? null : { rowIndex, columnKey };
|
|
13353
13625
|
}
|
|
13354
13626
|
/** Delegated mousedown — starts a click-drag range selection (left button only). */
|
|
@@ -13416,9 +13688,12 @@ class DataTableComponent {
|
|
|
13416
13688
|
*/
|
|
13417
13689
|
onCellDblClick(rowIndex, col, event) {
|
|
13418
13690
|
const key = String(col.accessorKey);
|
|
13419
|
-
if (key
|
|
13691
|
+
if (isGridColumnKey(key))
|
|
13420
13692
|
return;
|
|
13421
13693
|
event.stopPropagation();
|
|
13694
|
+
// Inside an open text field a double-click selects a word: opening the cell again would throw the typed text away.
|
|
13695
|
+
if (this.isEditing(rowIndex, key) && this.openEditInput() !== null)
|
|
13696
|
+
return;
|
|
13422
13697
|
this.startEditing(rowIndex, key);
|
|
13423
13698
|
}
|
|
13424
13699
|
/**
|
|
@@ -13428,8 +13703,16 @@ class DataTableComponent {
|
|
|
13428
13703
|
*/
|
|
13429
13704
|
onCellTouchEnd(event, rowIndex, col) {
|
|
13430
13705
|
const key = String(col.accessorKey);
|
|
13431
|
-
if (key
|
|
13706
|
+
if (isGridColumnKey(key))
|
|
13707
|
+
return;
|
|
13708
|
+
// Taps inside an open text field place the caret or select a word; they are not a request to open the cell again,
|
|
13709
|
+
// and they must not pair with a tap made before it opened.
|
|
13710
|
+
if (this.isEditing(rowIndex, key) && this.openEditInput() !== null) {
|
|
13711
|
+
this._lastTapTime = 0;
|
|
13712
|
+
this._lastTapRowIndex = -1;
|
|
13713
|
+
this._lastTapColumnKey = "";
|
|
13432
13714
|
return;
|
|
13715
|
+
}
|
|
13433
13716
|
const now = Date.now();
|
|
13434
13717
|
const isSameCell = this._lastTapRowIndex === rowIndex && this._lastTapColumnKey === key;
|
|
13435
13718
|
if (isSameCell && now - this._lastTapTime < this.DOUBLE_TAP_MAX_DELAY) {
|
|
@@ -13482,8 +13765,25 @@ class DataTableComponent {
|
|
|
13482
13765
|
* (`Ctrl/Cmd+V`), undo/redo (`Ctrl/Cmd+Z`/`Y`), then arrow/Home/End/Enter cell
|
|
13483
13766
|
* navigation. Each stage is gated by its feature input, and the first one to
|
|
13484
13767
|
* handle the event stops the chain.
|
|
13768
|
+
*
|
|
13769
|
+
* A control inside the grid that owns its keys (see `ownsItsKeys`: text
|
|
13770
|
+
* inputs, selects, contenteditable, slider / list / menu / tab / tree
|
|
13771
|
+
* roles, in a shadow root too) is left alone, as is anything that already
|
|
13772
|
+
* called `preventDefault` below the grid (a nested grid, a consumer's
|
|
13773
|
+
* control): the grid does not act on those. Known limit: a grid nested in a
|
|
13774
|
+
* cell leaves unhandled keys (arrows past its last row) to this one.
|
|
13775
|
+
*
|
|
13776
|
+
* Enter and F2 open the editor only when they come from the scroller or a
|
|
13777
|
+
* data cell and are not a held-key repeat; an Enter / F2 that opened an
|
|
13778
|
+
* editor does not propagate further.
|
|
13485
13779
|
*/
|
|
13486
13780
|
onTableKeydown(event) {
|
|
13781
|
+
// composedPath() starts at the real origin: `target` is retargeted to the host when the key comes from a shadow root.
|
|
13782
|
+
const path = event.composedPath();
|
|
13783
|
+
const fallback = event.target === null ? [] : [event.target];
|
|
13784
|
+
const origin = path.length > 0 ? path : fallback;
|
|
13785
|
+
if (event.defaultPrevented || ownsItsKeys(origin, this._el.nativeElement))
|
|
13786
|
+
return;
|
|
13487
13787
|
if (this.handleCopyKeydown(event))
|
|
13488
13788
|
return;
|
|
13489
13789
|
if (this.handlePasteKeydown(event))
|
|
@@ -13557,9 +13857,11 @@ class DataTableComponent {
|
|
|
13557
13857
|
case 'ArrowDown':
|
|
13558
13858
|
return { row: this.findNextEnabledRow(rowIndex, 1, totalRows), col: nextCol };
|
|
13559
13859
|
case 'ArrowLeft':
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13860
|
+
case 'ArrowRight': {
|
|
13861
|
+
// Arrows are visual; columns render right-to-left in RTL, so they swap.
|
|
13862
|
+
const step = (key === 'ArrowRight') === this.isRtl() ? -1 : 1;
|
|
13863
|
+
return { row: nextRow, col: Math.min(colKeys.length - 1, Math.max(0, nextCol + step)) };
|
|
13864
|
+
}
|
|
13563
13865
|
case 'Tab':
|
|
13564
13866
|
return this.computeTabTarget(shiftKey, rowIndex, colIndex, colKeys, totalRows);
|
|
13565
13867
|
case 'Home':
|
|
@@ -13588,10 +13890,42 @@ class DataTableComponent {
|
|
|
13588
13890
|
return { row: rowIndex + 1, col: 0 };
|
|
13589
13891
|
return { row: rowIndex, col: colIndex };
|
|
13590
13892
|
}
|
|
13893
|
+
isTabAtGridEdge(shiftKey, rowIndex, colIndex, colKeys, totalRows) {
|
|
13894
|
+
const target = this.computeTabTarget(shiftKey, rowIndex, colIndex, colKeys, totalRows);
|
|
13895
|
+
return target.row === rowIndex && target.col === colIndex;
|
|
13896
|
+
}
|
|
13591
13897
|
getPageSize() {
|
|
13592
13898
|
const container = this.scrollContainerRef()?.nativeElement;
|
|
13593
13899
|
return container ? Math.floor(container.clientHeight / this.effectiveRowHeight()) : 10;
|
|
13594
13900
|
}
|
|
13901
|
+
/** Enter / F2 open the editor only from the scroller or a data cell, not from a header or cell control that keeps its own Enter. */
|
|
13902
|
+
isEditKeyTarget(target) {
|
|
13903
|
+
if (target === null)
|
|
13904
|
+
return true;
|
|
13905
|
+
if (!(target instanceof HTMLElement))
|
|
13906
|
+
return false;
|
|
13907
|
+
if (target === this.scrollContainerRef()?.nativeElement)
|
|
13908
|
+
return true;
|
|
13909
|
+
const column = target.dataset['column'];
|
|
13910
|
+
return column !== undefined && !isGridColumnKey(column);
|
|
13911
|
+
}
|
|
13912
|
+
editFromKey(event) {
|
|
13913
|
+
const focused = this.focusedCell();
|
|
13914
|
+
if (!focused || !this.isEditKeyTarget(event.target))
|
|
13915
|
+
return;
|
|
13916
|
+
// A held key repeats past the commit that just returned focus here: it must not reopen the editor, and
|
|
13917
|
+
// it is claimed so an ancestor's Enter handler (a dialog's submit) does not fire on every repeat.
|
|
13918
|
+
if (event.repeat) {
|
|
13919
|
+
event.stopPropagation();
|
|
13920
|
+
return;
|
|
13921
|
+
}
|
|
13922
|
+
this.startEditing(focused.rowIndex, focused.columnKey);
|
|
13923
|
+
// Only an edit that opened has handled the key; otherwise an ancestor's Enter (a dialog's submit) still fires.
|
|
13924
|
+
if (this.editingCell() !== null) {
|
|
13925
|
+
event.preventDefault();
|
|
13926
|
+
event.stopPropagation();
|
|
13927
|
+
}
|
|
13928
|
+
}
|
|
13595
13929
|
handleNavigationKeydown(event) {
|
|
13596
13930
|
if (this.editingCell())
|
|
13597
13931
|
return;
|
|
@@ -13601,11 +13935,7 @@ class DataTableComponent {
|
|
|
13601
13935
|
return;
|
|
13602
13936
|
}
|
|
13603
13937
|
if (event.key === 'Enter' || event.key === 'F2') {
|
|
13604
|
-
|
|
13605
|
-
if (focused) {
|
|
13606
|
-
event.preventDefault();
|
|
13607
|
-
this.startEditing(focused.rowIndex, focused.columnKey);
|
|
13608
|
-
}
|
|
13938
|
+
this.editFromKey(event);
|
|
13609
13939
|
return;
|
|
13610
13940
|
}
|
|
13611
13941
|
const navKeys = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Tab', 'Home', 'End', 'PageUp', 'PageDown'];
|
|
@@ -13624,9 +13954,16 @@ class DataTableComponent {
|
|
|
13624
13954
|
}
|
|
13625
13955
|
return;
|
|
13626
13956
|
}
|
|
13627
|
-
|
|
13957
|
+
this.navigateFrom(event, focused, colKeys, totalRows);
|
|
13958
|
+
}
|
|
13959
|
+
navigateFrom(event, focused, colKeys, totalRows) {
|
|
13628
13960
|
const colIndex = colKeys.indexOf(focused.columnKey);
|
|
13629
13961
|
const safeColIndex = colIndex === -1 ? 0 : colIndex;
|
|
13962
|
+
// A Tab that cannot move the focused cell must reach the browser, or
|
|
13963
|
+
// keyboard users are trapped in the grid (WCAG 2.1.2).
|
|
13964
|
+
if (event.key === 'Tab' && this.isTabAtGridEdge(event.shiftKey, focused.rowIndex, safeColIndex, colKeys, totalRows))
|
|
13965
|
+
return;
|
|
13966
|
+
event.preventDefault();
|
|
13630
13967
|
const next = this.computeNextCell(event.key, event.shiftKey, event.ctrlKey || event.metaKey, focused.rowIndex, safeColIndex, colKeys, totalRows);
|
|
13631
13968
|
this.focusedCell.set({ rowIndex: next.row, columnKey: colKeys[next.col] });
|
|
13632
13969
|
this.ensureFocusedCellVisible();
|
|
@@ -13674,12 +14011,30 @@ class DataTableComponent {
|
|
|
13674
14011
|
if (this.isDisabled(row))
|
|
13675
14012
|
return;
|
|
13676
14013
|
const currentValue = this.getCellValue(row, col.accessorKey, col);
|
|
14014
|
+
const seededText = editorTextFor(currentValue);
|
|
13677
14015
|
this.cellEditError.set(null);
|
|
13678
14016
|
this.editValue.set(currentValue);
|
|
14017
|
+
this.editText.set(seededText);
|
|
14018
|
+
this.resetEditField(seededText);
|
|
13679
14019
|
this.editingRowId = this.getRowId()(row);
|
|
13680
14020
|
this.editingCell.set({ rowIndex, columnKey });
|
|
13681
14021
|
this.focusEditInput();
|
|
13682
14022
|
}
|
|
14023
|
+
/**
|
|
14024
|
+
* Puts the seeded text into the mounted edit field. The field is bound through its `value` attribute, which a field
|
|
14025
|
+
* the user has typed in ignores, so a re-open (including a cancel followed at once by one, before a render drops the
|
|
14026
|
+
* field) must write it by hand or Enter would commit text the user no longer sees. It also clears a half-typed number.
|
|
14027
|
+
* A field of another cell is removed by the next render, so the write is never seen.
|
|
14028
|
+
*/
|
|
14029
|
+
resetEditField(text) {
|
|
14030
|
+
const field = this.openEditInput();
|
|
14031
|
+
if (field !== null)
|
|
14032
|
+
field.value = text;
|
|
14033
|
+
}
|
|
14034
|
+
/** The text or number field of the open inline editor; only one editor is ever open. */
|
|
14035
|
+
openEditInput() {
|
|
14036
|
+
return this._el.nativeElement.querySelector('input[data-edit-input]');
|
|
14037
|
+
}
|
|
13683
14038
|
focusEditInput() {
|
|
13684
14039
|
requestAnimationFrame(() => {
|
|
13685
14040
|
const container = this._el.nativeElement;
|
|
@@ -13707,6 +14062,15 @@ class DataTableComponent {
|
|
|
13707
14062
|
const editing = this.editingCell();
|
|
13708
14063
|
if (!editing)
|
|
13709
14064
|
return;
|
|
14065
|
+
if (this.editorHoldsPartialNumber()) {
|
|
14066
|
+
this.cellEditError.set({
|
|
14067
|
+
rowIndex: editing.rowIndex,
|
|
14068
|
+
columnKey: editing.columnKey,
|
|
14069
|
+
value: this.editValue(),
|
|
14070
|
+
message: 'Enter a valid number',
|
|
14071
|
+
});
|
|
14072
|
+
return;
|
|
14073
|
+
}
|
|
13710
14074
|
const col = this.enhancedColumns().find((c) => String(c.accessorKey) === editing.columnKey);
|
|
13711
14075
|
const row = this.processedData()[editing.rowIndex];
|
|
13712
14076
|
if (!col || !row) {
|
|
@@ -13911,6 +14275,7 @@ class DataTableComponent {
|
|
|
13911
14275
|
this.editingCell.set(null);
|
|
13912
14276
|
this.editingRowId = undefined;
|
|
13913
14277
|
this.editValue.set(null);
|
|
14278
|
+
this.editText.set('');
|
|
13914
14279
|
this.cellEditError.set(null);
|
|
13915
14280
|
}
|
|
13916
14281
|
/** Returns the inline validation message for a cell, or `null` if valid. */
|
|
@@ -13924,9 +14289,62 @@ class DataTableComponent {
|
|
|
13924
14289
|
}
|
|
13925
14290
|
refocusTable() {
|
|
13926
14291
|
requestAnimationFrame(() => {
|
|
13927
|
-
this.scrollContainerRef()?.nativeElement
|
|
14292
|
+
const container = this.scrollContainerRef()?.nativeElement;
|
|
14293
|
+
const focused = this.focusedCell();
|
|
14294
|
+
const cell = container && focused ? this.renderedCell(container, focused) : undefined;
|
|
14295
|
+
(cell ?? container)?.focus({ preventScroll: true });
|
|
13928
14296
|
});
|
|
13929
14297
|
}
|
|
14298
|
+
/**
|
|
14299
|
+
* Whether the open number editor holds text that is not a number. Read from the field itself: it is the one place
|
|
14300
|
+
* that knows, and it stays right if the input is re-created while the editor is open.
|
|
14301
|
+
*/
|
|
14302
|
+
editorHoldsPartialNumber() {
|
|
14303
|
+
return this.openEditInput()?.validity.badInput ?? false;
|
|
14304
|
+
}
|
|
14305
|
+
/**
|
|
14306
|
+
* Stores what a text or number editor holds: a number (null when cleared) for `editType: 'number'`, else the
|
|
14307
|
+
* text. A half-typed number ("-", "1e") is not a value: while the field holds one, Enter, Tab and blur refuse
|
|
14308
|
+
* to commit and show "Enter a valid number" inline, and the cell keeps its value however the text got there (after
|
|
14309
|
+
* clearing the field or after selecting the digits). Like a validator rejection the editor stays open so the text
|
|
14310
|
+
* can be fixed; unlike one it emits no editError, since no validator was involved.
|
|
14311
|
+
*/
|
|
14312
|
+
onEditInput(input, col) {
|
|
14313
|
+
if (col.editType !== 'number') {
|
|
14314
|
+
this.editText.set(input.value);
|
|
14315
|
+
this.onEditValueChange(input.value);
|
|
14316
|
+
return;
|
|
14317
|
+
}
|
|
14318
|
+
if (input.validity.badInput) {
|
|
14319
|
+
// The text changed, so a message about the previous value no longer describes it.
|
|
14320
|
+
this.cellEditError.set(null);
|
|
14321
|
+
return;
|
|
14322
|
+
}
|
|
14323
|
+
this.editText.set(input.value);
|
|
14324
|
+
this.onEditValueChange(input.value === '' ? null : input.valueAsNumber);
|
|
14325
|
+
}
|
|
14326
|
+
/**
|
|
14327
|
+
* Which option the select shows as current: the one whose value is the edit value, else the first whose scalar
|
|
14328
|
+
* has its string form (as data from JSON does); -1 when no option stands for it, and the select then shows blank.
|
|
14329
|
+
*/
|
|
14330
|
+
editOptionIndex(col) {
|
|
14331
|
+
const options = col.editOptions ?? [];
|
|
14332
|
+
const value = this.editValue();
|
|
14333
|
+
const exact = options.findIndex((option) => option.value === value);
|
|
14334
|
+
if (exact !== -1)
|
|
14335
|
+
return exact;
|
|
14336
|
+
if (!isScalarOptionValue(value))
|
|
14337
|
+
return -1;
|
|
14338
|
+
return options.findIndex((option) => isScalarOptionValue(option.value) && String(option.value) === String(value));
|
|
14339
|
+
}
|
|
14340
|
+
/** Commits the chosen option's own value, not its string form, so numbers and booleans keep their type. */
|
|
14341
|
+
onEditSelect(select, col) {
|
|
14342
|
+
const option = select.value === '' ? undefined : col.editOptions?.[Number(select.value)];
|
|
14343
|
+
if (!option)
|
|
14344
|
+
return;
|
|
14345
|
+
this.onEditValueChange(option.value);
|
|
14346
|
+
this.commitEdit();
|
|
14347
|
+
}
|
|
13930
14348
|
/**
|
|
13931
14349
|
* Stores the editor's in-progress value and clears any visible validation
|
|
13932
14350
|
* message, so the error disappears as soon as the user types. Nothing is
|
|
@@ -13943,6 +14361,10 @@ class DataTableComponent {
|
|
|
13943
14361
|
* All three stop propagation so the grid's own navigation does not also run.
|
|
13944
14362
|
*/
|
|
13945
14363
|
onEditKeydown(event) {
|
|
14364
|
+
// The Enter / Escape that confirms an IME composition belongs to the IME, not to the editor. (Safari sends that
|
|
14365
|
+
// key after compositionend with isComposing already false; only keyCode 229 tells, and it is deprecated.)
|
|
14366
|
+
if (event.isComposing)
|
|
14367
|
+
return;
|
|
13946
14368
|
if (event.key === 'Escape') {
|
|
13947
14369
|
event.preventDefault();
|
|
13948
14370
|
event.stopPropagation();
|
|
@@ -13952,15 +14374,39 @@ class DataTableComponent {
|
|
|
13952
14374
|
if (event.key === 'Enter') {
|
|
13953
14375
|
event.preventDefault();
|
|
13954
14376
|
event.stopPropagation();
|
|
13955
|
-
this.
|
|
14377
|
+
// The Enter that opened this editor repeats while held and would commit it at once.
|
|
14378
|
+
if (!event.repeat)
|
|
14379
|
+
this.commitEdit();
|
|
13956
14380
|
return;
|
|
13957
14381
|
}
|
|
13958
14382
|
if (event.key === 'Tab') {
|
|
13959
|
-
event.preventDefault();
|
|
13960
14383
|
event.stopPropagation();
|
|
13961
|
-
this.
|
|
13962
|
-
|
|
14384
|
+
this.onEditTab(event);
|
|
14385
|
+
}
|
|
14386
|
+
}
|
|
14387
|
+
/**
|
|
14388
|
+
* Tab commits, then moves on. A refused commit (a validator rejection, a half-typed number) keeps the editor and
|
|
14389
|
+
* its text where they are: moving on would drop them without a word.
|
|
14390
|
+
*/
|
|
14391
|
+
onEditTab(event) {
|
|
14392
|
+
const leavesGrid = this.isEditTabAtGridEdge(event.shiftKey);
|
|
14393
|
+
this.commitEdit();
|
|
14394
|
+
if (this.editingCell() !== null) {
|
|
14395
|
+
event.preventDefault();
|
|
14396
|
+
return;
|
|
13963
14397
|
}
|
|
14398
|
+
// At the grid edge the browser moves focus out of the grid on its own.
|
|
14399
|
+
if (leavesGrid)
|
|
14400
|
+
return;
|
|
14401
|
+
event.preventDefault();
|
|
14402
|
+
this.advanceEditToNextCell(event.shiftKey);
|
|
14403
|
+
}
|
|
14404
|
+
isEditTabAtGridEdge(shiftKey) {
|
|
14405
|
+
const editing = this.focusedCell();
|
|
14406
|
+
if (!editing)
|
|
14407
|
+
return false;
|
|
14408
|
+
const colKeys = this.navigableColumnKeys();
|
|
14409
|
+
return this.isTabAtGridEdge(shiftKey, editing.rowIndex, colKeys.indexOf(editing.columnKey), colKeys, this.totalVisibleRows());
|
|
13964
14410
|
}
|
|
13965
14411
|
advanceEditToNextCell(shiftKey) {
|
|
13966
14412
|
const colKeys = this.navigableColumnKeys();
|
|
@@ -14022,7 +14468,8 @@ class DataTableComponent {
|
|
|
14022
14468
|
}
|
|
14023
14469
|
/**
|
|
14024
14470
|
* Expands every node with children, or only those above `toDepth` (0-based,
|
|
14025
|
-
* exclusive) when given
|
|
14471
|
+
* exclusive) when given; the deeper nodes are pinned closed, like
|
|
14472
|
+
* {@link collapseAllSubRows}. Walks the *unfiltered* {@link data} and **replaces**
|
|
14026
14473
|
* {@link subRowExpandedRows} wholesale, discarding any node you had explicitly
|
|
14027
14474
|
* collapsed.
|
|
14028
14475
|
*/
|
|
@@ -14035,9 +14482,9 @@ class DataTableComponent {
|
|
|
14035
14482
|
for (const row of rows) {
|
|
14036
14483
|
const children = getChildrenFn(row);
|
|
14037
14484
|
if (children && children.length > 0) {
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14485
|
+
// Pin the deeper nodes closed too: unpinned they would fall back to subRowDefaultExpanded
|
|
14486
|
+
// (-1 opens every level) and `toDepth` would open the whole tree.
|
|
14487
|
+
next[getId(row)] = targetDepth === -1 || depth < targetDepth;
|
|
14041
14488
|
walk(children, depth + 1);
|
|
14042
14489
|
}
|
|
14043
14490
|
}
|
|
@@ -14371,7 +14818,7 @@ class DataTableComponent {
|
|
|
14371
14818
|
}
|
|
14372
14819
|
isColumnReorderable(col) {
|
|
14373
14820
|
const key = String(col.accessorKey);
|
|
14374
|
-
if (key
|
|
14821
|
+
if (isGridColumnKey(key)) {
|
|
14375
14822
|
return false;
|
|
14376
14823
|
}
|
|
14377
14824
|
return col.enableReordering !== false;
|
|
@@ -14602,34 +15049,70 @@ class DataTableComponent {
|
|
|
14602
15049
|
if (draggedTreeRow && targetTreeRow && draggedTreeRow.depth !== targetTreeRow.depth) {
|
|
14603
15050
|
if (event.dataTransfer)
|
|
14604
15051
|
event.dataTransfer.dropEffect = 'none';
|
|
14605
|
-
this.dragOverIndex.set(
|
|
15052
|
+
this.dragOverIndex.set(null);
|
|
14606
15053
|
return { blocked: true, position };
|
|
14607
15054
|
}
|
|
14608
15055
|
return { blocked: false, position: position === 'on' ? 'below' : position };
|
|
14609
15056
|
}
|
|
15057
|
+
/**
|
|
15058
|
+
* Whether dropping the dragged tree node at `row` would move it into its own subtree: onto a descendant, or
|
|
15059
|
+
* "on" itself. Such a drop would lose the subtree (or make the node its own parent), so it is refused.
|
|
15060
|
+
*/
|
|
15061
|
+
refusesOwnSubtree(draggedId, row, position) {
|
|
15062
|
+
if (!row || !this.enableSubRows())
|
|
15063
|
+
return false;
|
|
15064
|
+
const getId = this.getRowId();
|
|
15065
|
+
const dragged = this.processedData().find(r => getId(r) === draggedId);
|
|
15066
|
+
if (!dragged)
|
|
15067
|
+
return false;
|
|
15068
|
+
if (getId(dragged) === getId(row))
|
|
15069
|
+
return position === 'on';
|
|
15070
|
+
return this.subtreeContains(dragged, getId(row), getId, this.getChildren());
|
|
15071
|
+
}
|
|
15072
|
+
/**
|
|
15073
|
+
* Refuses the row under the pointer as a drop target. Not just "no preventDefault": the container's dragover
|
|
15074
|
+
* would still accept the drop and `onRowDrop` would use the row hovered before, so the target is cleared and
|
|
15075
|
+
* the event stopped. Edge auto-scroll keeps working, or a tall refused subtree could not be scrolled past.
|
|
15076
|
+
*/
|
|
15077
|
+
refuseDrop(event) {
|
|
15078
|
+
if (event.dataTransfer)
|
|
15079
|
+
event.dataTransfer.dropEffect = 'none';
|
|
15080
|
+
this.dragOverIndex.set(null);
|
|
15081
|
+
event.stopPropagation();
|
|
15082
|
+
this.handleDragAutoScroll(event.clientY);
|
|
15083
|
+
}
|
|
14610
15084
|
/**
|
|
14611
15085
|
* Tracks the hovered row during a row drag and decides the drop position from
|
|
14612
15086
|
* the pointer's position within the row: above/below at the halves in `"flat"`
|
|
14613
15087
|
* mode, above/on/below at the quarters in `"tree"` mode. Rejects the target
|
|
14614
|
-
* when the row is disabled, when a flat drag would cross tree depths,
|
|
14615
|
-
*
|
|
15088
|
+
* when the row is disabled, when a flat drag would cross tree depths, when a
|
|
15089
|
+
* tree drag would land in its own subtree (on a descendant, or "on" itself),
|
|
15090
|
+
* or when {@link rowDragAllowDrop} vetoes it, and auto-scrolls near the edges.
|
|
14616
15091
|
*/
|
|
14617
15092
|
onRowDragOver(event, index) {
|
|
14618
15093
|
const draggedId = this.draggedRowId();
|
|
14619
15094
|
if (!this.enableRowDrag() || !draggedId)
|
|
14620
15095
|
return;
|
|
14621
15096
|
const row = this.processedData()[index];
|
|
14622
|
-
if (row && this.isDisabled(row))
|
|
15097
|
+
if (row && this.isDisabled(row)) {
|
|
15098
|
+
this.refuseDrop(event);
|
|
14623
15099
|
return;
|
|
15100
|
+
}
|
|
14624
15101
|
const getId = this.getRowId();
|
|
14625
15102
|
const rawPosition = this.computeDragPosition(event);
|
|
14626
15103
|
const { blocked, position } = this.checkFlatTreeDragCompatibility(event, index, draggedId, getId, rawPosition);
|
|
14627
15104
|
if (blocked)
|
|
14628
15105
|
return;
|
|
15106
|
+
if (this.refusesOwnSubtree(draggedId, row, position)) {
|
|
15107
|
+
this.refuseDrop(event);
|
|
15108
|
+
return;
|
|
15109
|
+
}
|
|
14629
15110
|
const draggedRow = this.processedData().find(r => getId(r) === draggedId);
|
|
14630
15111
|
const allowDropFn = this.rowDragAllowDrop();
|
|
14631
|
-
if (draggedRow && row && allowDropFn && !allowDropFn(draggedRow, row, position))
|
|
15112
|
+
if (draggedRow && row && allowDropFn && !allowDropFn(draggedRow, row, position)) {
|
|
15113
|
+
this.refuseDrop(event);
|
|
14632
15114
|
return;
|
|
15115
|
+
}
|
|
14633
15116
|
event.preventDefault();
|
|
14634
15117
|
event.stopPropagation();
|
|
14635
15118
|
this.dragOverIndex.set(index);
|
|
@@ -14660,7 +15143,8 @@ class DataTableComponent {
|
|
|
14660
15143
|
const lastRow = rows[rows.length - 1];
|
|
14661
15144
|
const lastRowRect = lastRow.getBoundingClientRect();
|
|
14662
15145
|
if (event.clientY > lastRowRect.bottom) {
|
|
14663
|
-
this.
|
|
15146
|
+
const refused = this.refusesOwnSubtree(this.draggedRowId() ?? '', this.processedData()[lastIndex], 'below');
|
|
15147
|
+
this.dragOverIndex.set(refused ? null : lastIndex);
|
|
14664
15148
|
this.dragOverPosition.set('below');
|
|
14665
15149
|
}
|
|
14666
15150
|
this.handleDragAutoScroll(event.clientY);
|
|
@@ -14758,8 +15242,17 @@ class DataTableComponent {
|
|
|
14758
15242
|
const { remaining, removed } = this.removeFromTree(data, rowId, getId, getChildrenFn, setChildrenFn);
|
|
14759
15243
|
if (!removed)
|
|
14760
15244
|
return data;
|
|
15245
|
+
// A node cannot move into itself or its own subtree: the target left the tree with it, so
|
|
15246
|
+
// inserting would never match and the moved subtree would be dropped from the data.
|
|
15247
|
+
if (this.subtreeContains(removed, targetId, getId, getChildrenFn))
|
|
15248
|
+
return data;
|
|
14761
15249
|
return this.insertIntoTree(remaining, removed, targetId, event.position, getId, getChildrenFn, setChildrenFn);
|
|
14762
15250
|
}
|
|
15251
|
+
subtreeContains(node, id, getId, getChildrenFn) {
|
|
15252
|
+
if (getId(node) === id)
|
|
15253
|
+
return true;
|
|
15254
|
+
return (getChildrenFn(node) ?? []).some(child => this.subtreeContains(child, id, getId, getChildrenFn));
|
|
15255
|
+
}
|
|
14763
15256
|
removeFromTree(nodes, rowId, getId, getChildrenFn, setChildrenFn) {
|
|
14764
15257
|
const idx = nodes.findIndex(n => getId(n) === rowId);
|
|
14765
15258
|
if (idx !== -1) {
|
|
@@ -14885,9 +15378,10 @@ class DataTableComponent {
|
|
|
14885
15378
|
}
|
|
14886
15379
|
/**
|
|
14887
15380
|
* Begins a mouse column resize from the header's drag handle, capturing the
|
|
14888
|
-
* start width and attaching document move/up listeners. The
|
|
14889
|
-
*
|
|
14890
|
-
* column
|
|
15381
|
+
* start width and attaching document move/up listeners. The drag delta is
|
|
15382
|
+
* signed by which way the column's edge actually moves (`resizeGrowthSign`):
|
|
15383
|
+
* flow direction (RTL-aware), reversed for a pinned column stuck to the
|
|
15384
|
+
* viewport edge.
|
|
14891
15385
|
*/
|
|
14892
15386
|
onResizeStart(event, col) {
|
|
14893
15387
|
event.preventDefault();
|
|
@@ -14919,6 +15413,32 @@ class DataTableComponent {
|
|
|
14919
15413
|
}
|
|
14920
15414
|
return `${base} bg-transparent group-hover/resize:bg-primary/50`;
|
|
14921
15415
|
}
|
|
15416
|
+
/**
|
|
15417
|
+
* Which way a drag moves the column's far edge: +1 grows the column toward the right, -1 toward the left.
|
|
15418
|
+
* A pinned column that is actually stuck to its viewport edge is held there by its `left`/`right` offset, so a
|
|
15419
|
+
* right-pinned one grows leftwards and a left-pinned one rightwards. Everything else, including a pinned column
|
|
15420
|
+
* sitting at its natural position because the table does not overflow, flows with the writing direction.
|
|
15421
|
+
* Whether it is stuck is measured: the pin setting alone cannot tell.
|
|
15422
|
+
*/
|
|
15423
|
+
resizeGrowthSign(col) {
|
|
15424
|
+
const flow = this.isRtl() ? -1 : 1;
|
|
15425
|
+
if (!this.scrollsHorizontally())
|
|
15426
|
+
return flow;
|
|
15427
|
+
if (col._pin === "right")
|
|
15428
|
+
return -1;
|
|
15429
|
+
if (col._pin === "left" || col.sticky)
|
|
15430
|
+
return 1;
|
|
15431
|
+
return flow;
|
|
15432
|
+
}
|
|
15433
|
+
/**
|
|
15434
|
+
* With horizontal overflow a pinned column is always held at its edge (stuck, or already at the end of the row);
|
|
15435
|
+
* without it the column keeps its natural position. Comparing the cell's rect with the viewport is fragile
|
|
15436
|
+
* (scrollbar, padding), so the overflow itself is the test. Unmeasurable: assume overflow.
|
|
15437
|
+
*/
|
|
15438
|
+
scrollsHorizontally() {
|
|
15439
|
+
const container = this.scrollContainerRef()?.nativeElement;
|
|
15440
|
+
return !container || container.scrollWidth > container.clientWidth + 1;
|
|
15441
|
+
}
|
|
14922
15442
|
startResize(clientX, col) {
|
|
14923
15443
|
const key = String(col.accessorKey);
|
|
14924
15444
|
this._resizingColumn.set(col);
|
|
@@ -14926,7 +15446,7 @@ class DataTableComponent {
|
|
|
14926
15446
|
const actualWidth = this.getColumnActualWidth(key);
|
|
14927
15447
|
this.resizeStartWidth = Number.parseInt(col._width, 10) || actualWidth || 150;
|
|
14928
15448
|
this.resizeOldWidth = this.columnWidths()[key] ?? col._width ?? "auto";
|
|
14929
|
-
this.
|
|
15449
|
+
this._resizeGrowthSign = this.resizeGrowthSign(col);
|
|
14930
15450
|
const onMouseMove = (e) => this.onResizeMove(e.clientX);
|
|
14931
15451
|
const onTouchMove = (e) => {
|
|
14932
15452
|
if (e.touches.length === 1) {
|
|
@@ -14955,8 +15475,7 @@ class DataTableComponent {
|
|
|
14955
15475
|
if (!resizing)
|
|
14956
15476
|
return;
|
|
14957
15477
|
const delta = clientX - this.resizeStartX;
|
|
14958
|
-
const
|
|
14959
|
-
const newWidth = Math.max(columnMinWidthPx(resizing), this.resizeStartWidth + effectiveDelta);
|
|
15478
|
+
const newWidth = Math.max(columnMinWidthPx(resizing), this.resizeStartWidth + delta * this._resizeGrowthSign);
|
|
14960
15479
|
const key = String(resizing.accessorKey);
|
|
14961
15480
|
this.columnWidths.update((widths) => ({
|
|
14962
15481
|
...widths,
|
|
@@ -15121,7 +15640,7 @@ class DataTableComponent {
|
|
|
15121
15640
|
ComponentPoolService,
|
|
15122
15641
|
provideComponentLocale(() => DataTableComponent),
|
|
15123
15642
|
{ provide: DataTableAddonHost, useExisting: forwardRef(() => DataTableComponent) },
|
|
15124
|
-
], viewQueries: [{ propertyName: "scrollContainerRef", first: true, predicate: ["scrollContainer"], descendants: true, isSignal: true }, { propertyName: "virtualRowElements", predicate: ["virtualRow"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "resizeHandles", predicate: ["resizeHandle"], descendants: true, 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 #resizeHandle\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 or double-tap 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 ) {\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-index]=\"displayRow.index\"\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, displayRow.index)\"\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: displayRow.index,\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: ["class", "open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger", inputs: ["class"] }, { 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: ["class", "total", "state", "pageSizeOptions", "showPageSizeSelector", "rowsPerPageLabel", "pageLabel", "ofLabel"], outputs: ["paginationChange"] }, { kind: "component", type: DataTableFilterBuilderComponent, selector: "ui-data-table-filter-builder", inputs: ["class", "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 }); }
|
|
15643
|
+
], viewQueries: [{ propertyName: "scrollContainerRef", first: true, predicate: ["scrollContainer"], descendants: true, isSignal: true }, { propertyName: "virtualRowElements", predicate: ["virtualRow"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "resizeHandles", predicate: ["resizeHandle"], descendants: true, 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 (change)=\"onEditSelect($any($event.target), col)\"\n (keydown)=\"onEditKeydown($event)\"\n >\n @let chosen = editOptionIndex(col);\n @if (chosen === -1) {\n <option value=\"\" selected disabled hidden></option>\n }\n @for (opt of col.editOptions; track $index; let i = $index) {\n <option [value]=\"i\" [selected]=\"i === chosen\">{{ opt.label }}</option>\n }\n </select>\n } @else {\n <!-- value is bound as an ATTRIBUTE on purpose: a property write from a late render overwrites what is being typed (see editText) -->\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 [attr.value]=\"editText()\"\n (input)=\"onEditInput($any($event.target), col)\"\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() || groupingActive() ? '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 #resizeHandle\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 or double-tap 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 [selected]=\"isRowSelected(treeRow.row)\"\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 [selected]=\"isRowSelected(row)\"\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 [selected]=\"isRowSelected(treeRow.row)\"\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 ) {\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 [selected]=\"isRowSelected(displayRow.row)\"\n [attr.data-disabled]=\"isDisabled(displayRow.row) || null\"\n [class.opacity-50]=\"isDisabled(displayRow.row)\"\n [attr.data-row-index]=\"displayRow.index\"\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, displayRow.index)\"\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: displayRow.index,\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 [selected]=\"isRowSelected(row)\"\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 [selected]=\"isRowSelected(row)\"\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)}@layer components{@media(hover:hover){[data-slot=table-row]:hover>.pinned-cell{background-image:linear-gradient(color-mix(in oklab,var(--muted) 50%,transparent),color-mix(in oklab,var(--muted) 50%,transparent))}}[data-slot=table-row][data-state=selected]>.pinned-cell{background-image:linear-gradient(var(--muted),var(--muted))}}\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: ["class", "open", "closeOnScroll"], outputs: ["openChange"] }, { kind: "component", type: PopoverTriggerComponent, selector: "ui-popover-trigger", inputs: ["class"] }, { 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: ["class", "total", "state", "pageSizeOptions", "showPageSizeSelector", "rowsPerPageLabel", "pageLabel", "ofLabel"], outputs: ["paginationChange"] }, { kind: "component", type: DataTableFilterBuilderComponent, selector: "ui-data-table-filter-builder", inputs: ["class", "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 }); }
|
|
15125
15644
|
}
|
|
15126
15645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DataTableComponent, decorators: [{
|
|
15127
15646
|
type: Component,
|
|
@@ -15155,7 +15674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
15155
15674
|
'[class]': 'hostClasses()',
|
|
15156
15675
|
'[attr.dir]': 'dir()',
|
|
15157
15676
|
'[attr.data-ui-theme]': 'theme()',
|
|
15158
|
-
}, 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 #resizeHandle\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 or double-tap 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 ) {\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-index]=\"displayRow.index\"\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, displayRow.index)\"\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: displayRow.index,\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"] }]
|
|
15677
|
+
}, 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 (change)=\"onEditSelect($any($event.target), col)\"\n (keydown)=\"onEditKeydown($event)\"\n >\n @let chosen = editOptionIndex(col);\n @if (chosen === -1) {\n <option value=\"\" selected disabled hidden></option>\n }\n @for (opt of col.editOptions; track $index; let i = $index) {\n <option [value]=\"i\" [selected]=\"i === chosen\">{{ opt.label }}</option>\n }\n </select>\n } @else {\n <!-- value is bound as an ATTRIBUTE on purpose: a property write from a late render overwrites what is being typed (see editText) -->\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 [attr.value]=\"editText()\"\n (input)=\"onEditInput($any($event.target), col)\"\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() || groupingActive() ? '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 #resizeHandle\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 or double-tap 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 [selected]=\"isRowSelected(treeRow.row)\"\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 [selected]=\"isRowSelected(row)\"\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 [selected]=\"isRowSelected(treeRow.row)\"\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 ) {\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 [selected]=\"isRowSelected(displayRow.row)\"\n [attr.data-disabled]=\"isDisabled(displayRow.row) || null\"\n [class.opacity-50]=\"isDisabled(displayRow.row)\"\n [attr.data-row-index]=\"displayRow.index\"\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, displayRow.index)\"\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: displayRow.index,\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 [selected]=\"isRowSelected(row)\"\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 [selected]=\"isRowSelected(row)\"\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)}@layer components{@media(hover:hover){[data-slot=table-row]:hover>.pinned-cell{background-image:linear-gradient(color-mix(in oklab,var(--muted) 50%,transparent),color-mix(in oklab,var(--muted) 50%,transparent))}}[data-slot=table-row][data-state=selected]>.pinned-cell{background-image:linear-gradient(var(--muted),var(--muted))}}\n"] }]
|
|
15159
15678
|
}], 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 }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", 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", { ...{
|
|
15160
15679
|
read: ElementRef,
|
|
15161
15680
|
}, 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"] }], resizeHandles: [{ type: i0.ViewChildren, args: ["resizeHandle", { isSignal: true }] }] } });
|
|
@@ -19649,5 +20168,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
19649
20168
|
* Generated bundle index. Do not edit.
|
|
19650
20169
|
*/
|
|
19651
20170
|
|
|
19652
|
-
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, renumberDataRows, restoreSpreadsheetText, toEditedDateValue, toLocalDateString };
|
|
20171
|
+
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, cellText, columnHelper, computeAggregateValue, computeColumnRange, computePivot, computeRowRange, computeVariableRowRange, dateFilterFn, dateRangeFilterFn, evaluateAdvancedFilter, guardSpreadsheetFormula, matchesCondition, multiselectFilterFn, parseClipboardGrid, parseNlFilterSpec, partitionIntoGroups, renumberDataRows, restoreSpreadsheetText, toAggregatableNumber$1 as toAggregatableNumber, toEditedDateValue, toLocalDateString };
|
|
19653
20172
|
//# sourceMappingURL=gilav21-shadcn-angular-data-table.mjs.map
|