@ithouse-bd/ngx-table 0.0.0-stage → 1.0.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,1016 @@
1
+ import { NgClass, NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, Directive, model, output, contentChildren, computed, signal, effect, untracked, 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
+ /** Read a dot-path value (`'a.b.c'`) from an object; `undefined` when a link is missing. */
131
+ function getPathValue(source, path) {
132
+ if (!path)
133
+ return undefined;
134
+ return path.split('.').reduce((value, part) => {
135
+ if (value === null || value === undefined)
136
+ return undefined;
137
+ return value[part];
138
+ }, source);
139
+ }
140
+ /** Human readable text for a cell value. */
141
+ function toDisplay(value) {
142
+ if (value === null || value === undefined)
143
+ return '';
144
+ if (value instanceof Date)
145
+ return value.toLocaleDateString();
146
+ if (typeof value === 'boolean')
147
+ return value ? 'Yes' : 'No';
148
+ if (typeof value === 'object')
149
+ return JSON.stringify(value);
150
+ return String(value);
151
+ }
152
+ /** Locale-aware, numeric-friendly comparison used by default sorting. */
153
+ function defaultCompare(a, b) {
154
+ if (a === b)
155
+ return 0;
156
+ if (a === null || a === undefined)
157
+ return -1;
158
+ if (b === null || b === undefined)
159
+ return 1;
160
+ if (typeof a === 'number' && typeof b === 'number')
161
+ return a - b;
162
+ if (typeof a === 'boolean' && typeof b === 'boolean')
163
+ return Number(a) - Number(b);
164
+ if (a instanceof Date && b instanceof Date)
165
+ return a.getTime() - b.getTime();
166
+ return String(a).localeCompare(String(b), undefined, { numeric: true, sensitivity: 'base' });
167
+ }
168
+ /** Sort a value ignoring the direction sign. */
169
+ function compareWithDirection(result, direction) {
170
+ return direction === 'asc' ? result : -result;
171
+ }
172
+ /**
173
+ * Page numbers to render, centred on `current`. First/last/prev/next buttons are
174
+ * separate controls, so no ellipsis is needed.
175
+ */
176
+ function buildPageWindow(current, pageCount, maxButtons = 5) {
177
+ if (pageCount <= 0)
178
+ return [];
179
+ const size = Math.max(1, Math.floor(maxButtons) || 1);
180
+ if (pageCount <= size) {
181
+ return Array.from({ length: pageCount }, (_, index) => index + 1);
182
+ }
183
+ const half = Math.floor(size / 2);
184
+ const start = Math.max(1, Math.min(current - half, pageCount - size + 1));
185
+ return Array.from({ length: size }, (_, index) => start + index);
186
+ }
187
+ /** `true` when the event target is a text field, so row-selection should be skipped. */
188
+ function isInteractiveTarget(target) {
189
+ if (!(target instanceof HTMLElement))
190
+ return false;
191
+ return !!target.closest('input, textarea, select, button, a, [contenteditable="true"], [role="button"]');
192
+ }
193
+
194
+ let tableIdCounter = 0;
195
+ /**
196
+ * Generic, standalone data table.
197
+ *
198
+ * ```html
199
+ * <ith-table
200
+ * title="Student List"
201
+ * [data]="students"
202
+ * [columns]="columns"
203
+ * selectionMode="multi"
204
+ * [pageSize]="10">
205
+ * </ith-table>
206
+ * ```
207
+ */
208
+ class TableComponent {
209
+ /** Unique prefix for generated DOM ids. */
210
+ idBase = `ith-table-${tableIdCounter++}`;
211
+ /* ---------------------------------------------------------------- */
212
+ /* Data */
213
+ /* ---------------------------------------------------------------- */
214
+ /** Rows to render. In `server` mode this is the current page. */
215
+ data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
216
+ columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
217
+ /** Look up a unique key on each row (dot-path allowed). */
218
+ keyField = input('id', ...(ngDevMode ? [{ debugName: "keyField" }] : []));
219
+ /** `client` sorts/searches/pages the array locally; `server` emits events instead. */
220
+ mode = input('client', ...(ngDevMode ? [{ debugName: "mode" }] : []));
221
+ /** Total row count for `server` mode (defaults to `data().length`). */
222
+ total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : []));
223
+ /* ---------------------------------------------------------------- */
224
+ /* Toolbar / labels */
225
+ /* ---------------------------------------------------------------- */
226
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
227
+ countSuffix = input('items', ...(ngDevMode ? [{ debugName: "countSuffix" }] : []));
228
+ totalLabel = input('Total Found', ...(ngDevMode ? [{ debugName: "totalLabel" }] : []));
229
+ showToolbar = input(true, ...(ngDevMode ? [{ debugName: "showToolbar" }] : []));
230
+ searchable = input(true, ...(ngDevMode ? [{ debugName: "searchable" }] : []));
231
+ searchPlaceholder = input('Search…', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
232
+ showFilters = input(false, ...(ngDevMode ? [{ debugName: "showFilters" }] : []));
233
+ filterPlaceholder = input('Filter…', ...(ngDevMode ? [{ debugName: "filterPlaceholder" }] : []));
234
+ /** Label of the empty option in `select` filters. */
235
+ filterAllLabel = input('All', ...(ngDevMode ? [{ debugName: "filterAllLabel" }] : []));
236
+ emptyText = input('No records found', ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
237
+ /** Accessible name of the table. */
238
+ ariaLabel = input('Data table', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
239
+ /* ---------------------------------------------------------------- */
240
+ /* Sorting */
241
+ /* ---------------------------------------------------------------- */
242
+ /** Active sort, two-way bindable. `null` means unsorted. */
243
+ sort = model(null, ...(ngDevMode ? [{ debugName: "sort" }] : []));
244
+ /** Table-wide sort switch; individual columns can opt out with `sortable: false`. */
245
+ sortable = input(true, ...(ngDevMode ? [{ debugName: "sortable" }] : []));
246
+ /* ---------------------------------------------------------------- */
247
+ /* Search / filters / pagination */
248
+ /* ---------------------------------------------------------------- */
249
+ /** Global search term, two-way bindable. Also emitted as `searchChange`. */
250
+ search = model('', ...(ngDevMode ? [{ debugName: "search" }] : []));
251
+ /** Emitted whenever a per-column filter changes. */
252
+ filterChange = output();
253
+ page = model(1, ...(ngDevMode ? [{ debugName: "page" }] : []));
254
+ pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
255
+ pageSizeOptions = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
256
+ showPagination = input(true, ...(ngDevMode ? [{ debugName: "showPagination" }] : []));
257
+ showPageSize = input(true, ...(ngDevMode ? [{ debugName: "showPageSize" }] : []));
258
+ showFirstLast = input(true, ...(ngDevMode ? [{ debugName: "showFirstLast" }] : []));
259
+ /** How many numbered page buttons are rendered. */
260
+ maxPageButtons = input(5, ...(ngDevMode ? [{ debugName: "maxPageButtons" }] : []));
261
+ showFooter = input(true, ...(ngDevMode ? [{ debugName: "showFooter" }] : []));
262
+ /* ---------------------------------------------------------------- */
263
+ /* Selection */
264
+ /* ---------------------------------------------------------------- */
265
+ selectionMode = input('none', ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
266
+ selectAllScope = input('page', ...(ngDevMode ? [{ debugName: "selectAllScope" }] : []));
267
+ /** Selected rows, two-way bindable. */
268
+ selected = model([], ...(ngDevMode ? [{ debugName: "selected" }] : []));
269
+ /** Selecting a row by clicking anywhere on it (not only the checkbox). */
270
+ selectOnRowClick = input(false, ...(ngDevMode ? [{ debugName: "selectOnRowClick" }] : []));
271
+ /* ---------------------------------------------------------------- */
272
+ /* Row actions / presentation */
273
+ /* ---------------------------------------------------------------- */
274
+ rowActions = input([], ...(ngDevMode ? [{ debugName: "rowActions" }] : []));
275
+ actionsHeader = input('Actions', ...(ngDevMode ? [{ debugName: "actionsHeader" }] : []));
276
+ actionsWidth = input('120px', ...(ngDevMode ? [{ debugName: "actionsWidth" }] : []));
277
+ rowClickable = input(false, ...(ngDevMode ? [{ debugName: "rowClickable" }] : []));
278
+ rowClass = input(...(ngDevMode ? [undefined, { debugName: "rowClass" }] : []));
279
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
280
+ loadingText = input('Loading…', ...(ngDevMode ? [{ debugName: "loadingText" }] : []));
281
+ striped = input(false, ...(ngDevMode ? [{ debugName: "striped" }] : []));
282
+ hoverable = input(true, ...(ngDevMode ? [{ debugName: "hoverable" }] : []));
283
+ bordered = input(false, ...(ngDevMode ? [{ debugName: "bordered" }] : []));
284
+ dense = input(false, ...(ngDevMode ? [{ debugName: "dense" }] : []));
285
+ stickyHeader = input(false, ...(ngDevMode ? [{ debugName: "stickyHeader" }] : []));
286
+ /** CSS max-height of the scroll container, e.g. `'480px'`. */
287
+ maxHeight = input('', ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
288
+ /* ---------------------------------------------------------------- */
289
+ /* Copy / context menu / column presets */
290
+ /* ---------------------------------------------------------------- */
291
+ /** Show a copy button on hover and enable Ctrl/Cmd+C on a focused cell. */
292
+ copyable = input(false, ...(ngDevMode ? [{ debugName: "copyable" }] : []));
293
+ /** Show the toolbar "Columns" popover (visibility switching). */
294
+ showColumnPicker = input(false, ...(ngDevMode ? [{ debugName: "showColumnPicker" }] : []));
295
+ /** Show the comfortable/compact density toggle in the toolbar. */
296
+ showDensityToggle = input(false, ...(ngDevMode ? [{ debugName: "showDensityToggle" }] : []));
297
+ /**
298
+ * localStorage key for the saved column/density preset. When set, the user's
299
+ * choice is restored on the next visit.
300
+ */
301
+ storageKey = input('', ...(ngDevMode ? [{ debugName: "storageKey" }] : []));
302
+ /** Number of placeholder rows rendered while `loading` and there are no rows. */
303
+ skeletonRows = input(6, ...(ngDevMode ? [{ debugName: "skeletonRows" }] : []));
304
+ /** Stick the checkbox column to the start edge. */
305
+ stickySelection = input(false, ...(ngDevMode ? [{ debugName: "stickySelection" }] : []));
306
+ /** Stick the actions column to the end edge. */
307
+ stickyActions = input(false, ...(ngDevMode ? [{ debugName: "stickyActions" }] : []));
308
+ /* ---------------------------------------------------------------- */
309
+ /* Events */
310
+ /* ---------------------------------------------------------------- */
311
+ actionClick = output();
312
+ rowClick = output();
313
+ /** Emitted after a cell or row was copied to the clipboard. */
314
+ cellCopy = output();
315
+ /** Emitted on right-click / context-menu key; the menu is positioned at the pointer. */
316
+ rowContextMenu = output();
317
+ /** Visible column keys, emitted whenever the user changes column visibility. */
318
+ columnsChange = output();
319
+ densityChange = output();
320
+ /* ---------------------------------------------------------------- */
321
+ /* Custom templates */
322
+ /* ---------------------------------------------------------------- */
323
+ cellDirectives = contentChildren(TableCellDirective, ...(ngDevMode ? [{ debugName: "cellDirectives", descendants: true }] : [{ descendants: true }]));
324
+ headerDirectives = contentChildren(TableHeaderDirective, ...(ngDevMode ? [{ debugName: "headerDirectives", descendants: true }] : [{ descendants: true }]));
325
+ filterDirectives = contentChildren(TableFilterDirective, ...(ngDevMode ? [{ debugName: "filterDirectives", descendants: true }] : [{ descendants: true }]));
326
+ rowActionsDirectives = contentChildren(TableRowActionsDirective, ...(ngDevMode ? [{ debugName: "rowActionsDirectives", descendants: true }] : [{
327
+ descendants: true,
328
+ }]));
329
+ toolbarDirectives = contentChildren(TableToolbarDirective, ...(ngDevMode ? [{ debugName: "toolbarDirectives", descendants: true }] : [{ descendants: true }]));
330
+ footerDirectives = contentChildren(TableFooterDirective, ...(ngDevMode ? [{ debugName: "footerDirectives", descendants: true }] : [{ descendants: true }]));
331
+ emptyDirectives = contentChildren(TableEmptyDirective, ...(ngDevMode ? [{ debugName: "emptyDirectives", descendants: true }] : [{ descendants: true }]));
332
+ rowMenuDirectives = contentChildren(TableRowMenuDirective, ...(ngDevMode ? [{ debugName: "rowMenuDirectives", descendants: true }] : [{
333
+ descendants: true,
334
+ }]));
335
+ cellTemplates = computed(() => {
336
+ const templates = new Map();
337
+ for (const directive of this.cellDirectives()) {
338
+ templates.set(directive.columnKey(), directive.template);
339
+ }
340
+ return templates;
341
+ }, ...(ngDevMode ? [{ debugName: "cellTemplates" }] : []));
342
+ headerTemplates = computed(() => {
343
+ const templates = new Map();
344
+ for (const directive of this.headerDirectives()) {
345
+ templates.set(directive.columnKey(), directive.template);
346
+ }
347
+ return templates;
348
+ }, ...(ngDevMode ? [{ debugName: "headerTemplates" }] : []));
349
+ filterTemplates = computed(() => {
350
+ const templates = new Map();
351
+ for (const directive of this.filterDirectives()) {
352
+ templates.set(directive.columnKey(), directive.template);
353
+ }
354
+ return templates;
355
+ }, ...(ngDevMode ? [{ debugName: "filterTemplates" }] : []));
356
+ rowActionsTemplate = computed(() => this.rowActionsDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "rowActionsTemplate" }] : []));
357
+ toolbarTemplate = computed(() => this.toolbarDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "toolbarTemplate" }] : []));
358
+ footerTemplate = computed(() => this.footerDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
359
+ emptyTemplate = computed(() => this.emptyDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : []));
360
+ rowMenuTemplate = computed(() => this.rowMenuDirectives()[0]?.template, ...(ngDevMode ? [{ debugName: "rowMenuTemplate" }] : []));
361
+ /* ---------------------------------------------------------------- */
362
+ /* Internal state */
363
+ /* ---------------------------------------------------------------- */
364
+ filters = model({}, ...(ngDevMode ? [{ debugName: "filters" }] : []));
365
+ skipInitialReset = true;
366
+ /** Columns hidden at runtime (on top of `column.hidden`), persisted via `storageKey`. */
367
+ hiddenColumnKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "hiddenColumnKeys" }] : []));
368
+ density = signal('comfortable', ...(ngDevMode ? [{ debugName: "density" }] : []));
369
+ compact = computed(() => this.dense() || this.density() === 'compact', ...(ngDevMode ? [{ debugName: "compact" }] : []));
370
+ columnPickerOpen = signal(false, ...(ngDevMode ? [{ debugName: "columnPickerOpen" }] : []));
371
+ /** Right-click menu position; `null` when closed. */
372
+ menuState = signal(null, ...(ngDevMode ? [{ debugName: "menuState" }] : []));
373
+ /** `${rowIndex}:${columnKey}` of the cell that was just copied (shows a check icon). */
374
+ copiedCell = signal(null, ...(ngDevMode ? [{ debugName: "copiedCell" }] : []));
375
+ skeletonIndexes = computed(() => Array.from({ length: Math.max(0, this.skeletonRows()) }, (_, index) => index), ...(ngDevMode ? [{ debugName: "skeletonIndexes" }] : []));
376
+ copyTimer;
377
+ constructor() {
378
+ this.restorePreset();
379
+ // Persist the preset whenever the user changes it.
380
+ effect(() => {
381
+ const preset = { hidden: [...this.hiddenColumnKeys()], density: this.density() };
382
+ untracked(() => this.persistPreset(preset));
383
+ });
384
+ // In client mode any change to the query starts again from the first page. In server
385
+ // mode the consumer owns the page (and fetches on every `pageChange`), so resetting
386
+ // here would fire a second request for the same query change.
387
+ effect(() => {
388
+ this.search();
389
+ this.filters();
390
+ this.pageSize();
391
+ this.sort();
392
+ if (this.skipInitialReset) {
393
+ this.skipInitialReset = false;
394
+ return;
395
+ }
396
+ if (this.isServer())
397
+ return;
398
+ untracked(() => this.page.set(1));
399
+ });
400
+ // Keep the page inside the available range.
401
+ effect(() => {
402
+ const lastPage = this.pageCount();
403
+ const current = this.page();
404
+ if (current > lastPage)
405
+ untracked(() => this.page.set(lastPage));
406
+ else if (current < 1)
407
+ untracked(() => this.page.set(1));
408
+ });
409
+ }
410
+ /* ---------------------------------------------------------------- */
411
+ /* Derived data */
412
+ /* ---------------------------------------------------------------- */
413
+ isServer = computed(() => this.mode() === 'server', ...(ngDevMode ? [{ debugName: "isServer" }] : []));
414
+ visibleColumns = computed(() => {
415
+ const hidden = this.hiddenColumnKeys();
416
+ return this.columns().filter((column) => !column.hidden && !hidden.has(column.key));
417
+ }, ...(ngDevMode ? [{ debugName: "visibleColumns" }] : []));
418
+ selectable = computed(() => this.selectionMode() !== 'none', ...(ngDevMode ? [{ debugName: "selectable" }] : []));
419
+ hasActionsColumn = computed(() => this.rowActions().length > 0 || !!this.rowActionsTemplate(), ...(ngDevMode ? [{ debugName: "hasActionsColumn" }] : []));
420
+ /** Rows that match the global search and the per-column filters (client mode). */
421
+ matchingRows = computed(() => {
422
+ const rows = this.data();
423
+ if (this.isServer())
424
+ return rows;
425
+ const term = this.search().trim().toLowerCase();
426
+ const activeFilters = Object.entries(this.filters()).filter(([, value]) => value.trim() !== '');
427
+ let result = rows;
428
+ if (term) {
429
+ const searchColumns = this.visibleColumns().filter((column) => column.searchable !== false);
430
+ result = result.filter((row) => searchColumns.some((column) => this.searchText(row, column).includes(term)));
431
+ }
432
+ if (activeFilters.length) {
433
+ const columns = this.visibleColumns();
434
+ result = result.filter((row) => activeFilters.every(([key, value]) => {
435
+ const column = columns.find((candidate) => candidate.key === key);
436
+ if (!column)
437
+ return true;
438
+ return this.columnMatchesFilter(row, column, value);
439
+ }));
440
+ }
441
+ return result;
442
+ }, ...(ngDevMode ? [{ debugName: "matchingRows" }] : []));
443
+ /** Matching rows in the active sort order (client mode). */
444
+ sortedRows = computed(() => {
445
+ const rows = this.matchingRows();
446
+ if (this.isServer())
447
+ return rows;
448
+ const sort = this.sort();
449
+ if (!sort)
450
+ return rows;
451
+ const column = this.columns().find((candidate) => candidate.key === sort.key);
452
+ if (!column)
453
+ return rows;
454
+ const direction = sort.direction;
455
+ return [...rows].sort((a, b) => compareWithDirection(this.compareRows(a, b, column), direction));
456
+ }, ...(ngDevMode ? [{ debugName: "sortedRows" }] : []));
457
+ totalRows = computed(() => this.isServer() ? this.total() || this.data().length : this.sortedRows().length, ...(ngDevMode ? [{ debugName: "totalRows" }] : []));
458
+ pageCount = computed(() => Math.max(1, Math.ceil(this.totalRows() / Math.max(1, this.pageSize()))), ...(ngDevMode ? [{ debugName: "pageCount" }] : []));
459
+ /** Rows of the current page. */
460
+ pagedRows = computed(() => {
461
+ if (this.isServer())
462
+ return this.data();
463
+ const size = Math.max(1, this.pageSize());
464
+ const start = (this.page() - 1) * size;
465
+ return this.sortedRows().slice(start, start + size);
466
+ }, ...(ngDevMode ? [{ debugName: "pagedRows" }] : []));
467
+ pageItems = computed(() => buildPageWindow(this.page(), this.pageCount(), this.maxPageButtons()), ...(ngDevMode ? [{ debugName: "pageItems" }] : []));
468
+ rangeStart = computed(() => this.totalRows() === 0 ? 0 : (this.page() - 1) * this.pageSize() + 1, ...(ngDevMode ? [{ debugName: "rangeStart" }] : []));
469
+ rangeEnd = computed(() => Math.min(this.page() * this.pageSize(), this.totalRows()), ...(ngDevMode ? [{ debugName: "rangeEnd" }] : []));
470
+ pageSizeChoices = computed(() => [...new Set([...this.pageSizeOptions(), this.pageSize()])].sort((a, b) => a - b), ...(ngDevMode ? [{ debugName: "pageSizeChoices" }] : []));
471
+ selectedKeySet = computed(() => new Set(this.selected().map((row) => this.rowKey(row))), ...(ngDevMode ? [{ debugName: "selectedKeySet" }] : []));
472
+ allPageSelected = computed(() => {
473
+ const rows = this.pagedRows();
474
+ return rows.length > 0 && rows.every((row) => this.selectedKeySet().has(this.rowKey(row)));
475
+ }, ...(ngDevMode ? [{ debugName: "allPageSelected" }] : []));
476
+ somePageSelected = computed(() => !this.allPageSelected() &&
477
+ this.pagedRows().some((row) => this.selectedKeySet().has(this.rowKey(row))), ...(ngDevMode ? [{ debugName: "somePageSelected" }] : []));
478
+ emptyColspan = computed(() => Math.max(1, this.visibleColumns().length + (this.selectable() ? 1 : 0) + (this.hasActionsColumn() ? 1 : 0)), ...(ngDevMode ? [{ debugName: "emptyColspan" }] : []));
479
+ hasQuery = computed(() => this.search().trim() !== '' ||
480
+ Object.values(this.filters()).some((value) => value.trim() !== ''), ...(ngDevMode ? [{ debugName: "hasQuery" }] : []));
481
+ /* ---------------------------------------------------------------- */
482
+ /* Sorting API */
483
+ /* ---------------------------------------------------------------- */
484
+ isSortable(column) {
485
+ return this.sortable() && column.sortable !== false;
486
+ }
487
+ ariaSort(column) {
488
+ const sort = this.sort();
489
+ if (!sort || sort.key !== column.key)
490
+ return 'none';
491
+ return sort.direction === 'asc' ? 'ascending' : 'descending';
492
+ }
493
+ sortDirection(column) {
494
+ const sort = this.sort();
495
+ return sort && sort.key === column.key ? sort.direction : null;
496
+ }
497
+ /** Cycles `asc` → `desc` → unsorted. */
498
+ toggleSort(column) {
499
+ if (!this.isSortable(column))
500
+ return;
501
+ const current = this.sort();
502
+ if (!current || current.key !== column.key) {
503
+ this.sort.set({ key: column.key, direction: 'asc' });
504
+ }
505
+ else if (current.direction === 'asc') {
506
+ this.sort.set({ key: column.key, direction: 'desc' });
507
+ }
508
+ else {
509
+ this.sort.set(null);
510
+ }
511
+ }
512
+ /* ---------------------------------------------------------------- */
513
+ /* Search / filter API */
514
+ /* ---------------------------------------------------------------- */
515
+ onSearchInput(value) {
516
+ this.search.set(value);
517
+ }
518
+ clearSearch() {
519
+ this.search.set('');
520
+ }
521
+ onFilterInput(key, value) {
522
+ const next = { ...this.filters(), [key]: value };
523
+ this.filters.set(next);
524
+ this.filterChange.emit(next);
525
+ }
526
+ filterValue(key) {
527
+ return this.filters()[key] ?? '';
528
+ }
529
+ /** Control rendered in the filter row for this column. */
530
+ filterTypeFor(column) {
531
+ return column.filterType ?? 'text';
532
+ }
533
+ filterOptionsFor(column) {
534
+ return column.filterOptions ?? [];
535
+ }
536
+ filterPlaceholderFor(column) {
537
+ return column.filterPlaceholder ?? this.filterPlaceholder();
538
+ }
539
+ filterTemplate(column) {
540
+ return this.filterTemplates().get(column.key);
541
+ }
542
+ /** Context handed to a custom `#ithTableFilter` template. */
543
+ filterContext(column) {
544
+ const value = this.filterValue(column.key);
545
+ return {
546
+ $implicit: value,
547
+ value,
548
+ column,
549
+ setValue: (next) => this.onFilterInput(column.key, next),
550
+ };
551
+ }
552
+ clearFilters() {
553
+ this.filters.set({});
554
+ this.filterChange.emit({});
555
+ }
556
+ clearQuery() {
557
+ this.search.set('');
558
+ this.clearFilters();
559
+ }
560
+ /* ---------------------------------------------------------------- */
561
+ /* Pagination API */
562
+ /* ---------------------------------------------------------------- */
563
+ goToPage(page) {
564
+ const next = Math.min(Math.max(1, Math.floor(page) || 1), this.pageCount());
565
+ if (next !== this.page())
566
+ this.page.set(next);
567
+ }
568
+ nextPage() {
569
+ this.goToPage(this.page() + 1);
570
+ }
571
+ previousPage() {
572
+ this.goToPage(this.page() - 1);
573
+ }
574
+ firstPage() {
575
+ this.goToPage(1);
576
+ }
577
+ lastPage() {
578
+ this.goToPage(this.pageCount());
579
+ }
580
+ onPageSizeChange(value) {
581
+ const size = Number(value);
582
+ if (!Number.isFinite(size) || size < 1)
583
+ return;
584
+ this.pageSize.set(size);
585
+ }
586
+ /* ---------------------------------------------------------------- */
587
+ /* Selection API */
588
+ /* ---------------------------------------------------------------- */
589
+ rowKey(row) {
590
+ const key = this.keyField();
591
+ const value = key ? getPathValue(row, key) : undefined;
592
+ return value === undefined || value === null ? row : value;
593
+ }
594
+ isSelected(row) {
595
+ return this.selectedKeySet().has(this.rowKey(row));
596
+ }
597
+ toggleRow(row, checked) {
598
+ if (!this.selectable())
599
+ return;
600
+ if (this.selectionMode() === 'single') {
601
+ this.selected.set(checked ? [row] : []);
602
+ return;
603
+ }
604
+ const key = this.rowKey(row);
605
+ if (checked) {
606
+ if (!this.selectedKeySet().has(key))
607
+ this.selected.set([...this.selected(), row]);
608
+ }
609
+ else {
610
+ this.selected.set(this.selected().filter((candidate) => this.rowKey(candidate) !== key));
611
+ }
612
+ }
613
+ onRowCheckboxChange(row, event) {
614
+ this.toggleRow(row, event.target.checked);
615
+ }
616
+ toggleAll(checked) {
617
+ if (!this.selectable())
618
+ return;
619
+ const candidates = this.selectAllScope() === 'all'
620
+ ? this.isServer()
621
+ ? this.data()
622
+ : this.sortedRows()
623
+ : this.pagedRows();
624
+ if (this.selectionMode() === 'single') {
625
+ this.selected.set(checked ? candidates.slice(0, 1) : []);
626
+ return;
627
+ }
628
+ const selection = new Map(this.selected().map((row) => [this.rowKey(row), row]));
629
+ for (const row of candidates) {
630
+ if (checked)
631
+ selection.set(this.rowKey(row), row);
632
+ else
633
+ selection.delete(this.rowKey(row));
634
+ }
635
+ this.selected.set([...selection.values()]);
636
+ }
637
+ onSelectAllChange(event) {
638
+ this.toggleAll(event.target.checked);
639
+ }
640
+ clearSelection() {
641
+ this.selected.set([]);
642
+ }
643
+ selectRow(row) {
644
+ this.toggleRow(row, true);
645
+ }
646
+ deselectRow(row) {
647
+ this.toggleRow(row, false);
648
+ }
649
+ /* ---------------------------------------------------------------- */
650
+ /* Row actions */
651
+ /* ---------------------------------------------------------------- */
652
+ isActionVisible(action, row, index) {
653
+ return action.hidden ? !action.hidden(row, index) : true;
654
+ }
655
+ isActionDisabled(action, row, index) {
656
+ return action.disabled ? action.disabled(row, index) : false;
657
+ }
658
+ onActionClick(action, row, index, event) {
659
+ event.stopPropagation();
660
+ this.actionClick.emit({ action, row, index });
661
+ }
662
+ onRowClick(row, index, event) {
663
+ if (isInteractiveTarget(event.target))
664
+ return;
665
+ this.activateRow(row, index, event);
666
+ }
667
+ /** `Enter` / `Space` activate a focusable row exactly like a mouse click. */
668
+ onRowKeydown(row, index, event) {
669
+ this.onRowContextMenuKey(row, index, event);
670
+ if (event.defaultPrevented)
671
+ return;
672
+ if (event.key !== 'Enter' && event.key !== ' ')
673
+ return;
674
+ if (isInteractiveTarget(event.target))
675
+ return;
676
+ if (!this.rowClickable() && !this.selectOnRowClick())
677
+ return;
678
+ event.preventDefault();
679
+ this.activateRow(row, index, event);
680
+ }
681
+ /** Shared by mouse and keyboard activation. */
682
+ activateRow(row, index, event) {
683
+ this.rowClick.emit({ row, index, event });
684
+ if (this.selectOnRowClick() && this.selectable()) {
685
+ this.toggleRow(row, !this.isSelected(row));
686
+ }
687
+ }
688
+ /* ---------------------------------------------------------------- */
689
+ /* Rendering helpers */
690
+ /* ---------------------------------------------------------------- */
691
+ cellValue(row, column) {
692
+ return getPathValue(row, column.field ?? column.key);
693
+ }
694
+ cellText(row, column, index = 0) {
695
+ const value = this.cellValue(row, column);
696
+ const formatted = column.formatter ? column.formatter(value, row, index) : value;
697
+ return toDisplay(formatted);
698
+ }
699
+ cellContext(row, column, index) {
700
+ return {
701
+ $implicit: row,
702
+ row,
703
+ column,
704
+ value: this.cellValue(row, column),
705
+ index,
706
+ };
707
+ }
708
+ cellTemplate(column) {
709
+ return this.cellTemplates().get(column.key);
710
+ }
711
+ headerTemplate(column) {
712
+ return this.headerTemplates().get(column.key);
713
+ }
714
+ cellClassFor(row, column, index) {
715
+ const value = typeof column.cellClass === 'function' ? column.cellClass(row, index) : column.cellClass;
716
+ return value ?? '';
717
+ }
718
+ headerClassFor(column) {
719
+ return [this.alignClass(column), column.headerClass ?? ''].filter((value) => !!value);
720
+ }
721
+ /** Flat class list for a header cell (NgClass rejects nested arrays). */
722
+ headerClasses(column) {
723
+ return [...this.headerClassFor(column), this.stickyClassFor(column)].filter((value) => !!value);
724
+ }
725
+ filterClasses(column) {
726
+ return [this.alignClass(column), this.stickyClassFor(column)].filter((value) => !!value);
727
+ }
728
+ /** Flat class list for a body cell, including dynamic `cellClass` output. */
729
+ cellClasses(row, column, index) {
730
+ const extra = this.cellClassFor(row, column, index);
731
+ const values = Array.isArray(extra) ? extra : [extra];
732
+ return [this.alignClass(column), this.stickyClassFor(column), ...values].filter((value) => !!value);
733
+ }
734
+ columnStyle(column) {
735
+ const style = {};
736
+ if (column.width)
737
+ style['width'] = column.width;
738
+ if (column.minWidth)
739
+ style['min-width'] = column.minWidth;
740
+ if (column.sticky === 'start')
741
+ style['left'] = this.stickyStartOffset(column);
742
+ if (column.sticky === 'end')
743
+ style['right'] = '0px';
744
+ return style;
745
+ }
746
+ stickyClassFor(column) {
747
+ if (column.sticky === 'start')
748
+ return 'ith-table-sticky-start';
749
+ if (column.sticky === 'end')
750
+ return 'ith-table-sticky-end';
751
+ return '';
752
+ }
753
+ /** Full text for the native tooltip; `null` disables it for a column. */
754
+ tooltipText(row, column, index) {
755
+ if (column.tooltip === false)
756
+ return null;
757
+ return this.cellText(row, column, index) || null;
758
+ }
759
+ stickyStartOffset(column) {
760
+ let offset = this.selectable() && this.stickySelection() ? 44 : 0;
761
+ for (const candidate of this.visibleColumns()) {
762
+ if (candidate.key === column.key)
763
+ break;
764
+ if (candidate.sticky === 'start')
765
+ offset += this.columnWidthPx(candidate);
766
+ }
767
+ return `${offset}px`;
768
+ }
769
+ columnWidthPx(column) {
770
+ const width = column.width ?? '';
771
+ return width.endsWith('px') ? Number.parseFloat(width) || 0 : 0;
772
+ }
773
+ /* ---------------------------------------------------------------- */
774
+ /* Copy / context menu */
775
+ /* ---------------------------------------------------------------- */
776
+ copyCell(row, column, index, event) {
777
+ event?.stopPropagation();
778
+ const value = this.cellText(row, column, index);
779
+ this.copyText(value, `${index}:${column.key}`);
780
+ this.cellCopy.emit({ value, row, index, column });
781
+ }
782
+ copyRow(row, index, event) {
783
+ event?.stopPropagation();
784
+ const value = this.visibleColumns()
785
+ .map((column) => this.cellText(row, column, index))
786
+ .join('\t');
787
+ this.copyText(value, `${index}:__row`);
788
+ this.cellCopy.emit({ value, row, index, column: null });
789
+ }
790
+ isCellCopied(index, column) {
791
+ return this.copiedCell() === `${index}:${column.key}`;
792
+ }
793
+ /** Ctrl/Cmd+C while a cell has focus copies that cell. */
794
+ onCellKeydown(row, column, index, event) {
795
+ if (!this.copyable())
796
+ return;
797
+ if (event.key.toLowerCase() !== 'c' || !(event.ctrlKey || event.metaKey))
798
+ return;
799
+ if (isInteractiveTarget(event.target))
800
+ return;
801
+ event.preventDefault();
802
+ this.copyCell(row, column, index);
803
+ }
804
+ onRowContextMenu(row, index, event) {
805
+ this.rowContextMenu.emit({ row, index, x: event.clientX, y: event.clientY, event });
806
+ if (!this.rowMenuTemplate())
807
+ return;
808
+ event.preventDefault();
809
+ this.menuState.set({ row, index, x: event.clientX, y: event.clientY });
810
+ }
811
+ /** Keyboard path for the same menu (context-menu key / Shift+F10). */
812
+ onRowContextMenuKey(row, index, event) {
813
+ if (event.key !== 'ContextMenu' && !(event.shiftKey && event.key === 'F10'))
814
+ return;
815
+ if (!this.rowMenuTemplate())
816
+ return;
817
+ event.preventDefault();
818
+ const target = event.target;
819
+ const rect = target?.getBoundingClientRect();
820
+ const x = rect ? rect.left + Math.min(24, rect.width / 2) : 0;
821
+ const y = rect ? rect.bottom : 0;
822
+ this.rowContextMenu.emit({ row, index, x, y, event });
823
+ this.menuState.set({ row, index, x, y });
824
+ }
825
+ closeRowMenu() {
826
+ this.menuState.set(null);
827
+ }
828
+ /* ---------------------------------------------------------------- */
829
+ /* Column preset / density */
830
+ /* ---------------------------------------------------------------- */
831
+ isColumnVisible(column) {
832
+ return !column.hidden && !this.hiddenColumnKeys().has(column.key);
833
+ }
834
+ setColumnVisible(key, visible) {
835
+ const next = new Set(this.hiddenColumnKeys());
836
+ if (visible)
837
+ next.delete(key);
838
+ else
839
+ next.add(key);
840
+ // Never hide every column: keep at least one visible.
841
+ const visibleCount = this.columns().filter((column) => !column.hidden && !next.has(column.key)).length;
842
+ if (visibleCount === 0)
843
+ return;
844
+ this.hiddenColumnKeys.set(next);
845
+ this.columnsChange.emit(this.visibleColumns().map((column) => column.key));
846
+ }
847
+ resetColumns() {
848
+ this.hiddenColumnKeys.set(new Set());
849
+ this.columnsChange.emit(this.visibleColumns().map((column) => column.key));
850
+ }
851
+ toggleColumnPicker() {
852
+ this.columnPickerOpen.update((open) => !open);
853
+ }
854
+ toggleDensity() {
855
+ this.density.update((density) => (density === 'compact' ? 'comfortable' : 'compact'));
856
+ this.densityChange.emit(this.density());
857
+ }
858
+ copyText(value, key) {
859
+ if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
860
+ void navigator.clipboard.writeText(value).catch(() => undefined);
861
+ }
862
+ this.copiedCell.set(key);
863
+ if (this.copyTimer)
864
+ clearTimeout(this.copyTimer);
865
+ this.copyTimer = setTimeout(() => this.copiedCell.set(null), 1400);
866
+ }
867
+ restorePreset() {
868
+ const preset = this.readPreset();
869
+ if (!preset)
870
+ return;
871
+ if (Array.isArray(preset.hidden))
872
+ this.hiddenColumnKeys.set(new Set(preset.hidden));
873
+ if (preset.density === 'compact' || preset.density === 'comfortable') {
874
+ this.density.set(preset.density);
875
+ }
876
+ }
877
+ readPreset() {
878
+ const key = this.storageKey();
879
+ if (!key || typeof localStorage === 'undefined')
880
+ return null;
881
+ try {
882
+ const raw = localStorage.getItem(key);
883
+ return raw ? JSON.parse(raw) : null;
884
+ }
885
+ catch {
886
+ return null;
887
+ }
888
+ }
889
+ persistPreset(preset) {
890
+ const key = this.storageKey();
891
+ if (!key || typeof localStorage === 'undefined')
892
+ return;
893
+ try {
894
+ localStorage.setItem(key, JSON.stringify(preset));
895
+ }
896
+ catch {
897
+ // Storage disabled (private mode) — the preset simply stays in memory.
898
+ }
899
+ }
900
+ onDocumentClick() {
901
+ this.closeRowMenu();
902
+ this.columnPickerOpen.set(false);
903
+ }
904
+ onDocumentEscape() {
905
+ this.closeRowMenu();
906
+ this.columnPickerOpen.set(false);
907
+ }
908
+ alignClass(column) {
909
+ return column.align ? `ith-table-align-${column.align}` : '';
910
+ }
911
+ rowClassFor(row, index) {
912
+ return [this.isSelected(row) ? 'ith-table-row-selected' : '', this.rowClass()?.(row, index) ?? ''];
913
+ }
914
+ trackRow(index, row) {
915
+ return this.rowKey(row) ?? index;
916
+ }
917
+ toolbarContext() {
918
+ return {
919
+ $implicit: this.pagedRows(),
920
+ rows: this.pagedRows(),
921
+ total: this.totalRows(),
922
+ selected: this.selected(),
923
+ search: this.search(),
924
+ };
925
+ }
926
+ footerContext() {
927
+ return {
928
+ ...this.toolbarContext(),
929
+ page: this.page(),
930
+ pageSize: this.pageSize(),
931
+ pageCount: this.pageCount(),
932
+ };
933
+ }
934
+ emptyContext() {
935
+ return { ...this.toolbarContext() };
936
+ }
937
+ /* ---------------------------------------------------------------- */
938
+ /* Internals */
939
+ /* ---------------------------------------------------------------- */
940
+ compareRows(a, b, column) {
941
+ if (column.sortFn)
942
+ return column.sortFn(a, b);
943
+ const path = column.field ?? column.key;
944
+ return defaultCompare(getPathValue(a, path), getPathValue(b, path));
945
+ }
946
+ /** Match one row against the current filter value of one column. */
947
+ columnMatchesFilter(row, column, term) {
948
+ const raw = this.cellValue(row, column);
949
+ const value = term.trim();
950
+ // A column-level predicate always wins; it gets the raw value and raw term.
951
+ if (column.filterPredicate)
952
+ return column.filterPredicate(raw, term, row);
953
+ switch (this.filterTypeFor(column)) {
954
+ case 'select':
955
+ return String(raw ?? '') === value;
956
+ case 'number': {
957
+ const number = Number(raw);
958
+ const typed = Number(value);
959
+ return value !== '' && Number.isFinite(number) && Number.isFinite(typed) && number === typed;
960
+ }
961
+ case 'date': {
962
+ // ISO strings (`2026-10-05`, `2026-10-05T23:00:00Z`) are compared by their
963
+ // calendar date, so a time zone can never shift the day.
964
+ if (typeof raw === 'string') {
965
+ const isoDate = /^(\d{4}-\d{2}-\d{2})/.exec(raw);
966
+ if (isoDate)
967
+ return isoDate[1] === value;
968
+ }
969
+ const date = raw instanceof Date ? raw : new Date(String(raw));
970
+ if (Number.isNaN(date.getTime()))
971
+ return this.filterText(row, column).includes(value.toLowerCase());
972
+ const pad = (part) => String(part).padStart(2, '0');
973
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}` === value;
974
+ }
975
+ default:
976
+ return this.filterText(row, column).includes(value.toLowerCase());
977
+ }
978
+ }
979
+ searchText(row, column) {
980
+ if (column.searchValue)
981
+ return column.searchValue(row).toLowerCase();
982
+ return this.cellText(row, column).toLowerCase();
983
+ }
984
+ filterText(row, column) {
985
+ if (column.filterValue)
986
+ return column.filterValue(row).toLowerCase();
987
+ return this.cellText(row, column).toLowerCase();
988
+ }
989
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
990
+ 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 }, 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 }, 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 }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, skeletonRows: { classPropertyName: "skeletonRows", publicName: "skeletonRows", 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 }, 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", filters: "filtersChange" }, host: { listeners: { "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 }], 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 (showColumnPicker()) {\n <div class=\"ith-table-columns\" (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()\">\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 @if (columnPickerOpen()) {\n <div class=\"ith-table-columns-popover\" role=\"dialog\" aria-label=\"Visible columns\">\n <div class=\"ith-table-columns-header\">Show columns</div>\n <div class=\"ith-table-columns-list\">\n @for (column of columns(); 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]=\"column.hidden\"\n (change)=\"setColumnVisible(column.key, $any($event.target).checked)\" />\n <span>{{ column.header ?? column.key }}</span>\n </label>\n }\n </div>\n <div class=\"ith-table-columns-footer\">\n <button type=\"button\" class=\"ith-table-columns-reset\" (click)=\"resetColumns()\">\n Reset columns\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n @if (showDensityToggle()) {\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n [attr.aria-pressed]=\"compact()\"\n (click)=\"toggleDensity()\">\n @if (compact()) {\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n <span>Comfortable</span>\n } @else {\n <svg class=\"ith-table-tool-icon\" 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 }\n </button>\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 </div>\n }\n\n <!-- Table -->\n <div class=\"ith-table-scroll\" [style.maxHeight]=\"maxHeight() || null\">\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 @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.aria-sort]=\"isSortable(column) ? ariaSort(column) : null\">\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 </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 @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 @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()\"\n [attr.tabindex]=\"rowClickable() || selectOnRowClick() ? 0 : null\"\n [attr.aria-selected]=\"selectable() ? isSelected(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 @for (column of visibleColumns(); track column.key) {\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.tabindex]=\"copyable() ? 0 : null\"\n (keydown)=\"onCellKeydown(row, column, rowIndex, $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 }\n </tbody>\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 <!-- 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)}: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, #2a2e42);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 42%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 10%, #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) 4%, #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, #1b1e30);--_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) 6%, #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))}@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, #2a2e42);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 42%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 10%, #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) 4%, #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, #1b1e30);--_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) 6%, #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))}}.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:color-mix(in srgb,var(--_brand) 3%,var(--_bg))}.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:#fff;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}.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:#dc2626;border-color:#fecaca}.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:#fff}.ith-table-page-number.is-active:hover{background:var(--_accent);color:#fff}.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}.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-columns{position:relative}.ith-table-columns-popover{position:absolute;z-index:45;top:calc(100% + 8px);inset-inline-end:0;min-width:220px;max-height:340px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--_border);border-radius:12px;background:var(--_bg);color:var(--_text);box-shadow:0 18px 40px -18px #110c2e59,0 0 0 1px color-mix(in srgb,var(--_border) 60%,transparent)}.ith-table-columns-header{padding:10px 12px 8px;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--_muted)}.ith-table-columns-list{padding:0 6px 6px;overflow-y:auto;max-height:240px}.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-footer{border-top:1px solid var(--_border);padding:4px;background:color-mix(in srgb,var(--_brand) 2%,var(--_bg))}.ith-table-columns-reset{width:100%;padding:7px 8px;border:0;border-radius:8px;background:transparent;color:var(--_accent);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease}.ith-table-columns-reset:hover{background:var(--_accent-soft)}.ith-table.ith-table-compact{--ith-table-cell-padding: 7px 12px}.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{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(--_bg);color:var(--_text);box-shadow:0 16px 36px -16px #110c2e73;font-size:13px}@media(prefers-reduced-motion:reduce){.ith-table-skeleton{animation:none}.ith-table-copy,.ith-table-tool-btn{transition:none}}\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 });
991
+ }
992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.34", ngImport: i0, type: TableComponent, decorators: [{
993
+ type: Component,
994
+ 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 (showColumnPicker()) {\n <div class=\"ith-table-columns\" (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()\">\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 @if (columnPickerOpen()) {\n <div class=\"ith-table-columns-popover\" role=\"dialog\" aria-label=\"Visible columns\">\n <div class=\"ith-table-columns-header\">Show columns</div>\n <div class=\"ith-table-columns-list\">\n @for (column of columns(); 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]=\"column.hidden\"\n (change)=\"setColumnVisible(column.key, $any($event.target).checked)\" />\n <span>{{ column.header ?? column.key }}</span>\n </label>\n }\n </div>\n <div class=\"ith-table-columns-footer\">\n <button type=\"button\" class=\"ith-table-columns-reset\" (click)=\"resetColumns()\">\n Reset columns\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n @if (showDensityToggle()) {\n <button\n type=\"button\"\n class=\"ith-table-tool-btn\"\n [attr.aria-pressed]=\"compact()\"\n (click)=\"toggleDensity()\">\n @if (compact()) {\n <svg class=\"ith-table-tool-icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n <span>Comfortable</span>\n } @else {\n <svg class=\"ith-table-tool-icon\" 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 }\n </button>\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 </div>\n }\n\n <!-- Table -->\n <div class=\"ith-table-scroll\" [style.maxHeight]=\"maxHeight() || null\">\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 @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.aria-sort]=\"isSortable(column) ? ariaSort(column) : null\">\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 </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 @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 @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()\"\n [attr.tabindex]=\"rowClickable() || selectOnRowClick() ? 0 : null\"\n [attr.aria-selected]=\"selectable() ? isSelected(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 @for (column of visibleColumns(); track column.key) {\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.tabindex]=\"copyable() ? 0 : null\"\n (keydown)=\"onCellKeydown(row, column, rowIndex, $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 }\n </tbody>\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 <!-- 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)}: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, #2a2e42);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 42%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 10%, #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) 4%, #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, #1b1e30);--_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) 6%, #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))}@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, #2a2e42);--_header-bg: var(--ith-table-header-bg, color-mix(in srgb, var(--_brand) 42%, #0b0d16));--_header-text: var(--ith-table-header-text, #f3eeff);--_hover: var(--ith-table-hover, color-mix(in srgb, var(--_brand) 10%, #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) 4%, #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, #1b1e30);--_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) 6%, #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))}}.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:color-mix(in srgb,var(--_brand) 3%,var(--_bg))}.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:#fff;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}.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:#dc2626;border-color:#fecaca}.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:#fff}.ith-table-page-number.is-active:hover{background:var(--_accent);color:#fff}.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}.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-columns{position:relative}.ith-table-columns-popover{position:absolute;z-index:45;top:calc(100% + 8px);inset-inline-end:0;min-width:220px;max-height:340px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--_border);border-radius:12px;background:var(--_bg);color:var(--_text);box-shadow:0 18px 40px -18px #110c2e59,0 0 0 1px color-mix(in srgb,var(--_border) 60%,transparent)}.ith-table-columns-header{padding:10px 12px 8px;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--_muted)}.ith-table-columns-list{padding:0 6px 6px;overflow-y:auto;max-height:240px}.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-footer{border-top:1px solid var(--_border);padding:4px;background:color-mix(in srgb,var(--_brand) 2%,var(--_bg))}.ith-table-columns-reset{width:100%;padding:7px 8px;border:0;border-radius:8px;background:transparent;color:var(--_accent);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease}.ith-table-columns-reset:hover{background:var(--_accent-soft)}.ith-table.ith-table-compact{--ith-table-cell-padding: 7px 12px}.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{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(--_bg);color:var(--_text);box-shadow:0 16px 36px -16px #110c2e73;font-size:13px}@media(prefers-reduced-motion:reduce){.ith-table-skeleton{animation:none}.ith-table-copy,.ith-table-tool-btn{transition:none}}\n"] }]
995
+ }], 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 }] }], 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 }] }], 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 }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], skeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonRows", required: false }] }], stickySelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickySelection", required: false }] }], stickyActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyActions", 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"] }], 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), { ...{
996
+ descendants: true,
997
+ }, 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), { ...{
998
+ descendants: true,
999
+ }, isSignal: true }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], onDocumentClick: [{
1000
+ type: HostListener,
1001
+ args: ['document:click']
1002
+ }], onDocumentEscape: [{
1003
+ type: HostListener,
1004
+ args: ['document:keydown.escape']
1005
+ }] } });
1006
+
1007
+ /**
1008
+ * Public models for `<ith-table>`.
1009
+ */
1010
+
1011
+ /**
1012
+ * Generated bundle index. Do not edit.
1013
+ */
1014
+
1015
+ export { TableCellDirective, TableComponent, TableEmptyDirective, TableFilterDirective, TableFooterDirective, TableHeaderDirective, TableRowActionsDirective, TableRowMenuDirective, TableToolbarDirective, buildPageWindow, compareWithDirection, defaultCompare, getPathValue, isInteractiveTarget, toDisplay };
1016
+ //# sourceMappingURL=ithouse-bd-ngx-table.mjs.map