schummar-table 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +17 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +17 -6
- package/dist/es/index.js.map +1 -1
- package/dist/types/types.d.ts +1 -0
- package/package.json +3 -2
package/dist/es/index.js
CHANGED
|
@@ -634,12 +634,21 @@ function useTableState(_props) {
|
|
|
634
634
|
const [key, setKey] = useState({});
|
|
635
635
|
const props = calcProps(_props);
|
|
636
636
|
function reset() {
|
|
637
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
637
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
638
638
|
setKey({});
|
|
639
|
-
(
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
(
|
|
639
|
+
if (props.sort === void 0) {
|
|
640
|
+
(_b = props.onSortChange) == null ? void 0 : _b.call(props, (_a = props.defaultSort) != null ? _a : []);
|
|
641
|
+
}
|
|
642
|
+
if (props.expanded === void 0) {
|
|
643
|
+
(_d = props.onExpandedChange) == null ? void 0 : _d.call(props, (_c = props.defaultExpanded) != null ? _c : /* @__PURE__ */ new Set());
|
|
644
|
+
}
|
|
645
|
+
if (props.selection === void 0) {
|
|
646
|
+
(_f = props.onSelectionChange) == null ? void 0 : _f.call(props, (_e = props.defaultSelection) != null ? _e : /* @__PURE__ */ new Set());
|
|
647
|
+
}
|
|
648
|
+
if (props.hiddenColumns === void 0) {
|
|
649
|
+
(_h = props.onHiddenColumnsChange) == null ? void 0 : _h.call(props, (_g = props.defaultHiddenColumns) != null ? _g : /* @__PURE__ */ new Set());
|
|
650
|
+
}
|
|
651
|
+
(_i = props.onReset) == null ? void 0 : _i.call(props);
|
|
643
652
|
}
|
|
644
653
|
const state = useMemo(() => {
|
|
645
654
|
var _a, _b, _c, _d;
|
|
@@ -3272,7 +3281,9 @@ function useFilter(impl) {
|
|
|
3272
3281
|
const filterBy = impl.filterBy && cache("", impl.filterBy);
|
|
3273
3282
|
useEffect(() => {
|
|
3274
3283
|
var _a;
|
|
3275
|
-
(
|
|
3284
|
+
if (impl.value === void 0) {
|
|
3285
|
+
(_a = impl.onChange) == null ? void 0 : _a.call(impl, impl.defaultValue);
|
|
3286
|
+
}
|
|
3276
3287
|
}, [table]);
|
|
3277
3288
|
useEffect(() => {
|
|
3278
3289
|
table.update((state) => {
|