@rozie-ui/data-table-solid 0.7.2 → 0.7.4

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @rozie-ui/data-table-solid
2
2
 
3
+ ## 0.7.4
4
+
5
+ ### Patch Changes
6
+
7
+ - cf49212: Regenerated with the compiler fixes found while building `@rozie-ui/select`. Depending on the target and the component:
8
+ - Angular: a two-way (`model: true`) prop is now controlled while the consumer binds a value — a write by the component only emits `<name>Change`, so a consumer that refuses the change keeps the control on its value. The prop keeps its `ModelSignal` type. `$onUpdate` hooks now run (after every render); they never ran before. An output named like a native bubbling event (`change`, `submit`, `reset`, `select`) no longer also delivers the native event to a consumer's binding.
9
+ - Vue: a two-way prop bound one-way (`:value` without `v-model`) is now controlled too: the component's write emits `update:value` and the control keeps the consumer's value.
10
+ - React: an `$expose` verb now runs in `flushSync`, so calls made in one tick each see what the call before left; primitive script constants are plain `const`s; a body statement no longer reads a binding declared after it on the first render.
11
+ - Svelte, Solid: a `$watch` now sees a `$data` write made in `$onMount`.
12
+ - Lit: a `$watch` whose getter reads both props and `$data` re-runs when only the prop changes; duplicated comments in lifecycle bodies are gone.
13
+ - @rozie/runtime-solid@0.10.0
14
+
15
+ ## 0.7.3
16
+
17
+ ### Patch Changes
18
+
19
+ - 67902f8: React and Solid: slot props passed to the component are no longer part of the attribute pass-through spread onto its root element. On Solid a slot render function passed as `<name>Slot` (or a `slots` record) was written to the DOM as an attribute holding the function source; on React the slot members (`render<Name>`, `children`, `slots`) were left in the rest bucket. Regenerated with the compiler fix; no API change.
20
+ - @rozie/runtime-solid@0.9.1
21
+
3
22
  ## 0.7.2
4
23
 
5
24
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -735,7 +735,17 @@ function DataTable(_props) {
735
735
  "onSelectionChange",
736
736
  "onSortChange",
737
737
  "onVisibilityChange",
738
- "onVisibleRangeChange"
738
+ "onVisibleRangeChange",
739
+ "groupBarSlot",
740
+ "selectAllSlot",
741
+ "placeholderSlot",
742
+ "selectCellSlot",
743
+ "detailSlot",
744
+ "colHeaderSlot",
745
+ "filterSlot",
746
+ "cellSlot",
747
+ "editorSlot",
748
+ "slots"
739
749
  ]);
740
750
  const resolved = () => local.children;
741
751
  (0, solid_js.onMount)(() => {
@@ -846,6 +856,45 @@ function DataTable(_props) {
846
856
  const [pasteAnnounce, setPasteAnnounce] = (0, solid_js.createSignal)("");
847
857
  const [rangeAnnounce, setRangeAnnounce] = (0, solid_js.createSignal)("");
848
858
  const [liveAnnounce, setLiveAnnounce] = (0, solid_js.createSignal)("");
859
+ (0, solid_js.createEffect)((0, solid_js.on)(() => windowVer(), (v) => (0, solid_js.untrack)(() => emitVisibleRangeIfChanged()), { defer: true }));
860
+ (0, solid_js.createEffect)((0, solid_js.on)(() => [
861
+ sorting(),
862
+ globalFilter(),
863
+ columnFilters(),
864
+ pagination(),
865
+ local.rowCount,
866
+ local.pageCount,
867
+ rowSelection(),
868
+ expanded(),
869
+ local.expandable,
870
+ grouping(),
871
+ local.groupable,
872
+ columnVisibility(),
873
+ columnSizing(),
874
+ columnOrder(),
875
+ columnPinning(),
876
+ local.selectionMode,
877
+ (data() || []).length,
878
+ data(),
879
+ dataDefault(),
880
+ local.columns,
881
+ colReg()
882
+ ], (v) => (0, solid_js.untrack)(() => (() => {
883
+ seedColumnPinning();
884
+ reFeed();
885
+ maybeClearHistoryOnExternalSwap();
886
+ })()), { defer: true }));
887
+ (0, solid_js.createEffect)((0, solid_js.on)(() => [
888
+ sorting(),
889
+ columnFilters(),
890
+ globalFilter(),
891
+ sortingDefault(),
892
+ columnFiltersDefault(),
893
+ globalFilterDefault()
894
+ ], (v) => (0, solid_js.untrack)(() => (() => {
895
+ const msg = buildSortFilterAnnounce();
896
+ if (msg) setLiveAnnounce(msg);
897
+ })()), { defer: true }));
849
898
  (0, solid_js.onMount)(() => {
850
899
  setDataDefault(data() || []);
851
900
  seedColumnPinning();
@@ -988,45 +1037,6 @@ function DataTable(_props) {
988
1037
  lastDataLen = d.length;
989
1038
  reFeed();
990
1039
  });
991
- (0, solid_js.createEffect)((0, solid_js.on)(() => windowVer(), (v) => (0, solid_js.untrack)(() => emitVisibleRangeIfChanged()), { defer: true }));
992
- (0, solid_js.createEffect)((0, solid_js.on)(() => [
993
- sorting(),
994
- globalFilter(),
995
- columnFilters(),
996
- pagination(),
997
- local.rowCount,
998
- local.pageCount,
999
- rowSelection(),
1000
- expanded(),
1001
- local.expandable,
1002
- grouping(),
1003
- local.groupable,
1004
- columnVisibility(),
1005
- columnSizing(),
1006
- columnOrder(),
1007
- columnPinning(),
1008
- local.selectionMode,
1009
- (data() || []).length,
1010
- data(),
1011
- dataDefault(),
1012
- local.columns,
1013
- colReg()
1014
- ], (v) => (0, solid_js.untrack)(() => (() => {
1015
- seedColumnPinning();
1016
- reFeed();
1017
- maybeClearHistoryOnExternalSwap();
1018
- })()), { defer: true }));
1019
- (0, solid_js.createEffect)((0, solid_js.on)(() => [
1020
- sorting(),
1021
- columnFilters(),
1022
- globalFilter(),
1023
- sortingDefault(),
1024
- columnFiltersDefault(),
1025
- globalFilterDefault()
1026
- ], (v) => (0, solid_js.untrack)(() => (() => {
1027
- const msg = buildSortFilterAnnounce();
1028
- if (msg) setLiveAnnounce(msg);
1029
- })()), { defer: true }));
1030
1040
  let __rozieRootRef = null;
1031
1041
  let table = null;
1032
1042
  let virtualizer = null;
@@ -5351,6 +5361,9 @@ function DataTable(_props) {
5351
5361
  _el$64.addEventListener("change", ($event) => {
5352
5362
  onCellEditorInput(cell().column.id, $event);
5353
5363
  });
5364
+ (0, solid_js_web.use)((el) => {
5365
+ (0, _rozie_runtime_solid.rozieSelectValue)(el, () => editorValueFor(cell().column.id));
5366
+ }, _el$64);
5354
5367
  (0, solid_js_web.insert)(_el$64, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
5355
5368
  get each() {
5356
5369
  return editorOptionsOf(cell().column.id);
@@ -5364,7 +5377,6 @@ function DataTable(_props) {
5364
5377
  })()
5365
5378
  }));
5366
5379
  (0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$64, "aria-invalid", (0, _rozie_runtime_solid.rozieAttr)(invalidMsg() ? "true" : null)));
5367
- (0, solid_js_web.effect)(() => _el$64.value = editorValueFor(cell().column.id));
5368
5380
  return _el$64;
5369
5381
  }
5370
5382
  });
@@ -6232,6 +6244,9 @@ function DataTable(_props) {
6232
6244
  _el$122.addEventListener("change", ($event) => {
6233
6245
  onCellEditorInput(cell().column.id, $event);
6234
6246
  });
6247
+ (0, solid_js_web.use)((el) => {
6248
+ (0, _rozie_runtime_solid.rozieSelectValue)(el, () => editorValueFor(cell().column.id));
6249
+ }, _el$122);
6235
6250
  (0, solid_js_web.insert)(_el$122, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
6236
6251
  get each() {
6237
6252
  return editorOptionsOf(cell().column.id);
@@ -6245,7 +6260,6 @@ function DataTable(_props) {
6245
6260
  })()
6246
6261
  }));
6247
6262
  (0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$122, "aria-invalid", (0, _rozie_runtime_solid.rozieAttr)(invalidMsg() ? "true" : null)));
6248
- (0, solid_js_web.effect)(() => _el$122.value = editorValueFor(cell().column.id));
6249
6263
  return _el$122;
6250
6264
  }
6251
6265
  });
