@skygraph/react 0.6.4 → 0.6.6
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/README.md +70 -70
- package/dist/{Table-CMKo6Pc3.d.cts → Table-Bhlshbs2.d.cts} +39 -0
- package/dist/{Table-CAay8MmA.d.ts → Table-DOGK_njf.d.ts} +39 -0
- package/dist/{chunk-Y6XZ5TLD.js → chunk-B6BK5B64.js} +3 -3
- package/dist/chunk-B6BK5B64.js.map +1 -0
- package/dist/{chunk-PEX2UTNG.js → chunk-EA2J67A4.js} +2 -2
- package/dist/chunk-EA2J67A4.js.map +1 -0
- package/dist/{chunk-BNMJSYI2.js → chunk-EWUB2QCP.js} +2 -2
- package/dist/chunk-EWUB2QCP.js.map +1 -0
- package/dist/{chunk-7AA2JPZB.js → chunk-G4MRXKGC.js} +21 -14
- package/dist/chunk-G4MRXKGC.js.map +1 -0
- package/dist/{chunk-EFDB2ENB.js → chunk-MTHPDCO3.js} +8 -6
- package/dist/chunk-MTHPDCO3.js.map +1 -0
- package/dist/{chunk-KGFFQGCM.js → chunk-N4S66XHX.js} +8 -4
- package/dist/chunk-N4S66XHX.js.map +1 -0
- package/dist/{chunk-SEQI65CF.js → chunk-U7BXGUMC.js} +1 -1
- package/dist/chunk-U7BXGUMC.js.map +1 -0
- package/dist/{chunk-45YW5VSP.js → chunk-UCCGEZPJ.js} +2 -2
- package/dist/chunk-UCCGEZPJ.js.map +1 -0
- package/dist/{chunk-VLRLCHEL.js → chunk-YJZKXU5O.js} +1 -1
- package/dist/chunk-YJZKXU5O.js.map +1 -0
- package/dist/{chunk-ZJC2QUWA.js → chunk-YWCL3MUL.js} +1 -1
- package/dist/chunk-YWCL3MUL.js.map +1 -0
- package/dist/datagrid.cjs +3 -4
- package/dist/datagrid.cjs.map +1 -1
- package/dist/datagrid.js +4 -4
- package/dist/devtools.cjs.map +1 -1
- package/dist/devtools.js +1 -1
- package/dist/form.cjs.map +1 -1
- package/dist/form.js +3 -3
- package/dist/index.cjs +1239 -255
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +1113 -150
- package/dist/index.js.map +1 -1
- package/dist/table.cjs +17 -10
- package/dist/table.cjs.map +1 -1
- package/dist/table.d.cts +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.js +4 -4
- package/dist/tree.cjs +11 -7
- package/dist/tree.cjs.map +1 -1
- package/dist/tree.js +3 -3
- package/dist/virtual.cjs.map +1 -1
- package/dist/virtual.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-45YW5VSP.js.map +0 -1
- package/dist/chunk-7AA2JPZB.js.map +0 -1
- package/dist/chunk-BNMJSYI2.js.map +0 -1
- package/dist/chunk-EFDB2ENB.js.map +0 -1
- package/dist/chunk-KGFFQGCM.js.map +0 -1
- package/dist/chunk-PEX2UTNG.js.map +0 -1
- package/dist/chunk-SEQI65CF.js.map +0 -1
- package/dist/chunk-VLRLCHEL.js.map +0 -1
- package/dist/chunk-Y6XZ5TLD.js.map +0 -1
- package/dist/chunk-ZJC2QUWA.js.map +0 -1
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
Button,
|
|
3
3
|
Input,
|
|
4
4
|
Transition
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UCCGEZPJ.js";
|
|
6
6
|
import {
|
|
7
7
|
Checkbox
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EA2J67A4.js";
|
|
9
9
|
import {
|
|
10
10
|
Spin,
|
|
11
11
|
useConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YJZKXU5O.js";
|
|
13
13
|
|
|
14
14
|
// src/components/ui/Pagination.tsx
|
|
15
15
|
import { useState } from "react";
|
|
@@ -2477,7 +2477,12 @@ function useTableState(props) {
|
|
|
2477
2477
|
setColumnWidth: persistColumnWidth,
|
|
2478
2478
|
refresh
|
|
2479
2479
|
} = useTable(tableOptions);
|
|
2480
|
-
const
|
|
2480
|
+
const config = useConfig();
|
|
2481
|
+
const configTableLocale = config.locale?.table;
|
|
2482
|
+
const t = useMemo3(
|
|
2483
|
+
() => ({ ...DEFAULT_LOCALE, ...configTableLocale, ...locale }),
|
|
2484
|
+
[configTableLocale, locale]
|
|
2485
|
+
);
|
|
2481
2486
|
const hasColumnGroups = columnsProp.some((c) => c.children && c.children.length > 0);
|
|
2482
2487
|
const leafColumns = useMemo3(() => flattenLeafColumns(columnsProp), [columnsProp]);
|
|
2483
2488
|
const headerRows = useMemo3(
|
|
@@ -2654,9 +2659,8 @@ function useTableState(props) {
|
|
|
2654
2659
|
} else {
|
|
2655
2660
|
next = sorts.filter((s) => s.column !== col.key);
|
|
2656
2661
|
}
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
} else {
|
|
2662
|
+
onSortsChange?.(next);
|
|
2663
|
+
if (controlledSorts === void 0) {
|
|
2660
2664
|
setInternalSorts(next);
|
|
2661
2665
|
}
|
|
2662
2666
|
if (next.length === 0) {
|
|
@@ -2665,7 +2669,7 @@ function useTableState(props) {
|
|
|
2665
2669
|
setSorts(next);
|
|
2666
2670
|
}
|
|
2667
2671
|
} else {
|
|
2668
|
-
const current = sorts.
|
|
2672
|
+
const current = sorts.find((s) => s.column === col.key) ?? null;
|
|
2669
2673
|
let next;
|
|
2670
2674
|
if (!current || current.column !== col.key) {
|
|
2671
2675
|
next = [{ column: col.key, direction: "asc" }];
|
|
@@ -2674,9 +2678,8 @@ function useTableState(props) {
|
|
|
2674
2678
|
} else {
|
|
2675
2679
|
next = [];
|
|
2676
2680
|
}
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
} else {
|
|
2681
|
+
onSortsChange?.(next);
|
|
2682
|
+
if (controlledSorts === void 0) {
|
|
2680
2683
|
setInternalSorts(next);
|
|
2681
2684
|
}
|
|
2682
2685
|
if (next.length === 0) {
|
|
@@ -2686,7 +2689,7 @@ function useTableState(props) {
|
|
|
2686
2689
|
}
|
|
2687
2690
|
}
|
|
2688
2691
|
},
|
|
2689
|
-
[multiSort, sorts, onSortsChange, setSort, setSorts, clearSort]
|
|
2692
|
+
[multiSort, sorts, controlledSorts, onSortsChange, setSort, setSorts, clearSort]
|
|
2690
2693
|
);
|
|
2691
2694
|
const getSortIndex = useCallback3(
|
|
2692
2695
|
(colKey) => {
|
|
@@ -2782,10 +2785,14 @@ function useTableState(props) {
|
|
|
2782
2785
|
e.preventDefault();
|
|
2783
2786
|
e.stopPropagation();
|
|
2784
2787
|
resizeCleanupRef.current?.();
|
|
2788
|
+
const handle = e.currentTarget;
|
|
2789
|
+
const th = handle.closest(".sg-table-th");
|
|
2790
|
+
const measuredW = th?.getBoundingClientRect().width;
|
|
2791
|
+
const startW = measuredW && Number.isFinite(measuredW) ? measuredW : colWidths[colKey] ?? DEFAULT_COL_WIDTH;
|
|
2785
2792
|
resizeRef.current = {
|
|
2786
2793
|
col: colKey,
|
|
2787
2794
|
startX: e.clientX,
|
|
2788
|
-
startW
|
|
2795
|
+
startW
|
|
2789
2796
|
};
|
|
2790
2797
|
const onMove = (ev) => {
|
|
2791
2798
|
const ref = resizeRef.current;
|
|
@@ -3878,4 +3885,4 @@ export {
|
|
|
3878
3885
|
printElement,
|
|
3879
3886
|
Table
|
|
3880
3887
|
};
|
|
3881
|
-
//# sourceMappingURL=chunk-
|
|
3888
|
+
//# sourceMappingURL=chunk-G4MRXKGC.js.map
|