@sia.soul/sia-react-ui 0.1.166 → 0.1.168

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.
Files changed (42) hide show
  1. package/dist/{Select-Dxevc0f6.d.cts → Select-BXL6JVj0.d.cts} +3 -1
  2. package/dist/{Select-tsENCXQI.d.ts → Select-xBynHOUn.d.ts} +3 -1
  3. package/dist/chart.cjs +4553 -4513
  4. package/dist/chart.d.cts +1850 -1843
  5. package/dist/chart.d.ts +1850 -1843
  6. package/dist/chart.js +1 -1
  7. package/dist/chunk-2FZI7TP6.js +0 -0
  8. package/dist/{chunk-T2F6X3LA.js → chunk-55MXRT55.js} +26 -22
  9. package/dist/{chunk-2EC653G5.js → chunk-5KTQXNGL.js} +2 -2
  10. package/dist/{chunk-NHGCGOF2.js → chunk-A7TLMWMM.js} +4754 -4714
  11. package/dist/{chunk-DKQ5UCN6.js → chunk-DQR7EPRA.js} +519 -220
  12. package/dist/{chunk-G5EJJFUI.js → chunk-FSO46WEJ.js} +14 -6
  13. package/dist/{chunk-SX4LLT3H.js → chunk-V4YT4LT5.js} +36 -29
  14. package/dist/{chunk-23FQ5ARA.js → chunk-XS7AVCHO.js} +27 -17
  15. package/dist/{core-Dy8NWJ1b.d.ts → core-BlCSI1Tm.d.ts} +7 -10
  16. package/dist/{core-Cnt8r6pj.d.cts → core-D_D7pOTq.d.cts} +7 -10
  17. package/dist/core.cjs +117 -88
  18. package/dist/core.css +3145 -5342
  19. package/dist/core.d.cts +2 -2
  20. package/dist/core.d.ts +2 -2
  21. package/dist/core.js +4 -4
  22. package/dist/game.cjs +14 -6
  23. package/dist/game.css +1658 -3131
  24. package/dist/game.js +1 -1
  25. package/dist/index.cjs +6684 -6237
  26. package/dist/index.css +8717 -8536
  27. package/dist/index.d.cts +137 -116
  28. package/dist/index.d.ts +137 -116
  29. package/dist/index.js +908 -828
  30. package/dist/markdown-editor.css +461 -0
  31. package/dist/markdown-editor.js +2 -1
  32. package/dist/rich-text-editor.cjs +38 -20
  33. package/dist/rich-text-editor.css +461 -0
  34. package/dist/rich-text-editor.js +4 -3
  35. package/dist/{select-date-range-E1N5-oXv.d.ts → select-date-range-C-29x2BA.d.ts} +7 -10
  36. package/dist/{select-date-range-BnlISSPV.d.cts → select-date-range-CewOaLtk.d.cts} +7 -10
  37. package/dist/select-date-range.cjs +563 -249
  38. package/dist/select-date-range.d.cts +2 -2
  39. package/dist/select-date-range.d.ts +2 -2
  40. package/dist/select-date-range.js +4 -4
  41. package/package.json +5 -1
  42. /package/dist/{chunk-V4I32DPL.js → chunk-GKWSCL5Q.js} +0 -0
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@ import {
56
56
  smoothSvgPath,
57
57
  svgArcPath,
58
58
  transferCompositeValue
59
- } from "./chunk-NHGCGOF2.js";
59
+ } from "./chunk-A7TLMWMM.js";
60
60
  import {
61
61
  Badge,
62
62
  Breadcrumb,
@@ -82,20 +82,21 @@ import {
82
82
  Watermark,
83
83
  message,
84
84
  notification
85
- } from "./chunk-T2F6X3LA.js";
85
+ } from "./chunk-55MXRT55.js";
86
86
  import "./chunk-RX242MUO.js";
87
87
  import {
88
88
  MarkdownEditor
89
- } from "./chunk-V4I32DPL.js";
89
+ } from "./chunk-GKWSCL5Q.js";
90
90
  import {
91
91
  RichTextContent,
92
92
  RichTextEditor
93
- } from "./chunk-2EC653G5.js";
93
+ } from "./chunk-5KTQXNGL.js";
94
+ import "./chunk-2FZI7TP6.js";
94
95
  import {
95
96
  DatePicker,
96
97
  SelectDateRange,
97
98
  TimePanel
98
- } from "./chunk-DKQ5UCN6.js";
99
+ } from "./chunk-DQR7EPRA.js";
99
100
  import {
100
101
  Checkbox,
101
102
  OverflowTags,
@@ -107,14 +108,14 @@ import {
107
108
  Tree,
108
109
  normalizeSelectionValues,
109
110
  usePressFeedback
110
- } from "./chunk-SX4LLT3H.js";
111
+ } from "./chunk-V4YT4LT5.js";
111
112
  import {
112
113
  Dropdown,
113
114
  Input,
114
115
  Menu,
115
116
  Segmented,
116
117
  Steps
117
- } from "./chunk-23FQ5ARA.js";
118
+ } from "./chunk-XS7AVCHO.js";
118
119
  import {
119
120
  TextArea
120
121
  } from "./chunk-J6BPKBEL.js";
@@ -128,7 +129,7 @@ import {
128
129
  Skeleton,
129
130
  useOverlayExitPlaceholder,
130
131
  useOverlayLifecycle
131
- } from "./chunk-G5EJJFUI.js";
132
+ } from "./chunk-FSO46WEJ.js";
132
133
  import {
133
134
  Button
134
135
  } from "./chunk-PAWEP65C.js";
@@ -606,7 +607,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
606
607
  }
607
608
 
608
609
  // src/components/Alert.tsx