@@ -6561,6 +6575,9 @@ function DataTable(_props) {
6561
6575
  _el$139.addEventListener("change", ($event) => {
6562
6576
  onPageSizeChange($event);
6563
6577
  });
6578
+ (0, solid_js_web.use)((el) => {
6579
+ (0, _rozie_runtime_solid.rozieSelectValue)(el, () => pageSize());
6580
+ }, _el$139);
6564
6581
  (0, solid_js_web.effect)((_p$) => {
6565
6582
  var _v$97 = !canPrevPage(), _v$98 = !canNextPage();
6566
6583
  _v$97 !== _p$.e && (_el$136.disabled = _p$.e = _v$97);
@@ -6570,7 +6587,6 @@ function DataTable(_props) {
6570
6587
  e: void 0,
6571
6588
  t: void 0
6572
6589
  });
6573
- (0, solid_js_web.effect)(() => _el$139.value = pageSize());
6574
6590
  return _el$135;
6575
6591
  }
6576
6592
  }), null);
@@ -6626,6 +6642,24 @@ function Column(_props) {
6626
6642
  "validate"
6627
6643
  ]);
6628
6644
  const registry = (0, solid_js.useContext)((0, _rozie_runtime_solid.rozieContext)("data-table:columns"));
6645
+ (0, solid_js.createEffect)((0, solid_js.on)(() => [
6646
+ local.id,
6647
+ local.field,
6648
+ local.header,
6649
+ local.sortable,
6650
+ local.filterable,
6651
+ local.pinned,
6652
+ local.width,
6653
+ local.expandable,
6654
+ local.groupable,
6655
+ local.aggregationFn,
6656
+ local.editable,
6657
+ local.editor,
6658
+ local.editorOptions,
6659
+ local.validate
6660
+ ], (v) => (0, solid_js.untrack)(() => (() => {
6661
+ if (reg) reg.registerColumn(colId(), buildSpec());
6662
+ })()), { defer: true }));
6629
6663
  (0, solid_js.onMount)(() => {
6630
6664
  const _cleanup = (() => {
6631
6665
  if (reg && !registered) {
@@ -6646,24 +6680,6 @@ function Column(_props) {
6646
6680
  registered = true;
6647
6681
  reg.registerColumn(colId(), buildSpec());
6648
6682
  });
6649
- (0, solid_js.createEffect)((0, solid_js.on)(() => [
6650
- local.id,
6651
- local.field,
6652
- local.header,
6653
- local.sortable,
6654
- local.filterable,
6655
- local.pinned,
6656
- local.width,
6657
- local.expandable,
6658
- local.groupable,
6659
- local.aggregationFn,
6660
- local.editable,
6661
- local.editor,
6662
- local.editorOptions,
6663
- local.validate
6664
- ], (v) => (0, solid_js.untrack)(() => (() => {
6665
- if (reg) reg.registerColumn(colId(), buildSpec());
6666
- })()), { defer: true }));
6667
6683
  let reg = null;
6668
6684
  reg = registry;
6669
6685
  let registered = false;
@@ -6719,12 +6735,12 @@ function EditorText(_props) {
6719
6735
  ]);
6720
6736
  const [draft, setDraft] = (0, solid_js.createSignal)("");
6721
6737
  const [touched, setTouched] = (0, solid_js.createSignal)(false);
6722
- (0, solid_js.onMount)(() => {
6723
- if (local.autofocus) inputElRef?.focus();
6724
- });
6725
6738
  (0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
6726
6739
  if (v) inputElRef?.focus();
6727
6740
  })(v)), { defer: true }));
6741
+ (0, solid_js.onMount)(() => {
6742
+ if (local.autofocus) inputElRef?.focus();
6743
+ });
6728
6744
  let inputElRef = null;
6729
6745
  function draftValue() {
6730
6746
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -6800,12 +6816,12 @@ function EditorNumber(_props) {
6800
6816
  ]);
6801
6817
  const [draft, setDraft] = (0, solid_js.createSignal)("");
6802
6818
  const [touched, setTouched] = (0, solid_js.createSignal)(false);
6803
- (0, solid_js.onMount)(() => {
6804
- if (local.autofocus) inputElRef?.focus();
6805
- });
6806
6819
  (0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
6807
6820
  if (v) inputElRef?.focus();
6808
6821
  })(v)), { defer: true }));
6822
+ (0, solid_js.onMount)(() => {
6823
+ if (local.autofocus) inputElRef?.focus();
6824
+ });
6809
6825
  let inputElRef = null;
6810
6826
  function draftValue() {
6811
6827
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -6890,12 +6906,12 @@ function EditorSelect(_props) {
6890
6906
  ]);
6891
6907
  const [draft, setDraft] = (0, solid_js.createSignal)("");
6892
6908
  const [touched, setTouched] = (0, solid_js.createSignal)(false);
6893
- (0, solid_js.onMount)(() => {
6894
- if (local.autofocus) selectElRef?.focus();
6895
- });
6896
6909
  (0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
6897
6910
  if (v) selectElRef?.focus();
6898
6911
  })(v)), { defer: true }));
6912
+ (0, solid_js.onMount)(() => {
6913
+ if (local.autofocus) selectElRef?.focus();
6914
+ });
6899
6915
  let selectElRef = null;
6900
6916
  function draftValue() {
6901
6917
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -6938,6 +6954,7 @@ function EditorSelect(_props) {
6938
6954
  onChange($event);
6939
6955
  });
6940
6956
  (0, solid_js_web.use)((el) => {
6957
+ (0, _rozie_runtime_solid.rozieSelectValue)(el, () => draftValue());
6941
6958
  selectElRef = el;
6942
6959
  }, _el$);
6943
6960
  (0, solid_js_web.insert)(_el$, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
@@ -6953,7 +6970,6 @@ function EditorSelect(_props) {
6953
6970
  })()
6954
6971
  }));
6955
6972
  (0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$, "aria-label", (0, _rozie_runtime_solid.rozieAttr)(a11yLabel())));
6956
- (0, solid_js_web.effect)(() => _el$.value = draftValue());
6957
6973
  return _el$;
6958
6974
  })();
6959
6975
  }
@@ -6981,12 +6997,12 @@ function EditorCheckbox(_props) {
6981
6997
  "autofocus",
6982
6998
  "columnLabel"
6983
6999
  ]);
6984
- (0, solid_js.onMount)(() => {
6985
- if (local.autofocus) inputElRef?.focus();
6986
- });
6987
7000
  (0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
6988
7001
  if (v) inputElRef?.focus();
6989
7002
  })(v)), { defer: true }));
7003
+ (0, solid_js.onMount)(() => {
7004
+ if (local.autofocus) inputElRef?.focus();
7005
+ });
6990
7006
  let inputElRef = null;
6991
7007
  function onChange(e) {
6992
7008
  local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
@@ -7076,12 +7092,12 @@ function EditorDate(_props) {
7076
7092
  ]);
7077
7093
  const [draft, setDraft] = (0, solid_js.createSignal)("");
7078
7094
  const [touched, setTouched] = (0, solid_js.createSignal)(false);
7079
- (0, solid_js.onMount)(() => {
7080
- if (local.autofocus) inputElRef?.focus();
7081
- });
7082
7095
  (0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
7083
7096
  if (v) inputElRef?.focus();
7084
7097
  })(v)), { defer: true }));
7098
+ (0, solid_js.onMount)(() => {
7099
+ if (local.autofocus) inputElRef?.focus();
7100
+ });
7085
7101
  let inputElRef = null;
7086
7102
  function draftValue() {
7087
7103
  return touched() ? draft() : toIsoDateString(local.value);
@@ -7344,6 +7360,9 @@ function FilterSelect(_props) {
7344
7360
  _el$.addEventListener("change", ($event) => {
7345
7361
  onChange($event);
7346
7362
  });
7363
+ (0, solid_js_web.use)((el) => {
7364
+ (0, _rozie_runtime_solid.rozieSelectValue)(el, () => selectValue());
7365
+ }, _el$);
7347
7366
  (0, solid_js_web.insert)(_el$, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
7348
7367
  get each() {
7349
7368
  return local.uniqueValues;
@@ -7357,7 +7376,6 @@ function FilterSelect(_props) {
7357
7376
  })()
7358
7377
  }), null);
7359
7378
  (0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$, "aria-label", (0, _rozie_runtime_solid.rozieAttr)(a11yLabel())));
7360
- (0, solid_js_web.effect)(() => _el$.value = selectValue());
7361
7379
  return _el$;
7362
7380
  })();
7363
7381
  }
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { className, createComponent, delegateEvents, effect, insert, memo, setAttribute, style, template, use } from "solid-js/web";
2
2
  import { Show, createEffect, createSignal, mergeProps, on, onCleanup, onMount, splitProps, untrack, useContext } from "solid-js";
3
3
  import { Key } from "@solid-primitives/keyed";
4
- import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay } from "@rozie/runtime-solid";
4
+ import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay, rozieSelectValue } from "@rozie/runtime-solid";
5
5
  import Popover from "@rozie-ui/popover-solid";
