@sia.soul/sia-react-ui 0.1.114 → 0.1.116
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/{Select-Cf0xz1Tg.d.cts → Select-BAFXKVZB.d.cts} +1 -1
- package/dist/{Select-BddM4uXC.d.ts → Select-vjX7B63I.d.ts} +1 -1
- package/dist/{chunk-7KNHBJZX.js → chunk-7PPE6DJO.js} +10 -3
- package/dist/{chunk-6CII5JCT.js → chunk-CVIFJLW6.js} +1 -1
- package/dist/{chunk-DUOOIPWH.js → chunk-D2H37DUL.js} +7 -4
- package/dist/{chunk-NKENBSLP.js → chunk-MKCU5S77.js} +1 -1
- package/dist/{chunk-IOVN3QL7.js → chunk-SATXB6X4.js} +31 -2
- package/dist/{core-CEaTbhWd.d.cts → core-CCb4CoSP.d.cts} +18 -7
- package/dist/{core-C6muCCSS.d.ts → core-CJnRQZkv.d.ts} +18 -7
- package/dist/core.cjs +40 -4
- package/dist/core.css +60 -2
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +3 -3
- package/dist/game.css +13 -0
- package/dist/index.cjs +851 -720
- package/dist/index.css +91 -2
- package/dist/index.d.cts +18 -10
- package/dist/index.d.ts +18 -10
- package/dist/index.js +257 -165
- package/dist/rich-text-editor.cjs +31 -2
- package/dist/rich-text-editor.js +2 -2
- package/dist/{select-date-range-yGDEA1RP.d.ts → select-date-range-C9jlUrCX.d.ts} +1 -1
- package/dist/{select-date-range-Cm5o2xPp.d.cts → select-date-range-CIiI0F5o.d.cts} +1 -1
- package/dist/select-date-range.cjs +9 -2
- package/dist/select-date-range.d.cts +2 -2
- package/dist/select-date-range.d.ts +2 -2
- package/dist/select-date-range.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
Watermark,
|
|
82
82
|
message,
|
|
83
83
|
notification
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-D2H37DUL.js";
|
|
85
85
|
import "./chunk-RX242MUO.js";
|
|
86
86
|
import {
|
|
87
87
|
MarkdownEditor
|
|
@@ -89,12 +89,12 @@ import {
|
|
|
89
89
|
import {
|
|
90
90
|
RichTextContent,
|
|
91
91
|
RichTextEditor
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-CVIFJLW6.js";
|
|
93
93
|
import {
|
|
94
94
|
DatePicker,
|
|
95
95
|
SelectDateRange,
|
|
96
96
|
TimePanel
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-MKCU5S77.js";
|
|
98
98
|
import {
|
|
99
99
|
Checkbox,
|
|
100
100
|
FloatingScrollbarProvider,
|
|
@@ -106,14 +106,14 @@ import {
|
|
|
106
106
|
Tooltip,
|
|
107
107
|
Tree,
|
|
108
108
|
useScrollbarProximity
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-7PPE6DJO.js";
|
|
110
110
|
import {
|
|
111
111
|
Dropdown,
|
|
112
112
|
Input,
|
|
113
113
|
Menu,
|
|
114
114
|
Segmented,
|
|
115
115
|
Steps
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-SATXB6X4.js";
|
|
117
117
|
import {
|
|
118
118
|
TextArea
|
|
119
119
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -142,15 +142,46 @@ import {
|
|
|
142
142
|
} from "./chunk-NZMUW5XI.js";
|
|
143
143
|
|
|
144
144
|
// src/components/CursorPreview.tsx
|
|
145
|
-
import { useEffect, useState } from "react";
|
|
145
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
146
146
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
147
|
-
function CursorPreview({ frames, size = 48, playing = true, followPointer = true, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerMove, onPointerLeave, ...props }) {
|
|
147
|
+
function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, followPointer = true, showHotspot = false, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerEnter, onPointerMove, onPointerLeave, ...props }) {
|
|
148
|
+
const rootRef = useRef(null);
|
|
149
|
+
const [bounds, setBounds] = useState({ width: 0, height: 0 });
|
|
150
|
+
const [hovered, setHovered] = useState(false);
|
|
148
151
|
const [index, setIndex] = useState(0);
|
|
149
152
|
const [point, setPoint] = useState(null);
|
|
150
153
|
const [reduced, setReduced] = useState(false);
|
|
151
154
|
const [failed, setFailed] = useState(false);
|
|
152
|
-
const
|
|
155
|
+
const [density, setDensity] = useState(() => typeof window === "undefined" ? 1 : window.devicePixelRatio || 1);
|
|
156
|
+
const scale = sizeUnit === "device" ? density : 1;
|
|
157
|
+
const safeSize = Math.max(8, Number.isFinite(size) ? size : 48) / scale;
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (sizeUnit !== "device") return;
|
|
160
|
+
let media;
|
|
161
|
+
const update = () => {
|
|
162
|
+
media?.removeEventListener("change", update);
|
|
163
|
+
const next = window.devicePixelRatio || 1;
|
|
164
|
+
setDensity(next);
|
|
165
|
+
media = window.matchMedia(`(resolution: ${next}dppx)`);
|
|
166
|
+
media.addEventListener("change", update);
|
|
167
|
+
};
|
|
168
|
+
update();
|
|
169
|
+
window.addEventListener("resize", update);
|
|
170
|
+
return () => {
|
|
171
|
+
media.removeEventListener("change", update);
|
|
172
|
+
window.removeEventListener("resize", update);
|
|
173
|
+
};
|
|
174
|
+
}, [sizeUnit]);
|
|
153
175
|
const frame = frames[playing && !reduced ? index % Math.max(1, frames.length) : 0];
|
|
176
|
+
useLayoutEffect(() => {
|
|
177
|
+
const root = rootRef.current;
|
|
178
|
+
if (!showHotspot && sizeUnit !== "device" || !root) return;
|
|
179
|
+
const measure = () => setBounds({ width: root.clientWidth, height: root.clientHeight });
|
|
180
|
+
measure();
|
|
181
|
+
const observer = new ResizeObserver(measure);
|
|
182
|
+
observer.observe(root);
|
|
183
|
+
return () => observer.disconnect();
|
|
184
|
+
}, [showHotspot, sizeUnit]);
|
|
154
185
|
useEffect(() => {
|
|
155
186
|
setIndex(0);
|
|
156
187
|
}, [frames]);
|
|
@@ -169,26 +200,58 @@ function CursorPreview({ frames, size = 48, playing = true, followPointer = true
|
|
|
169
200
|
}, [playing, reduced, frames, index, frame]);
|
|
170
201
|
function move(event) {
|
|
171
202
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
203
|
+
if (event.pointerType !== "touch") setHovered(true);
|
|
172
204
|
if (followPointer && event.pointerType !== "touch") setPoint({ x: event.clientX - rect.left, y: event.clientY - rect.top });
|
|
173
205
|
onPointerMove?.(event);
|
|
174
206
|
}
|
|
175
207
|
const following = !!point && followPointer && !!frame && !failed;
|
|
176
208
|
const offset = (value) => Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * safeSize;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
209
|
+
const origin = rootRef.current?.getBoundingClientRect();
|
|
210
|
+
const snap = (value, base) => sizeUnit === "device" ? Math.round((value + base) * density) / density - base : value;
|
|
211
|
+
const bitmapX = snap(following ? point.x - offset(frame.hotspotX) : (bounds.width - safeSize) / 2, origin?.left ?? 0);
|
|
212
|
+
const bitmapY = snap(following ? point.y - offset(frame.hotspotY) : (bounds.height - safeSize) / 2, origin?.top ?? 0);
|
|
213
|
+
const hotspotX = bitmapX + offset(frame?.hotspotX);
|
|
214
|
+
const hotspotY = bitmapY + offset(frame?.hotspotY);
|
|
215
|
+
const direction = bounds.width - hotspotX >= 130 ? 1 : -1;
|
|
216
|
+
const lineY = Math.max(18, hotspotY - 42);
|
|
217
|
+
const elbowX = hotspotX + direction * 28;
|
|
218
|
+
const endX = direction === 1 ? Math.min(bounds.width - 58, hotspotX + 82) : Math.max(58, hotspotX - 82);
|
|
219
|
+
return /* @__PURE__ */ jsxs(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
...props,
|
|
223
|
+
ref: rootRef,
|
|
224
|
+
className: `sia-cursor-preview${following ? " is-following" : ""} ${className}`.trim(),
|
|
225
|
+
style: { height, ...style },
|
|
226
|
+
onPointerEnter: (event) => {
|
|
227
|
+
if (event.pointerType !== "touch") setHovered(true);
|
|
228
|
+
onPointerEnter?.(event);
|
|
229
|
+
},
|
|
230
|
+
onPointerMove: move,
|
|
231
|
+
onPointerLeave: (event) => {
|
|
232
|
+
setHovered(false);
|
|
233
|
+
setPoint(null);
|
|
234
|
+
onPointerLeave?.(event);
|
|
235
|
+
},
|
|
236
|
+
children: [
|
|
237
|
+
frame ? /* @__PURE__ */ jsx("span", { className: "sia-cursor-preview__bitmap", style: { width: safeSize, height: safeSize, left: sizeUnit === "device" || following ? bitmapX : "50%", top: sizeUnit === "device" || following ? bitmapY : "50%", transform: sizeUnit === "device" || following ? void 0 : "translate(-50%, -50%)" }, children: /* @__PURE__ */ jsx(Image, { src: frame.src, width: safeSize, height: safeSize, alt, preview: false, draggable: false, onLoad: () => setFailed(false), onError: () => setFailed(true) }) }) : /* @__PURE__ */ jsx("span", { className: "sia-cursor-preview__empty", children: empty }),
|
|
238
|
+
showHotspot && !hovered && frame && !failed && bounds.width > 0 ? /* @__PURE__ */ jsxs("svg", { className: "sia-cursor-preview__hotspot", width: "100%", height: "100%", role: "img", "aria-label": "\u6307\u9488\u70B9\uFF1A\u9F20\u6807\u70B9\u51FB\u7684\u5B9E\u9645\u4F4D\u7F6E", children: [
|
|
239
|
+
/* @__PURE__ */ jsx("polyline", { points: `${hotspotX},${hotspotY} ${elbowX},${lineY} ${endX},${lineY}` }),
|
|
240
|
+
/* @__PURE__ */ jsx("circle", { cx: hotspotX, cy: hotspotY, r: 2.5 }),
|
|
241
|
+
/* @__PURE__ */ jsx("text", { x: endX + direction * 8, y: lineY, textAnchor: direction === 1 ? "start" : "end", dominantBaseline: "central", children: "\u6307\u9488\u70B9" })
|
|
242
|
+
] }) : null,
|
|
243
|
+
children ? /* @__PURE__ */ jsx("div", { className: "sia-cursor-preview__caption", children }) : null
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
);
|
|
184
247
|
}
|
|
185
248
|
|
|
186
249
|
// src/components/UtilityLayout.tsx
|
|
187
|
-
import { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
250
|
+
import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
188
251
|
import { createPortal } from "react-dom";
|
|
189
252
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
190
253
|
function AutoSizer({ children }) {
|
|
191
|
-
const ref =
|
|
254
|
+
const ref = useRef2(null);
|
|
192
255
|
const [size, setSize] = useState2({ width: 0, height: 0 });
|
|
193
256
|
useEffect2(() => {
|
|
194
257
|
const element = ref.current;
|
|
@@ -449,7 +512,7 @@ function Pagination({
|
|
|
449
512
|
}
|
|
450
513
|
|
|
451
514
|
// src/components/Cascader.tsx
|
|
452
|
-
import { useEffect as useEffect3, useMemo, useRef as
|
|
515
|
+
import { useEffect as useEffect3, useMemo, useRef as useRef3, useState as useState5 } from "react";
|
|
453
516
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
454
517
|
function optionValue(option, fields) {
|
|
455
518
|
return option[fields.value];
|
|
@@ -506,8 +569,8 @@ function Cascader({
|
|
|
506
569
|
}) {
|
|
507
570
|
const size = useControlSize(sizeProp);
|
|
508
571
|
const fields = useMemo(() => ({ label: fieldNames?.label ?? "label", value: fieldNames?.value ?? "value", children: fieldNames?.children ?? "children" }), [fieldNames]);
|
|
509
|
-
const rootRef =
|
|
510
|
-
const popupRef =
|
|
572
|
+
const rootRef = useRef3(null);
|
|
573
|
+
const popupRef = useRef3(null);
|
|
511
574
|
const [current, setCurrent] = useControllableState({
|
|
512
575
|
value,
|
|
513
576
|
defaultValue: defaultValue ?? (multiple ? [] : void 0)
|
|
@@ -812,7 +875,7 @@ function Col({
|
|
|
812
875
|
}
|
|
813
876
|
|
|
814
877
|
// src/components/Splitter.tsx
|
|
815
|
-
import { Children as Children2, cloneElement, isValidElement, useMemo as useMemo2, useRef as
|
|
878
|
+
import { Children as Children2, cloneElement, isValidElement, useMemo as useMemo2, useRef as useRef4, useState as useState6 } from "react";
|
|
816
879
|
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
817
880
|
function SplitterPanel({
|
|
818
881
|
defaultSize: _defaultSize,
|
|
@@ -862,10 +925,10 @@ function SplitterRoot({
|
|
|
862
925
|
children,
|
|
863
926
|
...props
|
|
864
927
|
}) {
|
|
865
|
-
const rootRef =
|
|
928
|
+
const rootRef = useRef4(null);
|
|
866
929
|
const panels = useMemo2(() => Children2.toArray(children).filter(isValidElement), [children]);
|
|
867
930
|
const [sizes, setSizes] = useState6(() => normalizeSizes(panels));
|
|
868
|
-
const expandedSizesRef =
|
|
931
|
+
const expandedSizesRef = useRef4(normalizeExpandedSizes(panels));
|
|
869
932
|
function resizePair(index, deltaPercent, complete = false) {
|
|
870
933
|
setSizes((current) => {
|
|
871
934
|
const next = [...current];
|
|
@@ -1010,7 +1073,7 @@ var Splitter = Object.assign(SplitterRoot, {
|
|
|
1010
1073
|
});
|
|
1011
1074
|
|
|
1012
1075
|
// src/components/ToolPanel.tsx
|
|
1013
|
-
import { useId, useLayoutEffect, useRef as
|
|
1076
|
+
import { useId, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState7 } from "react";
|
|
1014
1077
|
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1015
1078
|
function clamp2(value, min, max) {
|
|
1016
1079
|
return Math.min(max, Math.max(min, value));
|
|
@@ -1044,9 +1107,9 @@ function ToolPanel({
|
|
|
1044
1107
|
const requestedKey = activeKey ?? internalActiveKey;
|
|
1045
1108
|
const activePanel = panels.find((item) => item.key === requestedKey && !item.disabled) ?? panels.find((item) => !item.disabled);
|
|
1046
1109
|
const isOpen = (open ?? internalOpen) && Boolean(activePanel);
|
|
1047
|
-
const railRef =
|
|
1048
|
-
const indicatorRef =
|
|
1049
|
-
|
|
1110
|
+
const railRef = useRef5(null);
|
|
1111
|
+
const indicatorRef = useRef5(null);
|
|
1112
|
+
useLayoutEffect2(() => {
|
|
1050
1113
|
const rail2 = railRef.current;
|
|
1051
1114
|
const indicator = indicatorRef.current;
|
|
1052
1115
|
if (!rail2 || !indicator) return;
|
|
@@ -1204,6 +1267,7 @@ function ToolPanel({
|
|
|
1204
1267
|
}
|
|
1205
1268
|
|
|
1206
1269
|
// src/components/WindowFrame.tsx
|
|
1270
|
+
import { useEffect as useEffect4, useRef as useRef6 } from "react";
|
|
1207
1271
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1208
1272
|
var DEFAULT_LABELS = {
|
|
1209
1273
|
minimize: "\u6700\u5C0F\u5316",
|
|
@@ -1327,13 +1391,40 @@ function WindowTitleBar({
|
|
|
1327
1391
|
onMouseDown,
|
|
1328
1392
|
...props
|
|
1329
1393
|
}) {
|
|
1394
|
+
const cancelDrag = useRef6(null);
|
|
1395
|
+
useEffect4(() => () => cancelDrag.current?.(), [draggable]);
|
|
1330
1396
|
function handleMouseDown(event) {
|
|
1397
|
+
cancelDrag.current?.();
|
|
1331
1398
|
onMouseDown?.(event);
|
|
1332
1399
|
if (event.defaultPrevented || !draggable || !onWindowAction || event.button !== 0) return;
|
|
1333
1400
|
const target = event.target;
|
|
1334
1401
|
if (!(target instanceof Element) || target.closest(NON_DRAG_SELECTOR)) return;
|
|
1335
1402
|
event.preventDefault();
|
|
1336
|
-
|
|
1403
|
+
if (event.detail > 1) {
|
|
1404
|
+
void onWindowAction("toggle-maximize");
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
const origin = { x: event.clientX, y: event.clientY };
|
|
1408
|
+
const run = onWindowAction;
|
|
1409
|
+
function cancel() {
|
|
1410
|
+
document.removeEventListener("mousemove", move);
|
|
1411
|
+
document.removeEventListener("mouseup", cancel, true);
|
|
1412
|
+
window.removeEventListener("blur", cancel);
|
|
1413
|
+
cancelDrag.current = null;
|
|
1414
|
+
}
|
|
1415
|
+
function move(next) {
|
|
1416
|
+
if ((next.buttons & 1) === 0) {
|
|
1417
|
+
cancel();
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
if (Math.hypot(next.clientX - origin.x, next.clientY - origin.y) < 2) return;
|
|
1421
|
+
cancel();
|
|
1422
|
+
void run("start-dragging");
|
|
1423
|
+
}
|
|
1424
|
+
cancelDrag.current = cancel;
|
|
1425
|
+
document.addEventListener("mousemove", move);
|
|
1426
|
+
document.addEventListener("mouseup", cancel, true);
|
|
1427
|
+
window.addEventListener("blur", cancel);
|
|
1337
1428
|
}
|
|
1338
1429
|
const renderedControls = controls === true ? /* @__PURE__ */ jsx9(
|
|
1339
1430
|
WindowControls,
|
|
@@ -1365,7 +1456,7 @@ function WindowTitleBar({
|
|
|
1365
1456
|
}
|
|
1366
1457
|
|
|
1367
1458
|
// src/components/Drawer.tsx
|
|
1368
|
-
import { createContext, forwardRef, useCallback, useContext, useEffect as
|
|
1459
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect as useEffect5, useId as useId2, useMemo as useMemo3, useRef as useRef7, useState as useState8 } from "react";
|
|
1369
1460
|
import { createRoot } from "react-dom/client";
|
|
1370
1461
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1371
1462
|
var drawerHandles = /* @__PURE__ */ new Set();
|
|
@@ -1401,13 +1492,13 @@ var DrawerRoot = forwardRef(function Drawer({
|
|
|
1401
1492
|
style,
|
|
1402
1493
|
...props
|
|
1403
1494
|
}, forwardedRef) {
|
|
1404
|
-
const localRef =
|
|
1405
|
-
const bodyRef =
|
|
1495
|
+
const localRef = useRef7(null);
|
|
1496
|
+
const bodyRef = useRef7(null);
|
|
1406
1497
|
const titleId = useId2();
|
|
1407
1498
|
const drawerId = useId2();
|
|
1408
1499
|
const parentStack = useContext(DrawerStackContext);
|
|
1409
|
-
const afterOpenRef =
|
|
1410
|
-
const afterCloseRef =
|
|
1500
|
+
const afterOpenRef = useRef7(afterOpen);
|
|
1501
|
+
const afterCloseRef = useRef7(afterClose);
|
|
1411
1502
|
afterOpenRef.current = afterOpen;
|
|
1412
1503
|
afterCloseRef.current = afterClose;
|
|
1413
1504
|
const [rendered, setRendered] = useState8(open);
|
|
@@ -1424,7 +1515,7 @@ var DrawerRoot = forwardRef(function Drawer({
|
|
|
1424
1515
|
});
|
|
1425
1516
|
}, []);
|
|
1426
1517
|
const stackContextValue = useMemo3(() => ({ setChildOpen }), [setChildOpen]);
|
|
1427
|
-
|
|
1518
|
+
useEffect5(() => {
|
|
1428
1519
|
if (open) {
|
|
1429
1520
|
setRendered(true);
|
|
1430
1521
|
setClosing(false);
|
|
@@ -1439,12 +1530,12 @@ var DrawerRoot = forwardRef(function Drawer({
|
|
|
1439
1530
|
}, DRAWER_MOTION_DURATION);
|
|
1440
1531
|
return () => window.clearTimeout(timer);
|
|
1441
1532
|
}, [open, rendered]);
|
|
1442
|
-
|
|
1533
|
+
useEffect5(() => {
|
|
1443
1534
|
if (!open || !rendered) return void 0;
|
|
1444
1535
|
const timer = window.setTimeout(() => afterOpenRef.current?.(), DRAWER_MOTION_DURATION);
|
|
1445
1536
|
return () => window.clearTimeout(timer);
|
|
1446
1537
|
}, [open, rendered]);
|
|
1447
|
-
|
|
1538
|
+
useEffect5(() => {
|
|
1448
1539
|
if (!parentStack) return void 0;
|
|
1449
1540
|
parentStack.setChildOpen(drawerId, open);
|
|
1450
1541
|
return () => parentStack.setChildOpen(drawerId, false);
|
|
@@ -1570,7 +1661,7 @@ var Drawer2 = Object.assign(DrawerRoot, {
|
|
|
1570
1661
|
});
|
|
1571
1662
|
|
|
1572
1663
|
// src/components/Form.tsx
|
|
1573
|
-
import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef2, isValidElement as isValidElement2, useContext as useContext2, useEffect as
|
|
1664
|
+
import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef2, isValidElement as isValidElement2, useContext as useContext2, useEffect as useEffect6, useId as useId3, useLayoutEffect as useLayoutEffect3, useMemo as useMemo4, useRef as useRef8, useSyncExternalStore } from "react";
|
|
1574
1665
|
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1575
1666
|
var Switch = forwardRef2(function Switch2({
|
|
1576
1667
|
label,
|
|
@@ -1803,7 +1894,7 @@ var FormStore = class {
|
|
|
1803
1894
|
};
|
|
1804
1895
|
var FormContext = createContext2(null);
|
|
1805
1896
|
function useForm(form) {
|
|
1806
|
-
const ref =
|
|
1897
|
+
const ref = useRef8(form ?? new FormStore());
|
|
1807
1898
|
return [ref.current];
|
|
1808
1899
|
}
|
|
1809
1900
|
function FormRoot({
|
|
@@ -1827,8 +1918,8 @@ function FormRoot({
|
|
|
1827
1918
|
const instance = internalForm;
|
|
1828
1919
|
instance.configure(initialValues, { onFinish, onFinishFailed, onValuesChange });
|
|
1829
1920
|
const context = useMemo4(() => instance, [instance]);
|
|
1830
|
-
const formRef =
|
|
1831
|
-
|
|
1921
|
+
const formRef = useRef8(null);
|
|
1922
|
+
useLayoutEffect3(() => {
|
|
1832
1923
|
const root = formRef.current;
|
|
1833
1924
|
if (!root) return;
|
|
1834
1925
|
let frame = 0;
|
|
@@ -1892,6 +1983,7 @@ function defaultEventValue(valuePropName, args) {
|
|
|
1892
1983
|
function FormItem({
|
|
1893
1984
|
name,
|
|
1894
1985
|
label,
|
|
1986
|
+
align = "start",
|
|
1895
1987
|
rules = [],
|
|
1896
1988
|
required,
|
|
1897
1989
|
extra,
|
|
@@ -1907,7 +1999,7 @@ function FormItem({
|
|
|
1907
1999
|
}) {
|
|
1908
2000
|
const form = useContext2(FormContext);
|
|
1909
2001
|
const id = useId3();
|
|
1910
|
-
const itemRef =
|
|
2002
|
+
const itemRef = useRef8(null);
|
|
1911
2003
|
if (!form) throw new Error("Form.Item \u5FC5\u987B\u5728 Form \u5185\u4F7F\u7528");
|
|
1912
2004
|
useSyncExternalStore(form.subscribe, form.getSnapshot, form.getSnapshot);
|
|
1913
2005
|
const path = name === void 0 ? void 0 : pathArray(name);
|
|
@@ -1918,7 +2010,7 @@ function FormItem({
|
|
|
1918
2010
|
const helpContent = help ?? errors[0];
|
|
1919
2011
|
const labelId = label && !noStyle ? `${id}-label` : void 0;
|
|
1920
2012
|
const errorId = `${id}-error`;
|
|
1921
|
-
|
|
2013
|
+
useEffect6(() => {
|
|
1922
2014
|
if (!path) return void 0;
|
|
1923
2015
|
return form.registerField({
|
|
1924
2016
|
name: path,
|
|
@@ -1964,7 +2056,7 @@ function FormItem({
|
|
|
1964
2056
|
if (noStyle) return /* @__PURE__ */ jsx11(Fragment3, { children: content });
|
|
1965
2057
|
const inputWrap = /* @__PURE__ */ jsx11("div", { className: "sia-form-item__input-wrap", children: content });
|
|
1966
2058
|
const hasError = status === "error" && Boolean(helpContent);
|
|
1967
|
-
return /* @__PURE__ */ jsxs11("div", { ref: itemRef, className: `sia-form-item${status ? ` sia-form-item--${status}` : ""} ${className}`.trim(), "data-sia-form-field": key || void 0, children: [
|
|
2059
|
+
return /* @__PURE__ */ jsxs11("div", { ref: itemRef, className: `sia-form-item${align === "center" ? " sia-form-item--align-center" : ""}${status ? ` sia-form-item--${status}` : ""} ${className}`.trim(), "data-sia-form-field": key || void 0, children: [
|
|
1968
2060
|
label ? /* @__PURE__ */ jsx11("div", { id: labelId, className: "sia-form-item__label", children: /* @__PURE__ */ jsxs11("span", { className: "sia-form-item__label-content", children: [
|
|
1969
2061
|
ruleRequired ? /* @__PURE__ */ jsx11("span", { className: "sia-form-item__required-mark", "aria-hidden": "true", children: "*" }) : null,
|
|
1970
2062
|
label
|
|
@@ -2234,7 +2326,7 @@ function Slider({
|
|
|
2234
2326
|
}
|
|
2235
2327
|
|
|
2236
2328
|
// src/components/ColorPicker.tsx
|
|
2237
|
-
import { useEffect as
|
|
2329
|
+
import { useEffect as useEffect7, useRef as useRef9, useState as useState10 } from "react";
|
|
2238
2330
|
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2239
2331
|
var DEFAULT_MODES = ["solid", "gradient"];
|
|
2240
2332
|
var gradientStopSeed = 0;
|
|
@@ -2325,9 +2417,9 @@ function ColorPicker({
|
|
|
2325
2417
|
...props
|
|
2326
2418
|
}) {
|
|
2327
2419
|
const size = useControlSize(sizeProp);
|
|
2328
|
-
const rootRef =
|
|
2329
|
-
const popupRef =
|
|
2330
|
-
const lastEmittedValue =
|
|
2420
|
+
const rootRef = useRef9(null);
|
|
2421
|
+
const popupRef = useRef9(null);
|
|
2422
|
+
const lastEmittedValue = useRef9();
|
|
2331
2423
|
const initialGradient = parseGradient(value ?? defaultValue);
|
|
2332
2424
|
const initialSolid = initialGradient?.stops[0]?.color ?? normalizeHex(value || defaultValue);
|
|
2333
2425
|
const [open, setOpen] = useState10(false);
|
|
@@ -2351,7 +2443,7 @@ function ColorPicker({
|
|
|
2351
2443
|
const hsv = rgbToHsv(rgba);
|
|
2352
2444
|
const [hexDraft, setHexDraft] = useState10(editingColor);
|
|
2353
2445
|
const gradientValue = formatGradient(gradientAngle, gradientStops);
|
|
2354
|
-
|
|
2446
|
+
useEffect7(() => {
|
|
2355
2447
|
if (!open) return void 0;
|
|
2356
2448
|
const close = (event) => {
|
|
2357
2449
|
const target = event.target;
|
|
@@ -2360,10 +2452,10 @@ function ColorPicker({
|
|
|
2360
2452
|
document.addEventListener("pointerdown", close);
|
|
2361
2453
|
return () => document.removeEventListener("pointerdown", close);
|
|
2362
2454
|
}, [open]);
|
|
2363
|
-
|
|
2455
|
+
useEffect7(() => {
|
|
2364
2456
|
setHexDraft(editingColor);
|
|
2365
2457
|
}, [editingColor]);
|
|
2366
|
-
|
|
2458
|
+
useEffect7(() => {
|
|
2367
2459
|
if (value === void 0 || value === lastEmittedValue.current) return;
|
|
2368
2460
|
const parsed = parseGradient(value);
|
|
2369
2461
|
if (parsed) {
|
|
@@ -2550,7 +2642,7 @@ function ColorPicker({
|
|
|
2550
2642
|
}
|
|
2551
2643
|
|
|
2552
2644
|
// src/components/TimePicker.tsx
|
|
2553
|
-
import { useEffect as
|
|
2645
|
+
import { useEffect as useEffect8, useId as useId5, useRef as useRef10, useState as useState11 } from "react";
|
|
2554
2646
|
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2555
2647
|
function seconds(value) {
|
|
2556
2648
|
const [h = 0, m = 0, s = 0] = value.split(":").map(Number);
|
|
@@ -2581,10 +2673,10 @@ function TimePicker({
|
|
|
2581
2673
|
}) {
|
|
2582
2674
|
const size = useControlSize(sizeProp);
|
|
2583
2675
|
const id = useId5();
|
|
2584
|
-
const rootRef =
|
|
2585
|
-
const inputRef =
|
|
2586
|
-
const popupRef =
|
|
2587
|
-
const focusPanel =
|
|
2676
|
+
const rootRef = useRef10(null);
|
|
2677
|
+
const inputRef = useRef10(null);
|
|
2678
|
+
const popupRef = useRef10(null);
|
|
2679
|
+
const focusPanel = useRef10(false);
|
|
2588
2680
|
const [currentValue, setValue2] = useControllableState({ value, defaultValue, onChange });
|
|
2589
2681
|
const [open, setOpen] = useState11(false);
|
|
2590
2682
|
const [draft, setDraft] = useState11("00:00:00");
|
|
@@ -2605,7 +2697,7 @@ function TimePicker({
|
|
|
2605
2697
|
setOpen(next);
|
|
2606
2698
|
onOpenChange?.(next);
|
|
2607
2699
|
}
|
|
2608
|
-
|
|
2700
|
+
useEffect8(() => {
|
|
2609
2701
|
if (!open) return;
|
|
2610
2702
|
if (focusPanel.current) {
|
|
2611
2703
|
popupRef.current?.querySelector('[aria-selected="true"]')?.focus();
|
|
@@ -2724,7 +2816,7 @@ function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F0
|
|
|
2724
2816
|
})(TimePicker || (TimePicker = {}));
|
|
2725
2817
|
|
|
2726
2818
|
// src/components/TreeSelect.tsx
|
|
2727
|
-
import { useEffect as
|
|
2819
|
+
import { useEffect as useEffect9, useMemo as useMemo6, useRef as useRef11, useState as useState12 } from "react";
|
|
2728
2820
|
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2729
2821
|
function flattenTree(nodes, expanded, search, filter, depth = 0, parents = [], ancestorMatched = false) {
|
|
2730
2822
|
const result = [];
|
|
@@ -2787,8 +2879,8 @@ function TreeSelect({
|
|
|
2787
2879
|
...props
|
|
2788
2880
|
}) {
|
|
2789
2881
|
const size = useControlSize(sizeProp);
|
|
2790
|
-
const rootRef =
|
|
2791
|
-
const popupRef =
|
|
2882
|
+
const rootRef = useRef11(null);
|
|
2883
|
+
const popupRef = useRef11(null);
|
|
2792
2884
|
const nodeIndex = useMemo6(() => {
|
|
2793
2885
|
const index = /* @__PURE__ */ new Map();
|
|
2794
2886
|
const visit = (nodes) => nodes.forEach((node) => {
|
|
@@ -2824,7 +2916,7 @@ function TreeSelect({
|
|
|
2824
2916
|
const expandedSet = treeExpandedKeys ? new Set(treeExpandedKeys) : expanded;
|
|
2825
2917
|
const selectedNodes = resolveNodes(selectedValues);
|
|
2826
2918
|
const visibleNodes = flattenTree(treeData, expandedSet, search, filterTreeNode);
|
|
2827
|
-
|
|
2919
|
+
useEffect9(() => {
|
|
2828
2920
|
if (!open || treeExpandedKeys) return;
|
|
2829
2921
|
const keys = new Set(expanded);
|
|
2830
2922
|
const walk = (nodes, parents) => nodes.forEach((node) => {
|
|
@@ -2884,7 +2976,7 @@ function TreeSelect({
|
|
|
2884
2976
|
setCurrentValue(multi ? [] : void 0);
|
|
2885
2977
|
onClear?.();
|
|
2886
2978
|
}
|
|
2887
|
-
|
|
2979
|
+
useEffect9(() => {
|
|
2888
2980
|
if (!open) return void 0;
|
|
2889
2981
|
const close = (event) => {
|
|
2890
2982
|
const target = event.target;
|
|
@@ -3043,7 +3135,7 @@ function buildFlatTree(items, options = {}) {
|
|
|
3043
3135
|
}
|
|
3044
3136
|
|
|
3045
3137
|
// src/components/Editor.tsx
|
|
3046
|
-
import { useEffect as
|
|
3138
|
+
import { useEffect as useEffect10, useId as useId6, useRef as useRef12, useState as useState13 } from "react";
|
|
3047
3139
|
import EditorWorker from "monaco-editor/editor/editor.worker.js?worker";
|
|
3048
3140
|
|
|
3049
3141
|
// src/components/jsonLanguage.ts
|
|
@@ -3719,27 +3811,27 @@ function Editor({
|
|
|
3719
3811
|
loadingText = "\u6B63\u5728\u52A0\u8F7D\u7F16\u8F91\u5668\u2026"
|
|
3720
3812
|
}) {
|
|
3721
3813
|
const generatedId = useId6();
|
|
3722
|
-
const containerRef =
|
|
3723
|
-
const rangeHighlightRef =
|
|
3724
|
-
const editorRef =
|
|
3725
|
-
const modelRef =
|
|
3726
|
-
const apiRef =
|
|
3727
|
-
const applyingControlledValueRef =
|
|
3728
|
-
const updateHighlightRef =
|
|
3729
|
-
const changeHandlerRef =
|
|
3730
|
-
const readyHandlerRef =
|
|
3731
|
-
const selectionHandlerRef =
|
|
3732
|
-
const keyDownHandlerRef =
|
|
3733
|
-
const highlightRangeRef =
|
|
3734
|
-
const markersRef =
|
|
3735
|
-
const contextMenuItemsRef =
|
|
3736
|
-
const completionProviderRef =
|
|
3737
|
-
const refreshSuggestionOnSpaceRef =
|
|
3738
|
-
const initialValueRef =
|
|
3739
|
-
const initialLanguageRef =
|
|
3740
|
-
const initialPathRef =
|
|
3741
|
-
const initialThemeRef =
|
|
3742
|
-
const initialOptionsRef =
|
|
3814
|
+
const containerRef = useRef12(null);
|
|
3815
|
+
const rangeHighlightRef = useRef12(null);
|
|
3816
|
+
const editorRef = useRef12(null);
|
|
3817
|
+
const modelRef = useRef12(null);
|
|
3818
|
+
const apiRef = useRef12(null);
|
|
3819
|
+
const applyingControlledValueRef = useRef12(false);
|
|
3820
|
+
const updateHighlightRef = useRef12(() => void 0);
|
|
3821
|
+
const changeHandlerRef = useRef12(onChange);
|
|
3822
|
+
const readyHandlerRef = useRef12(onReady);
|
|
3823
|
+
const selectionHandlerRef = useRef12(onSelectionChange);
|
|
3824
|
+
const keyDownHandlerRef = useRef12(onKeyDown);
|
|
3825
|
+
const highlightRangeRef = useRef12(highlightRange);
|
|
3826
|
+
const markersRef = useRef12(markers);
|
|
3827
|
+
const contextMenuItemsRef = useRef12(contextMenuItems);
|
|
3828
|
+
const completionProviderRef = useRef12(completionProvider);
|
|
3829
|
+
const refreshSuggestionOnSpaceRef = useRef12(refreshSuggestionOnSpace);
|
|
3830
|
+
const initialValueRef = useRef12(value);
|
|
3831
|
+
const initialLanguageRef = useRef12(language);
|
|
3832
|
+
const initialPathRef = useRef12(path);
|
|
3833
|
+
const initialThemeRef = useRef12(theme);
|
|
3834
|
+
const initialOptionsRef = useRef12(options);
|
|
3743
3835
|
const [loading, setLoading] = useState13(true);
|
|
3744
3836
|
const [, setSelectionVersion] = useState13(0);
|
|
3745
3837
|
initialValueRef.current = value;
|
|
@@ -3756,7 +3848,7 @@ function Editor({
|
|
|
3756
3848
|
contextMenuItemsRef.current = contextMenuItems;
|
|
3757
3849
|
completionProviderRef.current = completionProvider;
|
|
3758
3850
|
refreshSuggestionOnSpaceRef.current = refreshSuggestionOnSpace;
|
|
3759
|
-
|
|
3851
|
+
useEffect10(() => {
|
|
3760
3852
|
let disposed = false;
|
|
3761
3853
|
const subscriptions = [];
|
|
3762
3854
|
async function mountEditor() {
|
|
@@ -4100,7 +4192,7 @@ function Editor({
|
|
|
4100
4192
|
updateHighlightRef.current = () => void 0;
|
|
4101
4193
|
};
|
|
4102
4194
|
}, [generatedId]);
|
|
4103
|
-
|
|
4195
|
+
useEffect10(() => {
|
|
4104
4196
|
const model = modelRef.current;
|
|
4105
4197
|
if (!model || model.getValue() === value) return;
|
|
4106
4198
|
applyingControlledValueRef.current = true;
|
|
@@ -4110,7 +4202,7 @@ function Editor({
|
|
|
4110
4202
|
applyingControlledValueRef.current = false;
|
|
4111
4203
|
}
|
|
4112
4204
|
}, [loading, value]);
|
|
4113
|
-
|
|
4205
|
+
useEffect10(() => {
|
|
4114
4206
|
if (loading) return;
|
|
4115
4207
|
void loadMonaco().then((monaco) => {
|
|
4116
4208
|
const model = modelRef.current;
|
|
@@ -4119,7 +4211,7 @@ function Editor({
|
|
|
4119
4211
|
}, [language, loading]);
|
|
4120
4212
|
const completionEnabled = Boolean(completionProvider);
|
|
4121
4213
|
const completionTriggerKey = completionTriggerCharacters.join("\0");
|
|
4122
|
-
|
|
4214
|
+
useEffect10(() => {
|
|
4123
4215
|
if (loading || !completionEnabled) return void 0;
|
|
4124
4216
|
let disposed = false;
|
|
4125
4217
|
let subscription;
|
|
@@ -4193,23 +4285,23 @@ function Editor({
|
|
|
4193
4285
|
subscription?.dispose();
|
|
4194
4286
|
};
|
|
4195
4287
|
}, [completionEnabled, completionTriggerKey, language, loading]);
|
|
4196
|
-
|
|
4288
|
+
useEffect10(() => {
|
|
4197
4289
|
if (loading) return;
|
|
4198
4290
|
void loadMonaco().then((monaco) => {
|
|
4199
4291
|
if (editorRef.current) monaco.editor.setTheme(theme === "dark" ? "vs-dark" : "vs");
|
|
4200
4292
|
});
|
|
4201
4293
|
}, [loading, theme]);
|
|
4202
|
-
|
|
4294
|
+
useEffect10(() => {
|
|
4203
4295
|
if (loading) return;
|
|
4204
4296
|
editorRef.current?.updateOptions({
|
|
4205
4297
|
...options ?? {},
|
|
4206
4298
|
contextmenu: contextMenuItems.length === 0 ? options?.contextmenu ?? true : false
|
|
4207
4299
|
});
|
|
4208
4300
|
}, [contextMenuItems.length, loading, options]);
|
|
4209
|
-
|
|
4301
|
+
useEffect10(() => {
|
|
4210
4302
|
updateHighlightRef.current();
|
|
4211
4303
|
}, [highlightRange]);
|
|
4212
|
-
|
|
4304
|
+
useEffect10(() => {
|
|
4213
4305
|
if (loading) return;
|
|
4214
4306
|
void loadMonaco().then((monaco) => {
|
|
4215
4307
|
const model = modelRef.current;
|
|
@@ -4277,19 +4369,19 @@ function Editor({
|
|
|
4277
4369
|
}
|
|
4278
4370
|
|
|
4279
4371
|
// src/components/Markdown.tsx
|
|
4280
|
-
import { useEffect as
|
|
4372
|
+
import { useEffect as useEffect11, useMemo as useMemo7, useRef as useRef13, useState as useState14 } from "react";
|
|
4281
4373
|
import DOMPurify from "dompurify";
|
|
4282
4374
|
import { marked } from "marked";
|
|
4283
4375
|
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4284
4376
|
function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", resolveImageSrc, imagePreview = true, className = "", onClick, onKeyDown, ...props }) {
|
|
4285
|
-
const rootRef =
|
|
4377
|
+
const rootRef = useRef13(null);
|
|
4286
4378
|
const [previewImage, setPreviewImage] = useState14(null);
|
|
4287
4379
|
const html = useMemo7(() => {
|
|
4288
4380
|
const rendered = marked.parse(content, { breaks: true, gfm: true });
|
|
4289
4381
|
const sanitized = DOMPurify.sanitize(rendered, { USE_PROFILES: { html: true } });
|
|
4290
4382
|
return sanitized.replace(/<img\b/giu, '<img loading="lazy" decoding="async" referrerpolicy="no-referrer"');
|
|
4291
4383
|
}, [content]);
|
|
4292
|
-
|
|
4384
|
+
useEffect11(() => {
|
|
4293
4385
|
const root = rootRef.current;
|
|
4294
4386
|
if (!root) return void 0;
|
|
4295
4387
|
let cancelled = false;
|
|
@@ -4357,7 +4449,7 @@ function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", r
|
|
|
4357
4449
|
}
|
|
4358
4450
|
|
|
4359
4451
|
// src/components/InputNumber.tsx
|
|
4360
|
-
import { forwardRef as forwardRef4, useEffect as
|
|
4452
|
+
import { forwardRef as forwardRef4, useEffect as useEffect12, useId as useId7, useRef as useRef14, useState as useState15 } from "react";
|
|
4361
4453
|
import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4362
4454
|
function formatValue(value, precision) {
|
|
4363
4455
|
if (value === null || !Number.isFinite(value)) return "";
|
|
@@ -4391,14 +4483,14 @@ var InputNumber = forwardRef4(function InputNumber2({
|
|
|
4391
4483
|
const size = useControlSize(sizeProp);
|
|
4392
4484
|
const fallbackId = useId7();
|
|
4393
4485
|
const inputId = id ?? fallbackId;
|
|
4394
|
-
const localRef =
|
|
4486
|
+
const localRef = useRef14(null);
|
|
4395
4487
|
const [currentValue, setCurrentValue] = useControllableState({ value, defaultValue, onChange });
|
|
4396
4488
|
const displayValue = (next) => {
|
|
4397
4489
|
const plain = formatValue(next, precision);
|
|
4398
4490
|
return plain && formatter ? formatter(plain) : plain;
|
|
4399
4491
|
};
|
|
4400
4492
|
const [text, setText] = useState15(() => displayValue(currentValue));
|
|
4401
|
-
|
|
4493
|
+
useEffect12(() => {
|
|
4402
4494
|
setText(displayValue(currentValue));
|
|
4403
4495
|
}, [currentValue, precision, formatter]);
|
|
4404
4496
|
function setRef(node) {
|
|
@@ -4633,7 +4725,7 @@ function openSelectModal(config) {
|
|
|
4633
4725
|
}
|
|
4634
4726
|
|
|
4635
4727
|
// src/components/Treemap.tsx
|
|
4636
|
-
import { useEffect as
|
|
4728
|
+
import { useEffect as useEffect13, useMemo as useMemo8, useRef as useRef15, useState as useState17 } from "react";
|
|
4637
4729
|
import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4638
4730
|
import { createElement } from "react";
|
|
4639
4731
|
function positiveValue(value) {
|
|
@@ -5006,7 +5098,7 @@ function Treemap({
|
|
|
5006
5098
|
style,
|
|
5007
5099
|
...props
|
|
5008
5100
|
}) {
|
|
5009
|
-
const containerRef =
|
|
5101
|
+
const containerRef = useRef15(null);
|
|
5010
5102
|
const [size, setSize] = useState17({ width: 0, height: 0 });
|
|
5011
5103
|
const [internalExpandedKeys, setInternalExpandedKeys] = useState17(() => [...defaultExpandedKeys]);
|
|
5012
5104
|
const [internalFocusedKey, setInternalFocusedKey] = useState17(defaultFocusedKey);
|
|
@@ -5034,7 +5126,7 @@ function Treemap({
|
|
|
5034
5126
|
),
|
|
5035
5127
|
[activeKey, aggregateOverflow, data, effectiveFocusedNode, expandedSet, gap, headerHeight, maxVisibleNodes, minTileHeight, minTileWidth, overflowLabel, size]
|
|
5036
5128
|
);
|
|
5037
|
-
|
|
5129
|
+
useEffect13(() => {
|
|
5038
5130
|
const element = containerRef.current;
|
|
5039
5131
|
if (!element) return void 0;
|
|
5040
5132
|
const updateSize = () => {
|
|
@@ -5046,7 +5138,7 @@ function Treemap({
|
|
|
5046
5138
|
observer.observe(element);
|
|
5047
5139
|
return () => observer.disconnect();
|
|
5048
5140
|
}, []);
|
|
5049
|
-
|
|
5141
|
+
useEffect13(() => {
|
|
5050
5142
|
if (!currentFocusedKey || effectiveFocusedNode) return;
|
|
5051
5143
|
if (focusedKey === void 0) setInternalFocusedKey(null);
|
|
5052
5144
|
onFocusedChange?.(null);
|
|
@@ -5159,7 +5251,7 @@ function Treemap({
|
|
|
5159
5251
|
}
|
|
5160
5252
|
|
|
5161
5253
|
// src/components/Table/TableCellContent.tsx
|
|
5162
|
-
import { useLayoutEffect as
|
|
5254
|
+
import { useLayoutEffect as useLayoutEffect4, useRef as useRef16, useState as useState18 } from "react";
|
|
5163
5255
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5164
5256
|
var pendingLayouts = /* @__PURE__ */ new Map();
|
|
5165
5257
|
var layoutFrame;
|
|
@@ -5178,10 +5270,10 @@ function scheduleLayout(element, task) {
|
|
|
5178
5270
|
});
|
|
5179
5271
|
}
|
|
5180
5272
|
function TableCellContent({ children, ellipsis, title }) {
|
|
5181
|
-
const ref =
|
|
5273
|
+
const ref = useRef16(null);
|
|
5182
5274
|
const [overflowing, setOverflowing] = useState18(false);
|
|
5183
5275
|
const customContent = typeof children !== "string" && typeof children !== "number" && children != null;
|
|
5184
|
-
|
|
5276
|
+
useLayoutEffect4(() => {
|
|
5185
5277
|
const element = ref.current;
|
|
5186
5278
|
if (!element || !ellipsis || !customContent) return;
|
|
5187
5279
|
const normalizeLayouts = (parent, layouts) => {
|
|
@@ -5217,14 +5309,14 @@ function TableCellContent({ children, ellipsis, title }) {
|
|
|
5217
5309
|
}
|
|
5218
5310
|
|
|
5219
5311
|
// src/components/Table/useRemainingHeight.ts
|
|
5220
|
-
import { useLayoutEffect as
|
|
5312
|
+
import { useLayoutEffect as useLayoutEffect5, useState as useState19 } from "react";
|
|
5221
5313
|
function useRemainingHeight(rootRef, options) {
|
|
5222
5314
|
const [height, setHeight] = useState19();
|
|
5223
5315
|
const enabled = !!options;
|
|
5224
5316
|
const container = typeof options === "object" ? options.container : void 0;
|
|
5225
5317
|
const bottomOffset = typeof options === "object" ? options.bottomOffset ?? 0 : 0;
|
|
5226
5318
|
const minHeight = typeof options === "object" ? options.minHeight ?? 0 : 0;
|
|
5227
|
-
|
|
5319
|
+
useLayoutEffect5(() => {
|
|
5228
5320
|
const root = rootRef.current;
|
|
5229
5321
|
if (!enabled || !root) return;
|
|
5230
5322
|
const win = root.ownerDocument.defaultView;
|
|
@@ -5295,7 +5387,7 @@ function useRemainingHeight(rootRef, options) {
|
|
|
5295
5387
|
}
|
|
5296
5388
|
|
|
5297
5389
|
// src/components/Table/TableCanvasLayer.tsx
|
|
5298
|
-
import { useLayoutEffect as
|
|
5390
|
+
import { useLayoutEffect as useLayoutEffect6, useRef as useRef17 } from "react";
|
|
5299
5391
|
|
|
5300
5392
|
// src/components/Table/utils.ts
|
|
5301
5393
|
var AUTO_WIDTH_COLUMN_KEYS = /* @__PURE__ */ new Set(["action", "actions", "operation", "operations"]);
|
|
@@ -5350,8 +5442,8 @@ function toTablePageParams(current, pageSize) {
|
|
|
5350
5442
|
// src/components/Table/TableCanvasLayer.tsx
|
|
5351
5443
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5352
5444
|
function TableCanvasLayer({ viewport, rows, columns, widths, rowHeight, headerHeight }) {
|
|
5353
|
-
const canvasRef =
|
|
5354
|
-
|
|
5445
|
+
const canvasRef = useRef17(null);
|
|
5446
|
+
useLayoutEffect6(() => {
|
|
5355
5447
|
const canvas = canvasRef.current;
|
|
5356
5448
|
const scroller = viewport.current;
|
|
5357
5449
|
if (!canvas || !scroller) return;
|
|
@@ -5494,10 +5586,10 @@ function createRowIdentity() {
|
|
|
5494
5586
|
}
|
|
5495
5587
|
|
|
5496
5588
|
// src/components/Table/Table.tsx
|
|
5497
|
-
import { Fragment as Fragment8, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as
|
|
5589
|
+
import { Fragment as Fragment8, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect15, useImperativeHandle, useMemo as useMemo9, useRef as useRef19, useState as useState21 } from "react";
|
|
5498
5590
|
|
|
5499
5591
|
// src/components/Table/plugins.tsx
|
|
5500
|
-
import { isValidElement as isValidElement3, useEffect as
|
|
5592
|
+
import { isValidElement as isValidElement3, useEffect as useEffect14, useRef as useRef18, useState as useState20 } from "react";
|
|
5501
5593
|
|
|
5502
5594
|
// src/components/Table/columnSettings.ts
|
|
5503
5595
|
function reconcileColumnSettings(columns, defaults, saved) {
|
|
@@ -6619,7 +6711,7 @@ function TableFilterControl({
|
|
|
6619
6711
|
const [open, setOpen] = useState20(false);
|
|
6620
6712
|
const [draft, setDraft] = useState20(value);
|
|
6621
6713
|
const label = getColumnLabel(column);
|
|
6622
|
-
|
|
6714
|
+
useEffect14(() => {
|
|
6623
6715
|
if (open) setDraft(value);
|
|
6624
6716
|
}, [open, value]);
|
|
6625
6717
|
const apply = (nextValue) => {
|
|
@@ -7059,15 +7151,15 @@ function EditableTableCell({
|
|
|
7059
7151
|
const config = typeof editable === "object" ? editable : { type: "input" };
|
|
7060
7152
|
const [editValue, setEditValue] = useState20(value);
|
|
7061
7153
|
const [saving, setSaving] = useState20(false);
|
|
7062
|
-
const inputRef =
|
|
7063
|
-
const editorRef =
|
|
7064
|
-
const editValueRef =
|
|
7065
|
-
const savingRef =
|
|
7066
|
-
const saveRef =
|
|
7154
|
+
const inputRef = useRef18(null);
|
|
7155
|
+
const editorRef = useRef18(null);
|
|
7156
|
+
const editValueRef = useRef18(value);
|
|
7157
|
+
const savingRef = useRef18(false);
|
|
7158
|
+
const saveRef = useRef18(
|
|
7067
7159
|
async () => {
|
|
7068
7160
|
}
|
|
7069
7161
|
);
|
|
7070
|
-
|
|
7162
|
+
useEffect14(() => {
|
|
7071
7163
|
if (!active) return;
|
|
7072
7164
|
editValueRef.current = value;
|
|
7073
7165
|
setEditValue(value);
|
|
@@ -7098,7 +7190,7 @@ function EditableTableCell({
|
|
|
7098
7190
|
}
|
|
7099
7191
|
}
|
|
7100
7192
|
saveRef.current = save;
|
|
7101
|
-
|
|
7193
|
+
useEffect14(() => {
|
|
7102
7194
|
if (!active || config.type === "select" || config.type === "custom") return;
|
|
7103
7195
|
const handleOutsidePointerDown = (event) => {
|
|
7104
7196
|
const target = event.target;
|
|
@@ -7404,14 +7496,14 @@ function ColumnSettingPanel({
|
|
|
7404
7496
|
onApply
|
|
7405
7497
|
}) {
|
|
7406
7498
|
const [draft, setDraft] = useState20(items);
|
|
7407
|
-
const listRef =
|
|
7408
|
-
const cancelDrag =
|
|
7499
|
+
const listRef = useRef18(null);
|
|
7500
|
+
const cancelDrag = useRef18(null);
|
|
7409
7501
|
const [preview, setPreview] = useState20(null);
|
|
7410
|
-
|
|
7502
|
+
useEffect14(() => {
|
|
7411
7503
|
cancelDrag.current?.();
|
|
7412
7504
|
if (open) setDraft(orderColumnSettings(items));
|
|
7413
7505
|
}, [items, open]);
|
|
7414
|
-
|
|
7506
|
+
useEffect14(() => () => cancelDrag.current?.(), []);
|
|
7415
7507
|
const labels = new Map(
|
|
7416
7508
|
flattenTableColumns(columns).map((column) => [
|
|
7417
7509
|
column.key,
|
|
@@ -8234,12 +8326,12 @@ function TableInner(props, ref) {
|
|
|
8234
8326
|
style,
|
|
8235
8327
|
...htmlProps
|
|
8236
8328
|
} = props;
|
|
8237
|
-
const rootRef =
|
|
8329
|
+
const rootRef = useRef19(null);
|
|
8238
8330
|
const remainingHeight = useRemainingHeight(rootRef, height == null && tableHeight == null ? fillRemaining : false);
|
|
8239
|
-
const scrollRef =
|
|
8240
|
-
const tableRef =
|
|
8331
|
+
const scrollRef = useRef19(null);
|
|
8332
|
+
const tableRef = useRef19(null);
|
|
8241
8333
|
useScrollbarProximity();
|
|
8242
|
-
const scrollbarDragRef =
|
|
8334
|
+
const scrollbarDragRef = useRef19(null);
|
|
8243
8335
|
const [internalLoading, setInternalLoading] = useState21(false);
|
|
8244
8336
|
const [scrollTop, setScrollTop] = useState21(0);
|
|
8245
8337
|
const [scrollLeft, setScrollLeft] = useState21(0);
|
|
@@ -8261,14 +8353,14 @@ function TableInner(props, ref) {
|
|
|
8261
8353
|
return plugins;
|
|
8262
8354
|
}, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, builtInIndexPlugin, providedPlugins, resizable, cellSelection, showIndex]);
|
|
8263
8355
|
const sortedPlugins = useMemo9(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
|
|
8264
|
-
const pluginsByIdRef =
|
|
8356
|
+
const pluginsByIdRef = useRef19(/* @__PURE__ */ new Map());
|
|
8265
8357
|
pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
|
|
8266
8358
|
const [pluginStates, setPluginStates] = useState21(() => Object.fromEntries(
|
|
8267
8359
|
sortedPlugins.map((plugin) => [plugin.id, resolveInitialState(plugin)])
|
|
8268
8360
|
));
|
|
8269
|
-
const pluginApisRef =
|
|
8270
|
-
const contextsRef =
|
|
8271
|
-
const mountedPluginsRef =
|
|
8361
|
+
const pluginApisRef = useRef19({});
|
|
8362
|
+
const contextsRef = useRef19(/* @__PURE__ */ new Map());
|
|
8363
|
+
const mountedPluginsRef = useRef19(/* @__PURE__ */ new Map());
|
|
8272
8364
|
const pipeline = { columns: baseColumns, rows: createTableRows(dataSource, getRowKey) };
|
|
8273
8365
|
const nextApis = {};
|
|
8274
8366
|
const contexts = /* @__PURE__ */ new Map();
|
|
@@ -8325,7 +8417,7 @@ function TableInner(props, ref) {
|
|
|
8325
8417
|
});
|
|
8326
8418
|
pluginApisRef.current = nextApis;
|
|
8327
8419
|
contextsRef.current = contexts;
|
|
8328
|
-
|
|
8420
|
+
useEffect15(() => {
|
|
8329
8421
|
const activePlugins2 = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
|
|
8330
8422
|
for (const [pluginId, mounted] of mountedPluginsRef.current) {
|
|
8331
8423
|
if (activePlugins2.get(pluginId) === mounted.plugin) continue;
|
|
@@ -8337,7 +8429,7 @@ function TableInner(props, ref) {
|
|
|
8337
8429
|
mountedPluginsRef.current.set(plugin.id, { plugin, cleanup: plugin.onMount(contextsRef.current.get(plugin.id)) });
|
|
8338
8430
|
}
|
|
8339
8431
|
}, [sortedPlugins]);
|
|
8340
|
-
|
|
8432
|
+
useEffect15(() => () => {
|
|
8341
8433
|
for (const mounted of mountedPluginsRef.current.values()) mounted.cleanup?.();
|
|
8342
8434
|
mountedPluginsRef.current.clear();
|
|
8343
8435
|
}, []);
|
|
@@ -8381,7 +8473,7 @@ function TableInner(props, ref) {
|
|
|
8381
8473
|
verticalTrackElement?.style.setProperty("--sia-table-scrollbar-y-size", `${verticalThumb}px`);
|
|
8382
8474
|
verticalTrackElement?.style.setProperty("--sia-table-scrollbar-y-position", `${verticalPosition}px`);
|
|
8383
8475
|
}, []);
|
|
8384
|
-
|
|
8476
|
+
useEffect15(() => {
|
|
8385
8477
|
const element = scrollRef.current;
|
|
8386
8478
|
if (!element || typeof ResizeObserver === "undefined") return;
|
|
8387
8479
|
const observer = new ResizeObserver(() => {
|
|
@@ -8394,19 +8486,19 @@ function TableInner(props, ref) {
|
|
|
8394
8486
|
updateScrollMetrics();
|
|
8395
8487
|
return () => observer.disconnect();
|
|
8396
8488
|
}, [updateScrollMetrics]);
|
|
8397
|
-
|
|
8489
|
+
useEffect15(() => {
|
|
8398
8490
|
updateScrollMetrics();
|
|
8399
8491
|
});
|
|
8400
8492
|
const orderedColumns = useMemo9(() => sortTableColumnsByFixed(pipeline.columns), [pipeline.columns]);
|
|
8401
8493
|
const leafColumns = useMemo9(() => flattenTableColumns(orderedColumns), [orderedColumns]);
|
|
8402
8494
|
const headerRows = useMemo9(() => buildHeaderRows(orderedColumns), [orderedColumns]);
|
|
8403
|
-
const measuredCells =
|
|
8495
|
+
const measuredCells = useRef19(/* @__PURE__ */ new WeakSet());
|
|
8404
8496
|
const autoWidthSignature = leafColumns.map((column) => `${column.key}:${column.autoWidth}:${resizedWidths[column.key] ?? ""}`).join("|");
|
|
8405
|
-
|
|
8497
|
+
useEffect15(() => {
|
|
8406
8498
|
measuredCells.current = /* @__PURE__ */ new WeakSet();
|
|
8407
8499
|
setAutoColumnWidths({});
|
|
8408
8500
|
}, [dataSource, baseColumns, size, autoWidthSignature]);
|
|
8409
|
-
|
|
8501
|
+
useEffect15(() => {
|
|
8410
8502
|
const autoWidthColumns = leafColumns.filter((column) => column.autoWidth && resizedWidths[column.key] === void 0);
|
|
8411
8503
|
const root = rootRef.current;
|
|
8412
8504
|
if (!root || autoWidthColumns.length === 0) return;
|
|
@@ -8943,7 +9035,7 @@ function applySiaTheme(mode, target = document.documentElement) {
|
|
|
8943
9035
|
}
|
|
8944
9036
|
|
|
8945
9037
|
// src/components/InputSelect.tsx
|
|
8946
|
-
import { forwardRef as forwardRef7, useEffect as
|
|
9038
|
+
import { forwardRef as forwardRef7, useEffect as useEffect16, useRef as useRef20, useState as useState22 } from "react";
|
|
8947
9039
|
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
8948
9040
|
var InputSelect = forwardRef7(function InputSelect2({
|
|
8949
9041
|
options,
|
|
@@ -8976,7 +9068,7 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
8976
9068
|
const values = current == null ? [] : Array.isArray(current) ? current : [current];
|
|
8977
9069
|
const text = values.map((item) => displayField === "label" ? String(options.find((option) => option.optionType !== "divider" && option.value === item)?.label ?? item) : String(item)).join(",");
|
|
8978
9070
|
const [draft, setDraft] = useState22(text);
|
|
8979
|
-
|
|
9071
|
+
useEffect16(() => {
|
|
8980
9072
|
setDraft(text);
|
|
8981
9073
|
}, [text, current]);
|
|
8982
9074
|
const [open, setOpen] = useState22(false);
|
|
@@ -8984,9 +9076,9 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
8984
9076
|
const [modalOpen, setModalOpen] = useState22(false);
|
|
8985
9077
|
const [modalValues, setModalValues] = useState22([]);
|
|
8986
9078
|
const [selectedOnly, setSelectedOnly] = useState22(false);
|
|
8987
|
-
const rootRef =
|
|
8988
|
-
const popupRef =
|
|
8989
|
-
const inputRef =
|
|
9079
|
+
const rootRef = useRef20(null);
|
|
9080
|
+
const popupRef = useRef20(null);
|
|
9081
|
+
const inputRef = useRef20(null);
|
|
8990
9082
|
const config = typeof enableModal === "object" ? enableModal : {};
|
|
8991
9083
|
function changeOpen(next) {
|
|
8992
9084
|
if (next && (disabled || loading)) return;
|
|
@@ -9006,7 +9098,7 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
9006
9098
|
inputRef.current?.focus();
|
|
9007
9099
|
}
|
|
9008
9100
|
}
|
|
9009
|
-
|
|
9101
|
+
useEffect16(() => {
|
|
9010
9102
|
if (!open) return;
|
|
9011
9103
|
const outside = (event) => {
|
|
9012
9104
|
if (!rootRef.current?.contains(event.target) && !popupRef.current?.contains(event.target)) changeOpen(false);
|
|
@@ -9014,7 +9106,7 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
9014
9106
|
document.addEventListener("pointerdown", outside);
|
|
9015
9107
|
return () => document.removeEventListener("pointerdown", outside);
|
|
9016
9108
|
}, [open, onOpenChange]);
|
|
9017
|
-
|
|
9109
|
+
useEffect16(() => {
|
|
9018
9110
|
if (disabled || loading) {
|
|
9019
9111
|
changeOpen(false);
|
|
9020
9112
|
setModalOpen(false);
|
|
@@ -9147,13 +9239,13 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
9147
9239
|
});
|
|
9148
9240
|
|
|
9149
9241
|
// src/components/QueryForm.tsx
|
|
9150
|
-
import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as
|
|
9242
|
+
import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect7, useRef as useRef23, useState as useState25 } from "react";
|
|
9151
9243
|
|
|
9152
9244
|
// src/components/QueryFormSettings.tsx
|
|
9153
|
-
import { useEffect as
|
|
9245
|
+
import { useEffect as useEffect18, useRef as useRef22, useState as useState24 } from "react";
|
|
9154
9246
|
|
|
9155
9247
|
// src/components/useQueryFieldSort.ts
|
|
9156
|
-
import { useEffect as
|
|
9248
|
+
import { useEffect as useEffect17, useRef as useRef21, useState as useState23 } from "react";
|
|
9157
9249
|
function getQuerySortPreview(keys, rects, from, dy, gap) {
|
|
9158
9250
|
const center = rects[from].top + rects[from].height / 2 + dy;
|
|
9159
9251
|
const rest = keys.map((_, index) => index).filter((index) => index !== from);
|
|
@@ -9172,13 +9264,13 @@ function getQuerySortPreview(keys, rects, from, dy, gap) {
|
|
|
9172
9264
|
return { ordered, offsets };
|
|
9173
9265
|
}
|
|
9174
9266
|
function useQueryFieldSort(keys, enabled, onCommit) {
|
|
9175
|
-
const listRef =
|
|
9176
|
-
const cancelRef =
|
|
9177
|
-
const commitRef =
|
|
9267
|
+
const listRef = useRef21(null);
|
|
9268
|
+
const cancelRef = useRef21();
|
|
9269
|
+
const commitRef = useRef21(onCommit);
|
|
9178
9270
|
commitRef.current = onCommit;
|
|
9179
9271
|
const [preview, setPreview] = useState23();
|
|
9180
9272
|
const signature = JSON.stringify(keys);
|
|
9181
|
-
|
|
9273
|
+
useEffect17(() => {
|
|
9182
9274
|
cancelRef.current?.();
|
|
9183
9275
|
return () => cancelRef.current?.();
|
|
9184
9276
|
}, [enabled, signature]);
|
|
@@ -9310,9 +9402,9 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
9310
9402
|
const [saving, setSaving] = useState24(false);
|
|
9311
9403
|
const [error, setError] = useState24("");
|
|
9312
9404
|
const [loadFailed, setLoadFailed] = useState24(false);
|
|
9313
|
-
const token =
|
|
9314
|
-
const saveLock =
|
|
9315
|
-
const latest =
|
|
9405
|
+
const token = useRef22(0);
|
|
9406
|
+
const saveLock = useRef22(false);
|
|
9407
|
+
const latest = useRef22({ config, fields, defaultCollapsed, applyCollapsed });
|
|
9316
9408
|
latest.current = { config, fields, defaultCollapsed, applyCollapsed };
|
|
9317
9409
|
const moduleName = config?.scope.moduleName;
|
|
9318
9410
|
const businessKey = config?.scope.businessKey;
|
|
@@ -9340,7 +9432,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
9340
9432
|
if (request === token.current) setLoading(false);
|
|
9341
9433
|
}
|
|
9342
9434
|
}
|
|
9343
|
-
|
|
9435
|
+
useEffect18(() => {
|
|
9344
9436
|
setSnapshot(void 0);
|
|
9345
9437
|
setOpen(false);
|
|
9346
9438
|
setError("");
|
|
@@ -9510,11 +9602,11 @@ function QueryForm({
|
|
|
9510
9602
|
const [saveError, setSaveError] = useState25("");
|
|
9511
9603
|
const [error, setError] = useState25("");
|
|
9512
9604
|
const [activeShortcut, setActiveShortcut] = useState25("");
|
|
9513
|
-
const source =
|
|
9514
|
-
const searchLock =
|
|
9515
|
-
const saveLock =
|
|
9516
|
-
const removeLock =
|
|
9517
|
-
const snapshot =
|
|
9605
|
+
const source = useRef23({ source: "submit" });
|
|
9606
|
+
const searchLock = useRef23(false);
|
|
9607
|
+
const saveLock = useRef23(false);
|
|
9608
|
+
const removeLock = useRef23(false);
|
|
9609
|
+
const snapshot = useRef23();
|
|
9518
9610
|
const busy = disabled || loading || searching;
|
|
9519
9611
|
const shortcutBusy = busy || shortcutsLoading || saving || removing;
|
|
9520
9612
|
const fieldLabel = (content) => {
|
|
@@ -9541,12 +9633,12 @@ function QueryForm({
|
|
|
9541
9633
|
const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
|
|
9542
9634
|
const layoutKey = JSON.stringify(configured);
|
|
9543
9635
|
const limit = Math.max(1, Math.floor(collapsedCount));
|
|
9544
|
-
const rowRef =
|
|
9545
|
-
const actionsRef =
|
|
9546
|
-
const toggleRef =
|
|
9636
|
+
const rowRef = useRef23(null);
|
|
9637
|
+
const actionsRef = useRef23(null);
|
|
9638
|
+
const toggleRef = useRef23(null);
|
|
9547
9639
|
const [fittingCount, setFittingCount] = useState25(limit);
|
|
9548
9640
|
const [settingsRows, setSettingsRows] = useState25(0);
|
|
9549
|
-
|
|
9641
|
+
useLayoutEffect7(() => {
|
|
9550
9642
|
const row = rowRef.current;
|
|
9551
9643
|
const actions = actionsRef.current;
|
|
9552
9644
|
if (!row || !actions) return;
|