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/cjs/index.js
CHANGED
|
@@ -636,12 +636,21 @@ function useTableState(_props) {
|
|
|
636
636
|
const [key, setKey] = react.useState({});
|
|
637
637
|
const props = calcProps(_props);
|
|
638
638
|
function reset() {
|
|
639
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
639
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
640
640
|
setKey({});
|
|
641
|
-
(
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
(
|
|
641
|
+
if (props.sort === void 0) {
|
|
642
|
+
(_b = props.onSortChange) == null ? void 0 : _b.call(props, (_a = props.defaultSort) != null ? _a : []);
|
|
643
|
+
}
|
|
644
|
+
if (props.expanded === void 0) {
|
|
645
|
+
(_d = props.onExpandedChange) == null ? void 0 : _d.call(props, (_c = props.defaultExpanded) != null ? _c : /* @__PURE__ */ new Set());
|
|
646
|
+
}
|
|
647
|
+
if (props.selection === void 0) {
|
|
648
|
+
(_f = props.onSelectionChange) == null ? void 0 : _f.call(props, (_e = props.defaultSelection) != null ? _e : /* @__PURE__ */ new Set());
|
|
649
|
+
}
|
|
650
|
+
if (props.hiddenColumns === void 0) {
|
|
651
|
+
(_h = props.onHiddenColumnsChange) == null ? void 0 : _h.call(props, (_g = props.defaultHiddenColumns) != null ? _g : /* @__PURE__ */ new Set());
|
|
652
|
+
}
|
|
653
|
+
(_i = props.onReset) == null ? void 0 : _i.call(props);
|
|
645
654
|
}
|
|
646
655
|
const state = react.useMemo(() => {
|
|
647
656
|
var _a, _b, _c, _d;
|
|
@@ -3274,7 +3283,9 @@ function useFilter(impl) {
|
|
|
3274
3283
|
const filterBy = impl.filterBy && cache("", impl.filterBy);
|
|
3275
3284
|
react.useEffect(() => {
|
|
3276
3285
|
var _a;
|
|
3277
|
-
(
|
|
3286
|
+
if (impl.value === void 0) {
|
|
3287
|
+
(_a = impl.onChange) == null ? void 0 : _a.call(impl, impl.defaultValue);
|
|
3288
|
+
}
|
|
3278
3289
|
}, [table]);
|
|
3279
3290
|
react.useEffect(() => {
|
|
3280
3291
|
table.update((state) => {
|