twico-ui 1.22.0 → 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 +15 -0
- package/dist/index.cjs +56 -1
- 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 +56 -1
- 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
|
@@ -5324,9 +5324,16 @@ function ColorPicker({
|
|
|
5324
5324
|
const onMove = () => place();
|
|
5325
5325
|
window.addEventListener("scroll", onMove, true);
|
|
5326
5326
|
window.addEventListener("resize", onMove);
|
|
5327
|
+
let ro;
|
|
5328
|
+
const rt = triggerRef.current;
|
|
5329
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
5330
|
+
ro = new ResizeObserver(onMove);
|
|
5331
|
+
ro.observe(rt);
|
|
5332
|
+
}
|
|
5327
5333
|
return () => {
|
|
5328
5334
|
window.removeEventListener("scroll", onMove, true);
|
|
5329
5335
|
window.removeEventListener("resize", onMove);
|
|
5336
|
+
ro?.disconnect();
|
|
5330
5337
|
};
|
|
5331
5338
|
}, [open, place]);
|
|
5332
5339
|
const labelId = React51__default.useId();
|
|
@@ -5786,9 +5793,16 @@ function Combobox({
|
|
|
5786
5793
|
const onMove = () => place();
|
|
5787
5794
|
window.addEventListener("scroll", onMove, true);
|
|
5788
5795
|
window.addEventListener("resize", onMove);
|
|
5796
|
+
let ro;
|
|
5797
|
+
const rt = controlRef.current;
|
|
5798
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
5799
|
+
ro = new ResizeObserver(onMove);
|
|
5800
|
+
ro.observe(rt);
|
|
5801
|
+
}
|
|
5789
5802
|
return () => {
|
|
5790
5803
|
window.removeEventListener("scroll", onMove, true);
|
|
5791
5804
|
window.removeEventListener("resize", onMove);
|
|
5805
|
+
ro?.disconnect();
|
|
5792
5806
|
};
|
|
5793
5807
|
}, [open, portal, place]);
|
|
5794
5808
|
React51__default.useEffect(() => {
|
|
@@ -6613,9 +6627,16 @@ function Select({
|
|
|
6613
6627
|
const onMove = () => place();
|
|
6614
6628
|
window.addEventListener("scroll", onMove, true);
|
|
6615
6629
|
window.addEventListener("resize", onMove);
|
|
6630
|
+
let ro;
|
|
6631
|
+
const rt = triggerRef.current;
|
|
6632
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
6633
|
+
ro = new ResizeObserver(onMove);
|
|
6634
|
+
ro.observe(rt);
|
|
6635
|
+
}
|
|
6616
6636
|
return () => {
|
|
6617
6637
|
window.removeEventListener("scroll", onMove, true);
|
|
6618
6638
|
window.removeEventListener("resize", onMove);
|
|
6639
|
+
ro?.disconnect();
|
|
6619
6640
|
};
|
|
6620
6641
|
}, [open, portal, place]);
|
|
6621
6642
|
React51__default.useEffect(() => {
|
|
@@ -7442,9 +7463,16 @@ function MultiSelect({
|
|
|
7442
7463
|
const onMove = () => place();
|
|
7443
7464
|
window.addEventListener("scroll", onMove, true);
|
|
7444
7465
|
window.addEventListener("resize", onMove);
|
|
7466
|
+
let ro;
|
|
7467
|
+
const rt = controlRef.current;
|
|
7468
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
7469
|
+
ro = new ResizeObserver(onMove);
|
|
7470
|
+
ro.observe(rt);
|
|
7471
|
+
}
|
|
7445
7472
|
return () => {
|
|
7446
7473
|
window.removeEventListener("scroll", onMove, true);
|
|
7447
7474
|
window.removeEventListener("resize", onMove);
|
|
7475
|
+
ro?.disconnect();
|
|
7448
7476
|
};
|
|
7449
7477
|
}, [open, portal, place]);
|
|
7450
7478
|
React51__default.useEffect(() => {
|
|
@@ -8508,7 +8536,10 @@ th.twc-dt__rownum .twc-dt__th-inner { padding-inline: 8px; gap: 2px; justify-con
|
|
|
8508
8536
|
cascade \u2014 user drag (-usr) > #289 measured auto-fit (-fit) > 118px fallback \u2014 entirely in clamp(), so
|
|
8509
8537
|
neither writer reads the other (reset = remove the -usr var and auto-fit instantly re-wins). */
|
|
8510
8538
|
.twc-dt__filters {
|
|
8511
|
-
position:
|
|
8539
|
+
/* #294: do NOT set 'position' here \u2014 this element also carries .twc-dt__pop (position: fixed), and an
|
|
8540
|
+
equal-specificity 'position: relative' defined later would clobber it, dropping the popover into normal
|
|
8541
|
+
flow below the table. The panel stays position: fixed, which already anchors the absolutely-positioned
|
|
8542
|
+
.twc-dt__pop-grip; per-field handles anchor to their own position: relative .twc-dt__f-* fields. */
|
|
8512
8543
|
width: var(--twc-dt-panel-w, 580px); max-width: calc(100vw - 32px);
|
|
8513
8544
|
height: var(--twc-dt-panel-h, auto); max-height: calc(100vh - 32px);
|
|
8514
8545
|
display: flex; flex-direction: column;
|
|
@@ -9247,6 +9278,9 @@ function Datatable({
|
|
|
9247
9278
|
const [headH, setHeadH] = React51__default.useState(41);
|
|
9248
9279
|
const theadRef = React51__default.useRef(null);
|
|
9249
9280
|
const [rowOrder, setRowOrder] = React51__default.useState(null);
|
|
9281
|
+
React51__default.useEffect(() => {
|
|
9282
|
+
if (serverMode) setRowOrder(null);
|
|
9283
|
+
}, [rows, serverMode]);
|
|
9250
9284
|
const [rowHeights, setRowHeights] = React51__default.useState({});
|
|
9251
9285
|
const [rowDrag, setRowDrag] = React51__default.useState({ from: null, over: null, after: false });
|
|
9252
9286
|
const [rowGrab, setRowGrab] = React51__default.useState(null);
|
|
@@ -12585,9 +12619,16 @@ function DatePicker({
|
|
|
12585
12619
|
const onMove = () => place();
|
|
12586
12620
|
window.addEventListener("scroll", onMove, true);
|
|
12587
12621
|
window.addEventListener("resize", onMove);
|
|
12622
|
+
let ro;
|
|
12623
|
+
const rt = triggerRef.current;
|
|
12624
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
12625
|
+
ro = new ResizeObserver(onMove);
|
|
12626
|
+
ro.observe(rt);
|
|
12627
|
+
}
|
|
12588
12628
|
return () => {
|
|
12589
12629
|
window.removeEventListener("scroll", onMove, true);
|
|
12590
12630
|
window.removeEventListener("resize", onMove);
|
|
12631
|
+
ro?.disconnect();
|
|
12591
12632
|
};
|
|
12592
12633
|
}, [open, place]);
|
|
12593
12634
|
React51__default.useEffect(() => {
|
|
@@ -13129,9 +13170,16 @@ function DateRangePicker({
|
|
|
13129
13170
|
const onMove = () => place();
|
|
13130
13171
|
window.addEventListener("scroll", onMove, true);
|
|
13131
13172
|
window.addEventListener("resize", onMove);
|
|
13173
|
+
let ro;
|
|
13174
|
+
const rt = triggerRef.current;
|
|
13175
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
13176
|
+
ro = new ResizeObserver(onMove);
|
|
13177
|
+
ro.observe(rt);
|
|
13178
|
+
}
|
|
13132
13179
|
return () => {
|
|
13133
13180
|
window.removeEventListener("scroll", onMove, true);
|
|
13134
13181
|
window.removeEventListener("resize", onMove);
|
|
13182
|
+
ro?.disconnect();
|
|
13135
13183
|
};
|
|
13136
13184
|
}, [open, place]);
|
|
13137
13185
|
React51__default.useEffect(() => {
|
|
@@ -13682,9 +13730,16 @@ function TimePicker({
|
|
|
13682
13730
|
const onMove = () => place();
|
|
13683
13731
|
window.addEventListener("scroll", onMove, true);
|
|
13684
13732
|
window.addEventListener("resize", onMove);
|
|
13733
|
+
let ro;
|
|
13734
|
+
const rt = triggerRef.current;
|
|
13735
|
+
if (rt && typeof ResizeObserver !== "undefined") {
|
|
13736
|
+
ro = new ResizeObserver(onMove);
|
|
13737
|
+
ro.observe(rt);
|
|
13738
|
+
}
|
|
13685
13739
|
return () => {
|
|
13686
13740
|
window.removeEventListener("scroll", onMove, true);
|
|
13687
13741
|
window.removeEventListener("resize", onMove);
|
|
13742
|
+
ro?.disconnect();
|
|
13688
13743
|
};
|
|
13689
13744
|
}, [open, place]);
|
|
13690
13745
|
React51__default.useEffect(() => {
|