6
6
  import { createTable, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from "@tanstack/table-core";
7
7
  import { Virtualizer, elementScroll, measureElement, observeElementOffset, observeElementRect } from "@tanstack/virtual-core";
@@ -708,7 +708,17 @@ function DataTable(_props) {
708
708
  "onSelectionChange",
709
709
  "onSortChange",
710
710
  "onVisibilityChange",
711
- "onVisibleRangeChange"
711
+ "onVisibleRangeChange",
712
+ "groupBarSlot",
713
+ "selectAllSlot",
714
+ "placeholderSlot",
715
+ "selectCellSlot",
716
+ "detailSlot",
717
+ "colHeaderSlot",
718
+ "filterSlot",
719
+ "cellSlot",
720
+ "editorSlot",
721
+ "slots"
712
722
  ]);
713
723
  const resolved = () => local.children;
714
724
  onMount(() => {
@@ -819,6 +829,45 @@ function DataTable(_props) {
819
829
  const [pasteAnnounce, setPasteAnnounce] = createSignal("");
820
830
  const [rangeAnnounce, setRangeAnnounce] = createSignal("");
821
831
  const [liveAnnounce, setLiveAnnounce] = createSignal("");
832
+ createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
833
+ createEffect(on(() => [
834
+ sorting(),
835
+ globalFilter(),
836
+ columnFilters(),
837
+ pagination(),
838
+ local.rowCount,
839
+ local.pageCount,
840
+ rowSelection(),
841
+ expanded(),
842
+ local.expandable,
843
+ grouping(),
844
+ local.groupable,
845
+ columnVisibility(),
846
+ columnSizing(),
847
+ columnOrder(),
848
+ columnPinning(),
849
+ local.selectionMode,
850
+ (data() || []).length,
851
+ data(),
852
+ dataDefault(),
853
+ local.columns,
854
+ colReg()
855
+ ], (v) => untrack(() => (() => {
856
+ seedColumnPinning();
857
+ reFeed();
858
+ maybeClearHistoryOnExternalSwap();
859
+ })()), { defer: true }));
860
+ createEffect(on(() => [
861
+ sorting(),
862
+ columnFilters(),
863
+ globalFilter(),
864
+ sortingDefault(),
865
+ columnFiltersDefault(),
866
+ globalFilterDefault()
867
+ ], (v) => untrack(() => (() => {
868
+ const msg = buildSortFilterAnnounce();
869
+ if (msg) setLiveAnnounce(msg);
870
+ })()), { defer: true }));
822
871
  onMount(() => {
823
872
  setDataDefault(data() || []);
824
873
  seedColumnPinning();
@@ -961,45 +1010,6 @@ function DataTable(_props) {
961
1010
  lastDataLen = d.length;
962
1011
  reFeed();
963
1012
  });
964
- createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
965
- createEffect(on(() => [
966
- sorting(),
967
- globalFilter(),
968
- columnFilters(),
969
- pagination(),
970
- local.rowCount,
971
- local.pageCount,
972
- rowSelection(),
973
- expanded(),
974
- local.expandable,
975
- grouping(),
976
- local.groupable,
977
- columnVisibility(),
978
- columnSizing(),
979
- columnOrder(),
980
- columnPinning(),
981
- local.selectionMode,
982
- (data() || []).length,
983
- data(),
984
- dataDefault(),
985
- local.columns,
986
- colReg()
987
- ], (v) => untrack(() => (() => {
988
- seedColumnPinning();
989
- reFeed();
990
- maybeClearHistoryOnExternalSwap();
991
- })()), { defer: true }));
992
- createEffect(on(() => [
993
- sorting(),
994
- columnFilters(),
995
- globalFilter(),
996
- sortingDefault(),
997
- columnFiltersDefault(),
998
- globalFilterDefault()
999
- ], (v) => untrack(() => (() => {
1000
- const msg = buildSortFilterAnnounce();
1001
- if (msg) setLiveAnnounce(msg);
1002
- })()), { defer: true }));
1003
1013
  let __rozieRootRef = null;
1004
1014
  let table = null;
1005
1015
  let virtualizer = null;
@@ -5324,6 +5334,9 @@ function DataTable(_props) {
5324
5334
  _el$64.addEventListener("change", ($event) => {
5325
5335
  onCellEditorInput(cell().column.id, $event);
5326
5336
  });
5337
+ use((el) => {
5338
+ rozieSelectValue(el, () => editorValueFor(cell().column.id));
5339
+ }, _el$64);
5327
5340
  insert(_el$64, createComponent(Key, {
5328
5341
  get each() {
5329
5342
  return editorOptionsOf(cell().column.id);
@@ -5337,7 +5350,6 @@ function DataTable(_props) {
5337
5350
  })()
5338
5351
  }));
5339
5352
  effect(() => setAttribute(_el$64, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
5340
- effect(() => _el$64.value = editorValueFor(cell().column.id));
5341
5353
  return _el$64;
5342
5354
  }
5343
5355
  });
@@ -6205,6 +6217,9 @@ function DataTable(_props) {
6205
6217
  _el$122.addEventListener("change", ($event) => {
6206
6218
  onCellEditorInput(cell().column.id, $event);
6207
6219
  });
6220
+ use((el) => {
6221
+ rozieSelectValue(el, () => editorValueFor(cell().column.id));
6222
+ }, _el$122);
6208
6223
  insert(_el$122, createComponent(Key, {
6209
6224
  get each() {
6210
6225
  return editorOptionsOf(cell().column.id);
@@ -6218,7 +6233,6 @@ function DataTable(_props) {
6218
6233
  })()
6219
6234
  }));
6220
6235
  effect(() => setAttribute(_el$122, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
6221
- effect(() => _el$122.value = editorValueFor(cell().column.id));
6222
6236
  return _el$122;
6223
6237
  }
6224
6238
  });
@@ -6534,6 +6548,9 @@ function DataTable(_props) {
6534
6548
  _el$139.addEventListener("change", ($event) => {
6535
6549
  onPageSizeChange($event);
6536
6550
  });
6551
+ use((el) => {
6552
+ rozieSelectValue(el, () => pageSize());
6553
+ }, _el$139);
6537
6554
  effect((_p$) => {
6538
6555
  var _v$97 = !canPrevPage(), _v$98 = !canNextPage();
6539
6556
  _v$97 !== _p$.e && (_el$136.disabled = _p$.e = _v$97);
@@ -6543,7 +6560,6 @@ function DataTable(_props) {
6543
6560
  e: void 0,
6544
6561
  t: void 0
6545
6562
  });
6546
- effect(() => _el$139.value = pageSize());
6547
6563
  return _el$135;
6548
6564
  }
6549
6565
  }), null);
@@ -6599,6 +6615,24 @@ function Column(_props) {
6599
6615
  "validate"
6600
6616
  ]);
6601
6617
  const registry = useContext(rozieContext("data-table:columns"));
6618
+ createEffect(on(() => [
6619
+ local.id,
6620
+ local.field,
6621
+ local.header,
6622
+ local.sortable,
6623
+ local.filterable,
6624
+ local.pinned,
6625
+ local.width,
6626
+ local.expandable,
6627
+ local.groupable,
6628
+ local.aggregationFn,
6629
+ local.editable,
6630
+ local.editor,
6631
+ local.editorOptions,
6632
+ local.validate
6633
+ ], (v) => untrack(() => (() => {
6634
+ if (reg) reg.registerColumn(colId(), buildSpec());
6635
+ })()), { defer: true }));
6602
6636
  onMount(() => {
6603
6637
  const _cleanup = (() => {
6604
6638
  if (reg && !registered) {
@@ -6619,24 +6653,6 @@ function Column(_props) {
6619
6653
  registered = true;
6620
6654
  reg.registerColumn(colId(), buildSpec());
6621
6655
  });
6622
- createEffect(on(() => [
6623
- local.id,
6624
- local.field,
6625
- local.header,
6626
- local.sortable,
6627
- local.filterable,
6628
- local.pinned,
6629
- local.width,
6630
- local.expandable,
6631
- local.groupable,
6632
- local.aggregationFn,
6633
- local.editable,
6634
- local.editor,
6635
- local.editorOptions,
6636
- local.validate
6637
- ], (v) => untrack(() => (() => {
6638
- if (reg) reg.registerColumn(colId(), buildSpec());
6639
- })()), { defer: true }));
6640
6656
  let reg = null;
6641
6657
  reg = registry;
6642
6658
  let registered = false;
@@ -6692,12 +6708,12 @@ function EditorText(_props) {
6692
6708
  ]);
6693
6709
  const [draft, setDraft] = createSignal("");
6694
6710
  const [touched, setTouched] = createSignal(false);
6695
- onMount(() => {
6696
- if (local.autofocus) inputElRef?.focus();
6697
- });
6698
6711
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
6699
6712
  if (v) inputElRef?.focus();
6700
6713
  })(v)), { defer: true }));
6714
+ onMount(() => {
6715
+ if (local.autofocus) inputElRef?.focus();
6716
+ });
6701
6717
  let inputElRef = null;
6702
6718
  function draftValue() {
6703
6719
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -6773,12 +6789,12 @@ function EditorNumber(_props) {
6773
6789
  ]);
6774
6790
  const [draft, setDraft] = createSignal("");
