@sia.soul/sia-react-ui 0.1.123 → 0.1.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6877,6 +6877,12 @@ function WindowFrame({
6877
6877
  }
6878
6878
  );
6879
6879
  }
6880
+ function renderWindowControlGlyph(action, maximized) {
6881
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1", "aria-hidden": "true", focusable: "false", children: action === "minimize" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M1 6.5h10" }) : action === "close" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "m1.5 1.5 9 9m0-9-9 9" }) : maximized ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
6882
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M3.5 3.5v-2h7v7h-2" }),
6883
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("rect", { x: "1.5", y: "3.5", width: "7", height: "7" })
6884
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("rect", { x: "1.5", y: "1.5", width: "9", height: "9" }) });
6885
+ }
6880
6886
  function WindowControls({
6881
6887
  maximized = false,
6882
6888
  showMinimize = true,
@@ -6910,7 +6916,7 @@ function WindowControls({
6910
6916
  ...withTitleTooltip({ title: mergedLabels.minimize }),
6911
6917
  disabled: isDisabled("minimize"),
6912
6918
  onClick: () => runAction("minimize"),
6913
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { name: "minus", size: 14 })
6919
+ children: renderWindowControlGlyph("minimize", maximized)
6914
6920
  }
6915
6921
  ) : null,
6916
6922
  showMaximize ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
@@ -6922,7 +6928,7 @@ function WindowControls({
6922
6928
  ...withTitleTooltip({ title: maximized ? mergedLabels.restore : mergedLabels.maximize }),
6923
6929
  disabled: isDisabled("toggle-maximize"),
6924
6930
  onClick: () => runAction("toggle-maximize"),
6925
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { name: maximized ? "fullscreen-exit" : "fullscreen", size: 13 })
6931
+ children: renderWindowControlGlyph("toggle-maximize", maximized)
6926
6932
  }
6927
6933
  ) : null,
6928
6934
  showClose ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
@@ -6934,7 +6940,7 @@ function WindowControls({
6934
6940
  ...withTitleTooltip({ title: mergedLabels.close }),
6935
6941
  disabled: isDisabled("close"),
6936
6942
  onClick: () => runAction("close"),
6937
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { name: "close", size: 14 })
6943
+ children: renderWindowControlGlyph("close", maximized)
6938
6944
  }
6939
6945
  ) : null
6940
6946
  ]
@@ -7453,9 +7459,18 @@ var FormStore = class {
7453
7459
  return values;
7454
7460
  };
