@rozie-ui/data-table-solid 0.7.3 → 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 +12 -0
- package/dist/index.cjs +85 -77
- package/dist/index.mjs +86 -78
- package/dist/source/index.jsx +87 -78
- package/package.json +2 -2
- package/src/Column.tsx +3 -3
- package/src/DataTable.tsx +34 -37
- package/src/EditorCheckbox.tsx +3 -3
- package/src/EditorDate.tsx +3 -3
- package/src/EditorNumber.tsx +3 -3
- package/src/EditorSelect.tsx +5 -5
- package/src/EditorText.tsx +3 -3
- package/src/FilterSelect.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
3
15
|
## 0.7.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -856,6 +856,45 @@ function DataTable(_props) {
|
|
|
856
856
|
const [pasteAnnounce, setPasteAnnounce] = (0, solid_js.createSignal)("");
|
|
857
857
|
const [rangeAnnounce, setRangeAnnounce] = (0, solid_js.createSignal)("");
|
|
858
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 }));
|
|
859
898
|
(0, solid_js.onMount)(() => {
|
|
860
899
|
setDataDefault(data() || []);
|
|
861
900
|
seedColumnPinning();
|
|
@@ -998,45 +1037,6 @@ function DataTable(_props) {
|
|
|
998
1037
|
lastDataLen = d.length;
|
|
999
1038
|
reFeed();
|
|
1000
1039
|
});
|
|
1001
|
-
(0, solid_js.createEffect)((0, solid_js.on)(() => windowVer(), (v) => (0, solid_js.untrack)(() => emitVisibleRangeIfChanged()), { defer: true }));
|
|
1002
|
-
(0, solid_js.createEffect)((0, solid_js.on)(() => [
|
|
1003
|
-
sorting(),
|
|
1004
|
-
globalFilter(),
|
|
1005
|
-
columnFilters(),
|
|
1006
|
-
pagination(),
|
|
1007
|
-
local.rowCount,
|
|
1008
|
-
local.pageCount,
|
|
1009
|
-
rowSelection(),
|
|
1010
|
-
expanded(),
|
|
1011
|
-
local.expandable,
|
|
1012
|
-
grouping(),
|
|
1013
|
-
local.groupable,
|
|
1014
|
-
columnVisibility(),
|
|
1015
|
-
columnSizing(),
|
|
1016
|
-
columnOrder(),
|
|
1017
|
-
columnPinning(),
|
|
1018
|
-
local.selectionMode,
|
|
1019
|
-
(data() || []).length,
|
|
1020
|
-
data(),
|
|
1021
|
-
dataDefault(),
|
|
1022
|
-
local.columns,
|
|
1023
|
-
colReg()
|
|
1024
|
-
], (v) => (0, solid_js.untrack)(() => (() => {
|
|
1025
|
-
seedColumnPinning();
|
|
1026
|
-
reFeed();
|
|
1027
|
-
maybeClearHistoryOnExternalSwap();
|
|
1028
|
-
})()), { defer: true }));
|
|
1029
|
-
(0, solid_js.createEffect)((0, solid_js.on)(() => [
|
|
1030
|
-
sorting(),
|
|
1031
|
-
columnFilters(),
|
|
1032
|
-
globalFilter(),
|
|
1033
|
-
sortingDefault(),
|
|
1034
|
-
columnFiltersDefault(),
|
|
1035
|
-
globalFilterDefault()
|
|
1036
|
-
], (v) => (0, solid_js.untrack)(() => (() => {
|
|
1037
|
-
const msg = buildSortFilterAnnounce();
|
|
1038
|
-
if (msg) setLiveAnnounce(msg);
|
|
1039
|
-
})()), { defer: true }));
|
|
1040
1040
|
let __rozieRootRef = null;
|
|
1041
1041
|
let table = null;
|
|
1042
1042
|
let virtualizer = null;
|
|
@@ -5361,6 +5361,9 @@ function DataTable(_props) {
|
|
|
5361
5361
|
_el$64.addEventListener("change", ($event) => {
|
|
5362
5362
|
onCellEditorInput(cell().column.id, $event);
|
|
5363
5363
|
});
|
|
5364
|
+
(0, solid_js_web.use)((el) => {
|
|
5365
|
+
(0, _rozie_runtime_solid.rozieSelectValue)(el, () => editorValueFor(cell().column.id));
|
|
5366
|
+
}, _el$64);
|
|
5364
5367
|
(0, solid_js_web.insert)(_el$64, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
|
|
5365
5368
|
get each() {
|
|
5366
5369
|
return editorOptionsOf(cell().column.id);
|
|
@@ -5374,7 +5377,6 @@ function DataTable(_props) {
|
|
|
5374
5377
|
})()
|
|
5375
5378
|
}));
|
|
5376
5379
|
(0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$64, "aria-invalid", (0, _rozie_runtime_solid.rozieAttr)(invalidMsg() ? "true" : null)));
|
|
5377
|
-
(0, solid_js_web.effect)(() => _el$64.value = editorValueFor(cell().column.id));
|
|
5378
5380
|
return _el$64;
|
|
5379
5381
|
}
|
|
5380
5382
|
});
|
|
@@ -6242,6 +6244,9 @@ function DataTable(_props) {
|
|
|
6242
6244
|
_el$122.addEventListener("change", ($event) => {
|
|
6243
6245
|
onCellEditorInput(cell().column.id, $event);
|
|
6244
6246
|
});
|
|
6247
|
+
(0, solid_js_web.use)((el) => {
|
|
6248
|
+
(0, _rozie_runtime_solid.rozieSelectValue)(el, () => editorValueFor(cell().column.id));
|
|
6249
|
+
}, _el$122);
|
|
6245
6250
|
(0, solid_js_web.insert)(_el$122, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
|
|
6246
6251
|
get each() {
|
|
6247
6252
|
return editorOptionsOf(cell().column.id);
|
|
@@ -6255,7 +6260,6 @@ function DataTable(_props) {
|
|
|
6255
6260
|
})()
|
|
6256
6261
|
}));
|
|
6257
6262
|
(0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$122, "aria-invalid", (0, _rozie_runtime_solid.rozieAttr)(invalidMsg() ? "true" : null)));
|
|
6258
|
-
(0, solid_js_web.effect)(() => _el$122.value = editorValueFor(cell().column.id));
|
|
6259
6263
|
return _el$122;
|
|
6260
6264
|
}
|
|
6261
6265
|
});
|
|
@@ -6571,6 +6575,9 @@ function DataTable(_props) {
|
|
|
6571
6575
|
_el$139.addEventListener("change", ($event) => {
|
|
6572
6576
|
onPageSizeChange($event);
|
|
6573
6577
|
});
|
|
6578
|
+
(0, solid_js_web.use)((el) => {
|
|
6579
|
+
(0, _rozie_runtime_solid.rozieSelectValue)(el, () => pageSize());
|
|
6580
|
+
}, _el$139);
|
|
6574
6581
|
(0, solid_js_web.effect)((_p$) => {
|
|
6575
6582
|
var _v$97 = !canPrevPage(), _v$98 = !canNextPage();
|
|
6576
6583
|
_v$97 !== _p$.e && (_el$136.disabled = _p$.e = _v$97);
|
|
@@ -6580,7 +6587,6 @@ function DataTable(_props) {
|
|
|
6580
6587
|
e: void 0,
|
|
6581
6588
|
t: void 0
|
|
6582
6589
|
});
|
|
6583
|
-
(0, solid_js_web.effect)(() => _el$139.value = pageSize());
|
|
6584
6590
|
return _el$135;
|
|
6585
6591
|
}
|
|
6586
6592
|
}), null);
|
|
@@ -6636,6 +6642,24 @@ function Column(_props) {
|
|
|
6636
6642
|
"validate"
|
|
6637
6643
|
]);
|
|
6638
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 }));
|
|
6639
6663
|
(0, solid_js.onMount)(() => {
|
|
6640
6664
|
const _cleanup = (() => {
|
|
6641
6665
|
if (reg && !registered) {
|
|
@@ -6656,24 +6680,6 @@ function Column(_props) {
|
|
|
6656
6680
|
registered = true;
|
|
6657
6681
|
reg.registerColumn(colId(), buildSpec());
|
|
6658
6682
|
});
|
|
6659
|
-
(0, solid_js.createEffect)((0, solid_js.on)(() => [
|
|
6660
|
-
local.id,
|
|
6661
|
-
local.field,
|
|
6662
|
-
local.header,
|
|
6663
|
-
local.sortable,
|
|
6664
|
-
local.filterable,
|
|
6665
|
-
local.pinned,
|
|
6666
|
-
local.width,
|
|
6667
|
-
local.expandable,
|
|
6668
|
-
local.groupable,
|
|
6669
|
-
local.aggregationFn,
|
|
6670
|
-
local.editable,
|
|
6671
|
-
local.editor,
|
|
6672
|
-
local.editorOptions,
|
|
6673
|
-
local.validate
|
|
6674
|
-
], (v) => (0, solid_js.untrack)(() => (() => {
|
|
6675
|
-
if (reg) reg.registerColumn(colId(), buildSpec());
|
|
6676
|
-
})()), { defer: true }));
|
|
6677
6683
|
let reg = null;
|
|
6678
6684
|
reg = registry;
|
|
6679
6685
|
let registered = false;
|
|
@@ -6729,12 +6735,12 @@ function EditorText(_props) {
|
|
|
6729
6735
|
]);
|
|
6730
6736
|
const [draft, setDraft] = (0, solid_js.createSignal)("");
|
|
6731
6737
|
const [touched, setTouched] = (0, solid_js.createSignal)(false);
|
|
6732
|
-
(0, solid_js.onMount)(() => {
|
|
6733
|
-
if (local.autofocus) inputElRef?.focus();
|
|
6734
|
-
});
|
|
6735
6738
|
(0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
|
|
6736
6739
|
if (v) inputElRef?.focus();
|
|
6737
6740
|
})(v)), { defer: true }));
|
|
6741
|
+
(0, solid_js.onMount)(() => {
|
|
6742
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6743
|
+
});
|
|
6738
6744
|
let inputElRef = null;
|
|
6739
6745
|
function draftValue() {
|
|
6740
6746
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -6810,12 +6816,12 @@ function EditorNumber(_props) {
|
|
|
6810
6816
|
]);
|
|
6811
6817
|
const [draft, setDraft] = (0, solid_js.createSignal)("");
|
|
6812
6818
|
const [touched, setTouched] = (0, solid_js.createSignal)(false);
|
|
6813
|
-
(0, solid_js.onMount)(() => {
|
|
6814
|
-
if (local.autofocus) inputElRef?.focus();
|
|
6815
|
-
});
|
|
6816
6819
|
(0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
|
|
6817
6820
|
if (v) inputElRef?.focus();
|
|
6818
6821
|
})(v)), { defer: true }));
|
|
6822
|
+
(0, solid_js.onMount)(() => {
|
|
6823
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6824
|
+
});
|
|
6819
6825
|
let inputElRef = null;
|
|
6820
6826
|
function draftValue() {
|
|
6821
6827
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -6900,12 +6906,12 @@ function EditorSelect(_props) {
|
|
|
6900
6906
|
]);
|
|
6901
6907
|
const [draft, setDraft] = (0, solid_js.createSignal)("");
|
|
6902
6908
|
const [touched, setTouched] = (0, solid_js.createSignal)(false);
|
|
6903
|
-
(0, solid_js.onMount)(() => {
|
|
6904
|
-
if (local.autofocus) selectElRef?.focus();
|
|
6905
|
-
});
|
|
6906
6909
|
(0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
|
|
6907
6910
|
if (v) selectElRef?.focus();
|
|
6908
6911
|
})(v)), { defer: true }));
|
|
6912
|
+
(0, solid_js.onMount)(() => {
|
|
6913
|
+
if (local.autofocus) selectElRef?.focus();
|
|
6914
|
+
});
|
|
6909
6915
|
let selectElRef = null;
|
|
6910
6916
|
function draftValue() {
|
|
6911
6917
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -6948,6 +6954,7 @@ function EditorSelect(_props) {
|
|
|
6948
6954
|
onChange($event);
|
|
6949
6955
|
});
|
|
6950
6956
|
(0, solid_js_web.use)((el) => {
|
|
6957
|
+
(0, _rozie_runtime_solid.rozieSelectValue)(el, () => draftValue());
|
|
6951
6958
|
selectElRef = el;
|
|
6952
6959
|
}, _el$);
|
|
6953
6960
|
(0, solid_js_web.insert)(_el$, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
|
|
@@ -6963,7 +6970,6 @@ function EditorSelect(_props) {
|
|
|
6963
6970
|
})()
|
|
6964
6971
|
}));
|
|
6965
6972
|
(0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$, "aria-label", (0, _rozie_runtime_solid.rozieAttr)(a11yLabel())));
|
|
6966
|
-
(0, solid_js_web.effect)(() => _el$.value = draftValue());
|
|
6967
6973
|
return _el$;
|
|
6968
6974
|
})();
|
|
6969
6975
|
}
|
|
@@ -6991,12 +6997,12 @@ function EditorCheckbox(_props) {
|
|
|
6991
6997
|
"autofocus",
|
|
6992
6998
|
"columnLabel"
|
|
6993
6999
|
]);
|
|
6994
|
-
(0, solid_js.onMount)(() => {
|
|
6995
|
-
if (local.autofocus) inputElRef?.focus();
|
|
6996
|
-
});
|
|
6997
7000
|
(0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
|
|
6998
7001
|
if (v) inputElRef?.focus();
|
|
6999
7002
|
})(v)), { defer: true }));
|
|
7003
|
+
(0, solid_js.onMount)(() => {
|
|
7004
|
+
if (local.autofocus) inputElRef?.focus();
|
|
7005
|
+
});
|
|
7000
7006
|
let inputElRef = null;
|
|
7001
7007
|
function onChange(e) {
|
|
7002
7008
|
local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
|
|
@@ -7086,12 +7092,12 @@ function EditorDate(_props) {
|
|
|
7086
7092
|
]);
|
|
7087
7093
|
const [draft, setDraft] = (0, solid_js.createSignal)("");
|
|
7088
7094
|
const [touched, setTouched] = (0, solid_js.createSignal)(false);
|
|
7089
|
-
(0, solid_js.onMount)(() => {
|
|
7090
|
-
if (local.autofocus) inputElRef?.focus();
|
|
7091
|
-
});
|
|
7092
7095
|
(0, solid_js.createEffect)((0, solid_js.on)(() => local.autofocus, (v) => (0, solid_js.untrack)(() => ((v) => {
|
|
7093
7096
|
if (v) inputElRef?.focus();
|
|
7094
7097
|
})(v)), { defer: true }));
|
|
7098
|
+
(0, solid_js.onMount)(() => {
|
|
7099
|
+
if (local.autofocus) inputElRef?.focus();
|
|
7100
|
+
});
|
|
7095
7101
|
let inputElRef = null;
|
|
7096
7102
|
function draftValue() {
|
|
7097
7103
|
return touched() ? draft() : toIsoDateString(local.value);
|
|
@@ -7354,6 +7360,9 @@ function FilterSelect(_props) {
|
|
|
7354
7360
|
_el$.addEventListener("change", ($event) => {
|
|
7355
7361
|
onChange($event);
|
|
7356
7362
|
});
|
|
7363
|
+
(0, solid_js_web.use)((el) => {
|
|
7364
|
+
(0, _rozie_runtime_solid.rozieSelectValue)(el, () => selectValue());
|
|
7365
|
+
}, _el$);
|
|
7357
7366
|
(0, solid_js_web.insert)(_el$, (0, solid_js_web.createComponent)(_solid_primitives_keyed.Key, {
|
|
7358
7367
|
get each() {
|
|
7359
7368
|
return local.uniqueValues;
|
|
@@ -7367,7 +7376,6 @@ function FilterSelect(_props) {
|
|
|
7367
7376
|
})()
|
|
7368
7377
|
}), null);
|
|
7369
7378
|
(0, solid_js_web.effect)(() => (0, solid_js_web.setAttribute)(_el$, "aria-label", (0, _rozie_runtime_solid.rozieAttr)(a11yLabel())));
|
|
7370
|
-
(0, solid_js_web.effect)(() => _el$.value = selectValue());
|
|
7371
7379
|
return _el$;
|
|
7372
7380
|
})();
|
|
7373
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";
|
|
@@ -829,6 +829,45 @@ function DataTable(_props) {
|
|
|
829
829
|
const [pasteAnnounce, setPasteAnnounce] = createSignal("");
|
|
830
830
|
const [rangeAnnounce, setRangeAnnounce] = createSignal("");
|
|
831
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 }));
|
|
832
871
|
onMount(() => {
|
|
833
872
|
setDataDefault(data() || []);
|
|
834
873
|
seedColumnPinning();
|
|
@@ -971,45 +1010,6 @@ function DataTable(_props) {
|
|
|
971
1010
|
lastDataLen = d.length;
|
|
972
1011
|
reFeed();
|
|
973
1012
|
});
|
|
974
|
-
createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
|
|
975
|
-
createEffect(on(() => [
|
|
976
|
-
sorting(),
|
|
977
|
-
globalFilter(),
|
|
978
|
-
columnFilters(),
|
|
979
|
-
pagination(),
|
|
980
|
-
local.rowCount,
|
|
981
|
-
local.pageCount,
|
|
982
|
-
rowSelection(),
|
|
983
|
-
expanded(),
|
|
984
|
-
local.expandable,
|
|
985
|
-
grouping(),
|
|
986
|
-
local.groupable,
|
|
987
|
-
columnVisibility(),
|
|
988
|
-
columnSizing(),
|
|
989
|
-
columnOrder(),
|
|
990
|
-
columnPinning(),
|
|
991
|
-
local.selectionMode,
|
|
992
|
-
(data() || []).length,
|
|
993
|
-
data(),
|
|
994
|
-
dataDefault(),
|
|
995
|
-
local.columns,
|
|
996
|
-
colReg()
|
|
997
|
-
], (v) => untrack(() => (() => {
|
|
998
|
-
seedColumnPinning();
|
|
999
|
-
reFeed();
|
|
1000
|
-
maybeClearHistoryOnExternalSwap();
|
|
1001
|
-
})()), { defer: true }));
|
|
1002
|
-
createEffect(on(() => [
|
|
1003
|
-
sorting(),
|
|
1004
|
-
columnFilters(),
|
|
1005
|
-
globalFilter(),
|
|
1006
|
-
sortingDefault(),
|
|
1007
|
-
columnFiltersDefault(),
|
|
1008
|
-
globalFilterDefault()
|
|
1009
|
-
], (v) => untrack(() => (() => {
|
|
1010
|
-
const msg = buildSortFilterAnnounce();
|
|
1011
|
-
if (msg) setLiveAnnounce(msg);
|
|
1012
|
-
})()), { defer: true }));
|
|
1013
1013
|
let __rozieRootRef = null;
|
|
1014
1014
|
let table = null;
|
|
1015
1015
|
let virtualizer = null;
|
|
@@ -5334,6 +5334,9 @@ function DataTable(_props) {
|
|
|
5334
5334
|
_el$64.addEventListener("change", ($event) => {
|
|
5335
5335
|
onCellEditorInput(cell().column.id, $event);
|
|
5336
5336
|
});
|
|
5337
|
+
use((el) => {
|
|
5338
|
+
rozieSelectValue(el, () => editorValueFor(cell().column.id));
|
|
5339
|
+
}, _el$64);
|
|
5337
5340
|
insert(_el$64, createComponent(Key, {
|
|
5338
5341
|
get each() {
|
|
5339
5342
|
return editorOptionsOf(cell().column.id);
|
|
@@ -5347,7 +5350,6 @@ function DataTable(_props) {
|
|
|
5347
5350
|
})()
|
|
5348
5351
|
}));
|
|
5349
5352
|
effect(() => setAttribute(_el$64, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
5350
|
-
effect(() => _el$64.value = editorValueFor(cell().column.id));
|
|
5351
5353
|
return _el$64;
|
|
5352
5354
|
}
|
|
5353
5355
|
});
|
|
@@ -6215,6 +6217,9 @@ function DataTable(_props) {
|
|
|
6215
6217
|
_el$122.addEventListener("change", ($event) => {
|
|
6216
6218
|
onCellEditorInput(cell().column.id, $event);
|
|
6217
6219
|
});
|
|
6220
|
+
use((el) => {
|
|
6221
|
+
rozieSelectValue(el, () => editorValueFor(cell().column.id));
|
|
6222
|
+
}, _el$122);
|
|
6218
6223
|
insert(_el$122, createComponent(Key, {
|
|
6219
6224
|
get each() {
|
|
6220
6225
|
return editorOptionsOf(cell().column.id);
|
|
@@ -6228,7 +6233,6 @@ function DataTable(_props) {
|
|
|
6228
6233
|
})()
|
|
6229
6234
|
}));
|
|
6230
6235
|
effect(() => setAttribute(_el$122, "aria-invalid", rozieAttr(invalidMsg() ? "true" : null)));
|
|
6231
|
-
effect(() => _el$122.value = editorValueFor(cell().column.id));
|
|
6232
6236
|
return _el$122;
|
|
6233
6237
|
}
|
|
6234
6238
|
});
|
|
@@ -6544,6 +6548,9 @@ function DataTable(_props) {
|
|
|
6544
6548
|
_el$139.addEventListener("change", ($event) => {
|
|
6545
6549
|
onPageSizeChange($event);
|
|
6546
6550
|
});
|
|
6551
|
+
use((el) => {
|
|
6552
|
+
rozieSelectValue(el, () => pageSize());
|
|
6553
|
+
}, _el$139);
|
|
6547
6554
|
effect((_p$) => {
|
|
6548
6555
|
var _v$97 = !canPrevPage(), _v$98 = !canNextPage();
|
|
6549
6556
|
_v$97 !== _p$.e && (_el$136.disabled = _p$.e = _v$97);
|
|
@@ -6553,7 +6560,6 @@ function DataTable(_props) {
|
|
|
6553
6560
|
e: void 0,
|
|
6554
6561
|
t: void 0
|
|
6555
6562
|
});
|
|
6556
|
-
effect(() => _el$139.value = pageSize());
|
|
6557
6563
|
return _el$135;
|
|
6558
6564
|
}
|
|
6559
6565
|
}), null);
|
|
@@ -6609,6 +6615,24 @@ function Column(_props) {
|
|
|
6609
6615
|
"validate"
|
|
6610
6616
|
]);
|
|
6611
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 }));
|
|
6612
6636
|
onMount(() => {
|
|
6613
6637
|
const _cleanup = (() => {
|
|
6614
6638
|
if (reg && !registered) {
|
|
@@ -6629,24 +6653,6 @@ function Column(_props) {
|
|
|
6629
6653
|
registered = true;
|
|
6630
6654
|
reg.registerColumn(colId(), buildSpec());
|
|
6631
6655
|
});
|
|
6632
|
-
createEffect(on(() => [
|
|
6633
|
-
local.id,
|
|
6634
|
-
local.field,
|
|
6635
|
-
local.header,
|
|
6636
|
-
local.sortable,
|
|
6637
|
-
local.filterable,
|
|
6638
|
-
local.pinned,
|
|
6639
|
-
local.width,
|
|
6640
|
-
local.expandable,
|
|
6641
|
-
local.groupable,
|
|
6642
|
-
local.aggregationFn,
|
|
6643
|
-
local.editable,
|
|
6644
|
-
local.editor,
|
|
6645
|
-
local.editorOptions,
|
|
6646
|
-
local.validate
|
|
6647
|
-
], (v) => untrack(() => (() => {
|
|
6648
|
-
if (reg) reg.registerColumn(colId(), buildSpec());
|
|
6649
|
-
})()), { defer: true }));
|
|
6650
6656
|
let reg = null;
|
|
6651
6657
|
reg = registry;
|
|
6652
6658
|
let registered = false;
|
|
@@ -6702,12 +6708,12 @@ function EditorText(_props) {
|
|
|
6702
6708
|
]);
|
|
6703
6709
|
const [draft, setDraft] = createSignal("");
|
|
6704
6710
|
const [touched, setTouched] = createSignal(false);
|
|
6705
|
-
onMount(() => {
|
|
6706
|
-
if (local.autofocus) inputElRef?.focus();
|
|
6707
|
-
});
|
|
6708
6711
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6709
6712
|
if (v) inputElRef?.focus();
|
|
6710
6713
|
})(v)), { defer: true }));
|
|
6714
|
+
onMount(() => {
|
|
6715
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6716
|
+
});
|
|
6711
6717
|
let inputElRef = null;
|
|
6712
6718
|
function draftValue() {
|
|
6713
6719
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -6783,12 +6789,12 @@ function EditorNumber(_props) {
|
|
|
6783
6789
|
]);
|
|
6784
6790
|
const [draft, setDraft] = createSignal("");
|
|
6785
6791
|
const [touched, setTouched] = createSignal(false);
|
|
6786
|
-
onMount(() => {
|
|
6787
|
-
if (local.autofocus) inputElRef?.focus();
|
|
6788
|
-
});
|
|
6789
6792
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6790
6793
|
if (v) inputElRef?.focus();
|
|
6791
6794
|
})(v)), { defer: true }));
|
|
6795
|
+
onMount(() => {
|
|
6796
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6797
|
+
});
|
|
6792
6798
|
let inputElRef = null;
|
|
6793
6799
|
function draftValue() {
|
|
6794
6800
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -6873,12 +6879,12 @@ function EditorSelect(_props) {
|
|
|
6873
6879
|
]);
|
|
6874
6880
|
const [draft, setDraft] = createSignal("");
|
|
6875
6881
|
const [touched, setTouched] = createSignal(false);
|
|
6876
|
-
onMount(() => {
|
|
6877
|
-
if (local.autofocus) selectElRef?.focus();
|
|
6878
|
-
});
|
|
6879
6882
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6880
6883
|
if (v) selectElRef?.focus();
|
|
6881
6884
|
})(v)), { defer: true }));
|
|
6885
|
+
onMount(() => {
|
|
6886
|
+
if (local.autofocus) selectElRef?.focus();
|
|
6887
|
+
});
|
|
6882
6888
|
let selectElRef = null;
|
|
6883
6889
|
function draftValue() {
|
|
6884
6890
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -6921,6 +6927,7 @@ function EditorSelect(_props) {
|
|
|
6921
6927
|
onChange($event);
|
|
6922
6928
|
});
|
|
6923
6929
|
use((el) => {
|
|
6930
|
+
rozieSelectValue(el, () => draftValue());
|
|
6924
6931
|
selectElRef = el;
|
|
6925
6932
|
}, _el$);
|
|
6926
6933
|
insert(_el$, createComponent(Key, {
|
|
@@ -6936,7 +6943,6 @@ function EditorSelect(_props) {
|
|
|
6936
6943
|
})()
|
|
6937
6944
|
}));
|
|
6938
6945
|
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
6939
|
-
effect(() => _el$.value = draftValue());
|
|
6940
6946
|
return _el$;
|
|
6941
6947
|
})();
|
|
6942
6948
|
}
|
|
@@ -6964,12 +6970,12 @@ function EditorCheckbox(_props) {
|
|
|
6964
6970
|
"autofocus",
|
|
6965
6971
|
"columnLabel"
|
|
6966
6972
|
]);
|
|
6967
|
-
onMount(() => {
|
|
6968
|
-
if (local.autofocus) inputElRef?.focus();
|
|
6969
|
-
});
|
|
6970
6973
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
6971
6974
|
if (v) inputElRef?.focus();
|
|
6972
6975
|
})(v)), { defer: true }));
|
|
6976
|
+
onMount(() => {
|
|
6977
|
+
if (local.autofocus) inputElRef?.focus();
|
|
6978
|
+
});
|
|
6973
6979
|
let inputElRef = null;
|
|
6974
6980
|
function onChange(e) {
|
|
6975
6981
|
local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
|
|
@@ -7059,12 +7065,12 @@ function EditorDate(_props) {
|
|
|
7059
7065
|
]);
|
|
7060
7066
|
const [draft, setDraft] = createSignal("");
|
|
7061
7067
|
const [touched, setTouched] = createSignal(false);
|
|
7062
|
-
onMount(() => {
|
|
7063
|
-
if (local.autofocus) inputElRef?.focus();
|
|
7064
|
-
});
|
|
7065
7068
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
7066
7069
|
if (v) inputElRef?.focus();
|
|
7067
7070
|
})(v)), { defer: true }));
|
|
7071
|
+
onMount(() => {
|
|
7072
|
+
if (local.autofocus) inputElRef?.focus();
|
|
7073
|
+
});
|
|
7068
7074
|
let inputElRef = null;
|
|
7069
7075
|
function draftValue() {
|
|
7070
7076
|
return touched() ? draft() : toIsoDateString(local.value);
|
|
@@ -7327,6 +7333,9 @@ function FilterSelect(_props) {
|
|
|
7327
7333
|
_el$.addEventListener("change", ($event) => {
|
|
7328
7334
|
onChange($event);
|
|
7329
7335
|
});
|
|
7336
|
+
use((el) => {
|
|
7337
|
+
rozieSelectValue(el, () => selectValue());
|
|
7338
|
+
}, _el$);
|
|
7330
7339
|
insert(_el$, createComponent(Key, {
|
|
7331
7340
|
get each() {
|
|
7332
7341
|
return local.uniqueValues;
|
|
@@ -7340,7 +7349,6 @@ function FilterSelect(_props) {
|
|
|
7340
7349
|
})()
|
|
7341
7350
|
}), null);
|
|
7342
7351
|
effect(() => setAttribute(_el$, "aria-label", rozieAttr(a11yLabel())));
|
|
7343
|
-
effect(() => _el$.value = selectValue());
|
|
7344
7352
|
return _el$;
|
|
7345
7353
|
})();
|
|
7346
7354
|
}
|
package/dist/source/index.jsx
CHANGED
|
@@ -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";
|
|
@@ -827,6 +827,45 @@ function DataTable(_props) {
|
|
|
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(() => [
|
|
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 }));
|
|
830
869
|
onMount(() => {
|
|
831
870
|
setDataDefault(data() || []);
|
|
832
871
|
seedColumnPinning();
|
|
@@ -969,45 +1008,6 @@ function DataTable(_props) {
|
|
|
969
1008
|
lastDataLen = d.length;
|
|
970
1009
|
reFeed();
|
|
971
1010
|
});
|
|
972
|
-
createEffect(on(() => windowVer(), (v) => untrack(() => emitVisibleRangeIfChanged()), { defer: true }));
|
|
973
|
-
createEffect(on(() => [
|
|
974
|
-
sorting(),
|
|
975
|
-
globalFilter(),
|
|
976
|
-
columnFilters(),
|
|
977
|
-
pagination(),
|
|
978
|
-
local.rowCount,
|
|
979
|
-
local.pageCount,
|
|
980
|
-
rowSelection(),
|
|
981
|
-
expanded(),
|
|
982
|
-
local.expandable,
|
|
983
|
-
grouping(),
|
|
984
|
-
local.groupable,
|
|
985
|
-
columnVisibility(),
|
|
986
|
-
columnSizing(),
|
|
987
|
-
columnOrder(),
|
|
988
|
-
columnPinning(),
|
|
989
|
-
local.selectionMode,
|
|
990
|
-
(data() || []).length,
|
|
991
|
-
data(),
|
|
992
|
-
dataDefault(),
|
|
993
|
-
local.columns,
|
|
994
|
-
colReg()
|
|
995
|
-
], (v) => untrack(() => (() => {
|
|
996
|
-
seedColumnPinning();
|
|
997
|
-
reFeed();
|
|
998
|
-
maybeClearHistoryOnExternalSwap();
|
|
999
|
-
})()), { defer: true }));
|
|
1000
|
-
createEffect(on(() => [
|
|
1001
|
-
sorting(),
|
|
1002
|
-
columnFilters(),
|
|
1003
|
-
globalFilter(),
|
|
1004
|
-
sortingDefault(),
|
|
1005
|
-
columnFiltersDefault(),
|
|
1006
|
-
globalFilterDefault()
|
|
1007
|
-
], (v) => untrack(() => (() => {
|
|
1008
|
-
const msg = buildSortFilterAnnounce();
|
|
1009
|
-
if (msg) setLiveAnnounce(msg);
|
|
1010
|
-
})()), { defer: true }));
|
|
1011
1011
|
let __rozieRootRef = null;
|
|
1012
1012
|
let table = null;
|
|
1013
1013
|
let virtualizer = null;
|
|
@@ -4975,7 +4975,9 @@ function DataTable(_props) {
|
|
|
4975
4975
|
onEditorKeyDown($event);
|
|
4976
4976
|
}} onBlur={($event) => {
|
|
4977
4977
|
onEditorBlur($event);
|
|
4978
|
-
}} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? "true" : null)} class={"rdt-cell-editor"}
|
|
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) => {
|
|
4979
4981
|
onCellEditorInput(cell().column.id, $event);
|
|
4980
4982
|
}} onKeyDown={($event) => {
|
|
4981
4983
|
onEditorKeyDown($event);
|
|
@@ -5343,7 +5345,9 @@ function DataTable(_props) {
|
|
|
5343
5345
|
onEditorKeyDown($event);
|
|
5344
5346
|
}} onBlur={($event) => {
|
|
5345
5347
|
onEditorBlur($event);
|
|
5346
|
-
}} data-rozie-s-d5dcab4c="" /></Show>}><select data-editing-cell="" data-builtin-editor="" aria-invalid={rozieAttr(invalidMsg() ? "true" : null)} class={"rdt-cell-editor"}
|
|
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) => {
|
|
5347
5351
|
onCellEditorInput(cell().column.id, $event);
|
|
5348
5352
|
}} onKeyDown={($event) => {
|
|
5349
5353
|
onEditorKeyDown($event);
|
|
@@ -5447,7 +5451,9 @@ function DataTable(_props) {
|
|
|
5447
5451
|
<button type="button" class={"rdt-page-btn rdt-page-next"} disabled={!canNextPage()} onClick={($event) => {
|
|
5448
5452
|
onNextPage();
|
|
5449
5453
|
}} data-rozie-s-d5dcab4c="">Next</button>
|
|
5450
|
-
<select aria-label="Rows per page" class={"rdt-page-size"}
|
|
5454
|
+
<select aria-label="Rows per page" class={"rdt-page-size"} ref={(el) => {
|
|
5455
|
+
rozieSelectValue(el, () => pageSize());
|
|
5456
|
+
}} onChange={($event) => {
|
|
5451
5457
|
onPageSizeChange($event);
|
|
5452
5458
|
}} data-rozie-s-d5dcab4c="">
|
|
5453
5459
|
<option value={10} data-rozie-s-d5dcab4c="">10</option>
|
|
@@ -5494,6 +5500,24 @@ function Column(_props) {
|
|
|
5494
5500
|
"validate"
|
|
5495
5501
|
]);
|
|
5496
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 }));
|
|
5497
5521
|
onMount(() => {
|
|
5498
5522
|
const _cleanup = (() => {
|
|
5499
5523
|
if (reg && !registered) {
|
|
@@ -5514,24 +5538,6 @@ function Column(_props) {
|
|
|
5514
5538
|
registered = true;
|
|
5515
5539
|
reg.registerColumn(colId(), buildSpec());
|
|
5516
5540
|
});
|
|
5517
|
-
createEffect(on(() => [
|
|
5518
|
-
local.id,
|
|
5519
|
-
local.field,
|
|
5520
|
-
local.header,
|
|
5521
|
-
local.sortable,
|
|
5522
|
-
local.filterable,
|
|
5523
|
-
local.pinned,
|
|
5524
|
-
local.width,
|
|
5525
|
-
local.expandable,
|
|
5526
|
-
local.groupable,
|
|
5527
|
-
local.aggregationFn,
|
|
5528
|
-
local.editable,
|
|
5529
|
-
local.editor,
|
|
5530
|
-
local.editorOptions,
|
|
5531
|
-
local.validate
|
|
5532
|
-
], (v) => untrack(() => (() => {
|
|
5533
|
-
if (reg) reg.registerColumn(colId(), buildSpec());
|
|
5534
|
-
})()), { defer: true }));
|
|
5535
5541
|
let reg = null;
|
|
5536
5542
|
reg = registry;
|
|
5537
5543
|
let registered = false;
|
|
@@ -5585,12 +5591,12 @@ function EditorText(_props) {
|
|
|
5585
5591
|
]);
|
|
5586
5592
|
const [draft, setDraft] = createSignal("");
|
|
5587
5593
|
const [touched, setTouched] = createSignal(false);
|
|
5588
|
-
onMount(() => {
|
|
5589
|
-
if (local.autofocus) inputElRef?.focus();
|
|
5590
|
-
});
|
|
5591
5594
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
5592
5595
|
if (v) inputElRef?.focus();
|
|
5593
5596
|
})(v)), { defer: true }));
|
|
5597
|
+
onMount(() => {
|
|
5598
|
+
if (local.autofocus) inputElRef?.focus();
|
|
5599
|
+
});
|
|
5594
5600
|
let inputElRef = null;
|
|
5595
5601
|
function draftValue() {
|
|
5596
5602
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -5657,12 +5663,12 @@ function EditorNumber(_props) {
|
|
|
5657
5663
|
]);
|
|
5658
5664
|
const [draft, setDraft] = createSignal("");
|
|
5659
5665
|
const [touched, setTouched] = createSignal(false);
|
|
5660
|
-
onMount(() => {
|
|
5661
|
-
if (local.autofocus) inputElRef?.focus();
|
|
5662
|
-
});
|
|
5663
5666
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
5664
5667
|
if (v) inputElRef?.focus();
|
|
5665
5668
|
})(v)), { defer: true }));
|
|
5669
|
+
onMount(() => {
|
|
5670
|
+
if (local.autofocus) inputElRef?.focus();
|
|
5671
|
+
});
|
|
5666
5672
|
let inputElRef = null;
|
|
5667
5673
|
function draftValue() {
|
|
5668
5674
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -5738,12 +5744,12 @@ function EditorSelect(_props) {
|
|
|
5738
5744
|
]);
|
|
5739
5745
|
const [draft, setDraft] = createSignal("");
|
|
5740
5746
|
const [touched, setTouched] = createSignal(false);
|
|
5741
|
-
onMount(() => {
|
|
5742
|
-
if (local.autofocus) selectElRef?.focus();
|
|
5743
|
-
});
|
|
5744
5747
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
5745
5748
|
if (v) selectElRef?.focus();
|
|
5746
5749
|
})(v)), { defer: true }));
|
|
5750
|
+
onMount(() => {
|
|
5751
|
+
if (local.autofocus) selectElRef?.focus();
|
|
5752
|
+
});
|
|
5747
5753
|
let selectElRef = null;
|
|
5748
5754
|
function draftValue() {
|
|
5749
5755
|
return touched() ? draft() : local.value != null ? String(local.value) : "";
|
|
@@ -5776,8 +5782,9 @@ function EditorSelect(_props) {
|
|
|
5776
5782
|
}
|
|
5777
5783
|
return <>
|
|
5778
5784
|
<select data-editing-cell="" aria-label={rozieAttr(a11yLabel())} ref={(el) => {
|
|
5785
|
+
rozieSelectValue(el, () => draftValue());
|
|
5779
5786
|
selectElRef = el;
|
|
5780
|
-
}} class={"rdt-cell-editor"}
|
|
5787
|
+
}} class={"rdt-cell-editor"} onChange={($event) => {
|
|
5781
5788
|
onChange($event);
|
|
5782
5789
|
}} onKeyDown={($event) => {
|
|
5783
5790
|
onKeydown($event);
|
|
@@ -5810,12 +5817,12 @@ function EditorCheckbox(_props) {
|
|
|
5810
5817
|
"autofocus",
|
|
5811
5818
|
"columnLabel"
|
|
5812
5819
|
]);
|
|
5813
|
-
onMount(() => {
|
|
5814
|
-
if (local.autofocus) inputElRef?.focus();
|
|
5815
|
-
});
|
|
5816
5820
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
5817
5821
|
if (v) inputElRef?.focus();
|
|
5818
5822
|
})(v)), { defer: true }));
|
|
5823
|
+
onMount(() => {
|
|
5824
|
+
if (local.autofocus) inputElRef?.focus();
|
|
5825
|
+
});
|
|
5819
5826
|
let inputElRef = null;
|
|
5820
5827
|
function onChange(e) {
|
|
5821
5828
|
local.commit && local.commit(!!(e && e.target ? e.target.checked : false));
|
|
@@ -5897,12 +5904,12 @@ function EditorDate(_props) {
|
|
|
5897
5904
|
]);
|
|
5898
5905
|
const [draft, setDraft] = createSignal("");
|
|
5899
5906
|
const [touched, setTouched] = createSignal(false);
|
|
5900
|
-
onMount(() => {
|
|
5901
|
-
if (local.autofocus) inputElRef?.focus();
|
|
5902
|
-
});
|
|
5903
5907
|
createEffect(on(() => local.autofocus, (v) => untrack(() => ((v) => {
|
|
5904
5908
|
if (v) inputElRef?.focus();
|
|
5905
5909
|
})(v)), { defer: true }));
|
|
5910
|
+
onMount(() => {
|
|
5911
|
+
if (local.autofocus) inputElRef?.focus();
|
|
5912
|
+
});
|
|
5906
5913
|
let inputElRef = null;
|
|
5907
5914
|
function draftValue() {
|
|
5908
5915
|
return touched() ? draft() : toIsoDateString(local.value);
|
|
@@ -6123,7 +6130,9 @@ function FilterSelect(_props) {
|
|
|
6123
6130
|
return local.columnId;
|
|
6124
6131
|
}
|
|
6125
6132
|
return <>
|
|
6126
|
-
<select part="col-filter" aria-label={rozieAttr(a11yLabel())} class={"rdt-col-filter"}
|
|
6133
|
+
<select part="col-filter" aria-label={rozieAttr(a11yLabel())} class={"rdt-col-filter"} ref={(el) => {
|
|
6134
|
+
rozieSelectValue(el, () => selectValue());
|
|
6135
|
+
}} onChange={($event) => {
|
|
6127
6136
|
onChange($event);
|
|
6128
6137
|
}} data-rozie-s-d75b42b2="">
|
|
6129
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.
|
|
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.
|
|
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';
|
|
@@ -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"}
|
|
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"}
|
|
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"}
|
|
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>
|
package/src/EditorCheckbox.tsx
CHANGED
|
@@ -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
|
package/src/EditorDate.tsx
CHANGED
|
@@ -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 ───────────────────────────────────
|
package/src/EditorNumber.tsx
CHANGED
|
@@ -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).
|
package/src/EditorSelect.tsx
CHANGED
|
@@ -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"}
|
|
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
|
</>
|
package/src/EditorText.tsx
CHANGED
|
@@ -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
|
package/src/FilterSelect.tsx
CHANGED
|
@@ -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"}
|
|
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>
|