6775
6791
  const [touched, setTouched] = createSignal(false);
6776
- onMount(() => {
6777
- if (local.autofocus) inputElRef?.focus();
6778
- });
6779
6792
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
6780
6793
  if (v) inputElRef?.focus();
6781
6794
  })(v)), { defer: true }));
6795
+ onMount(() => {
6796
+ if (local.autofocus) inputElRef?.focus();
6797
+ });
6782
6798
  let inputElRef = null;
6783
6799
  function draftValue() {
6784
6800
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -6863,12 +6879,12 @@ function EditorSelect(_props) {
6863
6879
  ]);
6864
6880
  const [draft, setDraft] = createSignal("");
6865
6881
  const [touched, setTouched] = createSignal(false);
6866
- onMount(() => {
6867
- if (local.autofocus) selectElRef?.focus();
6868
- });
6869
6882
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
6870
6883
  if (v) selectElRef?.focus();
6871
6884
  })(v)), { defer: true }));
6885
+ onMount(() => {
6886
+ if (local.autofocus) selectElRef?.focus();
6887
+ });
6872
6888
  let selectElRef = null;
6873
6889
  function draftValue() {
6874
6890
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -6911,6 +6927,7 @@ function EditorSelect(_props) {
6911
6927
  onChange($event);
6912
6928
  });
6913
6929
  use((el) => {
6930
+ rozieSelectValue(el, () => draftValue());
6914
6931
  selectElRef = el;
6915
6932
  }, _el$);
6916
6933
  insert(_el$, createComponent(Key, {
@@ -6926,7 +6943,6 @@ function EditorSelect(_props) {
6926
6943
  })()
6927
6944
  }));
6928
6945
  effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
6929
- effect(() => _el$.value = draftValue());
6930
6946
  return _el$;
6931
6947
  })();
6932
6948
  }
@@ -6954,12 +6970,12 @@ function EditorCheckbox(_props) {
6954
6970
  "autofocus",
6955
6971
  "columnLabel"
6956
6972
  ]);
6957
- onMount(() => {
6958
- if (local.autofocus) inputElRef?.focus();
6959
- });
6960
6973
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
6961
6974
  if (v) inputElRef?.focus();
6962
6975
  })(v)), { defer: true }));
6976
+ onMount(() => {
6977
+ if (local.autofocus) inputElRef?.focus();
6978
+ });
6963
6979
  let inputElRef = null;
6964
6980
  function onChange(e) {
6965
6981
  local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
@@ -7049,12 +7065,12 @@ function EditorDate(_props) {
7049
7065
  ]);
7050
7066
  const [draft, setDraft] = createSignal("");
7051
7067
  const [touched, setTouched] = createSignal(false);
7052
- onMount(() => {
7053
- if (local.autofocus) inputElRef?.focus();
7054
- });
7055
7068
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
7056
7069
  if (v) inputElRef?.focus();
7057
7070
  })(v)), { defer: true }));
7071
+ onMount(() => {
7072
+ if (local.autofocus) inputElRef?.focus();
7073
+ });
7058
7074
  let inputElRef = null;
7059
7075
  function draftValue() {
7060
7076
  return touched() ? draft() : toIsoDateString(local.value);
@@ -7317,6 +7333,9 @@ function FilterSelect(_props) {
7317
7333
  _el$.addEventListener("change", ($event) => {
7318
7334
  onChange($event);
7319
7335
  });
7336
+ use((el) => {
7337
+ rozieSelectValue(el, () => selectValue());
7338
+ }, _el$);
7320
7339
  insert(_el$, createComponent(Key, {
7321
7340
  get each() {
7322
7341
  return local.uniqueValues;
@@ -7330,7 +7349,6 @@ function FilterSelect(_props) {
7330
7349
  })()
7331
7350
  }), null);
7332
7351
  effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
7333
- effect(() => _el$.value = selectValue());
7334
7352
  return _el$;
7335
7353
  })();
7336
7354
  }
@@ -1,6 +1,6 @@
1
1
  import { Show, createEffect, createSignal, mergeProps, on, onCleanup, onMount, splitProps, untrack, useContext } from "solid-js";
2
2
  import { Key } from "@solid-primitives/keyed";
3
- import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay } from "@rozie/runtime-solid";
3
+ import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay, rozieSelectValue } from "@rozie/runtime-solid";
4
4
  import Popover from "@rozie-ui/popover-solid";
5
5
  import { createTable, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from "@tanstack/table-core";
6
6
  import { Virtualizer, elementScroll, measureElement, observeElementOffset, observeElementRect } from "@tanstack/virtual-core";
@@ -706,7 +706,17 @@ function DataTable(_props) {
706
706
  "onSelectionChange",
707
707
  "onSortChange",
708
708
  "onVisibilityChange",
709
- "onVisibleRangeChange"
709
+ "onVisibleRangeChange",
710
+ "groupBarSlot",
711
+ "selectAllSlot",
712
+ "placeholderSlot",
713
+ "selectCellSlot",
714
+ "detailSlot",
715
+ "colHeaderSlot",
716
+ "filterSlot",
717
+ "cellSlot",
718
+ "editorSlot",
719
+ "slots"
710
720
  ]);
711
721
  const resolved = () => local.children;