609
- import { useRef as useRef3, useState as useState3 } from "react";
610
+ import { forwardRef, useRef as useRef3, useState as useState3 } from "react";
610
611
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
611
612
  var alertIcons = {
612
613
  info: /* @__PURE__ */ jsx3(Icon, { name: "info", size: 20, variant: "filled" }),
@@ -614,7 +615,7 @@ var alertIcons = {
614
615
  warning: /* @__PURE__ */ jsx3(Icon, { name: "warning", size: 20, variant: "filled" }),
615
616
  error: /* @__PURE__ */ jsx3(Icon, { name: "circle-close", size: 20, variant: "filled" })
616
617
  };
617
- function Alert({
618
+ var Alert = forwardRef(function Alert2({
618
619
  status,
619
620
  type,
620
621
  title,
@@ -629,7 +630,7 @@ function Alert({
629
630
  afterClose,
630
631
  className = "",
631
632
  ...props
632
- }) {
633
+ }, forwardedRef) {
633
634
  const [visible, setVisible] = useState3(true);
634
635
  const rootRef = useRef3(null);
635
636
  const motion = useOverlayMotion(visible, rootRef, "fade", "bottom", true, (opened) => {
@@ -638,8 +639,13 @@ function Alert({
638
639
  const resolvedStatus = status ?? type ?? (banner ? "warning" : "info");
639
640
  const heading = message2 ?? title;
640
641
  const hasHeading = heading != null && heading !== "" && typeof heading !== "boolean";
642
+ function setRef(node) {
643
+ rootRef.current = node;
644
+ if (typeof forwardedRef === "function") forwardedRef(node);
645
+ else if (forwardedRef) forwardedRef.current = node;
646
+ }
641
647
  if (!motion.present) return null;
642
- return /* @__PURE__ */ jsxs3("div", { ref: rootRef, className: `sia-alert sia-alert--${resolvedStatus}${banner ? " sia-alert--banner" : ""}${description ? " sia-alert--with-description" : ""} ${className}`.trim(), role: "alert", ...withTitleTooltip(props), ...!visible ? { inert: "" } : {}, children: [
648
+ return /* @__PURE__ */ jsxs3("div", { ref: setRef, className: `sia-alert sia-alert--${resolvedStatus}${banner ? " sia-alert--banner" : ""}${description ? " sia-alert--with-description" : ""} ${className}`.trim(), role: "alert", ...withTitleTooltip(props), ...!visible ? { inert: "" } : {}, children: [
643
649
  showIcon || banner ? /* @__PURE__ */ jsx3("span", { className: "sia-alert__icon", "aria-hidden": "true", children: alertIcons[resolvedStatus] }) : null,
644
650
  /* @__PURE__ */ jsxs3("div", { className: "sia-alert__content", children: [
645
651
  hasHeading ? /* @__PURE__ */ jsx3("strong", { children: heading }) : null,
@@ -651,13 +657,13 @@ function Alert({
651
657
  setVisible(false);
652
658
  }, children: closeIcon ?? /* @__PURE__ */ jsx3(Icon, { name: "close", size: 14 }) }) : null
653
659
  ] });
654
- }
660
+ });
655
661
 
656
662
  // src/components/Pagination.tsx
657
- import { useState as useState4 } from "react";
663
+ import { forwardRef as forwardRef2, useState as useState4 } from "react";
658
664
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
659
665
  var DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100, 200, 500, 1e3, 2e3, 5e3];
660
- function Pagination({
666
+ var Pagination = forwardRef2(function Pagination2({
661
667
  size: sizeProp,
662
668
  total = 0,
663
669
  currentPageCount,
@@ -676,7 +682,7 @@ function Pagination({
676
682
  onShowSizeChange,
677
683
  className = "",
678
684
  ...props
679
- }) {
685
+ }, forwardedRef) {
680
686
  const controlSize = useControlSize(sizeProp);
681
687
  const [size, setSize] = useControllableState({ value: pageSize, defaultValue: Math.max(1, defaultPageSize) });
682
688
  const [page, setPage] = useControllableState({ value: current, defaultValue: Math.max(1, defaultCurrent) });
@@ -710,7 +716,7 @@ function Pagination({
710
716
  if (refreshing === void 0) setInternalRefreshing(false);
711
717
  }
712
718
  }
713
- return /* @__PURE__ */ jsxs4("nav", { className: `sia-pagination sia-pagination--${controlSize} ${className}`.trim(), "aria-label": "\u5206\u9875", ...withTitleTooltip(props), children: [
719
+ return /* @__PURE__ */ jsxs4("nav", { ref: forwardedRef, className: `sia-pagination sia-pagination--${controlSize} ${className}`.trim(), "aria-label": "\u5206\u9875", ...withTitleTooltip(props), children: [
714
720
  /* @__PURE__ */ jsxs4("span", { className: "sia-pagination__current-count", "aria-live": "polite", children: [
715
721
  "\u5F53\u524D\u9875 ",
716
722
  pageCount,
@@ -764,10 +770,10 @@ function Pagination({
764
770
  /* @__PURE__ */ jsx4(Button, { size: controlSize, variant: "text", "aria-label": "\u6700\u540E\u4E00\u9875", disabled: disabled || safePage >= totalPages, onClick: () => change(totalPages), children: /* @__PURE__ */ jsx4(Icon, { name: "double-right", size: 15 }) })
765
771
  ] })
766
772
  ] });
767
- }
773
+ });
768
774
 
769
775
  // src/components/Cascader.tsx
770
- import { useEffect as useEffect3, useMemo, useRef as useRef4, useState as useState5 } from "react";
776
+ import { forwardRef as forwardRef3, useEffect as useEffect3, useMemo, useRef as useRef4, useState as useState5 } from "react";
771
777
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
772
778
  function optionValue(option, fields) {
773
779
  return option[fields.value];
@@ -802,7 +808,7 @@ function leafPaths(options, fields, parents = []) {
802
808
  }
803
809
  return result;
804
810
  }
805
- function Cascader({
811
+ var Cascader = forwardRef3(function Cascader2({
806
812
  options,
807
813
  value,
808
814
  defaultValue,
@@ -821,10 +827,15 @@ function Cascader({
821
827
  onChange,
822
828
  className = "",
823
829
  ...props
824
- }) {
830
+ }, forwardedRef) {
825
831
  const size = useControlSize(sizeProp);
826
832
  const fields = useMemo(() => ({ label: fieldNames?.label ?? "label", value: fieldNames?.value ?? "value", children: fieldNames?.children ?? "children" }), [fieldNames]);
827
833
  const rootRef = useRef4(null);
834
+ function setRootRef(node) {
835
+ rootRef.current = node;
836
+ if (typeof forwardedRef === "function") forwardedRef(node);
837
+ else if (forwardedRef) forwardedRef.current = node;
838
+ }
828
839
  const popupRef = useRef4(null);
829
840
  const [current, setCurrent] = useControllableState({
830
841
  value,
@@ -911,7 +922,7 @@ function Cascader({
911
922
  if (children?.length) columns.push(children);
912
923
  });
913
924
  const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: selectedPaths.length > 0, active: open });
914
- return /* @__PURE__ */ jsxs5("div", { ref: rootRef, className: `sia-cascader sia-cascader--${size}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), ...withTitleTooltip(props), children: [
925
+ return /* @__PURE__ */ jsxs5("div", { ref: setRootRef, className: `sia-cascader sia-cascader--${size}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), ...withTitleTooltip(props), children: [
915
926
  /* @__PURE__ */ jsxs5("button", { type: "button", className: `sia-cascader__trigger${floating.className}`, disabled, "aria-haspopup": "listbox", "aria-expanded": open, onClick: toggleOpen, children: [
916
927
  /* @__PURE__ */ jsx5("span", { className: "sia-cascader__value", children: display ? multiple && Array.isArray(display) ? display.map((label, index) => /* @__PURE__ */ jsx5("span", { className: "sia-cascader__tag", children: label }, pathKey(selectedPaths[index] ?? []))) : display : /* @__PURE__ */ jsx5("span", { className: "sia-cascader__placeholder", children: placeholder }) }),
917
928
  allowClear && selectedPaths.length && !disabled ? /* @__PURE__ */ jsx5("span", { className: "sia-cascader__clear", role: "button", "aria-label": "\u6E05\u9664\u9009\u62E9", onClick: (event) => {
@@ -971,7 +982,7 @@ function Cascader({
971
982
  }) }, depth)) })
972
983
  ] })
973
984
  ] });
974
- }
985
+ });
975
986
 
976
987
  // src/components/Layout.tsx
977
988
  import { Children } from "react";
@@ -1526,9 +1537,9 @@ function ToolPanel({
1526
1537
  import { useEffect as useEffect4, useRef as useRef7, useState as useState8 } from "react";
1527
1538
 
1528
1539
  // src/components/ThemeSwitch.tsx
1529
- import { forwardRef } from "react";
1540
+ import { forwardRef as forwardRef4 } from "react";
1530
1541
  import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1531
- var ThemeSwitch = forwardRef(function ThemeSwitch2({
1542
+ var ThemeSwitch = forwardRef4(function ThemeSwitch2({
1532
1543
  checked,
1533
1544
  onCheckedChange,
1534
1545
  lightLabel = "\u4EAE\u8272\u6A21\u5F0F",
@@ -1566,38 +1577,50 @@ var ThemeSwitch = forwardRef(function ThemeSwitch2({
1566
1577
 
1567
1578
  // src/theme.ts
1568
1579
  var SIA_THEME = {
1569
- /** 主色。 */
1580
+ /** 主色,对应 `--sia-color-primary`。 */
1570
1581
  colorPrimary: "#1677ff",
1571
- /** 主色的悬停色。 */
1582
+ /** 主色的悬停色,对应 `--sia-color-primary-hover`。 */
1572
1583
  colorPrimaryHover: "#4096ff",
1573
- /** 主色的按下色。 */
1584
+ /** 主色的按下色,对应 `--sia-color-primary-active`。 */
1574
1585
  colorPrimaryActive: "#0958d9",
1575
- /** 主要文本颜色。 */
1586
+ /** 成功语义色,对应 `--sia-color-success`。 */
1587
+ colorSuccess: "#52c41a",
1588
+ /** 警告语义色,对应 `--sia-color-warning`。 */
1589
+ colorWarning: "#faad14",
1590
+ /** 错误语义色,对应 `--sia-color-error`。 */
1591
+ colorError: "#ff4d4f",
1592
+ /** 主要文本颜色,对应 `--sia-color-text`。 */
1576
1593
  colorText: "#1f1f1f",
1577
- /** 次要文本颜色。 */
1594
+ /** 次要文本颜色,对应 `--sia-color-text-secondary`。 */
1578
1595
  colorTextSecondary: "#666666",
1579
- /** 页面背景颜色。 */
1596
+ /** 页面背景颜色,对应 `--sia-color-background`。 */
1580
1597
  colorBackground: "#f5f7fa",
1581
- /** 组件表面颜色。 */
1598
+ /** 组件表面颜色,对应 `--sia-color-surface`。 */
1582
1599
  colorSurface: "#ffffff",
1583
- /** 默认边框颜色。 */
1600
+ /** 默认边框颜色,对应 `--sia-color-border`。 */
1584
1601
  colorBorder: "#d9d9d9",
1585
- /** 默认圆角半径,单位为像素。 */
1602
+ /** 默认圆角半径,单位为像素,对应 `--sia-radius`。 */
1586
1603
  borderRadius: 6,
1587
- /** 默认控件高度,单位为像素。 */
1588
- controlHeight: 32,
1589
- /** 默认布局间距为 8 像素,对应 --sia-spacing;业务可通过容器或组件上的同名 CSS 变量覆盖。 */
1604
+ /** 小号控件高度,单位为像素,对应 `--sia-control-height-small`。 */
1605
+ controlHeightSmall: 22,
1606
+ /** 默认(中号)控件高度,单位为像素,对应 `--sia-control-height` / `--sia-control-height-medium`。 */
1607
+ controlHeight: 30,
1608
+ /** 大号控件高度,单位为像素,对应 `--sia-control-height-large`。 */
1609
+ controlHeightLarge: 38,
1610
+ /** 默认布局间距为 8 像素,对应 `--sia-spacing`;业务可通过容器或组件上的同名 CSS 变量覆盖。 */
1590
1611
  spacing: 8,
1591
- /** 默认基础字号为 13 像素,对应 --sia-font-size;业务可通过 CSS 变量覆盖。 */
1612
+ /** 默认基础字号为 13 像素,对应 `--sia-font-size`;业务可通过 CSS 变量覆盖。 */
1592
1613
  fontSize: 13,
1593
- /** 默认小号文字尺寸为 13 像素,对应 --sia-font-size-small;业务可通过 CSS 变量覆盖。 */
1614
+ /** 默认小号文字尺寸为 13 像素,对应 `--sia-font-size-small`;业务可通过 CSS 变量覆盖。 */
1594
1615
  fontSizeSmall: 13,
1595
- /** 大号文字尺寸,单位为像素。 */
1616
+ /** 大号文字尺寸,单位为像素,对应 `--sia-font-size-large`。 */
1596
1617
  fontSizeLarge: 18
1597
1618
  };
1598
- function applySiaTheme(mode, target = document.documentElement) {
1599
- target.dataset.siaTheme = mode;
1600
- target.style.colorScheme = mode;
1619
+ function applySiaTheme(mode, target) {
1620
+ const element = target ?? (typeof document !== "undefined" ? document.documentElement : null);
1621
+ if (!element) return;
1622
+ element.dataset.siaTheme = mode;
1623
+ element.style.colorScheme = mode;
1601
1624
  }
1602
1625
 
1603
1626
  // src/components/WindowFrame.tsx
@@ -1821,7 +1844,7 @@ function WindowTitleBar({
1821
1844
  }
1822
1845
 
1823
1846
  // src/components/Drawer.tsx
1824
- import { createContext, forwardRef as forwardRef2, useCallback, useContext, useEffect as useEffect5, useId as useId2, useMemo as useMemo3, useRef as useRef8, useState as useState9 } from "react";
1847
+ import { createContext, forwardRef as forwardRef5, useCallback, useContext, useEffect as useEffect5, useId as useId2, useMemo as useMemo3, useRef as useRef8, useState as useState9 } from "react";
1825
1848
  import { createRoot } from "react-dom/client";
1826
1849
  import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1827
1850
  var drawerHandles = /* @__PURE__ */ new Set();
@@ -1833,7 +1856,7 @@ function createPushOffset(distance, depth, negative) {
1833
1856
  const operator = negative ? " - " : " + ";
1834
1857
  return `calc(0px${operator}${Array.from({ length: depth }, () => distance).join(operator)})`;
1835
1858
  }
1836
- var DrawerRoot = forwardRef2(function Drawer({
1859
+ var DrawerRoot = forwardRef5(function Drawer({
1837
1860
  open,
1838
1861
  deferContent = false,
1839
1862
  loadingFallback,
@@ -2013,9 +2036,9 @@ var Drawer2 = Object.assign(DrawerRoot, {
2013
2036
  });
2014
2037
 
2015
2038
  // src/components/Form.tsx
2016
- import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef3, isValidElement as isValidElement2, useContext as useContext2, useEffect as useEffect6, useId as useId3, useLayoutEffect as useLayoutEffect3, useMemo as useMemo4, useRef as useRef9, useState as useState10, useSyncExternalStore } from "react";
2039
+ import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef6, isValidElement as isValidElement2, useContext as useContext2, useEffect as useEffect6, useId as useId3, useLayoutEffect as useLayoutEffect3, useMemo as useMemo4, useRef as useRef9, useState as useState10, useSyncExternalStore } from "react";
2017
2040
  import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
2018
- var Switch = forwardRef3(function Switch2({
2041
+ var Switch = forwardRef6(function Switch2({
2019
2042
  label,
2020
2043
  variant = "standard",
2021
2044
  size: sizeProp,
@@ -2756,10 +2779,10 @@ function RadioSelectionMotion({ rootRef }) {
2756
2779
  }
2757
2780
 
2758
2781
  // src/components/Radio.tsx
2759
- import { createContext as createContext3, forwardRef as forwardRef4, useContext as useContext3, useId as useId4, useMemo as useMemo5, useRef as useRef11 } from "react";
2782
+ import { createContext as createContext3, forwardRef as forwardRef7, useContext as useContext3, useId as useId4, useMemo as useMemo5, useRef as useRef11 } from "react";
2760
2783
  import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
2761
2784
  var RadioContext = createContext3(null);
2762
- var RadioRoot = forwardRef4(function Radio({ value, size: sizeProp, children, disabled, checked, defaultChecked, button = false, className = "", onChange, ...props }, ref) {
2785
+ var RadioRoot = forwardRef7(function Radio({ value, size: sizeProp, children, disabled, checked, defaultChecked, button = false, className = "", onChange, ...props }, ref) {
2763
2786
  const size = useControlSize(sizeProp);
2764
2787
  const group = useContext3(RadioContext);
2765
2788
  const fallbackId = useId4();
@@ -2847,12 +2870,12 @@ var Radio2 = Object.assign(RadioRoot, {
2847
2870
  });
2848
2871
 
2849
2872
  // src/components/Slider.tsx
2850
- import { useState as useState11 } from "react";
2873
+ import { forwardRef as forwardRef8, useState as useState11 } from "react";
2851
2874
  import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
2852
2875
  function percent(value, min, max) {
2853
2876
  return (value - min) / (max - min) * 100;
2854
2877
  }
2855
- function Slider({
2878
+ var Slider = forwardRef8(function Slider2({
2856
2879
  value,
2857
2880
  defaultValue,
2858
2881
  min = 0,
@@ -2868,7 +2891,7 @@ function Slider({
2868
2891
  onChange,
2869
2892
  onChangeComplete,
2870
2893
  ...props
2871
- }) {
2894
+ }, forwardedRef) {
2872
2895
  const fallback = defaultValue ?? (range ? [min, max] : min);
2873
2896
  const [currentValue, setValue2] = useControllableState({ value, defaultValue: fallback, onChange });
2874
2897
  const [activeThumb, setActiveThumb] = useState11(null);
@@ -2896,6 +2919,7 @@ function Slider({
2896
2919
  return /* @__PURE__ */ jsxs14(
2897
2920
  "div",
2898
2921
  {
2922
+ ref: forwardedRef,
2899
2923
  className: `sia-slider${range ? " sia-slider--range" : ""}${vertical ? " sia-slider--vertical" : ""}${reverse ? " sia-slider--reverse" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
2900
2924
  style,
2901
2925
  ...withTitleTooltip(props),
@@ -2965,10 +2989,10 @@ function Slider({
2965
2989
  ]
2966
2990
  }
2967
2991
  );
2968
- }
2992
+ });
2969
2993
 
2970
2994
  // src/components/ColorPicker.tsx
2971
- import { useEffect as useEffect7, useRef as useRef12, useState as useState12 } from "react";
2995
+ import { forwardRef as forwardRef9, useEffect as useEffect7, useRef as useRef12, useState as useState12 } from "react";
2972
2996
  import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
2973
2997
  var DEFAULT_MODES = ["solid", "gradient"];
2974
2998
  var gradientStopSeed = 0;
@@ -3039,7 +3063,7 @@ function createStop(color, position) {
3039
3063
  function createDefaultStops(color) {
3040
3064
  return [createStop(color, 0), createStop("#FFFFFF", 100)];
3041
3065
  }
3042
- function ColorPicker({
3066
+ var ColorPicker = forwardRef9(function ColorPicker2({
3043
3067
  size: sizeProp,
3044
3068
  value,
3045
3069
  defaultValue = "#1677FF",
@@ -3057,9 +3081,14 @@ function ColorPicker({
3057
3081
  onModeChange,
3058
3082
  onClear,
3059
3083
  ...props
3060
- }) {
3084
+ }, forwardedRef) {
3061
3085
  const size = useControlSize(sizeProp);
3062
3086
  const rootRef = useRef12(null);
3087
+ function setRootRef(node) {
3088
+ rootRef.current = node;
3089
+ if (typeof forwardedRef === "function") forwardedRef(node);
3090
+ else if (forwardedRef) forwardedRef.current = node;
3091
+ }
3063
3092
  const popupRef = useRef12(null);
3064
3093
  const lastEmittedValue = useRef12();
3065
3094
  const initialGradient = parseGradient(value ?? defaultValue);
@@ -3159,7 +3188,7 @@ function ColorPicker({
3159
3188
  const triggerBackground = color || "transparent";
3160
3189
  const triggerText = color || "\u65E0\u8272";
3161
3190
  const opaqueColor = rgbaToHex({ ...rgba, a: 100 }, false);
3162
- return /* @__PURE__ */ jsxs15("div", { ref: rootRef, className: `sia-color-picker sia-color-picker--${size}${disabled ? " is-disabled" : ""} ${className}`.trim(), ...withTitleTooltip(props), children: [
3191
+ return /* @__PURE__ */ jsxs15("div", { ref: setRootRef, className: `sia-color-picker sia-color-picker--${size}${disabled ? " is-disabled" : ""} ${className}`.trim(), ...withTitleTooltip(props), children: [
3163
3192
  /* @__PURE__ */ jsxs15(
3164
3193
  "button",
3165
3194
  {
@@ -3281,16 +3310,16 @@ function ColorPicker({
3281
3310
  ] }, index))
3282
3311
  ] })
3283
3312
  ] });
3284
- }
3313
+ });
3285
3314
 
3286
3315
  // src/components/TimePicker.tsx
3287
- import { useEffect as useEffect8, useId as useId5, useRef as useRef13, useState as useState13 } from "react";
3316
+ import { forwardRef as forwardRef10, useEffect as useEffect8, useId as useId5, useRef as useRef13, useState as useState13 } from "react";
3288
3317
  import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
3289
3318
  function seconds(value) {
3290
3319
  const [h = 0, m = 0, s = 0] = value.split(":").map(Number);
3291
3320
  return h * 3600 + m * 60 + s;
3292
3321
  }
3293
- function TimePicker({
3322
+ var TimePickerRoot = forwardRef10(function TimePicker({
3294
3323
  value,
3295
3324
  defaultValue = "",
3296
3325
  size: sizeProp,
@@ -3312,10 +3341,15 @@ function TimePicker({
3312
3341
  max,
3313
3342
  step,
3314
3343
  ...props
3315
- }) {
3344
+ }, forwardedRef) {
3316
3345
  const size = useControlSize(sizeProp);
3317
3346
  const id = useId5();
3318
3347
  const rootRef = useRef13(null);
3348
+ function setRootRef(node) {
3349
+ rootRef.current = node;
3350
+ if (typeof forwardedRef === "function") forwardedRef(node);
3351
+ else if (forwardedRef) forwardedRef.current = node;
3352
+ }
3319
3353
  const inputRef = useRef13(null);
3320
3354
  const popupRef = useRef13(null);
3321
3355
  const focusPanel = useRef13(false);
@@ -3339,6 +3373,8 @@ function TimePicker({
3339
3373
  setOpen(next);
3340
3374
  onOpenChange?.(next);
3341
3375
  }
3376
+ const changeOpenRef = useRef13(changeOpen);
3377
+ changeOpenRef.current = changeOpen;
3342
3378
  useEffect8(() => {
3343
3379
  if (!open) return;
3344
3380
  if (focusPanel.current) {
@@ -3347,7 +3383,7 @@ function TimePicker({
3347
3383
  }
3348
3384
  const close = (event) => {
3349
3385
  const target = event.target;
3350
- if (!rootRef.current?.contains(target) && !popupRef.current?.contains(target)) changeOpen(false);
3386
+ if (!rootRef.current?.contains(target) && !popupRef.current?.contains(target)) changeOpenRef.current(false);
3351
3387
  };
3352
3388
  document.addEventListener("pointerdown", close);
3353
3389
  document.addEventListener("focusin", close);
@@ -3355,7 +3391,7 @@ function TimePicker({
3355
3391
  document.removeEventListener("pointerdown", close);
3356
3392
  document.removeEventListener("focusin", close);
3357
3393
  };
3358
- });
3394
+ }, [open]);
3359
3395
  const display = !currentValue ? "" : use12Hours ? String(Number(currentValue.slice(0, 2)) % 12 || 12).padStart(2, "0") + normalize(currentValue).slice(2) + (Number(currentValue.slice(0, 2)) < 12 ? " AM" : " PM") : normalize(currentValue);
3360
3396
  function confirm() {
3361
3397
  if (unavailable(draft)) return;
@@ -3364,7 +3400,7 @@ function TimePicker({
3364
3400
  inputRef.current?.focus();
3365
3401
  }
3366
3402
  const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: Boolean(display), active: open });
3367
- return /* @__PURE__ */ jsxs16("span", { ref: rootRef, style, className: `sia-picker sia-time-picker${floating.className} sia-picker--${size} sia-picker--${status}${disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
3403
+ return /* @__PURE__ */ jsxs16("span", { ref: setRootRef, style, className: `sia-picker sia-time-picker${floating.className} sia-picker--${size} sia-picker--${status}${disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
3368
3404
  /* @__PURE__ */ jsx17(
3369
3405
  "input",
3370
3406
  {
@@ -3438,8 +3474,8 @@ function TimePicker({
3438
3474
  }
3439
3475
  )
3440
3476
  ] });
3441
- }
3442
- function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F00\u59CB\u65F6\u95F4", "\u7ED3\u675F\u65F6\u95F4"], separator = "\u2192", onChange, className = "", style, ...props }) {
3477
+ });
3478
+ var TimeRangePicker = forwardRef10(function TimeRangePicker2({ value, defaultValue = ["", ""], placeholder = ["\u5F00\u59CB\u65F6\u95F4", "\u7ED3\u675F\u65F6\u95F4"], separator = "\u2192", onChange, className = "", style, ...props }, forwardedRef) {
3443
3479
  const size = useControlSize(props.size);
3444
3480
  const [currentValue, setValue2] = useControllableState({ value: value === void 0 ? void 0 : Array.isArray(value) ? value : ["", ""], defaultValue, onChange });
3445
3481
  function update(index, next) {
@@ -3447,18 +3483,19 @@ function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F0
3447
3483
  pair[index] = next;
3448
3484
  setValue2(pair);
3449
3485
  }
3450
- return /* @__PURE__ */ jsxs16("span", { style, className: `sia-time-range sia-picker--${size} sia-picker--${props.status ?? "default"}${props.disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
3451
- /* @__PURE__ */ jsx17(TimePicker, { ...props, "aria-label": props["aria-label"] ? props["aria-label"] + "\u5F00\u59CB\u65F6\u95F4" : "\u5F00\u59CB\u65F6\u95F4", value: currentValue[0], placeholder: placeholder[0], max: currentValue[1] && (!props.max || seconds(currentValue[1]) < seconds(String(props.max))) ? currentValue[1] : props.max, onChange: (next) => update(0, next) }),
3486
+ return /* @__PURE__ */ jsxs16("span", { ref: forwardedRef, style, className: `sia-time-range sia-picker--${size} sia-picker--${props.status ?? "default"}${props.disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
3487
+ /* @__PURE__ */ jsx17(TimePickerRoot, { ...props, "aria-label": props["aria-label"] ? props["aria-label"] + "\u5F00\u59CB\u65F6\u95F4" : "\u5F00\u59CB\u65F6\u95F4", value: currentValue[0], placeholder: placeholder[0], max: currentValue[1] && (!props.max || seconds(currentValue[1]) < seconds(String(props.max))) ? currentValue[1] : props.max, onChange: (next) => update(0, next) }),
3452
3488
  /* @__PURE__ */ jsx17("span", { className: "sia-time-range__separator", children: separator }),
3453
- /* @__PURE__ */ jsx17(TimePicker, { ...props, id: props.id ? props.id + "-end" : void 0, "aria-label": props["aria-label"] ? props["aria-label"] + "\u7ED3\u675F\u65F6\u95F4" : "\u7ED3\u675F\u65F6\u95F4", value: currentValue[1], placeholder: placeholder[1], min: currentValue[0] && (!props.min || seconds(currentValue[0]) > seconds(String(props.min))) ? currentValue[0] : props.min, onChange: (next) => update(1, next) })
3489
+ /* @__PURE__ */ jsx17(TimePickerRoot, { ...props, id: props.id ? props.id + "-end" : void 0, "aria-label": props["aria-label"] ? props["aria-label"] + "\u7ED3\u675F\u65F6\u95F4" : "\u7ED3\u675F\u65F6\u95F4", value: currentValue[1], placeholder: placeholder[1], min: currentValue[0] && (!props.min || seconds(currentValue[0]) > seconds(String(props.min))) ? currentValue[0] : props.min, onChange: (next) => update(1, next) })
3454
3490
  ] });
3455
- }
3456
- ((TimePicker2) => {
3457
- TimePicker2.RangePicker = TimeRangePicker;
3458
- })(TimePicker || (TimePicker = {}));
3491
+ });
3492
+ var TimePicker2 = Object.assign(TimePickerRoot, {
3493
+ /** 时间区间选择器。 */
3494
+ RangePicker: TimeRangePicker
3495
+ });
3459
3496
 
3460
3497
  // src/components/TreeSelect.tsx
3461
- import { useEffect as useEffect9, useMemo as useMemo6, useRef as useRef14, useState as useState14 } from "react";
3498
+ import { forwardRef as forwardRef11, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef14, useState as useState14 } from "react";
3462
3499
  import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
3463
3500
  function flattenTree(nodes, expanded, search, filter, depth = 0, parents = [], ancestorMatched = false) {
3464
3501
  const result = [];
@@ -3479,7 +3516,7 @@ function findNodes(nodes, values, result = []) {
3479
3516
  }
3480
3517
  return result;
3481
3518
  }
3482
- function TreeSelect({
3519
+ var TreeSelect = forwardRef11(function TreeSelect2({
3483
3520
  treeData,
3484
3521
  value,
3485
3522
  defaultValue,
@@ -3519,9 +3556,14 @@ function TreeSelect({
3519
3556
  onSelect,
3520
3557
  onDeselect,
3521
3558
  ...props
3522
- }) {
3559
+ }, forwardedRef) {
3523
3560
  const size = useControlSize(sizeProp);
3524
3561
  const rootRef = useRef14(null);
3562
+ function setRootRef(node) {
3563
+ rootRef.current = node;
3564
+ if (typeof forwardedRef === "function") forwardedRef(node);
3565
+ else if (forwardedRef) forwardedRef.current = node;
3566
+ }
3525
3567
  const popupRef = useRef14(null);
3526
3568
  const nodeIndex = useMemo6(() => {
3527
3569
  const index = /* @__PURE__ */ new Map();
@@ -3673,7 +3715,7 @@ function TreeSelect({
3673
3715
  return /* @__PURE__ */ jsxs17(
3674
3716
  "div",
3675
3717
  {
3676
- ref: rootRef,
3718
+ ref: setRootRef,
3677
3719
  className: `sia-tree-select sia-tree-select--${size} sia-tree-select--${status}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
3678
3720
  ...withTitleTooltip(props),
3679
3721
  onKeyDown: (event) => {
@@ -3745,7 +3787,7 @@ function TreeSelect({
3745
3787
  ]
3746
3788
  }
3747
3789
  );
3748
- }
3790
+ });
3749
3791
 
3750
3792
  // src/components/flatTree.ts
3751
3793
  function buildFlatTree(items, options = {}) {
@@ -5452,13 +5494,13 @@ function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", r
5452
5494
  }
5453
5495
 
5454
5496
  // src/components/InputNumber.tsx
5455
- import { forwardRef as forwardRef5, useEffect as useEffect13, useId as useId7, useRef as useRef18, useState as useState18 } from "react";
5497
+ import { forwardRef as forwardRef12, useEffect as useEffect13, useId as useId7, useRef as useRef18, useState as useState18 } from "react";
5456
5498
  import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
5457
5499
  function formatValue(value, precision) {
5458
5500
  if (value === null || !Number.isFinite(value)) return "";
5459
5501
  return precision === void 0 ? String(value) : value.toFixed(precision);
5460
5502
  }
5461
- var InputNumber = forwardRef5(function InputNumber2({
5503
+ var InputNumber = forwardRef12(function InputNumber2({
5462
5504
  value,
5463
5505
  defaultValue = null,
5464
5506
  onChange,
@@ -5601,10 +5643,11 @@ var InputNumber = forwardRef5(function InputNumber2({
5601
5643
  // src/components/SelectModal.tsx
5602
5644
  import { useState as useState19 } from "react";
5603
5645
  import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
5604
- function SelectModalBody({ config, values, disabled, onChange }) {
5605
- const [query, setQuery] = useState19("");
5646
+ function SelectModalBody({ config, values, query, disabled, onChange }) {
5606
5647
  const [selectedOnly, setSelectedOnly] = useState19(false);
5607
5648
  const multiple = config.mode === "multiple";
5649
+ const loading = Boolean(config.loading);
5650
+ const busy = disabled || loading;
5608
5651
  const search = query.trim();
5609
5652
  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()))));
5610
5653
  const enabled = filtered.filter((option) => !option.disabled && (!selectedOnly || values.includes(option.value)));
@@ -5619,44 +5662,27 @@ function SelectModalBody({ config, values, disabled, onChange }) {
5619
5662
  };
5620
5663
  return /* @__PURE__ */ jsxs22(Fragment7, { children: [
5621
5664
  config.headerExtra != null && config.headerExtra !== false ? /* @__PURE__ */ jsx23("div", { className: "sia-select-modal__header-extra", children: config.headerExtra }) : null,
5622
- /* @__PURE__ */ jsxs22("div", { className: "sia-select-modal__heading", children: [
5623
- /* @__PURE__ */ jsxs22("div", { role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
5624
- /* @__PURE__ */ jsx23(Button, { role: "tab", "aria-selected": !selectedOnly, variant: "link", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
5625
- /* @__PURE__ */ jsxs22(Button, { role: "tab", "aria-selected": selectedOnly, variant: "link", onClick: () => setSelectedOnly(true), children: [
5626
- "\u5DF2\u9009\u9879(",
5627
- values.length,
5628
- ")"
5629
- ] })
5630
- ] }),
5631
- /* @__PURE__ */ jsx23(
5632
- Input,
5633
- {
5634
- "aria-label": config.searchPlaceholder ?? "\u641C\u7D22\u9009\u9879",
5635
- placeholder: config.searchPlaceholder ?? "\u641C\u7D22\u9009\u9879",
5636
- prefix: /* @__PURE__ */ jsx23(Icon, { name: "search", size: 14 }),
5637
- value: query,
5638
- allowClear: true,
5639
- disabled,
5640
- onChange: (event) => {
5641
- setQuery(event.target.value);
5642
- config.onSearch?.(event.target.value);
5643
- }
5644
- }
5645
- )
5646
- ] }),
5665
+ /* @__PURE__ */ jsx23("div", { className: "sia-select-modal__heading", children: /* @__PURE__ */ jsxs22("div", { role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
5666
+ /* @__PURE__ */ jsx23(Button, { role: "tab", "aria-selected": !selectedOnly, variant: "link", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
5667
+ /* @__PURE__ */ jsxs22(Button, { role: "tab", "aria-selected": selectedOnly, variant: "link", onClick: () => setSelectedOnly(true), children: [
5668
+ "\u5DF2\u9009\u9879(",
5669
+ values.length,
5670
+ ")"
5671
+ ] })
5672
+ ] }) }),
5647
5673
  multiple ? /* @__PURE__ */ jsxs22("div", { className: "sia-select-modal__actions", children: [
5648
5674
  /* @__PURE__ */ jsx23(
5649
5675
  Checkbox,
5650
5676
  {
5651
5677
  checked: all,
5652
5678
  indeterminate: !all && enabled.some((option) => values.includes(option.value)),
5653
- disabled: disabled || !enabled.length,
5679
+ disabled: busy || !enabled.length,
5654
5680
  onChange: (checked) => batch(checked ? "all" : "remove"),
5655
5681
  children: "\u5168\u9009"
5656
5682
  }
5657
5683
  ),
5658
- /* @__PURE__ */ jsx23(Button, { variant: "link", size: "small", disabled: disabled || !enabled.length, onClick: () => batch("invert"), children: "\u53CD\u9009" }),
5659
- /* @__PURE__ */ jsx23(Button, { variant: "link", size: "small", danger: true, disabled: disabled || !values.length, onClick: () => onChange([]), children: "\u6E05\u7A7A" })
5684
+ /* @__PURE__ */ jsx23(Button, { variant: "link", size: "small", disabled: busy || !enabled.length, onClick: () => batch("invert"), children: "\u53CD\u9009" }),
5685
+ /* @__PURE__ */ jsx23(Button, { variant: "link", size: "small", danger: true, disabled: busy || !values.length, onClick: () => onChange([]), children: "\u6E05\u7A7A" })
5660
5686
  ] }) : null,
5661
5687
  /* @__PURE__ */ jsx23(
5662
5688
  SelectionPanel,
@@ -5667,6 +5693,7 @@ function SelectModalBody({ config, values, disabled, onChange }) {
5667
5693
  multiple,
5668
5694
  groupCheckable: config.groupCheckable,
5669
5695
  disabled,
5696
+ loading,
5670
5697
  selectedOnly,
5671
5698
  showValue: config.showValue,
5672
5699
  showSearch: false,
@@ -5683,25 +5710,52 @@ function openSelectModal(config) {
5683
5710
  const normalize = (value) => value == null ? [] : Array.isArray(value) ? [...value] : [value];
5684
5711
  let values = normalize(config.value);
5685
5712
  if (config.mode !== "multiple") values = values.slice(0, 1);
5713
+ let query = "";
5686
5714
  let submitting = false;
5715
+ function renderTitleExtra() {
5716
+ const placeholder = current.searchPlaceholder ?? "\u641C\u7D22\u9009\u9879";
5717
+ return /* @__PURE__ */ jsxs22(Fragment7, { children: [
5718
+ current.titleExtra != null && current.titleExtra !== false ? current.titleExtra : null,
5719
+ /* @__PURE__ */ jsx23(
5720
+ Input,
5721
+ {
5722
+ className: "sia-select-modal__search",
5723
+ "aria-label": placeholder,
5724
+ placeholder,
5725
+ placeholderMode: "default",
5726
+ prefix: /* @__PURE__ */ jsx23(Icon, { name: "search", size: 14 }),
5727
+ value: query,
5728
+ allowClear: true,
5729
+ disabled: submitting || Boolean(current.confirmLoading),
5730
+ onChange: (event) => {
5731
+ query = event.target.value;
5732
+ current.onSearch?.(query);
5733
+ handle.update({ titleExtra: renderTitleExtra(), children: body() });
5734
+ }
5735
+ },
5736
+ "sia-select-modal-search"
5737
+ )
5738
+ ] });
5739
+ }
5687
5740
  function body() {
5688
- return /* @__PURE__ */ jsx23(SelectModalBody, { config: current, values, disabled: submitting || Boolean(current.confirmLoading), onChange: (next) => {
5741
+ return /* @__PURE__ */ jsx23(SelectModalBody, { config: current, values, query, disabled: submitting || Boolean(current.confirmLoading), onChange: (next) => {
5689
5742
  values = next;
5690
5743
  handle.update({ children: body() });
5691
5744
  } });
5692
5745
  }
5693
5746
  function modalConfig() {
5694
- const { options, value, mode, groupCheckable, showValue, columns, maxHeight, headerExtra, extraValues, searchPlaceholder, filterOption, onSearch, onConfirm, ...modal } = current;
5747
+ const { options, value, mode, groupCheckable, showValue, columns, maxHeight, loading, titleExtra, headerExtra, extraValues, searchPlaceholder, filterOption, onSearch, onConfirm, ...modal } = current;
5695
5748
  return {
5696
5749
  ...modal,
5697
5750
  title: current.title ?? "\u8BF7\u9009\u62E9",
5751
+ titleExtra: renderTitleExtra(),
5698
5752
  width: current.width ?? 900,
5699
5753
  className: `sia-select-modal ${current.className ?? ""}`,
5700
5754
  children: body(),
5701
5755
  onOk: async () => {
5702
5756
  const selected = values.map((value2) => current.options.find((option) => option.value === value2) ?? { value: value2, label: String(value2) });
5703
5757
  submitting = true;
5704
- handle.update({ children: body() });
5758
+ handle.update({ titleExtra: renderTitleExtra(), children: body() });
5705
5759
  try {
5706
5760
  return await current.onConfirm?.(
5707
5761
  current.mode === "multiple" ? [...values] : values[0] ?? null,
@@ -5710,7 +5764,7 @@ function openSelectModal(config) {
5710
5764
  );
5711
5765
  } finally {
5712
5766
  submitting = false;
5713
- handle.update({ children: body() });
5767
+ handle.update({ titleExtra: renderTitleExtra(), children: body() });
5714
5768
  }
5715
5769
  }
5716
5770
  };
@@ -6742,130 +6796,10 @@ function playCellFocusGlow(cell, isVisible, onFinish, options) {
6742
6796
  }
6743
6797
 
6744
6798
  // src/components/Table/Table.tsx
6745
- import { Fragment as Fragment9, forwardRef as forwardRef6, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect17, useImperativeHandle, useMemo as useMemo10, useRef as useRef24, useState as useState24 } from "react";
6799
+ import { Fragment as Fragment12, forwardRef as forwardRef13, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect19, useImperativeHandle, useMemo as useMemo10, useRef as useRef27, useState as useState27 } from "react";
6746
6800
  import { flushSync } from "react-dom";
6747
6801
 
6748
- // src/components/Table/plugins.tsx
6749
- import { isValidElement as isValidElement3, useEffect as useEffect16, useRef as useRef23, useState as useState23 } from "react";
6750
-
6751
- // src/components/Table/columnSettings.ts
6752
- function reconcileColumnSettings(columns, defaults, saved) {
6753
- const stored = new Map(saved.map((item) => [item.key, item]));
6754
- const base = new Map(defaults.map((item) => [item.key, item]));
6755
- const result = [];
6756
- const rank = (column) => {
6757
- const own = stored.get(column.key)?.order;
6758
- if (own !== void 0) return own;
6759
- const children = column.children?.map(rank).filter((value) => value !== void 0);
6760
- return children?.length ? Math.min(...children) : void 0;
6761
- };
6762
- const walk = (source, parent) => {
6763
- const entries = source.map((column, index) => ({ column, index, rank: rank(column) }));
6764
- let anchor = -1;
6765
- for (const entry of entries) {
6766
- if (entry.rank !== void 0) anchor = entry.rank;
6767
- else entry.rank = anchor + (entry.index + 1) / (entries.length + 1);
6768
- }
6769
- entries.sort((a, b) => a.rank - b.rank || a.index - b.index);
6770
- for (const { column } of entries) {
6771
- const own = stored.get(column.key);
6772
- if (column.children?.length) {
6773
- walk(column.children, own ?? parent);
6774
- } else {
6775
- const fallback = base.get(column.key);
6776
- if (!fallback) continue;
6777
- const item = own ?? {
6778
- ...fallback,
6779
- fixed: parent?.fixed ?? fallback.fixed,
6780
- visible: fallback.visible && (parent?.visible ?? true)
6781
- };
6782
- result.push({ ...item, order: result.length });
6783
- }
6784
- }
6785
- };
6786
- walk(columns);
6787
- return result;
6788
- }
6789
- function mergeColumnSettings(columns, saved, active) {
6790
- const merged = new Map(saved.filter((item) => !["__index__", "__selection__"].includes(item.key)).map((item) => [item.key, item]));
6791
- active.forEach((item) => merged.set(item.key, item));
6792
- const current = new Map(active.map((item) => [item.key, item]));
6793
- const walk = (column) => {
6794
- if (!column.children?.length) return current.has(column.key) ? [current.get(column.key)] : [];
6795
- const leaves = column.children.flatMap(walk);
6796
- if (leaves.length) {
6797
- const old = merged.get(column.key);
6798
- merged.set(column.key, {
6799
- key: column.key,
6800
- width: old?.width ?? column.width,
6801
- fixed: old?.fixed,
6802
- visible: leaves.some((item) => item.visible),
6803
- order: Math.min(...leaves.map((item) => item.order))
6804
- });
6805
- }
6806
- return leaves;
6807
- };
6808
- columns.forEach(walk);
6809
- return [...merged.values()].sort((left, right) => left.order - right.order);
6810
- }
6811
-
6812
- // src/components/settingsPersistence.ts
6813
- var queues = /* @__PURE__ */ new WeakMap();
6814
- function saveSettingsPatch(adapter, scope, patch) {
6815
- let scoped = queues.get(adapter);
6816
- if (!scoped) {
6817
- scoped = /* @__PURE__ */ new Map();
6818
- queues.set(adapter, scoped);
6819
- }
6820
- const key = JSON.stringify([scope.moduleName, scope.businessKey]);
6821
- const previous = scoped.get(key) ?? Promise.resolve();
6822
- const task = previous.catch(() => void 0).then(async () => {
6823
- const current = await adapter.load(scope);
6824
- const defined = Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== void 0));
6825
- await adapter.save(scope, { ...current, ...defined });
6826
- });
6827
- scoped.set(key, task);
6828
- const cleanup = () => {
6829
- if (scoped.get(key) === task) scoped.delete(key);
6830
- };
6831
- void task.then(cleanup, cleanup);
6832
- return task;
6833
- }
6834
-
6835
- // src/components/Table/plugins.tsx
6836
- import { Fragment as Fragment8, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
6837
- function TableCheckbox({
6838
- checked,
6839
- indeterminate,
6840
- disabled,
6841
- label,
6842
- onChange
6843
- }) {
6844
- return /* @__PURE__ */ jsx28(
6845
- Checkbox,
6846
- {
6847
- className: "sia-table__checkbox",
6848
- "aria-label": label,
6849
- checked,
6850
- indeterminate,
6851
- disabled,
6852
- onClick: (event) => event.stopPropagation(),
6853
- onChange
6854
- }
6855
- );
6856
- }
6857
- function flattenRecords(data, childrenColumnName) {
6858
- const result = [];
6859
- const walk = (records) => {
6860
- for (const record of records) {
6861
- result.push(record);
6862
- const children = record[childrenColumnName];
6863
- if (Array.isArray(children)) walk(children);
6864
- }
6865
- };
6866
- walk(data);
6867
- return result;
6868
- }
6802
+ // src/components/Table/plugins/layout.tsx
6869
6803
  function createColumnTransformPlugin(options) {
6870
6804
  return {
6871
6805
  id: "columnTransform",
@@ -6922,62 +6856,198 @@ function createHighlightPlugin(options = { row: true }) {
6922
6856
  }
6923
6857
  };
6924
6858
  }
6925
- function sameCellAddress(left, right) {
6926
- return Object.is(left.rowKey, right.rowKey) && left.columnKey === right.columnKey;
6927
- }
6928
- function isInteractiveTableTarget(target) {
6929
- return target instanceof Element && Boolean(
6930
- target.closest(
6931
- "button, input, textarea, select, a, [contenteditable='true'], [role='button'], [role='separator']"
6932
- )
6933
- );
6859
+ var ROW_SPAN_META_KEY = "__siaTableRowSpan";
6860
+ function getRowSpanGroupValue(column, record, index, records) {
6861
+ const config = column.rowSpan;
6862
+ if (typeof config === "function") return config(record, index, records);
6863
+ const dataIndex = typeof config === "boolean" || config === void 0 ? column.dataIndex : config;
6864
+ return getTableValue(record, dataIndex, column.code ?? column.key);
6934
6865
  }
6935
- function createCellSelectionPlugin(options = {}) {
6936
- let dragMode = null;
6937
- let dragAnchor = null;
6938
- let textCell = null;
6939
- let headerDragAnchorKey = null;
6940
- let snapshotCache = null;
6941
- let latestContext = null;
6942
- let activeRoot = null;
6943
- function selectableColumns(context) {
6944
- return flattenTableColumns(sortTableColumnsByFixed(context.columns)).filter(
6945
- (column) => options.includeUtilityColumns || !column.meta?.plugin || column.meta.plugin === "index"
6946
- );
6947
- }
6948
- function rememberContext(context) {
6949
- latestContext = context;
6950
- return context;
6951
- }
6952
- function focusTable(target) {
6953
- if (!(target instanceof Element)) return;
6954
- const root = target.closest(".sia-table");
6955
- if (!root) return;
6956
- activeRoot = root;
6957
- if (!root.hasAttribute("tabindex")) root.tabIndex = -1;
6958
- root.focus({ preventScroll: true });
6959
- }
6960
- function findColumn(context, key) {
6961
- const stack = [...sortTableColumnsByFixed(context.columns)];
6962
- while (stack.length > 0) {
6963
- const column = stack.shift();
6964
- if (column.key === key) return column;
6965
- if (column.children?.length) stack.unshift(...column.children);
6966
- }
6967
- return void 0;
6968
- }
6969
- function findColumnPath(columns, key, path = []) {
6970
- for (const column of columns) {
6971
- if (column.hidden) continue;
6972
- const nextPath = [...path, column];
6973
- if (column.key === key) return nextPath;
6974
- const childPath = column.children?.length ? findColumnPath(column.children, key, nextPath) : null;
6975
- if (childPath) return childPath;
6976
- }
6977
- return null;
6978
- }
6979
- function isSelectable(row, column, context) {
6980
- const snapshot = getSnapshot(context);
6866
+ function createRowSpanPlugin(options = {}) {
6867
+ return {
6868
+ id: "rowSpan",
6869
+ order: 65,
6870
+ disableVirtual: options.disableVirtual ?? true,
6871
+ transformRows(rows, context) {
6872
+ const configured = flattenTableColumns(context.columns).filter(
6873
+ (column) => column.rowSpan && (!options.columns || options.columns.includes(column.key))
6874
+ );
6875
+ if (configured.length === 0 || rows.length === 0) return rows;
6876
+ const records = rows.map((row) => row.record);
6877
+ const nextRows = rows.map((row) => ({
6878
+ ...row,
6879
+ meta: { ...row.meta, [ROW_SPAN_META_KEY]: {} }
6880
+ }));
6881
+ for (const column of configured) {
6882
+ let start = 0;
6883
+ while (start < rows.length) {
6884
+ const value = getRowSpanGroupValue(
6885
+ column,
6886
+ rows[start].record,
6887
+ start,
6888
+ records
6889
+ );
6890
+ let end = start + 1;
6891
+ while (end < rows.length) {
6892
+ const nextValue = getRowSpanGroupValue(
6893
+ column,
6894
+ rows[end].record,
6895
+ end,
6896
+ records
6897
+ );
6898
+ const equal = options.equals?.(value, nextValue, column) ?? Object.is(value, nextValue);
6899
+ if (!equal) break;
6900
+ end += 1;
6901
+ }
6902
+ const span = end - start;
6903
+ const firstMeta = nextRows[start].meta[ROW_SPAN_META_KEY];
6904
+ firstMeta[column.key] = { rowSpan: span };
6905
+ for (let index = start + 1; index < end; index += 1) {
6906
+ const meta = nextRows[index].meta[ROW_SPAN_META_KEY];
6907
+ meta[column.key] = { hidden: true };
6908
+ }
6909
+ start = end;
6910
+ }
6911
+ }
6912
+ return nextRows;
6913
+ },
6914
+ getCellProps(row, column, context) {
6915
+ const meta = row.meta[ROW_SPAN_META_KEY];
6916
+ const cell = meta?.[column.key];
6917
+ if (!cell?.rowSpan || cell.rowSpan <= 1) return cell;
6918
+ const sticky = column.mergeSticky;
6919
+ if (!sticky) return { ...cell, className: "sia-table__cell--row-span" };
6920
+ const config = typeof sticky === "object" ? sticky : {};
6921
+ const records = context.rows.map((item) => item.record);
6922
+ return {
6923
+ ...cell,
6924
+ className: [
6925
+ "sia-table__cell--row-span",
6926
+ "sia-table__cell--merge-sticky",
6927
+ config.className
6928
+ ].filter(Boolean).join(" "),
6929
+ style: {
6930
+ ...config.style,
6931
+ textAlign: config.align,
6932
+ "--sia-table-merge-sticky-inset": `${config.inset ?? 0}px`,
6933
+ "--sia-table-merge-sticky-z-index": config.zIndex ?? 3
6934
+ },
6935
+ content: config.getValue?.(row.record, row.sourceIndex, records)
6936
+ };
6937
+ }
6938
+ };
6939
+ }
6940
+
6941
+ // src/components/Table/plugins/shared.tsx
6942
+ import { isValidElement as isValidElement3 } from "react";
6943
+ import { jsx as jsx28 } from "react/jsx-runtime";
6944
+ function TableCheckbox({
6945
+ checked,
6946
+ indeterminate,
6947
+ disabled,
6948
+ label,
6949
+ onChange
6950
+ }) {
6951
+ return /* @__PURE__ */ jsx28(
6952
+ Checkbox,
6953
+ {
6954
+ className: "sia-table__checkbox",
6955
+ "aria-label": label,
6956
+ checked,
6957
+ indeterminate,
6958
+ disabled,
6959
+ onClick: (event) => event.stopPropagation(),
6960
+ onChange
6961
+ }
6962
+ );
6963
+ }
6964
+ function flattenRecords(data, childrenColumnName) {
6965
+ const result = [];
6966
+ const walk = (records) => {
6967
+ for (const record of records) {
6968
+ result.push(record);
6969
+ const children = record[childrenColumnName];
6970
+ if (Array.isArray(children)) walk(children);
6971
+ }
6972
+ };
6973
+ walk(data);
6974
+ return result;
6975
+ }
6976
+ function tableExportText(node) {
6977
+ if (node === null || node === void 0 || typeof node === "boolean")
6978
+ return "";
6979
+ if (typeof node === "string" || typeof node === "number" || typeof node === "bigint")
6980
+ return String(node);
6981
+ if (Array.isArray(node)) return node.map(tableExportText).join("");
6982
+ if (isValidElement3(node))
6983
+ return tableExportText(node.props.children);
6984
+ return "";
6985
+ }
6986
+ function tableExportCell(value, sanitizeFormula) {
6987
+ const text = value === null || value === void 0 ? "" : typeof value === "object" ? JSON.stringify(value) : String(value);
6988
+ return sanitizeFormula && /^[=+\-@]/.test(text) ? `'${text}` : text;
6989
+ }
6990
+ function tableExportEscape(value, delimiter) {
6991
+ return value.includes(delimiter) || /["\r\n]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value;
6992
+ }
6993
+
6994
+ // src/components/Table/plugins/cellSelection.tsx
6995
+ function sameCellAddress(left, right) {
6996
+ return Object.is(left.rowKey, right.rowKey) && left.columnKey === right.columnKey;
6997
+ }
6998
+ function isInteractiveTableTarget(target) {
6999
+ return target instanceof Element && Boolean(
7000
+ target.closest(
7001
+ "button, input, textarea, select, a, [contenteditable='true'], [role='button'], [role='separator']"
7002
+ )
7003
+ );
7004
+ }
7005
+ function createCellSelectionPlugin(options = {}) {
7006
+ let dragMode = null;
7007
+ let dragAnchor = null;
7008
+ let textCell = null;
7009
+ let headerDragAnchorKey = null;
7010
+ let snapshotCache = null;
7011
+ let latestContext = null;
7012
+ let activeRoot = null;
7013
+ function selectableColumns(context) {
7014
+ return flattenTableColumns(sortTableColumnsByFixed(context.columns)).filter(
7015
+ (column) => options.includeUtilityColumns || !column.meta?.plugin || column.meta.plugin === "index"
7016
+ );
7017
+ }
7018
+ function rememberContext(context) {
7019
+ latestContext = context;
7020
+ return context;
7021
+ }
7022
+ function focusTable(target) {
7023
+ if (!(target instanceof Element)) return;
7024
+ const root = target.closest(".sia-table");
7025
+ if (!root) return;
7026
+ activeRoot = root;
7027
+ if (!root.hasAttribute("tabindex")) root.tabIndex = -1;
7028
+ root.focus({ preventScroll: true });
7029
+ }
7030
+ function findColumn(context, key) {
7031
+ const stack = [...sortTableColumnsByFixed(context.columns)];
7032
+ while (stack.length > 0) {
7033
+ const column = stack.shift();
7034
+ if (column.key === key) return column;
7035
+ if (column.children?.length) stack.unshift(...column.children);
7036
+ }
7037
+ return void 0;
7038
+ }
7039
+ function findColumnPath(columns, key, path = []) {
7040
+ for (const column of columns) {
7041
+ if (column.hidden) continue;
7042
+ const nextPath = [...path, column];
7043
+ if (column.key === key) return nextPath;
7044
+ const childPath = column.children?.length ? findColumnPath(column.children, key, nextPath) : null;
7045
+ if (childPath) return childPath;
7046
+ }
7047
+ return null;
7048
+ }
7049
+ function isSelectable(row, column, context) {
7050
+ const snapshot = getSnapshot(context);
6981
7051
  const columnIndex = snapshot.columnIndexes.get(column.key);
6982
7052
  if (columnIndex === void 0) return false;
6983
7053
  const rowIndex = snapshot.rowIndexes.get(row.key);
@@ -7370,87 +7440,10 @@ function createCellSelectionPlugin(options = {}) {
7370
7440
  })
7371
7441
  };
7372
7442
  }
7373
- var ROW_SPAN_META_KEY = "__siaTableRowSpan";
7374
- function getRowSpanGroupValue(column, record, index, records) {
7375
- const config = column.rowSpan;
7376
- if (typeof config === "function") return config(record, index, records);
7377
- const dataIndex = typeof config === "boolean" || config === void 0 ? column.dataIndex : config;
7378
- return getTableValue(record, dataIndex, column.code ?? column.key);
7379
- }
7380
- function createRowSpanPlugin(options = {}) {
7381
- return {
7382
- id: "rowSpan",
7383
- order: 65,
7384
- disableVirtual: options.disableVirtual ?? true,
7385
- transformRows(rows, context) {
7386
- const configured = flattenTableColumns(context.columns).filter(
7387
- (column) => column.rowSpan && (!options.columns || options.columns.includes(column.key))
7388
- );
7389
- if (configured.length === 0 || rows.length === 0) return rows;
7390
- const records = rows.map((row) => row.record);
7391
- const nextRows = rows.map((row) => ({
7392
- ...row,
7393
- meta: { ...row.meta, [ROW_SPAN_META_KEY]: {} }
7394
- }));
7395
- for (const column of configured) {
7396
- let start = 0;
7397
- while (start < rows.length) {
7398
- const value = getRowSpanGroupValue(
7399
- column,
7400
- rows[start].record,
7401
- start,
7402
- records
7403
- );
7404
- let end = start + 1;
7405
- while (end < rows.length) {
7406
- const nextValue = getRowSpanGroupValue(
7407
- column,
7408
- rows[end].record,
7409
- end,
7410
- records
7411
- );
7412
- const equal = options.equals?.(value, nextValue, column) ?? Object.is(value, nextValue);
7413
- if (!equal) break;
7414
- end += 1;
7415
- }
7416
- const span = end - start;
7417
- const firstMeta = nextRows[start].meta[ROW_SPAN_META_KEY];
7418
- firstMeta[column.key] = { rowSpan: span };
7419
- for (let index = start + 1; index < end; index += 1) {
7420
- const meta = nextRows[index].meta[ROW_SPAN_META_KEY];
7421
- meta[column.key] = { hidden: true };
7422
- }
7423
- start = end;
7424
- }
7425
- }
7426
- return nextRows;
7427
- },
7428
- getCellProps(row, column, context) {
7429
- const meta = row.meta[ROW_SPAN_META_KEY];
7430
- const cell = meta?.[column.key];
7431
- if (!cell?.rowSpan || cell.rowSpan <= 1) return cell;
7432
- const sticky = column.mergeSticky;
7433
- if (!sticky) return { ...cell, className: "sia-table__cell--row-span" };
7434
- const config = typeof sticky === "object" ? sticky : {};
7435
- const records = context.rows.map((item) => item.record);
7436
- return {
7437
- ...cell,
7438
- className: [
7439
- "sia-table__cell--row-span",
7440
- "sia-table__cell--merge-sticky",
7441
- config.className
7442
- ].filter(Boolean).join(" "),
7443
- style: {
7444
- ...config.style,
7445
- textAlign: config.align,
7446
- "--sia-table-merge-sticky-inset": `${config.inset ?? 0}px`,
7447
- "--sia-table-merge-sticky-z-index": config.zIndex ?? 3
7448
- },
7449
- content: config.getValue?.(row.record, row.sourceIndex, records)
7450
- };
7451
- }
7452
- };
7453
- }
7443
+
7444
+ // src/components/Table/plugins/selection.tsx
7445
+ import { useState as useState23 } from "react";
7446
+ import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
7454
7447
  function TableSelectedItemsPanel({
7455
7448
  entries,
7456
7449
  columns,
@@ -7469,10 +7462,10 @@ function TableSelectedItemsPanel({
7469
7462
  /* @__PURE__ */ jsxs24("div", { className: "sia-table-selection-panel__header", children: [
7470
7463
  /* @__PURE__ */ jsxs24("strong", { children: [
7471
7464
  "\u5DF2\u9009 ",
7472
- /* @__PURE__ */ jsx28("span", { children: entries.length }),
7465
+ /* @__PURE__ */ jsx29("span", { children: entries.length }),
7473
7466
  " \u9879"
7474
7467
  ] }),
7475
- /* @__PURE__ */ jsx28(
7468
+ /* @__PURE__ */ jsx29(
7476
7469
  Button,
7477
7470
  {
7478
7471
  size: "small",
@@ -7483,15 +7476,15 @@ function TableSelectedItemsPanel({
7483
7476
  }
7484
7477
  )
7485
7478
  ] }),
7486
- /* @__PURE__ */ jsx28("div", { className: "sia-table-selection-panel__body", children: /* @__PURE__ */ jsxs24("table", { children: [
7487
- /* @__PURE__ */ jsx28("thead", { children: /* @__PURE__ */ jsxs24("tr", { children: [
7488
- columns.map((column) => /* @__PURE__ */ jsx28("th", { children: getColumnLabel(column) }, column.key)),
7489
- /* @__PURE__ */ jsx28("th", { "aria-label": "\u64CD\u4F5C" })
7479
+ /* @__PURE__ */ jsx29("div", { className: "sia-table-selection-panel__body", children: /* @__PURE__ */ jsxs24("table", { children: [
7480
+ /* @__PURE__ */ jsx29("thead", { children: /* @__PURE__ */ jsxs24("tr", { children: [
7481
+ columns.map((column) => /* @__PURE__ */ jsx29("th", { children: getColumnLabel(column) }, column.key)),
7482
+ /* @__PURE__ */ jsx29("th", { "aria-label": "\u64CD\u4F5C" })
7490
7483
  ] }) }),
7491
- /* @__PURE__ */ jsx28("tbody", { children: visibleEntries.map((entry, selectedIndex) => /* @__PURE__ */ jsxs24("tr", { children: [
7484
+ /* @__PURE__ */ jsx29("tbody", { children: visibleEntries.map((entry, selectedIndex) => /* @__PURE__ */ jsxs24("tr", { children: [
7492
7485
  columns.map((column) => {
7493
7486
  if (column.meta?.plugin === "index")
7494
- return /* @__PURE__ */ jsx28("td", { children: entry.sourceIndex + 1 }, column.key);
7487
+ return /* @__PURE__ */ jsx29("td", { children: entry.sourceIndex + 1 }, column.key);
7495
7488
  const baseColumn = baseColumnMap.get(column.key) ?? column;
7496
7489
  const value = getTableValue(
7497
7490
  entry.record,
@@ -7511,9 +7504,9 @@ function TableSelectedItemsPanel({
7511
7504
  entry.sourceIndex,
7512
7505
  { row, rowIndex: entry.sourceIndex, column: baseColumn }
7513
7506
  ) ?? value;
7514
- return /* @__PURE__ */ jsx28("td", { children: content }, column.key);
7507
+ return /* @__PURE__ */ jsx29("td", { children: content }, column.key);
7515
7508
  }),
7516
- /* @__PURE__ */ jsx28("td", { children: /* @__PURE__ */ jsx28(
7509
+ /* @__PURE__ */ jsx29("td", { children: /* @__PURE__ */ jsx29(
7517
7510
  Button,
7518
7511
  {
7519
7512
  size: "small",
@@ -7528,7 +7521,7 @@ function TableSelectedItemsPanel({
7528
7521
  "\u8FD8\u6709 ",
7529
7522
  hiddenCount,
7530
7523
  " \u9879\u672A\u5C55\u793A",
7531
- /* @__PURE__ */ jsx28(Button, { size: "small", variant: "link", onClick: () => setShowAll(true), children: "\u5C55\u793A\u5168\u90E8" })
7524
+ /* @__PURE__ */ jsx29(Button, { size: "small", variant: "link", onClick: () => setShowAll(true), children: "\u5C55\u793A\u5168\u90E8" })
7532
7525
  ] }) : null
7533
7526
  ] });
7534
7527
  }
@@ -7649,7 +7642,7 @@ function createSelectionPlugin(options = {}) {
7649
7642
  const keys = selected(context);
7650
7643
  const allChecked = enabledRows.length > 0 && enabledRows.every((row) => keys.includes(row.key));
7651
7644
  const someChecked = enabledRows.some((row) => keys.includes(row.key));
7652
- return /* @__PURE__ */ jsx28(
7645
+ return /* @__PURE__ */ jsx29(
7653
7646
  TableCheckbox,
7654
7647
  {
7655
7648
  label: "\u9009\u62E9\u5F53\u524D\u9875\u5168\u90E8\u884C",
@@ -7665,7 +7658,7 @@ function createSelectionPlugin(options = {}) {
7665
7658
  }
7666
7659
  );
7667
7660
  },
7668
- render: (_value, record, _index, info) => mode === "single" ? /* @__PURE__ */ jsx28(
7661
+ render: (_value, record, _index, info) => mode === "single" ? /* @__PURE__ */ jsx29(
7669
7662
  Radio2,
7670
7663
  {
7671
7664
  className: "sia-table__checkbox",
@@ -7676,7 +7669,7 @@ function createSelectionPlugin(options = {}) {
7676
7669
  onClick: (event) => event.stopPropagation(),
7677
7670
  onChange: () => toggle(info.row.key, record, context)
7678
7671
  }
7679
- ) : /* @__PURE__ */ jsx28(
7672
+ ) : /* @__PURE__ */ jsx29(
7680
7673
  TableCheckbox,
7681
7674
  {
7682
7675
  label: `\u9009\u62E9\u7B2C ${info.rowIndex + 1} \u884C`,
@@ -7717,7 +7710,7 @@ function createSelectionPlugin(options = {}) {
7717
7710
  (column) => !column.hidden && column.meta?.plugin !== "selection"
7718
7711
  ).slice(0, Math.max(1, options.selectionPanelColumnCount ?? 4));
7719
7712
  return /* @__PURE__ */ jsxs24("span", { className: "sia-table__selection-footer", children: [
7720
- /* @__PURE__ */ jsx28(
7713
+ /* @__PURE__ */ jsx29(
7721
7714
  Popover,
7722
7715
  {
7723
7716
  placement: "top-start",
@@ -7725,7 +7718,7 @@ function createSelectionPlugin(options = {}) {
7725
7718
  open: context.state.panelOpen && entries.length > 0,
7726
7719
  onOpenChange: (panelOpen) => context.setState((state) => ({ ...state, panelOpen })),
7727
7720
  overlayClassName: "sia-table-selection-popover",
7728
- content: /* @__PURE__ */ jsx28(
7721
+ content: /* @__PURE__ */ jsx29(
7729
7722
  TableSelectedItemsPanel,
7730
7723
  {
7731
7724
  entries,
@@ -7757,7 +7750,7 @@ function createSelectionPlugin(options = {}) {
7757
7750
  )
7758
7751
  }
7759
7752
  ),
7760
- mode === "multiple" && options.showPreserveSelectedRowKeys !== false ? /* @__PURE__ */ jsx28(
7753
+ mode === "multiple" && options.showPreserveSelectedRowKeys !== false ? /* @__PURE__ */ jsx29(
7761
7754
  Checkbox,
7762
7755
  {
7763
7756
  checked: preserving(context),
@@ -7786,6 +7779,10 @@ function createSelectionPlugin(options = {}) {
7786
7779
  }
7787
7780
  };
7788
7781
  }
7782
+
7783
+ // src/components/Table/plugins/query.tsx
7784
+ import { useEffect as useEffect16, useState as useState24 } from "react";
7785
+ import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
7789
7786
  function createSortPlugin(options = {}) {
7790
7787
  const mode = options.mode ?? "local";
7791
7788
  const scope = options.scope ?? "all";
@@ -7814,9 +7811,9 @@ function createSortPlugin(options = {}) {
7814
7811
  const info = current(context);
7815
7812
  const order = info?.field === field ? info.order : null;
7816
7813
  const sortHint = `${getColumnLabel(currentColumn)}\uFF1A${order === "ascend" ? "\u5F53\u524D\u5347\u5E8F\uFF0C\u70B9\u51FB\u5207\u6362\u4E3A\u964D\u5E8F" : order === "descend" ? "\u5F53\u524D\u964D\u5E8F\uFF0C\u70B9\u51FB\u53D6\u6D88\u6392\u5E8F" : "\u672A\u6392\u5E8F\uFF0C\u70B9\u51FB\u6309\u5347\u5E8F\u6392\u5E8F"}`;
7817
- return /* @__PURE__ */ jsxs24("span", { className: "sia-table__sortable-header", children: [
7818
- /* @__PURE__ */ jsx28("span", { children: previousHeader ? previousHeader(currentColumn, coreContext) : currentColumn.title ?? currentColumn.name ?? currentColumn.key }),
7819
- /* @__PURE__ */ jsx28(
7814
+ return /* @__PURE__ */ jsxs25("span", { className: "sia-table__sortable-header", children: [
7815
+ /* @__PURE__ */ jsx30("span", { children: previousHeader ? previousHeader(currentColumn, coreContext) : currentColumn.title ?? currentColumn.name ?? currentColumn.key }),
7816
+ /* @__PURE__ */ jsx30(
7820
7817
  "button",
7821
7818
  {
7822
7819
  type: "button",
@@ -7828,9 +7825,9 @@ function createSortPlugin(options = {}) {
7828
7825
  event.stopPropagation();
7829
7826
  cycle(field, context);
7830
7827
  },
7831
- children: order ? /* @__PURE__ */ jsx28(Icon, { name: order === "ascend" ? "chevron-up" : "chevron-down", size: 18 }) : /* @__PURE__ */ jsxs24(Fragment8, { children: [
7832
- /* @__PURE__ */ jsx28(Icon, { name: "chevron-up", size: 11 }),
7833
- /* @__PURE__ */ jsx28(Icon, { name: "chevron-down", size: 11 })
7828
+ children: order ? /* @__PURE__ */ jsx30(Icon, { name: order === "ascend" ? "chevron-up" : "chevron-down", size: 18 }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
7829
+ /* @__PURE__ */ jsx30(Icon, { name: "chevron-up", size: 11 }),
7830
+ /* @__PURE__ */ jsx30(Icon, { name: "chevron-down", size: 11 })
7834
7831
  ] })
7835
7832
  }
7836
7833
  )
@@ -7865,8 +7862,8 @@ function TableFilterControl({
7865
7862
  placeholder,
7866
7863
  onApply
7867
7864
  }) {
7868
- const [open, setOpen] = useState23(false);
7869
- const [draft, setDraft] = useState23(value);
7865
+ const [open, setOpen] = useState24(false);
7866
+ const [draft, setDraft] = useState24(value);
7870
7867
  const label = getColumnLabel(column);
7871
7868
  useEffect16(() => {
7872
7869
  if (open) setDraft(value);
@@ -7875,17 +7872,17 @@ function TableFilterControl({
7875
7872
  onApply(nextValue.trim());
7876
7873
  setOpen(false);
7877
7874
  };
7878
- return /* @__PURE__ */ jsxs24("span", { className: "sia-table__filter-header", children: [
7879
- /* @__PURE__ */ jsx28("span", { children: column.title ?? column.name ?? column.key }),
7880
- /* @__PURE__ */ jsx28(
7875
+ return /* @__PURE__ */ jsxs25("span", { className: "sia-table__filter-header", children: [
7876
+ /* @__PURE__ */ jsx30("span", { children: column.title ?? column.name ?? column.key }),
7877
+ /* @__PURE__ */ jsx30(
7881
7878
  Popover,
7882
7879
  {
7883
7880
  open,
7884
7881
  onOpenChange: setOpen,
7885
7882
  placement: "bottom-end",
7886
7883
  overlayClassName: "sia-table-filter-popover",
7887
- content: /* @__PURE__ */ jsxs24("div", { className: "sia-table-filter-panel", children: [
7888
- /* @__PURE__ */ jsx28(
7884
+ content: /* @__PURE__ */ jsxs25("div", { className: "sia-table-filter-panel", children: [
7885
+ /* @__PURE__ */ jsx30(
7889
7886
  Input,
7890
7887
  {
7891
7888
  size: "small",
@@ -7899,8 +7896,8 @@ function TableFilterControl({
7899
7896
  }
7900
7897
  }
7901
7898
  ),
7902
- /* @__PURE__ */ jsxs24("div", { className: "sia-table-filter-panel__actions", children: [
7903
- /* @__PURE__ */ jsx28(
7899
+ /* @__PURE__ */ jsxs25("div", { className: "sia-table-filter-panel__actions", children: [
7900
+ /* @__PURE__ */ jsx30(
7904
7901
  Button,
7905
7902
  {
7906
7903
  size: "small",
@@ -7912,7 +7909,7 @@ function TableFilterControl({
7912
7909
  children: "\u6E05\u9664"
7913
7910
  }
7914
7911
  ),
7915
- /* @__PURE__ */ jsx28(
7912
+ /* @__PURE__ */ jsx30(
7916
7913
  Button,
7917
7914
  {
7918
7915
  size: "small",
@@ -7923,7 +7920,7 @@ function TableFilterControl({
7923
7920
  )
7924
7921
  ] })
7925
7922
  ] }),
7926
- children: /* @__PURE__ */ jsx28(
7923
+ children: /* @__PURE__ */ jsx30(
7927
7924
  "button",
7928
7925
  {
7929
7926
  type: "button",
@@ -7931,7 +7928,7 @@ function TableFilterControl({
7931
7928
  "aria-label": `\u7B5B\u9009${label}`,
7932
7929
  "aria-pressed": Boolean(value),
7933
7930
  onClick: (event) => event.stopPropagation(),
7934
- children: /* @__PURE__ */ jsx28(Icon, { name: "search", size: 13 })
7931
+ children: /* @__PURE__ */ jsx30(Icon, { name: "search", size: 13 })
7935
7932
  }
7936
7933
  )
7937
7934
  }
@@ -7993,7 +7990,7 @@ function createFilterPlugin(options = {}) {
7993
7990
  title: previousHeader ? previousHeader(currentColumn, coreContext) : currentColumn.title
7994
7991
  };
7995
7992
  const placeholder = typeof options.placeholder === "function" ? options.placeholder(currentColumn) : options.placeholder ?? `\u8F93\u5165${getColumnLabel(currentColumn)}\u7B5B\u9009`;
7996
- return /* @__PURE__ */ jsx28(
7993
+ return /* @__PURE__ */ jsx30(
7997
7994
  TableFilterControl,
7998
7995
  {
7999
7996
  column: renderedColumn,
@@ -8082,7 +8079,7 @@ function createPaginationPlugin(options = {}) {
8082
8079
  const page = currentPage(context);
8083
8080
  const filteredCount = context.getPluginApi("filter")?.getFilteredRows().length;
8084
8081
  const totalRecords = options.totalCount ?? filteredCount ?? context.sourceData.length;
8085
- return /* @__PURE__ */ jsx28(
8082
+ return /* @__PURE__ */ jsx30(
8086
8083
  Pagination,
8087
8084
  {
8088
8085
  className: "sia-table__pagination",
@@ -8118,6 +8115,9 @@ function createPaginationPlugin(options = {}) {
8118
8115
  }
8119
8116
  };
8120
8117
  }
8118
+
8119
+ // src/components/Table/plugins/structure.tsx
8120
+ import { Fragment as Fragment9, jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
8121
8121
  function createIndexPlugin(options = {}) {
8122
8122
  return {
8123
8123
  id: "index",
@@ -8220,19 +8220,19 @@ function createTreePlugin(options = {}) {
8220
8220
  return {
8221
8221
  ...column,
8222
8222
  ...options.showLine ? { ellipsis: false, meta: { ...column.meta, treeLines: true } } : {},
8223
- render: (value, record, index, info) => /* @__PURE__ */ jsxs24(
8223
+ render: (value, record, index, info) => /* @__PURE__ */ jsxs26(
8224
8224
  "span",
8225
8225
  {
8226
8226
  className: `sia-table__tree-cell${options.showLine ? " sia-table__tree-cell--lines" : ""}`,
8227
8227
  style: options.showLine ? void 0 : { paddingLeft: info.row.depth * 18 },
8228
8228
  children: [
8229
- options.showLine && info.row.depth > 0 && /* @__PURE__ */ jsxs24(Fragment8, { children: [
8230
- info.row.meta.treeGuides.map((continued, level) => /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", className: `sia-table__tree-guide${continued ? " sia-table__tree-guide--continued" : ""}` }, level)),
8231
- /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", className: `sia-table__tree-guide sia-table__tree-guide--branch${info.row.meta.treeHasNextSibling ? " sia-table__tree-guide--continued" : ""}` })
8229
+ options.showLine && info.row.depth > 0 && /* @__PURE__ */ jsxs26(Fragment9, { children: [
8230
+ info.row.meta.treeGuides.map((continued, level) => /* @__PURE__ */ jsx31("span", { "aria-hidden": "true", className: `sia-table__tree-guide${continued ? " sia-table__tree-guide--continued" : ""}` }, level)),
8231
+ /* @__PURE__ */ jsx31("span", { "aria-hidden": "true", className: `sia-table__tree-guide sia-table__tree-guide--branch${info.row.meta.treeHasNextSibling ? " sia-table__tree-guide--continued" : ""}` })
8232
8232
  ] }),
8233
- /* @__PURE__ */ jsxs24("span", { className: options.showLine ? "sia-table__tree-node" : void 0, style: options.showLine ? void 0 : { display: "contents" }, children: [
8234
- options.showLine && !!info.row.meta.treeHasChildren && current(context).includes(info.row.key) && /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", className: "sia-table__tree-stem" }),
8235
- info.row.meta.treeHasChildren ? /* @__PURE__ */ jsx28(
8233
+ /* @__PURE__ */ jsxs26("span", { className: options.showLine ? "sia-table__tree-node" : void 0, style: options.showLine ? void 0 : { display: "contents" }, children: [
8234
+ options.showLine && !!info.row.meta.treeHasChildren && current(context).includes(info.row.key) && /* @__PURE__ */ jsx31("span", { "aria-hidden": "true", className: "sia-table__tree-stem" }),
8235
+ info.row.meta.treeHasChildren ? /* @__PURE__ */ jsx31(
8236
8236
  "button",
8237
8237
  {
8238
8238
  type: "button",
@@ -8243,7 +8243,7 @@ function createTreePlugin(options = {}) {
8243
8243
  event.stopPropagation();
8244
8244
  toggle(info.row.key, context);
8245
8245
  },
8246
- children: /* @__PURE__ */ jsx28(
8246
+ children: /* @__PURE__ */ jsx31(
8247
8247
  Icon,
8248
8248
  {
8249
8249
  name: current(context).includes(info.row.key) ? "chevron-down" : "chevron-right",
@@ -8251,7 +8251,7 @@ function createTreePlugin(options = {}) {
8251
8251
  }
8252
8252
  )
8253
8253
  }
8254
- ) : /* @__PURE__ */ jsx28("span", { className: "sia-table__tree-placeholder" })
8254
+ ) : /* @__PURE__ */ jsx31("span", { className: "sia-table__tree-placeholder" })
8255
8255
  ] }),
8256
8256
  previousRender ? previousRender(value, record, index, info) : value
8257
8257
  ]
@@ -8294,6 +8294,10 @@ function createSummaryPlugin(options) {
8294
8294
  }
8295
8295
  };
8296
8296
  }
8297
+
8298
+ // src/components/Table/plugins/interaction.tsx
8299
+ import { useEffect as useEffect17, useRef as useRef25, useState as useState25 } from "react";
8300
+ import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
8297
8301
  function EditableTableCell({
8298
8302
  active,
8299
8303
  editable,
@@ -8305,18 +8309,18 @@ function EditableTableCell({
8305
8309
  showEditIcon
8306
8310
  }) {
8307
8311
  const config = typeof editable === "object" ? editable : { type: "input" };
8308
- const [editValue, setEditValue] = useState23(value);
8309
- const [saving, setSaving] = useState23(false);
8310
- const inputRef = useRef23(null);
8311
- const editorRef = useRef23(null);
8312
- const ownedEvents = useRef23(/* @__PURE__ */ new WeakSet());
8313
- const editValueRef = useRef23(value);
8314
- const savingRef = useRef23(false);
8315
- const saveRef = useRef23(
8312
+ const [editValue, setEditValue] = useState25(value);
8313
+ const [saving, setSaving] = useState25(false);
8314
+ const inputRef = useRef25(null);
8315
+ const editorRef = useRef25(null);
8316
+ const ownedEvents = useRef25(/* @__PURE__ */ new WeakSet());
8317
+ const editValueRef = useRef25(value);
8318
+ const savingRef = useRef25(false);
8319
+ const saveRef = useRef25(
8316
8320
  async () => {
8317
8321
  }
8318
8322
  );
8319
- useEffect16(() => {
8323
+ useEffect17(() => {
8320
8324
  if (!active) return;
8321
8325
  editValueRef.current = value;
8322
8326
  setEditValue(value);
@@ -8347,7 +8351,7 @@ function EditableTableCell({
8347
8351
  }
8348
8352
  }
8349
8353
  saveRef.current = save;
8350
- useEffect16(() => {
8354
+ useEffect17(() => {
8351
8355
  if (!active) return;
8352
8356
  const handleOutsidePointerDown = (event) => {
8353
8357
  const target = event.target;
@@ -8363,13 +8367,13 @@ function EditableTableCell({
8363
8367
  );
8364
8368
  }, [active, config.type, onCancel]);
8365
8369
  if (!active)
8366
- return /* @__PURE__ */ jsxs24(
8370
+ return /* @__PURE__ */ jsxs27(
8367
8371
  "div",
8368
8372
  {
8369
8373
  className: "sia-table__editable-display",
8370
8374
  children: [
8371
- /* @__PURE__ */ jsx28("span", { children: content }),
8372
- showEditIcon && /* @__PURE__ */ jsx28(Icon, { name: "edit", size: 13 })
8375
+ /* @__PURE__ */ jsx32("span", { children: content }),
8376
+ showEditIcon && /* @__PURE__ */ jsx32(Icon, { name: "edit", size: 13 })
8373
8377
  ]
8374
8378
  }
8375
8379
  );
@@ -8377,7 +8381,7 @@ function EditableTableCell({
8377
8381
  if (config.type === "custom" && config.editRender) {
8378
8382
  editor = config.editRender(record, (next) => void save(next), onCancel);
8379
8383
  } else if (config.type === "inputNumber") {
8380
- editor = /* @__PURE__ */ jsx28(
8384
+ editor = /* @__PURE__ */ jsx32(
8381
8385
  InputNumber,
8382
8386
  {
8383
8387
  ref: inputRef,
@@ -8398,7 +8402,7 @@ function EditableTableCell({
8398
8402
  }
8399
8403
  );
8400
8404
  } else if (config.type === "select") {
8401
- editor = /* @__PURE__ */ jsx28(
8405
+ editor = /* @__PURE__ */ jsx32(
8402
8406
  Select,
8403
8407
  {
8404
8408
  size: "small",
@@ -8412,14 +8416,14 @@ function EditableTableCell({
8412
8416
  }
8413
8417
  );
8414
8418
  } else {
8415
- editor = /* @__PURE__ */ jsx28(
8419
+ editor = /* @__PURE__ */ jsx32(
8416
8420
  Input,
8417
8421
  {
8418
8422
  ref: inputRef,
8419
8423
  size: "small",
8420
8424
  value: String(editValue ?? ""),
8421
8425
  disabled: saving,
8422
- suffix: saving ? /* @__PURE__ */ jsx28(Icon, { name: "loader", size: 13, spin: true }) : null,
8426
+ suffix: saving ? /* @__PURE__ */ jsx32(Icon, { name: "loader", size: 13, spin: true }) : null,
8423
8427
  onChange: (event) => updateEditValue(event.target.value),
8424
8428
  onBlur: () => void save(),
8425
8429
  onKeyDown: (event) => {
@@ -8429,7 +8433,7 @@ function EditableTableCell({
8429
8433
  }
8430
8434
  );
8431
8435
  }
8432
- return /* @__PURE__ */ jsx28(
8436
+ return /* @__PURE__ */ jsx32(
8433
8437
  "div",
8434
8438
  {
8435
8439
  ref: editorRef,
@@ -8466,7 +8470,7 @@ function createEditablePlugin(options = {}) {
8466
8470
  const active = canEdit && context.state.editing?.rowKey === info.row.key && context.state.editing.columnKey === column.key;
8467
8471
  const content = previousRender ? previousRender(value, record, index, info) : value;
8468
8472
  if (!canEdit) return content;
8469
- return /* @__PURE__ */ jsx28(
8473
+ return /* @__PURE__ */ jsx32(
8470
8474
  EditableTableCell,
8471
8475
  {
8472
8476
  active,
@@ -8526,9 +8530,9 @@ function createResizePlugin(options = {}) {
8526
8530
  ...column,
8527
8531
  autoWidth,
8528
8532
  width,
8529
- renderHeader: (currentColumn, coreContext) => /* @__PURE__ */ jsxs24("span", { className: "sia-table__resizable-header", children: [
8530
- /* @__PURE__ */ jsx28("span", { children: previousHeader ? previousHeader(currentColumn, coreContext) : currentColumn.title ?? currentColumn.name ?? currentColumn.key }),
8531
- /* @__PURE__ */ jsx28(
8533
+ renderHeader: (currentColumn, coreContext) => /* @__PURE__ */ jsxs27("span", { className: "sia-table__resizable-header", children: [
8534
+ /* @__PURE__ */ jsx32("span", { children: previousHeader ? previousHeader(currentColumn, coreContext) : currentColumn.title ?? currentColumn.name ?? currentColumn.key }),
8535
+ /* @__PURE__ */ jsx32(
8532
8536
  "span",
8533
8537
  {
8534
8538
  className: "sia-table__resize-handle",
@@ -8601,11 +8605,226 @@ function createResizePlugin(options = {}) {
8601
8605
  });
8602
8606
  },
8603
8607
  getApi: (context) => ({
8604
- getWidths: () => context.state.widths,
8605
- setWidth: (columnKey, width) => setWidth(columnKey, width, context, true)
8608
+ getWidths: () => context.state.widths,
8609
+ setWidth: (columnKey, width) => setWidth(columnKey, width, context, true)
8610
+ })
8611
+ };
8612
+ }
8613
+
8614
+ // src/components/Table/plugins/columnSetting.tsx
8615
+ import { useEffect as useEffect18, useRef as useRef26, useState as useState26 } from "react";
8616
+
8617
+ // src/components/Table/columnSettings.ts
8618
+ function reconcileColumnSettings(columns, defaults, saved) {
8619
+ const stored = new Map(saved.map((item) => [item.key, item]));
8620
+ const base = new Map(defaults.map((item) => [item.key, item]));
8621
+ const result = [];
8622
+ const rank = (column) => {
8623
+ const own = stored.get(column.key)?.order;
8624
+ if (own !== void 0) return own;
8625
+ const children = column.children?.map(rank).filter((value) => value !== void 0);
8626
+ return children?.length ? Math.min(...children) : void 0;
8627
+ };
8628
+ const walk = (source, parent) => {
8629
+ const entries = source.map((column, index) => ({ column, index, rank: rank(column) }));
8630
+ let anchor = -1;
8631
+ for (const entry of entries) {
8632
+ if (entry.rank !== void 0) anchor = entry.rank;
8633
+ else entry.rank = anchor + (entry.index + 1) / (entries.length + 1);
8634
+ }
8635
+ entries.sort((a, b) => a.rank - b.rank || a.index - b.index);
8636
+ for (const { column } of entries) {
8637
+ const own = stored.get(column.key);
8638
+ if (column.children?.length) {
8639
+ walk(column.children, own ?? parent);
8640
+ } else {
8641
+ const fallback = base.get(column.key);
8642
+ if (!fallback) continue;
8643
+ const item = own ?? {
8644
+ ...fallback,
8645
+ fixed: parent?.fixed ?? fallback.fixed,
8646
+ visible: fallback.visible && (parent?.visible ?? true)
8647
+ };
8648
+ result.push({ ...item, order: result.length });
8649
+ }
8650
+ }
8651
+ };
8652
+ walk(columns);
8653
+ return result;
8654
+ }
8655
+ function mergeColumnSettings(columns, saved, active) {
8656
+ const merged = new Map(saved.filter((item) => !["__index__", "__selection__"].includes(item.key)).map((item) => [item.key, item]));
8657
+ active.forEach((item) => merged.set(item.key, item));
8658
+ const current = new Map(active.map((item) => [item.key, item]));
8659
+ const walk = (column) => {
8660
+ if (!column.children?.length) return current.has(column.key) ? [current.get(column.key)] : [];
8661
+ const leaves = column.children.flatMap(walk);
8662
+ if (leaves.length) {
8663
+ const old = merged.get(column.key);
8664
+ merged.set(column.key, {
8665
+ key: column.key,
8666
+ width: old?.width ?? column.width,
8667
+ fixed: old?.fixed,
8668
+ visible: leaves.some((item) => item.visible),
8669
+ order: Math.min(...leaves.map((item) => item.order))
8670
+ });
8671
+ }
8672
+ return leaves;
8673
+ };
8674
+ columns.forEach(walk);
8675
+ return [...merged.values()].sort((left, right) => left.order - right.order);
8676
+ }
8677
+
8678
+ // src/components/settingsPersistence.ts
8679
+ var queues = /* @__PURE__ */ new WeakMap();
8680
+ function saveSettingsPatch(adapter, scope, patch) {
8681
+ let scoped = queues.get(adapter);
8682
+ if (!scoped) {
8683
+ scoped = /* @__PURE__ */ new Map();
8684
+ queues.set(adapter, scoped);
8685
+ }
8686
+ const key = JSON.stringify([scope.moduleName, scope.businessKey]);
8687
+ const previous = scoped.get(key) ?? Promise.resolve();
8688
+ const task = previous.catch(() => void 0).then(async () => {
8689
+ const current = await adapter.load(scope);
8690
+ const defined = Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== void 0));
8691
+ await adapter.save(scope, { ...current, ...defined });
8692
+ });
8693
+ scoped.set(key, task);
8694
+ const cleanup = () => {
8695
+ if (scoped.get(key) === task) scoped.delete(key);
8696
+ };
8697
+ void task.then(cleanup, cleanup);
8698
+ return task;
8699
+ }
8700
+
8701
+ // src/components/Table/plugins/actions.tsx
8702
+ import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
8703
+ function ToolbarItems({
8704
+ items,
8705
+ context
8706
+ }) {
8707
+ return /* @__PURE__ */ jsx33(Fragment10, { children: items.map((item) => {
8708
+ if (item.hidden === true || typeof item.hidden === "function" && item.hidden(context))
8709
+ return null;
8710
+ const disabled = item.disabled === true || typeof item.disabled === "function" && item.disabled(context);
8711
+ return /* @__PURE__ */ jsx33(
8712
+ Button,
8713
+ {
8714
+ size: "small",
8715
+ danger: item.danger,
8716
+ title: item.title,
8717
+ icon: item.icon,
8718
+ disabled,
8719
+ onClick: () => void item.onClick?.(context),
8720
+ children: item.label
8721
+ },
8722
+ item.key
8723
+ );
8724
+ }) });
8725
+ }
8726
+ function createToolbarPlugin(options) {
8727
+ const allowed = (item) => options.canAccess?.(item) ?? true;
8728
+ const items = (position, inSettings = false) => (options.items ?? []).filter(
8729
+ (item) => allowed(item) && (item.position ?? "start") === position && Boolean(item.inSettings) === inSettings
8730
+ );
8731
+ return {
8732
+ id: "toolbar",
8733
+ order: 5,
8734
+ renderToolbarStart: (context) => /* @__PURE__ */ jsxs28(Fragment10, { children: [
8735
+ options.start,
8736
+ /* @__PURE__ */ jsx33(ToolbarItems, { items: items("start"), context })
8737
+ ] }),
8738
+ renderToolbarEnd: (context) => /* @__PURE__ */ jsxs28(Fragment10, { children: [
8739
+ options.end,
8740
+ /* @__PURE__ */ jsx33(ToolbarItems, { items: items("end"), context }),
8741
+ items("end", true).length > 0 ? /* @__PURE__ */ jsxs28("details", { className: "sia-table__toolbar-menu", children: [
8742
+ /* @__PURE__ */ jsx33("summary", { "aria-label": "\u66F4\u591A\u8868\u683C\u64CD\u4F5C", children: /* @__PURE__ */ jsx33(Icon, { name: "more-horizontal", size: 16 }) }),
8743
+ /* @__PURE__ */ jsx33("div", { children: /* @__PURE__ */ jsx33(ToolbarItems, { items: items("end", true), context }) })
8744
+ ] }) : null
8745
+ ] })
8746
+ };
8747
+ }
8748
+ function createExportPlugin(options = {}) {
8749
+ function getRows(context, scope = options.scope ?? "visible") {
8750
+ if (scope === "all") return context.sourceData;
8751
+ if (scope === "selected")
8752
+ return context.getPluginApi("selection")?.getSelectedRows() ?? [];
8753
+ return context.rows.map((row) => row.record);
8754
+ }
8755
+ function getCsv(context, scope) {
8756
+ const delimiter = options.delimiter ?? ",";
8757
+ const sanitizeFormula = options.sanitizeFormula ?? true;
8758
+ const rows = getRows(context, scope);
8759
+ const columns = flattenTableColumns(context.columns).filter(
8760
+ (column) => column.exportable !== false && (!column.meta?.plugin || column.exportable === true)
8761
+ );
8762
+ const header = columns.map((column) => tableExportEscape(getColumnLabel(column), delimiter)).join(delimiter);
8763
+ const lines = rows.map((record, rowIndex) => {
8764
+ const row = {
8765
+ key: context.getRowKey(record, rowIndex),
8766
+ record,
8767
+ sourceIndex: rowIndex,
8768
+ depth: 0,
8769
+ meta: {}
8770
+ };
8771
+ return columns.map((column) => {
8772
+ const value = getTableValue(
8773
+ record,
8774
+ column.dataIndex,
8775
+ column.code ?? column.key
8776
+ );
8777
+ const rendered = column.exportRender?.(value, record, rowIndex, {
8778
+ row,
8779
+ rowIndex,
8780
+ column
8781
+ });
8782
+ const text = rendered === void 0 ? tableExportCell(value, sanitizeFormula) : tableExportText(rendered);
8783
+ return tableExportEscape(text, delimiter);
8784
+ }).join(delimiter);
8785
+ });
8786
+ return `${options.includeBom === false ? "" : "\uFEFF"}${[header, ...lines].join("\r\n")}`;
8787
+ }
8788
+ async function download(context, scope) {
8789
+ const rows = getRows(context, scope);
8790
+ const csv = getCsv(context, scope);
8791
+ if (options.onExport) {
8792
+ await options.onExport(csv, rows);
8793
+ return;
8794
+ }
8795
+ if (typeof document === "undefined") return;
8796
+ const fileName = typeof options.fileName === "function" ? options.fileName(context) : options.fileName ?? "table.csv";
8797
+ const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
8798
+ const url = URL.createObjectURL(blob);
8799
+ const anchor = document.createElement("a");
8800
+ anchor.href = url;
8801
+ anchor.download = fileName.endsWith(".csv") ? fileName : `${fileName}.csv`;
8802
+ anchor.click();
8803
+ window.setTimeout(() => URL.revokeObjectURL(url), 0);
8804
+ }
8805
+ return {
8806
+ id: "export",
8807
+ order: 95,
8808
+ renderToolbarEnd: options.showButton === false ? void 0 : (context) => /* @__PURE__ */ jsx33(
8809
+ Button,
8810
+ {
8811
+ size: "small",
8812
+ icon: /* @__PURE__ */ jsx33(Icon, { name: "download", size: 14 }),
8813
+ disabled: getRows(context).length === 0,
8814
+ onClick: () => void download(context),
8815
+ children: options.buttonLabel ?? "\u5BFC\u51FA"
8816
+ }
8817
+ ),
8818
+ getApi: (context) => ({
8819
+ getCsv: (scope) => getCsv(context, scope),
8820
+ download: (scope) => download(context, scope),
8821
+ getRows: (scope) => getRows(context, scope)
8606
8822
  })
8607
8823
  };
8608
8824
  }
8825
+
8826
+ // src/components/Table/plugins/columnSetting.tsx
8827
+ import { Fragment as Fragment11, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
8609
8828
  function isTableAuxiliaryColumn(column) {
8610
8829
  return column.meta?.plugin === "index" || column.meta?.plugin === "selection" || column.key === "__index__" || column.key === "__selection__";
8611
8830
  }
@@ -8664,12 +8883,12 @@ function ColumnSettingPanel({
8664
8883
  onClose,
8665
8884
  onApply
8666
8885
  }) {
8667
- const [draft, setDraft] = useState23(items);
8668
- const listRef = useRef23(null);
8669
- const cancelDrag = useRef23(null);
8670
- const [preview, setPreview] = useState23(null);
8671
- const syncedDraft = useRef23({ open: false, signature: "" });
8672
- useEffect16(() => {
8886
+ const [draft, setDraft] = useState26(items);
8887
+ const listRef = useRef26(null);
8888
+ const cancelDrag = useRef26(null);
8889
+ const [preview, setPreview] = useState26(null);
8890
+ const syncedDraft = useRef26({ open: false, signature: "" });
8891
+ useEffect18(() => {
8673
8892
  const signature = JSON.stringify(items);
8674
8893
  const changed = signature !== syncedDraft.current.signature;
8675
8894
  if (open !== syncedDraft.current.open || changed) cancelDrag.current?.();
@@ -8678,7 +8897,7 @@ function ColumnSettingPanel({
8678
8897
  }
8679
8898
  syncedDraft.current = { open, signature };
8680
8899
  }, [items, open]);
8681
- useEffect16(() => () => cancelDrag.current?.(), []);
8900
+ useEffect18(() => () => cancelDrag.current?.(), []);
8682
8901
  const labels = new Map(
8683
8902
  flattenTableColumns(columns).map((column) => [
8684
8903
  column.key,
@@ -8805,7 +9024,7 @@ function ColumnSettingPanel({
8805
9024
  window.addEventListener("blur", cancel);
8806
9025
  frame = requestAnimationFrame(tick);
8807
9026
  }
8808
- return /* @__PURE__ */ jsxs24(
9027
+ return /* @__PURE__ */ jsxs29(
8809
9028
  Drawer2,
8810
9029
  {
8811
9030
  open,
@@ -8814,9 +9033,9 @@ function ColumnSettingPanel({
8814
9033
  onOpenChange: (next) => {
8815
9034
  if (!next) onClose();
8816
9035
  },
8817
- footer: /* @__PURE__ */ jsxs24(Fragment8, { children: [
8818
- /* @__PURE__ */ jsx28(Button, { onClick: onClose, children: "\u53D6\u6D88" }),
8819
- /* @__PURE__ */ jsx28(
9036
+ footer: /* @__PURE__ */ jsxs29(Fragment11, { children: [
9037
+ /* @__PURE__ */ jsx34(Button, { onClick: onClose, children: "\u53D6\u6D88" }),
9038
+ /* @__PURE__ */ jsx34(
8820
9039
  Button,
8821
9040
  {
8822
9041
  variant: "primary",
@@ -8827,19 +9046,19 @@ function ColumnSettingPanel({
8827
9046
  )
8828
9047
  ] }),
8829
9048
  children: [
8830
- loadError ? /* @__PURE__ */ jsxs24("p", { role: "alert", children: [
9049
+ loadError ? /* @__PURE__ */ jsxs29("p", { role: "alert", children: [
8831
9050
  "\u8BFB\u53D6\u5217\u914D\u7F6E\u5931\u8D25\u3002",
8832
- /* @__PURE__ */ jsx28(Button, { variant: "link", onClick: onRetry, children: "\u91CD\u8BD5" })
9051
+ /* @__PURE__ */ jsx34(Button, { variant: "link", onClick: onRetry, children: "\u91CD\u8BD5" })
8833
9052
  ] }) : null,
8834
- /* @__PURE__ */ jsx28(Spin, { spinning: Boolean(loading), className: "sia-table-settings__loading", "aria-label": loading ? "\u6B63\u5728\u8BFB\u53D6\u5217\u914D\u7F6E" : void 0, children: /* @__PURE__ */ jsxs24(
9053
+ /* @__PURE__ */ jsx34(Spin, { spinning: Boolean(loading), className: "sia-table-settings__loading", "aria-label": loading ? "\u6B63\u5728\u8BFB\u53D6\u5217\u914D\u7F6E" : void 0, children: /* @__PURE__ */ jsxs29(
8835
9054
  "fieldset",
8836
9055
  {
8837
9056
  disabled: loading || loadError,
8838
9057
  style: { border: 0, padding: 0, margin: 0, minWidth: 0 },
8839
9058
  "aria-busy": loading,
8840
9059
  children: [
8841
- /* @__PURE__ */ jsxs24("label", { className: "sia-table-settings__all", children: [
8842
- /* @__PURE__ */ jsx28(
9060
+ /* @__PURE__ */ jsxs29("label", { className: "sia-table-settings__all", children: [
9061
+ /* @__PURE__ */ jsx34(
8843
9062
  TableCheckbox,
8844
9063
  {
8845
9064
  label: "\u5168\u9009\u5217",
@@ -8850,7 +9069,7 @@ function ColumnSettingPanel({
8850
9069
  )
8851
9070
  }
8852
9071
  ),
8853
- /* @__PURE__ */ jsxs24("span", { children: [
9072
+ /* @__PURE__ */ jsxs29("span", { children: [
8854
9073
  "\u5168\u9009\uFF08",
8855
9074
  visibleCount,
8856
9075
  "/",
@@ -8858,12 +9077,12 @@ function ColumnSettingPanel({
8858
9077
  "\uFF09"
8859
9078
  ] })
8860
9079
  ] }),
8861
- /* @__PURE__ */ jsx28(
9080
+ /* @__PURE__ */ jsx34(
8862
9081
  "div",
8863
9082
  {
8864
9083
  ref: listRef,
8865
9084
  className: `sia-table-settings__list${preview ? " is-sorting" : ""}`,
8866
- children: draft.map((item) => /* @__PURE__ */ jsxs24(
9085
+ children: draft.map((item) => /* @__PURE__ */ jsxs29(
8867
9086
  "div",
8868
9087
  {
8869
9088
  "data-column-key": item.key,
@@ -8873,8 +9092,8 @@ function ColumnSettingPanel({
8873
9092
  } : void 0,
8874
9093
  onPointerDown: (event) => startSort(event, item.key),
8875
9094
  children: [
8876
- /* @__PURE__ */ jsx28(Icon, { name: "menu", size: 15 }),
8877
- /* @__PURE__ */ jsx28(
9095
+ /* @__PURE__ */ jsx34(Icon, { name: "menu", size: 15 }),
9096
+ /* @__PURE__ */ jsx34(
8878
9097
  TableCheckbox,
8879
9098
  {
8880
9099
  label: `\u663E\u793A${labels.get(item.key) ?? item.key}\u5217`,
@@ -8886,15 +9105,15 @@ function ColumnSettingPanel({
8886
9105
  )
8887
9106
  }
8888
9107
  ),
8889
- /* @__PURE__ */ jsx28(
9108
+ /* @__PURE__ */ jsx34(
8890
9109
  "span",
8891
9110
  {
8892
9111
  className: "sia-table-settings__name",
8893
9112
  children: labels.get(item.key) ?? item.key
8894
9113
  }
8895
9114
  ),
8896
- /* @__PURE__ */ jsxs24("div", { className: "sia-table-settings__actions", children: [
8897
- /* @__PURE__ */ jsx28(
9115
+ /* @__PURE__ */ jsxs29("div", { className: "sia-table-settings__actions", children: [
9116
+ /* @__PURE__ */ jsx34(
8898
9117
  Button,
8899
9118
  {
8900
9119
  size: "small",
@@ -8907,7 +9126,7 @@ function ColumnSettingPanel({
8907
9126
  children: "\u5DE6"
8908
9127
  }
8909
9128
  ),
8910
- /* @__PURE__ */ jsx28(
9129
+ /* @__PURE__ */ jsx34(
8911
9130
  Button,
8912
9131
  {
8913
9132
  size: "small",
@@ -9057,7 +9276,7 @@ function createColumnSettingPlugin(options = {}) {
9057
9276
  {
9058
9277
  key: "builtin:export",
9059
9278
  label: "\u8868\u683C\u5BFC\u51FA",
9060
- icon: /* @__PURE__ */ jsx28(Icon, { name: "download", size: 18 }),
9279
+ icon: /* @__PURE__ */ jsx34(Icon, { name: "download", size: 18 }),
9061
9280
  disabled: exportApi().getRows().length === 0
9062
9281
  },
9063
9282
  { key: "builtin:divider", type: "divider" }
@@ -9065,7 +9284,7 @@ function createColumnSettingPlugin(options = {}) {
9065
9284
  {
9066
9285
  key: "builtin:columns",
9067
9286
  label: "\u5217\u8BBE\u7F6E",
9068
- icon: /* @__PURE__ */ jsx28(Icon, { name: "settings", size: 18 })
9287
+ icon: /* @__PURE__ */ jsx34(Icon, { name: "settings", size: 18 })
9069
9288
  },
9070
9289
  ...customItems.map((item) => ({
9071
9290
  key: "custom:" + item.key,
@@ -9077,7 +9296,7 @@ function createColumnSettingPlugin(options = {}) {
9077
9296
  disabled: item.disabled === true || typeof item.disabled === "function" && item.disabled(context)
9078
9297
  }))
9079
9298
  ];
9080
- return /* @__PURE__ */ jsx28(
9299
+ return /* @__PURE__ */ jsx34(
9081
9300
  Dropdown,
9082
9301
  {
9083
9302
  disabled: options.buttonProps?.disabled || options.buttonProps?.loading,
@@ -9094,12 +9313,12 @@ function createColumnSettingPlugin(options = {}) {
9094
9313
  void customItems.find((item) => "custom:" + item.key === key)?.onClick?.(context);
9095
9314
  }
9096
9315
  },
9097
- children: /* @__PURE__ */ jsx28(
9316
+ children: /* @__PURE__ */ jsx34(
9098
9317
  Button,
9099
9318
  {
9100
9319
  size: "small",
9101
9320
  variant: "text",
9102
- icon: /* @__PURE__ */ jsx28(Icon, { name: "settings", size: 16 }),
9321
+ icon: /* @__PURE__ */ jsx34(Icon, { name: "settings", size: 16 }),
9103
9322
  "aria-label": "\u8868\u683C\u8BBE\u7F6E",
9104
9323
  ...options.buttonProps,
9105
9324
  className: `sia-table__settings-button${options.buttonProps?.children == null ? " sia-table__toolbar-icon" : ""} ${options.buttonProps?.className ?? ""}`.trim()
@@ -9108,7 +9327,7 @@ function createColumnSettingPlugin(options = {}) {
9108
9327
  }
9109
9328
  );
9110
9329
  },
9111
- renderOverlay: (context) => /* @__PURE__ */ jsx28(
9330
+ renderOverlay: (context) => /* @__PURE__ */ jsx34(
9112
9331
  ColumnSettingPanel,
9113
9332
  {
9114
9333
  open: context.state.open,
@@ -9154,148 +9373,9 @@ function createLocalStorageTableSettingsAdapter(prefix = "sia-table") {
9154
9373
  }
9155
9374
  };
9156
9375
  }
9157
- function ToolbarItems({
9158
- items,
9159
- context
9160
- }) {
9161
- return /* @__PURE__ */ jsx28(Fragment8, { children: items.map((item) => {
9162
- if (item.hidden === true || typeof item.hidden === "function" && item.hidden(context))
9163
- return null;
9164
- const disabled = item.disabled === true || typeof item.disabled === "function" && item.disabled(context);
9165
- return /* @__PURE__ */ jsx28(
9166
- Button,
9167
- {
9168
- size: "small",
9169
- danger: item.danger,
9170
- title: item.title,
9171
- icon: item.icon,
9172
- disabled,
9173
- onClick: () => void item.onClick?.(context),
9174
- children: item.label
9175
- },
9176
- item.key
9177
- );
9178
- }) });
9179
- }
9180
- function createToolbarPlugin(options) {
9181
- const allowed = (item) => options.canAccess?.(item) ?? true;
9182
- const items = (position, inSettings = false) => (options.items ?? []).filter(
9183
- (item) => allowed(item) && (item.position ?? "start") === position && Boolean(item.inSettings) === inSettings
9184
- );
9185
- return {
9186
- id: "toolbar",
9187
- order: 5,
9188
- renderToolbarStart: (context) => /* @__PURE__ */ jsxs24(Fragment8, { children: [
9189
- options.start,
9190
- /* @__PURE__ */ jsx28(ToolbarItems, { items: items("start"), context })
9191
- ] }),
9192
- renderToolbarEnd: (context) => /* @__PURE__ */ jsxs24(Fragment8, { children: [
9193
- options.end,
9194
- /* @__PURE__ */ jsx28(ToolbarItems, { items: items("end"), context }),
9195
- items("end", true).length > 0 ? /* @__PURE__ */ jsxs24("details", { className: "sia-table__toolbar-menu", children: [
9196
- /* @__PURE__ */ jsx28("summary", { "aria-label": "\u66F4\u591A\u8868\u683C\u64CD\u4F5C", children: /* @__PURE__ */ jsx28(Icon, { name: "more-horizontal", size: 16 }) }),
9197
- /* @__PURE__ */ jsx28("div", { children: /* @__PURE__ */ jsx28(ToolbarItems, { items: items("end", true), context }) })
9198
- ] }) : null
9199
- ] })
9200
- };
9201
- }
9202
- function tableExportText(node) {
9203
- if (node === null || node === void 0 || typeof node === "boolean")
9204
- return "";
9205
- if (typeof node === "string" || typeof node === "number" || typeof node === "bigint")
9206
- return String(node);
9207
- if (Array.isArray(node)) return node.map(tableExportText).join("");
9208
- if (isValidElement3(node))
9209
- return tableExportText(node.props.children);
9210
- return "";
9211
- }
9212
- function tableExportCell(value, sanitizeFormula) {
9213
- const text = value === null || value === void 0 ? "" : typeof value === "object" ? JSON.stringify(value) : String(value);
9214
- return sanitizeFormula && /^[=+\-@]/.test(text) ? `'${text}` : text;
9215
- }
9216
- function tableExportEscape(value, delimiter) {
9217
- return value.includes(delimiter) || /["\r\n]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value;
9218
- }
9219
- function createExportPlugin(options = {}) {
9220
- function getRows(context, scope = options.scope ?? "visible") {
9221
- if (scope === "all") return context.sourceData;
9222
- if (scope === "selected")
9223
- return context.getPluginApi("selection")?.getSelectedRows() ?? [];
9224
- return context.rows.map((row) => row.record);
9225
- }
9226
- function getCsv(context, scope) {
9227
- const delimiter = options.delimiter ?? ",";
9228
- const sanitizeFormula = options.sanitizeFormula ?? true;
9229
- const rows = getRows(context, scope);
9230
- const columns = flattenTableColumns(context.columns).filter(
9231
- (column) => column.exportable !== false && (!column.meta?.plugin || column.exportable === true)
9232
- );
9233
- const header = columns.map((column) => tableExportEscape(getColumnLabel(column), delimiter)).join(delimiter);
9234
- const lines = rows.map((record, rowIndex) => {
9235
- const row = {
9236
- key: context.getRowKey(record, rowIndex),
9237
- record,
9238
- sourceIndex: rowIndex,
9239
- depth: 0,
9240
- meta: {}
9241
- };
9242
- return columns.map((column) => {
9243
- const value = getTableValue(
9244
- record,
9245
- column.dataIndex,
9246
- column.code ?? column.key
9247
- );
9248
- const rendered = column.exportRender?.(value, record, rowIndex, {
9249
- row,
9250
- rowIndex,
9251
- column
9252
- });
9253
- const text = rendered === void 0 ? tableExportCell(value, sanitizeFormula) : tableExportText(rendered);
9254
- return tableExportEscape(text, delimiter);
9255
- }).join(delimiter);
9256
- });
9257
- return `${options.includeBom === false ? "" : "\uFEFF"}${[header, ...lines].join("\r\n")}`;
9258
- }
9259
- async function download(context, scope) {
9260
- const rows = getRows(context, scope);
9261
- const csv = getCsv(context, scope);
9262
- if (options.onExport) {
9263
- await options.onExport(csv, rows);
9264
- return;
9265
- }
9266
- if (typeof document === "undefined") return;
9267
- const fileName = typeof options.fileName === "function" ? options.fileName(context) : options.fileName ?? "table.csv";
9268
- const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
9269
- const url = URL.createObjectURL(blob);
9270
- const anchor = document.createElement("a");
9271
- anchor.href = url;
9272
- anchor.download = fileName.endsWith(".csv") ? fileName : `${fileName}.csv`;
9273
- anchor.click();
9274
- window.setTimeout(() => URL.revokeObjectURL(url), 0);
9275
- }
9276
- return {
9277
- id: "export",
9278
- order: 95,
9279
- renderToolbarEnd: options.showButton === false ? void 0 : (context) => /* @__PURE__ */ jsx28(
9280
- Button,
9281
- {
9282
- size: "small",
9283
- icon: /* @__PURE__ */ jsx28(Icon, { name: "download", size: 14 }),
9284
- disabled: getRows(context).length === 0,
9285
- onClick: () => void download(context),
9286
- children: options.buttonLabel ?? "\u5BFC\u51FA"
9287
- }
9288
- ),
9289
- getApi: (context) => ({
9290
- getCsv: (scope) => getCsv(context, scope),
9291
- download: (scope) => download(context, scope),
9292
- getRows: (scope) => getRows(context, scope)
9293
- })
9294
- };
9295
- }
9296
9376
 
9297
9377
  // src/components/Table/Table.tsx
9298
- import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
9378
+ import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
9299
9379
  var EMPTY_DATA = [];
9300
9380
  var EMPTY_COLUMNS = [];
9301
9381
  var EMPTY_PLUGINS = [];
@@ -9412,9 +9492,9 @@ var TableBodyRow = memo(function TableBodyRow2({
9412
9492
  onCellPointerDown,
9413
9493
  onCellPointerMove
9414
9494
  }) {
9415
- const [textColumn, setTextColumn] = useState24();
9495
+ const [textColumn, setTextColumn] = useState27();
9416
9496
  const resizeColumnKey = resize ? columns.find((column) => !getCellProps(column).hidden)?.key : void 0;
9417
- return /* @__PURE__ */ jsx29(
9497
+ return /* @__PURE__ */ jsx35(
9418
9498
  "tr",
9419
9499
  {
9420
9500
  "data-row-key": String(row.key),
@@ -9430,7 +9510,7 @@ var TableBodyRow = memo(function TableBodyRow2({
9430
9510
  if (columnIndex > 0 && !visibleColumns.has(columns[columnIndex - 1].key)) return null;
9431
9511
  let count = 1;
9432
9512
  while (columnIndex + count < columns.length && !visibleColumns.has(columns[columnIndex + count].key)) count++;
9433
- return /* @__PURE__ */ jsx29("td", { colSpan: count, "aria-hidden": "true", style: { padding: 0 } }, `spacer-${column.key}`);
9513
+ return /* @__PURE__ */ jsx35("td", { colSpan: count, "aria-hidden": "true", style: { padding: 0 } }, `spacer-${column.key}`);
9434
9514
  }
9435
9515
  const pluginCellProps = getCellProps(column);
9436
9516
  if (pluginCellProps.hidden) return null;
@@ -9441,7 +9521,7 @@ var TableBodyRow = memo(function TableBodyRow2({
9441
9521
  const fixedStyle = fixed === "left" ? { left: leftOffsets.get(column.key) } : fixed === "right" ? { right: rightOffsets.get(column.key) } : void 0;
9442
9522
  const fixedEdgeClass = fixed === "left" && column.key === leftFixedEdgeKey ? " sia-table__cell--fixed-left-edge" : fixed === "right" && column.key === rightFixedEdgeKey ? " sia-table__cell--fixed-right-edge" : "";
9443
9523
  const autoWidthClass = column.autoWidth ? " sia-table__cell--auto-width" : "";
9444
- return /* @__PURE__ */ jsxs25(
9524
+ return /* @__PURE__ */ jsxs30(
9445
9525
  "td",
9446
9526
  {
9447
9527
  "data-column-key": column.key,
@@ -9466,7 +9546,7 @@ var TableBodyRow = memo(function TableBodyRow2({
9466
9546
  },
9467
9547
  onPointerMove: (event) => onCellPointerMove(column, event),
9468
9548
  children: [
9469
- !canvas || visibleColumns.has(column.key) && (pluginCellProps.content !== void 0 || !column.canvasRender && (column.render || textColumn === column.key)) ? /* @__PURE__ */ jsx29(
9549
+ !canvas || visibleColumns.has(column.key) && (pluginCellProps.content !== void 0 || !column.canvasRender && (column.render || textColumn === column.key)) ? /* @__PURE__ */ jsx35(
9470
9550
  TableCellContent,
9471
9551
  {
9472
9552
  ellipsis: column.ellipsis !== false,
@@ -9474,7 +9554,7 @@ var TableBodyRow = memo(function TableBodyRow2({
9474
9554
  children: pluginCellProps.content !== void 0 ? pluginCellProps.content : column.render ? column.render(value, row.record, row.sourceIndex, { row, rowIndex, column }) : value
9475
9555
  }
9476
9556
  ) : null,
9477
- resize && column.key === resizeColumnKey ? /* @__PURE__ */ jsx29(RowResizeHandle, { height: rowHeight, ...resize }) : null
9557
+ resize && column.key === resizeColumnKey ? /* @__PURE__ */ jsx35(RowResizeHandle, { height: rowHeight, ...resize }) : null
9478
9558
  ]
9479
9559
  },
9480
9560
  column.key
@@ -9525,8 +9605,8 @@ function TableInner(props, ref) {
9525
9605
  style,
9526
9606
  ...htmlProps
9527
9607
  } = props;
9528
- const [localRowHeights, setLocalRowHeights] = useState24({});
9529
- const [rowHeightPreview, setRowHeightPreview] = useState24(null);
9608
+ const [localRowHeights, setLocalRowHeights] = useState27({});
9609
+ const [rowHeightPreview, setRowHeightPreview] = useState27(null);
9530
9610
  const configuredRowHeights = rowHeights ?? localRowHeights;
9531
9611
  const effectiveRowHeights = useMemo10(() => rowHeightPreview ? { ...configuredRowHeights, [rowHeightPreview.key]: rowHeightPreview.height } : configuredRowHeights, [configuredRowHeights, rowHeightPreview]);
9532
9612
  const resizeMin = Math.max(SIZE_ROW_HEIGHT[size], Number.isFinite(minRowHeight) ? minRowHeight : SIZE_ROW_HEIGHT[size]);
@@ -9536,25 +9616,25 @@ function TableInner(props, ref) {
9536
9616
  if (rowHeights === void 0) setLocalRowHeights((previous) => ({ ...previous, [String(row.key)]: height2 }));
9537
9617
  onRowHeightChange?.(row.record, height2, row.sourceIndex);
9538
9618
  }, [rowHeights, onRowHeightChange]);
9539
- const rootRef = useRef24(null);
9619
+ const rootRef = useRef27(null);
9540
9620
  const remainingHeight = useRemainingHeight(rootRef, height == null && tableHeight == null ? fillRemaining : false);
9541
- const scrollRef = useRef24(null);
9542
- const cellFocusRequest = useRef24(0);
9543
- const cellGlow = useRef24(null);
9544
- useEffect17(() => () => {
9621
+ const scrollRef = useRef27(null);
9622
+ const cellFocusRequest = useRef27(0);
9623
+ const cellGlow = useRef27(null);
9624
+ useEffect19(() => () => {
9545
9625
  cellFocusRequest.current++;
9546
9626
  cellGlow.current?.();
9547
9627
  }, []);
9548
- const tableRef = useRef24(null);
9628
+ const tableRef = useRef27(null);
9549
9629
  useScrollbarProximity();
9550
- const scrollbarDragRef = useRef24(null);
9551
- const [internalLoading, setInternalLoading] = useState24(false);
9552
- const [scrollTop, setScrollTop] = useState24(0);
9553
- const [scrollLeft, setScrollLeft] = useState24(0);
9554
- const [viewportHeight, setViewportHeight] = useState24(420);
9555
- const [viewportWidth, setViewportWidth] = useState24(0);
9556
- const [autoColumnWidths, setAutoColumnWidths] = useState24({});
9557
- const [resolveRowIdentity] = useState24(createRowIdentity);
9630
+ const scrollbarDragRef = useRef27(null);
9631
+ const [internalLoading, setInternalLoading] = useState27(false);
9632
+ const [scrollTop, setScrollTop] = useState27(0);
9633
+ const [scrollLeft, setScrollLeft] = useState27(0);
9634
+ const [viewportHeight, setViewportHeight] = useState27(420);
9635
+ const [viewportWidth, setViewportWidth] = useState27(0);
9636
+ const [autoColumnWidths, setAutoColumnWidths] = useState27({});
9637
+ const [resolveRowIdentity] = useState27(createRowIdentity);
9558
9638
  const getRowKey = useCallback2((record, index) => resolveRowIdentity(record, index, typeof rowKey === "function" ? rowKey : rowKey == null ? void 0 : String(rowKey)), [rowKey, resolveRowIdentity]);
9559
9639
  const builtInResizePlugin = useMemo10(() => createResizePlugin(), []);
9560
9640
  const builtInHighlightPlugin = useMemo10(() => createHighlightPlugin(), []);
@@ -9569,14 +9649,14 @@ function TableInner(props, ref) {
9569
9649
  return plugins;
9570
9650
  }, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, builtInIndexPlugin, providedPlugins, resizable, cellSelection, showIndex]);
9571
9651
  const sortedPlugins = useMemo10(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
9572
- const pluginsByIdRef = useRef24(/* @__PURE__ */ new Map());
9652
+ const pluginsByIdRef = useRef27(/* @__PURE__ */ new Map());
9573
9653
  pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
9574
- const [pluginStates, setPluginStates] = useState24(() => Object.fromEntries(
9654
+ const [pluginStates, setPluginStates] = useState27(() => Object.fromEntries(
9575
9655
  sortedPlugins.map((plugin) => [plugin.id, resolveInitialState(plugin)])
9576
9656
  ));
9577
- const pluginApisRef = useRef24({});
9578
- const contextsRef = useRef24(/* @__PURE__ */ new Map());
9579
- const mountedPluginsRef = useRef24(/* @__PURE__ */ new Map());
9657
+ const pluginApisRef = useRef27({});
9658
+ const contextsRef = useRef27(/* @__PURE__ */ new Map());
9659
+ const mountedPluginsRef = useRef27(/* @__PURE__ */ new Map());
9580
9660
  const pipeline = { columns: baseColumns, rows: createTableRows(dataSource, getRowKey) };
9581
9661
  const nextApis = {};
9582
9662
  const contexts = /* @__PURE__ */ new Map();
@@ -9633,7 +9713,7 @@ function TableInner(props, ref) {
9633
9713
  });
9634
9714
  pluginApisRef.current = nextApis;
9635
9715
  contextsRef.current = contexts;
9636
- useEffect17(() => {
9716
+ useEffect19(() => {
9637
9717
  const activePlugins2 = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
9638
9718
  for (const [pluginId, mounted] of mountedPluginsRef.current) {
9639
9719
  if (activePlugins2.get(pluginId) === mounted.plugin) continue;
@@ -9645,7 +9725,7 @@ function TableInner(props, ref) {
9645
9725
  mountedPluginsRef.current.set(plugin.id, { plugin, cleanup: plugin.onMount(contextsRef.current.get(plugin.id)) });
9646
9726
  }
9647
9727
  }, [sortedPlugins]);
9648
- useEffect17(() => () => {
9728
+ useEffect19(() => () => {
9649
9729
  for (const mounted of mountedPluginsRef.current.values()) mounted.cleanup?.();
9650
9730
  mountedPluginsRef.current.clear();
9651
9731
  }, []);
@@ -9689,7 +9769,7 @@ function TableInner(props, ref) {
9689
9769
  verticalTrackElement?.style.setProperty("--sia-table-scrollbar-y-size", `${verticalThumb}px`);
9690
9770
  verticalTrackElement?.style.setProperty("--sia-table-scrollbar-y-position", `${verticalPosition}px`);
9691
9771
  }, []);
9692
- useEffect17(() => {
9772
+ useEffect19(() => {
9693
9773
  const element = scrollRef.current;
9694
9774
  if (!element || typeof ResizeObserver === "undefined") return;
9695
9775
  const observer = new ResizeObserver(() => {
@@ -9702,19 +9782,19 @@ function TableInner(props, ref) {
9702
9782
  updateScrollMetrics();
9703
9783
  return () => observer.disconnect();
9704
9784
  }, [updateScrollMetrics]);
9705
- useEffect17(() => {
9785
+ useEffect19(() => {
9706
9786
  updateScrollMetrics();
9707
9787
  });
9708
9788
  const orderedColumns = useMemo10(() => sortTableColumnsByFixed(pipeline.columns), [pipeline.columns]);
9709
9789
  const leafColumns = useMemo10(() => flattenTableColumns(orderedColumns), [orderedColumns]);
9710
9790
  const headerRows = useMemo10(() => buildHeaderRows(orderedColumns), [orderedColumns]);
9711
- const measuredCells = useRef24(/* @__PURE__ */ new WeakSet());
9791
+ const measuredCells = useRef27(/* @__PURE__ */ new WeakSet());
9712
9792
  const autoWidthSignature = leafColumns.map((column) => `${column.key}:${column.autoWidth}:${resizedWidths[column.key] ?? ""}`).join("|");
9713
- useEffect17(() => {
9793
+ useEffect19(() => {
9714
9794
  measuredCells.current = /* @__PURE__ */ new WeakSet();
9715
9795
  setAutoColumnWidths({});
9716
9796
  }, [dataSource, baseColumns, size, autoWidthSignature]);
9717
- useEffect17(() => {
9797
+ useEffect19(() => {
9718
9798
  const autoWidthColumns = leafColumns.filter((column) => column.autoWidth && resizedWidths[column.key] === void 0);
9719
9799
  const root = rootRef.current;
9720
9800
  if (!root || autoWidthColumns.length === 0) return;
@@ -9826,20 +9906,20 @@ function TableInner(props, ref) {
9826
9906
  ]);
9827
9907
  const toolbarStart = sortedPlugins.map((plugin) => {
9828
9908
  const content = plugin.renderToolbarStart?.(getContext(plugin));
9829
- return content ? /* @__PURE__ */ jsx29(Fragment9, { children: content }, `toolbar-start-${plugin.id}`) : null;
9909
+ return content ? /* @__PURE__ */ jsx35(Fragment12, { children: content }, `toolbar-start-${plugin.id}`) : null;
9830
9910
  }).filter(Boolean);
9831
9911
  const toolbarEnd = sortedPlugins.map((plugin) => {
9832
9912
  const content = plugin.renderToolbarEnd?.(getContext(plugin));
9833
- return content ? /* @__PURE__ */ jsx29(Fragment9, { children: content }, `toolbar-end-${plugin.id}`) : null;
9913
+ return content ? /* @__PURE__ */ jsx35(Fragment12, { children: content }, `toolbar-end-${plugin.id}`) : null;
9834
9914
  }).filter(Boolean);
9835
9915
  const summaries = sortedPlugins.flatMap((plugin) => plugin.renderSummary?.(getContext(plugin)) ?? []);
9836
9916
  const footers = sortedPlugins.map((plugin) => {
9837
9917
  const content = plugin.renderFooter?.(getContext(plugin));
9838
- return content ? /* @__PURE__ */ jsx29(Fragment9, { children: content }, `footer-${plugin.id}`) : null;
9918
+ return content ? /* @__PURE__ */ jsx35(Fragment12, { children: content }, `footer-${plugin.id}`) : null;
9839
9919
  }).filter(Boolean);
9840
9920
  const overlays = sortedPlugins.map((plugin) => {
9841
9921
  const content = plugin.renderOverlay?.(getContext(plugin));
9842
- return content ? /* @__PURE__ */ jsx29(Fragment9, { children: content }, `overlay-${plugin.id}`) : null;
9922
+ return content ? /* @__PURE__ */ jsx35(Fragment12, { children: content }, `overlay-${plugin.id}`) : null;
9843
9923
  }).filter(Boolean);
9844
9924
  const hasToolbar = toolbarStart.length > 0 || toolbarEnd.length > 0;
9845
9925
  const effectiveHeight = height ?? tableHeight ?? remainingHeight ?? (shouldVirtualize && maxBodyHeight == null ? 420 : void 0);
@@ -10016,10 +10096,10 @@ function TableInner(props, ref) {
10016
10096
  }
10017
10097
  function renderHeaderContent(column, content) {
10018
10098
  const title = getHeaderTitleText(column.title ?? column.name) || column.name || column.key;
10019
- return /* @__PURE__ */ jsxs25("span", { className: `sia-table__header-label${column.required ? " sia-table__header-label--required" : ""}`, children: [
10020
- column.required && /* @__PURE__ */ jsx29("span", { className: "sia-table__required-mark", "aria-hidden": "true", children: "*" }),
10021
- /* @__PURE__ */ jsx29("span", { className: "sia-table__header-label-content", "data-sia-title-overflow-only": true, ...withTitleTooltip({ title }), children: content }),
10022
- column.description != null && /* @__PURE__ */ jsx29(Tooltip, { title: column.description, placement: "top", trigger: ["hover", "focus"], children: /* @__PURE__ */ jsx29("button", { type: "button", className: "sia-table__header-description", "aria-label": `${column.name ?? column.key}\u5217\u8BF4\u660E`, onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx29(Icon, { name: "info", size: 14 }) }) })
10099
+ return /* @__PURE__ */ jsxs30("span", { className: `sia-table__header-label${column.required ? " sia-table__header-label--required" : ""}`, children: [
10100
+ column.required && /* @__PURE__ */ jsx35("span", { className: "sia-table__required-mark", "aria-hidden": "true", children: "*" }),
10101
+ /* @__PURE__ */ jsx35("span", { className: "sia-table__header-label-content", "data-sia-title-overflow-only": true, ...withTitleTooltip({ title }), children: content }),
10102
+ column.description != null && /* @__PURE__ */ jsx35(Tooltip, { title: column.description, placement: "top", trigger: ["hover", "focus"], children: /* @__PURE__ */ jsx35("button", { type: "button", className: "sia-table__header-description", "aria-label": `${column.name ?? column.key}\u5217\u8BF4\u660E`, onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx35(Icon, { name: "info", size: 14 }) }) })
10023
10103
  ] });
10024
10104
  }
10025
10105
  function getPluginCellProps(row, column) {
@@ -10059,17 +10139,17 @@ function TableInner(props, ref) {
10059
10139
  }
10060
10140
  function renderSummaryRow(summary) {
10061
10141
  let labelRendered = false;
10062
- return /* @__PURE__ */ jsx29("tr", { className: `sia-table__summary-row ${summary.className ?? ""}`.trim(), children: leafColumns.map((column) => {
10142
+ return /* @__PURE__ */ jsx35("tr", { className: `sia-table__summary-row ${summary.className ?? ""}`.trim(), children: leafColumns.map((column) => {
10063
10143
  const value = summary.values[column.key];
10064
10144
  const isLabel = value === void 0 && !labelRendered && summary.label !== void 0;
10065
10145
  const content = value !== void 0 ? value : isLabel ? (labelRendered = true, summary.label) : null;
10066
10146
  const fixed = normalizeFixed(column.fixed);
10067
10147
  const fixedEdgeClass = fixed === "left" && column.key === leftFixedEdgeKey ? " sia-table__cell--fixed-left-edge" : fixed === "right" && column.key === rightFixedEdgeKey ? " sia-table__cell--fixed-right-edge" : "";
10068
10148
  const autoWidthClass = column.autoWidth ? " sia-table__cell--auto-width" : "";
10069
- return /* @__PURE__ */ jsx29("td", { "data-column-key": column.key, className: `sia-table__cell sia-table__cell--${column.align ?? "left"} sia-table__summary-cell${isLabel ? " sia-table__summary-cell--label" : ""}${fixed ? ` sia-table__cell--fixed sia-table__cell--fixed-${fixed}` : ""}${fixedEdgeClass}${autoWidthClass}`, style: getFixedStyle(column), children: isLabel ? /* @__PURE__ */ jsx29("span", { className: "sia-table__summary-label", children: content }) : content }, column.key);
10149
+ return /* @__PURE__ */ jsx35("td", { "data-column-key": column.key, className: `sia-table__cell sia-table__cell--${column.align ?? "left"} sia-table__summary-cell${isLabel ? " sia-table__summary-cell--label" : ""}${fixed ? ` sia-table__cell--fixed sia-table__cell--fixed-${fixed}` : ""}${fixedEdgeClass}${autoWidthClass}`, style: getFixedStyle(column), children: isLabel ? /* @__PURE__ */ jsx35("span", { className: "sia-table__summary-label", children: content }) : content }, column.key);
10070
10150
  }) }, summary.key);
10071
10151
  }
10072
- return /* @__PURE__ */ jsxs25(
10152
+ return /* @__PURE__ */ jsxs30(
10073
10153
  "div",
10074
10154
  {
10075
10155
  ref: rootRef,
@@ -10120,19 +10200,19 @@ function TableInner(props, ref) {
10120
10200
  htmlProps.onDoubleClickCapture?.(event);
10121
10201
  },
10122
10202
  children: [
10123
- hasToolbar ? /* @__PURE__ */ jsxs25("div", { className: "sia-table__toolbar", children: [
10124
- /* @__PURE__ */ jsx29("div", { children: toolbarStart }),
10125
- /* @__PURE__ */ jsx29("div", { children: toolbarEnd })
10203
+ hasToolbar ? /* @__PURE__ */ jsxs30("div", { className: "sia-table__toolbar", children: [
10204
+ /* @__PURE__ */ jsx35("div", { children: toolbarStart }),
10205
+ /* @__PURE__ */ jsx35("div", { children: toolbarEnd })
10126
10206
  ] }) : null,
10127
- /* @__PURE__ */ jsxs25("div", { className: "sia-table__viewport-wrap", style: viewportStyle, children: [
10128
- /* @__PURE__ */ jsx29("div", { className: "sia-table__viewport", ref: scrollRef, onScroll: handleScroll, children: /* @__PURE__ */ jsxs25("table", { ref: tableRef, className: "sia-table__element", style: { width: Math.max(totalWidth, 1), ...manualColumnLayout ? { minWidth: 0 } : {}, ...tableStyle }, children: [
10129
- /* @__PURE__ */ jsx29("colgroup", { children: leafColumns.map((column) => /* @__PURE__ */ jsx29("col", { "data-column-key": column.key, style: { width: columnWidths.get(column.key) ?? DEFAULT_WIDTH } }, column.key)) }),
10130
- /* @__PURE__ */ jsx29("thead", { className: stickyHeader ? "sia-table__head sia-table__head--sticky" : "sia-table__head", children: headerRows.map((headerRow, depth) => /* @__PURE__ */ jsx29("tr", { children: headerRow.map((cell) => {
10207
+ /* @__PURE__ */ jsxs30("div", { className: "sia-table__viewport-wrap", style: viewportStyle, children: [
10208
+ /* @__PURE__ */ jsx35("div", { className: "sia-table__viewport", ref: scrollRef, onScroll: handleScroll, children: /* @__PURE__ */ jsxs30("table", { ref: tableRef, className: "sia-table__element", style: { width: Math.max(totalWidth, 1), ...manualColumnLayout ? { minWidth: 0 } : {}, ...tableStyle }, children: [
10209
+ /* @__PURE__ */ jsx35("colgroup", { children: leafColumns.map((column) => /* @__PURE__ */ jsx35("col", { "data-column-key": column.key, style: { width: columnWidths.get(column.key) ?? DEFAULT_WIDTH } }, column.key)) }),
10210
+ /* @__PURE__ */ jsx35("thead", { className: stickyHeader ? "sia-table__head sia-table__head--sticky" : "sia-table__head", children: headerRows.map((headerRow, depth) => /* @__PURE__ */ jsx35("tr", { children: headerRow.map((cell) => {
10131
10211
  const fixed = cell.fixed;
10132
10212
  const pluginHeaderProps = getPluginHeaderCellProps(cell.column);
10133
10213
  const fixedEdgeClass = fixed === "left" && cell.column.key === leftFixedEdgeKey ? " sia-table__cell--fixed-left-edge" : fixed === "right" && cell.column.key === rightFixedEdgeKey ? " sia-table__cell--fixed-right-edge" : "";
10134
10214
  const autoWidthClass = cell.column.autoWidth ? " sia-table__cell--auto-width" : "";
10135
- return /* @__PURE__ */ jsx29(
10215
+ return /* @__PURE__ */ jsx35(
10136
10216
  "th",
10137
10217
  {
10138
10218
  "data-column-key": cell.column.key,
@@ -10153,10 +10233,10 @@ function TableInner(props, ref) {
10153
10233
  `${cell.column.key}-${depth}-${cell.firstLeafKey}`
10154
10234
  );
10155
10235
  }) }, depth)) }),
10156
- /* @__PURE__ */ jsxs25("tbody", { children: [
10157
- maxBodyHeight != null && pipeline.rows.length === 0 ? /* @__PURE__ */ jsx29("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx29("td", { colSpan: leafColumns.length, style: { height: 120, padding: 0, border: 0 } }) }) : null,
10158
- pipeline.rows.length === 0 && summaries.length > 0 ? /* @__PURE__ */ jsx29("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx29("td", { colSpan: leafColumns.length, style: { height: Math.max(0, viewportHeight - (headerRows.length + summaries.length) * rowHeight), padding: 0, border: 0 } }) }) : null,
10159
- topSpacer > 0 ? /* @__PURE__ */ jsx29("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx29("td", { colSpan: leafColumns.length, style: { height: topSpacer, padding: 0, border: 0 } }) }) : null,
10236
+ /* @__PURE__ */ jsxs30("tbody", { children: [
10237
+ maxBodyHeight != null && pipeline.rows.length === 0 ? /* @__PURE__ */ jsx35("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx35("td", { colSpan: leafColumns.length, style: { height: 120, padding: 0, border: 0 } }) }) : null,
10238
+ pipeline.rows.length === 0 && summaries.length > 0 ? /* @__PURE__ */ jsx35("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx35("td", { colSpan: leafColumns.length, style: { height: Math.max(0, viewportHeight - (headerRows.length + summaries.length) * rowHeight), padding: 0, border: 0 } }) }) : null,
10239
+ topSpacer > 0 ? /* @__PURE__ */ jsx35("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx35("td", { colSpan: leafColumns.length, style: { height: topSpacer, padding: 0, border: 0 } }) }) : null,
10160
10240
  renderedRows.map((row, offset) => {
10161
10241
  const cached = rowElements.get(row.key);
10162
10242
  if (cached) return cached;
@@ -10165,7 +10245,7 @@ function TableInner(props, ref) {
10165
10245
  const status = typeof rowStatus === "function" ? rowStatus(row.record, row.sourceIndex) : rowStatus;
10166
10246
  const statusClass = status ? `sia-table__row--${status}` : "";
10167
10247
  const customClass = typeof rowClassName === "function" ? rowClassName(row.record, row.sourceIndex) : rowClassName ?? "";
10168
- const element = /* @__PURE__ */ jsx29(
10248
+ const element = /* @__PURE__ */ jsx35(
10169
10249
  TableBodyRow,
10170
10250
  {
10171
10251
  canvas,
@@ -10226,13 +10306,13 @@ function TableInner(props, ref) {
10226
10306
  rowElements.set(row.key, element);
10227
10307
  return element;
10228
10308
  }),
10229
- bottomSpacer > 0 ? /* @__PURE__ */ jsx29("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx29("td", { colSpan: leafColumns.length, style: { height: bottomSpacer, padding: 0, border: 0 } }) }) : null
10309
+ bottomSpacer > 0 ? /* @__PURE__ */ jsx35("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx35("td", { colSpan: leafColumns.length, style: { height: bottomSpacer, padding: 0, border: 0 } }) }) : null
10230
10310
  ] }),
10231
- summaries.length > 0 ? /* @__PURE__ */ jsx29("tfoot", { className: "sia-table__summary", children: summaries.map(renderSummaryRow) }) : null
10311
+ summaries.length > 0 ? /* @__PURE__ */ jsx35("tfoot", { className: "sia-table__summary", children: summaries.map(renderSummaryRow) }) : null
10232
10312
  ] }) }),
10233
- pipeline.rows.length === 0 ? /* @__PURE__ */ jsx29("div", { className: "sia-table__empty", role: "status", children: emptyText }) : null,
10234
- canvas ? /* @__PURE__ */ jsx29(TableCanvasLayer, { viewport: scrollRef, rows: pipeline.rows, columns: leafColumns, widths: columnWidths, rowHeight, headerHeight: headerRows.length * rowHeight }) : null,
10235
- /* @__PURE__ */ jsx29(
10313
+ pipeline.rows.length === 0 ? /* @__PURE__ */ jsx35("div", { className: "sia-table__empty", role: "status", children: emptyText }) : null,
10314
+ canvas ? /* @__PURE__ */ jsx35(TableCanvasLayer, { viewport: scrollRef, rows: pipeline.rows, columns: leafColumns, widths: columnWidths, rowHeight, headerHeight: headerRows.length * rowHeight }) : null,
10315
+ /* @__PURE__ */ jsx35(
10236
10316
  "div",
10237
10317
  {
10238
10318
  className: "sia-scrollbar-track sia-table__scrollbar sia-table__scrollbar--horizontal",
@@ -10243,10 +10323,10 @@ function TableInner(props, ref) {
10243
10323
  onPointerMove: handleScrollbarPointerMove,
10244
10324
  onPointerUp: handleScrollbarPointerEnd,
10245
10325
  onPointerCancel: handleScrollbarPointerEnd,
10246
- children: /* @__PURE__ */ jsx29("div", { className: "sia-table__scrollbar-thumb" })
10326
+ children: /* @__PURE__ */ jsx35("div", { className: "sia-table__scrollbar-thumb" })
10247
10327
  }
10248
10328
  ),
10249
- /* @__PURE__ */ jsx29(
10329
+ /* @__PURE__ */ jsx35(
10250
10330
  "div",
10251
10331
  {
10252
10332
  className: "sia-scrollbar-track sia-table__scrollbar sia-table__scrollbar--vertical",
@@ -10257,21 +10337,21 @@ function TableInner(props, ref) {
10257
10337
  onPointerMove: handleScrollbarPointerMove,
10258
10338
  onPointerUp: handleScrollbarPointerEnd,
10259
10339
  onPointerCancel: handleScrollbarPointerEnd,
10260
- children: /* @__PURE__ */ jsx29("div", { className: "sia-table__scrollbar-thumb" })
10340
+ children: /* @__PURE__ */ jsx35("div", { className: "sia-table__scrollbar-thumb" })
10261
10341
  }
10262
10342
  )
10263
10343
  ] }),
10264
- footers.length > 0 ? /* @__PURE__ */ jsx29("div", { className: "sia-table__footer", children: footers }) : null,
10265
- loading || internalLoading ? /* @__PURE__ */ jsxs25("div", { className: "sia-table__loading", role: "status", children: [
10266
- /* @__PURE__ */ jsx29(Icon, { name: "loader", size: 22, spin: true }),
10267
- /* @__PURE__ */ jsx29("span", { children: "\u52A0\u8F7D\u4E2D" })
10344
+ footers.length > 0 ? /* @__PURE__ */ jsx35("div", { className: "sia-table__footer", children: footers }) : null,
10345
+ loading || internalLoading ? /* @__PURE__ */ jsxs30("div", { className: "sia-table__loading", role: "status", children: [
10346
+ /* @__PURE__ */ jsx35(Icon, { name: "loader", size: 22, spin: true }),
10347
+ /* @__PURE__ */ jsx35("span", { children: "\u52A0\u8F7D\u4E2D" })
10268
10348
  ] }) : null,
10269
10349
  overlays
10270
10350
  ]
10271
10351
  }
10272
10352
  );
10273
10353
  }
10274
- var Table = forwardRef6(TableInner);
10354
+ var Table = forwardRef13(TableInner);
10275
10355
 
10276
10356
  // src/components/Table/worksheetModel.ts
10277
10357
  function parseWorksheetText(text) {
@@ -10337,7 +10417,7 @@ function incrementWorksheetValue(value, offset) {
10337
10417
  }
10338
10418
 
10339
10419
  // src/components/Table/worksheet.tsx
10340
- import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
10420
+ import { Fragment as Fragment13, jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
10341
10421
  var isEmpty2 = (value) => value == null || value === "";
10342
10422
  var editorKind = (column) => !column.editable ? "readonly" : typeof column.editable === "object" ? column.editable.type ?? "input" : "input";
10343
10423
  var nativeEditor = (target) => target instanceof Element && Boolean(
@@ -10765,9 +10845,9 @@ function createWorksheetPlugin(options) {
10765
10845
  const area = bounds(), cols = columns();
10766
10846
  const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && // 填充入口与编辑权限一致,避免只读格或保存锁定后仍暗示可以拖拽修改。
10767
10847
  editable(record, column) && (suppressEditing || !context.state.editing);
10768
- return /* @__PURE__ */ jsxs26(Fragment10, { children: [
10848
+ return /* @__PURE__ */ jsxs31(Fragment13, { children: [
10769
10849
  render ? render(value, record, index, info) : value,
10770
- handle && /* @__PURE__ */ jsx30(
10850
+ handle && /* @__PURE__ */ jsx36(
10771
10851
  "button",
10772
10852
  {
10773
10853
  type: "button",
@@ -10813,25 +10893,25 @@ function createWorksheetPlugin(options) {
10813
10893
  },
10814
10894
  renderToolbarStart(current) {
10815
10895
  remember(current);
10816
- return options.toolbar === false ? null : /* @__PURE__ */ jsxs26("span", { className: "sia-table__worksheet-tools", children: [
10817
- /* @__PURE__ */ jsx30(
10896
+ return options.toolbar === false ? null : /* @__PURE__ */ jsxs31("span", { className: "sia-table__worksheet-tools", children: [
10897
+ /* @__PURE__ */ jsx36(
10818
10898
  Button,
10819
10899
  {
10820
10900
  variant: "text",
10821
10901
  size: "small",
10822
- icon: /* @__PURE__ */ jsx30(Icon, { name: "undo" }),
10902
+ icon: /* @__PURE__ */ jsx36(Icon, { name: "undo" }),
10823
10903
  disabled: !undoStack.length,
10824
10904
  title: "\u64A4\u9500\uFF08Ctrl/Cmd + Z\uFF09",
10825
10905
  onClick: api.undo,
10826
10906
  children: "\u64A4\u9500"
10827
10907
  }
10828
10908
  ),
10829
- /* @__PURE__ */ jsx30(
10909
+ /* @__PURE__ */ jsx36(
10830
10910
  Button,
10831
10911
  {
10832
10912
  variant: "text",
10833
10913
  size: "small",
10834
- icon: /* @__PURE__ */ jsx30(Icon, { name: "redo" }),
10914
+ icon: /* @__PURE__ */ jsx36(Icon, { name: "redo" }),
10835
10915
  disabled: !redoStack.length,
10836
10916
  title: "\u6062\u590D\uFF08Ctrl/Cmd + Shift + Z \u6216 Ctrl/Cmd + Y\uFF09",
10837
10917
  onClick: api.redo,
@@ -10842,7 +10922,7 @@ function createWorksheetPlugin(options) {
10842
10922
  },
10843
10923
  renderOverlay(current) {
10844
10924
  remember(current);
10845
- return /* @__PURE__ */ jsx30(
10925
+ return /* @__PURE__ */ jsx36(
10846
10926
  "span",
10847
10927
  {
10848
10928
  hidden: true,
@@ -10929,16 +11009,16 @@ function createWorksheetPlugin(options) {
10929
11009
  }
10930
11010
 
10931
11011
  // src/components/Video.tsx
10932
- import { forwardRef as forwardRef7 } from "react";
10933
- import { jsx as jsx31 } from "react/jsx-runtime";
10934
- var Video = forwardRef7(function Video2({ controls = true, muted = false, playsInline = true, className = "", ...props }, ref) {
10935
- return /* @__PURE__ */ jsx31("video", { ...props, ref, controls, muted, playsInline, className: `sia-video ${className}`.trim() });
11012
+ import { forwardRef as forwardRef14 } from "react";
11013
+ import { jsx as jsx37 } from "react/jsx-runtime";
11014
+ var Video = forwardRef14(function Video2({ controls = true, muted = false, playsInline = true, className = "", ...props }, ref) {
11015
+ return /* @__PURE__ */ jsx37("video", { ...props, ref, controls, muted, playsInline, className: `sia-video ${className}`.trim() });
10936
11016
  });
10937
11017
 
10938
11018
  // src/components/InputSelect.tsx
10939
- import { forwardRef as forwardRef8, useEffect as useEffect18, useRef as useRef25, useState as useState25 } from "react";
10940
- import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
10941
- var InputSelect = forwardRef8(function InputSelect2({
11019
+ import { forwardRef as forwardRef15, useEffect as useEffect20, useRef as useRef28, useState as useState28 } from "react";
11020
+ import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
11021
+ var InputSelect = forwardRef15(function InputSelect2({
10942
11022
  options,
10943
11023
  value,
10944
11024
  defaultValue,
@@ -10964,22 +11044,22 @@ var InputSelect = forwardRef8(function InputSelect2({
10964
11044
  ...inputProps
10965
11045
  }, forwardedRef) {
10966
11046
  const size = useControlSize(sizeProp);
10967
- const [internal, setInternal] = useState25(defaultValue);
11047
+ const [internal, setInternal] = useState28(defaultValue);
10968
11048
  const current = value !== void 0 ? value : internal;
10969
11049
  const values = normalizeSelectionValues(current == null ? [] : Array.isArray(current) ? current : [current], options);
10970
11050
  const text = values.map((item) => displayField === "label" ? String(options.find((option) => option.optionType !== "divider" && option.value === item)?.label ?? item) : String(item)).join(",");
10971
- const [draft, setDraft] = useState25(text);
10972
- useEffect18(() => {
11051
+ const [draft, setDraft] = useState28(text);
11052
+ useEffect20(() => {
10973
11053
  setDraft(text);
10974
11054
  }, [text, current]);
10975
- const [open, setOpen] = useState25(false);
10976
- const [search, setSearch] = useState25("");
10977
- const [modalOpen, setModalOpen] = useState25(false);
10978
- const [modalValues, setModalValues] = useState25([]);
10979
- const [selectedOnly, setSelectedOnly] = useState25(false);
10980
- const rootRef = useRef25(null);
10981
- const popupRef = useRef25(null);
10982
- const inputRef = useRef25(null);
11055
+ const [open, setOpen] = useState28(false);
11056
+ const [search, setSearch] = useState28("");
11057
+ const [modalOpen, setModalOpen] = useState28(false);
11058
+ const [modalValues, setModalValues] = useState28([]);
11059
+ const [selectedOnly, setSelectedOnly] = useState28(false);
11060
+ const rootRef = useRef28(null);
11061
+ const popupRef = useRef28(null);
11062
+ const inputRef = useRef28(null);
10983
11063
  const config = typeof enableModal === "object" ? enableModal : {};
10984
11064
  function changeOpen(next) {
10985
11065
  if (next && (disabled || loading)) return;
@@ -10999,7 +11079,7 @@ var InputSelect = forwardRef8(function InputSelect2({
10999
11079
  inputRef.current?.focus();
11000
11080
  }
11001
11081
  }
11002
- useEffect18(() => {
11082
+ useEffect20(() => {
11003
11083
  if (!open) return;
11004
11084
  const outside = (event) => {
11005
11085
  if (!rootRef.current?.contains(event.target) && !popupRef.current?.contains(event.target)) changeOpen(false);
@@ -11007,7 +11087,7 @@ var InputSelect = forwardRef8(function InputSelect2({
11007
11087
  document.addEventListener("pointerdown", outside);
11008
11088
  return () => document.removeEventListener("pointerdown", outside);
11009
11089
  }, [open, onOpenChange]);
11010
- useEffect18(() => {
11090
+ useEffect20(() => {
11011
11091
  if (disabled || loading) {
11012
11092
  changeOpen(false);
11013
11093
  setModalOpen(false);
@@ -11020,14 +11100,14 @@ var InputSelect = forwardRef8(function InputSelect2({
11020
11100
  setSelectedOnly(false);
11021
11101
  setModalOpen(true);
11022
11102
  }
11023
- return /* @__PURE__ */ jsxs27("div", { ref: rootRef, style, className: `sia-input-select${open || modalOpen ? " is-open" : ""} ${className}`, onKeyDown: (event) => {
11103
+ return /* @__PURE__ */ jsxs32("div", { ref: rootRef, style, className: `sia-input-select${open || modalOpen ? " is-open" : ""} ${className}`, onKeyDown: (event) => {
11024
11104
  if (event.key === "Escape" && open) {
11025
11105
  event.stopPropagation();
11026
11106
  changeOpen(false);
11027
11107
  inputRef.current?.focus();
11028
11108
  }
11029
11109
  }, children: [
11030
- /* @__PURE__ */ jsx32(
11110
+ /* @__PURE__ */ jsx38(
11031
11111
  Input,
11032
11112
  {
11033
11113
  ...inputProps,
@@ -11064,26 +11144,26 @@ var InputSelect = forwardRef8(function InputSelect2({
11064
11144
  emit(parseInput ? parseInput(next) : multiple ? next.split(",").map((item) => item.trim()).filter(Boolean) : next);
11065
11145
  changeOpen(true);
11066
11146
  },
11067
- suffix: /* @__PURE__ */ jsxs27("span", { className: "sia-input-select__suffix", children: [
11068
- allowClear && draft && !disabled && /* @__PURE__ */ jsx32(Button, { className: "sia-input-select__clear", variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
11147
+ suffix: /* @__PURE__ */ jsxs32("span", { className: "sia-input-select__suffix", children: [
11148
+ allowClear && draft && !disabled && /* @__PURE__ */ jsx38(Button, { className: "sia-input-select__clear", variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
11069
11149
  event.stopPropagation();
11070
11150
  setDraft("");
11071
11151
  emit(multiple ? [] : void 0);
11072
11152
  inputRef.current?.focus();
11073
11153
  }, children: "\xD7" }),
11074
11154
  suffix,
11075
- enableModal && /* @__PURE__ */ jsx32(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u6253\u5F00\u9009\u62E9\u5F39\u7A97", onClick: (event) => {
11155
+ enableModal && /* @__PURE__ */ jsx38(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u6253\u5F00\u9009\u62E9\u5F39\u7A97", onClick: (event) => {
11076
11156
  event.stopPropagation();
11077
11157
  openModal();
11078
11158
  }, children: "\u2026" }),
11079
- /* @__PURE__ */ jsx32(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u5C55\u5F00\u9009\u9879", onClick: (event) => {
11159
+ /* @__PURE__ */ jsx38(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u5C55\u5F00\u9009\u9879", onClick: (event) => {
11080
11160
  event.stopPropagation();
11081
11161
  changeOpen(!open);
11082
- }, children: /* @__PURE__ */ jsx32(Icon, { name: loading ? "refresh" : open ? "chevron-up" : "chevron-down", size: 13 }) })
11162
+ }, children: /* @__PURE__ */ jsx38(Icon, { name: loading ? "refresh" : open ? "chevron-up" : "chevron-down", size: 13 }) })
11083
11163
  ] })
11084
11164
  }
11085
11165
  ),
11086
- /* @__PURE__ */ jsx32(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && !disabled && !loading, className: "sia-input-select__popup", children: /* @__PURE__ */ jsx32(
11166
+ /* @__PURE__ */ jsx38(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && !disabled && !loading, className: "sia-input-select__popup", children: /* @__PURE__ */ jsx38(
11087
11167
  SelectionPanel,
11088
11168
  {
11089
11169
  options,
@@ -11098,7 +11178,7 @@ var InputSelect = forwardRef8(function InputSelect2({
11098
11178
  onSearch: setSearch
11099
11179
  }
11100
11180
  ) }),
11101
- enableModal && /* @__PURE__ */ jsxs27(
11181
+ enableModal && /* @__PURE__ */ jsxs32(
11102
11182
  Modal,
11103
11183
  {
11104
11184
  open: modalOpen,
@@ -11111,15 +11191,15 @@ var InputSelect = forwardRef8(function InputSelect2({
11111
11191
  setModalOpen(false);
11112
11192
  },
11113
11193
  children: [
11114
- /* @__PURE__ */ jsxs27("div", { className: "sia-selection-panel__actions", role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
11115
- /* @__PURE__ */ jsx32(Button, { role: "tab", "aria-selected": !selectedOnly, variant: !selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
11116
- /* @__PURE__ */ jsxs27(Button, { role: "tab", "aria-selected": selectedOnly, variant: selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(true), children: [
11194
+ /* @__PURE__ */ jsxs32("div", { className: "sia-selection-panel__actions", role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
11195
+ /* @__PURE__ */ jsx38(Button, { role: "tab", "aria-selected": !selectedOnly, variant: !selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
11196
+ /* @__PURE__ */ jsxs32(Button, { role: "tab", "aria-selected": selectedOnly, variant: selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(true), children: [
11117
11197
  "\u5DF2\u9009\u9879(",
11118
11198
  modalValues.length,
11119
11199
  ")"
11120
11200
  ] })
11121
11201
  ] }),
11122
- modalOpen && /* @__PURE__ */ jsx32(
11202
+ modalOpen && /* @__PURE__ */ jsx38(
11123
11203
  SelectionPanel,
11124
11204
  {
11125
11205
  options,
@@ -11140,10 +11220,10 @@ var InputSelect = forwardRef8(function InputSelect2({
11140
11220
  });
11141
11221
 
11142
11222
  // src/components/QueryForm.tsx
11143
- import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect9, useRef as useRef29, useState as useState28 } from "react";
11223
+ import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect9, useRef as useRef32, useState as useState31 } from "react";
11144
11224
 
11145
11225
  // src/components/useQueryFormMotion.ts
11146
- import { useLayoutEffect as useLayoutEffect8, useRef as useRef26 } from "react";
11226
+ import { useLayoutEffect as useLayoutEffect8, useRef as useRef29 } from "react";
11147
11227
  function readLayout(row) {
11148
11228
  const root = row.getBoundingClientRect();
11149
11229
  const scaleX = root.width / row.offsetWidth || 1, scaleY = root.height / row.offsetHeight || 1;
@@ -11156,9 +11236,9 @@ function readLayout(row) {
11156
11236
  return { height: row.offsetHeight, boxes };
11157
11237
  }
11158
11238
  function useQueryFormMotion(ref, layoutKey) {
11159
- const previous = useRef26();
11160
- const stop = useRef26();
11161
- const snapshot = useRef26();
11239
+ const previous = useRef29();
11240
+ const stop = useRef29();
11241
+ const snapshot = useRef29();
11162
11242
  useLayoutEffect8(() => {
11163
11243
  const row = ref.current;
11164
11244
  if (!row) return;
@@ -11267,10 +11347,10 @@ function useQueryFormMotion(ref, layoutKey) {
11267
11347
  }
11268
11348
 
11269
11349
  // src/components/QueryFormSettings.tsx
11270
- import { useEffect as useEffect20, useRef as useRef28, useState as useState27 } from "react";
11350
+ import { useEffect as useEffect22, useRef as useRef31, useState as useState30 } from "react";
11271
11351
 
11272
11352
  // src/components/useQueryFieldSort.ts
11273
- import { useEffect as useEffect19, useRef as useRef27, useState as useState26 } from "react";
11353
+ import { useEffect as useEffect21, useRef as useRef30, useState as useState29 } from "react";
11274
11354
  function getQuerySortPreview(keys, rects, from, dy, gap) {
11275
11355
  const center = rects[from].top + rects[from].height / 2 + dy;
11276
11356
  const rest = keys.map((_, index) => index).filter((index) => index !== from);
@@ -11289,13 +11369,13 @@ function getQuerySortPreview(keys, rects, from, dy, gap) {
11289
11369
  return { ordered, offsets };
11290
11370
  }
11291
11371
  function useQueryFieldSort(keys, enabled, onCommit) {
11292
- const listRef = useRef27(null);
11293
- const cancelRef = useRef27();
11294
- const commitRef = useRef27(onCommit);
11372
+ const listRef = useRef30(null);
11373
+ const cancelRef = useRef30();
11374
+ const commitRef = useRef30(onCommit);
11295
11375
  commitRef.current = onCommit;
11296
- const [preview, setPreview] = useState26();
11376
+ const [preview, setPreview] = useState29();
11297
11377
  const signature = JSON.stringify(keys);
11298
- useEffect19(() => {
11378
+ useEffect21(() => {
11299
11379
  cancelRef.current?.();
11300
11380
  return () => cancelRef.current?.();
11301
11381
  }, [enabled, signature]);
@@ -11418,18 +11498,18 @@ function countQueryFieldRows(centers) {
11418
11498
  }
11419
11499
 
11420
11500
  // src/components/QueryFormSettings.tsx
11421
- import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
11501
+ import { Fragment as Fragment14, jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
11422
11502
  function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed, disabled) {
11423
- const [snapshot, setSnapshot] = useState27();
11424
- const [draft, setDraft] = useState27({ fields: [], defaultCollapsed: defaultCollapsed ?? false });
11425
- const [open, setOpen] = useState27(false);
11426
- const [loading, setLoading] = useState27(false);
11427
- const [saving, setSaving] = useState27(false);
11428
- const [error, setError] = useState27("");
11429
- const [loadFailed, setLoadFailed] = useState27(false);
11430
- const token = useRef28(0);
11431
- const saveLock = useRef28(false);
11432
- const latest = useRef28({ config, fields, defaultCollapsed, applyCollapsed });
11503
+ const [snapshot, setSnapshot] = useState30();
11504
+ const [draft, setDraft] = useState30({ fields: [], defaultCollapsed: defaultCollapsed ?? false });
11505
+ const [open, setOpen] = useState30(false);
11506
+ const [loading, setLoading] = useState30(false);
11507
+ const [saving, setSaving] = useState30(false);
11508
+ const [error, setError] = useState30("");
11509
+ const [loadFailed, setLoadFailed] = useState30(false);
11510
+ const token = useRef31(0);
11511
+ const saveLock = useRef31(false);
11512
+ const latest = useRef31({ config, fields, defaultCollapsed, applyCollapsed });
11433
11513
  latest.current = { config, fields, defaultCollapsed, applyCollapsed };
11434
11514
  const moduleName = config?.scope.moduleName;
11435
11515
  const businessKey = config?.scope.businessKey;
@@ -11462,7 +11542,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11462
11542
  if (request === token.current) setLoading(false);
11463
11543
  }
11464
11544
  }
11465
- useEffect20(() => {
11545
+ useEffect22(() => {
11466
11546
  setSnapshot(void 0);
11467
11547
  setOpen(false);
11468
11548
  setError("");
@@ -11518,7 +11598,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11518
11598
  const items = new Map(visibleDraft.map((item) => [item.key, item]));
11519
11599
  setDraft((current) => ({ ...current, fields: keys.map((key, order) => ({ ...items.get(key), order })) }));
11520
11600
  });
11521
- const control = /* @__PURE__ */ jsx33(
11601
+ const control = /* @__PURE__ */ jsx39(
11522
11602
  Button,
11523
11603
  {
11524
11604
  type: "button",
@@ -11527,14 +11607,14 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11527
11607
  "aria-label": "\u67E5\u8BE2\u8BBE\u7F6E",
11528
11608
  disabled: disabled || saving,
11529
11609
  loading: loading && !open,
11530
- icon: /* @__PURE__ */ jsx33(Icon, { name: "more-vertical" }),
11610
+ icon: /* @__PURE__ */ jsx39(Icon, { name: "more-vertical" }),
11531
11611
  onClick: () => {
11532
11612
  setOpen(true);
11533
11613
  void load(true);
11534
11614
  }
11535
11615
  }
11536
11616
  );
11537
- const panel = /* @__PURE__ */ jsx33(Fragment11, { children: /* @__PURE__ */ jsx33(
11617
+ const panel = /* @__PURE__ */ jsx39(Fragment14, { children: /* @__PURE__ */ jsx39(
11538
11618
  Modal,
11539
11619
  {
11540
11620
  title: "\u67E5\u8BE2\u8BBE\u7F6E",
@@ -11547,15 +11627,15 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11547
11627
  onOpenChange: (next) => {
11548
11628
  if (!saveLock.current) setOpen(next);
11549
11629
  },
11550
- children: /* @__PURE__ */ jsxs28("div", { className: "sia-query-settings", children: [
11551
- loading ? /* @__PURE__ */ jsx33("p", { role: "status", children: "\u6B63\u5728\u8BFB\u53D6\u67E5\u8BE2\u8BBE\u7F6E\u2026" }) : null,
11552
- error ? /* @__PURE__ */ jsxs28("div", { role: "alert", className: "sia-query-form__error", children: [
11630
+ children: /* @__PURE__ */ jsxs33("div", { className: "sia-query-settings", children: [
11631
+ loading ? /* @__PURE__ */ jsx39("p", { role: "status", children: "\u6B63\u5728\u8BFB\u53D6\u67E5\u8BE2\u8BBE\u7F6E\u2026" }) : null,
11632
+ error ? /* @__PURE__ */ jsxs33("div", { role: "alert", className: "sia-query-form__error", children: [
11553
11633
  error,
11554
- loadFailed ? /* @__PURE__ */ jsx33(Button, { type: "button", variant: "link", onClick: () => void load(true), children: "\u91CD\u8BD5" }) : null
11634
+ loadFailed ? /* @__PURE__ */ jsx39(Button, { type: "button", variant: "link", onClick: () => void load(true), children: "\u91CD\u8BD5" }) : null
11555
11635
  ] }) : null,
11556
- /* @__PURE__ */ jsx33(Checkbox, { checked: draft.defaultCollapsed, disabled: locked, onChange: (checked) => setDraft((current) => ({ ...current, defaultCollapsed: checked })), children: "\u9ED8\u8BA4\u6536\u8D77\u67E5\u8BE2\u6761\u4EF6" }),
11557
- /* @__PURE__ */ jsx33("p", { className: "sia-query-settings__hint", children: "\u52FE\u9009\u9700\u8981\u663E\u793A\u7684\u6761\u4EF6\uFF0C\u62D6\u52A8\u6216\u4F7F\u7528\u4E0A\u4E0B\u6309\u94AE\u8C03\u6574\u987A\u5E8F\u3002" }),
11558
- /* @__PURE__ */ jsx33("div", { ref: sort.listRef, className: `sia-query-settings__list${sort.preview ? " is-sorting" : ""}`, children: visibleDraft.map((item, index) => /* @__PURE__ */ jsxs28(
11636
+ /* @__PURE__ */ jsx39(Checkbox, { checked: draft.defaultCollapsed, disabled: locked, onChange: (checked) => setDraft((current) => ({ ...current, defaultCollapsed: checked })), children: "\u9ED8\u8BA4\u6536\u8D77\u67E5\u8BE2\u6761\u4EF6" }),
11637
+ /* @__PURE__ */ jsx39("p", { className: "sia-query-settings__hint", children: "\u52FE\u9009\u9700\u8981\u663E\u793A\u7684\u6761\u4EF6\uFF0C\u62D6\u52A8\u6216\u4F7F\u7528\u4E0A\u4E0B\u6309\u94AE\u8C03\u6574\u987A\u5E8F\u3002" }),
11638
+ /* @__PURE__ */ jsx39("div", { ref: sort.listRef, className: `sia-query-settings__list${sort.preview ? " is-sorting" : ""}`, children: visibleDraft.map((item, index) => /* @__PURE__ */ jsxs33(
11559
11639
  "div",
11560
11640
  {
11561
11641
  "data-query-field-key": item.key,
@@ -11563,18 +11643,18 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11563
11643
  style: sort.preview ? { transform: `translateY(${sort.preview.offsets[item.key] ?? 0}px)` } : void 0,
11564
11644
  onPointerDown: (event) => sort.start(event, item.key),
11565
11645
  children: [
11566
- /* @__PURE__ */ jsx33(Icon, { name: "menu", size: 15 }),
11567
- /* @__PURE__ */ jsx33(Checkbox, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked || hideDisabledKeys.has(item.key), onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
11568
- /* @__PURE__ */ jsx33("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
11569
- /* @__PURE__ */ jsxs28("div", { className: "sia-query-settings__order", children: [
11570
- /* @__PURE__ */ jsx33(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0A\u79FB ${item.key}`, disabled: locked || index === 0, icon: /* @__PURE__ */ jsx33(Icon, { name: "chevron-up" }), onClick: () => move(index, index - 1) }),
11571
- /* @__PURE__ */ jsx33(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0B\u79FB ${item.key}`, disabled: locked || index === visibleDraft.length - 1, icon: /* @__PURE__ */ jsx33(Icon, { name: "chevron-down" }), onClick: () => move(index, index + 1) })
11646
+ /* @__PURE__ */ jsx39(Icon, { name: "menu", size: 15 }),
11647
+ /* @__PURE__ */ jsx39(Checkbox, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked || hideDisabledKeys.has(item.key), onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
11648
+ /* @__PURE__ */ jsx39("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
11649
+ /* @__PURE__ */ jsxs33("div", { className: "sia-query-settings__order", children: [
11650
+ /* @__PURE__ */ jsx39(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0A\u79FB ${item.key}`, disabled: locked || index === 0, icon: /* @__PURE__ */ jsx39(Icon, { name: "chevron-up" }), onClick: () => move(index, index - 1) }),
11651
+ /* @__PURE__ */ jsx39(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0B\u79FB ${item.key}`, disabled: locked || index === visibleDraft.length - 1, icon: /* @__PURE__ */ jsx39(Icon, { name: "chevron-down" }), onClick: () => move(index, index + 1) })
11572
11652
  ] })
11573
11653
  ]
11574
11654
  },
11575
11655
  item.key
11576
11656
  )) }),
11577
- /* @__PURE__ */ jsx33(Button, { type: "button", disabled: locked, onClick: () => setDraft({ fields: reconcileQueryFields(fields.map((field) => field.key)), defaultCollapsed: defaultCollapsed ?? false }), children: "\u6062\u590D\u9ED8\u8BA4" })
11657
+ /* @__PURE__ */ jsx39(Button, { type: "button", disabled: locked, onClick: () => setDraft({ fields: reconcileQueryFields(fields.map((field) => field.key)), defaultCollapsed: defaultCollapsed ?? false }), children: "\u6062\u590D\u9ED8\u8BA4" })
11578
11658
  ] })
11579
11659
  }
11580
11660
  ) });
@@ -11582,7 +11662,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
11582
11662
  }
11583
11663
 
11584
11664
  // src/components/QueryForm.tsx
11585
- import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
11665
+ import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
11586
11666
  function QueryForm({
11587
11667
  fields,
11588
11668
  settings,
@@ -11617,22 +11697,22 @@ function QueryForm({
11617
11697
  ...formProps
11618
11698
  }) {
11619
11699
  const [form] = useForm(providedForm);
11620
- const [internalCollapsed, setInternalCollapsed] = useState28(defaultCollapsed);
11621
- const [expandedRows, setExpandedRows] = useState28(0);
11622
- const [needsCollapse, setNeedsCollapse] = useState28(false);
11700
+ const [internalCollapsed, setInternalCollapsed] = useState31(defaultCollapsed);
11701
+ const [expandedRows, setExpandedRows] = useState31(0);
11702
+ const [needsCollapse, setNeedsCollapse] = useState31(false);
11623
11703
  const collapsed = collapsible && needsCollapse && (controlledCollapsed ?? internalCollapsed ?? expandedRows >= 3);
11624
- const [searching, setSearching] = useState28(false);
11625
- const [saving, setSaving] = useState28(false);
11626
- const [removing, setRemoving] = useState28(false);
11627
- const [saveOpen, setSaveOpen] = useState28(false);
11628
- const [saveName, setSaveName] = useState28("");
11629
- const [saveError, setSaveError] = useState28("");
11630
- const [activeShortcut, setActiveShortcut] = useState28("");
11631
- const source = useRef29({ source: "submit" });
11632
- const searchLock = useRef29(false);
11633
- const saveLock = useRef29(false);
11634
- const removeLock = useRef29(false);
11635
- const snapshot = useRef29();
11704
+ const [searching, setSearching] = useState31(false);
11705
+ const [saving, setSaving] = useState31(false);
11706
+ const [removing, setRemoving] = useState31(false);
11707
+ const [saveOpen, setSaveOpen] = useState31(false);
11708
+ const [saveName, setSaveName] = useState31("");
11709
+ const [saveError, setSaveError] = useState31("");
11710
+ const [activeShortcut, setActiveShortcut] = useState31("");
11711
+ const source = useRef32({ source: "submit" });
11712
+ const searchLock = useRef32(false);
11713
+ const saveLock = useRef32(false);
11714
+ const removeLock = useRef32(false);
11715
+ const snapshot = useRef32();
11636
11716
  const busy = disabled || loading || searching;
11637
11717
  const shortcutBusy = busy || shortcutsLoading || saving || removing;
11638
11718
  const fieldLabel = (content) => {
@@ -11644,7 +11724,7 @@ function QueryForm({
11644
11724
  width,
11645
11725
  hideDisabled: settingsHideDisabled,
11646
11726
  label: settingsLabel ?? item.label ?? (typeof item.children === "function" ? void 0 : fieldLabel(item.children)) ?? key,
11647
- content: /* @__PURE__ */ jsx34(Form.Item, { noStyle: true, ...item })
11727
+ content: /* @__PURE__ */ jsx40(Form.Item, { noStyle: true, ...item })
11648
11728
  })) : Children4.toArray(children).map((content, index) => ({
11649
11729
  key: isValidElement5(content) && content.key != null ? String(content.key) : String(index),
11650
11730
  width: void 0,
@@ -11659,10 +11739,10 @@ function QueryForm({
11659
11739
  const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
11660
11740
  const layoutKey = JSON.stringify(configured);
11661
11741
  const limit = Math.max(1, Math.floor(collapsedCount));
11662
- const rowRef = useRef29(null);
11663
- const actionsRef = useRef29(null);
11664
- const toggleRef = useRef29(null);
11665
- const [fittingCount, setFittingCount] = useState28(limit);
11742
+ const rowRef = useRef32(null);
11743
+ const actionsRef = useRef32(null);
11744
+ const toggleRef = useRef32(null);
11745
+ const [fittingCount, setFittingCount] = useState31(limit);
11666
11746
  useLayoutEffect9(() => {
11667
11747
  const row = rowRef.current;
11668
11748
  const actions = actionsRef.current;
@@ -11803,8 +11883,8 @@ function QueryForm({
11803
11883
  setRemoving(false);
11804
11884
  }
11805
11885
  }
11806
- return /* @__PURE__ */ jsxs29("div", { className: `sia-query-form ${className}`.trim(), children: [
11807
- /* @__PURE__ */ jsxs29(
11886
+ return /* @__PURE__ */ jsxs34("div", { className: `sia-query-form ${className}`.trim(), children: [
11887
+ /* @__PURE__ */ jsxs34(
11808
11888
  Form,
11809
11889
  {
11810
11890
  ...formProps,
@@ -11823,8 +11903,8 @@ function QueryForm({
11823
11903
  onValuesChange?.(changed, values);
11824
11904
  },
11825
11905
  children: [
11826
- quickQueries.length ? /* @__PURE__ */ jsxs29("div", { className: "sia-query-form__quick", "aria-label": "\u9884\u8BBE\u5FEB\u6377\u67E5\u8BE2", children: [
11827
- quickQueries.map((query) => /* @__PURE__ */ jsx34(
11906
+ quickQueries.length ? /* @__PURE__ */ jsxs34("div", { className: "sia-query-form__quick", "aria-label": "\u9884\u8BBE\u5FEB\u6377\u67E5\u8BE2", children: [
11907
+ quickQueries.map((query) => /* @__PURE__ */ jsx40(
11828
11908
  Badge,
11829
11909
  {
11830
11910
  className: "sia-query-form__quick-badge",
@@ -11833,7 +11913,7 @@ function QueryForm({
11833
11913
  title: query.count === void 0 ? void 0 : `\u5171 ${query.count} \u6761`,
11834
11914
  ...query.badgeProps,
11835
11915
  count: query.count,
11836
- children: /* @__PURE__ */ jsx34(
11916
+ children: /* @__PURE__ */ jsx40(
11837
11917
  Button,
11838
11918
  {
11839
11919
  size: query.size ?? quickQuerySize,
@@ -11849,7 +11929,7 @@ function QueryForm({
11849
11929
  )),
11850
11930
  " "
11851
11931
  ] }) : null,
11852
- /* @__PURE__ */ jsx34("div", { className: "sia-query-form__motion", children: /* @__PURE__ */ jsxs29(
11932
+ /* @__PURE__ */ jsx40("div", { className: "sia-query-form__motion", children: /* @__PURE__ */ jsxs34(
11853
11933
  "div",
11854
11934
  {
11855
11935
  ref: rowRef,
@@ -11858,7 +11938,7 @@ function QueryForm({
11858
11938
  "--sia-query-field-width": typeof fieldWidth === "number" ? `${fieldWidth}px` : fieldWidth
11859
11939
  },
11860
11940
  children: [
11861
- entries.map((entry) => /* @__PURE__ */ jsx34(
11941
+ entries.map((entry) => /* @__PURE__ */ jsx40(
11862
11942
  "div",
11863
11943
  {
11864
11944
  className: "sia-query-form__field",
@@ -11872,9 +11952,9 @@ function QueryForm({
11872
11952
  },
11873
11953
  entry.key
11874
11954
  )),
11875
- /* @__PURE__ */ jsxs29("div", { ref: actionsRef, className: "sia-query-form__actions", children: [
11876
- /* @__PURE__ */ jsxs29(Space.Compact, { children: [
11877
- /* @__PURE__ */ jsx34(
11955
+ /* @__PURE__ */ jsxs34("div", { ref: actionsRef, className: "sia-query-form__actions", children: [
11956
+ /* @__PURE__ */ jsxs34(Space.Compact, { children: [
11957
+ /* @__PURE__ */ jsx40(
11878
11958
  Button,
11879
11959
  {
11880
11960
  type: "submit",
@@ -11884,8 +11964,8 @@ function QueryForm({
11884
11964
  children: searchText
11885
11965
  }
11886
11966
  ),
11887
- /* @__PURE__ */ jsx34(Button, { disabled: busy, onClick: reset, children: resetText }),
11888
- onSaveQuery ? /* @__PURE__ */ jsx34(
11967
+ /* @__PURE__ */ jsx40(Button, { disabled: busy, onClick: reset, children: resetText }),
11968
+ onSaveQuery ? /* @__PURE__ */ jsx40(
11889
11969
  Button,
11890
11970
  {
11891
11971
  disabled: shortcutBusy,
@@ -11900,12 +11980,12 @@ function QueryForm({
11900
11980
  ) : null,
11901
11981
  showSettings ? cloudSettings.control : null
11902
11982
  ] }),
11903
- collapsible && entries.length > 0 ? /* @__PURE__ */ jsx34("span", { ref: toggleRef, hidden: !needsCollapse, children: /* @__PURE__ */ jsx34(
11983
+ collapsible && entries.length > 0 ? /* @__PURE__ */ jsx40("span", { ref: toggleRef, hidden: !needsCollapse, children: /* @__PURE__ */ jsx40(
11904
11984
  Button,
11905
11985
  {
11906
11986
  variant: "link",
11907
11987
  "aria-expanded": !collapsed,
11908
- icon: /* @__PURE__ */ jsx34(Icon, { name: collapsed ? "chevron-down" : "chevron-up" }),
11988
+ icon: /* @__PURE__ */ jsx40(Icon, { name: collapsed ? "chevron-down" : "chevron-up" }),
11909
11989
  iconPosition: "end",
11910
11990
  onClick: () => {
11911
11991
  setInternalCollapsed(!collapsed);
@@ -11920,8 +12000,8 @@ function QueryForm({
11920
12000
  ]
11921
12001
  }
11922
12002
  ) }),
11923
- savedQueries.length ? /* @__PURE__ */ jsxs29("div", { className: "sia-query-form__saved", "aria-label": "\u5DF2\u4FDD\u5B58\u5FEB\u6377\u67E5\u8BE2", children: [
11924
- savedQueries.map((query, index) => /* @__PURE__ */ jsx34(
12003
+ savedQueries.length ? /* @__PURE__ */ jsxs34("div", { className: "sia-query-form__saved", "aria-label": "\u5DF2\u4FDD\u5B58\u5FEB\u6377\u67E5\u8BE2", children: [
12004
+ savedQueries.map((query, index) => /* @__PURE__ */ jsx40(
11925
12005
  Tag,
11926
12006
  {
11927
12007
  status: query.status ?? ["processing", "success", "warning", "error"][index % 4],
@@ -11950,7 +12030,7 @@ function QueryForm({
11950
12030
  ]
11951
12031
  }
11952
12032
  ),
11953
- /* @__PURE__ */ jsxs29(
12033
+ /* @__PURE__ */ jsxs34(
11954
12034
  Modal,
11955
12035
  {
11956
12036
  open: saveOpen,
@@ -11962,7 +12042,7 @@ function QueryForm({
11962
12042
  if (!saveLock.current) setSaveOpen(next);
11963
12043
  },
11964
12044
  children: [
11965
- /* @__PURE__ */ jsx34(
12045
+ /* @__PURE__ */ jsx40(
11966
12046
  Input,
11967
12047
  {
11968
12048
  autoFocus: true,
@@ -11981,7 +12061,7 @@ function QueryForm({
11981
12061
  }
11982
12062
  }
11983
12063
  ),
11984
- saveError ? /* @__PURE__ */ jsx34("p", { className: "sia-query-form__error", role: "alert", children: saveError }) : null
12064
+ saveError ? /* @__PURE__ */ jsx40("p", { className: "sia-query-form__error", role: "alert", children: saveError }) : null
11985
12065
  ]
11986
12066
  }
11987
12067
  )
@@ -11989,9 +12069,9 @@ function QueryForm({
11989
12069
  }
11990
12070
 
11991
12071
  // src/components/NumberRange.tsx
11992
- import { forwardRef as forwardRef9 } from "react";
11993
- import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
11994
- var NumberRange = forwardRef9(function NumberRange2({
12072
+ import { forwardRef as forwardRef16 } from "react";
12073
+ import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
12074
+ var NumberRange = forwardRef16(function NumberRange2({
11995
12075
  value,
11996
12076
  defaultValue = [null, null],
11997
12077
  onChange,
@@ -12019,7 +12099,7 @@ var NumberRange = forwardRef9(function NumberRange2({
12019
12099
  setValue2(index === 0 ? [next, range[1]] : [range[0], next]);
12020
12100
  }
12021
12101
  const inputProps = { min, max, step, precision, size, status, disabled, readOnly, placeholderMode, controls: false };
12022
- return /* @__PURE__ */ jsxs30(
12102
+ return /* @__PURE__ */ jsxs35(
12023
12103
  "span",
12024
12104
  {
12025
12105
  ...props,
@@ -12028,7 +12108,7 @@ var NumberRange = forwardRef9(function NumberRange2({
12028
12108
  "aria-disabled": disabled || void 0,
12029
12109
  className: `sia-number-range sia-number-range--${size} sia-number-range--${status}${disabled ? " is-disabled" : ""} ${className}`.trim(),
12030
12110
  children: [
12031
- /* @__PURE__ */ jsx35(
12111
+ /* @__PURE__ */ jsx41(
12032
12112
  InputNumber,
12033
12113
  {
12034
12114
  ...inputProps,
@@ -12040,8 +12120,8 @@ var NumberRange = forwardRef9(function NumberRange2({
12040
12120
  onChange: (next) => change(0, next)
12041
12121
  }
12042
12122
  ),
12043
- /* @__PURE__ */ jsx35(Icon, { className: "sia-number-range__separator", name: "tilde", size: 12, strokeWidth: 1.5, "aria-hidden": "true" }),
12044
- /* @__PURE__ */ jsx35(
12123
+ /* @__PURE__ */ jsx41(Icon, { className: "sia-number-range__separator", name: "tilde", size: 12, strokeWidth: 1.5, "aria-hidden": "true" }),
12124
+ /* @__PURE__ */ jsx41(
12045
12125
  InputNumber,
12046
12126
  {
12047
12127
  ...inputProps,
@@ -12053,15 +12133,15 @@ var NumberRange = forwardRef9(function NumberRange2({
12053
12133
  onChange: (next) => change(1, next)
12054
12134
  }
12055
12135
  ),
12056
- allowClear && !disabled && !readOnly && range.some((item) => item !== null) ? /* @__PURE__ */ jsx35("button", { type: "button", className: "sia-number-range__clear", "aria-label": "\u6E05\u9664\u6570\u5B57\u533A\u95F4", onClick: () => setValue2([null, null]), children: /* @__PURE__ */ jsx35(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null
12136
+ allowClear && !disabled && !readOnly && range.some((item) => item !== null) ? /* @__PURE__ */ jsx41("button", { type: "button", className: "sia-number-range__clear", "aria-label": "\u6E05\u9664\u6570\u5B57\u533A\u95F4", onClick: () => setValue2([null, null]), children: /* @__PURE__ */ jsx41(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null
12057
12137
  ]
12058
12138
  }
12059
12139
  );
12060
12140
  });
12061
12141
 
12062
12142
  // src/components/VirtualGrid.tsx
12063
- import { useEffect as useEffect21, useLayoutEffect as useLayoutEffect10, useRef as useRef30, useState as useState29 } from "react";
12064
- import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
12143
+ import { useEffect as useEffect23, useLayoutEffect as useLayoutEffect10, useRef as useRef33, useState as useState32 } from "react";
12144
+ import { jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
12065
12145
  function VirtualGrid({
12066
12146
  items,
12067
12147
  itemKey,
@@ -12080,11 +12160,11 @@ function VirtualGrid({
12080
12160
  tabIndex = 0,
12081
12161
  ...props
12082
12162
  }) {
12083
- const viewport = useRef30(null);
12084
- const [size, setSize] = useState29({ width: 0, height: 0 });
12085
- const [scrollTop, setScrollTop] = useState29(0);
12086
- const frame = useRef30();
12087
- const requestedLength = useRef30();
12163
+ const viewport = useRef33(null);
12164
+ const [size, setSize] = useState32({ width: 0, height: 0 });
12165
+ const [scrollTop, setScrollTop] = useState32(0);
12166
+ const frame = useRef33();
12167
+ const requestedLength = useRef33();
12088
12168
  const height = Math.max(1, rowHeight);
12089
12169
  const spacing = Math.max(0, gap);
12090
12170
  const columns = Math.max(1, Math.floor((size.width + spacing) / (Math.max(1, minColumnWidth) + spacing)));
@@ -12113,14 +12193,14 @@ function VirtualGrid({
12113
12193
  if (el.scrollTop !== next) el.scrollTop = next;
12114
12194
  setScrollTop(next);
12115
12195
  }, [totalHeight, size.height]);
12116
- useEffect21(() => {
12196
+ useEffect23(() => {
12117
12197
  if (!onLoadMore || !hasMore || loading || size.height <= 0) return;
12118
12198
  if (totalHeight - scrollTop - size.height > Math.max(0, loadMoreThreshold)) return;
12119
12199
  if (requestedLength.current === items.length) return;
12120
12200
  requestedLength.current = items.length;
12121
12201
  onLoadMore();
12122
12202
  }, [items.length, hasMore, loading, size.height, scrollTop, totalHeight, loadMoreThreshold, onLoadMore]);
12123
- return /* @__PURE__ */ jsxs31(
12203
+ return /* @__PURE__ */ jsxs36(
12124
12204
  "div",
12125
12205
  {
12126
12206
  ...props,
@@ -12138,16 +12218,16 @@ function VirtualGrid({
12138
12218
  });
12139
12219
  },
12140
12220
  children: [
12141
- /* @__PURE__ */ jsx36("div", { className: "sia-virtual-grid__spacer", style: { height: totalHeight }, children: Array.from({ length: Math.max(0, endRow - startRow) }, (_, offset) => {
12221
+ /* @__PURE__ */ jsx42("div", { className: "sia-virtual-grid__spacer", style: { height: totalHeight }, children: Array.from({ length: Math.max(0, endRow - startRow) }, (_, offset) => {
12142
12222
  const row = startRow + offset;
12143
- return /* @__PURE__ */ jsx36("div", { className: "sia-virtual-grid__row", role: "presentation", style: {
12223
+ return /* @__PURE__ */ jsx42("div", { className: "sia-virtual-grid__row", role: "presentation", style: {
12144
12224
  top: row * stride,
12145
12225
  height,
12146
12226
  columnGap: spacing,
12147
12227
  gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`
12148
12228
  }, children: items.slice(row * columns, (row + 1) * columns).map((item, column) => {
12149
12229
  const index = row * columns + column;
12150
- return /* @__PURE__ */ jsx36("div", { className: "sia-virtual-grid__item", role: "listitem", "aria-posinset": index + 1, "aria-setsize": hasMore ? -1 : items.length, children: renderItem(item, index) }, itemKey(item, index));
12230
+ return /* @__PURE__ */ jsx42("div", { className: "sia-virtual-grid__item", role: "listitem", "aria-posinset": index + 1, "aria-setsize": hasMore ? -1 : items.length, children: renderItem(item, index) }, itemKey(item, index));
12151
12231
  }) }, row);
12152
12232
  }) }),
12153
12233
  !items.length && !loading ? empty : null
@@ -12266,7 +12346,7 @@ export {
12266
12346
  TextArea,
12267
12347
  ThemeRiverChart,
12268
12348
  ThemeSwitch,
12269
- TimePicker,
12349
+ TimePicker2 as TimePicker,
12270
12350
  Timeline,
12271
12351
  ToolPanel,
12272
12352
  Toolbar,