@shival99/z-ui 1.9.12 → 1.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/base.css +0 -16
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs +129 -12
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +142 -8
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs +65 -16
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-chat.mjs +18 -7
- package/fesm2022/shival99-z-ui-components-z-chat.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +7 -2
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs +150 -3
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +13 -6
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs +61 -0
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs +13 -33
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs +16 -6
- package/fesm2022/shival99-z-ui-components-z-switch.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +510 -24
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +27 -2
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +44 -260
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +1 -4
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-providers.mjs +7 -2
- package/fesm2022/shival99-z-ui-providers.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services.mjs +441 -182
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-utils.mjs +6 -1
- package/fesm2022/shival99-z-ui-utils.mjs.map +1 -1
- package/package.json +5 -1
- package/types/shival99-z-ui-components-z-accordion.d.ts +22 -4
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +33 -7
- package/types/shival99-z-ui-components-z-breadcrumb.d.ts +13 -3
- package/types/shival99-z-ui-components-z-chat.d.ts +1 -0
- package/types/shival99-z-ui-components-z-drawer.d.ts +2 -0
- package/types/shival99-z-ui-components-z-filter.d.ts +17 -0
- package/types/shival99-z-ui-components-z-modal.d.ts +4 -1
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
- package/types/shival99-z-ui-components-z-skeleton-auto.d.ts +35 -0
- package/types/shival99-z-ui-components-z-skeleton.d.ts +3 -7
- package/types/shival99-z-ui-components-z-switch.d.ts +7 -1
- package/types/shival99-z-ui-components-z-table.d.ts +268 -6
- package/types/shival99-z-ui-components-z-tabs.d.ts +3 -3
- package/types/shival99-z-ui-components-z-timeline.d.ts +24 -60
- package/types/shival99-z-ui-providers.d.ts +6 -2
- package/types/shival99-z-ui-services.d.ts +43 -1
- package/types/shival99-z-ui-utils.d.ts +2 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as _shival99_angular_virtual from '@shival99/angular-virtual';
|
|
2
1
|
import * as _tanstack_angular_table from '@tanstack/angular-table';
|
|
3
|
-
import { RowData, SortingState, ColumnFiltersState, PaginationState, RowSelectionState, ExpandedState, HeaderContext, CellContext, FlexRenderComponent, Row, ColumnPinningState, RowPinningState, VisibilityState, ColumnOrderState,
|
|
2
|
+
import { RowData, SortingState, ColumnFiltersState, PaginationState, RowSelectionState, ExpandedState, HeaderContext, CellContext, FlexRenderComponent, Row, ColumnPinningState, RowPinningState, VisibilityState, ColumnOrderState, Column, createAngularTable, Table, ColumnDef } from '@tanstack/angular-table';
|
|
3
|
+
import * as _shival99_angular_virtual from '@shival99/angular-virtual';
|
|
4
4
|
import * as _shival99_z_ui_components_z_input from '@shival99/z-ui/components/z-input';
|
|
5
5
|
import { ZInputSize } from '@shival99/z-ui/components/z-input';
|
|
6
6
|
import * as _angular_core from '@angular/core';
|
|
7
7
|
import { TemplateRef, Type, AfterViewInit, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
8
|
-
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
8
|
+
import { CdkDragDrop, CdkDragEnd } from '@angular/cdk/drag-drop';
|
|
9
9
|
import { ClassValue } from 'clsx';
|
|
10
10
|
import { NgScrollbar } from 'ngx-scrollbar';
|
|
11
11
|
import { ZAutocompleteType, ZAutocompleteOption } from '@shival99/z-ui/components/z-autocomplete';
|
|
@@ -19,12 +19,33 @@ import * as _shival99_z_ui_components_z_table from '@shival99/z-ui/components/z-
|
|
|
19
19
|
import { ZDateRange } from '@shival99/z-ui/components/z-calendar';
|
|
20
20
|
import { ZDropdownMenuItem } from '@shival99/z-ui/components/z-dropdown-menu';
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Z-Table Type Definitions
|
|
24
|
+
*
|
|
25
|
+
* Central type file for the z-table component. Contains:
|
|
26
|
+
* - Default constants (row heights, sizing, debounce timers)
|
|
27
|
+
* - Column configuration types (header, body, footer)
|
|
28
|
+
* - Sort/filter/edit configuration interfaces
|
|
29
|
+
* - Event contracts for parent-component communication
|
|
30
|
+
* - Unified change event discriminated union
|
|
31
|
+
* - Virtual scrolling configuration
|
|
32
|
+
* - Settings persistence types
|
|
33
|
+
* - TanStack Table module augmentation for custom table meta
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A virtual group represents one or more consecutive rows that must be
|
|
38
|
+
* rendered together (e.g. rows sharing a rowSpan). The virtualizer operates
|
|
39
|
+
* on groups rather than individual rows to keep merged cells intact.
|
|
40
|
+
*/
|
|
22
41
|
interface ZVirtualGroup {
|
|
23
42
|
startIndex: number;
|
|
24
43
|
endIndex: number;
|
|
25
44
|
rowCount: number;
|
|
45
|
+
/** null when dynamicSize is enabled — height is measured after render */
|
|
26
46
|
height: number | null;
|
|
27
47
|
}
|
|
48
|
+
/** Parsed segment from the `[icon:name|size:16|class:text-red]` inline icon syntax */
|
|
28
49
|
interface ZTableIconPart {
|
|
29
50
|
type: 'text' | 'icon';
|
|
30
51
|
value: string;
|
|
@@ -33,18 +54,35 @@ interface ZTableIconPart {
|
|
|
33
54
|
strokeWidth?: number;
|
|
34
55
|
}
|
|
35
56
|
type ZTableAlign = 'left' | 'center' | 'right';
|
|
57
|
+
/**
|
|
58
|
+
* Body cell content — supports static values, Angular templates/components,
|
|
59
|
+
* or a function that receives the cell context and returns dynamic content.
|
|
60
|
+
*/
|
|
36
61
|
type ZTableCellContent<T> = string | number | TemplateRef<{
|
|
37
62
|
$implicit: CellContext<T, unknown>;
|
|
38
63
|
}> | Type<unknown> | FlexRenderComponent<unknown> | ((info: CellContext<T, unknown>) => string | number | TemplateRef<unknown> | FlexRenderComponent<unknown>);
|
|
64
|
+
/** Header/footer cell content — similar to body but uses HeaderContext */
|
|
39
65
|
type ZTableHeaderContent<T> = string | TemplateRef<unknown> | Type<unknown> | (() => string) | ((info: HeaderContext<T, unknown>) => string);
|
|
66
|
+
/** Alias for ZTableColumnConfig — kept for backward compatibility */
|
|
40
67
|
type ZTableColumn<T = unknown> = ZTableColumnConfig<T>;
|
|
68
|
+
/** Available column filter input types */
|
|
41
69
|
type ZTableFilterType = 'text' | 'number' | 'select' | 'multi-select' | 'date' | 'date-range' | 'range' | 'tags';
|
|
70
|
+
/** Available inline cell edit input types */
|
|
42
71
|
type ZTableEditType = 'text' | 'number' | 'select' | 'date' | 'checkbox' | 'textarea' | 'toggle' | 'autocomplete';
|
|
72
|
+
/**
|
|
73
|
+
* Table operation mode:
|
|
74
|
+
* - 'local': data is fully client-side (sort/filter/paginate handled by TanStack)
|
|
75
|
+
* - 'server': parent handles data fetching; table emits change events for server calls
|
|
76
|
+
*/
|
|
43
77
|
type ZTableMode = 'local' | 'server';
|
|
78
|
+
/** Per-column sort configuration; mode controls local vs server-side sorting */
|
|
44
79
|
interface ZTableSortConfig<T> {
|
|
45
80
|
enabled?: boolean;
|
|
81
|
+
/** 'local' = TanStack sorts in-memory; 'server' = emits event for API call */
|
|
46
82
|
mode?: ZTableMode;
|
|
83
|
+
/** Custom key sent with server-side sort events (defaults to column id) */
|
|
47
84
|
sortKey?: string;
|
|
85
|
+
/** Custom comparator for local sorting */
|
|
48
86
|
sortFn?: (rowA: Row<T>, rowB: Row<T>, columnId: string) => number;
|
|
49
87
|
}
|
|
50
88
|
type ZTableBuiltInFilterFn = 'equalsString' | 'includesString' | 'includesStringSensitive' | 'arrIncludes' | 'arrIncludesAll' | 'arrIncludesSome' | 'equals' | 'weakEquals' | 'inNumberRange';
|
|
@@ -110,10 +148,16 @@ interface ZTableEditConfig<T = unknown> {
|
|
|
110
148
|
/** Allow typing custom values when no options match. Default: false */
|
|
111
149
|
autocompleteAllowCustomValue?: boolean;
|
|
112
150
|
}
|
|
151
|
+
/** Minimal column info stored alongside saved config for cache invalidation */
|
|
113
152
|
interface ZTableSavedColumnInfo {
|
|
114
153
|
id: string;
|
|
115
154
|
accessorKey?: string;
|
|
116
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Shape of the persisted table configuration (via ZCacheService).
|
|
158
|
+
* Restored when a table with matching zKey re-mounts.
|
|
159
|
+
* columnInfo is used to detect schema changes and invalidate stale caches.
|
|
160
|
+
*/
|
|
117
161
|
interface ZTableSavedConfig {
|
|
118
162
|
columnOrder: string[];
|
|
119
163
|
columnSizing: Record<string, number>;
|
|
@@ -127,6 +171,11 @@ interface ZTableSavedConfig {
|
|
|
127
171
|
showHorizontalBorder: boolean;
|
|
128
172
|
showVerticalBorder: boolean;
|
|
129
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Imperative control handle emitted via `zControl` output.
|
|
176
|
+
* Allows parent components to programmatically manipulate table state
|
|
177
|
+
* (add/update/delete items, reset filters, toggle settings, etc.).
|
|
178
|
+
*/
|
|
130
179
|
interface ZTableControl<T> {
|
|
131
180
|
updateConfig: (config: Partial<ZTableConfig<T>>) => void;
|
|
132
181
|
toggleSettings: () => void;
|
|
@@ -138,6 +187,7 @@ interface ZTableControl<T> {
|
|
|
138
187
|
getItems: () => T[];
|
|
139
188
|
setColumnVisibility: (columnIds: string | string[], visible: boolean) => void;
|
|
140
189
|
}
|
|
190
|
+
/** Header cell configuration — applied to the <th> in the table header row */
|
|
141
191
|
interface ZTableHeaderColumnConfig<T> {
|
|
142
192
|
content?: ZTableHeaderContent<T>;
|
|
143
193
|
class?: string;
|
|
@@ -145,22 +195,31 @@ interface ZTableHeaderColumnConfig<T> {
|
|
|
145
195
|
align?: ZTableAlign;
|
|
146
196
|
rowSpan?: number;
|
|
147
197
|
colSpan?: number;
|
|
198
|
+
/** Class applied to the inner content wrapper, not the <th> itself */
|
|
148
199
|
contentClass?: string | ((info: HeaderContext<T, unknown>) => string);
|
|
149
200
|
contentStyle?: Record<string, string> | ((info: HeaderContext<T, unknown>) => Record<string, string>);
|
|
150
201
|
tooltip?: string | ZTooltipConfig;
|
|
151
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Body cell configuration — most properties accept a static value or
|
|
205
|
+
* a function receiving CellContext for per-row dynamic behavior.
|
|
206
|
+
*/
|
|
152
207
|
interface ZTableBodyColumnConfig<T> {
|
|
153
208
|
content?: ZTableCellContent<T>;
|
|
154
209
|
class?: string | ((info: CellContext<T, unknown>) => string);
|
|
155
210
|
style?: Record<string, string> | ((info: CellContext<T, unknown>) => Record<string, string>);
|
|
156
211
|
align?: ZTableAlign;
|
|
212
|
+
/** Static rowSpan or function returning 0 to hide the cell (merged into neighbor) */
|
|
157
213
|
rowSpan?: number | ((info: CellContext<T, unknown>) => number);
|
|
158
214
|
colSpan?: number | ((info: CellContext<T, unknown>) => number);
|
|
159
215
|
contentClass?: string | ((info: CellContext<T, unknown>) => string);
|
|
160
216
|
contentStyle?: Record<string, string> | ((info: CellContext<T, unknown>) => Record<string, string>);
|
|
161
217
|
tooltip?: string | ZTooltipConfig | ((info: CellContext<T, unknown>) => string | ZTooltipConfig);
|
|
218
|
+
/** Action buttons rendered inside this cell */
|
|
162
219
|
actions?: ZTableActionColumnConfig<T>;
|
|
220
|
+
/** When true, clicking the cell emits a cellClick event */
|
|
163
221
|
enabledClick?: boolean;
|
|
222
|
+
/** Enable inline editing — true uses defaults, or pass full config */
|
|
164
223
|
edit?: ZTableEditConfig<T> | boolean;
|
|
165
224
|
/** Control cell content visibility. When false, the cell is rendered but content is hidden. */
|
|
166
225
|
visible?: boolean | ((info: CellContext<T, unknown>) => boolean);
|
|
@@ -176,10 +235,23 @@ interface ZTableFooterColumnConfig<T> {
|
|
|
176
235
|
contentStyle?: Record<string, string> | ((info: HeaderContext<T, unknown>) => Record<string, string>);
|
|
177
236
|
tooltip?: string | ZTooltipConfig;
|
|
178
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Primary column definition — the consumer-facing API.
|
|
240
|
+
* Converted to TanStack ColumnDef internally via `columnConfigToColumnDef()`.
|
|
241
|
+
*
|
|
242
|
+
* Shorthand: header/body/footer accept either a full config object or
|
|
243
|
+
* just the content directly (string/template/function).
|
|
244
|
+
*
|
|
245
|
+
* Nested columns: use `columns` for multi-level header groups.
|
|
246
|
+
*/
|
|
179
247
|
interface ZTableColumnConfig<T> {
|
|
248
|
+
/** Unique column identifier — must be stable across re-renders */
|
|
180
249
|
id: string;
|
|
250
|
+
/** Pre-filter visibility — unlike columnVisibility, this removes the column entirely */
|
|
181
251
|
visible?: boolean | (() => boolean);
|
|
252
|
+
/** Object property key for simple accessor — mutually exclusive with accessorFn */
|
|
182
253
|
accessorKey?: keyof T & string;
|
|
254
|
+
/** Custom accessor function for derived/computed cell values */
|
|
183
255
|
accessorFn?: (row: T) => unknown;
|
|
184
256
|
header?: ZTableHeaderColumnConfig<T> | ZTableHeaderContent<T>;
|
|
185
257
|
body?: ZTableBodyColumnConfig<T> | ZTableCellContent<T>;
|
|
@@ -188,13 +260,17 @@ interface ZTableColumnConfig<T> {
|
|
|
188
260
|
minSize?: number;
|
|
189
261
|
maxSize?: number;
|
|
190
262
|
width?: string;
|
|
263
|
+
/** true = local sort with defaults; object = full config */
|
|
191
264
|
sort?: ZTableSortConfig<T> | boolean;
|
|
265
|
+
/** true = local filter with defaults; object = full config */
|
|
192
266
|
filter?: ZTableFilterConfig<T> | boolean;
|
|
193
267
|
enableResizing?: boolean;
|
|
194
268
|
enablePinning?: boolean;
|
|
195
269
|
enableHiding?: boolean;
|
|
196
270
|
enableOrdering?: boolean;
|
|
271
|
+
/** Initial pin position — applied on first render */
|
|
197
272
|
pinned?: 'left' | 'right' | false;
|
|
273
|
+
/** Child columns for multi-level header grouping */
|
|
198
274
|
columns?: ZTableColumnConfig<T>[];
|
|
199
275
|
}
|
|
200
276
|
interface ZTablePaginationConfig {
|
|
@@ -208,6 +284,7 @@ interface ZTablePaginationConfig {
|
|
|
208
284
|
totalLabel?: string;
|
|
209
285
|
disabled?: boolean;
|
|
210
286
|
}
|
|
287
|
+
/** Distinguishes user-triggered vs programmatic pagination changes */
|
|
211
288
|
type ZTableEmitType = 'user' | 'auto';
|
|
212
289
|
interface ZTablePageChangeEvent {
|
|
213
290
|
pageIndex: number;
|
|
@@ -245,6 +322,13 @@ interface ZTableCellEditEvent<T> {
|
|
|
245
322
|
oldValue: unknown;
|
|
246
323
|
newValue: unknown;
|
|
247
324
|
}
|
|
325
|
+
interface ZTableRowDragEvent<T> {
|
|
326
|
+
row: T;
|
|
327
|
+
rowId: string;
|
|
328
|
+
previousIndex: number;
|
|
329
|
+
currentIndex: number;
|
|
330
|
+
data: T[];
|
|
331
|
+
}
|
|
248
332
|
interface ZTableSortChangeEvent {
|
|
249
333
|
sorting: SortingState;
|
|
250
334
|
}
|
|
@@ -290,7 +374,8 @@ interface ZTableActionColumnConfig<T = unknown> {
|
|
|
290
374
|
actions: ZTableActionItem<T>[] | ((row: T) => ZTableActionItem<T>[]);
|
|
291
375
|
maxVisible?: number;
|
|
292
376
|
}
|
|
293
|
-
|
|
377
|
+
/** All possible change event types — used as discriminant in ZTableChangeEvent */
|
|
378
|
+
type ZTableChangeType = 'page' | 'sort' | 'filter' | 'search' | 'select' | 'expand' | 'rowSelect' | 'rowSelectAll' | 'rowExpand' | 'rowDrag' | 'cellClick' | 'cellEdit' | 'action';
|
|
294
379
|
interface ZTableChangeEventBase {
|
|
295
380
|
type: ZTableChangeType;
|
|
296
381
|
}
|
|
@@ -318,6 +403,10 @@ interface ZTableRowExpandChange<T> extends ZTableChangeEventBase {
|
|
|
318
403
|
type: 'rowExpand';
|
|
319
404
|
data: ZTableRowExpandEvent<T>;
|
|
320
405
|
}
|
|
406
|
+
interface ZTableRowDragChange<T> extends ZTableChangeEventBase {
|
|
407
|
+
type: 'rowDrag';
|
|
408
|
+
data: ZTableRowDragEvent<T>;
|
|
409
|
+
}
|
|
321
410
|
interface ZTableCellClickChange<T> extends ZTableChangeEventBase {
|
|
322
411
|
type: 'cellClick';
|
|
323
412
|
data: ZTableCellClickEvent<T>;
|
|
@@ -346,7 +435,21 @@ interface ZTableCellEditChange<T> extends ZTableChangeEventBase {
|
|
|
346
435
|
type: 'cellEdit';
|
|
347
436
|
data: ZTableCellEditEvent<T>;
|
|
348
437
|
}
|
|
349
|
-
|
|
438
|
+
/**
|
|
439
|
+
* Unified change event emitted via `zChange` output.
|
|
440
|
+
* Parent components can use `event.type` to narrow the discriminated union.
|
|
441
|
+
*
|
|
442
|
+
* Example:
|
|
443
|
+
* ```ts
|
|
444
|
+
* onTableChange(event: ZTableChangeEvent<MyRow>) {
|
|
445
|
+
* if (event.type === 'page') {
|
|
446
|
+
* // event.data is ZTablePageChangeEvent
|
|
447
|
+
* }
|
|
448
|
+
* }
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
type ZTableChangeEvent<T> = ZTablePageChange | ZTableSortChange | ZTableFilterChange | ZTableSearchChange | ZTableSelectChange | ZTableExpandChange | ZTableRowSelectChange<T> | ZTableRowSelectAllChange<T> | ZTableRowExpandChange<T> | ZTableRowDragChange<T> | ZTableCellClickChange<T> | ZTableCellEditChange<T> | ZTableActionChange<T>;
|
|
452
|
+
/** Initial table state — applied on first render, before any cached config is loaded */
|
|
350
453
|
interface ZTableInitialState {
|
|
351
454
|
columnPinning?: ColumnPinningState;
|
|
352
455
|
rowPinning?: RowPinningState;
|
|
@@ -425,22 +528,47 @@ interface ZTableSearchConfig {
|
|
|
425
528
|
width?: string;
|
|
426
529
|
size?: ZInputSize;
|
|
427
530
|
}
|
|
531
|
+
interface ZTableVirtualColumnConfig {
|
|
532
|
+
/** Enable horizontal column virtualization for center columns only */
|
|
533
|
+
enabled: boolean;
|
|
534
|
+
/** Number of columns to render outside the visible range */
|
|
535
|
+
overscan?: number;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Top-level configuration passed via `[zConfig]` input.
|
|
539
|
+
* This is the primary API surface for consumers of z-table.
|
|
540
|
+
*/
|
|
428
541
|
interface ZTableConfig<T> {
|
|
542
|
+
/** 'local' = client-side operations; 'server' = parent handles data fetching */
|
|
429
543
|
mode?: ZTableMode;
|
|
544
|
+
/** Row data array — for server mode, this is the current page's data */
|
|
430
545
|
data: T[];
|
|
546
|
+
/** Enables drag-and-drop row reordering for compatible local-table states */
|
|
547
|
+
enableRowDragging?: boolean;
|
|
548
|
+
/** Total row count for server-side pagination (aliased as totalRows) */
|
|
431
549
|
totalCount?: number;
|
|
550
|
+
/** Column definitions */
|
|
432
551
|
columns: ZTableColumnConfig<T>[];
|
|
552
|
+
/** Custom row ID generator — critical for selection/expansion state stability */
|
|
433
553
|
getRowId?: (row: T, index: number, parent: T | undefined, data: T[]) => string;
|
|
554
|
+
/** Sub-row accessor for tree/hierarchical data */
|
|
434
555
|
getSubRows?: (row: T, index: number, parent: T | undefined, data: T[]) => T[] | undefined;
|
|
556
|
+
/** @deprecated Use totalCount instead */
|
|
435
557
|
totalRows?: number;
|
|
558
|
+
/** true = enable with defaults; object = full virtual scroll config */
|
|
436
559
|
virtual?: ZTableVirtualConfig | boolean;
|
|
560
|
+
/** true = enable with defaults; object = full horizontal column virtualization config */
|
|
561
|
+
virtualColumns?: ZTableVirtualColumnConfig | boolean;
|
|
437
562
|
showHorizontalBorder?: boolean;
|
|
438
563
|
showVerticalBorder?: boolean;
|
|
439
564
|
showHeaderShadow?: boolean;
|
|
440
565
|
showFooterShadow?: boolean;
|
|
566
|
+
/** Show the settings drawer toggle button */
|
|
441
567
|
enableSettings?: boolean;
|
|
442
568
|
enableColumnResizing?: boolean;
|
|
569
|
+
/** When true, shift-click sorting is simulated automatically */
|
|
443
570
|
enableMultiSort?: boolean;
|
|
571
|
+
/** true = enable with defaults; object = full search bar config */
|
|
444
572
|
search?: ZTableSearchConfig | boolean;
|
|
445
573
|
enableRowPinning?: boolean;
|
|
446
574
|
enableColumnPinning?: boolean;
|
|
@@ -449,15 +577,20 @@ interface ZTableConfig<T> {
|
|
|
449
577
|
pagination?: ZTablePaginationConfig;
|
|
450
578
|
initialState?: ZTableInitialState;
|
|
451
579
|
loading?: boolean;
|
|
580
|
+
/** Template rendered when a row is expanded */
|
|
452
581
|
expandedRowTemplate?: TemplateRef<{
|
|
453
582
|
$implicit: Row<T>;
|
|
454
583
|
}>;
|
|
584
|
+
/** Template rendered when no data matches */
|
|
455
585
|
emptyTemplate?: TemplateRef<void>;
|
|
586
|
+
/** Template rendered during loading state */
|
|
456
587
|
loadingTemplate?: TemplateRef<void>;
|
|
457
588
|
getRowCanExpand?: (row: Row<T>) => boolean;
|
|
458
589
|
maxHeight?: string;
|
|
459
590
|
minHeight?: string;
|
|
591
|
+
/** Debounce time (ms) for async state updates; defaults to Z_DEFAULT_DEBOUNCE_TIME */
|
|
460
592
|
debounceTime?: number;
|
|
593
|
+
/** Use skeleton rows instead of loading spinner */
|
|
461
594
|
useSkeleton?: boolean;
|
|
462
595
|
}
|
|
463
596
|
interface ZTableEditCellChangeEvent<T = unknown> {
|
|
@@ -478,6 +611,10 @@ interface ZResolvedEditConfig {
|
|
|
478
611
|
disabled: boolean;
|
|
479
612
|
readonly: boolean;
|
|
480
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* Extends TanStack's TableMeta to add a custom `updateData` callback.
|
|
616
|
+
* This is used by inline edit cells to notify the table of value changes.
|
|
617
|
+
*/
|
|
481
618
|
declare module '@tanstack/angular-table' {
|
|
482
619
|
interface TableMeta<TData extends RowData> {
|
|
483
620
|
updateData?: (rowIndex: number, columnId: string, value: unknown) => void;
|
|
@@ -485,22 +622,37 @@ declare module '@tanstack/angular-table' {
|
|
|
485
622
|
}
|
|
486
623
|
|
|
487
624
|
declare class ZTableComponent<T> implements AfterViewInit {
|
|
625
|
+
/** Unified change event — parent listens to this for all table interactions */
|
|
488
626
|
readonly zChange: _angular_core.OutputEmitterRef<ZTableChangeEvent<T>>;
|
|
627
|
+
/** Emits an imperative control handle for programmatic table manipulation */
|
|
489
628
|
readonly zControl: _angular_core.OutputEmitterRef<ZTableControl<T>>;
|
|
629
|
+
/** Extra CSS classes merged onto the table container */
|
|
490
630
|
readonly zClass: _angular_core.InputSignal<ClassValue>;
|
|
631
|
+
/** Main configuration — data, columns, mode, features */
|
|
491
632
|
readonly zConfig: _angular_core.InputSignal<ZTableConfig<T>>;
|
|
633
|
+
/** External loading state (complementary to config.loading) */
|
|
492
634
|
readonly zLoading: _angular_core.InputSignal<boolean>;
|
|
635
|
+
/** Cache key for persisting column settings; no persistence when empty */
|
|
493
636
|
readonly zKey: _angular_core.InputSignal<string>;
|
|
637
|
+
/** Visual variant: 'default' has card shadow, 'borderless' has no container border */
|
|
494
638
|
readonly zVariant: _angular_core.InputSignal<"default" | "borderless">;
|
|
495
639
|
private readonly _destroy$;
|
|
496
640
|
private readonly _zTranslate;
|
|
641
|
+
/** Prevents recursive scroll sync between thead/tbody/tfoot */
|
|
497
642
|
private readonly _isSyncingScroll;
|
|
643
|
+
/** Preserves horizontal scroll position across loading states */
|
|
498
644
|
private readonly _savedScrollLeft;
|
|
645
|
+
/** Observes tbody container height changes for skeleton row count calculation */
|
|
499
646
|
private _resizeObserver;
|
|
647
|
+
/** Debounces rapid settings changes (visibility/pin toggles) */
|
|
500
648
|
private _settingsDebounceTimeout;
|
|
649
|
+
/** Debounces filter change emissions to server */
|
|
501
650
|
private _filterEmitDebounceTimeout;
|
|
651
|
+
/** Merged loading state from both zLoading input and config.loading */
|
|
502
652
|
protected readonly isLoading: _angular_core.Signal<boolean>;
|
|
653
|
+
/** True during debounced async state transitions (sort/filter processing) */
|
|
503
654
|
protected readonly isProcessing: _angular_core.WritableSignal<boolean>;
|
|
655
|
+
protected readonly isDraggingRow: _angular_core.WritableSignal<boolean>;
|
|
504
656
|
protected readonly theadWrapper: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
505
657
|
protected readonly tbodyContainer: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
506
658
|
protected readonly tbodyWrapper: _angular_core.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
@@ -516,38 +668,65 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
516
668
|
protected readonly rowPinning: _angular_core.WritableSignal<RowPinningState>;
|
|
517
669
|
protected readonly columnFilters: _angular_core.WritableSignal<ColumnFiltersState>;
|
|
518
670
|
protected readonly globalFilter: _angular_core.WritableSignal<string>;
|
|
671
|
+
/** Note: pageIndex is 1-based here; converted to 0-based for TanStack via _tanstackPagination */
|
|
519
672
|
protected readonly pagination: _angular_core.WritableSignal<PaginationState>;
|
|
520
673
|
protected readonly sorting: _angular_core.WritableSignal<SortingState>;
|
|
674
|
+
/**
|
|
675
|
+
* Caches the last server-provided total to avoid flickering to 0
|
|
676
|
+
* during loading transitions in server-side pagination mode.
|
|
677
|
+
*/
|
|
521
678
|
private readonly _serverPaginationTotal;
|
|
679
|
+
/** Container CSS classes combining variant + user-provided classes */
|
|
522
680
|
protected readonly classTable: _angular_core.Signal<string>;
|
|
681
|
+
/** Convert 1-based pagination to TanStack's 0-based pageIndex */
|
|
523
682
|
private readonly _tanstackPagination;
|
|
524
683
|
private readonly _configPagination;
|
|
525
684
|
protected readonly paginationTotal: _angular_core.Signal<number>;
|
|
526
685
|
protected readonly hasVerticalScroll: _angular_core.WritableSignal<boolean>;
|
|
527
686
|
protected readonly hasHorizontalScroll: _angular_core.WritableSignal<boolean>;
|
|
687
|
+
/** True when the last row touches or extends past the container bottom (no gap) */
|
|
528
688
|
protected readonly lastRowTouchesBottom: _angular_core.WritableSignal<boolean>;
|
|
529
689
|
protected readonly showSettingsDrawer: _angular_core.WritableSignal<boolean>;
|
|
530
690
|
protected readonly showHorizontalBorder: _angular_core.WritableSignal<boolean>;
|
|
531
691
|
protected readonly showVerticalBorder: _angular_core.WritableSignal<boolean>;
|
|
532
692
|
protected readonly showHeaderFooterShadow: _angular_core.WritableSignal<boolean>;
|
|
693
|
+
/** True when table body is scrolled away from left edge (shows left pin shadow) */
|
|
533
694
|
protected readonly hasScrollLeft: _angular_core.WritableSignal<boolean>;
|
|
695
|
+
/** True when table has right-pinned columns and body isn't scrolled to the end */
|
|
534
696
|
protected readonly hasScrollRight: _angular_core.WritableSignal<boolean>;
|
|
697
|
+
/** Maps row IDs to measured DOM heights for pinned row offset calculations */
|
|
535
698
|
protected readonly pinnedRowHeights: _angular_core.WritableSignal<Record<string, number>>;
|
|
699
|
+
/** Bumped to force recomputation of pinned column IDs after programmatic pin changes */
|
|
536
700
|
private readonly _columnPinVersion;
|
|
701
|
+
/** Bumped to trigger data refresh (e.g., after addItem/deleteItem via control API) */
|
|
537
702
|
private readonly _dataForceUpdate;
|
|
703
|
+
/** Stores a temporary locally reordered dataset until parent pushes a new data reference */
|
|
704
|
+
private readonly _rowDragDataOverride;
|
|
705
|
+
/** Tracks the latest external data array reference to detect parent-driven refreshes */
|
|
706
|
+
private _lastExternalDataRef;
|
|
707
|
+
/** Set when a single row is updated via control API (for targeted re-render) */
|
|
538
708
|
protected readonly _rowUpdate: _angular_core.WritableSignal<{
|
|
539
709
|
rowId: string;
|
|
540
710
|
updates: Record<string, unknown>;
|
|
541
711
|
} | null>;
|
|
712
|
+
/**
|
|
713
|
+
* Column config lookup cache — cleared when column reference changes.
|
|
714
|
+
* Avoids repeated recursive searches during render cycles.
|
|
715
|
+
*/
|
|
542
716
|
private _columnConfigCache;
|
|
543
717
|
private _lastColumnsRef;
|
|
544
718
|
protected readonly pinnedColumnIds: _angular_core.Signal<string[]>;
|
|
545
719
|
protected readonly pendingVisibleColumns: _angular_core.WritableSignal<string[]>;
|
|
546
720
|
protected readonly pendingColumnOrder: _angular_core.WritableSignal<string[]>;
|
|
547
721
|
protected readonly pendingShowHeaderFooterShadow: _angular_core.WritableSignal<boolean>;
|
|
722
|
+
/** True if ANY body column uses rowSpan — affects virtual grouping and expand column behavior */
|
|
548
723
|
protected readonly hasBodyRowSpan: _angular_core.Signal<boolean>;
|
|
549
724
|
protected readonly hasSelectColumn: _angular_core.Signal<boolean>;
|
|
550
725
|
protected readonly hasExpandColumn: _angular_core.Signal<boolean>;
|
|
726
|
+
protected readonly hasRowDragColumn: _angular_core.Signal<boolean>;
|
|
727
|
+
protected readonly canUseRowDrag: _angular_core.Signal<boolean>;
|
|
728
|
+
protected readonly isVirtualRowDragEnabled: _angular_core.Signal<boolean>;
|
|
729
|
+
protected readonly isRowDragEnabled: _angular_core.Signal<boolean>;
|
|
551
730
|
protected readonly actionColumnInfo: _angular_core.Signal<{
|
|
552
731
|
columnId: string;
|
|
553
732
|
config: ZTableActionColumnConfig<T>;
|
|
@@ -568,21 +747,49 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
568
747
|
size: _shival99_z_ui_components_z_input.ZInputSize;
|
|
569
748
|
} | null>;
|
|
570
749
|
protected readonly isSearchEnabled: _angular_core.Signal<boolean>;
|
|
750
|
+
/** Data signal with force-update support for control API mutations */
|
|
571
751
|
private readonly _data;
|
|
752
|
+
/**
|
|
753
|
+
* Converts ZTableColumnConfig[] into TanStack ColumnDef[].
|
|
754
|
+
* Handles special columns (select, expand, actionRowPin), action column sizing,
|
|
755
|
+
* and rowSpan/expand compatibility (expand column is removed when rowSpan is used).
|
|
756
|
+
*/
|
|
572
757
|
private readonly _columns;
|
|
573
758
|
protected readonly isVirtual: _angular_core.Signal<boolean>;
|
|
759
|
+
/** Normalized virtual config with defaults applied */
|
|
574
760
|
private readonly _virtualConfig;
|
|
575
761
|
protected readonly virtualRowHeight: _angular_core.Signal<number>;
|
|
576
762
|
protected readonly dynamicSize: _angular_core.Signal<boolean>;
|
|
763
|
+
private readonly _virtualColumnsConfig;
|
|
577
764
|
protected readonly groupSize: _angular_core.Signal<number>;
|
|
578
765
|
protected readonly groupHeight: _angular_core.Signal<number>;
|
|
579
766
|
private readonly _dynamicGroupsVersion;
|
|
767
|
+
/**
|
|
768
|
+
* Groups rows for virtual scrolling. When rowSpan is used, rows that share
|
|
769
|
+
* a merged cell are grouped together so the virtualizer treats them as
|
|
770
|
+
* a single unit, preserving the visual merge across scroll boundaries.
|
|
771
|
+
*/
|
|
580
772
|
protected readonly dynamicGroups: _angular_core.Signal<ZVirtualGroup[]>;
|
|
581
773
|
protected readonly hasFooter: _angular_core.Signal<boolean>;
|
|
582
774
|
protected readonly isEmpty: _angular_core.Signal<boolean>;
|
|
583
775
|
protected readonly isEmptyData: _angular_core.Signal<boolean>;
|
|
584
776
|
protected readonly isNoSearchResults: _angular_core.Signal<boolean>;
|
|
585
|
-
protected readonly
|
|
777
|
+
protected readonly leftLeafColumns: _angular_core.Signal<Column<T, unknown>[]>;
|
|
778
|
+
protected readonly centerLeafColumns: _angular_core.Signal<Column<T, unknown>[]>;
|
|
779
|
+
protected readonly rightLeafColumns: _angular_core.Signal<Column<T, unknown>[]>;
|
|
780
|
+
protected readonly hasComplexColumnLayout: _angular_core.Signal<boolean>;
|
|
781
|
+
protected readonly canUseVirtualColumns: _angular_core.Signal<boolean>;
|
|
782
|
+
protected readonly columnVirtualizer: _shival99_angular_virtual.AngularVirtualizer<HTMLDivElement, Element>;
|
|
783
|
+
protected readonly virtualCenterColumnItems: _angular_core.Signal<_shival99_angular_virtual.VirtualItem[]>;
|
|
784
|
+
protected readonly virtualCenterColumns: _angular_core.Signal<Column<T, unknown>[]>;
|
|
785
|
+
protected readonly virtualCenterColumnVisibilityMap: _angular_core.Signal<Record<string, boolean>>;
|
|
786
|
+
protected readonly firstVirtualCenterColumnId: _angular_core.Signal<string>;
|
|
787
|
+
protected readonly lastVirtualCenterColumnId: _angular_core.Signal<string>;
|
|
788
|
+
protected readonly virtualLeftSpacerWidth: _angular_core.Signal<number>;
|
|
789
|
+
protected readonly virtualCenterTotalWidth: _angular_core.Signal<number>;
|
|
790
|
+
protected readonly virtualRightSpacerWidth: _angular_core.Signal<number>;
|
|
791
|
+
protected readonly renderedColumnCount: _angular_core.Signal<number>;
|
|
792
|
+
protected readonly orderedLeafColumns: _angular_core.Signal<Column<T, unknown>[]>;
|
|
586
793
|
protected readonly orderedHeaderGroups: _angular_core.Signal<{
|
|
587
794
|
id: string;
|
|
588
795
|
headers: _tanstack_angular_table.Header<T, unknown>[];
|
|
@@ -593,6 +800,14 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
593
800
|
headers: _tanstack_angular_table.Header<T, unknown>[];
|
|
594
801
|
}[]>;
|
|
595
802
|
protected readonly bottomRowsReversed: _angular_core.Signal<Row<T>[]>;
|
|
803
|
+
protected readonly leftHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
804
|
+
protected readonly centerHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
805
|
+
protected readonly rightHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
806
|
+
protected readonly leftFooterRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
807
|
+
protected readonly centerFooterRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
808
|
+
protected readonly rightFooterRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
809
|
+
protected readonly virtualCenterHeaderRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
810
|
+
protected readonly virtualCenterFooterRow: _angular_core.Signal<_tanstack_angular_table.Header<T, unknown>[]>;
|
|
596
811
|
protected readonly totalWidth: _angular_core.Signal<number>;
|
|
597
812
|
protected readonly shouldHeaderShowShadow: _angular_core.Signal<boolean>;
|
|
598
813
|
protected readonly shouldFooterShowShadow: _angular_core.Signal<boolean>;
|
|
@@ -608,11 +823,22 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
608
823
|
protected readonly columnSizeVars: _angular_core.Signal<Record<string, number>>;
|
|
609
824
|
protected readonly table: ReturnType<typeof createAngularTable<T>>;
|
|
610
825
|
private readonly _virtualGroupCount;
|
|
826
|
+
/** Virtualizer instance — operates on groups rather than individual rows */
|
|
611
827
|
protected readonly virtualizer: _shival99_angular_virtual.AngularVirtualizer<HTMLDivElement, Element>;
|
|
612
828
|
private readonly _measureVirtualItems;
|
|
613
829
|
constructor();
|
|
614
830
|
ngAfterViewInit(): void;
|
|
831
|
+
/**
|
|
832
|
+
* Syncs parent row selection state based on children.
|
|
833
|
+
* If all children are selected, the parent is auto-selected;
|
|
834
|
+
* if no children are selected, the parent is deselected.
|
|
835
|
+
*/
|
|
615
836
|
private _handleRowSelectionWithParents;
|
|
837
|
+
/**
|
|
838
|
+
* Wraps state mutations with a debounced processing indicator.
|
|
839
|
+
* Shows a brief loading state to prevent UI flicker during
|
|
840
|
+
* filter/sort recomputation on large datasets.
|
|
841
|
+
*/
|
|
616
842
|
private _runAsyncStateUpdate;
|
|
617
843
|
private _emitFilterChangeDebounced;
|
|
618
844
|
private _checkScrollState;
|
|
@@ -624,8 +850,13 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
624
850
|
hasRightPinnedColumns(): boolean;
|
|
625
851
|
onTbodyScroll(event: Event): void;
|
|
626
852
|
private _syncScrollLeft;
|
|
853
|
+
/** Handles sort click; auto-adds shiftKey for multi-sort when enabled */
|
|
627
854
|
handleSort(event: Event, handler?: (event: unknown) => void): void;
|
|
628
855
|
onColumnDrop(event: CdkDragDrop<string[]>): void;
|
|
856
|
+
onRowDragStarted(): void;
|
|
857
|
+
onRowDragEnded(_event: CdkDragEnd<Row<T>>): void;
|
|
858
|
+
onRowDrop(event: CdkDragDrop<Row<T>[]>): void;
|
|
859
|
+
private _resolveRowDragDropIndex;
|
|
629
860
|
onToggleAllColumns(): void;
|
|
630
861
|
onPageChange(event: {
|
|
631
862
|
pageIndex: number;
|
|
@@ -646,9 +877,16 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
646
877
|
moveColumnRight(columnId: string): void;
|
|
647
878
|
isFirstMovableColumn(columnId: string): boolean;
|
|
648
879
|
isLastMovableColumn(columnId: string): boolean;
|
|
880
|
+
/** Saves current column layout, sizing, pinning, and visibility to ZCacheService */
|
|
649
881
|
private _saveConfig;
|
|
650
882
|
private _collectColumnInfo;
|
|
883
|
+
/** Loads cached config from ZCacheService; validates schema compatibility first */
|
|
651
884
|
private _loadConfigCache;
|
|
885
|
+
/**
|
|
886
|
+
* Validates cached column info against current config.
|
|
887
|
+
* Returns false if columns have been added/removed/renamed since cache was saved,
|
|
888
|
+
* which triggers cache invalidation.
|
|
889
|
+
*/
|
|
652
890
|
private _isColumnConfigValid;
|
|
653
891
|
private _getChangedFilterColumnIds;
|
|
654
892
|
private _getChangedSortColumnIds;
|
|
@@ -656,6 +894,10 @@ declare class ZTableComponent<T> implements AfterViewInit {
|
|
|
656
894
|
private _isColumnSortModeLocal;
|
|
657
895
|
private _filterServerModeColumnFilters;
|
|
658
896
|
private _filterServerModeSorting;
|
|
897
|
+
/**
|
|
898
|
+
* Recursively finds a column config by ID with caching.
|
|
899
|
+
* Cache is invalidated when the column array reference changes.
|
|
900
|
+
*/
|
|
659
901
|
private _findColumnConfig;
|
|
660
902
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZTableComponent<any>, never>;
|
|
661
903
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZTableComponent<any>, "z-table", ["zTable"], { "zClass": { "alias": "zClass"; "required": false; "isSignal": true; }; "zConfig": { "alias": "zConfig"; "required": false; "isSignal": true; }; "zLoading": { "alias": "zLoading"; "required": false; "isSignal": true; }; "zKey": { "alias": "zKey"; "required": false; "isSignal": true; }; "zVariant": { "alias": "zVariant"; "required": false; "isSignal": true; }; }, { "zChange": "zChange"; "zControl": "zControl"; }, never, never, true, never>;
|
|
@@ -771,9 +1013,13 @@ declare class ZTableEditCellComponent<T = unknown> implements OnInit {
|
|
|
771
1013
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZTableEditCellComponent<any>, "z-table-edit-cell", never, { "zRow": { "alias": "zRow"; "required": true; "isSignal": true; }; "zRowId": { "alias": "zRowId"; "required": true; "isSignal": true; }; "zRowIndex": { "alias": "zRowIndex"; "required": true; "isSignal": true; }; "zColumnId": { "alias": "zColumnId"; "required": true; "isSignal": true; }; "zValue": { "alias": "zValue"; "required": false; "isSignal": true; }; "zEditConfig": { "alias": "zEditConfig"; "required": false; "isSignal": true; }; "zRowUpdate": { "alias": "zRowUpdate"; "required": false; "isSignal": true; }; }, { "zChange": "zChange"; }, never, never, true, never>;
|
|
772
1014
|
}
|
|
773
1015
|
|
|
1016
|
+
/** Type guard: is this a full header config object (not just content shorthand)? */
|
|
774
1017
|
declare const isHeaderConfig: <T>(config: ZTableHeaderColumnConfig<T> | ZTableHeaderContent<T> | undefined) => config is ZTableHeaderColumnConfig<T>;
|
|
1018
|
+
/** Type guard: is this a full body config object (not just content shorthand)? */
|
|
775
1019
|
declare const isBodyConfig: <T>(config: ZTableBodyColumnConfig<T> | ZTableCellContent<T> | undefined) => config is ZTableBodyColumnConfig<T>;
|
|
1020
|
+
/** Type guard: is this a full footer config object (not just content shorthand)? */
|
|
776
1021
|
declare const isFooterConfig: <T>(config: ZTableFooterColumnConfig<T> | ZTableHeaderContent<T> | undefined) => config is ZTableFooterColumnConfig<T>;
|
|
1022
|
+
/** Extract and normalize header config from a column definition */
|
|
777
1023
|
declare const getHeaderConfig: <T>(col: ZTableColumnConfig<T> | undefined) => {
|
|
778
1024
|
content: ZTableHeaderContent<T> | undefined;
|
|
779
1025
|
class: string | undefined;
|
|
@@ -795,6 +1041,10 @@ declare const getHeaderConfig: <T>(col: ZTableColumnConfig<T> | undefined) => {
|
|
|
795
1041
|
contentClass: string | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => string) | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => string) | undefined;
|
|
796
1042
|
contentStyle: Record<string, string> | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => Record<string, string>) | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => Record<string, string>) | undefined;
|
|
797
1043
|
};
|
|
1044
|
+
/**
|
|
1045
|
+
* Extract and normalize body config from a column definition.
|
|
1046
|
+
* Resolves dynamic properties (class, style, rowSpan, etc.) when CellContext is provided.
|
|
1047
|
+
*/
|
|
798
1048
|
declare const getBodyConfig: <T>(col: ZTableColumnConfig<T> | undefined, ctx?: CellContext<T, unknown>) => {
|
|
799
1049
|
content: ZTableCellContent<T> | undefined;
|
|
800
1050
|
class: string | undefined;
|
|
@@ -837,7 +1087,19 @@ declare const getFooterConfig: <T>(col: ZTableColumnConfig<T> | undefined) => {
|
|
|
837
1087
|
contentClass: string | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => string) | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => string) | undefined;
|
|
838
1088
|
contentStyle: Record<string, string> | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => Record<string, string>) | ((info: _tanstack_angular_table.HeaderContext<T, unknown>) => Record<string, string>) | undefined;
|
|
839
1089
|
};
|
|
1090
|
+
/** Recursively search for a column config by ID within a (possibly nested) column array */
|
|
840
1091
|
declare const findColumnConfig: <T>(columnId: string, columns: ZTableColumnConfig<T>[]) => ZTableColumnConfig<T> | undefined;
|
|
1092
|
+
/**
|
|
1093
|
+
* Converts the consumer-facing ZTableColumnConfig into a TanStack ColumnDef.
|
|
1094
|
+
* This is the bridge between the z-table API and TanStack Table internals.
|
|
1095
|
+
*
|
|
1096
|
+
* Handles:
|
|
1097
|
+
* - Accessor mapping (accessorKey / accessorFn)
|
|
1098
|
+
* - Header/body/footer content resolution
|
|
1099
|
+
* - Sort and filter function wiring (local vs server mode)
|
|
1100
|
+
* - Built-in filter functions for each filter type
|
|
1101
|
+
* - Recursive nested column conversion
|
|
1102
|
+
*/
|
|
841
1103
|
declare function columnConfigToColumnDef<T>(config: ZTableColumnConfig<T>): ColumnDef<T>;
|
|
842
1104
|
|
|
843
1105
|
export { ZTableActionsComponent, ZTableComponent, ZTableEditCellComponent, ZTableFilterComponent, ZTableIconTextComponent, columnConfigToColumnDef, findColumnConfig, getBodyConfig, getFooterConfig, getHeaderConfig, isBodyConfig, isFooterConfig, isHeaderConfig };
|
|
@@ -20,7 +20,7 @@ interface ZTab {
|
|
|
20
20
|
badge?: string | number;
|
|
21
21
|
template?: TemplateRef<unknown>;
|
|
22
22
|
}
|
|
23
|
-
type ZTabsType = 'line' | 'enclosed' | 'enclosed-solid' | 'soft' | 'pill' | 'solid' | 'underline';
|
|
23
|
+
type ZTabsType = 'line' | 'enclosed' | 'enclosed-solid' | 'soft' | 'pill' | 'solid' | 'underline' | 'code-line';
|
|
24
24
|
type ZTabsSize = 'sm' | 'default' | 'lg';
|
|
25
25
|
type ZTabsOrientation = 'horizontal' | 'vertical';
|
|
26
26
|
|
|
@@ -62,11 +62,11 @@ declare class ZTabsComponent implements AfterViewInit, OnDestroy {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
declare const zTabsVariants: (props?: ({
|
|
65
|
-
zType?: "line" | "enclosed" | "enclosed-solid" | "soft" | "pill" | "solid" | "underline" | null | undefined;
|
|
65
|
+
zType?: "line" | "enclosed" | "enclosed-solid" | "soft" | "pill" | "solid" | "underline" | "code-line" | null | undefined;
|
|
66
66
|
zOrientation?: "horizontal" | "vertical" | null | undefined;
|
|
67
67
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
68
|
declare const zTabItemVariants: (props?: ({
|
|
69
|
-
zType?: "line" | "enclosed" | "enclosed-solid" | "soft" | "pill" | "solid" | "underline" | null | undefined;
|
|
69
|
+
zType?: "line" | "enclosed" | "enclosed-solid" | "soft" | "pill" | "solid" | "underline" | "code-line" | null | undefined;
|
|
70
70
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
71
71
|
zOrientation?: "horizontal" | "vertical" | null | undefined;
|
|
72
72
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|