712
722
  onMount(() => {
@@ -817,6 +827,45 @@ function DataTable(_props) {
817
827
  const [pasteAnnounce, setPasteAnnounce] = createSignal("");
818
828
  const [rangeAnnounce, setRangeAnnounce] = createSignal("");
819
829
  const [liveAnnounce, setLiveAnnounce] = createSignal("");
830
+ createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
831
+ createEffect(on(() => [
832
+ sorting(),
833
+ globalFilter(),
834
+ columnFilters(),
835
+ pagination(),
836
+ local.rowCount,
837
+ local.pageCount,
838
+ rowSelection(),
839
+ expanded(),
840
+ local.expandable,
841
+ grouping(),
842
+ local.groupable,
843
+ columnVisibility(),
844
+ columnSizing(),
845
+ columnOrder(),
846
+ columnPinning(),
847
+ local.selectionMode,
848
+ (data() || []).length,
849
+ data(),
850
+ dataDefault(),
851
+ local.columns,
852
+ colReg()
853
+ ], (v) => untrack(() => (() => {
854
+ seedColumnPinning();
855
+ reFeed();
856
+ maybeClearHistoryOnExternalSwap();
857
+ })()), { defer: true }));
858
+ createEffect(on(() => [
859
+ sorting(),
860
+ columnFilters(),
861
+ globalFilter(),
862
+ sortingDefault(),
863
+ columnFiltersDefault(),
864
+ globalFilterDefault()
865
+ ], (v) => untrack(() => (() => {
866
+ const msg = buildSortFilterAnnounce();
867
+ if (msg) setLiveAnnounce(msg);
868
+ })()), { defer: true }));
820
869
  onMount(() => {
821
870
  setDataDefault(data() || []);
822
871
  seedColumnPinning();
@@ -959,45 +1008,6 @@ function DataTable(_props) {
959
1008
  lastDataLen = d.length;
960
1009
  reFeed();
961
1010
  });
962
- createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
963
- createEffect(on(() => [
964
- sorting(),
965
- globalFilter(),
966
- columnFilters(),
967
- pagination(),
968
- local.rowCount,
969
- local.pageCount,
970
- rowSelection(),
971
- expanded(),
972
- local.expandable,
973
- grouping(),
974
- local.groupable,
975
- columnVisibility(),
976
- columnSizing(),
977
- columnOrder(),
978
- columnPinning(),
979
- local.selectionMode,
980
- (data() || []).length,
981
- data(),
982
- dataDefault(),
983
- local.columns,
984
- colReg()
985
- ], (v) => untrack(() => (() => {
986
- seedColumnPinning();
987
- reFeed();
988
- maybeClearHistoryOnExternalSwap();
989
- })()), { defer: true }));
990
- createEffect(on(() => [
991
- sorting(),
992
- columnFilters(),
993
- globalFilter(),
994
- sortingDefault(),
995
- columnFiltersDefault(),
996
- globalFilterDefault()
997
- ], (v) => untrack(() => (() => {
998
- const msg = buildSortFilterAnnounce();
999
- if (msg) setLiveAnnounce(msg);
1000
- })()), { defer: true }));
1001
1011
  let __rozieRootRef = null;
1002
1012
  let table = null;
1003
1013
  let virtualizer = null;
@@ -4965,7 +4975,9 @@ function DataTable(_props) {
4965
4975
  onEditorKeyDown($event);
4966
4976
  }} onBlur={($event) => {
4967
4977
  onEditorBlur($event);
4968
- }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? "true" : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event) => {
4978
+ }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? "true" : null)} class={"rdt-cell-editor"} ref={(el) => {
4979
+ rozieSelectValue(el, () => editorValueFor(cell().column.id));
4980
+ }} onChange={($event) => {
4969
4981
  onCellEditorInput(cell().column.id, $event);
4970
4982
  }} onKeyDown={($event) => {
4971
4983
  onEditorKeyDown($event);
@@ -5333,7 +5345,9 @@ function DataTable(_props) {
5333
5345
  onEditorKeyDown($event);
5334
5346
  }} onBlur={($event) => {
5335
5347
  onEditorBlur($event);
5336
- }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? "true" : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event) => {
5348
+ }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? "true" : null)} class={"rdt-cell-editor"} ref={(el) => {
5349
+ rozieSelectValue(el, () => editorValueFor(cell().column.id));
5350
+ }} onChange={($event) => {
5337
5351
  onCellEditorInput(cell().column.id, $event);
5338
5352
  }} onKeyDown={($event) => {
5339
5353
  onEditorKeyDown($event);
@@ -5437,7 +5451,9 @@ function DataTable(_props) {
5437
5451
  <button type="button" class={"rdt-page-btn rdt-page-next"} disabled={!canNextPage()} onClick={($event) => {
5438
5452
  onNextPage();
5439
5453
  }} data-rozie-s-d5dcab4c="">Next</button>
5440
- <select aria-label="Rows per page" class={"rdt-page-size"} value={pageSize()} onChange={($event) => {
5454
+ <select aria-label="Rows per page" class={"rdt-page-size"} ref={(el) => {
5455
+ rozieSelectValue(el, () => pageSize());
5456
+ }} onChange={($event) => {
5441
5457
  onPageSizeChange($event);
5442
5458
  }} data-rozie-s-d5dcab4c="">
5443
5459
  <option value={10} data-rozie-s-d5dcab4c="">10</option>
@@ -5484,6 +5500,24 @@ function Column(_props) {
5484
5500
  "validate"
5485
5501
  ]);
5486
5502
  const registry = useContext(rozieContext("data-table:columns"));
5503
+ createEffect(on(() => [
5504
+ local.id,
5505
+ local.field,
5506
+ local.header,
5507
+ local.sortable,
5508
+ local.filterable,
5509
+ local.pinned,
5510
+ local.width,
5511
+ local.expandable,
5512
+ local.groupable,
5513
+ local.aggregationFn,
5514
+ local.editable,
5515
+ local.editor,
5516
+ local.editorOptions,
5517
+ local.validate
5518
+ ], (v) => untrack(() => (() => {
5519
+ if (reg) reg.registerColumn(colId(), buildSpec());
5520
+ })()), { defer: true }));
5487
5521
  onMount(() => {
5488
5522
  const _cleanup = (() => {
5489
5523
  if (reg && !registered) {
@@ -5504,24 +5538,6 @@ function Column(_props) {
5504
5538
  registered = true;
5505
5539
  reg.registerColumn(colId(), buildSpec());
5506
5540
  });
5507
- createEffect(on(() => [
5508
- local.id,
5509
- local.field,
5510
- local.header,
5511
- local.sortable,
5512
- local.filterable,
5513
- local.pinned,
5514
- local.width,
5515
- local.expandable,
5516
- local.groupable,
5517
- local.aggregationFn,
5518
- local.editable,
5519
- local.editor,
5520
- local.editorOptions,
5521
- local.validate
5522
- ], (v) => untrack(() => (() => {
5523
- if (reg) reg.registerColumn(colId(), buildSpec());
5524
- })()), { defer: true }));
5525
5541
  let reg = null;
5526
5542
  reg = registry;
5527
5543
  let registered = false;
@@ -5575,12 +5591,12 @@ function EditorText(_props) {
5575
5591
  ]);
5576
5592
  const [draft, setDraft] = createSignal("");
5577
5593
  const [touched, setTouched] = createSignal(false);
5578
- onMount(() => {
5579
- if (local.autofocus) inputElRef?.focus();
5580
- });
5581
5594
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
5582
5595
  if (v) inputElRef?.focus();
5583
5596
  })(v)), { defer: true }));
5597
+ onMount(() => {
5598
+ if (local.autofocus) inputElRef?.focus();
5599
+ });
5584
5600
  let inputElRef = null;
5585
5601
  function draftValue() {
5586
5602
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -5647,12 +5663,12 @@ function EditorNumber(_props) {
5647
5663
  ]);
5648
5664
  const [draft, setDraft] = createSignal("");
5649
5665
  const [touched, setTouched] = createSignal(false);
5650
- onMount(() => {
5651
- if (local.autofocus) inputElRef?.focus();
5652
- });
5653
5666
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
5654
5667
  if (v) inputElRef?.focus();
5655
5668
  })(v)), { defer: true }));
5669
+ onMount(() => {
5670
+ if (local.autofocus) inputElRef?.focus();
5671
+ });
5656
5672
  let inputElRef = null;
5657
5673
  function draftValue() {
5658
5674
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -5728,12 +5744,12 @@ function EditorSelect(_props) {
5728
5744
  ]);
5729
5745
  const [draft, setDraft] = createSignal("");
5730
5746
  const [touched, setTouched] = createSignal(false);
5731
- onMount(() => {
5732
- if (local.autofocus) selectElRef?.focus();
5733
- });
5734
5747
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
5735
5748
  if (v) selectElRef?.focus();
5736
5749
  })(v)), { defer: true }));
5750
+ onMount(() => {
5751
+ if (local.autofocus) selectElRef?.focus();
5752
+ });
5737
5753
  let selectElRef = null;
5738
5754
  function draftValue() {
5739
5755
  return touched() ? draft() : local.value != null ? String(local.value) : "";
@@ -5766,8 +5782,9 @@ function EditorSelect(_props) {
5766
5782
  }
5767
5783
  return <>
5768
5784
  <select data-editing-cell="" aria-label={rozieAttr(a11yLabel())} ref={(el) => {
5785
+ rozieSelectValue(el, () => draftValue());
5769
5786
  selectElRef = el;
5770
- }} class={"rdt-cell-editor"} value={draftValue()} onChange={($event) => {
5787
+ }} class={"rdt-cell-editor"} onChange={($event) => {
5771
5788
  onChange($event);
5772
5789
  }} onKeyDown={($event) => {
5773
5790
  onKeydown($event);
@@ -5800,12 +5817,12 @@ function EditorCheckbox(_props) {
5800
5817
  "autofocus",
5801
5818
  "columnLabel"
5802
5819
  ]);
5803
- onMount(() => {
5804
- if (local.autofocus) inputElRef?.focus();
5805
- });
5806
5820
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
5807
5821
  if (v) inputElRef?.focus();
5808
5822
  })(v)), { defer: true }));
5823
+ onMount(() => {
5824
+ if (local.autofocus) inputElRef?.focus();
5825
+ });
5809
5826
  let inputElRef = null;
5810
5827
  function onChange(e) {
5811
5828
  local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
@@ -5887,12 +5904,12 @@ function EditorDate(_props) {
5887
5904
  ]);
5888
5905
  const [draft, setDraft] = createSignal("");
5889
5906
  const [touched, setTouched] = createSignal(false);
5890
- onMount(() => {
5891
- if (local.autofocus) inputElRef?.focus();
5892
- });
5893
5907
  createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
5894
5908
  if (v) inputElRef?.focus();
5895
5909
  })(v)), { defer: true }));
5910
+ onMount(() => {
5911
+ if (local.autofocus) inputElRef?.focus();
5912
+ });
5896
5913
  let inputElRef = null;
