@rozie-ui/data-table-solid 0.5.0 → 0.7.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.
package/dist/index.d.cts CHANGED
@@ -12,6 +12,10 @@ interface SelectAllSlotCtx {
12
12
  indeterminate: any;
13
13
  toggle: any;
14
14
  }
15
+ interface PlaceholderSlotCtx {
16
+ index: any;
17
+ columnId: any;
18
+ }
15
19
  interface SelectCellSlotCtx {
16
20
  row: any;
17
21
  checked: any;
@@ -30,6 +34,7 @@ interface FilterSlotCtx {
30
34
  value: any;
31
35
  uniqueValues: any;
32
36
  minMax: any;
37
+ columnLabel: any;
33
38
  setFilter: any;
34
39
  }
35
40
  interface CellSlotCtx {
@@ -45,6 +50,7 @@ interface EditorSlotCtx {
45
50
  value: any;
46
51
  commit: any;
47
52
  cancel: any;
53
+ columnLabel: any;
48
54
  autofocus: any;
49
55
  }
50
56
  interface DataTableProps {
@@ -110,6 +116,10 @@ interface DataTableProps {
110
116
  expanded?: (Record<string, any> | boolean) | null;
111
117
  defaultExpanded?: (Record<string, any> | boolean) | null;
112
118
  onExpandedChange?: (expanded: (Record<string, any> | boolean) | null) => void;
119
+ /**
120
+ * Row identity `(originalRow, index, parentRow?) => string | number` — the key `rowSelection`, `expanded` and the per-row caches use. Default null → table-core keys rows by position (`"0"`, `"1"`, … and `"0.1"` for sub-rows), so inserting or removing rows above a selected or expanded row moves that state onto whatever row now sits at its index. Supply it whenever rows can be added or removed while state is held (server push, live lists); the result is coerced to a string.
121
+ */
122
+ getRowId?: ((...args: any[]) => any) | null;
113
123
  /**
114
124
  * Table-level child-row accessor `(originalRow, index) => TData[] | undefined` that drives nested sub-rows. When supplied (with `expandable`), table-core flattens the hierarchy and the expand seam reveals depth-indented child rows. Null → the `#detail` scoped slot is the expand mode.
115
125
  */
@@ -201,13 +211,16 @@ interface DataTableProps {
201
211
  onReorderChange?: (...args: unknown[]) => void;
202
212
  onPinChange?: (...args: unknown[]) => void;
203
213
  onHistoryChange?: (...args: unknown[]) => void;
214
+ onVisibleRangeChange?: (...args: unknown[]) => void;
204
215
  onActivecellChange?: (...args: unknown[]) => void;
216
+ onRowActivate?: (...args: unknown[]) => void;
205
217
  onRangeChange?: (...args: unknown[]) => void;
206
218
  onCellEditCommit?: (...args: unknown[]) => void;
207
219
  onRowEditCommit?: (...args: unknown[]) => void;
208
220
  children?: JSX.Element;
209
221
  groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
210
222
  selectAllSlot?: (ctx: SelectAllSlotCtx) => JSX.Element;
223
+ placeholderSlot?: (ctx: PlaceholderSlotCtx) => JSX.Element;
211
224
  selectCellSlot?: (ctx: SelectCellSlotCtx) => JSX.Element;
212
225
  detailSlot?: (ctx: DetailSlotCtx) => JSX.Element;
213
226
  colHeaderSlot?: (ctx: ColHeaderSlotCtx) => JSX.Element;
@@ -225,6 +238,7 @@ interface DataTableProps {
225
238
  value: any;
226
239
  uniqueValues: any;
227
240
  minMax: any;
241
+ columnLabel: any;
228
242
  setFilter: any;
229
243
  }) => JSX.Element) | undefined;
230
244
  [key: `cell-${string}`]: ((ctx: {
@@ -240,6 +254,7 @@ interface DataTableProps {
240
254
  value: any;
241
255
  commit: any;
242
256
  cancel: any;
257
+ columnLabel: any;
243
258
  autofocus: any;
244
259
  }) => JSX.Element) | undefined;
245
260
  [key: string]: ((...args: any[]) => JSX.Element) | undefined;
@@ -270,6 +285,11 @@ interface DataTableHandle {
270
285
  focusCell: (...args: any[]) => any;
271
286
  getActiveCell: (...args: any[]) => any;
272
287
  clearActiveCell: (...args: any[]) => any;
288
+ scrollToRow(index: any, options?: {
289
+ align?: 'start' | 'center' | 'end' | 'auto';
290
+ behavior?: 'auto' | 'smooth' | 'instant';
291
+ }): void;
292
+ getScrollElement(): any;
273
293
  getRowIndexRelativeToPage: (...args: any[]) => any;
274
294
  editCell: (...args: any[]) => any;
275
295
  commitEditing: (...args: any[]) => any;
@@ -313,7 +333,7 @@ interface ColumnProps {
313
333
  */
314
334
  pinned?: string;
315
335
  /**
316
- * Optional fixed/initial column width — a CSS length string or a px number.
336
+ * Optional fixed/initial column width, applied as the column's starting size — a px number (`120`) or a px string (`'120px'`). Column sizing is numeric px, so other CSS lengths (`'12rem'`, `'20%'`, `'auto'`) have no px value to apply and are ignored; the column keeps the default width. An interactive resize overrides this.
317
337
  */
318
338
  width?: string | number;
319
339
  /**
@@ -377,6 +397,10 @@ interface EditorTextProps {
377
397
  * Focus this editor's primary input when true — the host sets it for the one editor that should hold focus; reactive.
378
398
  */
379
399
  autofocus?: boolean;
400
+ /**
401
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
402
+ */
403
+ columnLabel?: string;
380
404
  }
381
405
  declare function EditorText(_props: EditorTextProps): JSX.Element;
382
406
  //#endregion
@@ -406,6 +430,14 @@ interface EditorNumberProps {
406
430
  * `() => void` — revert the edit (Escape). Null-guarded at call sites.
407
431
  */
408
432
  cancel?: ((...args: any[]) => any) | null;
433
+ /**
434
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
435
+ */
436
+ autofocus?: boolean;
437
+ /**
438
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
439
+ */
440
+ columnLabel?: string;
409
441
  }
410
442
  declare function EditorNumber(_props: EditorNumberProps): JSX.Element;
411
443
  //#endregion
@@ -439,6 +471,14 @@ interface EditorSelectProps {
439
471
  * The select options — `[{ value, label }]`. Mirrors `<Column editorOptions>`.
440
472
  */
441
473
  options?: any[];
474
+ /**
475
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
476
+ */
477
+ autofocus?: boolean;
478
+ /**
479
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
480
+ */
481
+ columnLabel?: string;
442
482
  }
443
483
  declare function EditorSelect(_props: EditorSelectProps): JSX.Element;
444
484
  //#endregion
@@ -468,6 +508,14 @@ interface EditorCheckboxProps {
468
508
  * `() => void` — revert the edit (Escape). Null-guarded at call sites.
469
509
  */
470
510
  cancel?: ((...args: any[]) => any) | null;
511
+ /**
512
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
513
+ */
514
+ autofocus?: boolean;
515
+ /**
516
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
517
+ */
518
+ columnLabel?: string;
471
519
  }
472
520
  declare function EditorCheckbox(_props: EditorCheckboxProps): JSX.Element;
473
521
  //#endregion
@@ -497,6 +545,14 @@ interface EditorDateProps {
497
545
  * `() => void` — revert the edit (Escape). Null-guarded at call sites.
498
546
  */
499
547
  cancel?: ((...args: any[]) => any) | null;
548
+ /**
549
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
550
+ */
551
+ autofocus?: boolean;
552
+ /**
553
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
554
+ */
555
+ columnLabel?: string;
500
556
  }
501
557
  declare function EditorDate(_props: EditorDateProps): JSX.Element;
502
558
  //#endregion
@@ -518,6 +574,10 @@ interface FilterTextProps {
518
574
  * `(columnId, value) => void` — apply the column filter (Enter / blur applies, Escape clears). Null-guarded at call sites.
519
575
  */
520
576
  setFilter?: ((...args: any[]) => any) | null;
577
+ /**
578
+ * The column's human header, forwarded by the `#filter` slot scope — used as the control's accessible name in place of the internal column id.
579
+ */
580
+ columnLabel?: string;
521
581
  }
522
582
  declare function FilterText(_props: FilterTextProps): JSX.Element;
523
583
  //#endregion
@@ -543,6 +603,10 @@ interface FilterNumberRangeProps {
543
603
  * The faceted `[min, max]` bounds for this column (`[number, number]` or null) — drives the input placeholders only.
544
604
  */
545
605
  minMax?: (unknown) | null;
606
+ /**
607
+ * The column's human header, forwarded by the `#filter` slot scope — used as the control's accessible name in place of the internal column id.
608
+ */
609
+ columnLabel?: string;
546
610
  }
547
611
  declare function FilterNumberRange(_props: FilterNumberRangeProps): JSX.Element;
548
612
  //#endregion
@@ -568,6 +632,10 @@ interface FilterSelectProps {
568
632
  * The faceted distinct keys for this column (cross-filtered, keys only — no occurrence counts) used to build the `<option>` list.
569
633
  */
570
634
  uniqueValues?: any[];
635
+ /**
636
+ * The column's human header, forwarded by the `#filter` slot scope — used as the control's accessible name in place of the internal column id.
637
+ */
638
+ columnLabel?: string;
571
639
  }
572
640
  declare function FilterSelect(_props: FilterSelectProps): JSX.Element;
573
641
  //#endregion
package/dist/index.d.mts CHANGED
@@ -12,6 +12,10 @@ interface SelectAllSlotCtx {
12
12
  indeterminate: any;
13
13
  toggle: any;
14
14
  }
15
+ interface PlaceholderSlotCtx {
16
+ index: any;
17
+ columnId: any;
18
+ }
15
19
  interface SelectCellSlotCtx {
16
20
  row: any;
17
21
  checked: any;
@@ -30,6 +34,7 @@ interface FilterSlotCtx {
30
34
  value: any;
31
35
  uniqueValues: any;
32
36
  minMax: any;
37
+ columnLabel: any;
33
38
  setFilter: any;
34
39
  }
35
40
  interface CellSlotCtx {
@@ -45,6 +50,7 @@ interface EditorSlotCtx {
45
50
  value: any;
46
51
  commit: any;
47
52
  cancel: any;
53
+ columnLabel: any;
48
54
  autofocus: any;
49
55
  }
50
56
  interface DataTableProps {
@@ -110,6 +116,10 @@ interface DataTableProps {
110
116
  expanded?: (Record<string, any> | boolean) | null;
111
117
  defaultExpanded?: (Record<string, any> | boolean) | null;
112
118
  onExpandedChange?: (expanded: (Record<string, any> | boolean) | null) => void;
119
+ /**
120
+ * Row identity `(originalRow, index, parentRow?) => string | number` — the key `rowSelection`, `expanded` and the per-row caches use. Default null → table-core keys rows by position (`"0"`, `"1"`, … and `"0.1"` for sub-rows), so inserting or removing rows above a selected or expanded row moves that state onto whatever row now sits at its index. Supply it whenever rows can be added or removed while state is held (server push, live lists); the result is coerced to a string.
121
+ */
122
+ getRowId?: ((...args: any[]) => any) | null;
113
123
  /**
114
124
  * Table-level child-row accessor `(originalRow, index) => TData[] | undefined` that drives nested sub-rows. When supplied (with `expandable`), table-core flattens the hierarchy and the expand seam reveals depth-indented child rows. Null → the `#detail` scoped slot is the expand mode.
115
125
  */
@@ -201,13 +211,16 @@ interface DataTableProps {
201
211
  onReorderChange?: (...args: unknown[]) => void;
202
212
  onPinChange?: (...args: unknown[]) => void;
203
213
  onHistoryChange?: (...args: unknown[]) => void;
214
+ onVisibleRangeChange?: (...args: unknown[]) => void;
204
215
  onActivecellChange?: (...args: unknown[]) => void;
216
+ onRowActivate?: (...args: unknown[]) => void;
205
217
  onRangeChange?: (...args: unknown[]) => void;
206
218
  onCellEditCommit?: (...args: unknown[]) => void;
207
219
  onRowEditCommit?: (...args: unknown[]) => void;
208
220
  children?: JSX.Element;
209
221
  groupBarSlot?: (ctx: GroupBarSlotCtx) => JSX.Element;
210
222
  selectAllSlot?: (ctx: SelectAllSlotCtx) => JSX.Element;
223
+ placeholderSlot?: (ctx: PlaceholderSlotCtx) => JSX.Element;
211
224
  selectCellSlot?: (ctx: SelectCellSlotCtx) => JSX.Element;
212
225
  detailSlot?: (ctx: DetailSlotCtx) => JSX.Element;
213
226
  colHeaderSlot?: (ctx: ColHeaderSlotCtx) => JSX.Element;
@@ -225,6 +238,7 @@ interface DataTableProps {
225
238
  value: any;
226
239
  uniqueValues: any;
227
240
  minMax: any;
241
+ columnLabel: any;
228
242
  setFilter: any;
229
243
  }) => JSX.Element) | undefined;
230
244
  [key: `cell-${string}`]: ((ctx: {
@@ -240,6 +254,7 @@ interface DataTableProps {
240
254
  value: any;
241
255
  commit: any;
242
256
  cancel: any;
257
+ columnLabel: any;
243
258
  autofocus: any;
244
259
  }) => JSX.Element) | undefined;
245
260
  [key: string]: ((...args: any[]) => JSX.Element) | undefined;
@@ -270,6 +285,11 @@ interface DataTableHandle {
270
285
  focusCell: (...args: any[]) => any;
271
286
  getActiveCell: (...args: any[]) => any;
272
287
  clearActiveCell: (...args: any[]) => any;
288
+ scrollToRow(index: any, options?: {
289
+ align?: 'start' | 'center' | 'end' | 'auto';
290
+ behavior?: 'auto' | 'smooth' | 'instant';
291
+ }): void;
292
+ getScrollElement(): any;
273
293
  getRowIndexRelativeToPage: (...args: any[]) => any;
274
294
  editCell: (...args: any[]) => any;
275
295
  commitEditing: (...args: any[]) => any;
@@ -313,7 +333,7 @@ interface ColumnProps {
313
333
  */
314
334
  pinned?: string;
315
335
  /**
316
- * Optional fixed/initial column width — a CSS length string or a px number.
336
+ * Optional fixed/initial column width, applied as the column's starting size — a px number (`120`) or a px string (`'120px'`). Column sizing is numeric px, so other CSS lengths (`'12rem'`, `'20%'`, `'auto'`) have no px value to apply and are ignored; the column keeps the default width. An interactive resize overrides this.
317
337
  */
318
338
  width?: string | number;
319
339
  /**
@@ -377,6 +397,10 @@ interface EditorTextProps {
377
397
  * Focus this editor's primary input when true — the host sets it for the one editor that should hold focus; reactive.
378
398
  */
379
399
  autofocus?: boolean;
400
+ /**
401
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
402
+ */
403
+ columnLabel?: string;
380
404
  }
381
405
  declare function EditorText(_props: EditorTextProps): JSX.Element;
382
406
  //#endregion
@@ -406,6 +430,14 @@ interface EditorNumberProps {
406
430
  * `() => void` — revert the edit (Escape). Null-guarded at call sites.
407
431
  */
408
432
  cancel?: ((...args: any[]) => any) | null;
433
+ /**
434
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
435
+ */
436
+ autofocus?: boolean;
437
+ /**
438
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
439
+ */
440
+ columnLabel?: string;
409
441
  }
410
442
  declare function EditorNumber(_props: EditorNumberProps): JSX.Element;
411
443
  //#endregion
@@ -439,6 +471,14 @@ interface EditorSelectProps {
439
471
  * The select options — `[{ value, label }]`. Mirrors `<Column editorOptions>`.
440
472
  */
441
473
  options?: any[];
474
+ /**
475
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
476
+ */
477
+ autofocus?: boolean;
478
+ /**
479
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
480
+ */
481
+ columnLabel?: string;
442
482
  }
443
483
  declare function EditorSelect(_props: EditorSelectProps): JSX.Element;
444
484
  //#endregion
@@ -468,6 +508,14 @@ interface EditorCheckboxProps {
468
508
  * `() => void` — revert the edit (Escape). Null-guarded at call sites.
469
509
  */
470
510
  cancel?: ((...args: any[]) => any) | null;
511
+ /**
512
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
513
+ */
514
+ autofocus?: boolean;
515
+ /**
516
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
517
+ */
518
+ columnLabel?: string;
471
519
  }
472
520
  declare function EditorCheckbox(_props: EditorCheckboxProps): JSX.Element;
473
521
  //#endregion
@@ -497,6 +545,14 @@ interface EditorDateProps {
497
545
  * `() => void` — revert the edit (Escape). Null-guarded at call sites.
498
546
  */
499
547
  cancel?: ((...args: any[]) => any) | null;
548
+ /**
549
+ * Focus this editor's primary control when true — the host sets it for the one editor that should hold focus; reactive.
550
+ */
551
+ autofocus?: boolean;
552
+ /**
553
+ * The column's human header, forwarded by the slot scope — used as the control's accessible name in place of the internal column id.
554
+ */
555
+ columnLabel?: string;
500
556
  }
501
557
  declare function EditorDate(_props: EditorDateProps): JSX.Element;
502
558
  //#endregion
@@ -518,6 +574,10 @@ interface FilterTextProps {
518
574
  * `(columnId, value) => void` — apply the column filter (Enter / blur applies, Escape clears). Null-guarded at call sites.
519
575
  */
520
576
  setFilter?: ((...args: any[]) => any) | null;
577
+ /**
578
+ * The column's human header, forwarded by the `#filter` slot scope — used as the control's accessible name in place of the internal column id.
579
+ */
580
+ columnLabel?: string;
521
581
  }
522
582
  declare function FilterText(_props: FilterTextProps): JSX.Element;
523
583
  //#endregion
@@ -543,6 +603,10 @@ interface FilterNumberRangeProps {
543
603
  * The faceted `[min, max]` bounds for this column (`[number, number]` or null) — drives the input placeholders only.
544
604
  */
545
605
  minMax?: (unknown) | null;
606
+ /**
607
+ * The column's human header, forwarded by the `#filter` slot scope — used as the control's accessible name in place of the internal column id.
608
+ */
609
+ columnLabel?: string;
546
610
  }
547
611
  declare function FilterNumberRange(_props: FilterNumberRangeProps): JSX.Element;
548
612
  //#endregion
@@ -568,6 +632,10 @@ interface FilterSelectProps {
568
632
  * The faceted distinct keys for this column (cross-filtered, keys only — no occurrence counts) used to build the `<option>` list.
569
633
  */
570
634
  uniqueValues?: any[];
635
+ /**
636
+ * The column's human header, forwarded by the `#filter` slot scope — used as the control's accessible name in place of the internal column id.
637
+ */
638
+ columnLabel?: string;
571
639
  }
572
640
  declare function FilterSelect(_props: FilterSelectProps): JSX.Element;
573
641
  //#endregion