@sia.soul/sia-react-ui 0.1.124 → 0.1.125
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/{chunk-ZNUTLBDL.js → chunk-33FOEIXI.js} +4 -2
- package/dist/{chunk-5PC3YO7N.js → chunk-B333SUKG.js} +2 -2
- package/dist/{chunk-2GQG4ASH.js → chunk-D3CROVS2.js} +1 -1
- package/dist/{chunk-HQ3PUJLM.js → chunk-OYBMDSTC.js} +3 -3
- package/dist/{chunk-ZALDJYXM.js → chunk-PUNKAJBB.js} +2 -2
- package/dist/{chunk-Y3PGICI6.js → chunk-WA3LO3LY.js} +2 -2
- package/dist/core.cjs +4 -2
- package/dist/core.js +4 -4
- package/dist/game.cjs +4 -2
- package/dist/game.js +1 -1
- package/dist/index.cjs +46 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +130 -91
- package/dist/rich-text-editor.cjs +4 -2
- package/dist/rich-text-editor.js +3 -3
- package/dist/select-date-range.cjs +4 -2
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
|
@@ -417,7 +417,8 @@ var extendedIconPaths = {
|
|
|
417
417
|
/* @__PURE__ */ jsx("rect", { x: "3", y: "14", width: "7", height: "7", rx: "2" }),
|
|
418
418
|
/* @__PURE__ */ jsx("rect", { x: "14", y: "14", width: "7", height: "7", rx: "2" })
|
|
419
419
|
] }),
|
|
420
|
-
|
|
420
|
+
/** 扩展与插件:圆角拼图轮廓,顶部及右侧凸出接口,左侧内凹接口。 */
|
|
421
|
+
puzzle: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("path", { d: "M9 6V5a2 2 0 0 1 4 0v1h3a2 2 0 0 1 2 2v2h1a2 2 0 0 1 0 4h-1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4h1a2 2 0 0 0 0-4H4V8a2 2 0 0 1 2-2h3Z" }) }),
|
|
421
422
|
partition: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
422
423
|
/* @__PURE__ */ jsx("path", { d: "M12 5v5M6 14v-2h12v2M6 18v3M12 18v3M18 18v3" }),
|
|
423
424
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "3", r: "2" }),
|
|
@@ -706,7 +707,8 @@ var outlineIconBounds = {
|
|
|
706
707
|
"plus": [4, 4, 16, 16],
|
|
707
708
|
"power": [4, 3, 16.000002, 16.744997],
|
|
708
709
|
"printer": [4, 3, 16, 18],
|
|
709
|
-
|
|
710
|
+
// 拼图轮廓横向从 4 到 21,纵向从 3 到 21,与图形归一化范围一致。
|
|
711
|
+
"puzzle": [4, 3, 17, 18],
|
|
710
712
|
"qr-code": [3, 3, 18, 18],
|
|
711
713
|
"question": [3, 3, 18, 18],
|
|
712
714
|
"redo": [4, 7, 17, 12],
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover,
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WA3LO3LY.js";
|
|
5
5
|
import {
|
|
6
6
|
Dropdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-D3CROVS2.js";
|
|
8
8
|
import {
|
|
9
9
|
TextArea
|
|
10
10
|
} from "./chunk-SCEHVGKV.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon,
|
|
13
13
|
useOverlayLifecycle
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-33FOEIXI.js";
|
|
15
15
|
import {
|
|
16
16
|
Button
|
|
17
17
|
} from "./chunk-CZ2ITBRW.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FloatingScrollbarProvider,
|
|
3
3
|
Select
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WA3LO3LY.js";
|
|
5
5
|
import {
|
|
6
6
|
Icon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-33FOEIXI.js";
|
|
8
8
|
import {
|
|
9
9
|
useFloatingPlaceholder
|
|
10
10
|
} from "./chunk-KY6A5IJH.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Dropdown,
|
|
3
3
|
Input
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-D3CROVS2.js";
|
|
5
5
|
import {
|
|
6
6
|
Icon,
|
|
7
7
|
Modal,
|
|
8
8
|
isAnchorBehindOverlay,
|
|
9
9
|
subscribeOverlayLayers
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-33FOEIXI.js";
|
|
11
11
|
import {
|
|
12
12
|
Button
|
|
13
13
|
} from "./chunk-CZ2ITBRW.js";
|
package/dist/core.cjs
CHANGED
|
@@ -801,7 +801,8 @@ var extendedIconPaths = {
|
|
|
801
801
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "3", y: "14", width: "7", height: "7", rx: "2" }),
|
|
802
802
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "14", y: "14", width: "7", height: "7", rx: "2" })
|
|
803
803
|
] }),
|
|
804
|
-
|
|
804
|
+
/** 扩展与插件:圆角拼图轮廓,顶部及右侧凸出接口,左侧内凹接口。 */
|
|
805
|
+
puzzle: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9 6V5a2 2 0 0 1 4 0v1h3a2 2 0 0 1 2 2v2h1a2 2 0 0 1 0 4h-1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4h1a2 2 0 0 0 0-4H4V8a2 2 0 0 1 2-2h3Z" }) }),
|
|
805
806
|
partition: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
806
807
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 5v5M6 14v-2h12v2M6 18v3M12 18v3M18 18v3" }),
|
|
807
808
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "3", r: "2" }),
|
|
@@ -1090,7 +1091,8 @@ var outlineIconBounds = {
|
|
|
1090
1091
|
"plus": [4, 4, 16, 16],
|
|
1091
1092
|
"power": [4, 3, 16.000002, 16.744997],
|
|
1092
1093
|
"printer": [4, 3, 16, 18],
|
|
1093
|
-
|
|
1094
|
+
// 拼图轮廓横向从 4 到 21,纵向从 3 到 21,与图形归一化范围一致。
|
|
1095
|
+
"puzzle": [4, 3, 17, 18],
|
|
1094
1096
|
"qr-code": [3, 3, 18, 18],
|
|
1095
1097
|
"question": [3, 3, 18, 18],
|
|
1096
1098
|
"redo": [4, 7, 17, 12],
|
package/dist/core.js
CHANGED
|
@@ -11,20 +11,20 @@ import {
|
|
|
11
11
|
Typography,
|
|
12
12
|
Upload,
|
|
13
13
|
message
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OYBMDSTC.js";
|
|
15
15
|
import "./chunk-RX242MUO.js";
|
|
16
16
|
import {
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WA3LO3LY.js";
|
|
19
19
|
import {
|
|
20
20
|
Input,
|
|
21
21
|
Segmented
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-D3CROVS2.js";
|
|
23
23
|
import "./chunk-SCEHVGKV.js";
|
|
24
24
|
import {
|
|
25
25
|
Icon,
|
|
26
26
|
Modal
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-33FOEIXI.js";
|
|
28
28
|
import {
|
|
29
29
|
Button
|
|
30
30
|
} from "./chunk-CZ2ITBRW.js";
|
package/dist/game.cjs
CHANGED
|
@@ -1503,7 +1503,8 @@ var extendedIconPaths = {
|
|
|
1503
1503
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { x: "3", y: "14", width: "7", height: "7", rx: "2" }),
|
|
1504
1504
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { x: "14", y: "14", width: "7", height: "7", rx: "2" })
|
|
1505
1505
|
] }),
|
|
1506
|
-
|
|
1506
|
+
/** 扩展与插件:圆角拼图轮廓,顶部及右侧凸出接口,左侧内凹接口。 */
|
|
1507
|
+
puzzle: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M9 6V5a2 2 0 0 1 4 0v1h3a2 2 0 0 1 2 2v2h1a2 2 0 0 1 0 4h-1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4h1a2 2 0 0 0 0-4H4V8a2 2 0 0 1 2-2h3Z" }) }),
|
|
1507
1508
|
partition: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
1508
1509
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 5v5M6 14v-2h12v2M6 18v3M12 18v3M18 18v3" }),
|
|
1509
1510
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "3", r: "2" }),
|
|
@@ -1792,7 +1793,8 @@ var outlineIconBounds = {
|
|
|
1792
1793
|
"plus": [4, 4, 16, 16],
|
|
1793
1794
|
"power": [4, 3, 16.000002, 16.744997],
|
|
1794
1795
|
"printer": [4, 3, 16, 18],
|
|
1795
|
-
|
|
1796
|
+
// 拼图轮廓横向从 4 到 21,纵向从 3 到 21,与图形归一化范围一致。
|
|
1797
|
+
"puzzle": [4, 3, 17, 18],
|
|
1796
1798
|
"qr-code": [3, 3, 18, 18],
|
|
1797
1799
|
"question": [3, 3, 18, 18],
|
|
1798
1800
|
"redo": [4, 7, 17, 12],
|
package/dist/game.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -875,7 +875,8 @@ var extendedIconPaths = {
|
|
|
875
875
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { x: "3", y: "14", width: "7", height: "7", rx: "2" }),
|
|
876
876
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { x: "14", y: "14", width: "7", height: "7", rx: "2" })
|
|
877
877
|
] }),
|
|
878
|
-
|
|
878
|
+
/** 扩展与插件:圆角拼图轮廓,顶部及右侧凸出接口,左侧内凹接口。 */
|
|
879
|
+
puzzle: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M9 6V5a2 2 0 0 1 4 0v1h3a2 2 0 0 1 2 2v2h1a2 2 0 0 1 0 4h-1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4h1a2 2 0 0 0 0-4H4V8a2 2 0 0 1 2-2h3Z" }) }),
|
|
879
880
|
partition: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
880
881
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M12 5v5M6 14v-2h12v2M6 18v3M12 18v3M18 18v3" }),
|
|
881
882
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "12", cy: "3", r: "2" }),
|
|
@@ -1164,7 +1165,8 @@ var outlineIconBounds = {
|
|
|
1164
1165
|
"plus": [4, 4, 16, 16],
|
|
1165
1166
|
"power": [4, 3, 16.000002, 16.744997],
|
|
1166
1167
|
"printer": [4, 3, 16, 18],
|
|
1167
|
-
|
|
1168
|
+
// 拼图轮廓横向从 4 到 21,纵向从 3 到 21,与图形归一化范围一致。
|
|
1169
|
+
"puzzle": [4, 3, 17, 18],
|
|
1168
1170
|
"qr-code": [3, 3, 18, 18],
|
|
1169
1171
|
"question": [3, 3, 18, 18],
|
|
1170
1172
|
"redo": [4, 7, 17, 12],
|
|
@@ -7596,6 +7598,8 @@ function FormItem({
|
|
|
7596
7598
|
const form = (0, import_react34.useContext)(FormContext);
|
|
7597
7599
|
const id = (0, import_react34.useId)();
|
|
7598
7600
|
const itemRef = (0, import_react34.useRef)(null);
|
|
7601
|
+
const errorContentRef = (0, import_react34.useRef)(null);
|
|
7602
|
+
const [errorPlacement, setErrorPlacement] = (0, import_react34.useState)("bottom-start");
|
|
7599
7603
|
if (!form) throw new Error("Form.Item \u5FC5\u987B\u5728 Form \u5185\u4F7F\u7528");
|
|
7600
7604
|
(0, import_react34.useSyncExternalStore)(form.subscribe, form.getSnapshot, form.getSnapshot);
|
|
7601
7605
|
const path = name === void 0 ? void 0 : pathArray(name);
|
|
@@ -7606,6 +7610,44 @@ function FormItem({
|
|
|
7606
7610
|
const helpContent = help ?? errors[0];
|
|
7607
7611
|
const labelId = label && !noStyle ? `${id}-label` : void 0;
|
|
7608
7612
|
const errorId = `${id}-error`;
|
|
7613
|
+
const hasError = status === "error" && Boolean(helpContent);
|
|
7614
|
+
(0, import_react34.useEffect)(() => {
|
|
7615
|
+
setErrorPlacement("bottom-start");
|
|
7616
|
+
if (!hasError || noStyle) return void 0;
|
|
7617
|
+
const doc = itemRef.current?.ownerDocument;
|
|
7618
|
+
const view = doc?.defaultView;
|
|
7619
|
+
if (!doc || !view) return void 0;
|
|
7620
|
+
let frame = 0;
|
|
7621
|
+
let point;
|
|
7622
|
+
const measure = () => {
|
|
7623
|
+
frame = 0;
|
|
7624
|
+
const overlay = errorContentRef.current?.closest(".sia-form-item__error-popover");
|
|
7625
|
+
const bounds = overlay?.getBoundingClientRect();
|
|
7626
|
+
if (point && bounds && point.x >= bounds.left && point.x <= bounds.right && point.y >= bounds.top && point.y <= bounds.bottom) setErrorPlacement("top-start");
|
|
7627
|
+
};
|
|
7628
|
+
const schedule = () => {
|
|
7629
|
+
if (!frame) frame = view.requestAnimationFrame(measure);
|
|
7630
|
+
};
|
|
7631
|
+
const move = (event) => {
|
|
7632
|
+
point = { x: event.clientX, y: event.clientY };
|
|
7633
|
+
schedule();
|
|
7634
|
+
};
|
|
7635
|
+
const leave = () => {
|
|
7636
|
+
point = void 0;
|
|
7637
|
+
schedule();
|
|
7638
|
+
};
|
|
7639
|
+
doc.addEventListener("pointermove", move, { passive: true });
|
|
7640
|
+
doc.addEventListener("pointerleave", leave);
|
|
7641
|
+
doc.addEventListener("scroll", schedule, true);
|
|
7642
|
+
view.addEventListener("blur", leave);
|
|
7643
|
+
return () => {
|
|
7644
|
+
view.cancelAnimationFrame(frame);
|
|
7645
|
+
doc.removeEventListener("pointermove", move);
|
|
7646
|
+
doc.removeEventListener("pointerleave", leave);
|
|
7647
|
+
doc.removeEventListener("scroll", schedule, true);
|
|
7648
|
+
view.removeEventListener("blur", leave);
|
|
7649
|
+
};
|
|
7650
|
+
}, [hasError, noStyle, helpContent]);
|
|
7609
7651
|
(0, import_react34.useEffect)(() => {
|
|
7610
7652
|
if (!path) return void 0;
|
|
7611
7653
|
return form.registerField({
|
|
@@ -7651,7 +7693,6 @@ function FormItem({
|
|
|
7651
7693
|
}
|
|
7652
7694
|
if (noStyle) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: content });
|
|
7653
7695
|
const inputWrap = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "sia-form-item__input-wrap", children: content });
|
|
7654
|
-
const hasError = status === "error" && Boolean(helpContent);
|
|
7655
7696
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("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: [
|
|
7656
7697
|
label ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { id: labelId, className: "sia-form-item__label", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "sia-form-item__label-content", children: [
|
|
7657
7698
|
ruleRequired ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sia-form-item__required-mark", "aria-hidden": "true", children: "*" }) : null,
|
|
@@ -7661,11 +7702,11 @@ function FormItem({
|
|
|
7661
7702
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
7662
7703
|
Tooltip,
|
|
7663
7704
|
{
|
|
7664
|
-
title: hasError ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { id: errorId, className: "sia-form-item__error-content", children: [
|
|
7705
|
+
title: hasError ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { ref: errorContentRef, id: errorId, className: "sia-form-item__error-content", children: [
|
|
7665
7706
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { className: "sia-form-item__error-icon", name: "circle-close", variant: "filled", size: 16, "aria-hidden": "true" }),
|
|
7666
7707
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: helpContent })
|
|
7667
7708
|
] }) : null,
|
|
7668
|
-
placement:
|
|
7709
|
+
placement: errorPlacement,
|
|
7669
7710
|
trigger: [],
|
|
7670
7711
|
open: hasError,
|
|
7671
7712
|
role: "alert",
|
package/dist/index.d.cts
CHANGED
|
@@ -868,7 +868,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
868
868
|
onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
|
|
869
869
|
}
|
|
870
870
|
declare function FormRoot({ fill, form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
871
|
-
/**
|
|
871
|
+
/** 表单项的字段绑定、标签、校验及内容配置;错误气泡不占布局空间,默认在下方,鼠标进入气泡区域后移到上方。默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
|
|
872
872
|
interface FormItemProps {
|
|
873
873
|
/** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
|
|
874
874
|
name?: NamePath;
|
|
@@ -887,7 +887,7 @@ interface FormItemProps {
|
|
|
887
887
|
required?: boolean;
|
|
888
888
|
/** 主体之外的补充内容或操作区。 */
|
|
889
889
|
extra?: ReactNode;
|
|
890
|
-
/**
|
|
890
|
+
/** 字段下方的辅助说明或校验提示;错误气泡默认位于下方,鼠标进入后改为上方并保持,错误变化后恢复默认位置。视口空间不足时沿用浮层防溢出规则。 */
|
|
891
891
|
help?: ReactNode;
|
|
892
892
|
/** 手动指定字段校验状态。 */
|
|
893
893
|
validateStatus?: "success" | "warning" | "error" | "validating";
|
package/dist/index.d.ts
CHANGED
|
@@ -868,7 +868,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
868
868
|
onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
|
|
869
869
|
}
|
|
870
870
|
declare function FormRoot({ fill, form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
871
|
-
/**
|
|
871
|
+
/** 表单项的字段绑定、标签、校验及内容配置;错误气泡不占布局空间,默认在下方,鼠标进入气泡区域后移到上方。默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
|
|
872
872
|
interface FormItemProps {
|
|
873
873
|
/** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
|
|
874
874
|
name?: NamePath;
|
|
@@ -887,7 +887,7 @@ interface FormItemProps {
|
|
|
887
887
|
required?: boolean;
|
|
888
888
|
/** 主体之外的补充内容或操作区。 */
|
|
889
889
|
extra?: ReactNode;
|
|
890
|
-
/**
|
|
890
|
+
/** 字段下方的辅助说明或校验提示;错误气泡默认位于下方,鼠标进入后改为上方并保持,错误变化后恢复默认位置。视口空间不足时沿用浮层防溢出规则。 */
|
|
891
891
|
help?: ReactNode;
|
|
892
892
|
/** 手动指定字段校验状态。 */
|
|
893
893
|
validateStatus?: "success" | "warning" | "error" | "validating";
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
Watermark,
|
|
83
83
|
message,
|
|
84
84
|
notification
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-OYBMDSTC.js";
|
|
86
86
|
import "./chunk-RX242MUO.js";
|
|
87
87
|
import {
|
|
88
88
|
MarkdownEditor
|
|
@@ -90,12 +90,12 @@ import {
|
|
|
90
90
|
import {
|
|
91
91
|
RichTextContent,
|
|
92
92
|
RichTextEditor
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-B333SUKG.js";
|
|
94
94
|
import {
|
|
95
95
|
DatePicker,
|
|
96
96
|
SelectDateRange,
|
|
97
97
|
TimePanel
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-PUNKAJBB.js";
|
|
99
99
|
import {
|
|
100
100
|
Checkbox,
|
|
101
101
|
FloatingScrollbarProvider,
|
|
@@ -107,14 +107,14 @@ import {
|
|
|
107
107
|
Tooltip,
|
|
108
108
|
Tree,
|
|
109
109
|
useScrollbarProximity
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-WA3LO3LY.js";
|
|
111
111
|
import {
|
|
112
112
|
Dropdown,
|
|
113
113
|
Input,
|
|
114
114
|
Menu,
|
|
115
115
|
Segmented,
|
|
116
116
|
Steps
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-D3CROVS2.js";
|
|
118
118
|
import {
|
|
119
119
|
TextArea
|
|
120
120
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
Modal,
|
|
126
126
|
OverlayPortal,
|
|
127
127
|
useOverlayLifecycle
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-33FOEIXI.js";
|
|
129
129
|
import {
|
|
130
130
|
Button
|
|
131
131
|
} from "./chunk-CZ2ITBRW.js";
|
|
@@ -1695,7 +1695,7 @@ var Drawer2 = Object.assign(DrawerRoot, {
|
|
|
1695
1695
|
});
|
|
1696
1696
|
|
|
1697
1697
|
// src/components/Form.tsx
|
|
1698
|
-
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";
|
|
1698
|
+
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, useState as useState9, useSyncExternalStore } from "react";
|
|
1699
1699
|
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1700
1700
|
var Switch = forwardRef2(function Switch2({
|
|
1701
1701
|
label,
|
|
@@ -2059,6 +2059,8 @@ function FormItem({
|
|
|
2059
2059
|
const form = useContext2(FormContext);
|
|
2060
2060
|
const id = useId3();
|
|
2061
2061
|
const itemRef = useRef8(null);
|
|
2062
|
+
const errorContentRef = useRef8(null);
|
|
2063
|
+
const [errorPlacement, setErrorPlacement] = useState9("bottom-start");
|
|
2062
2064
|
if (!form) throw new Error("Form.Item \u5FC5\u987B\u5728 Form \u5185\u4F7F\u7528");
|
|
2063
2065
|
useSyncExternalStore(form.subscribe, form.getSnapshot, form.getSnapshot);
|
|
2064
2066
|
const path = name === void 0 ? void 0 : pathArray(name);
|
|
@@ -2069,6 +2071,44 @@ function FormItem({
|
|
|
2069
2071
|
const helpContent = help ?? errors[0];
|
|
2070
2072
|
const labelId = label && !noStyle ? `${id}-label` : void 0;
|
|
2071
2073
|
const errorId = `${id}-error`;
|
|
2074
|
+
const hasError = status === "error" && Boolean(helpContent);
|
|
2075
|
+
useEffect6(() => {
|
|
2076
|
+
setErrorPlacement("bottom-start");
|
|
2077
|
+
if (!hasError || noStyle) return void 0;
|
|
2078
|
+
const doc = itemRef.current?.ownerDocument;
|
|
2079
|
+
const view = doc?.defaultView;
|
|
2080
|
+
if (!doc || !view) return void 0;
|
|
2081
|
+
let frame = 0;
|
|
2082
|
+
let point;
|
|
2083
|
+
const measure = () => {
|
|
2084
|
+
frame = 0;
|
|
2085
|
+
const overlay = errorContentRef.current?.closest(".sia-form-item__error-popover");
|
|
2086
|
+
const bounds = overlay?.getBoundingClientRect();
|
|
2087
|
+
if (point && bounds && point.x >= bounds.left && point.x <= bounds.right && point.y >= bounds.top && point.y <= bounds.bottom) setErrorPlacement("top-start");
|
|
2088
|
+
};
|
|
2089
|
+
const schedule = () => {
|
|
2090
|
+
if (!frame) frame = view.requestAnimationFrame(measure);
|
|
2091
|
+
};
|
|
2092
|
+
const move = (event) => {
|
|
2093
|
+
point = { x: event.clientX, y: event.clientY };
|
|
2094
|
+
schedule();
|
|
2095
|
+
};
|
|
2096
|
+
const leave = () => {
|
|
2097
|
+
point = void 0;
|
|
2098
|
+
schedule();
|
|
2099
|
+
};
|
|
2100
|
+
doc.addEventListener("pointermove", move, { passive: true });
|
|
2101
|
+
doc.addEventListener("pointerleave", leave);
|
|
2102
|
+
doc.addEventListener("scroll", schedule, true);
|
|
2103
|
+
view.addEventListener("blur", leave);
|
|
2104
|
+
return () => {
|
|
2105
|
+
view.cancelAnimationFrame(frame);
|
|
2106
|
+
doc.removeEventListener("pointermove", move);
|
|
2107
|
+
doc.removeEventListener("pointerleave", leave);
|
|
2108
|
+
doc.removeEventListener("scroll", schedule, true);
|
|
2109
|
+
view.removeEventListener("blur", leave);
|
|
2110
|
+
};
|
|
2111
|
+
}, [hasError, noStyle, helpContent]);
|
|
2072
2112
|
useEffect6(() => {
|
|
2073
2113
|
if (!path) return void 0;
|
|
2074
2114
|
return form.registerField({
|
|
@@ -2114,7 +2154,6 @@ function FormItem({
|
|
|
2114
2154
|
}
|
|
2115
2155
|
if (noStyle) return /* @__PURE__ */ jsx11(Fragment4, { children: content });
|
|
2116
2156
|
const inputWrap = /* @__PURE__ */ jsx11("div", { className: "sia-form-item__input-wrap", children: content });
|
|
2117
|
-
const hasError = status === "error" && Boolean(helpContent);
|
|
2118
2157
|
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: [
|
|
2119
2158
|
label ? /* @__PURE__ */ jsx11("div", { id: labelId, className: "sia-form-item__label", children: /* @__PURE__ */ jsxs11("span", { className: "sia-form-item__label-content", children: [
|
|
2120
2159
|
ruleRequired ? /* @__PURE__ */ jsx11("span", { className: "sia-form-item__required-mark", "aria-hidden": "true", children: "*" }) : null,
|
|
@@ -2124,11 +2163,11 @@ function FormItem({
|
|
|
2124
2163
|
/* @__PURE__ */ jsx11(
|
|
2125
2164
|
Tooltip,
|
|
2126
2165
|
{
|
|
2127
|
-
title: hasError ? /* @__PURE__ */ jsxs11("span", { id: errorId, className: "sia-form-item__error-content", children: [
|
|
2166
|
+
title: hasError ? /* @__PURE__ */ jsxs11("span", { ref: errorContentRef, id: errorId, className: "sia-form-item__error-content", children: [
|
|
2128
2167
|
/* @__PURE__ */ jsx11(Icon, { className: "sia-form-item__error-icon", name: "circle-close", variant: "filled", size: 16, "aria-hidden": "true" }),
|
|
2129
2168
|
/* @__PURE__ */ jsx11("span", { children: helpContent })
|
|
2130
2169
|
] }) : null,
|
|
2131
|
-
placement:
|
|
2170
|
+
placement: errorPlacement,
|
|
2132
2171
|
trigger: [],
|
|
2133
2172
|
open: hasError,
|
|
2134
2173
|
role: "alert",
|
|
@@ -2264,7 +2303,7 @@ var Radio2 = Object.assign(RadioRoot, {
|
|
|
2264
2303
|
});
|
|
2265
2304
|
|
|
2266
2305
|
// src/components/Slider.tsx
|
|
2267
|
-
import { useState as
|
|
2306
|
+
import { useState as useState10 } from "react";
|
|
2268
2307
|
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2269
2308
|
function percent(value, min, max) {
|
|
2270
2309
|
return (value - min) / (max - min) * 100;
|
|
@@ -2288,7 +2327,7 @@ function Slider({
|
|
|
2288
2327
|
}) {
|
|
2289
2328
|
const fallback = defaultValue ?? (range ? [min, max] : min);
|
|
2290
2329
|
const [currentValue, setValue2] = useControllableState({ value, defaultValue: fallback, onChange });
|
|
2291
|
-
const [activeThumb, setActiveThumb] =
|
|
2330
|
+
const [activeThumb, setActiveThumb] = useState10(null);
|
|
2292
2331
|
const values = Array.isArray(currentValue) ? [...currentValue] : [currentValue];
|
|
2293
2332
|
const start = range ? percent(Math.min(values[0], values[1]), min, max) : 0;
|
|
2294
2333
|
const end = percent(range ? Math.max(values[0], values[1]) : values[0], min, max);
|
|
@@ -2385,7 +2424,7 @@ function Slider({
|
|
|
2385
2424
|
}
|
|
2386
2425
|
|
|
2387
2426
|
// src/components/ColorPicker.tsx
|
|
2388
|
-
import { useEffect as useEffect7, useRef as useRef9, useState as
|
|
2427
|
+
import { useEffect as useEffect7, useRef as useRef9, useState as useState11 } from "react";
|
|
2389
2428
|
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2390
2429
|
var DEFAULT_MODES = ["solid", "gradient"];
|
|
2391
2430
|
var gradientStopSeed = 0;
|
|
@@ -2481,7 +2520,7 @@ function ColorPicker({
|
|
|
2481
2520
|
const lastEmittedValue = useRef9();
|
|
2482
2521
|
const initialGradient = parseGradient(value ?? defaultValue);
|
|
2483
2522
|
const initialSolid = initialGradient?.stops[0]?.color ?? normalizeHex(value || defaultValue);
|
|
2484
|
-
const [open, setOpen] =
|
|
2523
|
+
const [open, setOpen] = useState11(false);
|
|
2485
2524
|
const [color, setColor] = useControllableState({
|
|
2486
2525
|
value,
|
|
2487
2526
|
defaultValue: initialGradient ? formatGradient(initialGradient.angle, initialGradient.stops.map((stop, index) => ({ id: index, ...stop }))) : normalizeHex(defaultValue),
|
|
@@ -2492,15 +2531,15 @@ function ColorPicker({
|
|
|
2492
2531
|
defaultValue: initialGradient ? "gradient" : defaultMode,
|
|
2493
2532
|
onChange: onModeChange
|
|
2494
2533
|
});
|
|
2495
|
-
const [solidColor, setSolidColor] =
|
|
2496
|
-
const [gradientAngle, setGradientAngle] =
|
|
2497
|
-
const [gradientStops, setGradientStops] =
|
|
2498
|
-
const [activeStopId, setActiveStopId] =
|
|
2534
|
+
const [solidColor, setSolidColor] = useState11(initialSolid);
|
|
2535
|
+
const [gradientAngle, setGradientAngle] = useState11(initialGradient?.angle ?? 90);
|
|
2536
|
+
const [gradientStops, setGradientStops] = useState11(() => initialGradient ? initialGradient.stops.map((stop) => createStop(stop.color, stop.position)) : createDefaultStops(initialSolid));
|
|
2537
|
+
const [activeStopId, setActiveStopId] = useState11(() => gradientStops[0]?.id ?? 0);
|
|
2499
2538
|
const activeStop = gradientStops.find((stop) => stop.id === activeStopId) ?? gradientStops[0];
|
|
2500
2539
|
const editingColor = currentMode === "gradient" ? activeStop?.color ?? solidColor : solidColor;
|
|
2501
2540
|
const rgba = parseHex(editingColor) ?? parseHex("#1677FF");
|
|
2502
2541
|
const hsv = rgbToHsv(rgba);
|
|
2503
|
-
const [hexDraft, setHexDraft] =
|
|
2542
|
+
const [hexDraft, setHexDraft] = useState11(editingColor);
|
|
2504
2543
|
const gradientValue = formatGradient(gradientAngle, gradientStops);
|
|
2505
2544
|
useEffect7(() => {
|
|
2506
2545
|
if (!open) return void 0;
|
|
@@ -2701,7 +2740,7 @@ function ColorPicker({
|
|
|
2701
2740
|
}
|
|
2702
2741
|
|
|
2703
2742
|
// src/components/TimePicker.tsx
|
|
2704
|
-
import { useEffect as useEffect8, useId as useId5, useRef as useRef10, useState as
|
|
2743
|
+
import { useEffect as useEffect8, useId as useId5, useRef as useRef10, useState as useState12 } from "react";
|
|
2705
2744
|
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2706
2745
|
function seconds(value) {
|
|
2707
2746
|
const [h = 0, m = 0, s = 0] = value.split(":").map(Number);
|
|
@@ -2737,8 +2776,8 @@ function TimePicker({
|
|
|
2737
2776
|
const popupRef = useRef10(null);
|
|
2738
2777
|
const focusPanel = useRef10(false);
|
|
2739
2778
|
const [currentValue, setValue2] = useControllableState({ value, defaultValue, onChange });
|
|
2740
|
-
const [open, setOpen] =
|
|
2741
|
-
const [draft, setDraft] =
|
|
2779
|
+
const [open, setOpen] = useState12(false);
|
|
2780
|
+
const [draft, setDraft] = useState12("00:00:00");
|
|
2742
2781
|
const normalize = (time) => showSecond ? (time + ":00").slice(0, 8) : time.slice(0, 5);
|
|
2743
2782
|
const unavailable = (time) => {
|
|
2744
2783
|
const normalized = normalize(time);
|
|
@@ -2875,7 +2914,7 @@ function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F0
|
|
|
2875
2914
|
})(TimePicker || (TimePicker = {}));
|
|
2876
2915
|
|
|
2877
2916
|
// src/components/TreeSelect.tsx
|
|
2878
|
-
import { useEffect as useEffect9, useMemo as useMemo6, useRef as useRef11, useState as
|
|
2917
|
+
import { useEffect as useEffect9, useMemo as useMemo6, useRef as useRef11, useState as useState13 } from "react";
|
|
2879
2918
|
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2880
2919
|
function flattenTree(nodes, expanded, search, filter, depth = 0, parents = [], ancestorMatched = false) {
|
|
2881
2920
|
const result = [];
|
|
@@ -2959,7 +2998,7 @@ function TreeSelect({
|
|
|
2959
2998
|
});
|
|
2960
2999
|
const [open, setOpen] = useControllableState({ value: controlledOpen, defaultValue: defaultOpen, onChange: onDropdownVisibleChange });
|
|
2961
3000
|
const [search, setSearch] = useControllableState({ value: searchValue, defaultValue: "", onChange: onSearch });
|
|
2962
|
-
const [expanded, setExpanded] =
|
|
3001
|
+
const [expanded, setExpanded] = useState13(() => {
|
|
2963
3002
|
if (!treeDefaultExpandAll) return new Set(treeDefaultExpandedKeys);
|
|
2964
3003
|
const values = [];
|
|
2965
3004
|
const collect = (nodes) => nodes.forEach((node) => {
|
|
@@ -3194,7 +3233,7 @@ function buildFlatTree(items, options = {}) {
|
|
|
3194
3233
|
}
|
|
3195
3234
|
|
|
3196
3235
|
// src/components/Editor.tsx
|
|
3197
|
-
import { useEffect as useEffect10, useId as useId6, useRef as useRef12, useState as
|
|
3236
|
+
import { useEffect as useEffect10, useId as useId6, useRef as useRef12, useState as useState14 } from "react";
|
|
3198
3237
|
import EditorWorker from "monaco-editor/editor/editor.worker.js?worker";
|
|
3199
3238
|
|
|
3200
3239
|
// src/components/jsonLanguage.ts
|
|
@@ -3891,8 +3930,8 @@ function Editor({
|
|
|
3891
3930
|
const initialPathRef = useRef12(path);
|
|
3892
3931
|
const initialThemeRef = useRef12(theme);
|
|
3893
3932
|
const initialOptionsRef = useRef12(options);
|
|
3894
|
-
const [loading, setLoading] =
|
|
3895
|
-
const [, setSelectionVersion] =
|
|
3933
|
+
const [loading, setLoading] = useState14(true);
|
|
3934
|
+
const [, setSelectionVersion] = useState14(0);
|
|
3896
3935
|
initialValueRef.current = value;
|
|
3897
3936
|
initialLanguageRef.current = language;
|
|
3898
3937
|
initialPathRef.current = path;
|
|
@@ -4428,13 +4467,13 @@ function Editor({
|
|
|
4428
4467
|
}
|
|
4429
4468
|
|
|
4430
4469
|
// src/components/Markdown.tsx
|
|
4431
|
-
import { useEffect as useEffect11, useMemo as useMemo7, useRef as useRef13, useState as
|
|
4470
|
+
import { useEffect as useEffect11, useMemo as useMemo7, useRef as useRef13, useState as useState15 } from "react";
|
|
4432
4471
|
import DOMPurify from "dompurify";
|
|
4433
4472
|
import { marked } from "marked";
|
|
4434
4473
|
import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4435
4474
|
function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", resolveImageSrc, imagePreview = true, className = "", onClick, onKeyDown, ...props }) {
|
|
4436
4475
|
const rootRef = useRef13(null);
|
|
4437
|
-
const [previewImage, setPreviewImage] =
|
|
4476
|
+
const [previewImage, setPreviewImage] = useState15(null);
|
|
4438
4477
|
const html = useMemo7(() => {
|
|
4439
4478
|
const rendered = marked.parse(content, { breaks: true, gfm: true });
|
|
4440
4479
|
const sanitized = DOMPurify.sanitize(rendered, { USE_PROFILES: { html: true } });
|
|
@@ -4508,7 +4547,7 @@ function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", r
|
|
|
4508
4547
|
}
|
|
4509
4548
|
|
|
4510
4549
|
// src/components/InputNumber.tsx
|
|
4511
|
-
import { forwardRef as forwardRef4, useEffect as useEffect12, useId as useId7, useRef as useRef14, useState as
|
|
4550
|
+
import { forwardRef as forwardRef4, useEffect as useEffect12, useId as useId7, useRef as useRef14, useState as useState16 } from "react";
|
|
4512
4551
|
import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4513
4552
|
function formatValue(value, precision) {
|
|
4514
4553
|
if (value === null || !Number.isFinite(value)) return "";
|
|
@@ -4548,7 +4587,7 @@ var InputNumber = forwardRef4(function InputNumber2({
|
|
|
4548
4587
|
const plain = formatValue(next, precision);
|
|
4549
4588
|
return plain && formatter ? formatter(plain) : plain;
|
|
4550
4589
|
};
|
|
4551
|
-
const [text, setText] =
|
|
4590
|
+
const [text, setText] = useState16(() => displayValue(currentValue));
|
|
4552
4591
|
useEffect12(() => {
|
|
4553
4592
|
setText(displayValue(currentValue));
|
|
4554
4593
|
}, [currentValue, precision, formatter]);
|
|
@@ -4655,11 +4694,11 @@ var InputNumber = forwardRef4(function InputNumber2({
|
|
|
4655
4694
|
});
|
|
4656
4695
|
|
|
4657
4696
|
// src/components/SelectModal.tsx
|
|
4658
|
-
import { useState as
|
|
4697
|
+
import { useState as useState17 } from "react";
|
|
4659
4698
|
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4660
4699
|
function SelectModalBody({ config, values, disabled, onChange }) {
|
|
4661
|
-
const [query, setQuery] =
|
|
4662
|
-
const [selectedOnly, setSelectedOnly] =
|
|
4700
|
+
const [query, setQuery] = useState17("");
|
|
4701
|
+
const [selectedOnly, setSelectedOnly] = useState17(false);
|
|
4663
4702
|
const multiple = config.mode === "multiple";
|
|
4664
4703
|
const search = query.trim();
|
|
4665
4704
|
const filtered = config.options.filter((option) => !search || (config.filterOption ? config.filterOption(search, option) : [option.label, option.value].some((text) => String(text ?? "").toLowerCase().includes(search.toLowerCase()))));
|
|
@@ -4784,7 +4823,7 @@ function openSelectModal(config) {
|
|
|
4784
4823
|
}
|
|
4785
4824
|
|
|
4786
4825
|
// src/components/Treemap.tsx
|
|
4787
|
-
import { useEffect as useEffect13, useMemo as useMemo8, useRef as useRef15, useState as
|
|
4826
|
+
import { useEffect as useEffect13, useMemo as useMemo8, useRef as useRef15, useState as useState18 } from "react";
|
|
4788
4827
|
import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4789
4828
|
import { createElement } from "react";
|
|
4790
4829
|
function positiveValue(value) {
|
|
@@ -5158,9 +5197,9 @@ function Treemap({
|
|
|
5158
5197
|
...props
|
|
5159
5198
|
}) {
|
|
5160
5199
|
const containerRef = useRef15(null);
|
|
5161
|
-
const [size, setSize] =
|
|
5162
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
5163
|
-
const [internalFocusedKey, setInternalFocusedKey] =
|
|
5200
|
+
const [size, setSize] = useState18({ width: 0, height: 0 });
|
|
5201
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = useState18(() => [...defaultExpandedKeys]);
|
|
5202
|
+
const [internalFocusedKey, setInternalFocusedKey] = useState18(defaultFocusedKey);
|
|
5164
5203
|
const currentExpandedKeys = expandedKeys ?? internalExpandedKeys;
|
|
5165
5204
|
const currentFocusedKey = focusedKey === void 0 ? internalFocusedKey : focusedKey;
|
|
5166
5205
|
const expandedSet = useMemo8(() => new Set(currentExpandedKeys), [currentExpandedKeys]);
|
|
@@ -5310,7 +5349,7 @@ function Treemap({
|
|
|
5310
5349
|
}
|
|
5311
5350
|
|
|
5312
5351
|
// src/components/Table/TableCellContent.tsx
|
|
5313
|
-
import { useLayoutEffect as useLayoutEffect4, useRef as useRef16, useState as
|
|
5352
|
+
import { useLayoutEffect as useLayoutEffect4, useRef as useRef16, useState as useState19 } from "react";
|
|
5314
5353
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5315
5354
|
var pendingLayouts = /* @__PURE__ */ new Map();
|
|
5316
5355
|
var layoutFrame;
|
|
@@ -5330,7 +5369,7 @@ function scheduleLayout(element, task) {
|
|
|
5330
5369
|
}
|
|
5331
5370
|
function TableCellContent({ children, ellipsis, title }) {
|
|
5332
5371
|
const ref = useRef16(null);
|
|
5333
|
-
const [overflowing, setOverflowing] =
|
|
5372
|
+
const [overflowing, setOverflowing] = useState19(false);
|
|
5334
5373
|
const customContent = typeof children !== "string" && typeof children !== "number" && children != null;
|
|
5335
5374
|
useLayoutEffect4(() => {
|
|
5336
5375
|
const element = ref.current;
|
|
@@ -5368,9 +5407,9 @@ function TableCellContent({ children, ellipsis, title }) {
|
|
|
5368
5407
|
}
|
|
5369
5408
|
|
|
5370
5409
|
// src/components/Table/useRemainingHeight.ts
|
|
5371
|
-
import { useLayoutEffect as useLayoutEffect5, useState as
|
|
5410
|
+
import { useLayoutEffect as useLayoutEffect5, useState as useState20 } from "react";
|
|
5372
5411
|
function useRemainingHeight(rootRef, options) {
|
|
5373
|
-
const [height, setHeight] =
|
|
5412
|
+
const [height, setHeight] = useState20();
|
|
5374
5413
|
const enabled = !!options;
|
|
5375
5414
|
const container = typeof options === "object" ? options.container : void 0;
|
|
5376
5415
|
const bottomOffset = typeof options === "object" ? options.bottomOffset ?? 0 : 0;
|
|
@@ -5645,10 +5684,10 @@ function createRowIdentity() {
|
|
|
5645
5684
|
}
|
|
5646
5685
|
|
|
5647
5686
|
// src/components/Table/Table.tsx
|
|
5648
|
-
import { Fragment as Fragment9, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect15, useImperativeHandle, useMemo as useMemo9, useRef as useRef19, useState as
|
|
5687
|
+
import { Fragment as Fragment9, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect15, useImperativeHandle, useMemo as useMemo9, useRef as useRef19, useState as useState22 } from "react";
|
|
5649
5688
|
|
|
5650
5689
|
// src/components/Table/plugins.tsx
|
|
5651
|
-
import { isValidElement as isValidElement3, useEffect as useEffect14, useRef as useRef18, useState as
|
|
5690
|
+
import { isValidElement as isValidElement3, useEffect as useEffect14, useRef as useRef18, useState as useState21 } from "react";
|
|
5652
5691
|
|
|
5653
5692
|
// src/components/Table/columnSettings.ts
|
|
5654
5693
|
function reconcileColumnSettings(columns, defaults, saved) {
|
|
@@ -6361,7 +6400,7 @@ function TableSelectedItemsPanel({
|
|
|
6361
6400
|
onRemove,
|
|
6362
6401
|
onClear
|
|
6363
6402
|
}) {
|
|
6364
|
-
const [showAll, setShowAll] =
|
|
6403
|
+
const [showAll, setShowAll] = useState21(false);
|
|
6365
6404
|
const visibleEntries = showAll ? entries : entries.slice(0, maxCount);
|
|
6366
6405
|
const hiddenCount = Math.max(0, entries.length - visibleEntries.length);
|
|
6367
6406
|
const baseColumnMap = new Map(
|
|
@@ -6767,8 +6806,8 @@ function TableFilterControl({
|
|
|
6767
6806
|
placeholder,
|
|
6768
6807
|
onApply
|
|
6769
6808
|
}) {
|
|
6770
|
-
const [open, setOpen] =
|
|
6771
|
-
const [draft, setDraft] =
|
|
6809
|
+
const [open, setOpen] = useState21(false);
|
|
6810
|
+
const [draft, setDraft] = useState21(value);
|
|
6772
6811
|
const label = getColumnLabel(column);
|
|
6773
6812
|
useEffect14(() => {
|
|
6774
6813
|
if (open) setDraft(value);
|
|
@@ -7208,8 +7247,8 @@ function EditableTableCell({
|
|
|
7208
7247
|
trigger
|
|
7209
7248
|
}) {
|
|
7210
7249
|
const config = typeof editable === "object" ? editable : { type: "input" };
|
|
7211
|
-
const [editValue, setEditValue] =
|
|
7212
|
-
const [saving, setSaving] =
|
|
7250
|
+
const [editValue, setEditValue] = useState21(value);
|
|
7251
|
+
const [saving, setSaving] = useState21(false);
|
|
7213
7252
|
const inputRef = useRef18(null);
|
|
7214
7253
|
const editorRef = useRef18(null);
|
|
7215
7254
|
const editValueRef = useRef18(value);
|
|
@@ -7554,10 +7593,10 @@ function ColumnSettingPanel({
|
|
|
7554
7593
|
onClose,
|
|
7555
7594
|
onApply
|
|
7556
7595
|
}) {
|
|
7557
|
-
const [draft, setDraft] =
|
|
7596
|
+
const [draft, setDraft] = useState21(items);
|
|
7558
7597
|
const listRef = useRef18(null);
|
|
7559
7598
|
const cancelDrag = useRef18(null);
|
|
7560
|
-
const [preview, setPreview] =
|
|
7599
|
+
const [preview, setPreview] = useState21(null);
|
|
7561
7600
|
useEffect14(() => {
|
|
7562
7601
|
cancelDrag.current?.();
|
|
7563
7602
|
if (open) setDraft(orderColumnSettings(items));
|
|
@@ -8392,13 +8431,13 @@ function TableInner(props, ref) {
|
|
|
8392
8431
|
const tableRef = useRef19(null);
|
|
8393
8432
|
useScrollbarProximity();
|
|
8394
8433
|
const scrollbarDragRef = useRef19(null);
|
|
8395
|
-
const [internalLoading, setInternalLoading] =
|
|
8396
|
-
const [scrollTop, setScrollTop] =
|
|
8397
|
-
const [scrollLeft, setScrollLeft] =
|
|
8398
|
-
const [viewportHeight, setViewportHeight] =
|
|
8399
|
-
const [viewportWidth, setViewportWidth] =
|
|
8400
|
-
const [autoColumnWidths, setAutoColumnWidths] =
|
|
8401
|
-
const [resolveRowIdentity] =
|
|
8434
|
+
const [internalLoading, setInternalLoading] = useState22(false);
|
|
8435
|
+
const [scrollTop, setScrollTop] = useState22(0);
|
|
8436
|
+
const [scrollLeft, setScrollLeft] = useState22(0);
|
|
8437
|
+
const [viewportHeight, setViewportHeight] = useState22(420);
|
|
8438
|
+
const [viewportWidth, setViewportWidth] = useState22(0);
|
|
8439
|
+
const [autoColumnWidths, setAutoColumnWidths] = useState22({});
|
|
8440
|
+
const [resolveRowIdentity] = useState22(createRowIdentity);
|
|
8402
8441
|
const getRowKey = useCallback2((record, index) => resolveRowIdentity(record, index, typeof rowKey === "function" ? rowKey : rowKey == null ? void 0 : String(rowKey)), [rowKey, resolveRowIdentity]);
|
|
8403
8442
|
const builtInResizePlugin = useMemo9(() => createResizePlugin(), []);
|
|
8404
8443
|
const builtInHighlightPlugin = useMemo9(() => createHighlightPlugin(), []);
|
|
@@ -8415,7 +8454,7 @@ function TableInner(props, ref) {
|
|
|
8415
8454
|
const sortedPlugins = useMemo9(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
|
|
8416
8455
|
const pluginsByIdRef = useRef19(/* @__PURE__ */ new Map());
|
|
8417
8456
|
pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
|
|
8418
|
-
const [pluginStates, setPluginStates] =
|
|
8457
|
+
const [pluginStates, setPluginStates] = useState22(() => Object.fromEntries(
|
|
8419
8458
|
sortedPlugins.map((plugin) => [plugin.id, resolveInitialState(plugin)])
|
|
8420
8459
|
));
|
|
8421
8460
|
const pluginApisRef = useRef19({});
|
|
@@ -9100,7 +9139,7 @@ function applySiaTheme(mode, target = document.documentElement) {
|
|
|
9100
9139
|
}
|
|
9101
9140
|
|
|
9102
9141
|
// src/components/InputSelect.tsx
|
|
9103
|
-
import { forwardRef as forwardRef7, useEffect as useEffect16, useRef as useRef20, useState as
|
|
9142
|
+
import { forwardRef as forwardRef7, useEffect as useEffect16, useRef as useRef20, useState as useState23 } from "react";
|
|
9104
9143
|
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9105
9144
|
var InputSelect = forwardRef7(function InputSelect2({
|
|
9106
9145
|
options,
|
|
@@ -9128,19 +9167,19 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
9128
9167
|
...inputProps
|
|
9129
9168
|
}, forwardedRef) {
|
|
9130
9169
|
const size = useControlSize(sizeProp);
|
|
9131
|
-
const [internal, setInternal] =
|
|
9170
|
+
const [internal, setInternal] = useState23(defaultValue);
|
|
9132
9171
|
const current = value !== void 0 ? value : internal;
|
|
9133
9172
|
const values = current == null ? [] : Array.isArray(current) ? current : [current];
|
|
9134
9173
|
const text = values.map((item) => displayField === "label" ? String(options.find((option) => option.optionType !== "divider" && option.value === item)?.label ?? item) : String(item)).join(",");
|
|
9135
|
-
const [draft, setDraft] =
|
|
9174
|
+
const [draft, setDraft] = useState23(text);
|
|
9136
9175
|
useEffect16(() => {
|
|
9137
9176
|
setDraft(text);
|
|
9138
9177
|
}, [text, current]);
|
|
9139
|
-
const [open, setOpen] =
|
|
9140
|
-
const [search, setSearch] =
|
|
9141
|
-
const [modalOpen, setModalOpen] =
|
|
9142
|
-
const [modalValues, setModalValues] =
|
|
9143
|
-
const [selectedOnly, setSelectedOnly] =
|
|
9178
|
+
const [open, setOpen] = useState23(false);
|
|
9179
|
+
const [search, setSearch] = useState23("");
|
|
9180
|
+
const [modalOpen, setModalOpen] = useState23(false);
|
|
9181
|
+
const [modalValues, setModalValues] = useState23([]);
|
|
9182
|
+
const [selectedOnly, setSelectedOnly] = useState23(false);
|
|
9144
9183
|
const rootRef = useRef20(null);
|
|
9145
9184
|
const popupRef = useRef20(null);
|
|
9146
9185
|
const inputRef = useRef20(null);
|
|
@@ -9304,13 +9343,13 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
9304
9343
|
});
|
|
9305
9344
|
|
|
9306
9345
|
// src/components/QueryForm.tsx
|
|
9307
|
-
import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect7, useRef as useRef23, useState as
|
|
9346
|
+
import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect7, useRef as useRef23, useState as useState26 } from "react";
|
|
9308
9347
|
|
|
9309
9348
|
// src/components/QueryFormSettings.tsx
|
|
9310
|
-
import { useEffect as useEffect18, useRef as useRef22, useState as
|
|
9349
|
+
import { useEffect as useEffect18, useRef as useRef22, useState as useState25 } from "react";
|
|
9311
9350
|
|
|
9312
9351
|
// src/components/useQueryFieldSort.ts
|
|
9313
|
-
import { useEffect as useEffect17, useRef as useRef21, useState as
|
|
9352
|
+
import { useEffect as useEffect17, useRef as useRef21, useState as useState24 } from "react";
|
|
9314
9353
|
function getQuerySortPreview(keys, rects, from, dy, gap) {
|
|
9315
9354
|
const center = rects[from].top + rects[from].height / 2 + dy;
|
|
9316
9355
|
const rest = keys.map((_, index) => index).filter((index) => index !== from);
|
|
@@ -9333,7 +9372,7 @@ function useQueryFieldSort(keys, enabled, onCommit) {
|
|
|
9333
9372
|
const cancelRef = useRef21();
|
|
9334
9373
|
const commitRef = useRef21(onCommit);
|
|
9335
9374
|
commitRef.current = onCommit;
|
|
9336
|
-
const [preview, setPreview] =
|
|
9375
|
+
const [preview, setPreview] = useState24();
|
|
9337
9376
|
const signature = JSON.stringify(keys);
|
|
9338
9377
|
useEffect17(() => {
|
|
9339
9378
|
cancelRef.current?.();
|
|
@@ -9460,13 +9499,13 @@ function countQueryFieldRows(centers) {
|
|
|
9460
9499
|
// src/components/QueryFormSettings.tsx
|
|
9461
9500
|
import { Fragment as Fragment10, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9462
9501
|
function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed, disabled) {
|
|
9463
|
-
const [snapshot, setSnapshot] =
|
|
9464
|
-
const [draft, setDraft] =
|
|
9465
|
-
const [open, setOpen] =
|
|
9466
|
-
const [loading, setLoading] =
|
|
9467
|
-
const [saving, setSaving] =
|
|
9468
|
-
const [error, setError] =
|
|
9469
|
-
const [loadFailed, setLoadFailed] =
|
|
9502
|
+
const [snapshot, setSnapshot] = useState25();
|
|
9503
|
+
const [draft, setDraft] = useState25({ fields: [], defaultCollapsed: defaultCollapsed ?? false });
|
|
9504
|
+
const [open, setOpen] = useState25(false);
|
|
9505
|
+
const [loading, setLoading] = useState25(false);
|
|
9506
|
+
const [saving, setSaving] = useState25(false);
|
|
9507
|
+
const [error, setError] = useState25("");
|
|
9508
|
+
const [loadFailed, setLoadFailed] = useState25(false);
|
|
9470
9509
|
const token = useRef22(0);
|
|
9471
9510
|
const saveLock = useRef22(false);
|
|
9472
9511
|
const latest = useRef22({ config, fields, defaultCollapsed, applyCollapsed });
|
|
@@ -9655,18 +9694,18 @@ function QueryForm({
|
|
|
9655
9694
|
...formProps
|
|
9656
9695
|
}) {
|
|
9657
9696
|
const [form] = useForm(providedForm);
|
|
9658
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
9659
|
-
const [expandedRows, setExpandedRows] =
|
|
9660
|
-
const [needsCollapse, setNeedsCollapse] =
|
|
9697
|
+
const [internalCollapsed, setInternalCollapsed] = useState26(defaultCollapsed);
|
|
9698
|
+
const [expandedRows, setExpandedRows] = useState26(0);
|
|
9699
|
+
const [needsCollapse, setNeedsCollapse] = useState26(false);
|
|
9661
9700
|
const collapsed = collapsible && needsCollapse && (controlledCollapsed ?? internalCollapsed ?? expandedRows >= 3);
|
|
9662
|
-
const [searching, setSearching] =
|
|
9663
|
-
const [saving, setSaving] =
|
|
9664
|
-
const [removing, setRemoving] =
|
|
9665
|
-
const [saveOpen, setSaveOpen] =
|
|
9666
|
-
const [saveName, setSaveName] =
|
|
9667
|
-
const [saveError, setSaveError] =
|
|
9668
|
-
const [error, setError] =
|
|
9669
|
-
const [activeShortcut, setActiveShortcut] =
|
|
9701
|
+
const [searching, setSearching] = useState26(false);
|
|
9702
|
+
const [saving, setSaving] = useState26(false);
|
|
9703
|
+
const [removing, setRemoving] = useState26(false);
|
|
9704
|
+
const [saveOpen, setSaveOpen] = useState26(false);
|
|
9705
|
+
const [saveName, setSaveName] = useState26("");
|
|
9706
|
+
const [saveError, setSaveError] = useState26("");
|
|
9707
|
+
const [error, setError] = useState26("");
|
|
9708
|
+
const [activeShortcut, setActiveShortcut] = useState26("");
|
|
9670
9709
|
const source = useRef23({ source: "submit" });
|
|
9671
9710
|
const searchLock = useRef23(false);
|
|
9672
9711
|
const saveLock = useRef23(false);
|
|
@@ -9701,8 +9740,8 @@ function QueryForm({
|
|
|
9701
9740
|
const rowRef = useRef23(null);
|
|
9702
9741
|
const actionsRef = useRef23(null);
|
|
9703
9742
|
const toggleRef = useRef23(null);
|
|
9704
|
-
const [fittingCount, setFittingCount] =
|
|
9705
|
-
const [settingsRows, setSettingsRows] =
|
|
9743
|
+
const [fittingCount, setFittingCount] = useState26(limit);
|
|
9744
|
+
const [settingsRows, setSettingsRows] = useState26(0);
|
|
9706
9745
|
useLayoutEffect7(() => {
|
|
9707
9746
|
const row = rowRef.current;
|
|
9708
9747
|
const actions = actionsRef.current;
|
|
@@ -818,7 +818,8 @@ var extendedIconPaths = {
|
|
|
818
818
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { x: "3", y: "14", width: "7", height: "7", rx: "2" }),
|
|
819
819
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { x: "14", y: "14", width: "7", height: "7", rx: "2" })
|
|
820
820
|
] }),
|
|
821
|
-
|
|
821
|
+
/** 扩展与插件:圆角拼图轮廓,顶部及右侧凸出接口,左侧内凹接口。 */
|
|
822
|
+
puzzle: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M9 6V5a2 2 0 0 1 4 0v1h3a2 2 0 0 1 2 2v2h1a2 2 0 0 1 0 4h-1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4h1a2 2 0 0 0 0-4H4V8a2 2 0 0 1 2-2h3Z" }) }),
|
|
822
823
|
partition: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
823
824
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 5v5M6 14v-2h12v2M6 18v3M12 18v3M18 18v3" }),
|
|
824
825
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "3", r: "2" }),
|
|
@@ -1107,7 +1108,8 @@ var outlineIconBounds = {
|
|
|
1107
1108
|
"plus": [4, 4, 16, 16],
|
|
1108
1109
|
"power": [4, 3, 16.000002, 16.744997],
|
|
1109
1110
|
"printer": [4, 3, 16, 18],
|
|
1110
|
-
|
|
1111
|
+
// 拼图轮廓横向从 4 到 21,纵向从 3 到 21,与图形归一化范围一致。
|
|
1112
|
+
"puzzle": [4, 3, 17, 18],
|
|
1111
1113
|
"qr-code": [3, 3, 18, 18],
|
|
1112
1114
|
"question": [3, 3, 18, 18],
|
|
1113
1115
|
"redo": [4, 7, 17, 12],
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextContent,
|
|
3
3
|
RichTextEditor
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-B333SUKG.js";
|
|
5
|
+
import "./chunk-D3CROVS2.js";
|
|
6
6
|
import "./chunk-SCEHVGKV.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-33FOEIXI.js";
|
|
8
8
|
import "./chunk-CZ2ITBRW.js";
|
|
9
9
|
import "./chunk-KY6A5IJH.js";
|
|
10
10
|
import "./chunk-NZMUW5XI.js";
|
|
@@ -735,7 +735,8 @@ var extendedIconPaths = {
|
|
|
735
735
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "3", y: "14", width: "7", height: "7", rx: "2" }),
|
|
736
736
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "14", y: "14", width: "7", height: "7", rx: "2" })
|
|
737
737
|
] }),
|
|
738
|
-
|
|
738
|
+
/** 扩展与插件:圆角拼图轮廓,顶部及右侧凸出接口,左侧内凹接口。 */
|
|
739
|
+
puzzle: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M9 6V5a2 2 0 0 1 4 0v1h3a2 2 0 0 1 2 2v2h1a2 2 0 0 1 0 4h-1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4h1a2 2 0 0 0 0-4H4V8a2 2 0 0 1 2-2h3Z" }) }),
|
|
739
740
|
partition: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
740
741
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 5v5M6 14v-2h12v2M6 18v3M12 18v3M18 18v3" }),
|
|
741
742
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "3", r: "2" }),
|
|
@@ -1024,7 +1025,8 @@ var outlineIconBounds = {
|
|
|
1024
1025
|
"plus": [4, 4, 16, 16],
|
|
1025
1026
|
"power": [4, 3, 16.000002, 16.744997],
|
|
1026
1027
|
"printer": [4, 3, 16, 18],
|
|
1027
|
-
|
|
1028
|
+
// 拼图轮廓横向从 4 到 21,纵向从 3 到 21,与图形归一化范围一致。
|
|
1029
|
+
"puzzle": [4, 3, 17, 18],
|
|
1028
1030
|
"qr-code": [3, 3, 18, 18],
|
|
1029
1031
|
"question": [3, 3, 18, 18],
|
|
1030
1032
|
"redo": [4, 7, 17, 12],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PUNKAJBB.js";
|
|
4
|
+
import "./chunk-WA3LO3LY.js";
|
|
5
|
+
import "./chunk-D3CROVS2.js";
|
|
6
6
|
import "./chunk-SCEHVGKV.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-33FOEIXI.js";
|
|
8
8
|
import "./chunk-CZ2ITBRW.js";
|
|
9
9
|
import "./chunk-KY6A5IJH.js";
|
|
10
10
|
import "./chunk-NZMUW5XI.js";
|