@ithouse-bd/ngx-table 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1988 @@
1
+ import { NgClass, NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, Directive, inject, ElementRef, model, output, contentChildren, computed, signal, effect, untracked, afterNextRender, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
4
+
5
+ /**
6
+ * Custom cell renderer.
7
+ *
8
+ * ```html
9
+ * <ng-template ithTableCell="status" let-row let-value="value">
10
+ * <span class="badge">{{ value }}</span>
11
+ * </ng-template>
12
+ * ```
13
+ */
14
+ class TableCellDirective {
15
+ template;
16
+ /** `key` of the column this template renders. */
17
+ columnKey = input.required(...(ngDevMode ? [{ debugName: "columnKey", alias: 'ithTableCell' }] : [{ alias: 'ithTableCell' }]));
18
+ constructor(template) {
19
+ this.template = template;
20
+ }
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableCellDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
22
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.34", type: TableCellDirective, isStandalone: true, selector: "[ithTableCell]", inputs: { columnKey: { classPropertyName: "columnKey", publicName: "ithTableCell", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableCellDirective, decorators: [{
25
+ type: Directive,
26
+ args: [{ selector: '[ithTableCell]' }]
27
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { columnKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ithTableCell", required: true }] }] } });
28
+ /** Custom header renderer for one column: `#ithTableHeader="key"`. */
29
+ class TableHeaderDirective {
30
+ template;
31
+ columnKey = input.required(...(ngDevMode ? [{ debugName: "columnKey", alias: 'ithTableHeader' }] : [{ alias: 'ithTableHeader' }]));
32
+ constructor(template) {
33
+ this.template = template;
34
+ }
35
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableHeaderDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
36
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.34", type: TableHeaderDirective, isStandalone: true, selector: "[ithTableHeader]", inputs: { columnKey: { classPropertyName: "columnKey", publicName: "ithTableHeader", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
37
+ }
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableHeaderDirective, decorators: [{
39
+ type: Directive,
40
+ args: [{ selector: '[ithTableHeader]' }]
41
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { columnKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ithTableHeader", required: true }] }] } });
42
+ /** Custom filter control for one column: `#ithTableFilter="key"`. */
43
+ class TableFilterDirective {
44
+ template;
45
+ columnKey = input.required(...(ngDevMode ? [{ debugName: "columnKey", alias: 'ithTableFilter' }] : [{ alias: 'ithTableFilter' }]));
46
+ constructor(template) {
47
+ this.template = template;
48
+ }
49
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableFilterDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
50
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.34", type: TableFilterDirective, isStandalone: true, selector: "[ithTableFilter]", inputs: { columnKey: { classPropertyName: "columnKey", publicName: "ithTableFilter", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
51
+ }
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableFilterDirective, decorators: [{
53
+ type: Directive,
54
+ args: [{ selector: '[ithTableFilter]' }]
55
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { columnKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ithTableFilter", required: true }] }] } });
56
+ /** Replaces the buttons of the actions column: `#ithTableRowActions`. */
57
+ class TableRowActionsDirective {
58
+ template;
59
+ constructor(template) {
60
+ this.template = template;
61
+ }
62
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableRowActionsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
63
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.34", type: TableRowActionsDirective, isStandalone: true, selector: "[ithTableRowActions]", ngImport: i0 });
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableRowActionsDirective, decorators: [{
66
+ type: Directive,
67
+ args: [{ selector: '[ithTableRowActions]' }]
68
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
69
+ /** Replaces the toolbar content next to the title: `#ithTableToolbar`. */
70
+ class TableToolbarDirective {
71
+ template;
72
+ constructor(template) {
73
+ this.template = template;
74
+ }
75
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableToolbarDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
76
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.34", type: TableToolbarDirective, isStandalone: true, selector: "[ithTableToolbar]", ngImport: i0 });
77
+ }
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableToolbarDirective, decorators: [{
79
+ type: Directive,
80
+ args: [{ selector: '[ithTableToolbar]' }]
81
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
82
+ /** Replaces the footer summary: `#ithTableFooter`. */
83
+ class TableFooterDirective {
84
+ template;
85
+ constructor(template) {
86
+ this.template = template;
87
+ }
88
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableFooterDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
89
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.34", type: TableFooterDirective, isStandalone: true, selector: "[ithTableFooter]", ngImport: i0 });
90
+ }
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableFooterDirective, decorators: [{
92
+ type: Directive,
93
+ args: [{ selector: '[ithTableFooter]' }]
94
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
95
+ /** Custom empty state: `#ithTableEmpty`. */
96
+ class TableEmptyDirective {
97
+ template;
98
+ constructor(template) {
99
+ this.template = template;
100
+ }
101
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableEmptyDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
102
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.34", type: TableEmptyDirective, isStandalone: true, selector: "[ithTableEmpty]", ngImport: i0 });
103
+ }
104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableEmptyDirective, decorators: [{
105
+ type: Directive,
106
+ args: [{ selector: '[ithTableEmpty]' }]
107
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
108
+ /**
109
+ * Custom right-click menu, rendered in a floating panel at the pointer.
110
+ *
111
+ * ```html
112
+ * <ng-template ithTableRowMenu let-row>
113
+ * <button type="button" (click)="open(row)">Open</button>
114
+ * </ng-template>
115
+ * ```
116
+ */
117
+ class TableRowMenuDirective {
118
+ template;
119
+ constructor(template) {
120
+ this.template = template;
121
+ }
122
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableRowMenuDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
123
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.34", type: TableRowMenuDirective, isStandalone: true, selector: "[ithTableRowMenu]", ngImport: i0 });
124
+ }
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableRowMenuDirective, decorators: [{
126
+ type: Directive,
127
+ args: [{ selector: '[ithTableRowMenu]' }]
128
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
129
+ /**
130
+ * Expandable row content, rendered on its own full-width row under the row.
131
+ *
132
+ * ```html
133
+ * <ng-template ithTableRowDetail let-row let-close="close">
134
+ * <div class="detail">{{ row.email }}</div>
135
+ * </ng-template>
136
+ * ```
137
+ */
138
+ class TableRowDetailDirective {
139
+ template;
140
+ constructor(template) {
141
+ this.template = template;
142
+ }
143
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableRowDetailDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
144
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.34", type: TableRowDetailDirective, isStandalone: true, selector: "[ithTableRowDetail]", ngImport: i0 });
145
+ }
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableRowDetailDirective, decorators: [{
147
+ type: Directive,
148
+ args: [{ selector: '[ithTableRowDetail]' }]
149
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
150
+
151
+ /** Read a dot-path value (`'a.b.c'`) from an object; `undefined` when a link is missing. */
152
+ function getPathValue(source, path) {
153
+ if (!path)
154
+ return undefined;
155
+ return path.split('.').reduce((value, part) => {
156
+ if (value === null || value === undefined)
157
+ return undefined;
158
+ return value[part];
159
+ }, source);
160
+ }
161
+ /** Human readable text for a cell value. */
162
+ function toDisplay(value) {
163
+ if (value === null || value === undefined)
164
+ return '';
165
+ if (value instanceof Date)
166
+ return value.toLocaleDateString();
167
+ if (typeof value === 'boolean')
168
+ return value ? 'Yes' : 'No';
169
+ if (typeof value === 'object')
170
+ return JSON.stringify(value);
171
+ return String(value);
172
+ }
173
+ /** Locale-aware, numeric-friendly comparison used by default sorting. */
174
+ function defaultCompare(a, b) {
175
+ if (a === b)
176
+ return 0;
177
+ if (a === null || a === undefined)
178
+ return -1;
179
+ if (b === null || b === undefined)
180
+ return 1;
181
+ if (typeof a === 'number' && typeof b === 'number')
182
+ return a - b;
183
+ if (typeof a === 'boolean' && typeof b === 'boolean')
184
+ return Number(a) - Number(b);
185
+ if (a instanceof Date && b instanceof Date)
186
+ return a.getTime() - b.getTime();
187
+ return String(a).localeCompare(String(b), undefined, { numeric: true, sensitivity: 'base' });
188
+ }
189
+ /** Sort a value ignoring the direction sign. */
190
+ function compareWithDirection(result, direction) {
191
+ return direction === 'asc' ? result : -result;
192
+ }
193
+ /**
194
+ * Page numbers to render, centred on `current`. First/last/prev/next buttons are
195
+ * separate controls, so no ellipsis is needed.
196
+ */
197
+ function buildPageWindow(current, pageCount, maxButtons = 5) {
198
+ if (pageCount <= 0)
199
+ return [];
200
+ const size = Math.max(1, Math.floor(maxButtons) || 1);
201
+ if (pageCount <= size) {
202
+ return Array.from({ length: pageCount }, (_, index) => index + 1);
203
+ }
204
+ const half = Math.floor(size / 2);
205
+ const start = Math.max(1, Math.min(current - half, pageCount - size + 1));
206
+ return Array.from({ length: size }, (_, index) => start + index);
207
+ }
208
+ /** `true` when the event target is a text field, so row-selection should be skipped. */
209
+ function isInteractiveTarget(target) {
210
+ if (!(target instanceof HTMLElement))
211
+ return false;
212
+ return !!target.closest('input, textarea, select, button, a, [contenteditable="true"], [role="button"]');
213
+ }
214
+
215
+ /**
216
+ * Tiny, dependency-free `.xlsx` writer.
217
+ *
218
+ * An xlsx file is a ZIP container with a handful of XML parts. Everything here is
219
+ * written with STORE (no compression), which is valid and keeps the code small, so the
220
+ * table can offer real Excel output without pulling in a spreadsheet library.
221
+ */
222
+ const CRC_TABLE = (() => {
223
+ const table = new Uint32Array(256);
224
+ for (let index = 0; index < 256; index++) {
225
+ let value = index;
226
+ for (let bit = 0; bit < 8; bit++) {
227
+ value = value & 1 ? 0xedb88320 ^ (value >>> 1) : value >>> 1;
228
+ }
229
+ table[index] = value >>> 0;
230
+ }
231
+ return table;
232
+ })();
233
+ function crc32(bytes) {
234
+ let crc = 0xffffffff;
235
+ for (let index = 0; index < bytes.length; index++) {
236
+ crc = CRC_TABLE[(crc ^ bytes[index]) & 0xff] ^ (crc >>> 8);
237
+ }
238
+ return (crc ^ 0xffffffff) >>> 0;
239
+ }
240
+ function toBytes(text) {
241
+ return new TextEncoder().encode(text);
242
+ }
243
+ /** Build a ZIP archive from plain (stored) entries. */
244
+ function zip(entries) {
245
+ const localParts = [];
246
+ const centralParts = [];
247
+ let offset = 0;
248
+ for (const entry of entries) {
249
+ const nameBytes = toBytes(entry.name);
250
+ const crc = crc32(entry.data);
251
+ const size = entry.data.length;
252
+ const local = new Uint8Array(30 + nameBytes.length);
253
+ const localView = new DataView(local.buffer);
254
+ localView.setUint32(0, 0x04034b50, true); // local file header
255
+ localView.setUint16(4, 20, true); // version needed
256
+ localView.setUint16(6, 0x0800, true); // UTF-8 names
257
+ localView.setUint16(8, 0, true); // stored
258
+ localView.setUint16(10, 0, true); // time
259
+ localView.setUint16(12, 0x21, true); // 1980-01-01
260
+ localView.setUint32(14, crc, true);
261
+ localView.setUint32(18, size, true);
262
+ localView.setUint32(22, size, true);
263
+ localView.setUint16(26, nameBytes.length, true);
264
+ localView.setUint16(28, 0, true);
265
+ local.set(nameBytes, 30);
266
+ const central = new Uint8Array(46 + nameBytes.length);
267
+ const centralView = new DataView(central.buffer);
268
+ centralView.setUint32(0, 0x02014b50, true); // central directory
269
+ centralView.setUint16(4, 20, true); // version made by
270
+ centralView.setUint16(6, 20, true); // version needed
271
+ centralView.setUint16(8, 0x0800, true);
272
+ centralView.setUint16(10, 0, true);
273
+ centralView.setUint16(12, 0, true);
274
+ centralView.setUint16(14, 0x21, true);
275
+ centralView.setUint32(16, crc, true);
276
+ centralView.setUint32(20, size, true);
277
+ centralView.setUint32(24, size, true);
278
+ centralView.setUint16(28, nameBytes.length, true);
279
+ centralView.setUint32(42, offset, true);
280
+ central.set(nameBytes, 46);
281
+ localParts.push(local, entry.data);
282
+ centralParts.push(central);
283
+ offset += local.length + size;
284
+ }
285
+ const centralSize = centralParts.reduce((total, part) => total + part.length, 0);
286
+ const end = new Uint8Array(22);
287
+ const endView = new DataView(end.buffer);
288
+ endView.setUint32(0, 0x06054b50, true); // end of central directory
289
+ endView.setUint16(8, entries.length, true);
290
+ endView.setUint16(10, entries.length, true);
291
+ endView.setUint32(12, centralSize, true);
292
+ endView.setUint32(16, offset, true);
293
+ const all = [...localParts, ...centralParts, end];
294
+ const total = all.reduce((size, part) => size + part.length, 0);
295
+ const output = new Uint8Array(total);
296
+ let cursor = 0;
297
+ for (const part of all) {
298
+ output.set(part, cursor);
299
+ cursor += part.length;
300
+ }
301
+ return output;
302
+ }
303
+ function escapeXml(value) {
304
+ return value
305
+ .replace(/&/g, '&amp;')
306
+ .replace(/</g, '&lt;')
307
+ .replace(/>/g, '&gt;')
308
+ .replace(/"/g, '&quot;')
309
+ .replace(/'/g, '&apos;');
310
+ }
311
+ function columnName(index) {
312
+ let name = '';
313
+ let current = index;
314
+ while (current >= 0) {
315
+ name = String.fromCharCode((current % 26) + 65) + name;
316
+ current = Math.floor(current / 26) - 1;
317
+ }
318
+ return name;
319
+ }
320
+ /** Build an `.xlsx` workbook (single sheet, frozen + filtered header row). */
321
+ function buildXlsxBlob(options) {
322
+ const { sheetName, header, rows } = options;
323
+ const widths = options.columnWidths ??
324
+ header.map((title, index) => {
325
+ const longest = rows.reduce((max, row) => Math.max(max, (row[index] ?? '').length), title.length);
326
+ return Math.min(60, Math.max(8, longest + 2));
327
+ });
328
+ const cell = (value, ref, style) => {
329
+ if (value === '')
330
+ return '';
331
+ return `<c r="${ref}" t="inlineStr" s="${style}"><is><t xml:space="preserve">${escapeXml(value)}</t></is></c>`;
332
+ };
333
+ const headerXml = header
334
+ .map((value, index) => `<c r="${columnName(index)}1" t="inlineStr" s="1"><is><t xml:space="preserve">${escapeXml(value)}</t></is></c>`)
335
+ .join('');
336
+ const rowsXml = rows
337
+ .map((row, rowIndex) => {
338
+ const cells = row
339
+ .map((value, columnIndex) => cell(value ?? '', `${columnName(columnIndex)}${rowIndex + 2}`, 0))
340
+ .join('');
341
+ return `<row r="${rowIndex + 2}">${cells}</row>`;
342
+ })
343
+ .join('');
344
+ const lastColumn = columnName(Math.max(0, header.length - 1));
345
+ const lastRow = rows.length + 1;
346
+ const worksheet = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` +
347
+ `<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">` +
348
+ `<sheetViews><sheetView workbookViewId="0">` +
349
+ `<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/>` +
350
+ `</sheetView></sheetViews>` +
351
+ `<cols>${widths
352
+ .map((width, index) => `<col min="${index + 1}" max="${index + 1}" width="${width}" customWidth="1"/>`)
353
+ .join('')}</cols>` +
354
+ `<sheetData><row r="1">${headerXml}</row>${rowsXml}</sheetData>` +
355
+ `<autoFilter ref="A1:${lastColumn}${lastRow}"/>` +
356
+ `</worksheet>`;
357
+ const workbook = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` +
358
+ `<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" ` +
359
+ `xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">` +
360
+ `<sheets><sheet name="${escapeXml(sheetName).slice(0, 31)}" sheetId="1" r:id="rId1"/></sheets>` +
361
+ `</workbook>`;
362
+ const workbookRels = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` +
363
+ `<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">` +
364
+ `<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/>` +
365
+ `<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>` +
366
+ `</Relationships>`;
367
+ const rootRels = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` +
368
+ `<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">` +
369
+ `<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>` +
370
+ `</Relationships>`;
371
+ const contentTypes = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` +
372
+ `<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">` +
373
+ `<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>` +
374
+ `<Default Extension="xml" ContentType="application/xml"/>` +
375
+ `<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>` +
376
+ `<Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>` +
377
+ `<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>` +
378
+ `</Types>`;
379
+ const styles = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` +
380
+ `<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">` +
381
+ `<fonts count="2">` +
382
+ `<font><sz val="11"/><name val="Calibri"/></font>` +
383
+ `<font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font>` +
384
+ `</fonts>` +
385
+ `<fills count="3">` +
386
+ `<fill><patternFill patternType="none"/></fill>` +
387
+ `<fill><patternFill patternType="gray125"/></fill>` +
388
+ `<fill><patternFill patternType="solid"><fgColor rgb="FF5B21B6"/><bgColor indexed="64"/></patternFill></fill>` +
389
+ `</fills>` +
390
+ `<borders count="1"><border/></borders>` +
391
+ `<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>` +
392
+ `<cellXfs count="2">` +
393
+ `<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>` +
394
+ `<xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment vertical="center"/></xf>` +
395
+ `</cellXfs>` +
396
+ `</styleSheet>`;
397
+ const archive = zip([
398
+ { name: '[Content_Types].xml', data: toBytes(contentTypes) },
399
+ { name: '_rels/.rels', data: toBytes(rootRels) },
400
+ { name: 'xl/workbook.xml', data: toBytes(workbook) },
401
+ { name: 'xl/_rels/workbook.xml.rels', data: toBytes(workbookRels) },
402
+ { name: 'xl/styles.xml', data: toBytes(styles) },
403
+ { name: 'xl/worksheets/sheet1.xml', data: toBytes(worksheet) },
404
+ ]);
405
+ return new Blob([archive], {
406
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
407
+ });
408
+ }
409
+
410
+ let tableIdCounter = 0;
411
+ const DEFAULT_COLUMN_WIDTH = 140;
412
+ const MIN_COLUMN_WIDTH = 56;
413
+ /**
414
+ * Generic, standalone data table.
415
+ *
416
+ * ```html
417
+ * <ith-table
418
+ * title="Student List"
419
+ * [data]="students"
420
+ * [columns]="columns"
421
+ * selectionMode="multi"
422
+ * [pageSize]="10">
423
+ * </ith-table>
424
+ * ```
425
+ */
426
+ class TableComponent {
427
+ host = inject(ElementRef);
428
+ /** Unique prefix for generated DOM ids. */
429
+ idBase = `ith-table-${tableIdCounter++}`;
430
+ /* ---------------------------------------------------------------- */
431
+ /* Data */
432
+ /* ---------------------------------------------------------------- */
433
+ /** Rows to render. In `server` mode this is the current page. */
434
+ data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
435
+ columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
436
+ /** Look up a unique key on each row (dot-path allowed). */
437
+ keyField = input('id', ...(ngDevMode ? [{ debugName: "keyField" }] : []));
438
+ /** `client` sorts/searches/pages the array locally; `server` emits events instead. */
439
+ mode = input('client', ...(ngDevMode ? [{ debugName: "mode" }] : []));
440
+ /** Total row count for `server` mode (defaults to `data().length`). */
441
+ total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : []));
442
+ /* ---------------------------------------------------------------- */
443
+ /* Toolbar / labels */
444
+ /* ---------------------------------------------------------------- */
445
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
446
+ countSuffix = input('items', ...(ngDevMode ? [{ debugName: "countSuffix" }] : []));
447
+ totalLabel = input('Total Found', ...(ngDevMode ? [{ debugName: "totalLabel" }] : []));
448
+ showToolbar = input(true, ...(ngDevMode ? [{ debugName: "showToolbar" }] : []));
449
+ searchable = input(true, ...(ngDevMode ? [{ debugName: "searchable" }] : []));
450
+ searchPlaceholder = input('Search…', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
451
+ showFilters = input(false, ...(ngDevMode ? [{ debugName: "showFilters" }] : []));
452
+ filterPlaceholder = input('Filter…', ...(ngDevMode ? [{ debugName: "filterPlaceholder" }] : []));
453
+ /** Label of the empty option in `select` filters. */
454
+ filterAllLabel = input('All', ...(ngDevMode ? [{ debugName: "filterAllLabel" }] : []));
455
+ emptyText = input('No records found', ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
456
+ /** Accessible name of the table. */
457
+ ariaLabel = input('Data table', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
458
+ /* ---------------------------------------------------------------- */
459
+ /* Sorting */
460
+ /* ---------------------------------------------------------------- */
461
+ /** Active sort, two-way bindable. `null` means unsorted. */
462
+ sort = model(null, ...(ngDevMode ? [{ debugName: "sort" }] : []));
463
+ /** Table-wide sort switch; individual columns can opt out with `sortable: false`. */
464
+ sortable = input(true, ...(ngDevMode ? [{ debugName: "sortable" }] : []));
465
+ /* ---------------------------------------------------------------- */
466
+ /* Search / filters / pagination */
467
+ /* ---------------------------------------------------------------- */
468
+ /** Global search term, two-way bindable. Also emitted as `searchChange`. */
469
+ search = model('', ...(ngDevMode ? [{ debugName: "search" }] : []));
470
+ /** Emitted whenever a per-column filter changes. */
471
+ filterChange = output();
472
+ page = model(1, ...(ngDevMode ? [{ debugName: "page" }] : []));
473
+ pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
474
+ pageSizeOptions = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
475
+ showPagination = input(true, ...(ngDevMode ? [{ debugName: "showPagination" }] : []));
476
+ showPageSize = input(true, ...(ngDevMode ? [{ debugName: "showPageSize" }] : []));
477
+ showFirstLast = input(true, ...(ngDevMode ? [{ debugName: "showFirstLast" }] : []));
478
+ /** How many numbered page buttons are rendered. */
479
+ maxPageButtons = input(5, ...(ngDevMode ? [{ debugName: "maxPageButtons" }] : []));
480
+ showFooter = input(true, ...(ngDevMode ? [{ debugName: "showFooter" }] : []));
481
+ /** Render removable chips for the active search term and column filters. */
482
+ showFilterChips = input(true, ...(ngDevMode ? [{ debugName: "showFilterChips" }] : []));
483
+ /* ---------------------------------------------------------------- */
484
+ /* Selection */
485
+ /* ---------------------------------------------------------------- */
486
+ selectionMode = input('none', ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
487
+ selectAllScope = input('page', ...(ngDevMode ? [{ debugName: "selectAllScope" }] : []));
488
+ /** Selected rows, two-way bindable. */
489
+ selected = model([], ...(ngDevMode ? [{ debugName: "selected" }] : []));
490
+ /** Selecting a row by clicking anywhere on it (not only the checkbox). */
491
+ selectOnRowClick = input(false, ...(ngDevMode ? [{ debugName: "selectOnRowClick" }] : []));
492
+ /** Bulk actions rendered in the selection bar once rows are selected. */
493
+ selectionActions = input([], ...(ngDevMode ? [{ debugName: "selectionActions" }] : []));
494
+ /* ---------------------------------------------------------------- */
495
+ /* Row actions / presentation */
496
+ /* ---------------------------------------------------------------- */
497
+ rowActions = input([], ...(ngDevMode ? [{ debugName: "rowActions" }] : []));
498
+ actionsHeader = input('Actions', ...(ngDevMode ? [{ debugName: "actionsHeader" }] : []));
499
+ actionsWidth = input('120px', ...(ngDevMode ? [{ debugName: "actionsWidth" }] : []));
500
+ rowClickable = input(false, ...(ngDevMode ? [{ debugName: "rowClickable" }] : []));
501
+ rowClass = input(...(ngDevMode ? [undefined, { debugName: "rowClass" }] : []));
502
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
503
+ loadingText = input('Loading…', ...(ngDevMode ? [{ debugName: "loadingText" }] : []));
504
+ striped = input(false, ...(ngDevMode ? [{ debugName: "striped" }] : []));
505
+ hoverable = input(true, ...(ngDevMode ? [{ debugName: "hoverable" }] : []));
506
+ bordered = input(false, ...(ngDevMode ? [{ debugName: "bordered" }] : []));
507
+ dense = input(false, ...(ngDevMode ? [{ debugName: "dense" }] : []));
508
+ stickyHeader = input(false, ...(ngDevMode ? [{ debugName: "stickyHeader" }] : []));
509
+ /** CSS max-height of the scroll container, e.g. `'480px'`. */
510
+ maxHeight = input('', ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
511
+ /* ---------------------------------------------------------------- */
512
+ /* Copy / context menu / column presets */
513
+ /* ---------------------------------------------------------------- */
514
+ /** Show a copy button on hover and enable Ctrl/Cmd+C on a focused cell. */
515
+ copyable = input(false, ...(ngDevMode ? [{ debugName: "copyable" }] : []));
516
+ /** Show the toolbar "Columns" popover (visibility switching). */
517
+ showColumnPicker = input(false, ...(ngDevMode ? [{ debugName: "showColumnPicker" }] : []));
518
+ /** Show the comfortable/compact density toggle in the toolbar. */
519
+ showDensityToggle = input(false, ...(ngDevMode ? [{ debugName: "showDensityToggle" }] : []));
520
+ /** Show the per-column header menu (sort, pin, autosize, hide). */
521
+ showColumnMenu = input(true, ...(ngDevMode ? [{ debugName: "showColumnMenu" }] : []));
522
+ /** Show the toolbar "Export" button (CSV download). */
523
+ showExport = input(false, ...(ngDevMode ? [{ debugName: "showExport" }] : []));
524
+ /** Base file name used by `downloadCsv()`. */
525
+ exportFileName = input('table', ...(ngDevMode ? [{ debugName: "exportFileName" }] : []));
526
+ /** Show the toolbar "Views" menu for saving/loading named presets. */
527
+ showViews = input(false, ...(ngDevMode ? [{ debugName: "showViews" }] : []));
528
+ /** Allow dragging the column separator to resize a column. */
529
+ resizable = input(false, ...(ngDevMode ? [{ debugName: "resizable" }] : []));
530
+ /** Allow dragging a header onto another header to reorder columns. */
531
+ reorderable = input(false, ...(ngDevMode ? [{ debugName: "reorderable" }] : []));
532
+ /** Arrow-key navigation across cells with a single tab stop. */
533
+ keyboardNavigation = input(true, ...(ngDevMode ? [{ debugName: "keyboardNavigation" }] : []));
534
+ /**
535
+ * localStorage key for the saved column/density preset. When set, the user's
536
+ * choice is restored on the next visit.
537
+ */
538
+ storageKey = input('', ...(ngDevMode ? [{ debugName: "storageKey" }] : []));
539
+ /** Number of placeholder rows rendered while `loading` and there are no rows. */
540
+ skeletonRows = input(6, ...(ngDevMode ? [{ debugName: "skeletonRows" }] : []));
541
+ /**
542
+ * Minimum number of body rows the grid keeps in view. Rows stay at their natural
543
+ * height, the spare space stays empty, so a table with one row does not collapse
544
+ * into a single line. `0` lets the grid shrink to its content.
545
+ */
546
+ minRows = input(4, ...(ngDevMode ? [{ debugName: "minRows" }] : []));
547
+ /** Stick the checkbox column to the start edge. */
548
+ stickySelection = input(false, ...(ngDevMode ? [{ debugName: "stickySelection" }] : []));
549
+ /** Stick the actions column to the end edge. */
550
+ stickyActions = input(false, ...(ngDevMode ? [{ debugName: "stickyActions" }] : []));
551
+ /* ---------------------------------------------------------------- */
552
+ /* Row detail */
553
+ /* ---------------------------------------------------------------- */
554
+ /** How the `#ithTableRowDetail` template is expanded. */
555
+ rowDetailTrigger = input('button', ...(ngDevMode ? [{ debugName: "rowDetailTrigger" }] : []));
556
+ /* ---------------------------------------------------------------- */
557
+ /* Events */
558
+ /* ---------------------------------------------------------------- */
559
+ actionClick = output();
560
+ rowClick = output();
561
+ /** Emitted after a cell or row was copied to the clipboard. */
562
+ cellCopy = output();
563
+ /** Emitted on right-click / context-menu key; the menu is positioned at the pointer. */
564
+ rowContextMenu = output();
565
+ /** Visible column keys, emitted whenever the user changes column visibility. */
566
+ columnsChange = output();
567
+ densityChange = output();
568
+ /** Full user-chosen layout (hidden, density, order, widths, pinned). */
569
+ columnStateChange = output();
570
+ /** Bulk action clicked in the selection bar. */
571
+ selectionAction = output();
572
+ /** Emitted with the generated CSV text after `downloadCsv()` / the toolbar button. */
573
+ csvExport = output();
574
+ /** Emitted for both downloads (CSV and XLSX) with the produced file. */
575
+ exportFile = output();
576
+ /* ---------------------------------------------------------------- */
577
+ /* Custom templates */
578
+ /* ---------------------------------------------------------------- */
579
+ cellDirectives = contentChildren(TableCellDirective, ...(ngDevMode ? [{ debugName: "cellDirectives", descendants: true }] : [{ descendants: true }]));
580
+ headerDirectives = contentChildren(TableHeaderDirective, ...(ngDevMode ? [{ debugName: "headerDirectives", descendants: true }] : [{ descendants: true }]));
581
+ filterDirectives = contentChildren(TableFilterDirective, ...(ngDevMode ? [{ debugName: "filterDirectives", descendants: true }] : [{ descendants: true }]));
582
+ rowActionsDirectives = contentChildren(TableRowActionsDirective, ...(ngDevMode ? [{ debugName: "rowActionsDirectives", descendants: true }] : [{
583
+ descendants: true,
584
+ }]));
585
+ toolbarDirectives = contentChildren(TableToolbarDirective, ...(ngDevMode ? [{ debugName: "toolbarDirectives", descendants: true }] : [{ descendants: true }]));
586
+ footerDirectives = contentChildren(TableFooterDirective, ...(ngDevMode ? [{ debugName: "footerDirectives", descendants: true }] : [{ descendants: true }]));
587
+ emptyDirectives = contentChildren(TableEmptyDirective, ...(ngDevMode ? [{ debugName: "emptyDirectives", descendants: true }] : [{ descendants: true }]));
588
+ rowMenuDirectives = contentChildren(TableRowMenuDirective, ...(ngDevMode ? [{ debugName: "rowMenuDirectives", descendants: true }] : [{
589
+ descendants: true,
590
+ }]));
591
+ rowDetailDirectives = contentChildren(TableRowDetailDirective, ...(ngDevMode ? [{ debugName: "rowDetailDirectives", descendants: true }] : [{
592
+ descendants: true,
593
+ }]));
594
+ cellTemplates = computed(() => {
595
+ const templates = new Map();
596
+ for (const directive of this.cellDirectives()) {
597
+ templates.set(directive.columnKey(), directive.template);
598
+ }
599
+ return templates;
600
+ }, ...(ngDevMode ? [{ debugName: "cellTemplates" }] : []));
601
+ headerTemplates = computed(() => {
602
+ const templates = new Map();
603
+ for (const directive of this.headerDirectives()) {
604
+ templates.set(directive.columnKey(), directive.template);
605
+ }
606
+ return templates;
607
+ }, ...(ngDevMode ? [{ debugName: "headerTemplates" }] : []));
608
+ filterTemplates = computed(() => {
609
+ const templates = new Map();
610
+ for (const directive of this.filterDirectives()) {
611
+ templates.set(directive.columnKey(), directive.template);
612
+ }
613
+ return templates;
614
+ }, ...(ngDevMode ? [{ debugName: "filterTemplates" }] : []));
615
+ rowActionsTemplate = computed(() => this.rowActionsDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "rowActionsTemplate" }] : []));
616
+ toolbarTemplate = computed(() => this.toolbarDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "toolbarTemplate" }] : []));
617
+ footerTemplate = computed(() => this.footerDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
618
+ emptyTemplate = computed(() => this.emptyDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : []));
619
+ rowMenuTemplate = computed(() => this.rowMenuDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "rowMenuTemplate" }] : []));
620
+ rowDetailTemplate = computed(() => this.rowDetailDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "rowDetailTemplate" }] : []));
621
+ /* ---------------------------------------------------------------- */
622
+ /* Internal state */
623
+ /* ---------------------------------------------------------------- */
624
+ filters = model({}, ...(ngDevMode ? [{ debugName: "filters" }] : []));
625
+ skipInitialReset = true;
626
+ /** Columns hidden at runtime (on top of `column.hidden`), persisted via `storageKey`. */
627
+ hiddenColumnKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "hiddenColumnKeys" }] : []));
628
+ density = signal('comfortable', ...(ngDevMode ? [{ debugName: "density" }] : []));
629
+ /** Runtime column order (all column keys, hidden ones included). */
630
+ columnOrder = signal([], ...(ngDevMode ? [{ debugName: "columnOrder" }] : []));
631
+ /** Runtime widths in px, keyed by column key. */
632
+ columnWidths = signal({}, ...(ngDevMode ? [{ debugName: "columnWidths" }] : []));
633
+ /** Runtime pinning, keyed by column key. */
634
+ pinnedKeys = signal({}, ...(ngDevMode ? [{ debugName: "pinnedKeys" }] : []));
635
+ /** Measured header widths, used to offset stacked sticky columns. */
636
+ measuredWidths = signal({}, ...(ngDevMode ? [{ debugName: "measuredWidths" }] : []));
637
+ /** Saved named views. */
638
+ views = signal({}, ...(ngDevMode ? [{ debugName: "views" }] : []));
639
+ activeView = signal(null, ...(ngDevMode ? [{ debugName: "activeView" }] : []));
640
+ compact = computed(() => this.dense() || this.density() === 'compact', ...(ngDevMode ? [{ debugName: "compact" }] : []));
641
+ columnPickerOpen = signal(false, ...(ngDevMode ? [{ debugName: "columnPickerOpen" }] : []));
642
+ columnsMenuPos = signal(null, ...(ngDevMode ? [{ debugName: "columnsMenuPos" }] : []));
643
+ viewsOpen = signal(false, ...(ngDevMode ? [{ debugName: "viewsOpen" }] : []));
644
+ viewsMenuPos = signal(null, ...(ngDevMode ? [{ debugName: "viewsMenuPos" }] : []));
645
+ /** Export-format menu; `null` when closed. */
646
+ exportMenuPos = signal(null, ...(ngDevMode ? [{ debugName: "exportMenuPos" }] : []));
647
+ viewNameDraft = signal('', ...(ngDevMode ? [{ debugName: "viewNameDraft" }] : []));
648
+ /** Header menu state; `null` when closed. */
649
+ columnMenu = signal(null, ...(ngDevMode ? [{ debugName: "columnMenu" }] : []));
650
+ /** Right-click menu position; `null` when closed. */
651
+ menuState = signal(null, ...(ngDevMode ? [{ debugName: "menuState" }] : []));
652
+ /** `${rowIndex}:${columnKey}` of the cell that was just copied (shows a check icon). */
653
+ copiedCell = signal(null, ...(ngDevMode ? [{ debugName: "copiedCell" }] : []));
654
+ /** Row keys whose detail panel is open. */
655
+ expandedKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedKeys" }] : []));
656
+ /** Cell that owns the single tab stop of the grid. */
657
+ focusedCell = signal(null, ...(ngDevMode ? [{ debugName: "focusedCell" }] : []));
658
+ /** Column key being dragged, and the header it hovers. */
659
+ dragKey = signal(null, ...(ngDevMode ? [{ debugName: "dragKey" }] : []));
660
+ dragOverKey = signal(null, ...(ngDevMode ? [{ debugName: "dragOverKey" }] : []));
661
+ /** `true` once the scroll container is scrolled away from the top. */
662
+ scrolled = signal(false, ...(ngDevMode ? [{ debugName: "scrolled" }] : []));
663
+ resizing = null;
664
+ copyTimer;
665
+ measureHandle;
666
+ presetLoaded = false;
667
+ skeletonIndexes = computed(() => Array.from({ length: Math.max(0, this.skeletonRows()) }, (_, index) => index), ...(ngDevMode ? [{ debugName: "skeletonIndexes" }] : []));
668
+ constructor() {
669
+ // Restore the stored preset once, then persist every later change. Restoring must
670
+ // happen here (not in the constructor body) because `storageKey` is an input and is
671
+ // still empty until the host has bound it.
672
+ effect(() => {
673
+ const key = this.storageKey();
674
+ const state = this.state();
675
+ void this.views();
676
+ void this.activeView();
677
+ untracked(() => {
678
+ if (!this.presetLoaded) {
679
+ this.presetLoaded = true;
680
+ if (!key)
681
+ return;
682
+ const stored = this.readPreset(key);
683
+ if (stored) {
684
+ this.views.set(stored.views ?? {});
685
+ this.activeView.set(stored.activeView ?? null);
686
+ this.applyState(stored.state);
687
+ return;
688
+ }
689
+ }
690
+ this.persistPreset(key);
691
+ });
692
+ });
693
+ // In client mode any change to the query starts again from the first page. In server
694
+ // mode the consumer owns the page (and fetches on every `pageChange`), so resetting
695
+ // here would fire a second request for the same query change.
696
+ effect(() => {
697
+ this.search();
698
+ this.filters();
699
+ this.pageSize();
700
+ this.sort();
701
+ if (this.skipInitialReset) {
702
+ this.skipInitialReset = false;
703
+ return;
704
+ }
705
+ if (this.isServer())
706
+ return;
707
+ untracked(() => this.page.set(1));
708
+ });
709
+ // Keep the page inside the available range.
710
+ effect(() => {
711
+ const lastPage = this.pageCount();
712
+ const current = this.page();
713
+ if (current > lastPage)
714
+ untracked(() => this.page.set(lastPage));
715
+ else if (current < 1)
716
+ untracked(() => this.page.set(1));
717
+ });
718
+ // Sticky columns stack on measured widths, so re-measure after layout changes.
719
+ effect(() => {
720
+ this.pagedRows();
721
+ this.visibleColumns();
722
+ this.compact();
723
+ this.density();
724
+ untracked(() => this.scheduleMeasure());
725
+ });
726
+ afterNextRender(() => this.scheduleMeasure());
727
+ }
728
+ /* ---------------------------------------------------------------- */
729
+ /* Derived data */
730
+ /* ---------------------------------------------------------------- */
731
+ isServer = computed(() => this.mode() === 'server', ...(ngDevMode ? [{ debugName: "isServer" }] : []));
732
+ /** Columns in the user's order (hidden columns keep their slot in the list). */
733
+ orderedColumns = computed(() => {
734
+ const columns = this.columns();
735
+ const order = this.columnOrder();
736
+ if (!order.length)
737
+ return columns;
738
+ const indexOf = new Map(order.map((key, index) => [key, index]));
739
+ return [...columns].sort((a, b) => (indexOf.get(a.key) ?? Number.MAX_SAFE_INTEGER) -
740
+ (indexOf.get(b.key) ?? Number.MAX_SAFE_INTEGER));
741
+ }, ...(ngDevMode ? [{ debugName: "orderedColumns" }] : []));
742
+ visibleColumns = computed(() => {
743
+ const hidden = this.hiddenColumnKeys();
744
+ return this.orderedColumns().filter((column) => !column.hidden && !hidden.has(column.key));
745
+ }, ...(ngDevMode ? [{ debugName: "visibleColumns" }] : []));
746
+ selectable = computed(() => this.selectionMode() !== 'none', ...(ngDevMode ? [{ debugName: "selectable" }] : []));
747
+ hasActionsColumn = computed(() => this.rowActions().length > 0 || !!this.rowActionsTemplate(), ...(ngDevMode ? [{ debugName: "hasActionsColumn" }] : []));
748
+ hasRowDetail = computed(() => !!this.rowDetailTemplate() && this.rowDetailTrigger() !== 'none', ...(ngDevMode ? [{ debugName: "hasRowDetail" }] : []));
749
+ /** Expander cell rendered as the first cell of every row. */
750
+ hasExpander = computed(() => this.hasRowDetail() && this.rowDetailTrigger() === 'button', ...(ngDevMode ? [{ debugName: "hasExpander" }] : []));
751
+ /** Rows that match the global search and the per-column filters (client mode). */
752
+ matchingRows = computed(() => {
753
+ const rows = this.data();
754
+ if (this.isServer())
755
+ return rows;
756
+ const term = this.search().trim().toLowerCase();
757
+ const activeFilters = Object.entries(this.filters()).filter(([, value]) => value.trim() !== '');
758
+ let result = rows;
759
+ if (term) {
760
+ const searchColumns = this.visibleColumns().filter((column) => column.searchable !== false);
761
+ result = result.filter((row) => searchColumns.some((column) => this.searchText(row, column).includes(term)));
762
+ }
763
+ if (activeFilters.length) {
764
+ const columns = this.visibleColumns();
765
+ result = result.filter((row) => activeFilters.every(([key, value]) => {
766
+ const column = columns.find((candidate) => candidate.key === key);
767
+ if (!column)
768
+ return true;
769
+ return this.columnMatchesFilter(row, column, value);
770
+ }));
771
+ }
772
+ return result;
773
+ }, ...(ngDevMode ? [{ debugName: "matchingRows" }] : []));
774
+ /** Matching rows in the active sort order (client mode). */
775
+ sortedRows = computed(() => {
776
+ const rows = this.matchingRows();
777
+ if (this.isServer())
778
+ return rows;
779
+ const sort = this.sort();
780
+ if (!sort)
781
+ return rows;
782
+ const column = this.columns().find((candidate) => candidate.key === sort.key);
783
+ if (!column)
784
+ return rows;
785
+ const direction = sort.direction;
786
+ return [...rows].sort((a, b) => compareWithDirection(this.compareRows(a, b, column), direction));
787
+ }, ...(ngDevMode ? [{ debugName: "sortedRows" }] : []));
788
+ totalRows = computed(() => this.isServer() ? this.total() || this.data().length : this.sortedRows().length, ...(ngDevMode ? [{ debugName: "totalRows" }] : []));
789
+ pageCount = computed(() => Math.max(1, Math.ceil(this.totalRows() / Math.max(1, this.pageSize()))), ...(ngDevMode ? [{ debugName: "pageCount" }] : []));
790
+ /** Rows of the current page. */
791
+ pagedRows = computed(() => {
792
+ if (this.isServer())
793
+ return this.data();
794
+ const size = Math.max(1, this.pageSize());
795
+ const start = (this.page() - 1) * size;
796
+ return this.sortedRows().slice(start, start + size);
797
+ }, ...(ngDevMode ? [{ debugName: "pagedRows" }] : []));
798
+ pageItems = computed(() => buildPageWindow(this.page(), this.pageCount(), this.maxPageButtons()), ...(ngDevMode ? [{ debugName: "pageItems" }] : []));
799
+ rangeStart = computed(() => this.totalRows() === 0 ? 0 : (this.page() - 1) * this.pageSize() + 1, ...(ngDevMode ? [{ debugName: "rangeStart" }] : []));
800
+ rangeEnd = computed(() => Math.min(this.page() * this.pageSize(), this.totalRows()), ...(ngDevMode ? [{ debugName: "rangeEnd" }] : []));
801
+ pageSizeChoices = computed(() => [...new Set([...this.pageSizeOptions(), this.pageSize()])].sort((a, b) => a - b), ...(ngDevMode ? [{ debugName: "pageSizeChoices" }] : []));
802
+ selectedKeySet = computed(() => new Set(this.selected().map((row) => this.rowKey(row))), ...(ngDevMode ? [{ debugName: "selectedKeySet" }] : []));
803
+ allPageSelected = computed(() => {
804
+ const rows = this.pagedRows();
805
+ return rows.length > 0 && rows.every((row) => this.selectedKeySet().has(this.rowKey(row)));
806
+ }, ...(ngDevMode ? [{ debugName: "allPageSelected" }] : []));
807
+ somePageSelected = computed(() => !this.allPageSelected() &&
808
+ this.pagedRows().some((row) => this.selectedKeySet().has(this.rowKey(row))), ...(ngDevMode ? [{ debugName: "somePageSelected" }] : []));
809
+ emptyColspan = computed(() => Math.max(1, this.visibleColumns().length +
810
+ (this.selectable() ? 1 : 0) +
811
+ (this.hasActionsColumn() ? 1 : 0) +
812
+ (this.hasExpander() ? 1 : 0)), ...(ngDevMode ? [{ debugName: "emptyColspan" }] : []));
813
+ hasQuery = computed(() => this.search().trim() !== '' ||
814
+ Object.values(this.filters()).some((value) => value.trim() !== ''), ...(ngDevMode ? [{ debugName: "hasQuery" }] : []));
815
+ /** Removable chips for the active search term and filters. */
816
+ filterChips = computed(() => {
817
+ const chips = [];
818
+ const term = this.search().trim();
819
+ if (term) {
820
+ chips.push({ kind: 'search', key: '__search', label: 'Search', value: term });
821
+ }
822
+ for (const [key, value] of Object.entries(this.filters())) {
823
+ if (!value.trim())
824
+ continue;
825
+ const column = this.columns().find((candidate) => candidate.key === key);
826
+ const option = this.filterOptionsFor(column ?? { key }).find((candidate) => String(candidate.value) === value);
827
+ chips.push({
828
+ kind: 'filter',
829
+ key,
830
+ label: column?.header ?? key,
831
+ value: option?.label ?? value,
832
+ });
833
+ }
834
+ return chips;
835
+ }, ...(ngDevMode ? [{ debugName: "filterChips" }] : []));
836
+ /** Columns that declare a footer aggregate. */
837
+ hasAggregates = computed(() => this.visibleColumns().some((column) => !!column.aggregate), ...(ngDevMode ? [{ debugName: "hasAggregates" }] : []));
838
+ /** Full user layout, the shape that `storageKey` stores. */
839
+ state = computed(() => ({
840
+ hidden: [...this.hiddenColumnKeys()],
841
+ density: this.density(),
842
+ order: this.columnOrder(),
843
+ widths: this.columnWidths(),
844
+ pinned: this.pinnedKeys(),
845
+ }), ...(ngDevMode ? [{ debugName: "state" }] : []));
846
+ savedViewNames = computed(() => Object.keys(this.views()).sort(), ...(ngDevMode ? [{ debugName: "savedViewNames" }] : []));
847
+ /* ---------------------------------------------------------------- */
848
+ /* Sorting API */
849
+ /* ---------------------------------------------------------------- */
850
+ isSortable(column) {
851
+ return this.sortable() && column.sortable !== false;
852
+ }
853
+ ariaSort(column) {
854
+ const sort = this.sort();
855
+ if (!sort || sort.key !== column.key)
856
+ return 'none';
857
+ return sort.direction === 'asc' ? 'ascending' : 'descending';
858
+ }
859
+ sortDirection(column) {
860
+ const sort = this.sort();
861
+ return sort && sort.key === column.key ? sort.direction : null;
862
+ }
863
+ /** Cycles `asc` → `desc` → unsorted. */
864
+ toggleSort(column) {
865
+ if (!this.isSortable(column))
866
+ return;
867
+ const current = this.sort();
868
+ if (!current || current.key !== column.key) {
869
+ this.sort.set({ key: column.key, direction: 'asc' });
870
+ }
871
+ else if (current.direction === 'asc') {
872
+ this.sort.set({ key: column.key, direction: 'desc' });
873
+ }
874
+ else {
875
+ this.sort.set(null);
876
+ }
877
+ }
878
+ /* ---------------------------------------------------------------- */
879
+ /* Search / filter API */
880
+ /* ---------------------------------------------------------------- */
881
+ onSearchInput(value) {
882
+ this.search.set(value);
883
+ }
884
+ clearSearch() {
885
+ this.search.set('');
886
+ }
887
+ onFilterInput(key, value) {
888
+ const next = { ...this.filters(), [key]: value };
889
+ this.filters.set(next);
890
+ this.filterChange.emit(next);
891
+ }
892
+ filterValue(key) {
893
+ return this.filters()[key] ?? '';
894
+ }
895
+ /** Control rendered in the filter row for this column. */
896
+ filterTypeFor(column) {
897
+ return column.filterType ?? 'text';
898
+ }
899
+ filterOptionsFor(column) {
900
+ return column.filterOptions ?? [];
901
+ }
902
+ filterPlaceholderFor(column) {
903
+ return column.filterPlaceholder ?? this.filterPlaceholder();
904
+ }
905
+ filterTemplate(column) {
906
+ return this.filterTemplates().get(column.key);
907
+ }
908
+ /** Context handed to a custom `#ithTableFilter` template. */
909
+ filterContext(column) {
910
+ const value = this.filterValue(column.key);
911
+ return {
912
+ $implicit: value,
913
+ value,
914
+ column,
915
+ setValue: (next) => this.onFilterInput(column.key, next),
916
+ };
917
+ }
918
+ clearFilters() {
919
+ this.filters.set({});
920
+ this.filterChange.emit({});
921
+ }
922
+ clearQuery() {
923
+ this.search.set('');
924
+ this.clearFilters();
925
+ }
926
+ /** Remove one chip from the chip row. */
927
+ removeChip(chip) {
928
+ if (chip.kind === 'search') {
929
+ this.clearSearch();
930
+ return;
931
+ }
932
+ const next = { ...this.filters() };
933
+ delete next[chip.key];
934
+ this.filters.set(next);
935
+ this.filterChange.emit(next);
936
+ }
937
+ /* ---------------------------------------------------------------- */
938
+ /* Pagination API */
939
+ /* ---------------------------------------------------------------- */
940
+ goToPage(page) {
941
+ const next = Math.min(Math.max(1, Math.floor(page) || 1), this.pageCount());
942
+ if (next !== this.page())
943
+ this.page.set(next);
944
+ }
945
+ nextPage() {
946
+ this.goToPage(this.page() + 1);
947
+ }
948
+ previousPage() {
949
+ this.goToPage(this.page() - 1);
950
+ }
951
+ firstPage() {
952
+ this.goToPage(1);
953
+ }
954
+ lastPage() {
955
+ this.goToPage(this.pageCount());
956
+ }
957
+ onPageSizeChange(value) {
958
+ const size = Number(value);
959
+ if (!Number.isFinite(size) || size < 1)
960
+ return;
961
+ this.pageSize.set(size);
962
+ }
963
+ /* ---------------------------------------------------------------- */
964
+ /* Selection API */
965
+ /* ---------------------------------------------------------------- */
966
+ rowKey(row) {
967
+ const key = this.keyField();
968
+ const value = key ? getPathValue(row, key) : undefined;
969
+ return value === undefined || value === null ? row : value;
970
+ }
971
+ isSelected(row) {
972
+ return this.selectedKeySet().has(this.rowKey(row));
973
+ }
974
+ toggleRow(row, checked) {
975
+ if (!this.selectable())
976
+ return;
977
+ if (this.selectionMode() === 'single') {
978
+ this.selected.set(checked ? [row] : []);
979
+ return;
980
+ }
981
+ const key = this.rowKey(row);
982
+ if (checked) {
983
+ if (!this.selectedKeySet().has(key))
984
+ this.selected.set([...this.selected(), row]);
985
+ }
986
+ else {
987
+ this.selected.set(this.selected().filter((candidate) => this.rowKey(candidate) !== key));
988
+ }
989
+ }
990
+ onRowCheckboxChange(row, event) {
991
+ this.toggleRow(row, event.target.checked);
992
+ }
993
+ toggleAll(checked) {
994
+ if (!this.selectable())
995
+ return;
996
+ const candidates = this.selectAllScope() === 'all'
997
+ ? this.isServer()
998
+ ? this.data()
999
+ : this.sortedRows()
1000
+ : this.pagedRows();
1001
+ if (this.selectionMode() === 'single') {
1002
+ this.selected.set(checked ? candidates.slice(0, 1) : []);
1003
+ return;
1004
+ }
1005
+ const selection = new Map(this.selected().map((row) => [this.rowKey(row), row]));
1006
+ for (const row of candidates) {
1007
+ if (checked)
1008
+ selection.set(this.rowKey(row), row);
1009
+ else
1010
+ selection.delete(this.rowKey(row));
1011
+ }
1012
+ this.selected.set([...selection.values()]);
1013
+ }
1014
+ onSelectAllChange(event) {
1015
+ this.toggleAll(event.target.checked);
1016
+ }
1017
+ clearSelection() {
1018
+ this.selected.set([]);
1019
+ }
1020
+ selectRow(row) {
1021
+ this.toggleRow(row, true);
1022
+ }
1023
+ deselectRow(row) {
1024
+ this.toggleRow(row, false);
1025
+ }
1026
+ /** Click on a selection-bar action. */
1027
+ onSelectionAction(action, event) {
1028
+ event.stopPropagation();
1029
+ this.selectionAction.emit({ action, rows: this.selected() });
1030
+ }
1031
+ /* ---------------------------------------------------------------- */
1032
+ /* Row actions */
1033
+ /* ---------------------------------------------------------------- */
1034
+ isActionVisible(action, row, index) {
1035
+ return action.hidden ? !action.hidden(row, index) : true;
1036
+ }
1037
+ isActionDisabled(action, row, index) {
1038
+ return action.disabled ? action.disabled(row, index) : false;
1039
+ }
1040
+ onActionClick(action, row, index, event) {
1041
+ event.stopPropagation();
1042
+ this.actionClick.emit({ action, row, index });
1043
+ }
1044
+ onRowClick(row, index, event) {
1045
+ if (isInteractiveTarget(event.target))
1046
+ return;
1047
+ this.activateRow(row, index, event);
1048
+ }
1049
+ /** `Enter` / `Space` activate a focusable row exactly like a mouse click. */
1050
+ onRowKeydown(row, index, event) {
1051
+ this.onRowContextMenuKey(row, index, event);
1052
+ if (event.defaultPrevented)
1053
+ return;
1054
+ if (event.key !== 'Enter' && event.key !== ' ')
1055
+ return;
1056
+ if (isInteractiveTarget(event.target))
1057
+ return;
1058
+ if (!this.rowClickable() && !this.selectOnRowClick() && !this.togglesDetailOnRow())
1059
+ return;
1060
+ event.preventDefault();
1061
+ this.activateRow(row, index, event);
1062
+ }
1063
+ /** Shared by mouse and keyboard activation. */
1064
+ activateRow(row, index, event) {
1065
+ if (this.rowClickable())
1066
+ this.rowClick.emit({ row, index, event });
1067
+ if (this.selectOnRowClick() && this.selectable()) {
1068
+ this.toggleRow(row, !this.isSelected(row));
1069
+ }
1070
+ if (this.togglesDetailOnRow())
1071
+ this.toggleRowDetail(row);
1072
+ }
1073
+ togglesDetailOnRow() {
1074
+ return this.hasRowDetail() && this.rowDetailTrigger() === 'row';
1075
+ }
1076
+ /* ---------------------------------------------------------------- */
1077
+ /* Row detail */
1078
+ /* ---------------------------------------------------------------- */
1079
+ isRowExpanded(row) {
1080
+ return this.expandedKeys().has(String(this.rowKey(row)));
1081
+ }
1082
+ toggleRowDetail(row, event) {
1083
+ event?.stopPropagation();
1084
+ const key = String(this.rowKey(row));
1085
+ const next = new Set(this.expandedKeys());
1086
+ if (next.has(key))
1087
+ next.delete(key);
1088
+ else
1089
+ next.add(key);
1090
+ this.expandedKeys.set(next);
1091
+ }
1092
+ /** `close` callback handed to the `#ithTableRowDetail` template. */
1093
+ rowDetailContext(row, index) {
1094
+ return {
1095
+ $implicit: row,
1096
+ row,
1097
+ index,
1098
+ close: () => this.toggleRowDetail(row),
1099
+ };
1100
+ }
1101
+ /* ---------------------------------------------------------------- */
1102
+ /* Rendering helpers */
1103
+ /* ---------------------------------------------------------------- */
1104
+ cellValue(row, column) {
1105
+ return getPathValue(row, column.field ?? column.key);
1106
+ }
1107
+ cellText(row, column, index = 0) {
1108
+ const value = this.cellValue(row, column);
1109
+ const formatted = column.formatter ? column.formatter(value, row, index) : value;
1110
+ return toDisplay(formatted);
1111
+ }
1112
+ cellContext(row, column, index) {
1113
+ return {
1114
+ $implicit: row,
1115
+ row,
1116
+ column,
1117
+ value: this.cellValue(row, column),
1118
+ index,
1119
+ };
1120
+ }
1121
+ cellTemplate(column) {
1122
+ return this.cellTemplates().get(column.key);
1123
+ }
1124
+ headerTemplate(column) {
1125
+ return this.headerTemplates().get(column.key);
1126
+ }
1127
+ cellClassFor(row, column, index) {
1128
+ const value = typeof column.cellClass === 'function' ? column.cellClass(row, index) : column.cellClass;
1129
+ return value ?? '';
1130
+ }
1131
+ headerClassFor(column) {
1132
+ return [this.alignClass(column), column.headerClass ?? ''].filter((value) => !!value);
1133
+ }
1134
+ /** Flat class list for a header cell (NgClass rejects nested arrays). */
1135
+ headerClasses(column) {
1136
+ return [
1137
+ ...this.headerClassFor(column),
1138
+ this.stickyClassFor(column),
1139
+ this.dragOverKey() === column.key ? 'ith-table-drop-target' : '',
1140
+ ].filter((value) => !!value);
1141
+ }
1142
+ filterClasses(column) {
1143
+ return [this.alignClass(column), this.stickyClassFor(column)].filter((value) => !!value);
1144
+ }
1145
+ /** Flat class list for a body cell, including dynamic `cellClass` output. */
1146
+ cellClasses(row, column, index) {
1147
+ const extra = this.cellClassFor(row, column, index);
1148
+ const values = Array.isArray(extra) ? extra : [extra];
1149
+ return [this.alignClass(column), this.stickyClassFor(column), ...values].filter((value) => !!value);
1150
+ }
1151
+ columnStyle(column) {
1152
+ const style = {};
1153
+ const width = this.columnWidths()[column.key];
1154
+ if (width) {
1155
+ style['width'] = `${width}px`;
1156
+ style['min-width'] = `${width}px`;
1157
+ style['max-width'] = `${width}px`;
1158
+ }
1159
+ else {
1160
+ if (column.width)
1161
+ style['width'] = column.width;
1162
+ if (column.minWidth)
1163
+ style['min-width'] = column.minWidth;
1164
+ }
1165
+ const pin = this.pinOf(column);
1166
+ if (pin) {
1167
+ const offset = this.stickyOffsets().get(column.key);
1168
+ if (pin === 'start')
1169
+ style['left'] = `${offset ?? 0}px`;
1170
+ else
1171
+ style['right'] = `${offset ?? 0}px`;
1172
+ }
1173
+ return style;
1174
+ }
1175
+ /** Runtime pin, falling back to the declared `column.sticky`. */
1176
+ pinOf(column) {
1177
+ return this.pinnedKeys()[column.key] ?? column.sticky ?? null;
1178
+ }
1179
+ stickyClassFor(column) {
1180
+ const pin = this.pinOf(column);
1181
+ if (pin === 'start')
1182
+ return 'ith-table-sticky-start';
1183
+ if (pin === 'end')
1184
+ return 'ith-table-sticky-end';
1185
+ return '';
1186
+ }
1187
+ /**
1188
+ * Left/right offsets for stacked sticky columns. Depends on measured widths, so it
1189
+ * stays correct for auto-sized and resized columns.
1190
+ */
1191
+ stickyOffsets = computed(() => {
1192
+ const offsets = new Map();
1193
+ const measured = this.measuredWidths();
1194
+ const declared = this.columnWidths();
1195
+ const widthOf = (column) => declared[column.key] ?? measured[column.key] ?? this.declaredWidthPx(column);
1196
+ let start = this.selectable() && this.stickySelection() ? 46 : 0;
1197
+ for (const column of this.visibleColumns()) {
1198
+ if (this.pinOf(column) !== 'start')
1199
+ continue;
1200
+ offsets.set(column.key, start);
1201
+ start += widthOf(column);
1202
+ }
1203
+ let end = this.hasActionsColumn() && this.stickyActions() ? this.actionsWidthPx() : 0;
1204
+ for (const column of [...this.visibleColumns()].reverse()) {
1205
+ if (this.pinOf(column) !== 'end')
1206
+ continue;
1207
+ offsets.set(column.key, end);
1208
+ end += widthOf(column);
1209
+ }
1210
+ return offsets;
1211
+ }, ...(ngDevMode ? [{ debugName: "stickyOffsets" }] : []));
1212
+ /** Full text for the native tooltip; `null` disables it for a column. */
1213
+ tooltipText(row, column, index) {
1214
+ if (column.tooltip === false)
1215
+ return null;
1216
+ return this.cellText(row, column, index) || null;
1217
+ }
1218
+ declaredWidthPx(column) {
1219
+ const width = column.width ?? '';
1220
+ if (width.endsWith('px'))
1221
+ return Number.parseFloat(width) || DEFAULT_COLUMN_WIDTH;
1222
+ return DEFAULT_COLUMN_WIDTH;
1223
+ }
1224
+ actionsWidthPx() {
1225
+ const width = this.actionsWidth();
1226
+ return width.endsWith('px') ? Number.parseFloat(width) || 120 : 120;
1227
+ }
1228
+ /* ---------------------------------------------------------------- */
1229
+ /* Copy / context menu */
1230
+ /* ---------------------------------------------------------------- */
1231
+ copyCell(row, column, index, event) {
1232
+ event?.stopPropagation();
1233
+ const value = this.cellText(row, column, index);
1234
+ this.copyText(value, `${index}:${column.key}`);
1235
+ this.cellCopy.emit({ value, row, index, column });
1236
+ }
1237
+ copyRow(row, index, event) {
1238
+ event?.stopPropagation();
1239
+ const value = this.visibleColumns()
1240
+ .map((column) => this.cellText(row, column, index))
1241
+ .join('\t');
1242
+ this.copyText(value, `${index}:__row`);
1243
+ this.cellCopy.emit({ value, row, index, column: null });
1244
+ }
1245
+ isCellCopied(index, column) {
1246
+ return this.copiedCell() === `${index}:${column.key}`;
1247
+ }
1248
+ onRowContextMenu(row, index, event) {
1249
+ this.rowContextMenu.emit({ row, index, x: event.clientX, y: event.clientY, event });
1250
+ if (!this.rowMenuTemplate())
1251
+ return;
1252
+ event.preventDefault();
1253
+ this.menuState.set({ row, index, x: event.clientX, y: event.clientY });
1254
+ }
1255
+ /** Keyboard path for the same menu (context-menu key / Shift+F10). */
1256
+ onRowContextMenuKey(row, index, event) {
1257
+ if (event.key !== 'ContextMenu' && !(event.shiftKey && event.key === 'F10'))
1258
+ return;
1259
+ if (!this.rowMenuTemplate())
1260
+ return;
1261
+ event.preventDefault();
1262
+ const target = event.target;
1263
+ const rect = target?.getBoundingClientRect();
1264
+ const x = rect ? rect.left + Math.min(24, rect.width / 2) : 0;
1265
+ const y = rect ? rect.bottom : 0;
1266
+ this.rowContextMenu.emit({ row, index, x, y, event });
1267
+ this.menuState.set({ row, index, x, y });
1268
+ }
1269
+ closeRowMenu() {
1270
+ this.menuState.set(null);
1271
+ }
1272
+ /* ---------------------------------------------------------------- */
1273
+ /* Keyboard grid navigation */
1274
+ /* ---------------------------------------------------------------- */
1275
+ /** `tabindex` of a body cell: one tab stop for the whole grid. */
1276
+ cellTabIndex(rowIndex, colIndex) {
1277
+ if (!this.keyboardNavigation())
1278
+ return this.copyable() ? 0 : null;
1279
+ const focused = this.focusedCell();
1280
+ if (!focused)
1281
+ return rowIndex === 0 && colIndex === 0 ? 0 : -1;
1282
+ return focused.row === rowIndex && focused.col === colIndex ? 0 : -1;
1283
+ }
1284
+ onCellFocus(rowIndex, colIndex) {
1285
+ const current = this.focusedCell();
1286
+ if (current && current.row === rowIndex && current.col === colIndex)
1287
+ return;
1288
+ this.focusedCell.set({ row: rowIndex, col: colIndex });
1289
+ }
1290
+ /** Copy shortcut plus arrow/Home/End/Page navigation for the cell grid. */
1291
+ onCellKeydown(column, rowIndex, colIndex, event) {
1292
+ if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'c') {
1293
+ if (!this.copyable() || isInteractiveTarget(event.target))
1294
+ return;
1295
+ event.preventDefault();
1296
+ const row = this.pagedRows()[rowIndex];
1297
+ if (row)
1298
+ this.copyCell(row, column, rowIndex);
1299
+ return;
1300
+ }
1301
+ if (!this.keyboardNavigation() || event.altKey)
1302
+ return;
1303
+ const rows = this.pagedRows().length;
1304
+ const cols = this.visibleColumns().length;
1305
+ if (!rows || !cols)
1306
+ return;
1307
+ const lastRow = rows - 1;
1308
+ const lastCol = cols - 1;
1309
+ let row = rowIndex;
1310
+ let col = colIndex;
1311
+ switch (event.key) {
1312
+ case 'ArrowUp':
1313
+ row = Math.max(0, rowIndex - 1);
1314
+ break;
1315
+ case 'ArrowDown':
1316
+ row = Math.min(lastRow, rowIndex + 1);
1317
+ break;
1318
+ case 'ArrowLeft':
1319
+ col = Math.max(0, colIndex - 1);
1320
+ break;
1321
+ case 'ArrowRight':
1322
+ col = Math.min(lastCol, colIndex + 1);
1323
+ break;
1324
+ case 'Home':
1325
+ if (event.ctrlKey || event.metaKey) {
1326
+ row = 0;
1327
+ col = 0;
1328
+ }
1329
+ else {
1330
+ col = 0;
1331
+ }
1332
+ break;
1333
+ case 'End':
1334
+ if (event.ctrlKey || event.metaKey) {
1335
+ row = lastRow;
1336
+ col = lastCol;
1337
+ }
1338
+ else {
1339
+ col = lastCol;
1340
+ }
1341
+ break;
1342
+ case 'PageUp':
1343
+ row = Math.max(0, rowIndex - this.pageSize());
1344
+ break;
1345
+ case 'PageDown':
1346
+ row = Math.min(lastRow, rowIndex + this.pageSize());
1347
+ break;
1348
+ case ' ':
1349
+ case 'Spacebar': {
1350
+ const target = this.pagedRows()[rowIndex];
1351
+ if (!target || !this.selectable() || isInteractiveTarget(event.target))
1352
+ return;
1353
+ event.preventDefault();
1354
+ this.toggleRow(target, !this.isSelected(target));
1355
+ return;
1356
+ }
1357
+ default:
1358
+ return;
1359
+ }
1360
+ event.preventDefault();
1361
+ if (row === rowIndex && col === colIndex)
1362
+ return;
1363
+ this.focusCell(row, col);
1364
+ }
1365
+ /** Move DOM focus to a cell, updating the single tab stop. */
1366
+ focusCell(row, col) {
1367
+ this.focusedCell.set({ row, col });
1368
+ const target = this.host.nativeElement.querySelector(`[data-cell="${row}-${col}"]`);
1369
+ target?.focus();
1370
+ }
1371
+ /* ---------------------------------------------------------------- */
1372
+ /* Column preset / density */
1373
+ /* ---------------------------------------------------------------- */
1374
+ isColumnVisible(column) {
1375
+ return !column.hidden && !this.hiddenColumnKeys().has(column.key);
1376
+ }
1377
+ setColumnVisible(key, visible) {
1378
+ const next = new Set(this.hiddenColumnKeys());
1379
+ if (visible)
1380
+ next.delete(key);
1381
+ else if (!this.canHide(key))
1382
+ return;
1383
+ else
1384
+ next.add(key);
1385
+ // Never hide every column: keep at least one visible.
1386
+ const visibleCount = this.columns().filter((column) => !column.hidden && !next.has(column.key)).length;
1387
+ if (visibleCount === 0)
1388
+ return;
1389
+ this.hiddenColumnKeys.set(next);
1390
+ this.emitColumns();
1391
+ }
1392
+ resetColumns() {
1393
+ this.hiddenColumnKeys.set(new Set());
1394
+ this.columnOrder.set([]);
1395
+ this.columnWidths.set({});
1396
+ this.pinnedKeys.set({});
1397
+ this.emitColumns();
1398
+ }
1399
+ /** A column can be hidden when it is hideable and at least one other stays visible. */
1400
+ canHide(key) {
1401
+ const column = this.columns().find((candidate) => candidate.key === key);
1402
+ if (column?.hideable === false)
1403
+ return false;
1404
+ return this.visibleColumns().length > 1;
1405
+ }
1406
+ emitColumns() {
1407
+ this.columnsChange.emit(this.visibleColumns().map((column) => column.key));
1408
+ this.columnStateChange.emit(this.state());
1409
+ }
1410
+ toggleColumnPicker(event) {
1411
+ event?.stopPropagation();
1412
+ if (this.columnPickerOpen()) {
1413
+ this.columnPickerOpen.set(false);
1414
+ return;
1415
+ }
1416
+ const anchor = event?.currentTarget;
1417
+ if (anchor instanceof HTMLElement) {
1418
+ this.columnsMenuPos.set(this.floatPosition(anchor, 250, 380));
1419
+ }
1420
+ this.columnPickerOpen.set(true);
1421
+ this.viewsOpen.set(false);
1422
+ this.columnMenu.set(null);
1423
+ }
1424
+ toggleViews(event) {
1425
+ event?.stopPropagation();
1426
+ if (this.viewsOpen()) {
1427
+ this.viewsOpen.set(false);
1428
+ return;
1429
+ }
1430
+ const anchor = event?.currentTarget;
1431
+ if (anchor instanceof HTMLElement) {
1432
+ this.viewsMenuPos.set(this.floatPosition(anchor, 260, 340));
1433
+ }
1434
+ this.viewsOpen.set(true);
1435
+ this.columnPickerOpen.set(false);
1436
+ this.columnMenu.set(null);
1437
+ }
1438
+ /** Set the row density explicitly (the toolbar segmented control). */
1439
+ setDensity(density) {
1440
+ if (this.density() === density)
1441
+ return;
1442
+ this.density.set(density);
1443
+ this.densityChange.emit(density);
1444
+ }
1445
+ toggleDensity() {
1446
+ this.setDensity(this.density() === 'compact' ? 'comfortable' : 'compact');
1447
+ }
1448
+ /* ---- header menu ------------------------------------------------- */
1449
+ openColumnMenu(column, event) {
1450
+ event.stopPropagation();
1451
+ const anchor = event.currentTarget;
1452
+ if (!(anchor instanceof HTMLElement))
1453
+ return;
1454
+ if (this.columnMenu()?.key === column.key) {
1455
+ this.columnMenu.set(null);
1456
+ return;
1457
+ }
1458
+ const position = this.floatPosition(anchor, 220, 300);
1459
+ this.columnMenu.set({ key: column.key, ...position });
1460
+ this.columnPickerOpen.set(false);
1461
+ this.viewsOpen.set(false);
1462
+ }
1463
+ columnMenuColumn() {
1464
+ const menu = this.columnMenu();
1465
+ return menu ? this.columns().find((column) => column.key === menu.key) : undefined;
1466
+ }
1467
+ closeColumnMenu() {
1468
+ this.columnMenu.set(null);
1469
+ }
1470
+ menuSort(direction) {
1471
+ const column = this.columnMenuColumn();
1472
+ if (column)
1473
+ this.sort.set({ key: column.key, direction });
1474
+ this.closeColumnMenu();
1475
+ }
1476
+ menuClearSort() {
1477
+ this.sort.set(null);
1478
+ this.closeColumnMenu();
1479
+ }
1480
+ menuPin(pin) {
1481
+ const column = this.columnMenuColumn();
1482
+ if (column)
1483
+ this.pinColumn(column.key, pin);
1484
+ this.closeColumnMenu();
1485
+ }
1486
+ menuHide() {
1487
+ const column = this.columnMenuColumn();
1488
+ if (column)
1489
+ this.setColumnVisible(column.key, false);
1490
+ this.closeColumnMenu();
1491
+ }
1492
+ menuAutosize() {
1493
+ const column = this.columnMenuColumn();
1494
+ if (column)
1495
+ this.autosizeColumn(column.key);
1496
+ this.closeColumnMenu();
1497
+ }
1498
+ canPin(column) {
1499
+ return column.pinnable !== false;
1500
+ }
1501
+ pinColumn(key, pin) {
1502
+ const next = { ...this.pinnedKeys() };
1503
+ if (pin)
1504
+ next[key] = pin;
1505
+ else
1506
+ delete next[key];
1507
+ this.pinnedKeys.set(next);
1508
+ this.emitColumns();
1509
+ }
1510
+ /* ---- resize ------------------------------------------------------ */
1511
+ startResize(column, event) {
1512
+ if (!this.resizable())
1513
+ return;
1514
+ event.preventDefault();
1515
+ event.stopPropagation();
1516
+ const header = event.target.closest('th');
1517
+ const startWidth = header?.getBoundingClientRect().width ?? this.declaredWidthPx(column);
1518
+ this.resizing = { key: column.key, startX: event.clientX, startWidth };
1519
+ document.body.style.userSelect = 'none';
1520
+ }
1521
+ onDocumentPointerMove(event) {
1522
+ if (!this.resizing)
1523
+ return;
1524
+ const width = Math.max(MIN_COLUMN_WIDTH, Math.round(this.resizing.startWidth + event.clientX - this.resizing.startX));
1525
+ this.columnWidths.set({ ...this.columnWidths(), [this.resizing.key]: width });
1526
+ }
1527
+ onDocumentPointerUp() {
1528
+ if (!this.resizing)
1529
+ return;
1530
+ this.resizing = null;
1531
+ document.body.style.userSelect = '';
1532
+ this.scheduleMeasure();
1533
+ this.columnStateChange.emit(this.state());
1534
+ }
1535
+ /** Shrink/grow a column to its widest rendered value. */
1536
+ autosizeColumn(key) {
1537
+ const column = this.visibleColumns().find((candidate) => candidate.key === key);
1538
+ if (!column)
1539
+ return;
1540
+ const header = String(column.header ?? column.key);
1541
+ const widths = this.pagedRows().map((row, index) => this.cellText(row, column, index).length);
1542
+ const longest = Math.max(header.length, ...widths, 4);
1543
+ const width = Math.min(460, Math.max(MIN_COLUMN_WIDTH, Math.round(longest * 7.6) + 46));
1544
+ this.columnWidths.set({ ...this.columnWidths(), [key]: width });
1545
+ this.columnStateChange.emit(this.state());
1546
+ }
1547
+ /* ---- reorder ----------------------------------------------------- */
1548
+ onHeaderDragStart(column, event) {
1549
+ if (!this.reorderable()) {
1550
+ event.preventDefault();
1551
+ return;
1552
+ }
1553
+ this.dragKey.set(column.key);
1554
+ if (event.dataTransfer) {
1555
+ event.dataTransfer.effectAllowed = 'move';
1556
+ event.dataTransfer.setData('text/plain', column.key);
1557
+ }
1558
+ }
1559
+ onHeaderDragOver(column, event) {
1560
+ if (!this.reorderable() || !this.dragKey())
1561
+ return;
1562
+ event.preventDefault();
1563
+ if (event.dataTransfer)
1564
+ event.dataTransfer.dropEffect = 'move';
1565
+ if (this.dragOverKey() !== column.key)
1566
+ this.dragOverKey.set(column.key);
1567
+ }
1568
+ onHeaderDrop(column, event) {
1569
+ if (!this.reorderable())
1570
+ return;
1571
+ event.preventDefault();
1572
+ const from = this.dragKey();
1573
+ this.dragKey.set(null);
1574
+ this.dragOverKey.set(null);
1575
+ if (!from || from === column.key)
1576
+ return;
1577
+ this.moveColumn(from, column.key);
1578
+ }
1579
+ onHeaderDragEnd() {
1580
+ this.dragKey.set(null);
1581
+ this.dragOverKey.set(null);
1582
+ }
1583
+ /** Move `from` onto the slot of `to`, keeping hidden columns in the list. */
1584
+ moveColumn(from, to) {
1585
+ const order = this.orderedColumns().map((column) => column.key);
1586
+ const fromIndex = order.indexOf(from);
1587
+ const toIndex = order.indexOf(to);
1588
+ if (fromIndex < 0 || toIndex < 0)
1589
+ return;
1590
+ order.splice(fromIndex, 1);
1591
+ order.splice(toIndex, 0, from);
1592
+ this.columnOrder.set(order);
1593
+ this.emitColumns();
1594
+ }
1595
+ /* ---------------------------------------------------------------- */
1596
+ /* Export */
1597
+ /* ---------------------------------------------------------------- */
1598
+ /** Rows an export writes: the selection when there is one, else every match. */
1599
+ exportRows() {
1600
+ return this.selected().length ? this.selected() : this.sortedRows();
1601
+ }
1602
+ toggleExportMenu(event) {
1603
+ event?.stopPropagation();
1604
+ if (this.exportMenuPos()) {
1605
+ this.exportMenuPos.set(null);
1606
+ return;
1607
+ }
1608
+ const anchor = event?.currentTarget;
1609
+ this.exportMenuPos.set(anchor instanceof HTMLElement ? this.floatPosition(anchor, 210, 170) : { x: 8, y: 8 });
1610
+ this.columnPickerOpen.set(false);
1611
+ this.viewsOpen.set(false);
1612
+ this.columnMenu.set(null);
1613
+ }
1614
+ exportAs(format) {
1615
+ this.exportMenuPos.set(null);
1616
+ if (format === 'xlsx')
1617
+ this.downloadExcel();
1618
+ else
1619
+ this.downloadCsv();
1620
+ }
1621
+ /** CSV text of the current view: selected rows when there are any, else all matches. */
1622
+ toCsv() {
1623
+ const columns = this.visibleColumns();
1624
+ const rows = this.exportRows();
1625
+ const escapeValue = (value) => /[",;\n\r]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value;
1626
+ const header = columns.map((column) => escapeValue(String(column.header ?? column.key)));
1627
+ const body = rows.map((row, index) => columns.map((column) => escapeValue(this.cellText(row, column, index))).join(','));
1628
+ return [header.join(','), ...body].join('\r\n');
1629
+ }
1630
+ /** Download the current view as a UTF-8 CSV file. */
1631
+ downloadCsv() {
1632
+ const csv = this.toCsv();
1633
+ this.csvExport.emit(csv);
1634
+ const blob = new Blob([`\uFEFF${csv}`], { type: 'text/csv;charset=utf-8;' });
1635
+ this.saveFile(blob, `${this.exportFileName()}.csv`, 'csv');
1636
+ }
1637
+ /** Real Excel workbook (`.xlsx`) of the current view, built without dependencies. */
1638
+ toExcel() {
1639
+ const columns = this.visibleColumns();
1640
+ const rows = this.exportRows();
1641
+ return buildXlsxBlob({
1642
+ sheetName: this.title() || 'Data',
1643
+ header: columns.map((column) => String(column.header ?? column.key)),
1644
+ rows: rows.map((row, index) => columns.map((column) => this.cellText(row, column, index))),
1645
+ });
1646
+ }
1647
+ /** Download the current view as an `.xlsx` workbook. */
1648
+ downloadExcel() {
1649
+ this.saveFile(this.toExcel(), `${this.exportFileName()}.xlsx`, 'xlsx');
1650
+ }
1651
+ saveFile(blob, fileName, format) {
1652
+ this.exportFile.emit({ format, fileName, blob, rows: this.exportRows() });
1653
+ if (typeof document === 'undefined' || typeof URL === 'undefined')
1654
+ return;
1655
+ const url = URL.createObjectURL(blob);
1656
+ const link = document.createElement('a');
1657
+ link.href = url;
1658
+ link.download = fileName;
1659
+ link.style.display = 'none';
1660
+ document.body.appendChild(link);
1661
+ link.click();
1662
+ document.body.removeChild(link);
1663
+ setTimeout(() => URL.revokeObjectURL(url), 0);
1664
+ }
1665
+ /* ---------------------------------------------------------------- */
1666
+ /* Aggregates */
1667
+ /* ---------------------------------------------------------------- */
1668
+ /** Footer cell text for a column that declares an `aggregate`. */
1669
+ aggregateText(column) {
1670
+ if (!column.aggregate)
1671
+ return '';
1672
+ const aggregate = typeof column.aggregate === 'string' ? { type: column.aggregate } : column.aggregate;
1673
+ const rows = this.isServer() ? this.data() : this.sortedRows();
1674
+ if (aggregate.type === 'count') {
1675
+ return String(rows.length);
1676
+ }
1677
+ const numbers = rows
1678
+ .map((row) => Number(this.cellValue(row, column)))
1679
+ .filter((value) => Number.isFinite(value));
1680
+ if (!numbers.length)
1681
+ return '';
1682
+ let value = 0;
1683
+ switch (aggregate.type) {
1684
+ case 'sum':
1685
+ value = numbers.reduce((total, next) => total + next, 0);
1686
+ break;
1687
+ case 'avg':
1688
+ value = numbers.reduce((total, next) => total + next, 0) / numbers.length;
1689
+ break;
1690
+ case 'min':
1691
+ value = Math.min(...numbers);
1692
+ break;
1693
+ case 'max':
1694
+ value = Math.max(...numbers);
1695
+ break;
1696
+ }
1697
+ if (aggregate.format)
1698
+ return aggregate.format(value, column);
1699
+ return value.toLocaleString(undefined, { maximumFractionDigits: 2 });
1700
+ }
1701
+ aggregateLabel(column) {
1702
+ if (!column.aggregate)
1703
+ return '';
1704
+ if (typeof column.aggregate !== 'string' && column.aggregate.label) {
1705
+ return column.aggregate.label;
1706
+ }
1707
+ const type = typeof column.aggregate === 'string' ? column.aggregate : column.aggregate.type;
1708
+ return type;
1709
+ }
1710
+ /* ---------------------------------------------------------------- */
1711
+ /* Named views */
1712
+ /* ---------------------------------------------------------------- */
1713
+ applyView(name) {
1714
+ const view = this.views()[name];
1715
+ if (!view)
1716
+ return;
1717
+ this.applyState(view);
1718
+ this.activeView.set(name);
1719
+ this.viewsOpen.set(false);
1720
+ this.emitColumns();
1721
+ }
1722
+ saveView() {
1723
+ const name = this.viewNameDraft().trim();
1724
+ if (!name)
1725
+ return;
1726
+ this.views.set({ ...this.views(), [name]: this.state() });
1727
+ this.activeView.set(name);
1728
+ this.viewNameDraft.set('');
1729
+ }
1730
+ deleteView(name, event) {
1731
+ event.stopPropagation();
1732
+ const next = { ...this.views() };
1733
+ delete next[name];
1734
+ this.views.set(next);
1735
+ if (this.activeView() === name)
1736
+ this.activeView.set(null);
1737
+ }
1738
+ onViewNameInput(value) {
1739
+ this.viewNameDraft.set(value);
1740
+ }
1741
+ /* ---------------------------------------------------------------- */
1742
+ /* Scroll */
1743
+ /* ---------------------------------------------------------------- */
1744
+ onScroll(event) {
1745
+ const target = event.target;
1746
+ const scrolled = target.scrollTop > 0;
1747
+ if (scrolled !== this.scrolled())
1748
+ this.scrolled.set(scrolled);
1749
+ }
1750
+ /* ---------------------------------------------------------------- */
1751
+ /* Internals */
1752
+ /* ---------------------------------------------------------------- */
1753
+ copyText(value, key) {
1754
+ if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
1755
+ void navigator.clipboard.writeText(value).catch(() => undefined);
1756
+ }
1757
+ this.copiedCell.set(key);
1758
+ if (this.copyTimer)
1759
+ clearTimeout(this.copyTimer);
1760
+ this.copyTimer = setTimeout(() => this.copiedCell.set(null), 1400);
1761
+ }
1762
+ /** Screen position for a menu anchored to `anchor`, kept inside the viewport. */
1763
+ floatPosition(anchor, width, height) {
1764
+ const rect = anchor.getBoundingClientRect();
1765
+ const viewportWidth = typeof window === 'undefined' ? 1280 : window.innerWidth;
1766
+ const viewportHeight = typeof window === 'undefined' ? 800 : window.innerHeight;
1767
+ const x = Math.min(Math.max(8, rect.right - width), Math.max(8, viewportWidth - width - 8));
1768
+ const y = Math.min(rect.bottom + 6, Math.max(8, viewportHeight - height - 8));
1769
+ return { x, y };
1770
+ }
1771
+ /** Read header widths so stacked sticky columns line up. */
1772
+ measureHeaderWidths() {
1773
+ const headers = this.host.nativeElement.querySelectorAll('th[data-col]');
1774
+ if (!headers.length)
1775
+ return;
1776
+ const next = {};
1777
+ headers.forEach((header) => {
1778
+ const key = header.dataset['col'];
1779
+ if (!key)
1780
+ return;
1781
+ const width = Math.round(header.getBoundingClientRect().width);
1782
+ if (width > 0)
1783
+ next[key] = width;
1784
+ });
1785
+ const current = this.measuredWidths();
1786
+ const keys = Object.keys(next);
1787
+ const changed = keys.length !== Object.keys(current).length ||
1788
+ keys.some((key) => Math.abs((current[key] ?? 0) - next[key]) > 0.5);
1789
+ if (changed)
1790
+ this.measuredWidths.set(next);
1791
+ }
1792
+ scheduleMeasure() {
1793
+ if (typeof requestAnimationFrame === 'undefined')
1794
+ return;
1795
+ if (this.measureHandle)
1796
+ cancelAnimationFrame(this.measureHandle);
1797
+ this.measureHandle = requestAnimationFrame(() => {
1798
+ this.measureHandle = undefined;
1799
+ this.measureHeaderWidths();
1800
+ });
1801
+ }
1802
+ applyState(state) {
1803
+ if (!state)
1804
+ return;
1805
+ if (Array.isArray(state.hidden))
1806
+ this.hiddenColumnKeys.set(new Set(state.hidden));
1807
+ if (state.density === 'compact' || state.density === 'comfortable') {
1808
+ this.density.set(state.density);
1809
+ }
1810
+ if (Array.isArray(state.order))
1811
+ this.columnOrder.set([...state.order]);
1812
+ if (state.widths && typeof state.widths === 'object') {
1813
+ this.columnWidths.set({ ...state.widths });
1814
+ }
1815
+ if (state.pinned && typeof state.pinned === 'object') {
1816
+ this.pinnedKeys.set({ ...state.pinned });
1817
+ }
1818
+ }
1819
+ readPreset(key) {
1820
+ if (!key || typeof localStorage === 'undefined')
1821
+ return null;
1822
+ try {
1823
+ const raw = localStorage.getItem(key);
1824
+ if (!raw)
1825
+ return null;
1826
+ const parsed = JSON.parse(raw);
1827
+ if (parsed.state) {
1828
+ return {
1829
+ state: parsed.state,
1830
+ views: parsed.views ?? {},
1831
+ activeView: parsed.activeView ?? null,
1832
+ };
1833
+ }
1834
+ return {
1835
+ state: {
1836
+ hidden: Array.isArray(parsed.hidden) ? parsed.hidden : [],
1837
+ density: parsed.density === 'compact' ? 'compact' : 'comfortable',
1838
+ order: [],
1839
+ widths: {},
1840
+ pinned: {},
1841
+ },
1842
+ views: {},
1843
+ activeView: null,
1844
+ };
1845
+ }
1846
+ catch {
1847
+ return null;
1848
+ }
1849
+ }
1850
+ persistPreset(key) {
1851
+ if (!key || typeof localStorage === 'undefined')
1852
+ return;
1853
+ try {
1854
+ localStorage.setItem(key, JSON.stringify({
1855
+ v: 2,
1856
+ state: this.state(),
1857
+ views: this.views(),
1858
+ activeView: this.activeView(),
1859
+ }));
1860
+ }
1861
+ catch {
1862
+ // Storage disabled (private mode) — the preset simply stays in memory.
1863
+ }
1864
+ }
1865
+ onDocumentClick() {
1866
+ this.closeRowMenu();
1867
+ this.columnPickerOpen.set(false);
1868
+ this.viewsOpen.set(false);
1869
+ this.columnMenu.set(null);
1870
+ this.exportMenuPos.set(null);
1871
+ }
1872
+ onDocumentEscape() {
1873
+ this.onDocumentClick();
1874
+ }
1875
+ alignClass(column) {
1876
+ return column.align ? `ith-table-align-${column.align}` : '';
1877
+ }
1878
+ rowClassFor(row, index) {
1879
+ return [this.isSelected(row) ? 'ith-table-row-selected' : '', this.rowClass()?.(row, index) ?? ''];
1880
+ }
1881
+ trackRow(index, row) {
1882
+ return this.rowKey(row) ?? index;
1883
+ }
1884
+ toolbarContext() {
1885
+ return {
1886
+ $implicit: this.pagedRows(),
1887
+ rows: this.pagedRows(),
1888
+ total: this.totalRows(),
1889
+ selected: this.selected(),
1890
+ search: this.search(),
1891
+ };
1892
+ }
1893
+ footerContext() {
1894
+ return {
1895
+ ...this.toolbarContext(),
1896
+ page: this.page(),
1897
+ pageSize: this.pageSize(),
1898
+ pageCount: this.pageCount(),
1899
+ };
1900
+ }
1901
+ emptyContext() {
1902
+ return { ...this.toolbarContext() };
1903
+ }
1904
+ compareRows(a, b, column) {
1905
+ if (column.sortFn)
1906
+ return column.sortFn(a, b);
1907
+ const path = column.field ?? column.key;
1908
+ return defaultCompare(getPathValue(a, path), getPathValue(b, path));
1909
+ }
1910
+ /** Match one row against the current filter value of one column. */
1911
+ columnMatchesFilter(row, column, term) {
1912
+ const raw = this.cellValue(row, column);
1913
+ const value = term.trim();
1914
+ // A column-level predicate always wins; it gets the raw value and raw term.
1915
+ if (column.filterPredicate)
1916
+ return column.filterPredicate(raw, term, row);
1917
+ switch (this.filterTypeFor(column)) {
1918
+ case 'select':
1919
+ return String(raw ?? '') === value;
1920
+ case 'number': {
1921
+ const number = Number(raw);
1922
+ const typed = Number(value);
1923
+ return value !== '' && Number.isFinite(number) && Number.isFinite(typed) && number === typed;
1924
+ }
1925
+ case 'date': {
1926
+ // ISO strings (`2026-10-05`, `2026-10-05T23:00:00Z`) are compared by their
1927
+ // calendar date, so a time zone can never shift the day.
1928
+ if (typeof raw === 'string') {
1929
+ const isoDate = /^(\d{4}-\d{2}-\d{2})/.exec(raw);
1930
+ if (isoDate)
1931
+ return isoDate[1] === value;
1932
+ }
1933
+ const date = raw instanceof Date ? raw : new Date(String(raw));
1934
+ if (Number.isNaN(date.getTime()))
1935
+ return this.filterText(row, column).includes(value.toLowerCase());
1936
+ const pad = (part) => String(part).padStart(2, '0');
1937
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}` === value;
1938
+ }
1939
+ default:
1940
+ return this.filterText(row, column).includes(value.toLowerCase());
1941
+ }
1942
+ }
1943
+ searchText(row, column) {
1944
+ if (column.searchValue)
1945
+ return column.searchValue(row).toLowerCase();
1946
+ return this.cellText(row, column).toLowerCase();
1947
+ }
1948
+ filterText(row, column) {
1949
+ if (column.filterValue)
1950
+ return column.filterValue(row).toLowerCase();
1951
+ return this.cellText(row, column).toLowerCase();
1952
+ }
1953
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1954
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.34", type: TableComponent, isStandalone: true, selector: "ith-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, keyField: { classPropertyName: "keyField", publicName: "keyField", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, countSuffix: { classPropertyName: "countSuffix", publicName: "countSuffix", isSignal: true, isRequired: false, transformFunction: null }, totalLabel: { classPropertyName: "totalLabel", publicName: "totalLabel", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filterAllLabel: { classPropertyName: "filterAllLabel", publicName: "filterAllLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPagination: { classPropertyName: "showPagination", publicName: "showPagination", isSignal: true, isRequired: false, transformFunction: null }, showPageSize: { classPropertyName: "showPageSize", publicName: "showPageSize", isSignal: true, isRequired: false, transformFunction: null }, showFirstLast: { classPropertyName: "showFirstLast", publicName: "showFirstLast", isSignal: true, isRequired: false, transformFunction: null }, maxPageButtons: { classPropertyName: "maxPageButtons", publicName: "maxPageButtons", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, showFilterChips: { classPropertyName: "showFilterChips", publicName: "showFilterChips", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectAllScope: { classPropertyName: "selectAllScope", publicName: "selectAllScope", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, selectOnRowClick: { classPropertyName: "selectOnRowClick", publicName: "selectOnRowClick", isSignal: true, isRequired: false, transformFunction: null }, selectionActions: { classPropertyName: "selectionActions", publicName: "selectionActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, actionsHeader: { classPropertyName: "actionsHeader", publicName: "actionsHeader", isSignal: true, isRequired: false, transformFunction: null }, actionsWidth: { classPropertyName: "actionsWidth", publicName: "actionsWidth", isSignal: true, isRequired: false, transformFunction: null }, rowClickable: { classPropertyName: "rowClickable", publicName: "rowClickable", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, hoverable: { classPropertyName: "hoverable", publicName: "hoverable", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, dense: { classPropertyName: "dense", publicName: "dense", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, copyable: { classPropertyName: "copyable", publicName: "copyable", isSignal: true, isRequired: false, transformFunction: null }, showColumnPicker: { classPropertyName: "showColumnPicker", publicName: "showColumnPicker", isSignal: true, isRequired: false, transformFunction: null }, showDensityToggle: { classPropertyName: "showDensityToggle", publicName: "showDensityToggle", isSignal: true, isRequired: false, transformFunction: null }, showColumnMenu: { classPropertyName: "showColumnMenu", publicName: "showColumnMenu", isSignal: true, isRequired: false, transformFunction: null }, showExport: { classPropertyName: "showExport", publicName: "showExport", isSignal: true, isRequired: false, transformFunction: null }, exportFileName: { classPropertyName: "exportFileName", publicName: "exportFileName", isSignal: true, isRequired: false, transformFunction: null }, showViews: { classPropertyName: "showViews", publicName: "showViews", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null }, keyboardNavigation: { classPropertyName: "keyboardNavigation", publicName: "keyboardNavigation", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", isSignal: true, isRequired: false, transformFunction: null }, minRows: { classPropertyName: "minRows", publicName: "minRows", isSignal: true, isRequired: false, transformFunction: null }, stickySelection: { classPropertyName: "stickySelection", publicName: "stickySelection", isSignal: true, isRequired: false, transformFunction: null }, stickyActions: { classPropertyName: "stickyActions", publicName: "stickyActions", isSignal: true, isRequired: false, transformFunction: null }, rowDetailTrigger: { classPropertyName: "rowDetailTrigger", publicName: "rowDetailTrigger", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sort: "sortChange", search: "searchChange", filterChange: "filterChange", page: "pageChange", pageSize: "pageSizeChange", selected: "selectedChange", actionClick: "actionClick", rowClick: "rowClick", cellCopy: "cellCopy", rowContextMenu: "rowContextMenu", columnsChange: "columnsChange", densityChange: "densityChange", columnStateChange: "columnStateChange", selectionAction: "selectionAction", csvExport: "csvExport", exportFile: "exportFile", filters: "filtersChange" }, host: { listeners: { "document:pointermove": "onDocumentPointerMove($event)", "document:pointerup": "onDocumentPointerUp()", "document:click": "onDocumentClick()", "document:keydown.escape": "onDocumentEscape()" } }, queries: [{ propertyName: "cellDirectives", predicate: TableCellDirective, descendants: true, isSignal: true }, { propertyName: "headerDirectives", predicate: TableHeaderDirective, descendants: true, isSignal: true }, { propertyName: "filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "rowActionsDirectives", predicate: TableRowActionsDirective, descendants: true, isSignal: true }, { propertyName: "toolbarDirectives", predicate: TableToolbarDirective, descendants: true, isSignal: true }, { propertyName: "footerDirectives", predicate: TableFooterDirective, descendants: true, isSignal: true }, { propertyName: "emptyDirectives", predicate: TableEmptyDirective, descendants: true, isSignal: true }, { propertyName: "rowMenuDirectives", predicate: TableRowMenuDirective, descendants: true, isSignal: true }, { propertyName: "rowDetailDirectives", predicate: TableRowDetailDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"ith-table\"\n [class.ith-table-bordered]=\"bordered()\"\n [class.ith-table-dense]=\"dense()\"\n [class.ith-table-striped]=\"striped()\"\n [class.ith-table-hoverable]=\"hoverable()\"\n [class.ith-table-sticky]=\"stickyHeader()\"\n [class.ith-table-compact]=\"compact()\">\n <!-- Toolbar -->\n @if (showToolbar()) {\n <div class=\"ith-table-toolbar\">\n <div class=\"ith-table-toolbar-inner\">\n <div class=\"ith-table-toolbar-main\">\n @if (title()) {\n <h3 class=\"ith-table-title\">{{ title() }}</h3>\n }\n <span class=\"ith-table-badge\">{{ totalRows() }} {{ countSuffix() }}</span>\n @if (selected().length > 0) {\n <span class=\"ith-table-badge ith-table-badge-accent\">{{ selected().length }} selected</span>\n }\n @if (toolbarTemplate(); as toolbarTpl) {\n <ng-container\n [ngTemplateOutlet]=\"toolbarTpl\"\n [ngTemplateOutletContext]=\"toolbarContext()\" />\n }\n </div>\n\n <div class=\"ith-table-toolbar-spacer\"></div>\n\n <div class=\"ith-table-toolbar-actions\">\n @if (showViews()) {\n <div class=\"ith-table-menu-anchor\" (click)=\"$event.stopPropagation()\">\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"viewsOpen()\"\n (click)=\"toggleViews($event)\">\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6h16M4 12h10M4 18h7\" />\n </svg>\n <span>Views</span>\n </button>\n </div>\n }\n\n @if (showColumnPicker()) {\n <div class=\"ith-table-menu-anchor\" (click)=\"$event.stopPropagation()\">\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"columnPickerOpen()\"\n (click)=\"toggleColumnPicker($event)\">\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"7\" height=\"16\" rx=\"1.5\" />\n <rect x=\"14\" y=\"4\" width=\"7\" height=\"16\" rx=\"1.5\" />\n </svg>\n <span>Columns</span>\n </button>\n </div>\n }\n\n @if (showDensityToggle()) {\n <div class=\"ith-table-segmented\" role=\"group\" aria-label=\"Row density\">\n <button\n type=\"button\"\n class=\"ith-table-segmented-btn\"\n [class.is-active]=\"!compact()\"\n [attr.aria-pressed]=\"!compact()\"\n title=\"Comfortable rows\"\n (click)=\"setDensity('comfortable')\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 8h16M4 16h16\" />\n </svg>\n <span>Comfortable</span>\n </button>\n <button\n type=\"button\"\n class=\"ith-table-segmented-btn\"\n [class.is-active]=\"compact()\"\n [attr.aria-pressed]=\"compact()\"\n title=\"Compact rows\"\n (click)=\"setDensity('compact')\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6h16M4 10h16M4 14h16M4 18h16\" />\n </svg>\n <span>Compact</span>\n </button>\n </div>\n }\n\n @if (showExport()) {\n <div class=\"ith-table-menu-anchor\" (click)=\"$event.stopPropagation()\">\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"!!exportMenuPos()\"\n title=\"Export the current view\"\n (click)=\"toggleExportMenu($event)\">\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M12 4v11m0 0 4-4m-4 4-4-4\" />\n <path d=\"M4 19h16\" />\n </svg>\n <span>Export</span>\n </button>\n </div>\n }\n\n @if (searchable()) {\n <div class=\"ith-table-search\">\n <svg class=\"ith-table-search-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.6-3.6\" />\n </svg>\n <input\n type=\"search\"\n class=\"ith-table-search-input\"\n [value]=\"search()\"\n [attr.placeholder]=\"searchPlaceholder()\"\n [attr.aria-label]=\"searchPlaceholder()\"\n (input)=\"onSearchInput($any($event.target).value)\" />\n @if (search()) {\n <button type=\"button\" class=\"ith-table-search-clear\" (click)=\"clearSearch()\" aria-label=\"Clear search\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n }\n </div>\n }\n </div>\n </div>\n\n @if (showFilterChips() && hasQuery()) {\n <div class=\"ith-table-chips\">\n @for (chip of filterChips(); track chip.kind + chip.key) {\n <span class=\"ith-table-chip\">\n <span class=\"ith-table-chip-label\">{{ chip.label }}</span>\n <span class=\"ith-table-chip-value\">{{ chip.value }}</span>\n <button\n type=\"button\"\n class=\"ith-table-chip-remove\"\n [attr.aria-label]=\"'Remove ' + chip.label + ' filter'\"\n (click)=\"removeChip(chip)\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n </span>\n }\n <button type=\"button\" class=\"ith-table-chips-clear\" (click)=\"clearQuery()\">Clear all</button>\n </div>\n }\n </div>\n }\n\n <!-- Bulk actions for the current selection -->\n @if (selected().length > 0 && selectionActions().length) {\n <div class=\"ith-table-selection-bar\" role=\"region\" aria-label=\"Selection actions\">\n <span class=\"ith-table-selection-count\">\n <strong>{{ selected().length }}</strong> selected\n </span>\n <span class=\"ith-table-selection-spacer\"></span>\n <div class=\"ith-table-selection-actions\">\n @for (action of selectionActions(); track action.id) {\n <button\n type=\"button\"\n class=\"ith-table-selection-btn\"\n [ngClass]=\"action.class ?? ''\"\n [attr.title]=\"action.title ?? action.label\"\n (click)=\"onSelectionAction(action, $event)\">\n @if (action.icon) {\n <span class=\"ith-table-selection-icon\" aria-hidden=\"true\">{{ action.icon }}</span>\n }\n <span>{{ action.label }}</span>\n </button>\n }\n <button type=\"button\" class=\"ith-table-selection-clear\" (click)=\"clearSelection()\">\n Clear selection\n </button>\n </div>\n </div>\n }\n\n <!-- Table -->\n <div\n class=\"ith-table-scroll\"\n [class.ith-table-scroll-bounded]=\"!!maxHeight()\"\n [class.ith-table-scroll-filtered]=\"showFilters()\"\n [class.is-scrolled]=\"scrolled()\"\n [style.maxHeight]=\"maxHeight() || null\"\n [style.--_min-rows]=\"minRows()\"\n (scroll)=\"onScroll($event)\">\n <table class=\"ith-table-grid\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-busy]=\"loading()\">\n <thead>\n <tr class=\"ith-table-head-row\">\n @if (selectable()) {\n <th\n scope=\"col\"\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\">\n @if (selectionMode() === 'multi') {\n <input\n type=\"checkbox\"\n class=\"ith-table-checkbox\"\n [checked]=\"allPageSelected()\"\n [indeterminate]=\"somePageSelected()\"\n [attr.aria-label]=\"'Select all rows'\"\n (change)=\"onSelectAllChange($event)\" />\n }\n </th>\n }\n\n @if (hasExpander()) {\n <th scope=\"col\" class=\"ith-table-expander-cell\" [attr.aria-label]=\"'Row details'\"></th>\n }\n\n @for (column of visibleColumns(); track column.key) {\n <th\n scope=\"col\"\n class=\"ith-table-th\"\n [ngClass]=\"headerClasses(column)\"\n [style]=\"columnStyle(column)\"\n [attr.data-col]=\"column.key\"\n [attr.aria-sort]=\"isSortable(column) ? ariaSort(column) : null\"\n [attr.draggable]=\"reorderable() ? 'true' : null\"\n [class.ith-table-th-dragging]=\"dragKey() === column.key\"\n (dragstart)=\"onHeaderDragStart(column, $event)\"\n (dragover)=\"onHeaderDragOver(column, $event)\"\n (drop)=\"onHeaderDrop(column, $event)\"\n (dragend)=\"onHeaderDragEnd()\">\n <div class=\"ith-table-th-inner\">\n @if (headerTemplate(column); as headerTpl) {\n <ng-container\n [ngTemplateOutlet]=\"headerTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column: column }\" />\n } @else if (isSortable(column)) {\n <button\n type=\"button\"\n class=\"ith-table-sort\"\n [class.is-sorted]=\"!!sortDirection(column)\"\n (click)=\"toggleSort(column)\"\n [attr.aria-label]=\"'Sort by ' + (column.header ?? column.key)\">\n <span class=\"ith-table-th-label\">{{ column.header ?? column.key }}</span>\n <span class=\"ith-table-sort-icons\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 10 6\" class=\"ith-table-sort-up\" [class.is-active]=\"sortDirection(column) === 'asc'\"><path d=\"M5 0l5 6H0z\" /></svg>\n <svg viewBox=\"0 0 10 6\" class=\"ith-table-sort-down\" [class.is-active]=\"sortDirection(column) === 'desc'\"><path d=\"M5 6L0 0h10z\" /></svg>\n </span>\n </button>\n } @else {\n <span class=\"ith-table-th-label\">{{ column.header ?? column.key }}</span>\n }\n\n @if (showColumnMenu()) {\n <button\n type=\"button\"\n class=\"ith-table-th-menu\"\n [attr.aria-expanded]=\"columnMenu()?.key === column.key\"\n [attr.aria-label]=\"'Column options for ' + (column.header ?? column.key)\"\n (click)=\"openColumnMenu(column, $event)\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"5\" r=\"1.7\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.7\" />\n <circle cx=\"12\" cy=\"19\" r=\"1.7\" />\n </svg>\n </button>\n }\n\n @if (pinOf(column) === 'start') {\n <span class=\"ith-table-pin-dot\" aria-hidden=\"true\"></span>\n }\n </div>\n\n @if (resizable()) {\n <span\n class=\"ith-table-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + (column.header ?? column.key)\"\n (pointerdown)=\"startResize(column, $event)\"></span>\n }\n </th>\n }\n\n @if (hasActionsColumn()) {\n <th\n scope=\"col\"\n class=\"ith-table-th ith-table-actions-head\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.width]=\"actionsWidth()\"\n [style.right]=\"stickyActions() ? '0px' : null\">\n {{ actionsHeader() }}\n </th>\n }\n </tr>\n\n @if (showFilters()) {\n <tr class=\"ith-table-filter-row\">\n @if (selectable()) {\n <th\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\"></th>\n }\n @if (hasExpander()) {\n <th class=\"ith-table-expander-cell\"></th>\n }\n @for (column of visibleColumns(); track column.key) {\n <th\n class=\"ith-table-filter-cell\"\n [ngClass]=\"filterClasses(column)\"\n [style]=\"columnStyle(column)\">\n @if (filterTemplate(column); as filterTpl) {\n <ng-container\n [ngTemplateOutlet]=\"filterTpl\"\n [ngTemplateOutletContext]=\"filterContext(column)\" />\n } @else if (column.filterable !== false) {\n @switch (filterTypeFor(column)) {\n @case ('select') {\n <select\n class=\"ith-table-filter-input ith-table-filter-select\"\n [value]=\"filterValue(column.key)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (change)=\"onFilterInput(column.key, $any($event.target).value)\">\n <option value=\"\">{{ filterAllLabel() }}</option>\n @for (option of filterOptionsFor(column); track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n }\n @case ('number') {\n <input\n type=\"number\"\n class=\"ith-table-filter-input\"\n [value]=\"filterValue(column.key)\"\n [attr.placeholder]=\"filterPlaceholderFor(column)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (input)=\"onFilterInput(column.key, $any($event.target).value)\" />\n }\n @case ('date') {\n <input\n type=\"date\"\n class=\"ith-table-filter-input\"\n [value]=\"filterValue(column.key)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (input)=\"onFilterInput(column.key, $any($event.target).value)\" />\n }\n @default {\n <input\n type=\"text\"\n class=\"ith-table-filter-input\"\n [value]=\"filterValue(column.key)\"\n [attr.placeholder]=\"filterPlaceholderFor(column)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (input)=\"onFilterInput(column.key, $any($event.target).value)\" />\n }\n }\n }\n </th>\n }\n @if (hasActionsColumn()) {\n <th\n class=\"ith-table-filter-cell\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.right]=\"stickyActions() ? '0px' : null\"></th>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n @if (loading() && pagedRows().length === 0) {\n @for (skeleton of skeletonIndexes(); track skeleton) {\n <tr class=\"ith-table-skeleton-row\" aria-hidden=\"true\">\n @if (selectable()) {\n <td\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\">\n <span class=\"ith-table-skeleton is-check\"></span>\n </td>\n }\n @if (hasExpander()) {\n <td class=\"ith-table-expander-cell\"></td>\n }\n @for (column of visibleColumns(); track column.key) {\n <td class=\"ith-table-td\">\n <span class=\"ith-table-skeleton\"></span>\n </td>\n }\n @if (hasActionsColumn()) {\n <td class=\"ith-table-actions-cell\"><span class=\"ith-table-skeleton\"></span></td>\n }\n </tr>\n }\n <tr>\n <td class=\"ith-table-visually-hidden\" [attr.colspan]=\"emptyColspan()\" aria-live=\"polite\">\n {{ loadingText() }}\n </td>\n </tr>\n } @else if (pagedRows().length === 0) {\n <tr>\n <td class=\"ith-table-status\" [attr.colspan]=\"emptyColspan()\">\n @if (emptyTemplate(); as emptyTpl) {\n <ng-container\n [ngTemplateOutlet]=\"emptyTpl\"\n [ngTemplateOutletContext]=\"emptyContext()\" />\n } @else {\n <div class=\"ith-table-empty\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M3 10h18M9 10v9\" />\n </svg>\n <span>{{ hasQuery() ? 'No records match your search.' : emptyText() }}</span>\n @if (hasQuery()) {\n <button type=\"button\" class=\"ith-table-link\" (click)=\"clearQuery()\">Clear search &amp; filters</button>\n }\n </div>\n }\n </td>\n </tr>\n } @else {\n @for (row of pagedRows(); track trackRow($index, row); let rowIndex = $index) {\n <tr\n class=\"ith-table-row\"\n [ngClass]=\"rowClassFor(row, $index)\"\n [class.ith-table-row-clickable]=\"rowClickable() || selectOnRowClick() || (hasRowDetail() && rowDetailTrigger() === 'row')\"\n [attr.tabindex]=\"rowClickable() || selectOnRowClick() ? 0 : null\"\n [attr.aria-selected]=\"selectable() ? isSelected(row) : null\"\n [attr.aria-expanded]=\"hasRowDetail() ? isRowExpanded(row) : null\"\n (click)=\"onRowClick(row, $index, $event)\"\n (keydown)=\"onRowKeydown(row, $index, $event)\"\n (contextmenu)=\"onRowContextMenu(row, $index, $event)\">\n @if (selectable()) {\n <td\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\">\n <input\n type=\"checkbox\"\n class=\"ith-table-checkbox\"\n [checked]=\"isSelected(row)\"\n [attr.aria-label]=\"'Select row ' + ($index + 1)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onRowCheckboxChange(row, $event)\" />\n </td>\n }\n\n @if (hasExpander()) {\n <td class=\"ith-table-expander-cell\">\n <button\n type=\"button\"\n class=\"ith-table-expander\"\n [class.is-open]=\"isRowExpanded(row)\"\n [attr.aria-expanded]=\"isRowExpanded(row)\"\n [attr.aria-label]=\"'Toggle details for row ' + ($index + 1)\"\n (click)=\"toggleRowDetail(row, $event)\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"m9 6 6 6-6 6\" />\n </svg>\n </button>\n </td>\n }\n\n @for (column of visibleColumns(); track column.key; let colIndex = $index) {\n <td\n class=\"ith-table-td\"\n [class.ith-table-copyable]=\"copyable()\"\n [ngClass]=\"cellClasses(row, column, rowIndex)\"\n [style]=\"columnStyle(column)\"\n [attr.title]=\"tooltipText(row, column, rowIndex)\"\n [attr.data-cell]=\"rowIndex + '-' + colIndex\"\n [attr.data-col]=\"column.key\"\n [attr.tabindex]=\"cellTabIndex(rowIndex, colIndex)\"\n (focus)=\"onCellFocus(rowIndex, colIndex)\"\n (keydown)=\"onCellKeydown(column, rowIndex, colIndex, $event)\">\n @if (cellTemplate(column); as cellTpl) {\n <ng-container\n [ngTemplateOutlet]=\"cellTpl\"\n [ngTemplateOutletContext]=\"cellContext(row, column, rowIndex)\" />\n } @else {\n {{ cellText(row, column, rowIndex) }}\n }\n @if (copyable()) {\n <button\n type=\"button\"\n class=\"ith-table-copy\"\n [class.is-copied]=\"isCellCopied(rowIndex, column)\"\n [attr.aria-label]=\"'Copy ' + (column.header ?? column.key)\"\n (click)=\"copyCell(row, column, rowIndex, $event)\">\n @if (isCellCopied(rowIndex, column)) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m5 13 4 4L19 7\" /></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" /><path d=\"M15 5.5A2.5 2.5 0 0 0 12.5 3H6a2 2 0 0 0-2 2v7.5A2.5 2.5 0 0 0 6.5 15\" /></svg>\n }\n </button>\n }\n </td>\n }\n\n @if (hasActionsColumn()) {\n <td\n class=\"ith-table-actions-cell\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.right]=\"stickyActions() ? '0px' : null\">\n @if (rowActionsTemplate(); as actionsTpl) {\n <ng-container\n [ngTemplateOutlet]=\"actionsTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row, index: $index }\" />\n } @else {\n @for (action of rowActions(); track action.id) {\n @if (isActionVisible(action, row, $index)) {\n <button\n type=\"button\"\n class=\"ith-table-action\"\n [ngClass]=\"action.class ?? ''\"\n [attr.title]=\"action.title ?? action.label\"\n [disabled]=\"isActionDisabled(action, row, $index)\"\n (click)=\"onActionClick(action, row, $index, $event)\">\n @if (action.icon) {\n <span class=\"ith-table-action-icon\" aria-hidden=\"true\">{{ action.icon }}</span>\n }\n <span>{{ action.label }}</span>\n </button>\n }\n }\n }\n </td>\n }\n </tr>\n\n @if (hasRowDetail() && isRowExpanded(row)) {\n <tr class=\"ith-table-detail-row\">\n <td [attr.colspan]=\"emptyColspan()\">\n @if (rowDetailTemplate(); as detailTpl) {\n <ng-container\n [ngTemplateOutlet]=\"detailTpl\"\n [ngTemplateOutletContext]=\"rowDetailContext(row, rowIndex)\" />\n }\n </td>\n </tr>\n }\n }\n }\n </tbody>\n\n @if (hasAggregates() && pagedRows().length > 0) {\n <tfoot>\n <tr class=\"ith-table-total-row\">\n @if (selectable()) {\n <td\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\"></td>\n }\n @if (hasExpander()) {\n <td class=\"ith-table-expander-cell\"></td>\n }\n @for (column of visibleColumns(); track column.key) {\n <td\n class=\"ith-table-total-cell\"\n [ngClass]=\"stickyClassFor(column)\"\n [style]=\"columnStyle(column)\">\n @if (column.aggregate) {\n <span class=\"ith-table-total-label\">{{ aggregateLabel(column) }}</span>\n <span class=\"ith-table-total-value\">{{ aggregateText(column) }}</span>\n }\n </td>\n }\n @if (hasActionsColumn()) {\n <td\n class=\"ith-table-total-cell ith-table-actions-cell\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.right]=\"stickyActions() ? '0px' : null\"></td>\n }\n </tr>\n </tfoot>\n }\n </table>\n\n @if (loading() && pagedRows().length > 0) {\n <div class=\"ith-table-loading-overlay\">\n <span class=\"ith-table-spinner\" aria-hidden=\"true\"></span>\n <span>{{ loadingText() }}</span>\n </div>\n }\n </div>\n\n <!-- Columns popover (fixed, so the toolbar's scroll box cannot clip it) -->\n @if (columnPickerOpen()) {\n <div\n class=\"ith-table-popover\"\n role=\"dialog\"\n aria-label=\"Visible columns\"\n [style.left.px]=\"columnsMenuPos()?.x ?? 0\"\n [style.top.px]=\"columnsMenuPos()?.y ?? 0\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"ith-table-popover-header\">Show columns</div>\n <div class=\"ith-table-popover-list\">\n @for (column of orderedColumns(); track column.key) {\n <label class=\"ith-table-columns-item\">\n <input\n type=\"checkbox\"\n class=\"ith-table-checkbox\"\n [checked]=\"isColumnVisible(column)\"\n [disabled]=\"!isColumnVisible(column) && !canHide(column.key)\"\n (change)=\"setColumnVisible(column.key, $any($event.target).checked)\" />\n <span>{{ column.header ?? column.key }}</span>\n @if (pinOf(column)) {\n <span class=\"ith-table-pin-tag\">{{ pinOf(column) }}</span>\n }\n </label>\n }\n </div>\n <div class=\"ith-table-popover-footer\">\n <button type=\"button\" class=\"ith-table-popover-action\" (click)=\"resetColumns()\">\n Reset columns\n </button>\n </div>\n </div>\n }\n\n <!-- Export formats -->\n @if (exportMenuPos(); as pos) {\n <div\n class=\"ith-table-popover ith-table-export-menu\"\n role=\"menu\"\n aria-label=\"Export format\"\n [style.left.px]=\"pos.x\"\n [style.top.px]=\"pos.y\"\n (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"exportAs('xlsx')\">\n <span class=\"ith-table-export-name\">Excel</span>\n <span class=\"ith-table-export-hint\">.xlsx \u2014 Excel, Numbers, Sheets</span>\n </button>\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"exportAs('csv')\">\n <span class=\"ith-table-export-name\">CSV</span>\n <span class=\"ith-table-export-hint\">.csv \u2014 plain text, any tool</span>\n </button>\n </div>\n }\n\n <!-- Named views -->\n @if (viewsOpen()) {\n <div\n class=\"ith-table-popover\"\n role=\"dialog\"\n aria-label=\"Saved views\"\n [style.left.px]=\"viewsMenuPos()?.x ?? 0\"\n [style.top.px]=\"viewsMenuPos()?.y ?? 0\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"ith-table-popover-header\">Saved views</div>\n <div class=\"ith-table-popover-list\">\n @for (name of savedViewNames(); track name) {\n <div class=\"ith-table-view-item\" [class.is-active]=\"activeView() === name\">\n <button type=\"button\" class=\"ith-table-view-apply\" (click)=\"applyView(name)\">\n {{ name }}\n </button>\n <button\n type=\"button\"\n class=\"ith-table-view-delete\"\n [attr.aria-label]=\"'Delete view ' + name\"\n (click)=\"deleteView(name, $event)\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n </div>\n } @empty {\n <p class=\"ith-table-popover-empty\">No saved views yet.</p>\n }\n </div>\n <div class=\"ith-table-popover-footer ith-table-view-save\">\n <input\n type=\"text\"\n class=\"ith-table-view-input\"\n placeholder=\"View name\"\n aria-label=\"New view name\"\n [value]=\"viewNameDraft()\"\n (input)=\"onViewNameInput($any($event.target).value)\"\n (keydown.enter)=\"saveView()\" />\n <button type=\"button\" class=\"ith-table-popover-action\" (click)=\"saveView()\">Save</button>\n </div>\n </div>\n }\n\n <!-- Column header menu -->\n @if (columnMenu(); as menu) {\n <div\n class=\"ith-table-popover ith-table-column-menu\"\n role=\"menu\"\n [style.left.px]=\"menu.x\"\n [style.top.px]=\"menu.y\"\n (click)=\"$event.stopPropagation()\">\n @if (columnMenuColumn(); as column) {\n @if (isSortable(column)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuSort('asc')\">\n Sort ascending\n </button>\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuSort('desc')\">\n Sort descending\n </button>\n @if (sortDirection(column)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuClearSort()\">\n Clear sort\n </button>\n }\n <div class=\"ith-table-menu-divider\"></div>\n }\n @if (canPin(column)) {\n @if (pinOf(column) !== 'start') {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuPin('start')\">\n Pin to left\n </button>\n }\n @if (pinOf(column) !== 'end') {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuPin('end')\">\n Pin to right\n </button>\n }\n @if (pinOf(column)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuPin(null)\">\n Unpin column\n </button>\n }\n <div class=\"ith-table-menu-divider\"></div>\n }\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuAutosize()\">\n Fit to content\n </button>\n @if (canHide(column.key)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuHide()\">\n Hide column\n </button>\n }\n }\n </div>\n }\n\n <!-- Right-click menu (projected template, positioned at the pointer) -->\n @if (menuState(); as menu) {\n <div\n class=\"ith-table-menu\"\n role=\"menu\"\n [style.left.px]=\"menu.x\"\n [style.top.px]=\"menu.y\"\n (click)=\"closeRowMenu(); $event.stopPropagation()\">\n @if (rowMenuTemplate(); as menuTpl) {\n <ng-container\n [ngTemplateOutlet]=\"menuTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: menu.row, row: menu.row, index: menu.index }\" />\n }\n </div>\n }\n\n <!-- Footer -->\n @if (showFooter()) {\n <div class=\"ith-table-footer\">\n <div class=\"ith-table-footer-info\">\n @if (footerTemplate(); as footerTpl) {\n <ng-container\n [ngTemplateOutlet]=\"footerTpl\"\n [ngTemplateOutletContext]=\"footerContext()\" />\n } @else {\n <span>\n Showing <strong>{{ rangeStart() }}</strong>\u2013<strong>{{ rangeEnd() }}</strong>\n of <strong>{{ totalRows() }}</strong>\n </span>\n <span class=\"ith-table-total\">{{ totalLabel() }}: <strong>{{ totalRows() }}</strong></span>\n }\n </div>\n\n <div class=\"ith-table-footer-controls\">\n @if (showPagination()) {\n <nav class=\"ith-table-pagination\" aria-label=\"Pagination\">\n @if (showFirstLast()) {\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"firstPage()\" [disabled]=\"page() === 1\" aria-label=\"First page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m11 17-5-5 5-5M18 17l-5-5 5-5\" /></svg>\n </button>\n }\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"previousPage()\" [disabled]=\"page() === 1\" aria-label=\"Previous page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m15 18-6-6 6-6\" /></svg>\n </button>\n\n @for (item of pageItems(); track item) {\n <button\n type=\"button\"\n class=\"ith-table-page-btn ith-table-page-number\"\n [class.is-active]=\"item === page()\"\n [attr.aria-current]=\"item === page() ? 'page' : null\"\n (click)=\"goToPage(item)\">\n {{ item }}\n </button>\n }\n\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"nextPage()\" [disabled]=\"page() === pageCount()\" aria-label=\"Next page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m9 18 6-6-6-6\" /></svg>\n </button>\n @if (showFirstLast()) {\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"lastPage()\" [disabled]=\"page() === pageCount()\" aria-label=\"Last page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m13 17 5-5-5-5M6 17l5-5-5-5\" /></svg>\n </button>\n }\n <span class=\"ith-table-page-state\">Page {{ page() }} / {{ pageCount() }}</span>\n </nav>\n }\n\n @if (showPageSize()) {\n <label class=\"ith-table-page-size\">\n <span>Rows:</span>\n <select class=\"ith-table-select\" [value]=\"pageSize()\" (change)=\"onPageSizeChange($any($event.target).value)\">\n @for (size of pageSizeChoices(); track size) {\n <option [value]=\"size\">{{ size }}</option>\n }\n </select>\n </label>\n }\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:block;--_brand: var(--ith-table-brand, #5b21b6);--_bg: var(--ith-table-bg, #ffffff);--_text: var(--ith-table-text, #1f2937);--_muted: var(--ith-table-muted, #6b7280);--_border: var(--ith-table-border, #e8eaf0);--_header-bg: var(--ith-table-header-bg, var(--_brand));--_header-text: var(--ith-table-header-text, #ffffff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 6%, #ffffff));--_selected-bg: var(--ith-table-selected-bg, color-mix(in srgb, var(--_brand) 10%, #ffffff));--_striped-bg: var(--ith-table-striped-bg, color-mix(in srgb, var(--_brand) 2%, #ffffff));--_accent: var(--ith-table-accent, var(--_brand));--_accent-soft: var(--ith-table-accent-soft, color-mix(in srgb, var(--_brand) 12%, #ffffff));--_input-bg: var(--ith-table-input-bg, #ffffff);--_input-border: var(--ith-table-input-border, #dfe3ec);--_footer-bg: var(--ith-table-footer-bg, color-mix(in srgb, var(--_brand) 2%, #ffffff));--_filter-bg: var(--ith-table-filter-bg, color-mix(in srgb, var(--_brand) 3%, #ffffff));--_overlay: var(--ith-table-overlay, rgba(255, 255, 255, .72));--_radius: var(--ith-table-radius, 14px);--_shadow: var(--ith-table-shadow, 0 18px 40px -28px rgba(24, 20, 60, .55));--_focus: var(--ith-table-focus, color-mix(in srgb, var(--_brand) 25%, transparent));--_cell-padding: var(--ith-table-cell-padding, 12px 16px);--_font-size: var(--ith-table-font-size, 14px);--_header-font-size: var(--ith-table-header-font-size, 13px);--_row-height: var(--ith-table-row-height, 46px);--_head-height: var(--ith-table-head-height, 45px);--_filter-height: 47px;--_on-accent: #ffffff;--_toolbar-tint: color-mix(in srgb, var(--_brand) 3%, var(--_bg));--_popover-bg: var(--_bg);--_scroll-thumb: color-mix(in srgb, var(--_muted) 38%, transparent);--_danger: #dc2626;--_elevation: 0 18px 40px -18px rgba(17, 12, 46, .35), 0 0 0 1px color-mix(in srgb, var(--_border) 60%, transparent)}:host-context([data-theme=\"dark\"]),:host-context(.dark){--_brand: var(--ith-table-brand, #7c3aed);--_bg: var(--ith-table-bg, #161826);--_text: var(--ith-table-text, #e7e9f3);--_muted: var(--ith-table-muted, #9aa0b5);--_border: var(--ith-table-border, #2f3348);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 34%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 15%, #161826));--_selected-bg: var(--ith-table-selected-bg, color-mix(in srgb, var(--_brand) 20%, #161826));--_striped-bg: var(--ith-table-striped-bg, color-mix(in srgb, var(--_brand) 6%, #161826));--_accent: var(--ith-table-accent, color-mix(in srgb, var(--_brand) 55%, #ffffff));--_accent-soft: var(--ith-table-accent-soft, color-mix(in srgb, var(--_brand) 26%, #161826));--_input-bg: var(--ith-table-input-bg, #202436);--_input-border: var(--ith-table-input-border, #343a52);--_footer-bg: var(--ith-table-footer-bg, color-mix(in srgb, var(--_brand) 4%, #12141f));--_filter-bg: var(--ith-table-filter-bg, color-mix(in srgb, var(--_brand) 9%, #161826));--_overlay: var(--ith-table-overlay, rgba(17, 19, 30, .72));--_shadow: var(--ith-table-shadow, 0 18px 40px -28px rgba(0, 0, 0, .85));--_focus: var(--ith-table-focus, color-mix(in srgb, var(--_brand) 38%, transparent));--_on-accent: #15121f;--_toolbar-tint: color-mix(in srgb, var(--_brand) 12%, var(--_bg));--_popover-bg: #1d2133;--_scroll-thumb: color-mix(in srgb, #ffffff 22%, transparent);--_danger: #f87171;--_elevation: 0 22px 48px -20px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, #ffffff 8%, transparent)}@media(prefers-color-scheme:dark){:host-context([data-theme=\"auto\"]){--_brand: var(--ith-table-brand, #7c3aed);--_bg: var(--ith-table-bg, #161826);--_text: var(--ith-table-text, #e7e9f3);--_muted: var(--ith-table-muted, #9aa0b5);--_border: var(--ith-table-border, #2f3348);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 34%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 15%, #161826));--_selected-bg: var(--ith-table-selected-bg, color-mix(in srgb, var(--_brand) 20%, #161826));--_striped-bg: var(--ith-table-striped-bg, color-mix(in srgb, var(--_brand) 6%, #161826));--_accent: var(--ith-table-accent, color-mix(in srgb, var(--_brand) 55%, #ffffff));--_accent-soft: var(--ith-table-accent-soft, color-mix(in srgb, var(--_brand) 26%, #161826));--_input-bg: var(--ith-table-input-bg, #202436);--_input-border: var(--ith-table-input-border, #343a52);--_footer-bg: var(--ith-table-footer-bg, color-mix(in srgb, var(--_brand) 4%, #12141f));--_filter-bg: var(--ith-table-filter-bg, color-mix(in srgb, var(--_brand) 9%, #161826));--_overlay: var(--ith-table-overlay, rgba(17, 19, 30, .72));--_shadow: var(--ith-table-shadow, 0 18px 40px -28px rgba(0, 0, 0, .85));--_focus: var(--ith-table-focus, color-mix(in srgb, var(--_brand) 38%, transparent));--_on-accent: #15121f;--_toolbar-tint: color-mix(in srgb, var(--_brand) 12%, var(--_bg));--_popover-bg: #1d2133;--_scroll-thumb: color-mix(in srgb, #ffffff 22%, transparent);--_danger: #f87171;--_elevation: 0 22px 48px -20px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, #ffffff 8%, transparent)}}.ith-table{display:block;position:relative;background:var(--_bg);color:var(--_text);border:1px solid var(--_border);border-radius:var(--_radius);box-shadow:var(--_shadow);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:var(--_font-size);overflow:hidden}.ith-table-toolbar{padding:14px 16px;border-bottom:1px solid var(--_border);background:var(--_toolbar-tint)}.ith-table-toolbar-inner{display:flex;align-items:center;gap:12px;flex-wrap:nowrap;min-width:0;overflow-x:auto;scrollbar-width:none}.ith-table-toolbar-inner::-webkit-scrollbar{display:none}.ith-table-toolbar-main{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0;flex:0 0 auto}.ith-table-toolbar-spacer{flex:1 1 auto;min-width:8px}.ith-table-title{margin:0;font-size:15.5px;font-weight:650;letter-spacing:-.015em;color:var(--_text);white-space:nowrap}.ith-table-badge{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;background:var(--_accent-soft);color:var(--_accent);font-size:11.5px;font-weight:600;line-height:1.4;white-space:nowrap}.ith-table-badge-accent{background:var(--_accent);color:var(--_on-accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_accent) 30%,transparent)}.ith-table-search{position:relative;flex:0 1 260px;min-width:180px}.ith-table-search-icon{position:absolute;left:12px;top:50%;width:15px;height:15px;transform:translateY(-50%);color:var(--_muted);pointer-events:none}.ith-table-search-input{width:100%;box-sizing:border-box;height:36px;padding:0 34px 0 36px;border:1px solid var(--_input-border);border-radius:10px;background:var(--_input-bg);color:var(--_text);font-size:13px;font-family:inherit;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ith-table-search-input:hover{border-color:color-mix(in srgb,var(--_accent) 35%,var(--_input-border))}.ith-table-search-input::placeholder{color:var(--_muted)}.ith-table-search-input::-webkit-search-cancel-button,.ith-table-search-input::-webkit-search-decoration,.ith-table-search-input::-webkit-search-results-button,.ith-table-search-input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.ith-table-search-input:focus{outline:none;border-color:var(--_accent);box-shadow:0 0 0 3px var(--_focus);background:var(--_bg)}.ith-table-search-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:24px;height:24px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:var(--_muted);cursor:pointer;transition:background-color .12s ease,color .12s ease}.ith-table-search-clear svg{width:14px;height:14px}.ith-table-search-clear:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-scroll{position:relative;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--_scroll-thumb) transparent}.ith-table-scroll::-webkit-scrollbar{width:10px;height:10px}.ith-table-scroll::-webkit-scrollbar-track{background:transparent}.ith-table-scroll::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:999px;background-color:var(--_scroll-thumb);background-clip:content-box}.ith-table-scroll::-webkit-scrollbar-thumb:hover{background-color:color-mix(in srgb,var(--_scroll-thumb) 75%,var(--_text))}.ith-table-scroll:not(.ith-table-scroll-bounded){min-height:calc(var(--_head-height) + var(--_row-height) * var(--_min-rows, 4))}.ith-table-scroll:not(.ith-table-scroll-bounded).ith-table-scroll-filtered{min-height:calc(var(--_head-height) + var(--_filter-height) + var(--_row-height) * var(--_min-rows, 4))}.ith-table-grid{width:100%;border-collapse:separate;border-spacing:0;table-layout:auto}.ith-table-head-row th{background:var(--_header-bg);color:var(--_header-text);font-size:var(--_header-font-size);font-weight:600;letter-spacing:.01em;text-align:left;padding:13px 16px;white-space:nowrap;border:0}.ith-table-sticky .ith-table-head-row th{position:sticky;top:0;z-index:2}.ith-table-th-label{display:inline-block}.ith-table-sort{display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;cursor:pointer;text-align:inherit}.ith-table-sort-icons{display:inline-flex;flex-direction:column;gap:2px;opacity:.5}.ith-table-sort-icons svg{width:8px;height:5px;fill:currentColor;opacity:.5;transition:opacity .15s ease}.ith-table-sort-icons svg.is-active{opacity:1}.ith-table-sort.is-sorted .ith-table-sort-icons{opacity:1}.ith-table-select-cell{width:46px;text-align:center;padding-left:14px;padding-right:10px}.ith-table-checkbox{width:16px;height:16px;margin:0;cursor:pointer;accent-color:var(--_accent);vertical-align:middle}.ith-table-checkbox:focus-visible{outline:2px solid var(--_accent);outline-offset:2px}.ith-table-row{background:var(--_bg);transition:background-color .15s ease}.ith-table-hoverable .ith-table-row:hover{background:var(--_hover)}.ith-table-row.ith-table-row-selected{background:var(--_selected-bg)}.ith-table-row.ith-table-row-selected td:first-child{box-shadow:inset 3px 0 0 var(--_accent)}.ith-table-row-clickable{cursor:pointer}.ith-table-td{padding:var(--_cell-padding);border-bottom:1px solid var(--_border);font-size:var(--_font-size);color:var(--_text);vertical-align:middle;white-space:nowrap;background:transparent}.ith-table-row:last-child .ith-table-td{border-bottom:0}.ith-table-align-left{text-align:left}.ith-table-align-center{text-align:center}.ith-table-align-right,.ith-table-actions-head{text-align:right}.ith-table-actions-cell{padding:var(--_cell-padding);border-bottom:1px solid var(--_border);text-align:right;white-space:nowrap}.ith-table-row:last-child .ith-table-actions-cell{border-bottom:0}.ith-table-action{display:inline-flex;align-items:center;gap:4px;padding:5px 9px;margin-left:4px;border:1px solid var(--_border);border-radius:7px;background:transparent;color:var(--_accent);font-family:inherit;font-size:12px;font-weight:500;line-height:1.2;cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.ith-table-action:hover:not(:disabled){background:var(--_accent-soft);border-color:var(--_accent)}.ith-table-action:disabled{opacity:.45;cursor:not-allowed}.ith-table-action-icon{font-size:12px;line-height:1}.ith-table-action.is-danger{color:var(--_danger);border-color:color-mix(in srgb,var(--_danger) 35%,transparent)}.ith-table-filter-row th{background:var(--_filter-bg);padding:8px 10px;border-bottom:1px solid var(--_border);border-top:1px solid var(--_border)}.ith-table-filter-input{width:100%;box-sizing:border-box;height:30px;padding:0 9px;border:1px solid var(--_input-border);border-radius:7px;background:var(--_input-bg);color:var(--_text);font-family:inherit;font-size:12px}.ith-table-filter-select{cursor:pointer;padding-right:4px}.ith-table-filter-input:focus{outline:none;border-color:var(--_accent);box-shadow:0 0 0 3px var(--_focus)}.ith-table-filter-input::placeholder{color:var(--_muted)}.ith-table-status{padding:40px 16px;text-align:center;color:var(--_muted);font-size:13px}.ith-table-empty{display:flex;flex-direction:column;align-items:center;gap:8px}.ith-table-empty svg{width:36px;height:36px;opacity:.45}.ith-table-spinner{display:inline-block;width:16px;height:16px;border:2px solid var(--_accent-soft);border-top-color:var(--_accent);border-radius:50%;animation:ith-table-spin .7s linear infinite;vertical-align:middle}@keyframes ith-table-spin{to{transform:rotate(360deg)}}.ith-table-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--_overlay);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);color:var(--_text);font-size:13px;font-weight:500;z-index:3}.ith-table-link{padding:0;border:0;background:none;color:var(--_accent);font-family:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.ith-table-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 16px;border-top:1px solid var(--_border);background:var(--_footer-bg);font-size:12px;color:var(--_muted)}.ith-table-footer-info{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.ith-table-footer-info strong{color:var(--_text);font-weight:600}.ith-table-footer-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.ith-table-pagination{display:flex;align-items:center;gap:4px}.ith-table-page-btn{display:inline-grid;place-items:center;min-width:30px;height:30px;padding:0 6px;border:1px solid var(--_border);border-radius:7px;background:var(--_bg);color:var(--_text);font-family:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.ith-table-page-btn svg{width:14px;height:14px}.ith-table-page-btn:hover:not(:disabled){border-color:var(--_accent);color:var(--_accent);background:var(--_accent-soft)}.ith-table-page-btn:disabled{opacity:.4;cursor:not-allowed}.ith-table-page-number{min-width:30px}.ith-table-page-number.is-active{background:var(--_accent);border-color:var(--_accent);color:var(--_on-accent)}.ith-table-page-number.is-active:hover{background:var(--_accent);color:var(--_on-accent)}.ith-table-page-state{margin-left:6px;white-space:nowrap}.ith-table-page-size{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.ith-table-select{height:30px;padding:0 6px;border:1px solid var(--_border);border-radius:7px;background:var(--_bg);color:var(--_text);font-family:inherit;font-size:12px;cursor:pointer}.ith-table-select:focus-visible,.ith-table-page-btn:focus-visible,.ith-table-action:focus-visible,.ith-table-link:focus-visible{outline:2px solid var(--_accent);outline-offset:2px}.ith-table-dense{--ith-table-cell-padding: 8px 12px;--ith-table-font-size: 13px;--ith-table-header-font-size: 12px;--_cell-padding: 8px 12px;--_font-size: 13px;--_header-font-size: 12px;--_row-height: 39px;--_head-height: 38px}.ith-table-dense .ith-table-head-row th{padding:10px 12px}.ith-table-striped .ith-table-row:nth-child(2n){background:var(--_striped-bg)}.ith-table-bordered .ith-table-td,.ith-table-bordered .ith-table-actions-cell,.ith-table-bordered .ith-table-head-row th,.ith-table-bordered .ith-table-filter-row th{border-right:1px solid var(--_border)}.ith-table-bordered .ith-table-head-row th:last-child,.ith-table-bordered .ith-table-filter-row th:last-child{border-right:0}.ith-table-bordered .ith-table-td:last-child,.ith-table-bordered .ith-table-actions-cell:last-child{border-right:0}@media(prefers-reduced-motion:reduce){.ith-table-row,.ith-table-action,.ith-table-page-btn,.ith-table-search-input,.ith-table-sort-icons svg{transition:none}.ith-table-spinner{animation-duration:2.4s}}@media(max-width:640px){.ith-table-footer{align-items:stretch;flex-direction:column}.ith-table-toolbar-inner{gap:10px}.ith-table-search{flex:1 1 auto}.ith-table-footer-controls{justify-content:space-between}.ith-table-page-state{display:none}}.ith-table-toolbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;flex:0 0 auto}.ith-table-tool-btn{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 13px;border:1px solid var(--_input-border);border-radius:10px;background:var(--_input-bg);color:var(--_text);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;white-space:nowrap;transition:border-color .14s ease,background-color .14s ease,color .14s ease,box-shadow .14s ease}.ith-table-tool-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.ith-table-tool-btn:hover .ith-table-tool-icon,.ith-table-tool-btn[aria-expanded=true] .ith-table-tool-icon,.ith-table-tool-btn[aria-pressed=true] .ith-table-tool-icon{opacity:1}.ith-table-tool-btn:hover{border-color:color-mix(in srgb,var(--_accent) 45%,var(--_input-border));background:color-mix(in srgb,var(--_accent) 4%,var(--_input-bg));color:var(--_accent)}.ith-table-tool-btn[aria-expanded=true],.ith-table-tool-btn[aria-pressed=true]{border-color:var(--_accent);background:var(--_accent-soft);color:var(--_accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_accent) 20%,transparent)}.ith-table-tool-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--_focus)}.ith-table-menu-anchor{position:relative;display:inline-flex}.ith-table-segmented{display:inline-flex;align-items:center;gap:2px;height:36px;padding:3px;border:1px solid var(--_input-border);border-radius:10px;background:var(--_input-bg)}.ith-table-segmented-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:0;border-radius:7px;background:transparent;color:var(--_muted);font:inherit;font-size:12.5px;font-weight:600;white-space:nowrap;cursor:pointer;transition:background-color .12s ease,color .12s ease}.ith-table-segmented-btn svg{width:13px;height:13px}.ith-table-segmented-btn:hover{color:var(--_accent)}.ith-table-segmented-btn.is-active{background:var(--_accent-soft);color:var(--_accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_accent) 22%,transparent)}.ith-table-segmented-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--_focus)}.ith-table-popover{position:fixed;z-index:900;width:250px;max-height:380px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--_border);border-radius:12px;background:var(--_popover-bg);color:var(--_text);box-shadow:var(--_elevation);font-size:13px}.ith-table-popover-header{padding:10px 12px 8px;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--_muted)}.ith-table-popover-list{padding:0 6px 6px;overflow-y:auto;max-height:280px}.ith-table-popover-footer{display:flex;gap:6px;padding:6px;border-top:1px solid var(--_border);background:color-mix(in srgb,var(--_brand) 2%,var(--_bg))}.ith-table-popover-action{flex:1 1 auto;padding:7px 8px;border:0;border-radius:8px;background:transparent;color:var(--_accent);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}.ith-table-popover-action:hover{background:var(--_accent-soft)}.ith-table-popover-empty{margin:0;padding:10px 12px;color:var(--_muted);font-size:12.5px}.ith-table-columns-item{display:flex;align-items:center;gap:10px;padding:7px 8px;border-radius:8px;font-size:13px;cursor:pointer;transition:background-color .12s ease}.ith-table-columns-item:hover{background:var(--_hover)}.ith-table-columns-item input:disabled{opacity:.4;cursor:not-allowed}.ith-table-pin-tag{margin-left:auto;padding:1px 7px;border-radius:999px;background:var(--_accent-soft);color:var(--_accent);font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.ith-table-view-item{display:flex;align-items:center;gap:4px;padding-right:4px;border-radius:8px}.ith-table-view-item:hover{background:var(--_hover)}.ith-table-view-item.is-active .ith-table-view-apply{color:var(--_accent);font-weight:650}.ith-table-view-apply{flex:1 1 auto;padding:7px 8px;border:0;background:transparent;color:var(--_text);font:inherit;font-size:13px;text-align:left;cursor:pointer}.ith-table-view-delete{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--_muted);cursor:pointer}.ith-table-view-delete svg{width:11px;height:11px}.ith-table-view-delete:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-view-save{align-items:center}.ith-table-view-input{flex:1 1 auto;min-width:0;height:30px;padding:0 9px;border:1px solid var(--_input-border);border-radius:8px;background:var(--_input-bg);color:var(--_text);font:inherit;font-size:12.5px}.ith-table-view-input:focus{outline:none;border-color:var(--_accent);box-shadow:0 0 0 3px var(--_focus)}.ith-table-column-menu{width:220px;padding:6px}.ith-table-menu-item{display:block;width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:var(--_text);font:inherit;font-size:13px;text-align:left;cursor:pointer}.ith-table-menu-item:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-menu-divider{height:1px;margin:5px 6px;background:var(--_border)}.ith-table.ith-table-compact{--ith-table-cell-padding: 7px 12px;--_cell-padding: var(--ith-table-compact-padding, 7px 12px);--_font-size: var(--ith-table-compact-font-size, 13px);--_header-font-size: 12.5px;--_row-height: 39px;--_head-height: 39px}.ith-table.ith-table-compact .ith-table-head-row th{padding:10px 12px}.ith-table.ith-table-compact .ith-table-filter-row th{padding:6px 10px}.ith-table-sticky-start,.ith-table-sticky-end{position:sticky;z-index:3;background:var(--_bg)}.ith-table-sticky-start{box-shadow:inset -1px 0 0 var(--_border)}.ith-table-sticky-end{box-shadow:inset 1px 0 0 var(--_border)}.ith-table-striped .ith-table-row:nth-child(2n) .ith-table-sticky-start,.ith-table-striped .ith-table-row:nth-child(2n) .ith-table-sticky-end{background:var(--_striped-bg)}.ith-table-row-selected .ith-table-sticky-start,.ith-table-row-selected .ith-table-sticky-end{background:var(--_selected-bg)}.ith-table-row:hover .ith-table-sticky-start,.ith-table-row:hover .ith-table-sticky-end{background:var(--_hover)}thead .ith-table-sticky-start,thead .ith-table-sticky-end{z-index:7;background:var(--_header-bg)}.ith-table-filter-row .ith-table-sticky-start,.ith-table-filter-row .ith-table-sticky-end{z-index:6;background:var(--_filter-bg)}.ith-table-td:not(.ith-table-sticky-start):not(.ith-table-sticky-end){position:relative}.ith-table-td.ith-table-copyable{padding-inline-end:36px}.ith-table-copy{position:absolute;inset-inline-end:8px;top:50%;display:grid;place-items:center;width:24px;height:24px;padding:0;transform:translateY(-50%);border:1px solid transparent;border-radius:7px;background:var(--_bg);color:var(--_muted);cursor:pointer;opacity:0;pointer-events:none;transition:opacity .12s ease,color .12s ease,border-color .12s ease}.ith-table-copy svg{width:14px;height:14px}.ith-table-td:hover .ith-table-copy,.ith-table-td:focus-within .ith-table-copy,.ith-table-copy.is-copied{opacity:1;pointer-events:auto}.ith-table-copy:hover{border-color:var(--_accent);color:var(--_accent)}.ith-table-copy.is-copied{color:var(--_accent)}.ith-table-td:focus-visible{outline:2px solid var(--_accent);outline-offset:-2px}.ith-table-skeleton{display:block;width:72%;height:12px;border-radius:6px;background:linear-gradient(90deg,var(--_border) 25%,var(--_hover) 37%,var(--_border) 63%);background-size:400% 100%;animation:ith-table-shimmer 1.4s ease infinite}.ith-table-skeleton.is-check{width:16px;height:16px;border-radius:4px;margin:0 auto}@keyframes ith-table-shimmer{0%{background-position:100% 50%}to{background-position:0 50%}}.ith-table-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ith-table-menu{position:fixed;z-index:1000;min-width:180px;max-width:280px;padding:6px;border:1px solid var(--_border);border-radius:10px;background:var(--_popover-bg);color:var(--_text);box-shadow:var(--_elevation);font-size:13px}@media(prefers-reduced-motion:reduce){.ith-table-skeleton{animation:none}.ith-table-copy,.ith-table-tool-btn{transition:none}}.ith-table-th-inner{display:flex;align-items:center;gap:6px;min-width:0}.ith-table-th-inner>*:first-child{min-width:0}.ith-table-th:not(.ith-table-sticky-start):not(.ith-table-sticky-end){position:relative}.ith-table-th-menu{display:grid;place-items:center;flex:0 0 auto;width:20px;height:20px;padding:0;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer;opacity:0;transition:opacity .12s ease,background-color .12s ease}.ith-table-th-menu svg{width:13px;height:13px}.ith-table-th:hover .ith-table-th-menu,.ith-table-th-menu[aria-expanded=true],.ith-table-th-menu:focus-visible{opacity:.85}.ith-table-th-menu:hover{background:color-mix(in srgb,currentColor 20%,transparent);opacity:1}.ith-table-th-menu:focus-visible{outline:2px solid currentColor;outline-offset:1px}.ith-table-resizer{position:absolute;top:0;inset-inline-end:-4px;bottom:0;width:9px;z-index:4;cursor:col-resize;touch-action:none}.ith-table-resizer:after{content:\"\";position:absolute;top:22%;bottom:22%;inset-inline-start:4px;width:2px;border-radius:2px;background:transparent;transition:background-color .12s ease}.ith-table-th:hover .ith-table-resizer:after{background:color-mix(in srgb,currentColor 40%,transparent)}.ith-table-th-dragging{opacity:.5}.ith-table-drop-target{box-shadow:inset 3px 0 0 var(--_accent)}.ith-table-pin-dot{flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.55}.ith-table-sticky .ith-table-scroll.is-scrolled .ith-table-head-row th{box-shadow:0 1px 0 var(--_border),0 10px 16px -14px #0c0a1e8c}.ith-table-chips{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:10px}.ith-table-chip{display:inline-flex;align-items:center;gap:6px;max-width:260px;padding:3px 4px 3px 9px;border:1px solid color-mix(in srgb,var(--_accent) 24%,transparent);border-radius:999px;background:var(--_accent-soft);color:var(--_accent);font-size:11.5px;font-weight:600}.ith-table-chip-label{font-size:10px;letter-spacing:.04em;text-transform:uppercase;opacity:.7}.ith-table-chip-value{max-width:150px;overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.ith-table-chip-remove{display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:color-mix(in srgb,var(--_accent) 16%,transparent);color:inherit;cursor:pointer}.ith-table-chip-remove svg{width:9px;height:9px}.ith-table-chip-remove:hover{background:var(--_accent);color:var(--_on-accent)}.ith-table-chips-clear{padding:3px 8px;border:0;border-radius:999px;background:transparent;color:var(--_muted);font:inherit;font-size:11.5px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.ith-table-chips-clear:hover{color:var(--_accent)}.ith-table-selection-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 16px;border-bottom:1px solid color-mix(in srgb,var(--_accent) 28%,var(--_border));background:var(--_accent-soft);color:var(--_accent);font-size:12.5px}.ith-table-selection-count strong{font-weight:700}.ith-table-selection-spacer{flex:1 1 auto}.ith-table-selection-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.ith-table-selection-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:1px solid color-mix(in srgb,var(--_accent) 35%,transparent);border-radius:8px;background:var(--_bg);color:var(--_accent);font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .12s ease,color .12s ease}.ith-table-selection-btn:hover{background:var(--_accent);color:var(--_on-accent)}.ith-table-selection-btn.is-danger{border-color:color-mix(in srgb,var(--_danger) 40%,transparent);color:var(--_danger)}.ith-table-selection-btn.is-danger:hover{background:var(--_danger);color:#fff}.ith-table-selection-clear{border:0;background:transparent;color:var(--_muted);font:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.ith-table-selection-clear:hover{color:var(--_accent)}.ith-table-expander-cell{width:38px;padding:0 0 0 10px;text-align:center}th.ith-table-expander-cell{background:var(--_header-bg)}.ith-table-expander{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--_muted);cursor:pointer;transition:transform .15s ease,color .12s ease,background-color .12s ease}.ith-table-expander svg{width:13px;height:13px}.ith-table-expander:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-expander.is-open{transform:rotate(90deg);color:var(--_accent)}.ith-table-detail-row>td{padding:14px 16px;border-bottom:1px solid var(--_border);background:var(--_striped-bg);white-space:normal}.ith-table-total-cell{padding:var(--_cell-padding);border-top:1px solid var(--_border);background:var(--_filter-bg);font-size:12px;white-space:nowrap}.ith-table-total-row .ith-table-select-cell,.ith-table-total-row .ith-table-expander-cell{border-top:1px solid var(--_border);background:var(--_filter-bg)}.ith-table-total-label{margin-inline-end:6px;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--_muted)}.ith-table-total-value{font-weight:650;color:var(--_text)}@media(prefers-reduced-motion:reduce){.ith-table-expander,.ith-table-th-menu,.ith-table-selection-btn{transition:none}}.ith-table-export-menu{width:236px;padding:6px}.ith-table-export-name{display:block;font-weight:650}.ith-table-export-hint{display:block;margin-top:2px;font-size:11px;font-weight:500;color:var(--_muted)}.ith-table-menu-item:hover .ith-table-export-hint{color:inherit;opacity:.75}:host-context([data-theme=\"dark\"]) .ith-table,:host-context(.dark) .ith-table{box-shadow:var(--_shadow),inset 0 0 0 1px color-mix(in srgb,#ffffff 6%,transparent)}@media(prefers-color-scheme:dark){:host-context([data-theme=\"auto\"]) .ith-table{box-shadow:var(--_shadow),inset 0 0 0 1px color-mix(in srgb,#ffffff 6%,transparent)}}:host-context([data-theme=\"dark\"]) .ith-table-td,:host-context(.dark) .ith-table-td,:host-context([data-theme=\"dark\"]) .ith-table-actions-cell,:host-context(.dark) .ith-table-actions-cell{border-color:color-mix(in srgb,var(--_border) 78%,#ffffff)}:host-context([data-theme=\"dark\"]) .ith-table-row.ith-table-row-selected td:first-child,:host-context(.dark) .ith-table-row.ith-table-row-selected td:first-child{box-shadow:inset 3px 0 0 var(--_accent)}:host-context([data-theme=\"dark\"]) .ith-table-sort-icons,:host-context(.dark) .ith-table-sort-icons{opacity:.65}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1955
+ }
1956
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableComponent, decorators: [{
1957
+ type: Component,
1958
+ args: [{ selector: 'ith-table', imports: [NgClass, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"ith-table\"\n [class.ith-table-bordered]=\"bordered()\"\n [class.ith-table-dense]=\"dense()\"\n [class.ith-table-striped]=\"striped()\"\n [class.ith-table-hoverable]=\"hoverable()\"\n [class.ith-table-sticky]=\"stickyHeader()\"\n [class.ith-table-compact]=\"compact()\">\n <!-- Toolbar -->\n @if (showToolbar()) {\n <div class=\"ith-table-toolbar\">\n <div class=\"ith-table-toolbar-inner\">\n <div class=\"ith-table-toolbar-main\">\n @if (title()) {\n <h3 class=\"ith-table-title\">{{ title() }}</h3>\n }\n <span class=\"ith-table-badge\">{{ totalRows() }} {{ countSuffix() }}</span>\n @if (selected().length > 0) {\n <span class=\"ith-table-badge ith-table-badge-accent\">{{ selected().length }} selected</span>\n }\n @if (toolbarTemplate(); as toolbarTpl) {\n <ng-container\n [ngTemplateOutlet]=\"toolbarTpl\"\n [ngTemplateOutletContext]=\"toolbarContext()\" />\n }\n </div>\n\n <div class=\"ith-table-toolbar-spacer\"></div>\n\n <div class=\"ith-table-toolbar-actions\">\n @if (showViews()) {\n <div class=\"ith-table-menu-anchor\" (click)=\"$event.stopPropagation()\">\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"viewsOpen()\"\n (click)=\"toggleViews($event)\">\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6h16M4 12h10M4 18h7\" />\n </svg>\n <span>Views</span>\n </button>\n </div>\n }\n\n @if (showColumnPicker()) {\n <div class=\"ith-table-menu-anchor\" (click)=\"$event.stopPropagation()\">\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"columnPickerOpen()\"\n (click)=\"toggleColumnPicker($event)\">\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"7\" height=\"16\" rx=\"1.5\" />\n <rect x=\"14\" y=\"4\" width=\"7\" height=\"16\" rx=\"1.5\" />\n </svg>\n <span>Columns</span>\n </button>\n </div>\n }\n\n @if (showDensityToggle()) {\n <div class=\"ith-table-segmented\" role=\"group\" aria-label=\"Row density\">\n <button\n type=\"button\"\n class=\"ith-table-segmented-btn\"\n [class.is-active]=\"!compact()\"\n [attr.aria-pressed]=\"!compact()\"\n title=\"Comfortable rows\"\n (click)=\"setDensity('comfortable')\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 8h16M4 16h16\" />\n </svg>\n <span>Comfortable</span>\n </button>\n <button\n type=\"button\"\n class=\"ith-table-segmented-btn\"\n [class.is-active]=\"compact()\"\n [attr.aria-pressed]=\"compact()\"\n title=\"Compact rows\"\n (click)=\"setDensity('compact')\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6h16M4 10h16M4 14h16M4 18h16\" />\n </svg>\n <span>Compact</span>\n </button>\n </div>\n }\n\n @if (showExport()) {\n <div class=\"ith-table-menu-anchor\" (click)=\"$event.stopPropagation()\">\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"!!exportMenuPos()\"\n title=\"Export the current view\"\n (click)=\"toggleExportMenu($event)\">\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M12 4v11m0 0 4-4m-4 4-4-4\" />\n <path d=\"M4 19h16\" />\n </svg>\n <span>Export</span>\n </button>\n </div>\n }\n\n @if (searchable()) {\n <div class=\"ith-table-search\">\n <svg class=\"ith-table-search-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m20 20-3.6-3.6\" />\n </svg>\n <input\n type=\"search\"\n class=\"ith-table-search-input\"\n [value]=\"search()\"\n [attr.placeholder]=\"searchPlaceholder()\"\n [attr.aria-label]=\"searchPlaceholder()\"\n (input)=\"onSearchInput($any($event.target).value)\" />\n @if (search()) {\n <button type=\"button\" class=\"ith-table-search-clear\" (click)=\"clearSearch()\" aria-label=\"Clear search\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n }\n </div>\n }\n </div>\n </div>\n\n @if (showFilterChips() && hasQuery()) {\n <div class=\"ith-table-chips\">\n @for (chip of filterChips(); track chip.kind + chip.key) {\n <span class=\"ith-table-chip\">\n <span class=\"ith-table-chip-label\">{{ chip.label }}</span>\n <span class=\"ith-table-chip-value\">{{ chip.value }}</span>\n <button\n type=\"button\"\n class=\"ith-table-chip-remove\"\n [attr.aria-label]=\"'Remove ' + chip.label + ' filter'\"\n (click)=\"removeChip(chip)\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n </span>\n }\n <button type=\"button\" class=\"ith-table-chips-clear\" (click)=\"clearQuery()\">Clear all</button>\n </div>\n }\n </div>\n }\n\n <!-- Bulk actions for the current selection -->\n @if (selected().length > 0 && selectionActions().length) {\n <div class=\"ith-table-selection-bar\" role=\"region\" aria-label=\"Selection actions\">\n <span class=\"ith-table-selection-count\">\n <strong>{{ selected().length }}</strong> selected\n </span>\n <span class=\"ith-table-selection-spacer\"></span>\n <div class=\"ith-table-selection-actions\">\n @for (action of selectionActions(); track action.id) {\n <button\n type=\"button\"\n class=\"ith-table-selection-btn\"\n [ngClass]=\"action.class ?? ''\"\n [attr.title]=\"action.title ?? action.label\"\n (click)=\"onSelectionAction(action, $event)\">\n @if (action.icon) {\n <span class=\"ith-table-selection-icon\" aria-hidden=\"true\">{{ action.icon }}</span>\n }\n <span>{{ action.label }}</span>\n </button>\n }\n <button type=\"button\" class=\"ith-table-selection-clear\" (click)=\"clearSelection()\">\n Clear selection\n </button>\n </div>\n </div>\n }\n\n <!-- Table -->\n <div\n class=\"ith-table-scroll\"\n [class.ith-table-scroll-bounded]=\"!!maxHeight()\"\n [class.ith-table-scroll-filtered]=\"showFilters()\"\n [class.is-scrolled]=\"scrolled()\"\n [style.maxHeight]=\"maxHeight() || null\"\n [style.--_min-rows]=\"minRows()\"\n (scroll)=\"onScroll($event)\">\n <table class=\"ith-table-grid\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-busy]=\"loading()\">\n <thead>\n <tr class=\"ith-table-head-row\">\n @if (selectable()) {\n <th\n scope=\"col\"\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\">\n @if (selectionMode() === 'multi') {\n <input\n type=\"checkbox\"\n class=\"ith-table-checkbox\"\n [checked]=\"allPageSelected()\"\n [indeterminate]=\"somePageSelected()\"\n [attr.aria-label]=\"'Select all rows'\"\n (change)=\"onSelectAllChange($event)\" />\n }\n </th>\n }\n\n @if (hasExpander()) {\n <th scope=\"col\" class=\"ith-table-expander-cell\" [attr.aria-label]=\"'Row details'\"></th>\n }\n\n @for (column of visibleColumns(); track column.key) {\n <th\n scope=\"col\"\n class=\"ith-table-th\"\n [ngClass]=\"headerClasses(column)\"\n [style]=\"columnStyle(column)\"\n [attr.data-col]=\"column.key\"\n [attr.aria-sort]=\"isSortable(column) ? ariaSort(column) : null\"\n [attr.draggable]=\"reorderable() ? 'true' : null\"\n [class.ith-table-th-dragging]=\"dragKey() === column.key\"\n (dragstart)=\"onHeaderDragStart(column, $event)\"\n (dragover)=\"onHeaderDragOver(column, $event)\"\n (drop)=\"onHeaderDrop(column, $event)\"\n (dragend)=\"onHeaderDragEnd()\">\n <div class=\"ith-table-th-inner\">\n @if (headerTemplate(column); as headerTpl) {\n <ng-container\n [ngTemplateOutlet]=\"headerTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: column, column: column }\" />\n } @else if (isSortable(column)) {\n <button\n type=\"button\"\n class=\"ith-table-sort\"\n [class.is-sorted]=\"!!sortDirection(column)\"\n (click)=\"toggleSort(column)\"\n [attr.aria-label]=\"'Sort by ' + (column.header ?? column.key)\">\n <span class=\"ith-table-th-label\">{{ column.header ?? column.key }}</span>\n <span class=\"ith-table-sort-icons\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 10 6\" class=\"ith-table-sort-up\" [class.is-active]=\"sortDirection(column) === 'asc'\"><path d=\"M5 0l5 6H0z\" /></svg>\n <svg viewBox=\"0 0 10 6\" class=\"ith-table-sort-down\" [class.is-active]=\"sortDirection(column) === 'desc'\"><path d=\"M5 6L0 0h10z\" /></svg>\n </span>\n </button>\n } @else {\n <span class=\"ith-table-th-label\">{{ column.header ?? column.key }}</span>\n }\n\n @if (showColumnMenu()) {\n <button\n type=\"button\"\n class=\"ith-table-th-menu\"\n [attr.aria-expanded]=\"columnMenu()?.key === column.key\"\n [attr.aria-label]=\"'Column options for ' + (column.header ?? column.key)\"\n (click)=\"openColumnMenu(column, $event)\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"5\" r=\"1.7\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.7\" />\n <circle cx=\"12\" cy=\"19\" r=\"1.7\" />\n </svg>\n </button>\n }\n\n @if (pinOf(column) === 'start') {\n <span class=\"ith-table-pin-dot\" aria-hidden=\"true\"></span>\n }\n </div>\n\n @if (resizable()) {\n <span\n class=\"ith-table-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + (column.header ?? column.key)\"\n (pointerdown)=\"startResize(column, $event)\"></span>\n }\n </th>\n }\n\n @if (hasActionsColumn()) {\n <th\n scope=\"col\"\n class=\"ith-table-th ith-table-actions-head\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.width]=\"actionsWidth()\"\n [style.right]=\"stickyActions() ? '0px' : null\">\n {{ actionsHeader() }}\n </th>\n }\n </tr>\n\n @if (showFilters()) {\n <tr class=\"ith-table-filter-row\">\n @if (selectable()) {\n <th\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\"></th>\n }\n @if (hasExpander()) {\n <th class=\"ith-table-expander-cell\"></th>\n }\n @for (column of visibleColumns(); track column.key) {\n <th\n class=\"ith-table-filter-cell\"\n [ngClass]=\"filterClasses(column)\"\n [style]=\"columnStyle(column)\">\n @if (filterTemplate(column); as filterTpl) {\n <ng-container\n [ngTemplateOutlet]=\"filterTpl\"\n [ngTemplateOutletContext]=\"filterContext(column)\" />\n } @else if (column.filterable !== false) {\n @switch (filterTypeFor(column)) {\n @case ('select') {\n <select\n class=\"ith-table-filter-input ith-table-filter-select\"\n [value]=\"filterValue(column.key)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (change)=\"onFilterInput(column.key, $any($event.target).value)\">\n <option value=\"\">{{ filterAllLabel() }}</option>\n @for (option of filterOptionsFor(column); track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n }\n @case ('number') {\n <input\n type=\"number\"\n class=\"ith-table-filter-input\"\n [value]=\"filterValue(column.key)\"\n [attr.placeholder]=\"filterPlaceholderFor(column)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (input)=\"onFilterInput(column.key, $any($event.target).value)\" />\n }\n @case ('date') {\n <input\n type=\"date\"\n class=\"ith-table-filter-input\"\n [value]=\"filterValue(column.key)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (input)=\"onFilterInput(column.key, $any($event.target).value)\" />\n }\n @default {\n <input\n type=\"text\"\n class=\"ith-table-filter-input\"\n [value]=\"filterValue(column.key)\"\n [attr.placeholder]=\"filterPlaceholderFor(column)\"\n [attr.aria-label]=\"'Filter by ' + (column.header ?? column.key)\"\n (input)=\"onFilterInput(column.key, $any($event.target).value)\" />\n }\n }\n }\n </th>\n }\n @if (hasActionsColumn()) {\n <th\n class=\"ith-table-filter-cell\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.right]=\"stickyActions() ? '0px' : null\"></th>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n @if (loading() && pagedRows().length === 0) {\n @for (skeleton of skeletonIndexes(); track skeleton) {\n <tr class=\"ith-table-skeleton-row\" aria-hidden=\"true\">\n @if (selectable()) {\n <td\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\">\n <span class=\"ith-table-skeleton is-check\"></span>\n </td>\n }\n @if (hasExpander()) {\n <td class=\"ith-table-expander-cell\"></td>\n }\n @for (column of visibleColumns(); track column.key) {\n <td class=\"ith-table-td\">\n <span class=\"ith-table-skeleton\"></span>\n </td>\n }\n @if (hasActionsColumn()) {\n <td class=\"ith-table-actions-cell\"><span class=\"ith-table-skeleton\"></span></td>\n }\n </tr>\n }\n <tr>\n <td class=\"ith-table-visually-hidden\" [attr.colspan]=\"emptyColspan()\" aria-live=\"polite\">\n {{ loadingText() }}\n </td>\n </tr>\n } @else if (pagedRows().length === 0) {\n <tr>\n <td class=\"ith-table-status\" [attr.colspan]=\"emptyColspan()\">\n @if (emptyTemplate(); as emptyTpl) {\n <ng-container\n [ngTemplateOutlet]=\"emptyTpl\"\n [ngTemplateOutletContext]=\"emptyContext()\" />\n } @else {\n <div class=\"ith-table-empty\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M3 10h18M9 10v9\" />\n </svg>\n <span>{{ hasQuery() ? 'No records match your search.' : emptyText() }}</span>\n @if (hasQuery()) {\n <button type=\"button\" class=\"ith-table-link\" (click)=\"clearQuery()\">Clear search &amp; filters</button>\n }\n </div>\n }\n </td>\n </tr>\n } @else {\n @for (row of pagedRows(); track trackRow($index, row); let rowIndex = $index) {\n <tr\n class=\"ith-table-row\"\n [ngClass]=\"rowClassFor(row, $index)\"\n [class.ith-table-row-clickable]=\"rowClickable() || selectOnRowClick() || (hasRowDetail() && rowDetailTrigger() === 'row')\"\n [attr.tabindex]=\"rowClickable() || selectOnRowClick() ? 0 : null\"\n [attr.aria-selected]=\"selectable() ? isSelected(row) : null\"\n [attr.aria-expanded]=\"hasRowDetail() ? isRowExpanded(row) : null\"\n (click)=\"onRowClick(row, $index, $event)\"\n (keydown)=\"onRowKeydown(row, $index, $event)\"\n (contextmenu)=\"onRowContextMenu(row, $index, $event)\">\n @if (selectable()) {\n <td\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\">\n <input\n type=\"checkbox\"\n class=\"ith-table-checkbox\"\n [checked]=\"isSelected(row)\"\n [attr.aria-label]=\"'Select row ' + ($index + 1)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onRowCheckboxChange(row, $event)\" />\n </td>\n }\n\n @if (hasExpander()) {\n <td class=\"ith-table-expander-cell\">\n <button\n type=\"button\"\n class=\"ith-table-expander\"\n [class.is-open]=\"isRowExpanded(row)\"\n [attr.aria-expanded]=\"isRowExpanded(row)\"\n [attr.aria-label]=\"'Toggle details for row ' + ($index + 1)\"\n (click)=\"toggleRowDetail(row, $event)\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"m9 6 6 6-6 6\" />\n </svg>\n </button>\n </td>\n }\n\n @for (column of visibleColumns(); track column.key; let colIndex = $index) {\n <td\n class=\"ith-table-td\"\n [class.ith-table-copyable]=\"copyable()\"\n [ngClass]=\"cellClasses(row, column, rowIndex)\"\n [style]=\"columnStyle(column)\"\n [attr.title]=\"tooltipText(row, column, rowIndex)\"\n [attr.data-cell]=\"rowIndex + '-' + colIndex\"\n [attr.data-col]=\"column.key\"\n [attr.tabindex]=\"cellTabIndex(rowIndex, colIndex)\"\n (focus)=\"onCellFocus(rowIndex, colIndex)\"\n (keydown)=\"onCellKeydown(column, rowIndex, colIndex, $event)\">\n @if (cellTemplate(column); as cellTpl) {\n <ng-container\n [ngTemplateOutlet]=\"cellTpl\"\n [ngTemplateOutletContext]=\"cellContext(row, column, rowIndex)\" />\n } @else {\n {{ cellText(row, column, rowIndex) }}\n }\n @if (copyable()) {\n <button\n type=\"button\"\n class=\"ith-table-copy\"\n [class.is-copied]=\"isCellCopied(rowIndex, column)\"\n [attr.aria-label]=\"'Copy ' + (column.header ?? column.key)\"\n (click)=\"copyCell(row, column, rowIndex, $event)\">\n @if (isCellCopied(rowIndex, column)) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m5 13 4 4L19 7\" /></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" /><path d=\"M15 5.5A2.5 2.5 0 0 0 12.5 3H6a2 2 0 0 0-2 2v7.5A2.5 2.5 0 0 0 6.5 15\" /></svg>\n }\n </button>\n }\n </td>\n }\n\n @if (hasActionsColumn()) {\n <td\n class=\"ith-table-actions-cell\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.right]=\"stickyActions() ? '0px' : null\">\n @if (rowActionsTemplate(); as actionsTpl) {\n <ng-container\n [ngTemplateOutlet]=\"actionsTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row, index: $index }\" />\n } @else {\n @for (action of rowActions(); track action.id) {\n @if (isActionVisible(action, row, $index)) {\n <button\n type=\"button\"\n class=\"ith-table-action\"\n [ngClass]=\"action.class ?? ''\"\n [attr.title]=\"action.title ?? action.label\"\n [disabled]=\"isActionDisabled(action, row, $index)\"\n (click)=\"onActionClick(action, row, $index, $event)\">\n @if (action.icon) {\n <span class=\"ith-table-action-icon\" aria-hidden=\"true\">{{ action.icon }}</span>\n }\n <span>{{ action.label }}</span>\n </button>\n }\n }\n }\n </td>\n }\n </tr>\n\n @if (hasRowDetail() && isRowExpanded(row)) {\n <tr class=\"ith-table-detail-row\">\n <td [attr.colspan]=\"emptyColspan()\">\n @if (rowDetailTemplate(); as detailTpl) {\n <ng-container\n [ngTemplateOutlet]=\"detailTpl\"\n [ngTemplateOutletContext]=\"rowDetailContext(row, rowIndex)\" />\n }\n </td>\n </tr>\n }\n }\n }\n </tbody>\n\n @if (hasAggregates() && pagedRows().length > 0) {\n <tfoot>\n <tr class=\"ith-table-total-row\">\n @if (selectable()) {\n <td\n class=\"ith-table-select-cell\"\n [class.ith-table-sticky-start]=\"stickySelection()\"\n [style.left]=\"stickySelection() ? '0px' : null\"></td>\n }\n @if (hasExpander()) {\n <td class=\"ith-table-expander-cell\"></td>\n }\n @for (column of visibleColumns(); track column.key) {\n <td\n class=\"ith-table-total-cell\"\n [ngClass]=\"stickyClassFor(column)\"\n [style]=\"columnStyle(column)\">\n @if (column.aggregate) {\n <span class=\"ith-table-total-label\">{{ aggregateLabel(column) }}</span>\n <span class=\"ith-table-total-value\">{{ aggregateText(column) }}</span>\n }\n </td>\n }\n @if (hasActionsColumn()) {\n <td\n class=\"ith-table-total-cell ith-table-actions-cell\"\n [class.ith-table-sticky-end]=\"stickyActions()\"\n [style.right]=\"stickyActions() ? '0px' : null\"></td>\n }\n </tr>\n </tfoot>\n }\n </table>\n\n @if (loading() && pagedRows().length > 0) {\n <div class=\"ith-table-loading-overlay\">\n <span class=\"ith-table-spinner\" aria-hidden=\"true\"></span>\n <span>{{ loadingText() }}</span>\n </div>\n }\n </div>\n\n <!-- Columns popover (fixed, so the toolbar's scroll box cannot clip it) -->\n @if (columnPickerOpen()) {\n <div\n class=\"ith-table-popover\"\n role=\"dialog\"\n aria-label=\"Visible columns\"\n [style.left.px]=\"columnsMenuPos()?.x ?? 0\"\n [style.top.px]=\"columnsMenuPos()?.y ?? 0\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"ith-table-popover-header\">Show columns</div>\n <div class=\"ith-table-popover-list\">\n @for (column of orderedColumns(); track column.key) {\n <label class=\"ith-table-columns-item\">\n <input\n type=\"checkbox\"\n class=\"ith-table-checkbox\"\n [checked]=\"isColumnVisible(column)\"\n [disabled]=\"!isColumnVisible(column) && !canHide(column.key)\"\n (change)=\"setColumnVisible(column.key, $any($event.target).checked)\" />\n <span>{{ column.header ?? column.key }}</span>\n @if (pinOf(column)) {\n <span class=\"ith-table-pin-tag\">{{ pinOf(column) }}</span>\n }\n </label>\n }\n </div>\n <div class=\"ith-table-popover-footer\">\n <button type=\"button\" class=\"ith-table-popover-action\" (click)=\"resetColumns()\">\n Reset columns\n </button>\n </div>\n </div>\n }\n\n <!-- Export formats -->\n @if (exportMenuPos(); as pos) {\n <div\n class=\"ith-table-popover ith-table-export-menu\"\n role=\"menu\"\n aria-label=\"Export format\"\n [style.left.px]=\"pos.x\"\n [style.top.px]=\"pos.y\"\n (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"exportAs('xlsx')\">\n <span class=\"ith-table-export-name\">Excel</span>\n <span class=\"ith-table-export-hint\">.xlsx \u2014 Excel, Numbers, Sheets</span>\n </button>\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"exportAs('csv')\">\n <span class=\"ith-table-export-name\">CSV</span>\n <span class=\"ith-table-export-hint\">.csv \u2014 plain text, any tool</span>\n </button>\n </div>\n }\n\n <!-- Named views -->\n @if (viewsOpen()) {\n <div\n class=\"ith-table-popover\"\n role=\"dialog\"\n aria-label=\"Saved views\"\n [style.left.px]=\"viewsMenuPos()?.x ?? 0\"\n [style.top.px]=\"viewsMenuPos()?.y ?? 0\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"ith-table-popover-header\">Saved views</div>\n <div class=\"ith-table-popover-list\">\n @for (name of savedViewNames(); track name) {\n <div class=\"ith-table-view-item\" [class.is-active]=\"activeView() === name\">\n <button type=\"button\" class=\"ith-table-view-apply\" (click)=\"applyView(name)\">\n {{ name }}\n </button>\n <button\n type=\"button\"\n class=\"ith-table-view-delete\"\n [attr.aria-label]=\"'Delete view ' + name\"\n (click)=\"deleteView(name, $event)\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n </button>\n </div>\n } @empty {\n <p class=\"ith-table-popover-empty\">No saved views yet.</p>\n }\n </div>\n <div class=\"ith-table-popover-footer ith-table-view-save\">\n <input\n type=\"text\"\n class=\"ith-table-view-input\"\n placeholder=\"View name\"\n aria-label=\"New view name\"\n [value]=\"viewNameDraft()\"\n (input)=\"onViewNameInput($any($event.target).value)\"\n (keydown.enter)=\"saveView()\" />\n <button type=\"button\" class=\"ith-table-popover-action\" (click)=\"saveView()\">Save</button>\n </div>\n </div>\n }\n\n <!-- Column header menu -->\n @if (columnMenu(); as menu) {\n <div\n class=\"ith-table-popover ith-table-column-menu\"\n role=\"menu\"\n [style.left.px]=\"menu.x\"\n [style.top.px]=\"menu.y\"\n (click)=\"$event.stopPropagation()\">\n @if (columnMenuColumn(); as column) {\n @if (isSortable(column)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuSort('asc')\">\n Sort ascending\n </button>\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuSort('desc')\">\n Sort descending\n </button>\n @if (sortDirection(column)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuClearSort()\">\n Clear sort\n </button>\n }\n <div class=\"ith-table-menu-divider\"></div>\n }\n @if (canPin(column)) {\n @if (pinOf(column) !== 'start') {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuPin('start')\">\n Pin to left\n </button>\n }\n @if (pinOf(column) !== 'end') {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuPin('end')\">\n Pin to right\n </button>\n }\n @if (pinOf(column)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuPin(null)\">\n Unpin column\n </button>\n }\n <div class=\"ith-table-menu-divider\"></div>\n }\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuAutosize()\">\n Fit to content\n </button>\n @if (canHide(column.key)) {\n <button type=\"button\" class=\"ith-table-menu-item\" role=\"menuitem\" (click)=\"menuHide()\">\n Hide column\n </button>\n }\n }\n </div>\n }\n\n <!-- Right-click menu (projected template, positioned at the pointer) -->\n @if (menuState(); as menu) {\n <div\n class=\"ith-table-menu\"\n role=\"menu\"\n [style.left.px]=\"menu.x\"\n [style.top.px]=\"menu.y\"\n (click)=\"closeRowMenu(); $event.stopPropagation()\">\n @if (rowMenuTemplate(); as menuTpl) {\n <ng-container\n [ngTemplateOutlet]=\"menuTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: menu.row, row: menu.row, index: menu.index }\" />\n }\n </div>\n }\n\n <!-- Footer -->\n @if (showFooter()) {\n <div class=\"ith-table-footer\">\n <div class=\"ith-table-footer-info\">\n @if (footerTemplate(); as footerTpl) {\n <ng-container\n [ngTemplateOutlet]=\"footerTpl\"\n [ngTemplateOutletContext]=\"footerContext()\" />\n } @else {\n <span>\n Showing <strong>{{ rangeStart() }}</strong>\u2013<strong>{{ rangeEnd() }}</strong>\n of <strong>{{ totalRows() }}</strong>\n </span>\n <span class=\"ith-table-total\">{{ totalLabel() }}: <strong>{{ totalRows() }}</strong></span>\n }\n </div>\n\n <div class=\"ith-table-footer-controls\">\n @if (showPagination()) {\n <nav class=\"ith-table-pagination\" aria-label=\"Pagination\">\n @if (showFirstLast()) {\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"firstPage()\" [disabled]=\"page() === 1\" aria-label=\"First page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m11 17-5-5 5-5M18 17l-5-5 5-5\" /></svg>\n </button>\n }\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"previousPage()\" [disabled]=\"page() === 1\" aria-label=\"Previous page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m15 18-6-6 6-6\" /></svg>\n </button>\n\n @for (item of pageItems(); track item) {\n <button\n type=\"button\"\n class=\"ith-table-page-btn ith-table-page-number\"\n [class.is-active]=\"item === page()\"\n [attr.aria-current]=\"item === page() ? 'page' : null\"\n (click)=\"goToPage(item)\">\n {{ item }}\n </button>\n }\n\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"nextPage()\" [disabled]=\"page() === pageCount()\" aria-label=\"Next page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m9 18 6-6-6-6\" /></svg>\n </button>\n @if (showFirstLast()) {\n <button type=\"button\" class=\"ith-table-page-btn\" (click)=\"lastPage()\" [disabled]=\"page() === pageCount()\" aria-label=\"Last page\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m13 17 5-5-5-5M6 17l5-5-5-5\" /></svg>\n </button>\n }\n <span class=\"ith-table-page-state\">Page {{ page() }} / {{ pageCount() }}</span>\n </nav>\n }\n\n @if (showPageSize()) {\n <label class=\"ith-table-page-size\">\n <span>Rows:</span>\n <select class=\"ith-table-select\" [value]=\"pageSize()\" (change)=\"onPageSizeChange($any($event.target).value)\">\n @for (size of pageSizeChoices(); track size) {\n <option [value]=\"size\">{{ size }}</option>\n }\n </select>\n </label>\n }\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:block;--_brand: var(--ith-table-brand, #5b21b6);--_bg: var(--ith-table-bg, #ffffff);--_text: var(--ith-table-text, #1f2937);--_muted: var(--ith-table-muted, #6b7280);--_border: var(--ith-table-border, #e8eaf0);--_header-bg: var(--ith-table-header-bg, var(--_brand));--_header-text: var(--ith-table-header-text, #ffffff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 6%, #ffffff));--_selected-bg: var(--ith-table-selected-bg, color-mix(in srgb, var(--_brand) 10%, #ffffff));--_striped-bg: var(--ith-table-striped-bg, color-mix(in srgb, var(--_brand) 2%, #ffffff));--_accent: var(--ith-table-accent, var(--_brand));--_accent-soft: var(--ith-table-accent-soft, color-mix(in srgb, var(--_brand) 12%, #ffffff));--_input-bg: var(--ith-table-input-bg, #ffffff);--_input-border: var(--ith-table-input-border, #dfe3ec);--_footer-bg: var(--ith-table-footer-bg, color-mix(in srgb, var(--_brand) 2%, #ffffff));--_filter-bg: var(--ith-table-filter-bg, color-mix(in srgb, var(--_brand) 3%, #ffffff));--_overlay: var(--ith-table-overlay, rgba(255, 255, 255, .72));--_radius: var(--ith-table-radius, 14px);--_shadow: var(--ith-table-shadow, 0 18px 40px -28px rgba(24, 20, 60, .55));--_focus: var(--ith-table-focus, color-mix(in srgb, var(--_brand) 25%, transparent));--_cell-padding: var(--ith-table-cell-padding, 12px 16px);--_font-size: var(--ith-table-font-size, 14px);--_header-font-size: var(--ith-table-header-font-size, 13px);--_row-height: var(--ith-table-row-height, 46px);--_head-height: var(--ith-table-head-height, 45px);--_filter-height: 47px;--_on-accent: #ffffff;--_toolbar-tint: color-mix(in srgb, var(--_brand) 3%, var(--_bg));--_popover-bg: var(--_bg);--_scroll-thumb: color-mix(in srgb, var(--_muted) 38%, transparent);--_danger: #dc2626;--_elevation: 0 18px 40px -18px rgba(17, 12, 46, .35), 0 0 0 1px color-mix(in srgb, var(--_border) 60%, transparent)}:host-context([data-theme=\"dark\"]),:host-context(.dark){--_brand: var(--ith-table-brand, #7c3aed);--_bg: var(--ith-table-bg, #161826);--_text: var(--ith-table-text, #e7e9f3);--_muted: var(--ith-table-muted, #9aa0b5);--_border: var(--ith-table-border, #2f3348);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 34%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 15%, #161826));--_selected-bg: var(--ith-table-selected-bg, color-mix(in srgb, var(--_brand) 20%, #161826));--_striped-bg: var(--ith-table-striped-bg, color-mix(in srgb, var(--_brand) 6%, #161826));--_accent: var(--ith-table-accent, color-mix(in srgb, var(--_brand) 55%, #ffffff));--_accent-soft: var(--ith-table-accent-soft, color-mix(in srgb, var(--_brand) 26%, #161826));--_input-bg: var(--ith-table-input-bg, #202436);--_input-border: var(--ith-table-input-border, #343a52);--_footer-bg: var(--ith-table-footer-bg, color-mix(in srgb, var(--_brand) 4%, #12141f));--_filter-bg: var(--ith-table-filter-bg, color-mix(in srgb, var(--_brand) 9%, #161826));--_overlay: var(--ith-table-overlay, rgba(17, 19, 30, .72));--_shadow: var(--ith-table-shadow, 0 18px 40px -28px rgba(0, 0, 0, .85));--_focus: var(--ith-table-focus, color-mix(in srgb, var(--_brand) 38%, transparent));--_on-accent: #15121f;--_toolbar-tint: color-mix(in srgb, var(--_brand) 12%, var(--_bg));--_popover-bg: #1d2133;--_scroll-thumb: color-mix(in srgb, #ffffff 22%, transparent);--_danger: #f87171;--_elevation: 0 22px 48px -20px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, #ffffff 8%, transparent)}@media(prefers-color-scheme:dark){:host-context([data-theme=\"auto\"]){--_brand: var(--ith-table-brand, #7c3aed);--_bg: var(--ith-table-bg, #161826);--_text: var(--ith-table-text, #e7e9f3);--_muted: var(--ith-table-muted, #9aa0b5);--_border: var(--ith-table-border, #2f3348);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 34%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 15%, #161826));--_selected-bg: var(--ith-table-selected-bg, color-mix(in srgb, var(--_brand) 20%, #161826));--_striped-bg: var(--ith-table-striped-bg, color-mix(in srgb, var(--_brand) 6%, #161826));--_accent: var(--ith-table-accent, color-mix(in srgb, var(--_brand) 55%, #ffffff));--_accent-soft: var(--ith-table-accent-soft, color-mix(in srgb, var(--_brand) 26%, #161826));--_input-bg: var(--ith-table-input-bg, #202436);--_input-border: var(--ith-table-input-border, #343a52);--_footer-bg: var(--ith-table-footer-bg, color-mix(in srgb, var(--_brand) 4%, #12141f));--_filter-bg: var(--ith-table-filter-bg, color-mix(in srgb, var(--_brand) 9%, #161826));--_overlay: var(--ith-table-overlay, rgba(17, 19, 30, .72));--_shadow: var(--ith-table-shadow, 0 18px 40px -28px rgba(0, 0, 0, .85));--_focus: var(--ith-table-focus, color-mix(in srgb, var(--_brand) 38%, transparent));--_on-accent: #15121f;--_toolbar-tint: color-mix(in srgb, var(--_brand) 12%, var(--_bg));--_popover-bg: #1d2133;--_scroll-thumb: color-mix(in srgb, #ffffff 22%, transparent);--_danger: #f87171;--_elevation: 0 22px 48px -20px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, #ffffff 8%, transparent)}}.ith-table{display:block;position:relative;background:var(--_bg);color:var(--_text);border:1px solid var(--_border);border-radius:var(--_radius);box-shadow:var(--_shadow);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:var(--_font-size);overflow:hidden}.ith-table-toolbar{padding:14px 16px;border-bottom:1px solid var(--_border);background:var(--_toolbar-tint)}.ith-table-toolbar-inner{display:flex;align-items:center;gap:12px;flex-wrap:nowrap;min-width:0;overflow-x:auto;scrollbar-width:none}.ith-table-toolbar-inner::-webkit-scrollbar{display:none}.ith-table-toolbar-main{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0;flex:0 0 auto}.ith-table-toolbar-spacer{flex:1 1 auto;min-width:8px}.ith-table-title{margin:0;font-size:15.5px;font-weight:650;letter-spacing:-.015em;color:var(--_text);white-space:nowrap}.ith-table-badge{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;background:var(--_accent-soft);color:var(--_accent);font-size:11.5px;font-weight:600;line-height:1.4;white-space:nowrap}.ith-table-badge-accent{background:var(--_accent);color:var(--_on-accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_accent) 30%,transparent)}.ith-table-search{position:relative;flex:0 1 260px;min-width:180px}.ith-table-search-icon{position:absolute;left:12px;top:50%;width:15px;height:15px;transform:translateY(-50%);color:var(--_muted);pointer-events:none}.ith-table-search-input{width:100%;box-sizing:border-box;height:36px;padding:0 34px 0 36px;border:1px solid var(--_input-border);border-radius:10px;background:var(--_input-bg);color:var(--_text);font-size:13px;font-family:inherit;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ith-table-search-input:hover{border-color:color-mix(in srgb,var(--_accent) 35%,var(--_input-border))}.ith-table-search-input::placeholder{color:var(--_muted)}.ith-table-search-input::-webkit-search-cancel-button,.ith-table-search-input::-webkit-search-decoration,.ith-table-search-input::-webkit-search-results-button,.ith-table-search-input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.ith-table-search-input:focus{outline:none;border-color:var(--_accent);box-shadow:0 0 0 3px var(--_focus);background:var(--_bg)}.ith-table-search-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:24px;height:24px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:var(--_muted);cursor:pointer;transition:background-color .12s ease,color .12s ease}.ith-table-search-clear svg{width:14px;height:14px}.ith-table-search-clear:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-scroll{position:relative;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--_scroll-thumb) transparent}.ith-table-scroll::-webkit-scrollbar{width:10px;height:10px}.ith-table-scroll::-webkit-scrollbar-track{background:transparent}.ith-table-scroll::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:999px;background-color:var(--_scroll-thumb);background-clip:content-box}.ith-table-scroll::-webkit-scrollbar-thumb:hover{background-color:color-mix(in srgb,var(--_scroll-thumb) 75%,var(--_text))}.ith-table-scroll:not(.ith-table-scroll-bounded){min-height:calc(var(--_head-height) + var(--_row-height) * var(--_min-rows, 4))}.ith-table-scroll:not(.ith-table-scroll-bounded).ith-table-scroll-filtered{min-height:calc(var(--_head-height) + var(--_filter-height) + var(--_row-height) * var(--_min-rows, 4))}.ith-table-grid{width:100%;border-collapse:separate;border-spacing:0;table-layout:auto}.ith-table-head-row th{background:var(--_header-bg);color:var(--_header-text);font-size:var(--_header-font-size);font-weight:600;letter-spacing:.01em;text-align:left;padding:13px 16px;white-space:nowrap;border:0}.ith-table-sticky .ith-table-head-row th{position:sticky;top:0;z-index:2}.ith-table-th-label{display:inline-block}.ith-table-sort{display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;cursor:pointer;text-align:inherit}.ith-table-sort-icons{display:inline-flex;flex-direction:column;gap:2px;opacity:.5}.ith-table-sort-icons svg{width:8px;height:5px;fill:currentColor;opacity:.5;transition:opacity .15s ease}.ith-table-sort-icons svg.is-active{opacity:1}.ith-table-sort.is-sorted .ith-table-sort-icons{opacity:1}.ith-table-select-cell{width:46px;text-align:center;padding-left:14px;padding-right:10px}.ith-table-checkbox{width:16px;height:16px;margin:0;cursor:pointer;accent-color:var(--_accent);vertical-align:middle}.ith-table-checkbox:focus-visible{outline:2px solid var(--_accent);outline-offset:2px}.ith-table-row{background:var(--_bg);transition:background-color .15s ease}.ith-table-hoverable .ith-table-row:hover{background:var(--_hover)}.ith-table-row.ith-table-row-selected{background:var(--_selected-bg)}.ith-table-row.ith-table-row-selected td:first-child{box-shadow:inset 3px 0 0 var(--_accent)}.ith-table-row-clickable{cursor:pointer}.ith-table-td{padding:var(--_cell-padding);border-bottom:1px solid var(--_border);font-size:var(--_font-size);color:var(--_text);vertical-align:middle;white-space:nowrap;background:transparent}.ith-table-row:last-child .ith-table-td{border-bottom:0}.ith-table-align-left{text-align:left}.ith-table-align-center{text-align:center}.ith-table-align-right,.ith-table-actions-head{text-align:right}.ith-table-actions-cell{padding:var(--_cell-padding);border-bottom:1px solid var(--_border);text-align:right;white-space:nowrap}.ith-table-row:last-child .ith-table-actions-cell{border-bottom:0}.ith-table-action{display:inline-flex;align-items:center;gap:4px;padding:5px 9px;margin-left:4px;border:1px solid var(--_border);border-radius:7px;background:transparent;color:var(--_accent);font-family:inherit;font-size:12px;font-weight:500;line-height:1.2;cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.ith-table-action:hover:not(:disabled){background:var(--_accent-soft);border-color:var(--_accent)}.ith-table-action:disabled{opacity:.45;cursor:not-allowed}.ith-table-action-icon{font-size:12px;line-height:1}.ith-table-action.is-danger{color:var(--_danger);border-color:color-mix(in srgb,var(--_danger) 35%,transparent)}.ith-table-filter-row th{background:var(--_filter-bg);padding:8px 10px;border-bottom:1px solid var(--_border);border-top:1px solid var(--_border)}.ith-table-filter-input{width:100%;box-sizing:border-box;height:30px;padding:0 9px;border:1px solid var(--_input-border);border-radius:7px;background:var(--_input-bg);color:var(--_text);font-family:inherit;font-size:12px}.ith-table-filter-select{cursor:pointer;padding-right:4px}.ith-table-filter-input:focus{outline:none;border-color:var(--_accent);box-shadow:0 0 0 3px var(--_focus)}.ith-table-filter-input::placeholder{color:var(--_muted)}.ith-table-status{padding:40px 16px;text-align:center;color:var(--_muted);font-size:13px}.ith-table-empty{display:flex;flex-direction:column;align-items:center;gap:8px}.ith-table-empty svg{width:36px;height:36px;opacity:.45}.ith-table-spinner{display:inline-block;width:16px;height:16px;border:2px solid var(--_accent-soft);border-top-color:var(--_accent);border-radius:50%;animation:ith-table-spin .7s linear infinite;vertical-align:middle}@keyframes ith-table-spin{to{transform:rotate(360deg)}}.ith-table-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--_overlay);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);color:var(--_text);font-size:13px;font-weight:500;z-index:3}.ith-table-link{padding:0;border:0;background:none;color:var(--_accent);font-family:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.ith-table-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 16px;border-top:1px solid var(--_border);background:var(--_footer-bg);font-size:12px;color:var(--_muted)}.ith-table-footer-info{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.ith-table-footer-info strong{color:var(--_text);font-weight:600}.ith-table-footer-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.ith-table-pagination{display:flex;align-items:center;gap:4px}.ith-table-page-btn{display:inline-grid;place-items:center;min-width:30px;height:30px;padding:0 6px;border:1px solid var(--_border);border-radius:7px;background:var(--_bg);color:var(--_text);font-family:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.ith-table-page-btn svg{width:14px;height:14px}.ith-table-page-btn:hover:not(:disabled){border-color:var(--_accent);color:var(--_accent);background:var(--_accent-soft)}.ith-table-page-btn:disabled{opacity:.4;cursor:not-allowed}.ith-table-page-number{min-width:30px}.ith-table-page-number.is-active{background:var(--_accent);border-color:var(--_accent);color:var(--_on-accent)}.ith-table-page-number.is-active:hover{background:var(--_accent);color:var(--_on-accent)}.ith-table-page-state{margin-left:6px;white-space:nowrap}.ith-table-page-size{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.ith-table-select{height:30px;padding:0 6px;border:1px solid var(--_border);border-radius:7px;background:var(--_bg);color:var(--_text);font-family:inherit;font-size:12px;cursor:pointer}.ith-table-select:focus-visible,.ith-table-page-btn:focus-visible,.ith-table-action:focus-visible,.ith-table-link:focus-visible{outline:2px solid var(--_accent);outline-offset:2px}.ith-table-dense{--ith-table-cell-padding: 8px 12px;--ith-table-font-size: 13px;--ith-table-header-font-size: 12px;--_cell-padding: 8px 12px;--_font-size: 13px;--_header-font-size: 12px;--_row-height: 39px;--_head-height: 38px}.ith-table-dense .ith-table-head-row th{padding:10px 12px}.ith-table-striped .ith-table-row:nth-child(2n){background:var(--_striped-bg)}.ith-table-bordered .ith-table-td,.ith-table-bordered .ith-table-actions-cell,.ith-table-bordered .ith-table-head-row th,.ith-table-bordered .ith-table-filter-row th{border-right:1px solid var(--_border)}.ith-table-bordered .ith-table-head-row th:last-child,.ith-table-bordered .ith-table-filter-row th:last-child{border-right:0}.ith-table-bordered .ith-table-td:last-child,.ith-table-bordered .ith-table-actions-cell:last-child{border-right:0}@media(prefers-reduced-motion:reduce){.ith-table-row,.ith-table-action,.ith-table-page-btn,.ith-table-search-input,.ith-table-sort-icons svg{transition:none}.ith-table-spinner{animation-duration:2.4s}}@media(max-width:640px){.ith-table-footer{align-items:stretch;flex-direction:column}.ith-table-toolbar-inner{gap:10px}.ith-table-search{flex:1 1 auto}.ith-table-footer-controls{justify-content:space-between}.ith-table-page-state{display:none}}.ith-table-toolbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;flex:0 0 auto}.ith-table-tool-btn{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 13px;border:1px solid var(--_input-border);border-radius:10px;background:var(--_input-bg);color:var(--_text);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;white-space:nowrap;transition:border-color .14s ease,background-color .14s ease,color .14s ease,box-shadow .14s ease}.ith-table-tool-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.ith-table-tool-btn:hover .ith-table-tool-icon,.ith-table-tool-btn[aria-expanded=true] .ith-table-tool-icon,.ith-table-tool-btn[aria-pressed=true] .ith-table-tool-icon{opacity:1}.ith-table-tool-btn:hover{border-color:color-mix(in srgb,var(--_accent) 45%,var(--_input-border));background:color-mix(in srgb,var(--_accent) 4%,var(--_input-bg));color:var(--_accent)}.ith-table-tool-btn[aria-expanded=true],.ith-table-tool-btn[aria-pressed=true]{border-color:var(--_accent);background:var(--_accent-soft);color:var(--_accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_accent) 20%,transparent)}.ith-table-tool-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--_focus)}.ith-table-menu-anchor{position:relative;display:inline-flex}.ith-table-segmented{display:inline-flex;align-items:center;gap:2px;height:36px;padding:3px;border:1px solid var(--_input-border);border-radius:10px;background:var(--_input-bg)}.ith-table-segmented-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:0;border-radius:7px;background:transparent;color:var(--_muted);font:inherit;font-size:12.5px;font-weight:600;white-space:nowrap;cursor:pointer;transition:background-color .12s ease,color .12s ease}.ith-table-segmented-btn svg{width:13px;height:13px}.ith-table-segmented-btn:hover{color:var(--_accent)}.ith-table-segmented-btn.is-active{background:var(--_accent-soft);color:var(--_accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_accent) 22%,transparent)}.ith-table-segmented-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--_focus)}.ith-table-popover{position:fixed;z-index:900;width:250px;max-height:380px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--_border);border-radius:12px;background:var(--_popover-bg);color:var(--_text);box-shadow:var(--_elevation);font-size:13px}.ith-table-popover-header{padding:10px 12px 8px;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--_muted)}.ith-table-popover-list{padding:0 6px 6px;overflow-y:auto;max-height:280px}.ith-table-popover-footer{display:flex;gap:6px;padding:6px;border-top:1px solid var(--_border);background:color-mix(in srgb,var(--_brand) 2%,var(--_bg))}.ith-table-popover-action{flex:1 1 auto;padding:7px 8px;border:0;border-radius:8px;background:transparent;color:var(--_accent);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}.ith-table-popover-action:hover{background:var(--_accent-soft)}.ith-table-popover-empty{margin:0;padding:10px 12px;color:var(--_muted);font-size:12.5px}.ith-table-columns-item{display:flex;align-items:center;gap:10px;padding:7px 8px;border-radius:8px;font-size:13px;cursor:pointer;transition:background-color .12s ease}.ith-table-columns-item:hover{background:var(--_hover)}.ith-table-columns-item input:disabled{opacity:.4;cursor:not-allowed}.ith-table-pin-tag{margin-left:auto;padding:1px 7px;border-radius:999px;background:var(--_accent-soft);color:var(--_accent);font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.ith-table-view-item{display:flex;align-items:center;gap:4px;padding-right:4px;border-radius:8px}.ith-table-view-item:hover{background:var(--_hover)}.ith-table-view-item.is-active .ith-table-view-apply{color:var(--_accent);font-weight:650}.ith-table-view-apply{flex:1 1 auto;padding:7px 8px;border:0;background:transparent;color:var(--_text);font:inherit;font-size:13px;text-align:left;cursor:pointer}.ith-table-view-delete{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--_muted);cursor:pointer}.ith-table-view-delete svg{width:11px;height:11px}.ith-table-view-delete:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-view-save{align-items:center}.ith-table-view-input{flex:1 1 auto;min-width:0;height:30px;padding:0 9px;border:1px solid var(--_input-border);border-radius:8px;background:var(--_input-bg);color:var(--_text);font:inherit;font-size:12.5px}.ith-table-view-input:focus{outline:none;border-color:var(--_accent);box-shadow:0 0 0 3px var(--_focus)}.ith-table-column-menu{width:220px;padding:6px}.ith-table-menu-item{display:block;width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:var(--_text);font:inherit;font-size:13px;text-align:left;cursor:pointer}.ith-table-menu-item:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-menu-divider{height:1px;margin:5px 6px;background:var(--_border)}.ith-table.ith-table-compact{--ith-table-cell-padding: 7px 12px;--_cell-padding: var(--ith-table-compact-padding, 7px 12px);--_font-size: var(--ith-table-compact-font-size, 13px);--_header-font-size: 12.5px;--_row-height: 39px;--_head-height: 39px}.ith-table.ith-table-compact .ith-table-head-row th{padding:10px 12px}.ith-table.ith-table-compact .ith-table-filter-row th{padding:6px 10px}.ith-table-sticky-start,.ith-table-sticky-end{position:sticky;z-index:3;background:var(--_bg)}.ith-table-sticky-start{box-shadow:inset -1px 0 0 var(--_border)}.ith-table-sticky-end{box-shadow:inset 1px 0 0 var(--_border)}.ith-table-striped .ith-table-row:nth-child(2n) .ith-table-sticky-start,.ith-table-striped .ith-table-row:nth-child(2n) .ith-table-sticky-end{background:var(--_striped-bg)}.ith-table-row-selected .ith-table-sticky-start,.ith-table-row-selected .ith-table-sticky-end{background:var(--_selected-bg)}.ith-table-row:hover .ith-table-sticky-start,.ith-table-row:hover .ith-table-sticky-end{background:var(--_hover)}thead .ith-table-sticky-start,thead .ith-table-sticky-end{z-index:7;background:var(--_header-bg)}.ith-table-filter-row .ith-table-sticky-start,.ith-table-filter-row .ith-table-sticky-end{z-index:6;background:var(--_filter-bg)}.ith-table-td:not(.ith-table-sticky-start):not(.ith-table-sticky-end){position:relative}.ith-table-td.ith-table-copyable{padding-inline-end:36px}.ith-table-copy{position:absolute;inset-inline-end:8px;top:50%;display:grid;place-items:center;width:24px;height:24px;padding:0;transform:translateY(-50%);border:1px solid transparent;border-radius:7px;background:var(--_bg);color:var(--_muted);cursor:pointer;opacity:0;pointer-events:none;transition:opacity .12s ease,color .12s ease,border-color .12s ease}.ith-table-copy svg{width:14px;height:14px}.ith-table-td:hover .ith-table-copy,.ith-table-td:focus-within .ith-table-copy,.ith-table-copy.is-copied{opacity:1;pointer-events:auto}.ith-table-copy:hover{border-color:var(--_accent);color:var(--_accent)}.ith-table-copy.is-copied{color:var(--_accent)}.ith-table-td:focus-visible{outline:2px solid var(--_accent);outline-offset:-2px}.ith-table-skeleton{display:block;width:72%;height:12px;border-radius:6px;background:linear-gradient(90deg,var(--_border) 25%,var(--_hover) 37%,var(--_border) 63%);background-size:400% 100%;animation:ith-table-shimmer 1.4s ease infinite}.ith-table-skeleton.is-check{width:16px;height:16px;border-radius:4px;margin:0 auto}@keyframes ith-table-shimmer{0%{background-position:100% 50%}to{background-position:0 50%}}.ith-table-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ith-table-menu{position:fixed;z-index:1000;min-width:180px;max-width:280px;padding:6px;border:1px solid var(--_border);border-radius:10px;background:var(--_popover-bg);color:var(--_text);box-shadow:var(--_elevation);font-size:13px}@media(prefers-reduced-motion:reduce){.ith-table-skeleton{animation:none}.ith-table-copy,.ith-table-tool-btn{transition:none}}.ith-table-th-inner{display:flex;align-items:center;gap:6px;min-width:0}.ith-table-th-inner>*:first-child{min-width:0}.ith-table-th:not(.ith-table-sticky-start):not(.ith-table-sticky-end){position:relative}.ith-table-th-menu{display:grid;place-items:center;flex:0 0 auto;width:20px;height:20px;padding:0;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer;opacity:0;transition:opacity .12s ease,background-color .12s ease}.ith-table-th-menu svg{width:13px;height:13px}.ith-table-th:hover .ith-table-th-menu,.ith-table-th-menu[aria-expanded=true],.ith-table-th-menu:focus-visible{opacity:.85}.ith-table-th-menu:hover{background:color-mix(in srgb,currentColor 20%,transparent);opacity:1}.ith-table-th-menu:focus-visible{outline:2px solid currentColor;outline-offset:1px}.ith-table-resizer{position:absolute;top:0;inset-inline-end:-4px;bottom:0;width:9px;z-index:4;cursor:col-resize;touch-action:none}.ith-table-resizer:after{content:\"\";position:absolute;top:22%;bottom:22%;inset-inline-start:4px;width:2px;border-radius:2px;background:transparent;transition:background-color .12s ease}.ith-table-th:hover .ith-table-resizer:after{background:color-mix(in srgb,currentColor 40%,transparent)}.ith-table-th-dragging{opacity:.5}.ith-table-drop-target{box-shadow:inset 3px 0 0 var(--_accent)}.ith-table-pin-dot{flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.55}.ith-table-sticky .ith-table-scroll.is-scrolled .ith-table-head-row th{box-shadow:0 1px 0 var(--_border),0 10px 16px -14px #0c0a1e8c}.ith-table-chips{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:10px}.ith-table-chip{display:inline-flex;align-items:center;gap:6px;max-width:260px;padding:3px 4px 3px 9px;border:1px solid color-mix(in srgb,var(--_accent) 24%,transparent);border-radius:999px;background:var(--_accent-soft);color:var(--_accent);font-size:11.5px;font-weight:600}.ith-table-chip-label{font-size:10px;letter-spacing:.04em;text-transform:uppercase;opacity:.7}.ith-table-chip-value{max-width:150px;overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.ith-table-chip-remove{display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:color-mix(in srgb,var(--_accent) 16%,transparent);color:inherit;cursor:pointer}.ith-table-chip-remove svg{width:9px;height:9px}.ith-table-chip-remove:hover{background:var(--_accent);color:var(--_on-accent)}.ith-table-chips-clear{padding:3px 8px;border:0;border-radius:999px;background:transparent;color:var(--_muted);font:inherit;font-size:11.5px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.ith-table-chips-clear:hover{color:var(--_accent)}.ith-table-selection-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 16px;border-bottom:1px solid color-mix(in srgb,var(--_accent) 28%,var(--_border));background:var(--_accent-soft);color:var(--_accent);font-size:12.5px}.ith-table-selection-count strong{font-weight:700}.ith-table-selection-spacer{flex:1 1 auto}.ith-table-selection-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.ith-table-selection-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:1px solid color-mix(in srgb,var(--_accent) 35%,transparent);border-radius:8px;background:var(--_bg);color:var(--_accent);font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .12s ease,color .12s ease}.ith-table-selection-btn:hover{background:var(--_accent);color:var(--_on-accent)}.ith-table-selection-btn.is-danger{border-color:color-mix(in srgb,var(--_danger) 40%,transparent);color:var(--_danger)}.ith-table-selection-btn.is-danger:hover{background:var(--_danger);color:#fff}.ith-table-selection-clear{border:0;background:transparent;color:var(--_muted);font:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.ith-table-selection-clear:hover{color:var(--_accent)}.ith-table-expander-cell{width:38px;padding:0 0 0 10px;text-align:center}th.ith-table-expander-cell{background:var(--_header-bg)}.ith-table-expander{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--_muted);cursor:pointer;transition:transform .15s ease,color .12s ease,background-color .12s ease}.ith-table-expander svg{width:13px;height:13px}.ith-table-expander:hover{background:var(--_accent-soft);color:var(--_accent)}.ith-table-expander.is-open{transform:rotate(90deg);color:var(--_accent)}.ith-table-detail-row>td{padding:14px 16px;border-bottom:1px solid var(--_border);background:var(--_striped-bg);white-space:normal}.ith-table-total-cell{padding:var(--_cell-padding);border-top:1px solid var(--_border);background:var(--_filter-bg);font-size:12px;white-space:nowrap}.ith-table-total-row .ith-table-select-cell,.ith-table-total-row .ith-table-expander-cell{border-top:1px solid var(--_border);background:var(--_filter-bg)}.ith-table-total-label{margin-inline-end:6px;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--_muted)}.ith-table-total-value{font-weight:650;color:var(--_text)}@media(prefers-reduced-motion:reduce){.ith-table-expander,.ith-table-th-menu,.ith-table-selection-btn{transition:none}}.ith-table-export-menu{width:236px;padding:6px}.ith-table-export-name{display:block;font-weight:650}.ith-table-export-hint{display:block;margin-top:2px;font-size:11px;font-weight:500;color:var(--_muted)}.ith-table-menu-item:hover .ith-table-export-hint{color:inherit;opacity:.75}:host-context([data-theme=\"dark\"]) .ith-table,:host-context(.dark) .ith-table{box-shadow:var(--_shadow),inset 0 0 0 1px color-mix(in srgb,#ffffff 6%,transparent)}@media(prefers-color-scheme:dark){:host-context([data-theme=\"auto\"]) .ith-table{box-shadow:var(--_shadow),inset 0 0 0 1px color-mix(in srgb,#ffffff 6%,transparent)}}:host-context([data-theme=\"dark\"]) .ith-table-td,:host-context(.dark) .ith-table-td,:host-context([data-theme=\"dark\"]) .ith-table-actions-cell,:host-context(.dark) .ith-table-actions-cell{border-color:color-mix(in srgb,var(--_border) 78%,#ffffff)}:host-context([data-theme=\"dark\"]) .ith-table-row.ith-table-row-selected td:first-child,:host-context(.dark) .ith-table-row.ith-table-row-selected td:first-child{box-shadow:inset 3px 0 0 var(--_accent)}:host-context([data-theme=\"dark\"]) .ith-table-sort-icons,:host-context(.dark) .ith-table-sort-icons{opacity:.65}\n"] }]
1959
+ }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], keyField: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyField", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], countSuffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "countSuffix", required: false }] }], totalLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalLabel", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], filterAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterAllLabel", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], sort: [{ type: i0.Input, args: [{ isSignal: true, alias: "sort", required: false }] }, { type: i0.Output, args: ["sortChange"] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPagination", required: false }] }], showPageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSize", required: false }] }], showFirstLast: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLast", required: false }] }], maxPageButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxPageButtons", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], showFilterChips: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilterChips", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selectAllScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllScope", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], selectOnRowClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnRowClick", required: false }] }], selectionActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionActions", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], actionsHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsHeader", required: false }] }], actionsWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsWidth", required: false }] }], rowClickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClickable", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingText", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], hoverable: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverable", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], dense: [{ type: i0.Input, args: [{ isSignal: true, alias: "dense", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], copyable: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyable", required: false }] }], showColumnPicker: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnPicker", required: false }] }], showDensityToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDensityToggle", required: false }] }], showColumnMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnMenu", required: false }] }], showExport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExport", required: false }] }], exportFileName: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFileName", required: false }] }], showViews: [{ type: i0.Input, args: [{ isSignal: true, alias: "showViews", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], reorderable: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderable", required: false }] }], keyboardNavigation: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboardNavigation", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], minRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRows", required: false }] }], stickySelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickySelection", required: false }] }], stickyActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyActions", required: false }] }], rowDetailTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowDetailTrigger", required: false }] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], cellCopy: [{ type: i0.Output, args: ["cellCopy"] }], rowContextMenu: [{ type: i0.Output, args: ["rowContextMenu"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }], densityChange: [{ type: i0.Output, args: ["densityChange"] }], columnStateChange: [{ type: i0.Output, args: ["columnStateChange"] }], selectionAction: [{ type: i0.Output, args: ["selectionAction"] }], csvExport: [{ type: i0.Output, args: ["csvExport"] }], exportFile: [{ type: i0.Output, args: ["exportFile"] }], cellDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableCellDirective), { ...{ descendants: true }, isSignal: true }] }], headerDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableHeaderDirective), { ...{ descendants: true }, isSignal: true }] }], filterDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableFilterDirective), { ...{ descendants: true }, isSignal: true }] }], rowActionsDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableRowActionsDirective), { ...{
1960
+ descendants: true,
1961
+ }, isSignal: true }] }], toolbarDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableToolbarDirective), { ...{ descendants: true }, isSignal: true }] }], footerDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableFooterDirective), { ...{ descendants: true }, isSignal: true }] }], emptyDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableEmptyDirective), { ...{ descendants: true }, isSignal: true }] }], rowMenuDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableRowMenuDirective), { ...{
1962
+ descendants: true,
1963
+ }, isSignal: true }] }], rowDetailDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TableRowDetailDirective), { ...{
1964
+ descendants: true,
1965
+ }, isSignal: true }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], onDocumentPointerMove: [{
1966
+ type: HostListener,
1967
+ args: ['document:pointermove', ['$event']]
1968
+ }], onDocumentPointerUp: [{
1969
+ type: HostListener,
1970
+ args: ['document:pointerup']
1971
+ }], onDocumentClick: [{
1972
+ type: HostListener,
1973
+ args: ['document:click']
1974
+ }], onDocumentEscape: [{
1975
+ type: HostListener,
1976
+ args: ['document:keydown.escape']
1977
+ }] } });
1978
+
1979
+ /**
1980
+ * Public models for `<ith-table>`.
1981
+ */
1982
+
1983
+ /**
1984
+ * Generated bundle index. Do not edit.
1985
+ */
1986
+
1987
+ export { TableCellDirective, TableComponent, TableEmptyDirective, TableFilterDirective, TableFooterDirective, TableHeaderDirective, TableRowActionsDirective, TableRowDetailDirective, TableRowMenuDirective, TableToolbarDirective, buildPageWindow, buildXlsxBlob, compareWithDirection, defaultCompare, getPathValue, isInteractiveTarget, toDisplay };
1988
+ //# sourceMappingURL=ithouse-bd-ngx-table.mjs.map