twico-ui 1.22.1 → 1.22.3
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 +14 -0
- package/dist/index.cjs +27 -10
- 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 +27 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Twico UI are documented here (newest first). This file is generated automatically on each release by [semantic-release](https://semantic-release.gitbook.io/) from [Conventional Commits](https://www.conventionalcommits.org/) — do not edit it by hand. The same notes appear on each [GitHub Release](https://github.com/EncryptionL/twico-ui/releases).
|
|
4
4
|
|
|
5
|
+
## [1.22.3](https://github.com/EncryptionL/twico-ui/compare/v1.22.2...v1.22.3) (2026-07-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **datatable:** stop stateKey persistence being clobbered under Strict Mode + async columns ([#298](https://github.com/EncryptionL/twico-ui/issues/298)) ([d7ff41e](https://github.com/EncryptionL/twico-ui/commit/d7ff41e2bd9f3e1d20d31eaf2b6ca0ae2348c6ab))
|
|
11
|
+
|
|
12
|
+
## [1.22.2](https://github.com/EncryptionL/twico-ui/compare/v1.22.1...v1.22.2) (2026-07-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **datatable:** reset optimistic rowReorder overlay when rows change in server mode ([#296](https://github.com/EncryptionL/twico-ui/issues/296)) ([600cb16](https://github.com/EncryptionL/twico-ui/commit/600cb16099faf0f5498c11430773d8375dc593ac))
|
|
18
|
+
|
|
5
19
|
## [1.22.1](https://github.com/EncryptionL/twico-ui/compare/v1.22.0...v1.22.1) (2026-07-29)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.cjs
CHANGED
|
@@ -9299,6 +9299,9 @@ function Datatable({
|
|
|
9299
9299
|
const [headH, setHeadH] = React51__namespace.default.useState(41);
|
|
9300
9300
|
const theadRef = React51__namespace.default.useRef(null);
|
|
9301
9301
|
const [rowOrder, setRowOrder] = React51__namespace.default.useState(null);
|
|
9302
|
+
React51__namespace.default.useEffect(() => {
|
|
9303
|
+
if (serverMode) setRowOrder(null);
|
|
9304
|
+
}, [rows, serverMode]);
|
|
9302
9305
|
const [rowHeights, setRowHeights] = React51__namespace.default.useState({});
|
|
9303
9306
|
const [rowDrag, setRowDrag] = React51__namespace.default.useState({ from: null, over: null, after: false });
|
|
9304
9307
|
const [rowGrab, setRowGrab] = React51__namespace.default.useState(null);
|
|
@@ -9358,6 +9361,7 @@ function Datatable({
|
|
|
9358
9361
|
}
|
|
9359
9362
|
};
|
|
9360
9363
|
const stateReadyRef = React51__namespace.default.useRef(false);
|
|
9364
|
+
const stateRestoredRef = React51__namespace.default.useRef(false);
|
|
9361
9365
|
const onStateChangeRef = React51__namespace.default.useRef(onStateChange);
|
|
9362
9366
|
onStateChangeRef.current = onStateChange;
|
|
9363
9367
|
React51__namespace.default.useEffect(() => {
|
|
@@ -9373,7 +9377,7 @@ function Datatable({
|
|
|
9373
9377
|
}
|
|
9374
9378
|
return void 0;
|
|
9375
9379
|
}, [filters, sort, quick, pageVal, sizeVal, order, widths, hidden, pins, density, fWidths, fPanelSize, stateKey]);
|
|
9376
|
-
|
|
9380
|
+
const restoreState = () => {
|
|
9377
9381
|
let saved = null;
|
|
9378
9382
|
if (stateKey) {
|
|
9379
9383
|
try {
|
|
@@ -9384,8 +9388,22 @@ function Datatable({
|
|
|
9384
9388
|
}
|
|
9385
9389
|
if (!saved && initialState) saved = initialState;
|
|
9386
9390
|
if (saved) applyState(saved);
|
|
9387
|
-
|
|
9391
|
+
stateRestoredRef.current = true;
|
|
9392
|
+
};
|
|
9393
|
+
React51__namespace.default.useEffect(() => {
|
|
9394
|
+
if (columns.length) {
|
|
9395
|
+
restoreState();
|
|
9396
|
+
stateReadyRef.current = true;
|
|
9397
|
+
}
|
|
9398
|
+
return () => {
|
|
9399
|
+
stateReadyRef.current = false;
|
|
9400
|
+
};
|
|
9388
9401
|
}, []);
|
|
9402
|
+
React51__namespace.default.useEffect(() => {
|
|
9403
|
+
if (stateRestoredRef.current || !columns.length) return;
|
|
9404
|
+
restoreState();
|
|
9405
|
+
stateReadyRef.current = true;
|
|
9406
|
+
}, [columns.length]);
|
|
9389
9407
|
const rootRef = React51__namespace.default.useRef(null);
|
|
9390
9408
|
const [compact, setCompact] = React51__namespace.default.useState(false);
|
|
9391
9409
|
React51__namespace.default.useEffect(() => {
|
|
@@ -9458,20 +9476,19 @@ function Datatable({
|
|
|
9458
9476
|
React51__namespace.default.useEffect(() => {
|
|
9459
9477
|
setOrder((prev) => mergeColOrder(prev, columns.map((c) => c.field).filter(Boolean)));
|
|
9460
9478
|
}, [columns]);
|
|
9461
|
-
const
|
|
9479
|
+
const densityPropRef = React51__namespace.default.useRef(densityProp);
|
|
9462
9480
|
React51__namespace.default.useEffect(() => {
|
|
9463
|
-
if (
|
|
9464
|
-
|
|
9481
|
+
if (densityPropRef.current === densityProp) return;
|
|
9482
|
+
densityPropRef.current = densityProp;
|
|
9483
|
+
setDensity(densityProp);
|
|
9465
9484
|
}, [densityProp]);
|
|
9466
9485
|
React51__namespace.default.useEffect(() => {
|
|
9467
9486
|
setAggOn(showAggregation);
|
|
9468
9487
|
}, [showAggregation]);
|
|
9469
|
-
const
|
|
9488
|
+
const pageSizePropRef = React51__namespace.default.useRef(pageSize);
|
|
9470
9489
|
React51__namespace.default.useEffect(() => {
|
|
9471
|
-
if (
|
|
9472
|
-
|
|
9473
|
-
return;
|
|
9474
|
-
}
|
|
9490
|
+
if (pageSizePropRef.current === pageSize) return;
|
|
9491
|
+
pageSizePropRef.current = pageSize;
|
|
9475
9492
|
if (pageSizeControlled) return;
|
|
9476
9493
|
setInternalRpp(pageSize > 0 ? pageSize : 10);
|
|
9477
9494
|
setInternalPage(0);
|