5897
5914
  function draftValue() {
5898
5915
  return touched() ? draft() : toIsoDateString(local.value);
@@ -6113,7 +6130,9 @@ function FilterSelect(_props) {
6113
6130
  return local.columnId;
6114
6131
  }
6115
6132
  return <>
6116
- <select part="col-filter" aria-label={rozieAttr(a11yLabel())} class={"rdt-col-filter"} value={selectValue()} onChange={($event) => {
6133
+ <select part="col-filter" aria-label={rozieAttr(a11yLabel())} class={"rdt-col-filter"} ref={(el) => {
6134
+ rozieSelectValue(el, () => selectValue());
6135
+ }} onChange={($event) => {
6117
6136
  onChange($event);
6118
6137
  }} data-rozie-s-d75b42b2="">
6119
6138
  <option value="" data-rozie-s-d75b42b2="">All</option>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rozie-ui/data-table-solid",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "@solid-primitives/keyed": "^1.5.3",
51
- "@rozie/runtime-solid": "^0.9.0"
51
+ "@rozie/runtime-solid": "^0.10.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "solid-js": "^1.8",
package/src/Column.tsx CHANGED
@@ -68,6 +68,9 @@ export default function Column(_props: ColumnProps): JSX.Element {
68
68
  const [local, attrs] = splitProps(_merged, ['id', 'field', 'header', 'sortable', 'filterable', 'pinned', 'width', 'expandable', 'groupable', 'aggregationFn', 'editable', 'editor', 'editorOptions', 'validate']);
69
69
 
70
70
  const registry = useContext(rozieContext("data-table:columns"));
71
+ createEffect(on(() => (() => [local.id, local.field, local.header, local.sortable, local.filterable, local.pinned, local.width, local.expandable, local.groupable, local.aggregationFn, local.editable, local.editor, local.editorOptions, local.validate])(), (v) => untrack(() => (() => {
72
+ if (reg) reg.registerColumn(colId(), buildSpec());
73
+ })()), { defer: true }));
71
74
  onMount(() => {
72
75
  const _cleanup = (() => {
73
76
  // register this column's spec. On Lit the injected registry may still be undefined
@@ -91,9 +94,6 @@ export default function Column(_props: ColumnProps): JSX.Element {
91
94
  registered = true;
92
95
  reg.registerColumn(colId(), buildSpec());
93
96
  });
94
- createEffect(on(() => (() => [local.id, local.field, local.header, local.sortable, local.filterable, local.pinned, local.width, local.expandable, local.groupable, local.aggregationFn, local.editable, local.editor, local.editorOptions, local.validate])(), (v) => untrack(() => (() => {
95
- if (reg) reg.registerColumn(colId(), buildSpec());
96
- })()), { defer: true }));
97
97
 
98
98
  // $inject is typed `unknown` (Phase 36 D-4: no rich type synthesis yet), which the
99
99
  // STRICT BUNDLED-LEAF tsc rejects on `.registerColumn(...)` (TS2339). The .rozie-native
package/src/DataTable.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { JSX } from 'solid-js';
2
2
  import { Show, createEffect, createSignal, mergeProps, on, onCleanup, onMount, splitProps, untrack } from 'solid-js';
3
3
  import { Key } from '@solid-primitives/keyed';
4
- import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay } from '@rozie/runtime-solid';
4
+ import { __rozieInjectStyle, createControllableSignal, parseInlineStyle, rozieAttr, rozieClass, rozieContext, rozieDisplay, rozieSelectValue } from '@rozie/runtime-solid';
5
5
  import Popover from '@rozie-ui/popover-solid';
6
6
  import { isSafeKey, wrapAggregationFn, indexDefsById, editorKindWarning, collectGroupableLeafDefs } from './helpers/columnDefUtils';
7
7
  import { applyUpdater, clamp, focusables } from './helpers/indexMath';
@@ -755,7 +755,7 @@ export interface DataTableHandle {
755
755
 
756
756
  export default function DataTable(_props: DataTableProps): JSX.Element {
757
757
  const _merged = mergeProps({ columns: (() => [])() as any[], selectionMode: 'none', manual: false, rowCount: null, pageCount: null, expandable: false, getRowId: null, getSubRows: null, groupable: false, stickyHeader: false, interactionMode: 'table', singleClickEdit: false, undoable: false, undoLimit: 100, virtual: false, estimateRowHeight: 40, autoMeasure: false, maxHeight: '' }, _props);
758
- const [local, attrs] = splitProps(_merged, ['data', 'columns', 'selectionMode', 'sorting', 'globalFilter', 'columnFilters', 'pagination', 'manual', 'rowCount', 'pageCount', 'expandable', 'expanded', 'getRowId', 'getSubRows', 'groupable', 'grouping', 'rowSelection', 'columnVisibility', 'columnSizing', 'columnOrder', 'columnPinning', 'stickyHeader', 'interactionMode', 'singleClickEdit', 'undoable', 'undoLimit', 'virtual', 'estimateRowHeight', 'autoMeasure', 'maxHeight', 'children', 'ref', 'onActivecellChange', 'onCellEditCommit', 'onExpandChange', 'onFilterChange', 'onGroupChange', 'onHistoryChange', 'onPageChange', 'onPinChange', 'onRangeChange', 'onReorderChange', 'onResizeChange', 'onRowActivate', 'onRowEditCommit', 'onSelectionChange', 'onSortChange', 'onVisibilityChange', 'onVisibleRangeChange']);
758
+ const [local, attrs] = splitProps(_merged, ['data', 'columns', 'selectionMode', 'sorting', 'globalFilter', 'columnFilters', 'pagination', 'manual', 'rowCount', 'pageCount', 'expandable', 'expanded', 'getRowId', 'getSubRows', 'groupable', 'grouping', 'rowSelection', 'columnVisibility', 'columnSizing', 'columnOrder', 'columnPinning', 'stickyHeader', 'interactionMode', 'singleClickEdit', 'undoable', 'undoLimit', 'virtual', 'estimateRowHeight', 'autoMeasure', 'maxHeight', 'children', 'ref', 'onActivecellChange', 'onCellEditCommit', 'onExpandChange', 'onFilterChange', 'onGroupChange', 'onHistoryChange', 'onPageChange', 'onPinChange', 'onRangeChange', 'onReorderChange', 'onResizeChange', 'onRowActivate', 'onRowEditCommit', 'onSelectionChange', 'onSortChange', 'onVisibilityChange', 'onVisibleRangeChange', 'groupBarSlot', 'selectAllSlot', 'placeholderSlot', 'selectCellSlot', 'detailSlot', 'colHeaderSlot', 'filterSlot', 'cellSlot', 'editorSlot', 'slots']);
759
759
  const resolved = () => local.children;
760
760
  onMount(() => { local.ref?.({ sortColumn, clearSorting, toggleRowExpanded, expandAll, collapseAll, getExpandedRows, applyGrouping, clearGrouping, getFacetedUniqueValues, getFacetedMinMaxValues, getColumnDefs, toggleAllRows, clearSelection, getSelectedRows, setPage, setRowsPerPage, toggleColumnVisibility, applyColumnOrder, resetColumnSizing, pinColumn, focusCell, getActiveCell, clearActiveCell, scrollToRow, getScrollElement, getRowIndexRelativeToPage, editCell, commitEditing, editRow, getSelectedRange, cut, undo, redo, canUndo, canRedo, clearHistory }); });
761
761
 
@@ -827,6 +827,36 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
827
827
  const [pasteAnnounce, setPasteAnnounce] = createSignal('');
828
828
  const [rangeAnnounce, setRangeAnnounce] = createSignal('');
829
829
  const [liveAnnounce, setLiveAnnounce] = createSignal('');
830
+ createEffect(on(() => (() => windowVer())(), (v) => untrack(() => (() => emitVisibleRangeIfChanged())()), { defer: true }));
831
+ createEffect(on(() => (() => [sorting(), globalFilter(), columnFilters(), pagination(),
832
+ // Server-side page-count sources (#2): re-feed when the consumer's rowCount/pageCount
833
+ // changes at runtime (e.g. a server response updates the total) so getPageCount() and the
834
+ // Next button availability track the new total.
835
+ local.rowCount, local.pageCount, rowSelection(), expanded(), local.expandable, grouping(), local.groupable, columnVisibility(), columnSizing(), columnOrder(), columnPinning(), local.selectionMode, (data() || []).length, // Phase 51 req-4: key on the data REFERENCE (both sinks) so a committed edit re-feeds
836
+ // even when the fresh array is the SAME length (a single-cell edit replaces one row
837
+ // object → new array ref, identical length → the .length key alone would miss it). The
838
+ // controlled path observes $props.data; the uncontrolled path observes $data.dataDefault.
839
+ // writeData is echo-guarded (programmatic) and reFeed writes neither sink, so no loop.
840
+ data(), dataDefault(),
841
+ // Column CONFIG prop (the `:columns` array form) — the sibling column source to
842
+ // $data.colReg (the `<Column>` children). Watch it so a runtime `:columns` swap re-feeds:
843
+ // columnDefs()/tableColumns() build the UNION of both, and reFeed re-passes columns.
844
+ // (Consumers memoize the array as with $props.data/$props.sorting; the uncontrolled
845
+ // <Column>-children path leaves $props.columns undefined — a stable no-op getter.)
846
+ local.columns, colReg()])(), (v) => untrack(() => (() => {
847
+ // Seed BEFORE the re-feed so the pinning this call may write is part of the state object
848
+ // table-core receives on this same tick (rather than landing a frame late and re-ordering
849
+ // getVisibleCells() a render after the columns appear). One-shot and self-latching — see
850
+ // seedColumnPinning() in stateAssembly.rzts. This is the `<Column>`-children entry point:
851
+ // those register during mount, so the $onMount call below can find zero columns.
852
+ seedColumnPinning();
853
+ reFeed();
854
+ maybeClearHistoryOnExternalSwap();
855
+ })()), { defer: true }));
856
+ createEffect(on(() => (() => [sorting(), columnFilters(), globalFilter(), sortingDefault(), columnFiltersDefault(), globalFilterDefault()])(), (v) => untrack(() => (() => {
857
+ const msg = buildSortFilterAnnounce();
858
+ if (msg) setLiveAnnounce(msg);
859
+ })()), { defer: true }));
830
860
  onMount(() => {
831
861
  // Seed the uncontrolled `data` fallback (Phase 51 req-4) from the initial prop so an
832
862
  // edit committed BEFORE the consumer ever pushes new rows (or when the consumer passes
@@ -1222,36 +1252,6 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
1222
1252
  lastDataLen = d.length;
1223
1253
  reFeed();
1224
1254
  });
1225
- createEffect(on(() => (() => windowVer())(), (v) => untrack(() => (() => emitVisibleRangeIfChanged())()), { defer: true }));
1226
- createEffect(on(() => (() => [sorting(), globalFilter(), columnFilters(), pagination(),
1227
- // Server-side page-count sources (#2): re-feed when the consumer's rowCount/pageCount
1228
- // changes at runtime (e.g. a server response updates the total) so getPageCount() and the
1229
- // Next button availability track the new total.
1230
- local.rowCount, local.pageCount, rowSelection(), expanded(), local.expandable, grouping(), local.groupable, columnVisibility(), columnSizing(), columnOrder(), columnPinning(), local.selectionMode, (data() || []).length, // Phase 51 req-4: key on the data REFERENCE (both sinks) so a committed edit re-feeds
1231
- // even when the fresh array is the SAME length (a single-cell edit replaces one row
1232
- // object → new array ref, identical length → the .length key alone would miss it). The
1233
- // controlled path observes $props.data; the uncontrolled path observes $data.dataDefault.
1234
- // writeData is echo-guarded (programmatic) and reFeed writes neither sink, so no loop.
1235
- data(), dataDefault(),
1236
- // Column CONFIG prop (the `:columns` array form) — the sibling column source to
1237
- // $data.colReg (the `<Column>` children). Watch it so a runtime `:columns` swap re-feeds:
1238
- // columnDefs()/tableColumns() build the UNION of both, and reFeed re-passes columns.
1239
- // (Consumers memoize the array as with $props.data/$props.sorting; the uncontrolled
1240
- // <Column>-children path leaves $props.columns undefined — a stable no-op getter.)
1241
- local.columns, colReg()])(), (v) => untrack(() => (() => {
1242
- // Seed BEFORE the re-feed so the pinning this call may write is part of the state object
1243
- // table-core receives on this same tick (rather than landing a frame late and re-ordering
1244
- // getVisibleCells() a render after the columns appear). One-shot and self-latching — see
1245
- // seedColumnPinning() in stateAssembly.rzts. This is the `<Column>`-children entry point:
1246
- // those register during mount, so the $onMount call below can find zero columns.
1247
- seedColumnPinning();
1248
- reFeed();
1249
- maybeClearHistoryOnExternalSwap();
1250
- })()), { defer: true }));
1251
- createEffect(on(() => (() => [sorting(), columnFilters(), globalFilter(), sortingDefault(), columnFiltersDefault(), globalFilterDefault()])(), (v) => untrack(() => (() => {
1252
- const msg = buildSortFilterAnnounce();
1253
- if (msg) setLiveAnnounce(msg);
1254
- })()), { defer: true }));
1255
1255
  let __rozieRootRef: HTMLElement | null = null;
1256
1256
 
1257
1257
  // table-core instance — top-level `let` referenced from hooks → React hoists to
@@ -4518,9 +4518,6 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
4518
4518
  function toAbsRow(localRow: any) {
4519
4519
  return localRow + pageRowOffset();
4520
4520
  }
4521
- // A body row's ABSOLUTE display-order index = its page-relative index + the page offset. Drives
4522
- // aria-rowindex on the non-virtual paginated body (B27); the virtual path uses wr.vi.index
4523
- // directly (already absolute). Reactive via rowIndexOf's tick().
4524
4521
 
4525
4522
  // Total filtered+sorted PRE-pagination row count — the clamp bound for an absolute focusCell.
4526
4523
  // In virtual mode $data.rows IS the full pre-pagination model (bodyRowCount suffices); in the
@@ -8813,7 +8810,7 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
8813
8810
  </span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
8814
8811
  {<Show when={editorTypeOf(cell().column.id) === 'number'} fallback={<Show when={editorTypeOf(cell().column.id) === 'select'} fallback={<Show when={editorTypeOf(cell().column.id) === 'checkbox'} fallback={<Show when={editorTypeOf(cell().column.id) === 'custom'} fallback={<input type="text" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}><span style={{ display: "contents" }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSpanElement; target: Element }) => { onEditorDropinKeyDown($event); }} data-rozie-s-d5dcab4c="">
8815
8812
  {_props.slots?.[`editor-${cell().column.id}`]?.({ get columnId() { return cell().column.id; }, get column() { return cell().column; }, get row() { return cellSlotRow(row()); }, get value() { return editorValueFor(cell().column.id); }, get commit() { return editorCommitFor(cell().column.id); }, get cancel() { return editorCancelFor(); }, get columnLabel() { return headerLabel(cell().column.id); }, get autofocus() { return editorAutofocusFor(cell().column.id, rowIndexOf(row())); } }) ?? (_props.editorSlot ?? _props.slots?.['editor'])?.({ get columnId() { return cell().column.id; }, get column() { return cell().column; }, get row() { return cellSlotRow(row()); }, get value() { return editorValueFor(cell().column.id); }, get commit() { return editorCommitFor(cell().column.id); }, get cancel() { return editorCancelFor(); }, get columnLabel() { return headerLabel(cell().column.id); }, get autofocus() { return editorAutofocusFor(cell().column.id, rowIndexOf(row())); } }) ?? <input type="text" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}
8816
- </span></Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorCheckbox(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="">
8813
+ </span></Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorCheckbox(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} ref={(el) => { rozieSelectValue(el as HTMLSelectElement, () => (editorValueFor(cell().column.id))); }} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="">
8817
8814
  <Key each={editorOptionsOf(cell().column.id) as readonly any[]} by={(opt) => opt.value}>{(opt) => <option value={rozieAttr(opt().value)} data-rozie-s-d5dcab4c="">{rozieDisplay(opt().label)}</option>}</Key>
8818
8815
  </select></Show>}><input type="number" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
8819
8816
  <button type="button" data-expander="" aria-expanded={!!rowIsExpanded(row())} aria-label={rozieAttr(rowIsExpanded(row()) ? 'Collapse group' : 'Expand group')} class={"rdt-expander rdt-group-toggle"} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onToggleExpand(row(), $event); }} data-rozie-s-d5dcab4c="">{rozieDisplay(rowIsExpanded(row()) ? '▾' : '▸')}</button>
@@ -8890,7 +8887,7 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
8890
8887
  </span>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="" /></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
8891
8888
  {<Show when={editorTypeOf(cell().column.id) === 'number'} fallback={<Show when={editorTypeOf(cell().column.id) === 'select'} fallback={<Show when={editorTypeOf(cell().column.id) === 'checkbox'} fallback={<Show when={editorTypeOf(cell().column.id) === 'custom'} fallback={<input type="text" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}><span style={{ display: "contents" }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSpanElement; target: Element }) => { onEditorDropinKeyDown($event); }} data-rozie-s-d5dcab4c="">
8892
8889
  {_props.slots?.[`editor-${cell().column.id}`]?.({ get columnId() { return cell().column.id; }, get column() { return cell().column; }, get row() { return cellSlotRow(wr().row); }, get value() { return editorValueFor(cell().column.id); }, get commit() { return editorCommitFor(cell().column.id); }, get cancel() { return editorCancelFor(); }, get columnLabel() { return headerLabel(cell().column.id); }, get autofocus() { return editorAutofocusFor(cell().column.id, wr().vi.index); } }) ?? (_props.editorSlot ?? _props.slots?.['editor'])?.({ get columnId() { return cell().column.id; }, get column() { return cell().column; }, get row() { return cellSlotRow(wr().row); }, get value() { return editorValueFor(cell().column.id); }, get commit() { return editorCommitFor(cell().column.id); }, get cancel() { return editorCancelFor(); }, get columnLabel() { return headerLabel(cell().column.id); }, get autofocus() { return editorAutofocusFor(cell().column.id, wr().vi.index); } }) ?? <input type="text" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" />}
8893
- </span></Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorCheckbox(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="">
8890
+ </span></Show>}><input type="checkbox" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} checked={editorCheckedFor(cell().column.id)} onChange={($event: Event & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorCheckbox(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} ref={(el) => { rozieSelectValue(el as HTMLSelectElement, () => (editorValueFor(cell().column.id))); }} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="">
8894
8891
  <Key each={editorOptionsOf(cell().column.id) as readonly any[]} by={(opt) => opt.value}>{(opt) => <option value={rozieAttr(opt().value)} data-rozie-s-d5dcab4c="">{rozieDisplay(opt().label)}</option>}</Key>
8895
8892
  </select></Show>}><input type="number" data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? 'true' : null)} class={"rdt-cell-editor"} value={editorValueFor(cell().column.id)} onInput={($event: InputEvent & { currentTarget: HTMLInputElement; target: Element }) => { onCellEditorInput(cell().column.id, $event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorKeyDown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLInputElement; target: Element }) => { onEditorBlur($event); }} data-rozie-s-d5dcab4c="" /></Show>}</span></Show>}><span style={{ display: "contents" }} data-rozie-s-d5dcab4c="">
8896
8893
  <button type="button" data-expander="" aria-expanded={!!rowIsExpanded(wr().row)} aria-label={rozieAttr(rowIsExpanded(wr().row) ? 'Collapse group' : 'Expand group')} class={"rdt-expander rdt-group-toggle"} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onToggleExpand(wr().row, $event); }} data-rozie-s-d5dcab4c="">{rozieDisplay(rowIsExpanded(wr().row) ? '▾' : '▸')}</button>
@@ -8927,7 +8924,7 @@ export default function DataTable(_props: DataTableProps): JSX.Element {
8927
8924
  {rozieDisplay('Page ' + (pageIndex() + 1) + ' of ' + displayPageCount())}
8928
8925
  </span>
8929
8926
  <button type="button" class={"rdt-page-btn rdt-page-next"} disabled={!canNextPage()} onClick={($event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => { onNextPage(); }} data-rozie-s-d5dcab4c="">Next</button>
8930
- <select aria-label="Rows per page" class={"rdt-page-size"} value={pageSize()} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onPageSizeChange($event); }} data-rozie-s-d5dcab4c="">
8927
+ <select aria-label="Rows per page" class={"rdt-page-size"} ref={(el) => { rozieSelectValue(el as HTMLSelectElement, () => (pageSize())); }} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onPageSizeChange($event); }} data-rozie-s-d5dcab4c="">
8931
8928
  <option value={10} data-rozie-s-d5dcab4c="">10</option>
8932
8929
  <option value={25} data-rozie-s-d5dcab4c="">25</option>
8933
8930
  <option value={50} data-rozie-s-d5dcab4c="">50</option>
@@ -41,12 +41,12 @@ export default function EditorCheckbox(_props: EditorCheckboxProps): JSX.Element
41
41
  const _merged = mergeProps({ columnId: '', column: null, row: null, value: null, commit: null, cancel: null, autofocus: false, columnLabel: '' }, _props);
42
42
  const [local, attrs] = splitProps(_merged, ['columnId', 'column', 'row', 'value', 'commit', 'cancel', 'autofocus', 'columnLabel']);
43
43
 
44
- onMount(() => {
45
- if (local.autofocus) inputElRef?.focus();
46
- });
47
44
  createEffect(on(() => (() => local.autofocus)(), (v) => untrack(() => ((v: any) => {
48
45
  if (v) inputElRef?.focus();
49
46
  })(v)), { defer: true }));
47
+ onMount(() => {
48
+ if (local.autofocus) inputElRef?.focus();
49
+ });
50
50
  let inputElRef: HTMLElement | null = null;
51
51
 
52
52
  // Immediate-commit-on-change: read .checked the global-filter way, coerce to a
@@ -64,12 +64,12 @@ export default function EditorDate(_props: EditorDateProps): JSX.Element {
64
64
 
65
65
  const [draft, setDraft] = createSignal('');
66
66
  const [touched, setTouched] = createSignal(false);
67
- onMount(() => {
68
- if (local.autofocus) inputElRef?.focus();
69
- });
70
67
  createEffect(on(() => (() => local.autofocus)(), (v) => untrack(() => ((v: any) => {
71
68
  if (v) inputElRef?.focus();
72
69
  })(v)), { defer: true }));
70
+ onMount(() => {
71
+ if (local.autofocus) inputElRef?.focus();
72
+ });
73
73
  let inputElRef: HTMLElement | null = null;
74
74
 
75
75
  // ── N-04: the draft is DERIVED, not seeded setup-once ───────────────────────────────────
@@ -43,12 +43,12 @@ export default function EditorNumber(_props: EditorNumberProps): JSX.Element {
43
43
 
44
44
  const [draft, setDraft] = createSignal('');
45
45
  const [touched, setTouched] = createSignal(false);
46
- onMount(() => {
47
- if (local.autofocus) inputElRef?.focus();
48
- });
49
46
  createEffect(on(() => (() => local.autofocus)(), (v) => untrack(() => ((v: any) => {
50
47
  if (v) inputElRef?.focus();
51
48
  })(v)), { defer: true }));
49
+ onMount(() => {
50
+ if (local.autofocus) inputElRef?.focus();
51
+ });
52
52
  let inputElRef: HTMLElement | null = null;
53
53
 
54
54
  // Seed the draft string once from the incoming value (setup-once).
@@ -1,7 +1,7 @@
1
1
  import type { JSX } from 'solid-js';
2
2
  import { createEffect, createSignal, mergeProps, on, onMount, splitProps, untrack } from 'solid-js';
3
3
  import { Key } from '@solid-primitives/keyed';
4
- import { rozieAttr, rozieDisplay } from '@rozie/runtime-solid';
4
+ import { rozieAttr, rozieDisplay, rozieSelectValue } from '@rozie/runtime-solid';
5
5
 
6
6
  interface EditorSelectProps {
7
7
  /**
@@ -48,12 +48,12 @@ export default function EditorSelect(_props: EditorSelectProps): JSX.Element {
48
48
 
49
49
  const [draft, setDraft] = createSignal('');
50
50
  const [touched, setTouched] = createSignal(false);
51
- onMount(() => {
52
- if (local.autofocus) selectElRef?.focus();
53
- });
54
51
  createEffect(on(() => (() => local.autofocus)(), (v) => untrack(() => ((v: any) => {
55
52
  if (v) selectElRef?.focus();
56
53
  })(v)), { defer: true }));
54
+ onMount(() => {
55
+ if (local.autofocus) selectElRef?.focus();
56
+ });
57
57
  let selectElRef: HTMLElement | null = null;
58
58
 
59
59
  // Seed the draft once from the incoming value (setup-once). Normalize null/undefined
@@ -116,7 +116,7 @@ export default function EditorSelect(_props: EditorSelectProps): JSX.Element {
116
116
 
117
117
  return (
118
118
  <>
119
- <select data-editing-cell="" aria-label={rozieAttr(a11yLabel())} ref={(el) => { selectElRef = el as HTMLElement; }} class={"rdt-cell-editor"} value={draftValue()} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onChange($event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onKeydown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onBlur(); }} data-rozie-s-117f1a16="">
119
+ <select data-editing-cell="" aria-label={rozieAttr(a11yLabel())} ref={(el) => { rozieSelectValue(el as HTMLSelectElement, () => (draftValue())); selectElRef = el as HTMLElement; }} class={"rdt-cell-editor"} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onChange($event); }} onKeyDown={($event: KeyboardEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onKeydown($event); }} onBlur={($event: FocusEvent & { currentTarget: HTMLSelectElement; target: Element }) => { onBlur(); }} data-rozie-s-117f1a16="">
120
120
  <Key each={local.options as readonly any[]} by={(opt) => opt.value}>{(opt) => <option value={rozieAttr(opt().value)} data-rozie-s-117f1a16="">{rozieDisplay(opt().label)}</option>}</Key>
121
121
  </select>
122
122
  </>
@@ -43,12 +43,12 @@ export default function EditorText(_props: EditorTextProps): JSX.Element {
43
43
 
44
44
  const [draft, setDraft] = createSignal('');
45
45
  const [touched, setTouched] = createSignal(false);
46
- onMount(() => {
47
- if (local.autofocus) inputElRef?.focus();
48
- });
49
46
  createEffect(on(() => (() => local.autofocus)(), (v) => untrack(() => ((v: any) => {
50
47
  if (v) inputElRef?.focus();
51
48
  })(v)), { defer: true }));
49
+ onMount(() => {
50
+ if (local.autofocus) inputElRef?.focus();
51
+ });
52
52
  let inputElRef: HTMLElement | null = null;
53
53
 
54
54
  // Seed the draft once at setup from the incoming value (setup-once, NOT in the
@@ -1,7 +1,7 @@
1
1
  import type { JSX } from 'solid-js';
2
2
  import { mergeProps, splitProps } from 'solid-js';
3
3
  import { Key } from '@solid-primitives/keyed';
4
- import { rozieAttr, rozieDisplay } from '@rozie/runtime-solid';
4
+ import { rozieAttr, rozieDisplay, rozieSelectValue } from '@rozie/runtime-solid';
5
5
 
6
6
  interface FilterSelectProps {
7
7
  /**
@@ -66,7 +66,7 @@ export default function FilterSelect(_props: FilterSelectProps): JSX.Element {
66
66
 
67
67
  return (
68
68
  <>
69
- <select part="col-filter" aria-label={rozieAttr(a11yLabel())} class={"rdt-col-filter"} value={selectValue()} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onChange($event); }} data-rozie-s-d75b42b2="">
69
+ <select part="col-filter" aria-label={rozieAttr(a11yLabel())} class={"rdt-col-filter"} ref={(el) => { rozieSelectValue(el as HTMLSelectElement, () => (selectValue())); }} onChange={($event: Event & { currentTarget: HTMLSelectElement; target: Element }) => { onChange($event); }} data-rozie-s-d75b42b2="">
70
70
  <option value="" data-rozie-s-d75b42b2="">All</option>
71
71
  <Key each={local.uniqueValues as readonly any[]} by={(opt) => opt}>{(opt) => <option value={rozieAttr(opt())} data-rozie-s-d75b42b2="">{rozieDisplay(opt())}</option>}</Key>
72
72
  </select>