@rozie-ui/data-table-lit 0.7.1 → 0.7.3
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/CHANGELOG.md +429 -0
- package/README.md +11 -11
- package/dist/index.cjs +97 -17
- package/dist/index.d.cts +174 -77
- package/dist/index.d.mts +174 -77
- package/dist/index.mjs +114 -34
- package/package.json +4 -3
- package/src/Column.ts +8 -6
- package/src/DataTable.ts +275 -206
- package/src/FilterNumberRange.ts +10 -1
- package/src/index.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,107 @@
|
|
|
1
1
|
import * as _$lit from "lit";
|
|
2
2
|
import { LitElement } from "lit";
|
|
3
|
+
import { Column as Column$1, ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, RowSelectionState, SortingState, VisibilityState } from "@tanstack/table-core";
|
|
4
|
+
|
|
3
5
|
//#region src/DataTable.d.ts
|
|
6
|
+
/** A cell position as integers over the visible (display-order) model. */
|
|
7
|
+
interface DataTableCellPosition {
|
|
8
|
+
rowIndex: number;
|
|
9
|
+
colIndex: number;
|
|
10
|
+
}
|
|
11
|
+
/** The active (roving-focus) cell. A header cell reports `rowIndex: null` and `isHeader: true`. */
|
|
12
|
+
interface DataTableActiveCell {
|
|
13
|
+
rowIndex: number | null;
|
|
14
|
+
colIndex: number;
|
|
15
|
+
isHeader: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** The rectangular cell-range selection. Both corners are `null` when there is no range. */
|
|
18
|
+
interface DataTableRange {
|
|
19
|
+
anchor: DataTableCellPosition | null;
|
|
20
|
+
focus: DataTableCellPosition | null;
|
|
21
|
+
}
|
|
22
|
+
/** One data column offered to the `#groupBar` slot. */
|
|
23
|
+
interface DataTableGroupableColumn {
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
/** One changed cell inside a row edit commit. */
|
|
28
|
+
interface DataTableCellChange {
|
|
29
|
+
columnId: string;
|
|
30
|
+
oldValue: any;
|
|
31
|
+
newValue: any;
|
|
32
|
+
}
|
|
33
|
+
/** The `activecell-change` payload. `isHeader` is set when the move landed on or left a header cell. */
|
|
34
|
+
interface DataTableActiveCellChangePayload {
|
|
35
|
+
rowIndex: number | null;
|
|
36
|
+
colIndex: number;
|
|
37
|
+
isHeader?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** The `cell-edit-commit` payload: one committed cell. */
|
|
40
|
+
interface DataTableCellEditCommitPayload {
|
|
41
|
+
rowId: string;
|
|
42
|
+
columnId: string;
|
|
43
|
+
oldValue: any;
|
|
44
|
+
newValue: any;
|
|
45
|
+
}
|
|
46
|
+
/** The `row-edit-commit` payload: the row and every cell the save changed. */
|
|
47
|
+
interface DataTableRowEditCommitPayload {
|
|
48
|
+
rowId: string;
|
|
49
|
+
changes: DataTableCellChange[];
|
|
50
|
+
}
|
|
51
|
+
/** The `filter-change` payload: `globalFilter` for the search box, `columnFilters` for a per-column filter. Exactly one key is set. */
|
|
52
|
+
interface DataTableFilterChangePayload {
|
|
53
|
+
globalFilter?: string;
|
|
54
|
+
columnFilters?: ColumnFiltersState;
|
|
55
|
+
}
|
|
56
|
+
/** The `history-change` payload: undo/redo availability. */
|
|
57
|
+
interface DataTableHistoryChangePayload {
|
|
58
|
+
canUndo: boolean;
|
|
59
|
+
canRedo: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** The `range-change` payload: the new range corners (both `null` when the range cleared). */
|
|
62
|
+
type DataTableRangeChangePayload = DataTableRange;
|
|
63
|
+
/** The `row-activate` payload. `row` is the original data object and `index` its position in the rendered model. */
|
|
64
|
+
interface DataTableRowActivatePayload {
|
|
65
|
+
row: any;
|
|
66
|
+
index: number;
|
|
67
|
+
trigger: 'keyboard' | 'click';
|
|
68
|
+
}
|
|
69
|
+
/** The `visible-range-change` payload: the rendered row window, `end` exclusive. */
|
|
70
|
+
interface DataTableVisibleRangeChangePayload {
|
|
71
|
+
start: number;
|
|
72
|
+
end: number;
|
|
73
|
+
}
|
|
74
|
+
interface RozieDataTableEventMap extends Omit<HTMLElementEventMap, 'activecell-change' | 'cell-edit-commit' | 'expand-change' | 'filter-change' | 'group-change' | 'history-change' | 'page-change' | 'pin-change' | 'range-change' | 'reorder-change' | 'resize-change' | 'row-activate' | 'row-edit-commit' | 'selection-change' | 'sort-change' | 'visibility-change' | 'visible-range-change' | 'data-change' | 'sorting-change' | 'global-filter-change' | 'column-filters-change' | 'pagination-change' | 'expanded-change' | 'grouping-change' | 'row-selection-change' | 'column-visibility-change' | 'column-sizing-change' | 'column-order-change' | 'column-pinning-change'> {
|
|
75
|
+
'activecell-change': CustomEvent<DataTableActiveCellChangePayload>;
|
|
76
|
+
'cell-edit-commit': CustomEvent<DataTableCellEditCommitPayload>;
|
|
77
|
+
'expand-change': CustomEvent<ExpandedState>;
|
|
78
|
+
'filter-change': CustomEvent<DataTableFilterChangePayload>;
|
|
79
|
+
'group-change': CustomEvent<GroupingState>;
|
|
80
|
+
'history-change': CustomEvent<DataTableHistoryChangePayload>;
|
|
81
|
+
'page-change': CustomEvent<PaginationState>;
|
|
82
|
+
'pin-change': CustomEvent<ColumnPinningState>;
|
|
83
|
+
'range-change': CustomEvent<DataTableRangeChangePayload>;
|
|
84
|
+
'reorder-change': CustomEvent<ColumnOrderState>;
|
|
85
|
+
'resize-change': CustomEvent<ColumnSizingState>;
|
|
86
|
+
'row-activate': CustomEvent<DataTableRowActivatePayload>;
|
|
87
|
+
'row-edit-commit': CustomEvent<DataTableRowEditCommitPayload>;
|
|
88
|
+
'selection-change': CustomEvent<RowSelectionState>;
|
|
89
|
+
'sort-change': CustomEvent<SortingState>;
|
|
90
|
+
'visibility-change': CustomEvent<VisibilityState>;
|
|
91
|
+
'visible-range-change': CustomEvent<DataTableVisibleRangeChangePayload>;
|
|
92
|
+
'data-change': CustomEvent<any[]>;
|
|
93
|
+
'sorting-change': CustomEvent<any[]>;
|
|
94
|
+
'global-filter-change': CustomEvent<string>;
|
|
95
|
+
'column-filters-change': CustomEvent<any[]>;
|
|
96
|
+
'pagination-change': CustomEvent<any>;
|
|
97
|
+
'expanded-change': CustomEvent<any | boolean>;
|
|
98
|
+
'grouping-change': CustomEvent<any[]>;
|
|
99
|
+
'row-selection-change': CustomEvent<any>;
|
|
100
|
+
'column-visibility-change': CustomEvent<any>;
|
|
101
|
+
'column-sizing-change': CustomEvent<any>;
|
|
102
|
+
'column-order-change': CustomEvent<any[]>;
|
|
103
|
+
'column-pinning-change': CustomEvent<any>;
|
|
104
|
+
}
|
|
4
105
|
declare const DataTable_base: typeof LitElement;
|
|
5
106
|
declare class DataTable extends DataTable_base {
|
|
6
107
|
static shadowRootOptions: ShadowRootInit;
|
|
@@ -177,8 +278,10 @@ declare class DataTable extends DataTable_base {
|
|
|
177
278
|
private _liveAnnounce;
|
|
178
279
|
private _ref__rozieRoot;
|
|
179
280
|
private __rozieWatchInitial_0;
|
|
281
|
+
private __rozieWatchPrev_1;
|
|
180
282
|
private __rozieWatchInitial_1;
|
|
181
283
|
private __rozieWatchInitial_2;
|
|
284
|
+
private __rozieFirstUpdateDone;
|
|
182
285
|
private __rozieCtxProvider_data_table_columns;
|
|
183
286
|
private _rozieSlotDistributor;
|
|
184
287
|
private _hasSlotDefault;
|
|
@@ -186,17 +289,17 @@ declare class DataTable extends DataTable_base {
|
|
|
186
289
|
private _hasSlotGroupBar;
|
|
187
290
|
private _slotGroupBarElements;
|
|
188
291
|
groupBar?: (scope: {
|
|
189
|
-
grouping:
|
|
190
|
-
groupableColumns:
|
|
191
|
-
applyGrouping:
|
|
192
|
-
clearGrouping:
|
|
292
|
+
grouping: string[];
|
|
293
|
+
groupableColumns: DataTableGroupableColumn[];
|
|
294
|
+
applyGrouping: (cols: string[]) => void;
|
|
295
|
+
clearGrouping: () => void;
|
|
193
296
|
}) => unknown;
|
|
194
297
|
private _hasSlotSelectAll;
|
|
195
298
|
private _slotSelectAllElements;
|
|
196
299
|
selectAll?: (scope: {
|
|
197
|
-
checked:
|
|
198
|
-
indeterminate:
|
|
199
|
-
toggle: any;
|
|
300
|
+
checked: boolean;
|
|
301
|
+
indeterminate: boolean;
|
|
302
|
+
toggle: (event: any) => void;
|
|
200
303
|
}) => unknown;
|
|
201
304
|
private _hasSlotDynamicColHeader;
|
|
202
305
|
private _slotDynamicColHeaderElements;
|
|
@@ -205,15 +308,15 @@ declare class DataTable extends DataTable_base {
|
|
|
205
308
|
private _hasSlotPlaceholder;
|
|
206
309
|
private _slotPlaceholderElements;
|
|
207
310
|
placeholder?: (scope: {
|
|
208
|
-
index:
|
|
209
|
-
columnId:
|
|
311
|
+
index: number;
|
|
312
|
+
columnId: string;
|
|
210
313
|
}) => unknown;
|
|
211
314
|
private _hasSlotSelectCell;
|
|
212
315
|
private _slotSelectCellElements;
|
|
213
316
|
selectCell?: (scope: {
|
|
214
317
|
row: any;
|
|
215
|
-
checked:
|
|
216
|
-
toggle: any;
|
|
318
|
+
checked: boolean;
|
|
319
|
+
toggle: (event: any) => void;
|
|
217
320
|
}) => unknown;
|
|
218
321
|
private _hasSlotDynamicCell;
|
|
219
322
|
private _slotDynamicCellElements;
|
|
@@ -227,69 +330,69 @@ declare class DataTable extends DataTable_base {
|
|
|
227
330
|
private _hasSlotColHeader;
|
|
228
331
|
private _slotColHeaderElements;
|
|
229
332
|
colHeader?: (scope: {
|
|
230
|
-
columnId:
|
|
231
|
-
column: any
|
|
232
|
-
label:
|
|
333
|
+
columnId: string;
|
|
334
|
+
column: Column$1<any, unknown>;
|
|
335
|
+
label: string;
|
|
233
336
|
}) => unknown;
|
|
234
337
|
private _hasSlotFilter;
|
|
235
338
|
private _slotFilterElements;
|
|
236
339
|
filter?: (scope: {
|
|
237
|
-
columnId:
|
|
340
|
+
columnId: string;
|
|
238
341
|
value: any;
|
|
239
|
-
uniqueValues: any;
|
|
240
|
-
minMax:
|
|
241
|
-
columnLabel:
|
|
242
|
-
setFilter: any;
|
|
342
|
+
uniqueValues: any[];
|
|
343
|
+
minMax: [number, number] | null;
|
|
344
|
+
columnLabel: string;
|
|
345
|
+
setFilter: (columnId: string, value: any) => void;
|
|
243
346
|
}) => unknown;
|
|
244
347
|
private _hasSlotCell;
|
|
245
348
|
private _slotCellElements;
|
|
246
349
|
cell?: (scope: {
|
|
247
|
-
columnId:
|
|
248
|
-
column: any
|
|
350
|
+
columnId: string;
|
|
351
|
+
column: Column$1<any, unknown>;
|
|
249
352
|
row: any;
|
|
250
353
|
value: any;
|
|
251
354
|
}) => unknown;
|
|
252
355
|
private _hasSlotEditor;
|
|
253
356
|
private _slotEditorElements;
|
|
254
357
|
editor?: (scope: {
|
|
255
|
-
columnId:
|
|
256
|
-
column: any
|
|
358
|
+
columnId: string;
|
|
359
|
+
column: Column$1<any, unknown>;
|
|
257
360
|
row: any;
|
|
258
361
|
value: any;
|
|
259
|
-
commit: any;
|
|
260
|
-
cancel:
|
|
261
|
-
columnLabel:
|
|
262
|
-
autofocus:
|
|
362
|
+
commit: (value: any) => void;
|
|
363
|
+
cancel: () => void;
|
|
364
|
+
columnLabel: string;
|
|
365
|
+
autofocus: boolean;
|
|
263
366
|
}) => unknown;
|
|
264
367
|
rozieSlots?: {
|
|
265
368
|
[key: `colHeader-${string}`]: (scope: {
|
|
266
|
-
columnId:
|
|
267
|
-
column: any
|
|
268
|
-
label:
|
|
369
|
+
columnId: string;
|
|
370
|
+
column: Column$1<any, unknown>;
|
|
371
|
+
label: string;
|
|
269
372
|
}) => unknown;
|
|
270
373
|
[key: `filter-${string}`]: (scope: {
|
|
271
|
-
columnId:
|
|
374
|
+
columnId: string;
|
|
272
375
|
value: any;
|
|
273
|
-
uniqueValues: any;
|
|
274
|
-
minMax:
|
|
275
|
-
columnLabel:
|
|
276
|
-
setFilter: any;
|
|
376
|
+
uniqueValues: any[];
|
|
377
|
+
minMax: [number, number] | null;
|
|
378
|
+
columnLabel: string;
|
|
379
|
+
setFilter: (columnId: string, value: any) => void;
|
|
277
380
|
}) => unknown;
|
|
278
381
|
[key: `cell-${string}`]: (scope: {
|
|
279
|
-
columnId:
|
|
280
|
-
column: any
|
|
382
|
+
columnId: string;
|
|
383
|
+
column: Column$1<any, unknown>;
|
|
281
384
|
row: any;
|
|
282
385
|
value: any;
|
|
283
386
|
}) => unknown;
|
|
284
387
|
[key: `editor-${string}`]: (scope: {
|
|
285
|
-
columnId:
|
|
286
|
-
column: any
|
|
388
|
+
columnId: string;
|
|
389
|
+
column: Column$1<any, unknown>;
|
|
287
390
|
row: any;
|
|
288
391
|
value: any;
|
|
289
|
-
commit: any;
|
|
290
|
-
cancel:
|
|
291
|
-
columnLabel:
|
|
292
|
-
autofocus:
|
|
392
|
+
commit: (value: any) => void;
|
|
393
|
+
cancel: () => void;
|
|
394
|
+
columnLabel: string;
|
|
395
|
+
autofocus: boolean;
|
|
293
396
|
}) => unknown;
|
|
294
397
|
} & Record<string, (scope: any) => unknown>;
|
|
295
398
|
private _disconnectCleanups;
|
|
@@ -451,7 +554,7 @@ declare class DataTable extends DataTable_base {
|
|
|
451
554
|
align?: "start" | "center" | "end" | "auto";
|
|
452
555
|
behavior?: "auto" | "smooth" | "instant";
|
|
453
556
|
}) => void;
|
|
454
|
-
getScrollElement: () =>
|
|
557
|
+
getScrollElement: () => HTMLElement | null;
|
|
455
558
|
virtualItemKey: (i: any) => any;
|
|
456
559
|
COL_OVERSCAN: number;
|
|
457
560
|
colRtlObserver: any;
|
|
@@ -567,19 +670,19 @@ declare class DataTable extends DataTable_base {
|
|
|
567
670
|
hasAnyFilterableColumn: () => boolean;
|
|
568
671
|
selectAllBox: any;
|
|
569
672
|
syncIndeterminate: () => void;
|
|
570
|
-
sortColumn: (colId:
|
|
673
|
+
sortColumn: (colId: string, desc?: boolean) => void;
|
|
571
674
|
clearSorting: () => void;
|
|
572
|
-
getColumnDefs: () => any[];
|
|
573
|
-
toggleAllRows: (value
|
|
675
|
+
getColumnDefs: () => ColumnDef<any, any>[];
|
|
676
|
+
toggleAllRows: (value?: boolean) => void;
|
|
574
677
|
clearSelection: () => void;
|
|
575
|
-
getSelectedRows: () => any;
|
|
576
|
-
setPage: (idx:
|
|
577
|
-
setRowsPerPage: (size:
|
|
578
|
-
toggleColumnVisibility: (colId:
|
|
579
|
-
applyColumnOrder: (order:
|
|
678
|
+
getSelectedRows: () => any[];
|
|
679
|
+
setPage: (idx: number) => void;
|
|
680
|
+
setRowsPerPage: (size: number) => void;
|
|
681
|
+
toggleColumnVisibility: (colId: string) => void;
|
|
682
|
+
applyColumnOrder: (order: string[]) => void;
|
|
580
683
|
resetColumnSizing: () => void;
|
|
581
|
-
pinColumn: (colId:
|
|
582
|
-
getRowIndexRelativeToPage: (absRow
|
|
684
|
+
pinColumn: (colId: string, side: 'left' | 'right' | false) => void;
|
|
685
|
+
getRowIndexRelativeToPage: (absRow?: number) => number;
|
|
583
686
|
cut: () => void;
|
|
584
687
|
isGrid: () => boolean;
|
|
585
688
|
tableRole: () => "grid" | "table";
|
|
@@ -650,16 +753,7 @@ declare class DataTable extends DataTable_base {
|
|
|
650
753
|
rangeClickPending: any;
|
|
651
754
|
rangeActive: boolean;
|
|
652
755
|
inRange: (rIdx: any, cIdx: any) => boolean;
|
|
653
|
-
getSelectedRange: () =>
|
|
654
|
-
anchor: {
|
|
655
|
-
rowIndex: any;
|
|
656
|
-
colIndex: any;
|
|
657
|
-
};
|
|
658
|
-
focus: {
|
|
659
|
-
rowIndex: any;
|
|
660
|
-
colIndex: any;
|
|
661
|
-
};
|
|
662
|
-
};
|
|
756
|
+
getSelectedRange: () => DataTableRange;
|
|
663
757
|
isFillHandleCell: (rIdx: any, cIdx: any) => boolean;
|
|
664
758
|
rangeSummary: (anchor: any, focus: any) => string;
|
|
665
759
|
emitRangeChange: (anchor: any, focus: any) => void;
|
|
@@ -781,25 +875,21 @@ declare class DataTable extends DataTable_base {
|
|
|
781
875
|
onEditorKeyDown: (e: any) => void;
|
|
782
876
|
onEditorDropinKeyDown: (e: any) => void;
|
|
783
877
|
onEditorBlur: (e: any) => void;
|
|
784
|
-
editCell: (rowIndex:
|
|
878
|
+
editCell: (rowIndex: number, colIndex: number) => void;
|
|
785
879
|
commitEditing: () => void;
|
|
786
|
-
editRow: (rowIndex:
|
|
880
|
+
editRow: (rowIndex: number) => void;
|
|
787
881
|
focusAbsCellWhenReady: (absRow: any, localRow: any, col: any) => void;
|
|
788
|
-
focusCell: (rowIndex:
|
|
789
|
-
getActiveCell: () =>
|
|
790
|
-
rowIndex: any;
|
|
791
|
-
colIndex: number;
|
|
792
|
-
isHeader: boolean;
|
|
793
|
-
};
|
|
882
|
+
focusCell: (rowIndex: number, colIndex: number) => void;
|
|
883
|
+
getActiveCell: () => DataTableActiveCell;
|
|
794
884
|
clearActiveCell: () => void;
|
|
795
|
-
toggleRowExpanded: (rowId:
|
|
885
|
+
toggleRowExpanded: (rowId: string | number) => void;
|
|
796
886
|
expandAll: () => void;
|
|
797
887
|
collapseAll: () => void;
|
|
798
888
|
getExpandedRows: () => any[];
|
|
799
|
-
applyGrouping: (cols:
|
|
889
|
+
applyGrouping: (cols: string[]) => void;
|
|
800
890
|
clearGrouping: () => void;
|
|
801
|
-
getFacetedUniqueValues: (colId:
|
|
802
|
-
getFacetedMinMaxValues: (colId:
|
|
891
|
+
getFacetedUniqueValues: (colId: string) => any[];
|
|
892
|
+
getFacetedMinMaxValues: (colId: string) => [number, number] | null;
|
|
803
893
|
get data(): any[];
|
|
804
894
|
set data(v: any[]);
|
|
805
895
|
get sorting(): any[];
|
|
@@ -824,6 +914,10 @@ declare class DataTable extends DataTable_base {
|
|
|
824
914
|
set columnOrder(v: any[]);
|
|
825
915
|
get columnPinning(): any;
|
|
826
916
|
set columnPinning(v: any);
|
|
917
|
+
addEventListener<K extends keyof RozieDataTableEventMap>(type: K, listener: (this: DataTable, ev: RozieDataTableEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
918
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
919
|
+
removeEventListener<K extends keyof RozieDataTableEventMap>(type: K, listener: (this: DataTable, ev: RozieDataTableEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
920
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
827
921
|
}
|
|
828
922
|
//#endregion
|
|
829
923
|
//#region src/Column.d.ts
|
|
@@ -1264,10 +1358,13 @@ declare class FilterNumberRange extends FilterNumberRange_base {
|
|
|
1264
1358
|
private _minDraft;
|
|
1265
1359
|
private _maxDraft;
|
|
1266
1360
|
private _touched;
|
|
1361
|
+
private __rozieWatchPrev_0;
|
|
1267
1362
|
private __rozieWatchInitial_0;
|
|
1363
|
+
private __rozieFirstUpdateDone;
|
|
1268
1364
|
private _disconnectCleanups;
|
|
1269
1365
|
private _rozieTornDown;
|
|
1270
1366
|
firstUpdated(): void;
|
|
1367
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
1271
1368
|
disconnectedCallback(): void;
|
|
1272
1369
|
render(): _$lit.TemplateResult<1>;
|
|
1273
1370
|
minDraftValue: () => string;
|
|
@@ -1381,4 +1478,4 @@ declare class DetailPanel extends DetailPanel_base {
|
|
|
1381
1478
|
}[];
|
|
1382
1479
|
}
|
|
1383
1480
|
//#endregion
|
|
1384
|
-
export { Column, DataTable, DataTable as default, DetailPanel, EditorCheckbox, EditorDate, EditorNumber, EditorSelect, EditorText, FilterNumberRange, FilterSelect, FilterText, GroupBar };
|
|
1481
|
+
export { Column, DataTable, DataTable as default, DataTableActiveCell, DataTableActiveCellChangePayload, DataTableCellChange, DataTableCellEditCommitPayload, DataTableCellPosition, DataTableFilterChangePayload, DataTableGroupableColumn, DataTableHistoryChangePayload, DataTableRange, DataTableRangeChangePayload, DataTableRowActivatePayload, DataTableRowEditCommitPayload, DataTableVisibleRangeChangePayload, DetailPanel, EditorCheckbox, EditorDate, EditorNumber, EditorSelect, EditorText, FilterNumberRange, FilterSelect, FilterText, GroupBar, type RozieDataTableEventMap };
|
package/dist/index.mjs
CHANGED
|
@@ -417,6 +417,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
|
|
|
417
417
|
this.__rozieWatchInitial_0 = true;
|
|
418
418
|
this.__rozieWatchInitial_1 = true;
|
|
419
419
|
this.__rozieWatchInitial_2 = true;
|
|
420
|
+
this.__rozieFirstUpdateDone = false;
|
|
420
421
|
this.__rozieCtxProvider_data_table_columns = new ContextProvider(this, {
|
|
421
422
|
context: __rozieCtx_data_table_columns$1,
|
|
422
423
|
initialValue: ((__rozieCtxHost) => ({
|
|
@@ -4660,8 +4661,31 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
|
|
|
4660
4661
|
});
|
|
4661
4662
|
}));
|
|
4662
4663
|
this._disconnectCleanups.push(effect(() => {
|
|
4663
|
-
|
|
4664
|
+
const __watchVal = [
|
|
4665
|
+
this.sorting,
|
|
4666
|
+
this.globalFilter,
|
|
4667
|
+
this.columnFilters,
|
|
4668
|
+
this.pagination,
|
|
4669
|
+
this.rowCount,
|
|
4670
|
+
this.pageCount,
|
|
4671
|
+
this.rowSelection,
|
|
4672
|
+
this.expanded,
|
|
4673
|
+
this.expandable,
|
|
4674
|
+
this.grouping,
|
|
4675
|
+
this.groupable,
|
|
4676
|
+
this.columnVisibility,
|
|
4677
|
+
this.columnSizing,
|
|
4678
|
+
this.columnOrder,
|
|
4679
|
+
this.columnPinning,
|
|
4680
|
+
this.selectionMode,
|
|
4681
|
+
(this.data || []).length,
|
|
4682
|
+
this.data,
|
|
4683
|
+
this._dataDefault.value,
|
|
4684
|
+
this.columns,
|
|
4685
|
+
this._colReg.value
|
|
4686
|
+
];
|
|
4664
4687
|
untracked(() => {
|
|
4688
|
+
this.__rozieWatchPrev_1 = __watchVal;
|
|
4665
4689
|
if (this.__rozieWatchInitial_1) {
|
|
4666
4690
|
this.__rozieWatchInitial_1 = false;
|
|
4667
4691
|
return;
|
|
@@ -4829,15 +4853,51 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
|
|
|
4829
4853
|
this.announceState.globalFilter = this.effectiveGlobalFilter();
|
|
4830
4854
|
}
|
|
4831
4855
|
updated(changedProperties) {
|
|
4832
|
-
this.
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4856
|
+
if (this.__rozieFirstUpdateDone && (changedProperties.has("rowCount") || changedProperties.has("pageCount") || changedProperties.has("expandable") || changedProperties.has("groupable") || changedProperties.has("selectionMode") || changedProperties.has("columns"))) {
|
|
4857
|
+
const __watchVal = untracked(() => [
|
|
4858
|
+
this.sorting,
|
|
4859
|
+
this.globalFilter,
|
|
4860
|
+
this.columnFilters,
|
|
4861
|
+
this.pagination,
|
|
4862
|
+
this.rowCount,
|
|
4863
|
+
this.pageCount,
|
|
4864
|
+
this.rowSelection,
|
|
4865
|
+
this.expanded,
|
|
4866
|
+
this.expandable,
|
|
4867
|
+
this.grouping,
|
|
4868
|
+
this.groupable,
|
|
4869
|
+
this.columnVisibility,
|
|
4870
|
+
this.columnSizing,
|
|
4871
|
+
this.columnOrder,
|
|
4872
|
+
this.columnPinning,
|
|
4873
|
+
this.selectionMode,
|
|
4874
|
+
(this.data || []).length,
|
|
4875
|
+
this.data,
|
|
4876
|
+
this._dataDefault.value,
|
|
4877
|
+
this.columns,
|
|
4878
|
+
this._colReg.value
|
|
4879
|
+
]);
|
|
4880
|
+
if (!Object.is(__watchVal, this.__rozieWatchPrev_1)) {
|
|
4881
|
+
this.__rozieWatchPrev_1 = __watchVal;
|
|
4882
|
+
untracked(() => (() => {
|
|
4883
|
+
this.seedColumnPinning();
|
|
4884
|
+
this.reFeed();
|
|
4885
|
+
this.maybeClearHistoryOnExternalSwap();
|
|
4886
|
+
})());
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
this.__rozieFirstUpdateDone = true;
|
|
4890
|
+
(() => {
|
|
4891
|
+
this.maybeClearHistoryOnExternalSwap();
|
|
4892
|
+
this.emitVisibleRangeIfChanged();
|
|
4893
|
+
this.remeasureColumnSizes();
|
|
4894
|
+
if (!this.table) return;
|
|
4895
|
+
const d = this.currentData() || [];
|
|
4896
|
+
if (d === this.lastData && d.length === this.lastDataLen) return;
|
|
4897
|
+
this.lastData = d;
|
|
4898
|
+
this.lastDataLen = d.length;
|
|
4899
|
+
this.reFeed();
|
|
4900
|
+
})();
|
|
4841
4901
|
}
|
|
4842
4902
|
disconnectedCallback() {
|
|
4843
4903
|
super.disconnectedCallback();
|
|
@@ -5890,6 +5950,12 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
|
|
|
5890
5950
|
set columnPinning(v) {
|
|
5891
5951
|
this._columnPinningControllable.notifyPropertyWrite(v);
|
|
5892
5952
|
}
|
|
5953
|
+
addEventListener(type, listener, options) {
|
|
5954
|
+
super.addEventListener(type, listener, options);
|
|
5955
|
+
}
|
|
5956
|
+
removeEventListener(type, listener, options) {
|
|
5957
|
+
super.removeEventListener(type, listener, options);
|
|
5958
|
+
}
|
|
5893
5959
|
};
|
|
5894
5960
|
__decorate([property({
|
|
5895
5961
|
type: Array,
|
|
@@ -6086,7 +6152,7 @@ var DataTable_default = DataTable;
|
|
|
6086
6152
|
//#endregion
|
|
6087
6153
|
//#region src/Column.ts
|
|
6088
6154
|
const __rozieCtx_data_table_columns = createContext(Symbol.for("rozie:data-table:columns"));
|
|
6089
|
-
let Column = class Column extends SignalWatcher(LitElement) {
|
|
6155
|
+
let Column$1 = class Column extends SignalWatcher(LitElement) {
|
|
6090
6156
|
constructor(..._args) {
|
|
6091
6157
|
super(..._args);
|
|
6092
6158
|
this.id = "";
|
|
@@ -6156,12 +6222,14 @@ let Column = class Column extends SignalWatcher(LitElement) {
|
|
|
6156
6222
|
})();
|
|
6157
6223
|
}
|
|
6158
6224
|
this.__rozieFirstUpdateDone = true;
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6225
|
+
(() => {
|
|
6226
|
+
if (this.registered) return;
|
|
6227
|
+
const live = this.registry;
|
|
6228
|
+
if (live == null) return;
|
|
6229
|
+
this.reg = live;
|
|
6230
|
+
this.registered = true;
|
|
6231
|
+
this.reg.registerColumn(this.colId(), this.buildSpec());
|
|
6232
|
+
})();
|
|
6165
6233
|
}
|
|
6166
6234
|
disconnectedCallback() {
|
|
6167
6235
|
super.disconnectedCallback();
|
|
@@ -6182,55 +6250,55 @@ let Column = class Column extends SignalWatcher(LitElement) {
|
|
|
6182
6250
|
__decorate([property({
|
|
6183
6251
|
type: String,
|
|
6184
6252
|
reflect: true
|
|
6185
|
-
})], Column.prototype, "id", void 0);
|
|
6253
|
+
})], Column$1.prototype, "id", void 0);
|
|
6186
6254
|
__decorate([property({
|
|
6187
6255
|
type: String,
|
|
6188
6256
|
reflect: true
|
|
6189
|
-
})], Column.prototype, "field", void 0);
|
|
6257
|
+
})], Column$1.prototype, "field", void 0);
|
|
6190
6258
|
__decorate([property({
|
|
6191
6259
|
type: String,
|
|
6192
6260
|
reflect: true
|
|
6193
|
-
})], Column.prototype, "header", void 0);
|
|
6261
|
+
})], Column$1.prototype, "header", void 0);
|
|
6194
6262
|
__decorate([property({
|
|
6195
6263
|
type: Boolean,
|
|
6196
6264
|
reflect: true
|
|
6197
|
-
})], Column.prototype, "sortable", void 0);
|
|
6265
|
+
})], Column$1.prototype, "sortable", void 0);
|
|
6198
6266
|
__decorate([property({
|
|
6199
6267
|
type: Boolean,
|
|
6200
6268
|
reflect: true
|
|
6201
|
-
})], Column.prototype, "filterable", void 0);
|
|
6269
|
+
})], Column$1.prototype, "filterable", void 0);
|
|
6202
6270
|
__decorate([property({
|
|
6203
6271
|
type: String,
|
|
6204
6272
|
reflect: true
|
|
6205
|
-
})], Column.prototype, "pinned", void 0);
|
|
6206
|
-
__decorate([property({ converter: { fromAttribute: rozieNumberOrStringAttr } })], Column.prototype, "width", void 0);
|
|
6273
|
+
})], Column$1.prototype, "pinned", void 0);
|
|
6274
|
+
__decorate([property({ converter: { fromAttribute: rozieNumberOrStringAttr } })], Column$1.prototype, "width", void 0);
|
|
6207
6275
|
__decorate([property({
|
|
6208
6276
|
type: Boolean,
|
|
6209
6277
|
reflect: true
|
|
6210
|
-
})], Column.prototype, "expandable", void 0);
|
|
6278
|
+
})], Column$1.prototype, "expandable", void 0);
|
|
6211
6279
|
__decorate([property({
|
|
6212
6280
|
type: Boolean,
|
|
6213
6281
|
reflect: true
|
|
6214
|
-
})], Column.prototype, "groupable", void 0);
|
|
6282
|
+
})], Column$1.prototype, "groupable", void 0);
|
|
6215
6283
|
__decorate([property({
|
|
6216
6284
|
type: String,
|
|
6217
6285
|
attribute: "aggregation-fn"
|
|
6218
|
-
})], Column.prototype, "aggregationFn", void 0);
|
|
6286
|
+
})], Column$1.prototype, "aggregationFn", void 0);
|
|
6219
6287
|
__decorate([property({
|
|
6220
6288
|
type: Boolean,
|
|
6221
6289
|
reflect: true
|
|
6222
|
-
})], Column.prototype, "editable", void 0);
|
|
6290
|
+
})], Column$1.prototype, "editable", void 0);
|
|
6223
6291
|
__decorate([property({
|
|
6224
6292
|
type: String,
|
|
6225
6293
|
reflect: true
|
|
6226
|
-
})], Column.prototype, "editor", void 0);
|
|
6294
|
+
})], Column$1.prototype, "editor", void 0);
|
|
6227
6295
|
__decorate([property({
|
|
6228
6296
|
type: Array,
|
|
6229
6297
|
attribute: "editor-options"
|
|
6230
|
-
})], Column.prototype, "editorOptions", void 0);
|
|
6231
|
-
__decorate([property({ type: Function })], Column.prototype, "validate", void 0);
|
|
6232
|
-
Column = __decorate([customElement("rozie-column")], Column);
|
|
6233
|
-
var Column_default = Column;
|
|
6298
|
+
})], Column$1.prototype, "editorOptions", void 0);
|
|
6299
|
+
__decorate([property({ type: Function })], Column$1.prototype, "validate", void 0);
|
|
6300
|
+
Column$1 = __decorate([customElement("rozie-column")], Column$1);
|
|
6301
|
+
var Column_default = Column$1;
|
|
6234
6302
|
//#endregion
|
|
6235
6303
|
//#region src/EditorText.ts
|
|
6236
6304
|
let EditorText = class EditorText extends SignalWatcher(LitElement) {
|
|
@@ -6889,6 +6957,7 @@ let FilterNumberRange = class FilterNumberRange extends SignalWatcher(LitElement
|
|
|
6889
6957
|
this._maxDraft = signal("");
|
|
6890
6958
|
this._touched = signal(false);
|
|
6891
6959
|
this.__rozieWatchInitial_0 = true;
|
|
6960
|
+
this.__rozieFirstUpdateDone = false;
|
|
6892
6961
|
this._disconnectCleanups = [];
|
|
6893
6962
|
this._rozieTornDown = false;
|
|
6894
6963
|
this.minDraftValue = () => this._touched.value ? this._minDraft.value : Array.isArray(this.value) && this.value[0] != null ? String(this.value[0]) : "";
|
|
@@ -6927,8 +6996,9 @@ let FilterNumberRange = class FilterNumberRange extends SignalWatcher(LitElement
|
|
|
6927
6996
|
}
|
|
6928
6997
|
firstUpdated() {
|
|
6929
6998
|
this._disconnectCleanups.push(effect(() => {
|
|
6930
|
-
Array.isArray(this.value)
|
|
6999
|
+
const __watchVal = Array.isArray(this.value) ? String(this.value[0]) + "\0" + String(this.value[1]) : "";
|
|
6931
7000
|
untracked(() => {
|
|
7001
|
+
this.__rozieWatchPrev_0 = __watchVal;
|
|
6932
7002
|
if (this.__rozieWatchInitial_0) {
|
|
6933
7003
|
this.__rozieWatchInitial_0 = false;
|
|
6934
7004
|
return;
|
|
@@ -6937,6 +7007,16 @@ let FilterNumberRange = class FilterNumberRange extends SignalWatcher(LitElement
|
|
|
6937
7007
|
});
|
|
6938
7008
|
}));
|
|
6939
7009
|
}
|
|
7010
|
+
updated(changedProperties) {
|
|
7011
|
+
if (this.__rozieFirstUpdateDone && changedProperties.has("value")) {
|
|
7012
|
+
const __watchVal = untracked(() => Array.isArray(this.value) ? String(this.value[0]) + "\0" + String(this.value[1]) : "");
|
|
7013
|
+
if (!Object.is(__watchVal, this.__rozieWatchPrev_0)) {
|
|
7014
|
+
this.__rozieWatchPrev_0 = __watchVal;
|
|
7015
|
+
untracked(() => (this._touched.value = false, void 0));
|
|
7016
|
+
}
|
|
7017
|
+
}
|
|
7018
|
+
this.__rozieFirstUpdateDone = true;
|
|
7019
|
+
}
|
|
6940
7020
|
disconnectedCallback() {
|
|
6941
7021
|
super.disconnectedCallback();
|
|
6942
7022
|
queueMicrotask(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozie-ui/data-table-lit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"dist",
|
|
45
|
-
"src"
|
|
45
|
+
"src",
|
|
46
|
+
"CHANGELOG.md"
|
|
46
47
|
],
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@rozie/runtime-lit": "^0.
|
|
49
|
+
"@rozie/runtime-lit": "^0.10.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
52
|
"lit": "^3.2",
|
package/src/Column.ts
CHANGED
|
@@ -101,12 +101,14 @@ private get registry() { return this.__rozieCtxConsumer_data_table_columns.value
|
|
|
101
101
|
})(); }
|
|
102
102
|
this.__rozieFirstUpdateDone = true;
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
(() => {
|
|
105
|
+
if (this.registered) return;
|
|
106
|
+
const live = this.registry;
|
|
107
|
+
if (live == null) return;
|
|
108
|
+
this.reg = live;
|
|
109
|
+
this.registered = true;
|
|
110
|
+
this.reg.registerColumn(this.colId(), this.buildSpec());
|
|
111
|
+
})();
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
disconnectedCallback(): void {
|