7455
7461
  submit = () => {
7456
- void this.validateFields().then(this.callbacks.onFinish).catch((info) => {
7457
- this.callbacks.onFinishFailed?.(info);
7458
- if (info.errorFields[0]) this.scrollToField(info.errorFields[0].name);
7462
+ void this.validateFields().then(
7463
+ async (values) => {
7464
+ try {
7465
+ await this.callbacks.onFinish?.(values);
7466
+ } catch {
7467
+ }
7468
+ },
7469
+ (info) => {
7470
+ this.callbacks.onFinishFailed?.(info);
7471
+ if (info.errorFields[0]) this.scrollToField(info.errorFields[0].name);
7472
+ }
7473
+ ).catch(() => {
7459
7474
  });
7460
7475
  };
7461
7476
  scrollToField = (name) => {
package/dist/index.d.cts CHANGED
@@ -589,7 +589,8 @@ interface WindowFrameProps extends HTMLAttributes<HTMLDivElement> {
589
589
  /** 窗口控制按钮的属性配置。 */
590
590
  interface WindowControlsProps extends HTMLAttributes<HTMLDivElement> {
591
591
  /**
592
- * 当前窗口是否已最大化。
592
+ * 当前窗口是否已最大化;true 显示叠放方框的还原图标,false 显示单方框的最大化图标。
593
+ * 由宿主在窗口状态改变后更新,点击按钮只通过 onAction 请求切换。
593
594
  * @defaultValue false
594
595
  */
595
596
  maximized?: boolean;
@@ -635,7 +636,8 @@ interface WindowTitleBarProps extends HTMLAttributes<HTMLElement> {
635
636
  */
636
637
  controls?: boolean | ReactNode;
637
638
  /**
638
- * 当前窗口是否已最大化。
639
+ * 当前窗口是否已最大化;默认控制组在 true 时显示叠放方框的还原图标,否则显示单方框。
640
+ * 由宿主在窗口状态改变后更新,点击按钮通过 onWindowAction 请求切换。
639
641
  * @defaultValue false
640
642
  */
641
643
  maximized?: boolean;
@@ -653,7 +655,7 @@ interface WindowTitleBarProps extends HTMLAttributes<HTMLElement> {
653
655
  }
654
656
  /** 窗口框架组件。 */
655
657
  declare function WindowFrame({ titleBar, textSelectable, className, children, ...props }: WindowFrameProps): react.JSX.Element;
656
- /** 窗口控制按钮组件。 */
658
+ /** 窗口控制按钮组件,采用横线、单方框/叠放方框及叉号表示最小化、最大化/还原和关闭;实际窗口操作由 onAction 交给宿主执行。 */
657
659
  declare function WindowControls({ maximized, showMinimize, showMaximize, showClose, disabledActions, labels, onAction, className, ...props }: WindowControlsProps): react.JSX.Element;
658
660
  /** 窗口标题栏组件。 */
659
661
  declare function WindowTitleBar({ leading, actions, actionsAlign, controls, maximized, draggable, disabledActions, controlLabels, onWindowAction, className, children, onMouseDown, ...props }: WindowTitleBarProps): react.JSX.Element;
@@ -819,7 +821,7 @@ interface FormInstance {
819
821
  resetFields: (names?: readonly NamePath[]) => void;
820
822
  /** 执行字段校验;成功返回字段值,失败抛出校验错误信息。 */
821
823
  validateFields: (names?: readonly NamePath[]) => Promise<FormValues>;
822
- /** 提交表单并执行校验;校验通过触发 onFinish,失败触发 onFinishFailed。 */
824
+ /** 提交表单并执行校验;校验通过触发并等待 onFinish,字段校验失败触发 onFinishFailed。提交回调异常由业务处理,不转成字段校验错误或清空表单。 */
823
825
  submit: () => void;
824
826
  /** 将指定字段滚动到可见区域。 */
825
827
  scrollToField: (name: NamePath) => void;
@@ -853,9 +855,9 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
853
855
  * @defaultValue true
854
856
  */
855
857
  requiredMark?: boolean | "optional";
856
- /** 当前表单提交并且校验通过时调用,参数为完整的表单字段值;提交事件不会冒泡触发祖先表单,包含 Portal 内的子表单。 */
857
- onFinish?: (values: FormValues) => void;
858
- /** 表单提交校验失败时调用,参数包含字段值和错误列表。 */
858
+ /** 当前表单提交且校验通过时调用,参数为完整字段值,可返回 Promise;异常由业务回调处理,框架保留字段值且不会调用 onFinishFailed。提交事件不会冒泡触发祖先表单,包含 Portal 内的子表单。 */
859
+ onFinish?: (values: FormValues) => void | Promise<unknown>;
860
+ /** 仅字段校验失败时调用,参数包含字段值和错误列表;onFinish 的同步异常或 Promise 拒绝不会触发此回调。 */
859
861
  onFinishFailed?: (info: {
860
862
  /** 字段值或选中值的集合。 */
861
863
  values: FormValues;
package/dist/index.d.ts CHANGED
@@ -589,7 +589,8 @@ interface WindowFrameProps extends HTMLAttributes<HTMLDivElement> {
589
589
  /** 窗口控制按钮的属性配置。 */
590
590
  interface WindowControlsProps extends HTMLAttributes<HTMLDivElement> {
591
591
  /**
592
- * 当前窗口是否已最大化。
592
+ * 当前窗口是否已最大化;true 显示叠放方框的还原图标,false 显示单方框的最大化图标。
593
+ * 由宿主在窗口状态改变后更新,点击按钮只通过 onAction 请求切换。
593
594
  * @defaultValue false
594
595
  */
595
596
  maximized?: boolean;
@@ -635,7 +636,8 @@ interface WindowTitleBarProps extends HTMLAttributes<HTMLElement> {
635
636
  */
636
637
  controls?: boolean | ReactNode;
637
638
  /**
638
- * 当前窗口是否已最大化。
639
+ * 当前窗口是否已最大化;默认控制组在 true 时显示叠放方框的还原图标,否则显示单方框。
640
+ * 由宿主在窗口状态改变后更新,点击按钮通过 onWindowAction 请求切换。
639
641
  * @defaultValue false
640
642
  */
641
643
  maximized?: boolean;
@@ -653,7 +655,7 @@ interface WindowTitleBarProps extends HTMLAttributes<HTMLElement> {
653
655
  }
654
656
  /** 窗口框架组件。 */
655
657
  declare function WindowFrame({ titleBar, textSelectable, className, children, ...props }: WindowFrameProps): react.JSX.Element;
656
- /** 窗口控制按钮组件。 */
658
+ /** 窗口控制按钮组件,采用横线、单方框/叠放方框及叉号表示最小化、最大化/还原和关闭;实际窗口操作由 onAction 交给宿主执行。 */
657
659
  declare function WindowControls({ maximized, showMinimize, showMaximize, showClose, disabledActions, labels, onAction, className, ...props }: WindowControlsProps): react.JSX.Element;
658
660
  /** 窗口标题栏组件。 */
659
661
  declare function WindowTitleBar({ leading, actions, actionsAlign, controls, maximized, draggable, disabledActions, controlLabels, onWindowAction, className, children, onMouseDown, ...props }: WindowTitleBarProps): react.JSX.Element;
@@ -819,7 +821,7 @@ interface FormInstance {
819
821
  resetFields: (names?: readonly NamePath[]) => void;
820
822
  /** 执行字段校验;成功返回字段值,失败抛出校验错误信息。 */
821
823
  validateFields: (names?: readonly NamePath[]) => Promise<FormValues>;
822
- /** 提交表单并执行校验;校验通过触发 onFinish,失败触发 onFinishFailed。 */
824
+ /** 提交表单并执行校验;校验通过触发并等待 onFinish,字段校验失败触发 onFinishFailed。提交回调异常由业务处理,不转成字段校验错误或清空表单。 */
823
825
  submit: () => void;
824
826
  /** 将指定字段滚动到可见区域。 */
825
827
  scrollToField: (name: NamePath) => void;
@@ -853,9 +855,9 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
853
855
  * @defaultValue true
854
856
  */
855
857
  requiredMark?: boolean | "optional";
856
- /** 当前表单提交并且校验通过时调用,参数为完整的表单字段值;提交事件不会冒泡触发祖先表单,包含 Portal 内的子表单。 */
857
- onFinish?: (values: FormValues) => void;
858
- /** 表单提交校验失败时调用,参数包含字段值和错误列表。 */
858
+ /** 当前表单提交且校验通过时调用,参数为完整字段值,可返回 Promise;异常由业务回调处理,框架保留字段值且不会调用 onFinishFailed。提交事件不会冒泡触发祖先表单,包含 Portal 内的子表单。 */
859
+ onFinish?: (values: FormValues) => void | Promise<unknown>;
860
+ /** 仅字段校验失败时调用,参数包含字段值和错误列表;onFinish 的同步异常或 Promise 拒绝不会触发此回调。 */
859
861
  onFinishFailed?: (info: {
860
862
  /** 字段值或选中值的集合。 */
861
863
  values: FormValues;
package/dist/index.js CHANGED
@@ -1296,7 +1296,7 @@ function ToolPanel({
1296
1296
 
1297
1297
  // src/components/WindowFrame.tsx
1298
1298
  import { useEffect as useEffect4, useRef as useRef6 } from "react";
1299
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1299
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1300
1300
  var DEFAULT_LABELS = {
1301
1301
  minimize: "\u6700\u5C0F\u5316",
1302
1302
  maximize: "\u6700\u5927\u5316",
@@ -1340,6 +1340,12 @@ function WindowFrame({
1340
1340
  }
1341
1341
  );
1342
1342
  }
1343
+ function renderWindowControlGlyph(action, maximized) {
1344
+ return /* @__PURE__ */ jsx9("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1", "aria-hidden": "true", focusable: "false", children: action === "minimize" ? /* @__PURE__ */ jsx9("path", { d: "M1 6.5h10" }) : action === "close" ? /* @__PURE__ */ jsx9("path", { d: "m1.5 1.5 9 9m0-9-9 9" }) : maximized ? /* @__PURE__ */ jsxs9(Fragment3, { children: [
1345
+ /* @__PURE__ */ jsx9("path", { d: "M3.5 3.5v-2h7v7h-2" }),
1346
+ /* @__PURE__ */ jsx9("rect", { x: "1.5", y: "3.5", width: "7", height: "7" })
1347
+ ] }) : /* @__PURE__ */ jsx9("rect", { x: "1.5", y: "1.5", width: "9", height: "9" }) });
1348
+ }
1343
1349
  function WindowControls({
1344
1350
  maximized = false,
1345
1351
  showMinimize = true,
@@ -1373,7 +1379,7 @@ function WindowControls({
1373
1379
  ...withTitleTooltip({ title: mergedLabels.minimize }),
1374
1380
  disabled: isDisabled("minimize"),
1375
1381
  onClick: () => runAction("minimize"),
1376
- children: /* @__PURE__ */ jsx9(Icon, { name: "minus", size: 14 })
1382
+ children: renderWindowControlGlyph("minimize", maximized)
1377
1383
  }
1378
1384
  ) : null,
1379
1385
  showMaximize ? /* @__PURE__ */ jsx9(
@@ -1385,7 +1391,7 @@ function WindowControls({
1385
1391
  ...withTitleTooltip({ title: maximized ? mergedLabels.restore : mergedLabels.maximize }),
1386
1392
  disabled: isDisabled("toggle-maximize"),
1387
1393
  onClick: () => runAction("toggle-maximize"),
1388
- children: /* @__PURE__ */ jsx9(Icon, { name: maximized ? "fullscreen-exit" : "fullscreen", size: 13 })
1394
+ children: renderWindowControlGlyph("toggle-maximize", maximized)
1389
1395
  }
1390
1396
  ) : null,
1391
1397
  showClose ? /* @__PURE__ */ jsx9(
@@ -1397,7 +1403,7 @@ function WindowControls({
1397
1403
  ...withTitleTooltip({ title: mergedLabels.close }),
1398
1404
  disabled: isDisabled("close"),
1399
1405
  onClick: () => runAction("close"),
1400
- children: /* @__PURE__ */ jsx9(Icon, { name: "close", size: 14 })
1406
+ children: renderWindowControlGlyph("close", maximized)
1401
1407
  }
1402
1408
  ) : null
1403
1409
  ]
@@ -1690,7 +1696,7 @@ var Drawer2 = Object.assign(DrawerRoot, {
1690
1696
 
1691
1697
  // src/components/Form.tsx
1692
1698
  import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef2, isValidElement as isValidElement2, useContext as useContext2, useEffect as useEffect6, useId as useId3, useLayoutEffect as useLayoutEffect3, useMemo as useMemo4, useRef as useRef8, useSyncExternalStore } from "react";
1693
- import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1699
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1694
1700
  var Switch = forwardRef2(function Switch2({
1695
1701
  label,
1696
1702
  variant = "standard",
@@ -1719,7 +1725,7 @@ var Switch = forwardRef2(function Switch2({
1719
1725
  "aria-hidden": "true",
1720
1726
  children: [
1721
1727
  /* @__PURE__ */ jsx11("span", { className: "sia-switch__thumb" }),
1722
- variant === "segmented" ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
1728
+ variant === "segmented" ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
1723
1729
  /* @__PURE__ */ jsx11("span", { className: "sia-switch__segment sia-switch__segment--unchecked", children: uncheckedVisual }),
1724
1730
  /* @__PURE__ */ jsx11("span", { className: "sia-switch__segment sia-switch__segment--checked", children: checkedVisual })
1725
1731
  ] }) : hasContent ? /* @__PURE__ */ jsxs11("span", { className: "sia-switch__content", children: [
@@ -1916,9 +1922,18 @@ var FormStore = class {
1916
1922
  return values;
1917
1923
  };
1918
1924
  submit = () => {
1919
- void this.validateFields().then(this.callbacks.onFinish).catch((info) => {
1920
- this.callbacks.onFinishFailed?.(info);
1921
- if (info.errorFields[0]) this.scrollToField(info.errorFields[0].name);
1925
+ void this.validateFields().then(
1926
+ async (values) => {
1927
+ try {
1928
+ await this.callbacks.onFinish?.(values);
1929
+ } catch {
1930
+ }
1931
+ },
1932
+ (info) => {
1933
+ this.callbacks.onFinishFailed?.(info);
1934
+ if (info.errorFields[0]) this.scrollToField(info.errorFields[0].name);
1935
+ }
1936
+ ).catch(() => {
1922
1937
  });
1923
1938
  };
1924
1939
  scrollToField = (name) => {
@@ -2097,7 +2112,7 @@ function FormItem({
2097
2112
  content = children;
2098
2113
  }
2099
2114
  }
2100
- if (noStyle) return /* @__PURE__ */ jsx11(Fragment3, { children: content });
2115
+ if (noStyle) return /* @__PURE__ */ jsx11(Fragment4, { children: content });
2101
2116
  const inputWrap = /* @__PURE__ */ jsx11("div", { className: "sia-form-item__input-wrap", children: content });
2102
2117
  const hasError = status === "error" && Boolean(helpContent);
2103
2118
  return /* @__PURE__ */ jsxs11("div", { ref: itemRef, className: `sia-form-item${align === "center" ? " sia-form-item--align-center" : ""}${status ? ` sia-form-item--${status}` : ""} ${className}`.trim(), "data-sia-form-field": key || void 0, children: [
@@ -2861,7 +2876,7 @@ function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F0
2861
2876
 
2862
2877
  // src/components/TreeSelect.tsx
2863
2878
  import { useEffect as useEffect9, useMemo as useMemo6, useRef as useRef11, useState as useState12 } from "react";
2864
- import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
2879
+ import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
2865
2880
  function flattenTree(nodes, expanded, search, filter, depth = 0, parents = [], ancestorMatched = false) {
2866
2881
  const result = [];
2867
2882
  for (const node of nodes) {
@@ -3086,7 +3101,7 @@ function TreeSelect({
3086
3101
  }
3087
3102
  },
3088
3103
  children: [
3089
- renderTrigger ? renderTrigger({ open, toggle: () => changeOpen(!open), clear }) : /* @__PURE__ */ jsxs16(Fragment4, { children: [
3104
+ renderTrigger ? renderTrigger({ open, toggle: () => changeOpen(!open), clear }) : /* @__PURE__ */ jsxs16(Fragment5, { children: [
3090
3105
  /* @__PURE__ */ jsxs16(
3091
3106
  "button",
3092
3107
  {
@@ -4416,7 +4431,7 @@ function Editor({
4416
4431
  import { useEffect as useEffect11, useMemo as useMemo7, useRef as useRef13, useState as useState14 } from "react";
4417
4432
  import DOMPurify from "dompurify";
4418
4433
  import { marked } from "marked";
4419
- import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
4434
+ import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
4420
4435
  function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", resolveImageSrc, imagePreview = true, className = "", onClick, onKeyDown, ...props }) {
4421
4436
  const rootRef = useRef13(null);
4422
4437
  const [previewImage, setPreviewImage] = useState14(null);
@@ -4484,7 +4499,7 @@ function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", r
4484
4499
  if (!content.trim()) {
4485
4500
  return /* @__PURE__ */ jsx18("div", { className: `sia-markdown sia-markdown--empty ${className}`.trim(), children: emptyText });
4486
4501
  }
4487
- return /* @__PURE__ */ jsxs18(Fragment5, { children: [
4502
+ return /* @__PURE__ */ jsxs18(Fragment6, { children: [
4488
4503
  /* @__PURE__ */ jsx18("article", { ...withTitleTooltip(props), ref: rootRef, className: `sia-markdown ${className}`.trim(), onClick: handleClick, onKeyDown: handleKeyDown, dangerouslySetInnerHTML: { __html: html } }),
4489
4504
  /* @__PURE__ */ jsx18(ImagePreview, { open: Boolean(previewImage), src: previewImage?.src, alt: previewImage?.alt, onOpenChange: (open) => {
4490
4505
  if (!open) setPreviewImage(null);
@@ -4641,7 +4656,7 @@ var InputNumber = forwardRef4(function InputNumber2({
4641
4656
 
4642
4657
  // src/components/SelectModal.tsx
4643
4658
  import { useState as useState16 } from "react";
4644
- import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
4659
+ import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
4645
4660
  function SelectModalBody({ config, values, disabled, onChange }) {
4646
4661
  const [query, setQuery] = useState16("");
4647
4662
  const [selectedOnly, setSelectedOnly] = useState16(false);
@@ -4658,7 +4673,7 @@ function SelectModalBody({ config, values, disabled, onChange }) {
4658
4673
  });
4659
4674
  onChange([...next]);
4660
4675
  };
4661
- return /* @__PURE__ */ jsxs20(Fragment6, { children: [
4676
+ return /* @__PURE__ */ jsxs20(Fragment7, { children: [
4662
4677
  config.headerExtra != null && config.headerExtra !== false ? /* @__PURE__ */ jsx20("div", { className: "sia-select-modal__header-extra", children: config.headerExtra }) : null,
4663
4678
  /* @__PURE__ */ jsxs20("div", { className: "sia-select-modal__heading", children: [
4664
4679
  /* @__PURE__ */ jsxs20("div", { role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
@@ -5630,7 +5645,7 @@ function createRowIdentity() {
5630
5645
  }
5631
5646
 
5632
5647
  // src/components/Table/Table.tsx
5633
- import { Fragment as Fragment8, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect15, useImperativeHandle, useMemo as useMemo9, useRef as useRef19, useState as useState21 } from "react";
5648
+ import { Fragment as Fragment9, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect15, useImperativeHandle, useMemo as useMemo9, useRef as useRef19, useState as useState21 } from "react";
5634
5649
 
5635
5650
  // src/components/Table/plugins.tsx
5636
5651
  import { isValidElement as isValidElement3, useEffect as useEffect14, useRef as useRef18, useState as useState20 } from "react";
@@ -5720,7 +5735,7 @@ function saveSettingsPatch(adapter, scope, patch) {
5720
5735
  }
5721
5736
 
5722
5737
  // src/components/Table/plugins.tsx
5723
- import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
5738
+ import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
5724
5739
  function TableCheckbox({
5725
5740
  checked,
5726
5741
  indeterminate,
@@ -6715,7 +6730,7 @@ function createSortPlugin(options = {}) {
6715
6730
  event.stopPropagation();
6716
6731
  cycle(field, context);
6717
6732
  },
6718
- children: order ? /* @__PURE__ */ jsx24(Icon, { name: order === "ascend" ? "chevron-up" : "chevron-down", size: 18 }) : /* @__PURE__ */ jsxs22(Fragment7, { children: [
6733
+ children: order ? /* @__PURE__ */ jsx24(Icon, { name: order === "ascend" ? "chevron-up" : "chevron-down", size: 18 }) : /* @__PURE__ */ jsxs22(Fragment8, { children: [
6719
6734
  /* @__PURE__ */ jsx24(Icon, { name: "chevron-up", size: 11 }),
6720
6735
  /* @__PURE__ */ jsx24(Icon, { name: "chevron-down", size: 11 })
6721
6736
  ] })
@@ -7113,7 +7128,7 @@ function createTreePlugin(options = {}) {
7113
7128
  className: `sia-table__tree-cell${options.showLine ? " sia-table__tree-cell--lines" : ""}`,
7114
7129
  style: options.showLine ? void 0 : { paddingLeft: info.row.depth * 18 },
7115
7130
  children: [
7116
- options.showLine && info.row.depth > 0 && /* @__PURE__ */ jsxs22(Fragment7, { children: [
7131
+ options.showLine && info.row.depth > 0 && /* @__PURE__ */ jsxs22(Fragment8, { children: [
7117
7132
  info.row.meta.treeGuides.map((continued, level) => /* @__PURE__ */ jsx24("span", { "aria-hidden": "true", className: `sia-table__tree-guide${continued ? " sia-table__tree-guide--continued" : ""}` }, level)),
7118
7133
  /* @__PURE__ */ jsx24("span", { "aria-hidden": "true", className: `sia-table__tree-guide sia-table__tree-guide--branch${info.row.meta.treeHasNextSibling ? " sia-table__tree-guide--continued" : ""}` })
7119
7134
  ] }),
@@ -7683,7 +7698,7 @@ function ColumnSettingPanel({
7683
7698
  onOpenChange: (next) => {
7684
7699
  if (!next) onClose();
7685
7700
  },
7686
- footer: /* @__PURE__ */ jsxs22(Fragment7, { children: [
7701
+ footer: /* @__PURE__ */ jsxs22(Fragment8, { children: [
7687
7702
  /* @__PURE__ */ jsx24(Button, { onClick: onClose, children: "\u53D6\u6D88" }),
7688
7703
  /* @__PURE__ */ jsx24(
7689
7704
  Button,
@@ -8027,7 +8042,7 @@ function ToolbarItems({
8027
8042
  items,
8028
8043
  context
8029
8044
  }) {
8030
- return /* @__PURE__ */ jsx24(Fragment7, { children: items.map((item) => {
8045
+ return /* @__PURE__ */ jsx24(Fragment8, { children: items.map((item) => {
8031
8046
  if (item.hidden === true || typeof item.hidden === "function" && item.hidden(context))
8032
8047
  return null;
8033
8048
  const disabled = item.disabled === true || typeof item.disabled === "function" && item.disabled(context);
@@ -8054,11 +8069,11 @@ function createToolbarPlugin(options) {
8054
8069
  return {
8055
8070
  id: "toolbar",
8056
8071
  order: 5,
8057
- renderToolbarStart: (context) => /* @__PURE__ */ jsxs22(Fragment7, { children: [
8072
+ renderToolbarStart: (context) => /* @__PURE__ */ jsxs22(Fragment8, { children: [
8058
8073
  options.start,
8059
8074
  /* @__PURE__ */ jsx24(ToolbarItems, { items: items("start"), context })
8060
8075
  ] }),
8061
- renderToolbarEnd: (context) => /* @__PURE__ */ jsxs22(Fragment7, { children: [
8076
+ renderToolbarEnd: (context) => /* @__PURE__ */ jsxs22(Fragment8, { children: [
8062
8077
  options.end,
8063
8078
  /* @__PURE__ */ jsx24(ToolbarItems, { items: items("end"), context }),
8064
8079
  items("end", true).length > 0 ? /* @__PURE__ */ jsxs22("details", { className: "sia-table__toolbar-menu", children: [
@@ -8648,20 +8663,20 @@ function TableInner(props, ref) {
8648
8663
  ]);
8649
8664
  const toolbarStart = sortedPlugins.map((plugin) => {
8650
8665
  const content = plugin.renderToolbarStart?.(getContext(plugin));
8651
- return content ? /* @__PURE__ */ jsx25(Fragment8, { children: content }, `toolbar-start-${plugin.id}`) : null;
8666
+ return content ? /* @__PURE__ */ jsx25(Fragment9, { children: content }, `toolbar-start-${plugin.id}`) : null;
8652
8667
  }).filter(Boolean);
8653
8668
  const toolbarEnd = sortedPlugins.map((plugin) => {
8654
8669
  const content = plugin.renderToolbarEnd?.(getContext(plugin));
8655
- return content ? /* @__PURE__ */ jsx25(Fragment8, { children: content }, `toolbar-end-${plugin.id}`) : null;
8670
+ return content ? /* @__PURE__ */ jsx25(Fragment9, { children: content }, `toolbar-end-${plugin.id}`) : null;
8656
8671
  }).filter(Boolean);
8657
8672
  const summaries = sortedPlugins.flatMap((plugin) => plugin.renderSummary?.(getContext(plugin)) ?? []);
8658
8673
  const footers = sortedPlugins.map((plugin) => {
8659
8674
  const content = plugin.renderFooter?.(getContext(plugin));
8660
- return content ? /* @__PURE__ */ jsx25(Fragment8, { children: content }, `footer-${plugin.id}`) : null;
8675
+ return content ? /* @__PURE__ */ jsx25(Fragment9, { children: content }, `footer-${plugin.id}`) : null;
8661
8676
  }).filter(Boolean);
8662
8677
  const overlays = sortedPlugins.map((plugin) => {
8663
8678
  const content = plugin.renderOverlay?.(getContext(plugin));
8664
- return content ? /* @__PURE__ */ jsx25(Fragment8, { children: content }, `overlay-${plugin.id}`) : null;
8679
+ return content ? /* @__PURE__ */ jsx25(Fragment9, { children: content }, `overlay-${plugin.id}`) : null;
8665
8680
  }).filter(Boolean);
8666
8681
  const hasToolbar = toolbarStart.length > 0 || toolbarEnd.length > 0;
8667
8682
  const effectiveHeight = height ?? tableHeight ?? remainingHeight ?? (shouldVirtualize && maxBodyHeight == null ? 420 : void 0);
@@ -9443,7 +9458,7 @@ function countQueryFieldRows(centers) {
9443
9458
  }
9444
9459
 
9445
9460
  // src/components/QueryFormSettings.tsx
9446
- import { Fragment as Fragment9, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
9461
+ import { Fragment as Fragment10, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
9447
9462
  function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed, disabled) {
9448
9463
  const [snapshot, setSnapshot] = useState24();
9449
9464
  const [draft, setDraft] = useState24({ fields: [], defaultCollapsed: defaultCollapsed ?? false });
@@ -9554,7 +9569,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
9554
9569
  }
9555
9570
  }
9556
9571
  ) : null;
9557
- const panel = config ? /* @__PURE__ */ jsxs26(Fragment9, { children: [
9572
+ const panel = config ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
9558
9573
  !open && error ? /* @__PURE__ */ jsx28("span", { className: "sia-query-form__error", role: "alert", children: "\u67E5\u8BE2\u8BBE\u7F6E\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7\u6253\u5F00\u8BBE\u7F6E\u91CD\u8BD5" }) : null,
9559
9574
  /* @__PURE__ */ jsx28(
9560
9575
  Modal,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.123",
3
+ "version": "0.1.124",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",