twico-ui 1.22.1 → 1.22.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/CHANGELOG.md +7 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1953,7 +1953,10 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
1953
1953
|
rowReorder?: boolean;
|
|
1954
1954
|
/** Enable drag-to-resize row height (handle on the row's bottom edge). @default false */
|
|
1955
1955
|
rowResize?: boolean;
|
|
1956
|
-
/** Called with the new array of row keys after a drag-reorder.
|
|
1956
|
+
/** Called with the new array of row keys after a drag-reorder. In `serverMode` the drag order is
|
|
1957
|
+
* an optimistic overlay: persist the keys, then hand back a new `rows` prop — the overlay clears on
|
|
1958
|
+
* any `rows` change, so a rejected reorder reverts (reload the authoritative order) and a
|
|
1959
|
+
* server-corrected order reflects, both without remounting. */
|
|
1957
1960
|
onRowOrderChange?: (keys: Array<string | number>) => void;
|
|
1958
1961
|
/** Initial pivot model (seeds the toolbar **Pivot** panel, which the user can edit live): aggregate `values` across `rows` (row groups) × `columns` (nested column groups). */
|
|
1959
1962
|
pivot?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1953,7 +1953,10 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
1953
1953
|
rowReorder?: boolean;
|
|
1954
1954
|
/** Enable drag-to-resize row height (handle on the row's bottom edge). @default false */
|
|
1955
1955
|
rowResize?: boolean;
|
|
1956
|
-
/** Called with the new array of row keys after a drag-reorder.
|
|
1956
|
+
/** Called with the new array of row keys after a drag-reorder. In `serverMode` the drag order is
|
|
1957
|
+
* an optimistic overlay: persist the keys, then hand back a new `rows` prop — the overlay clears on
|
|
1958
|
+
* any `rows` change, so a rejected reorder reverts (reload the authoritative order) and a
|
|
1959
|
+
* server-corrected order reflects, both without remounting. */
|
|
1957
1960
|
onRowOrderChange?: (keys: Array<string | number>) => void;
|
|
1958
1961
|
/** Initial pivot model (seeds the toolbar **Pivot** panel, which the user can edit live): aggregate `values` across `rows` (row groups) × `columns` (nested column groups). */
|
|
1959
1962
|
pivot?: {
|
package/dist/index.mjs
CHANGED
|
@@ -9278,6 +9278,9 @@ function Datatable({
|
|
|
9278
9278
|
const [headH, setHeadH] = React51__default.useState(41);
|
|
9279
9279
|
const theadRef = React51__default.useRef(null);
|
|
9280
9280
|
const [rowOrder, setRowOrder] = React51__default.useState(null);
|
|
9281
|
+
React51__default.useEffect(() => {
|
|
9282
|
+
if (serverMode) setRowOrder(null);
|
|
9283
|
+
}, [rows, serverMode]);
|
|
9281
9284
|
const [rowHeights, setRowHeights] = React51__default.useState({});
|
|
9282
9285
|
const [rowDrag, setRowDrag] = React51__default.useState({ from: null, over: null, after: false });
|
|
9283
9286
|
const [rowGrab, setRowGrab] = React51__default.useState(null);
|