@sia.soul/sia-react-ui 0.1.20 → 0.1.22

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 (38) hide show
  1. package/dist/Select-4hGJt3RJ.d.cts +142 -0
  2. package/dist/Select-BNSE67xn.d.ts +142 -0
  3. package/dist/chart.d.cts +2498 -0
  4. package/dist/chart.d.ts +2498 -0
  5. package/dist/{chunk-4HB6GC24.js → chunk-3TRRBMXY.js} +37 -8
  6. package/dist/{chunk-3RWL67CK.js → chunk-7RNS52YG.js} +38 -5
  7. package/dist/{chunk-SUMXP2SF.js → chunk-KLI65JVD.js} +12 -4
  8. package/dist/{chunk-I3EF5SF2.js → chunk-RWGSZW32.js} +1 -1
  9. package/dist/{chunk-LO3BUBWU.js → chunk-VN6PIPP7.js} +2 -2
  10. package/dist/{core-CdoVqv0o.d.ts → core-C5OnrCi4.d.cts} +1207 -3
  11. package/dist/{core-CM79w-7A.d.cts → core-DeZknKwc.d.ts} +1207 -3
  12. package/dist/core.cjs +77 -13
  13. package/dist/core.css +29 -5
  14. package/dist/core.d.cts +3 -3
  15. package/dist/core.d.ts +3 -3
  16. package/dist/core.js +3 -3
  17. package/dist/index.cjs +167 -25
  18. package/dist/index.css +29 -5
  19. package/dist/index.d.cts +1697 -8
  20. package/dist/index.d.ts +1697 -8
  21. package/dist/index.js +89 -17
  22. package/dist/markdown-editor.d.cts +41 -1
  23. package/dist/markdown-editor.d.ts +41 -1
  24. package/dist/rich-text-editor.cjs +11 -3
  25. package/dist/rich-text-editor.d.cts +46 -1
  26. package/dist/rich-text-editor.d.ts +46 -1
  27. package/dist/rich-text-editor.js +2 -2
  28. package/dist/{select-date-range-4tEYkA5O.d.cts → select-date-range-CGRb3-W8.d.ts} +116 -2
  29. package/dist/{select-date-range-D-ynrB5k.d.ts → select-date-range-DDmYGDD4.d.cts} +116 -2
  30. package/dist/select-date-range.cjs +36 -7
  31. package/dist/select-date-range.d.cts +3 -3
  32. package/dist/select-date-range.d.ts +3 -3
  33. package/dist/select-date-range.js +3 -3
  34. package/dist/{shared-DAYZvZVu.d.cts → shared-Bx4B28Wh.d.cts} +3 -0
  35. package/dist/{shared-DAYZvZVu.d.ts → shared-Bx4B28Wh.d.ts} +3 -0
  36. package/package.json +1 -1
  37. package/dist/Select-Cz3hzQl_.d.ts +0 -57
  38. package/dist/Select-Da9CLN0X.d.cts +0 -57
package/dist/index.cjs CHANGED
@@ -1484,6 +1484,7 @@ function DropdownRoot({
1484
1484
  open,
1485
1485
  defaultOpen = false,
1486
1486
  disabled = false,
1487
+ showTriggerIcon = true,
1487
1488
  arrow = false,
1488
1489
  autoFocus = false,
1489
1490
  openDelay = 80,
@@ -1644,6 +1645,10 @@ function DropdownRoot({
1644
1645
  className: "sia-dropdown__menu"
1645
1646
  }
1646
1647
  );
1648
+ const triggerNode = showTriggerIcon && (0, import_react7.isValidElement)(children) && children.type === Button && children.props.children !== void 0 && children.props.children !== null ? (0, import_react7.cloneElement)(children, {}, /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "sia-dropdown__trigger-content", children: [
1649
+ children.props.children,
1650
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chevron-down", size: 14, className: "sia-dropdown__trigger-icon" })
1651
+ ] })) : children;
1647
1652
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1648
1653
  "span",
1649
1654
  {
@@ -1659,7 +1664,7 @@ function DropdownRoot({
1659
1664
  onKeyDown: handleKeyDown,
1660
1665
  ...props,
1661
1666
  children: [
1662
- children,
1667
+ triggerNode,
1663
1668
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1664
1669
  "span",
1665
1670
  {
@@ -1706,7 +1711,7 @@ function DropdownButton({
1706
1711
  }) {
1707
1712
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: `sia-dropdown-button ${className}`.trim(), children: [
1708
1713
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { ...buttonProps, disabled, onClick, children }),
1709
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownRoot, { ...dropdownProps, disabled, trigger, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1714
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownRoot, { ...dropdownProps, disabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1710
1715
  Button,
1711
1716
  {
1712
1717
  ...buttonProps,
@@ -1718,7 +1723,10 @@ function DropdownButton({
1718
1723
  ) })
1719
1724
  ] });
1720
1725
  }
1721
- var Dropdown = Object.assign(DropdownRoot, { Button: DropdownButton });
1726
+ var Dropdown = Object.assign(DropdownRoot, {
1727
+ /** 组合主操作按钮与下拉菜单的按钮组件。 */
1728
+ Button: DropdownButton
1729
+ });
1722
1730
 
1723
1731
  // src/components/Pagination.tsx
1724
1732
  var import_react18 = require("react");
@@ -2027,12 +2035,19 @@ function preset(type, defaults = {}) {
2027
2035
  });
2028
2036
  }
2029
2037
  var Modal2 = Object.assign(ModalRoot, {
2038
+ /** 直接打开实例,返回可用于更新或关闭的操作句柄。 */
2030
2039
  open: openModal,
2040
+ /** 显示普通信息提示。 */
2031
2041
  info: preset("info", { title: "\u63D0\u793A" }),
2042
+ /** 显示成功提示。 */
2032
2043
  success: preset("success", { title: "\u64CD\u4F5C\u6210\u529F" }),
2044
+ /** 显示警告提示。 */
2033
2045
  warning: preset("warning", { title: "\u8BF7\u6CE8\u610F" }),
2046
+ /** 显示错误提示。 */
2034
2047
  error: preset("error", { title: "\u64CD\u4F5C\u5931\u8D25" }),
2048
+ /** 打开确认弹框,支持异步确认;返回 false 可阻止关闭。 */
2035
2049
  confirm: preset("confirm", { title: "\u786E\u8BA4\u64CD\u4F5C" }),
2050
+ /** 关闭由此 API 打开的所有弹层。 */
2036
2051
  destroyAll() {
2037
2052
  [...modalHandles].forEach((handle) => handle.destroy());
2038
2053
  }
@@ -2215,7 +2230,10 @@ function CheckboxGroup({
2215
2230
  children
2216
2231
  ] }) }) });
2217
2232
  }
2218
- var Checkbox2 = Object.assign(CheckboxRoot, { Group: CheckboxGroup });
2233
+ var Checkbox2 = Object.assign(CheckboxRoot, {
2234
+ /** 组合多个子项并统一管理布局或选择状态。 */
2235
+ Group: CheckboxGroup
2236
+ });
2219
2237
 
2220
2238
  // src/components/SelectionPanel.tsx
2221
2239
  var import_react13 = require("react");
@@ -2695,6 +2713,8 @@ function SelectionPanel({
2695
2713
  const search = searchValue ?? localSearch;
2696
2714
  const [scrollTop, setScrollTop] = (0, import_react13.useState)(0);
2697
2715
  const [active, setActive] = (0, import_react13.useState)();
2716
+ const [keyboardActive, setKeyboardActive] = (0, import_react13.useState)(false);
2717
+ const [deselectedHover, setDeselectedHover] = (0, import_react13.useState)();
2698
2718
  const listRef = (0, import_react13.useRef)(null);
2699
2719
  const id = (0, import_react13.useId)();
2700
2720
  const selected = (0, import_react13.useMemo)(() => new Set(value), [value]);
@@ -2739,9 +2759,11 @@ function SelectionPanel({
2739
2759
  if (listRef.current) listRef.current.scrollTop = 0;
2740
2760
  setActive(void 0);
2741
2761
  }, [search, selectedOnly, count]);
2742
- function toggle(option) {
2762
+ function toggle(option, keyboard = false) {
2743
2763
  if (disabled || loading || option.disabled || option.optionType === "divider") return;
2744
2764
  setActive(option.value);
2765
+ setKeyboardActive(keyboard);
2766
+ setDeselectedHover(!keyboard && !multiple && allowDeselect && selected.has(option.value) ? option.value : void 0);
2745
2767
  onChange(multiple ? selected.has(option.value) ? value.filter((item) => item !== option.value) : [...value, option.value] : allowDeselect && selected.has(option.value) ? [] : [option.value]);
2746
2768
  }
2747
2769
  function batch(operation) {
@@ -2791,6 +2813,10 @@ function SelectionPanel({
2791
2813
  className: "sia-selection-panel__list",
2792
2814
  style: { maxHeight },
2793
2815
  onScroll: (event) => setScrollTop(event.currentTarget.scrollTop),
2816
+ onPointerDown: () => setKeyboardActive(false),
2817
+ onBlur: (event) => {
2818
+ if (!event.currentTarget.contains(event.relatedTarget)) setKeyboardActive(false);
2819
+ },
2794
2820
  "aria-activedescendant": active !== void 0 ? `${id}-${typeof active}-${active}` : void 0,
2795
2821
  onKeyDown: (event) => {
2796
2822
  if (event.target instanceof HTMLInputElement) return;
@@ -2798,6 +2824,8 @@ function SelectionPanel({
2798
2824
  const index = enabled.findIndex((option) => option.value === active);
2799
2825
  if (["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) {
2800
2826
  event.preventDefault();
2827
+ setKeyboardActive(true);
2828
+ setDeselectedHover(void 0);
2801
2829
  const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, index + (event.key === "ArrowDown" ? 1 : -1)));
2802
2830
  const option = enabled[next];
2803
2831
  setActive(option.value);
@@ -2808,7 +2836,7 @@ function SelectionPanel({
2808
2836
  }
2809
2837
  } else if ((event.key === "Enter" || event.key === " ") && index >= 0) {
2810
2838
  event.preventDefault();
2811
- toggle(enabled[index]);
2839
+ toggle(enabled[index], true);
2812
2840
  }
2813
2841
  },
2814
2842
  children: loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { role: "status", children: "\u52A0\u8F7D\u4E2D\u2026" }) : !rows.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "sia-selection-panel__empty", children: "\u6682\u65E0\u5339\u914D\u9009\u9879" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { height: totalHeight, position: "relative" }, children: renderedRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
@@ -2824,7 +2852,11 @@ function SelectionPanel({
2824
2852
  tabIndex: -1,
2825
2853
  "aria-selected": selected.has(option.value),
2826
2854
  "aria-disabled": disabled || option.disabled || void 0,
2827
- className: `sia-selection-panel__option${active === option.value ? " is-active" : ""}`,
2855
+ className: `sia-selection-panel__option${keyboardActive && active === option.value ? " is-active" : ""}`,
2856
+ "data-deselected-hover": deselectedHover === option.value || void 0,
2857
+ onPointerLeave: () => {
2858
+ if (deselectedHover === option.value) setDeselectedHover(void 0);
2859
+ },
2828
2860
  onClick: (event) => {
2829
2861
  if (!event.target.closest(".sia-checkbox")) toggle(option);
2830
2862
  },
@@ -3276,7 +3308,8 @@ function defaultFilterOption(query, option) {
3276
3308
  var Select = (0, import_react17.forwardRef)(function Select2({
3277
3309
  options,
3278
3310
  mode = "single",
3279
- popupMode = "dropdown",
3311
+ popupMode: popupModeProp,
3312
+ modalThreshold = 15,
3280
3313
  modalConfig,
3281
3314
  value,
3282
3315
  defaultValue,
@@ -3285,7 +3318,7 @@ var Select = (0, import_react17.forwardRef)(function Select2({
3285
3318
  placeholderMode,
3286
3319
  size: sizeProp,
3287
3320
  status = "default",
3288
- allowClear = false,
3321
+ allowClear = true,
3289
3322
  loading = false,
3290
3323
  showSearch = false,
3291
3324
  showValue = false,
@@ -3318,6 +3351,9 @@ var Select = (0, import_react17.forwardRef)(function Select2({
3318
3351
  const searchRef = (0, import_react17.useRef)(null);
3319
3352
  const listRef = (0, import_react17.useRef)(null);
3320
3353
  const [open, setOpen] = (0, import_react17.useState)(false);
3354
+ const automaticMode = popupModeProp ?? (options.length > modalThreshold ? "modal" : "dropdown");
3355
+ const [openedMode, setOpenedMode] = (0, import_react17.useState)(automaticMode);
3356
+ const popupMode = open ? openedMode : automaticMode;
3321
3357
  const [modalValues, setModalValues] = (0, import_react17.useState)([]);
3322
3358
  const [selectedOnly, setSelectedOnly] = (0, import_react17.useState)(false);
3323
3359
  const [query, setQuery] = (0, import_react17.useState)("");
@@ -3389,9 +3425,10 @@ var Select = (0, import_react17.forwardRef)(function Select2({
3389
3425
  }
3390
3426
  function openDropdown() {
3391
3427
  if (disabled || loading) return;
3428
+ setOpenedMode(automaticMode);
3392
3429
  const selectedIndex = filteredOptions.findIndex((option) => selectedValueSet.has(option.value) && !option.disabled);
3393
3430
  setActiveIndex(selectedIndex >= 0 ? selectedIndex : firstEnabledIndex());
3394
- if (popupMode === "modal") {
3431
+ if (automaticMode === "modal") {
3395
3432
  setModalValues([...selectedValues]);
3396
3433
  setSelectedOnly(false);
3397
3434
  }
@@ -3700,6 +3737,7 @@ var DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100, 200, 500, 1e3, 2e3, 5e3];
3700
3737
  function Pagination({
3701
3738
  size: sizeProp,
3702
3739
  total = 0,
3740
+ currentPageCount,
3703
3741
  current,
3704
3742
  defaultCurrent = 1,
3705
3743
  pageSize,
@@ -3726,6 +3764,7 @@ function Pagination({
3726
3764
  const loading = refreshing ?? internalRefreshing;
3727
3765
  const sizes = [...new Set([...pageSizeOptions, size].filter((value) => value > 0))].sort((a, b) => a - b);
3728
3766
  const range = safeTotal ? [(safePage - 1) * size + 1, Math.min(safeTotal, safePage * size)] : [0, 0];
3767
+ const pageCount = Math.max(0, currentPageCount ?? (safeTotal ? range[1] - range[0] + 1 : 0));
3729
3768
  if (hideOnSinglePage && totalPages <= 1) return null;
3730
3769
  function change(nextPage, nextSize = size) {
3731
3770
  const nextTotalPages = Math.max(1, Math.ceil(safeTotal / nextSize));
@@ -3749,6 +3788,11 @@ function Pagination({
3749
3788
  }
3750
3789
  }
3751
3790
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("nav", { className: `sia-pagination sia-pagination--${controlSize} ${className}`.trim(), "aria-label": "\u5206\u9875", ...props, children: [
3791
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "sia-pagination__current-count", "aria-live": "polite", children: [
3792
+ "\u5F53\u524D\u9875 ",
3793
+ pageCount,
3794
+ " \u6761"
3795
+ ] }),
3752
3796
  showSizeChanger ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "sia-pagination__size", children: [
3753
3797
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "\u6BCF\u9875\u663E\u793A" }),
3754
3798
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -4460,11 +4504,17 @@ function openNotification(config) {
4460
4504
  return { key, close: () => closeNotification(key) };
4461
4505
  }
4462
4506
  var notification = {
4507
+ /** 直接打开实例,返回可用于更新或关闭的操作句柄。 */
4463
4508
  open: openNotification,
4509
+ /** 显示普通信息提示。 */
4464
4510
  info: (config) => openNotification({ ...config, type: "info" }),
4511
+ /** 显示成功提示。 */
4465
4512
  success: (config) => openNotification({ ...config, type: "success" }),
4513
+ /** 显示警告提示。 */
4466
4514
  warning: (config) => openNotification({ ...config, type: "warning" }),
4515
+ /** 显示错误提示。 */
4467
4516
  error: (config) => openNotification({ ...config, type: "error" }),
4517
+ /** 关闭指定实例;未指定标识时关闭所有实例。 */
4468
4518
  destroy: (key) => {
4469
4519
  if (key !== void 0) closeNotification(key);
4470
4520
  else {
@@ -4640,7 +4690,10 @@ function SpaceRoot({
4640
4690
  split !== void 0 && index < items.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sia-space__split", children: split }) : null
4641
4691
  ] }, index)) });
4642
4692
  }
4643
- var Space = Object.assign(SpaceRoot, { Compact: SpaceCompact });
4693
+ var Space = Object.assign(SpaceRoot, {
4694
+ /** 紧凑布局容器,将相邻控件组合为连续的按钮或输入组。 */
4695
+ Compact: SpaceCompact
4696
+ });
4644
4697
  function Divider({
4645
4698
  orientation = "horizontal",
4646
4699
  variant = "solid",
@@ -4913,7 +4966,10 @@ function SplitterRoot({
4913
4966
  )];
4914
4967
  }) });
4915
4968
  }
4916
- var Splitter = Object.assign(SplitterRoot, { Panel: SplitterPanel });
4969
+ var Splitter = Object.assign(SplitterRoot, {
4970
+ /** Splitter 中的可调整大小面板。 */
4971
+ Panel: SplitterPanel
4972
+ });
4917
4973
 
4918
4974
  // src/components/ToolPanel.tsx
4919
4975
  var import_react25 = require("react");
@@ -5463,7 +5519,9 @@ function openDrawer(config) {
5463
5519
  return handle;
5464
5520
  }
5465
5521
  var Drawer2 = Object.assign(DrawerRoot, {
5522
+ /** 直接打开实例,返回可用于更新或关闭的操作句柄。 */
5466
5523
  open: openDrawer,
5524
+ /** 关闭由此 API 打开的所有弹层。 */
5467
5525
  destroyAll() {
5468
5526
  [...drawerHandles].forEach((handle) => handle.destroy());
5469
5527
  }
@@ -5867,9 +5925,13 @@ function FormErrorList({ errors = [] }) {
5867
5925
  return errors.length ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "sia-form-error-list", children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: error }, index)) }) : null;
5868
5926
  }
5869
5927
  var Form = Object.assign(FormRoot, {
5928
+ /** 表单字段,负责字段值绑定、校验和标签布局。 */
5870
5929
  Item: FormItem,
5930
+ /** 动态表单列表,提供字段索引以及新增、删除、移动操作。 */
5871
5931
  List: FormList,
5932
+ /** 显示表单错误文本集合。 */
5872
5933
  ErrorList: FormErrorList,
5934
+ /** 创建或复用表单实例,返回单元素元组 [form]。 */
5873
5935
  useForm
5874
5936
  });
5875
5937
 
@@ -5948,7 +6010,12 @@ function RadioGroup({
5948
6010
  children
5949
6011
  ] }) }) });
5950
6012
  }
5951
- var Radio2 = Object.assign(RadioRoot, { Button: RadioButton, Group: RadioGroup });
6013
+ var Radio2 = Object.assign(RadioRoot, {
6014
+ /** 组合主操作按钮与下拉菜单的按钮组件。 */
6015
+ Button: RadioButton,
6016
+ /** 组合多个子项并统一管理布局或选择状态。 */
6017
+ Group: RadioGroup
6018
+ });
5952
6019
 
5953
6020
  // src/components/Slider.tsx
5954
6021
  var import_react29 = require("react");
@@ -7871,7 +7938,12 @@ function UploadDragger({ hint = "\u652F\u6301\u5355\u4E2A\u6216\u6279\u91CF\u4E0
7871
7938
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: hint })
7872
7939
  ] }) });
7873
7940
  }
7874
- var Upload = Object.assign(UploadRoot, { Dragger: UploadDragger, LIST_IGNORE });
7941
+ var Upload = Object.assign(UploadRoot, {
7942
+ /** 支持拖入文件上传的区域组件。 */
7943
+ Dragger: UploadDragger,
7944
+ /** beforeUpload 返回此标记时忽略该文件,不加入上传列表。 */
7945
+ LIST_IGNORE
7946
+ });
7875
7947
 
7876
7948
  // src/components/TextArea.tsx
7877
7949
  var import_react36 = require("react");
@@ -10073,12 +10145,19 @@ function shortcut(type) {
10073
10145
  return (content, duration) => openMessage({ content, duration, type });
10074
10146
  }
10075
10147
  var message = {
10148
+ /** 直接打开实例,返回可用于更新或关闭的操作句柄。 */
10076
10149
  open: openMessage,
10150
+ /** 显示普通信息提示。 */
10077
10151
  info: shortcut("info"),
10152
+ /** 显示成功提示。 */
10078
10153
  success: shortcut("success"),
10154
+ /** 显示警告提示。 */
10079
10155
  warning: shortcut("warning"),
10156
+ /** 显示错误提示。 */
10080
10157
  error: shortcut("error"),
10158
+ /** 显示持续加载提示。 */
10081
10159
  loading: shortcut("loading"),
10160
+ /** 关闭指定实例;未指定标识时关闭所有实例。 */
10082
10161
  destroy(key) {
10083
10162
  if (key !== void 0) {
10084
10163
  closeMessage(key);
@@ -10086,6 +10165,7 @@ var message = {
10086
10165
  }
10087
10166
  [...messageItems].forEach((item) => closeMessage(item.key));
10088
10167
  },
10168
+ /** 配置消息默认持续时间和最大同时显示数量。 */
10089
10169
  config(config) {
10090
10170
  if (config.duration !== void 0) defaultDuration = config.duration;
10091
10171
  if (config.maxCount !== void 0) maxCount = Math.max(1, config.maxCount);
@@ -10819,7 +10899,7 @@ function TableCellContent({ children, ellipsis, title }) {
10819
10899
  layouts.forEach((layout) => layout.removeAttribute("data-table-inline-layout"));
10820
10900
  };
10821
10901
  }, [children, ellipsis, customContent]);
10822
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: "sia-table__cell-content", title, "data-custom-content": customContent || void 0, "data-content-overflow": ellipsis && customContent && overflowing || void 0, children });
10902
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref, className: "sia-table__cell-content", "data-custom-content": customContent || void 0, "data-content-overflow": ellipsis && customContent && overflowing || void 0, children: title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Tooltip, { title, className: "sia-table__cell-tooltip", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children }) }) : children });
10823
10903
  }
10824
10904
 
10825
10905
  // src/components/Table/Table.tsx
@@ -10981,6 +11061,7 @@ function isInteractiveTableTarget(target) {
10981
11061
  function createCellSelectionPlugin(options = {}) {
10982
11062
  let dragMode = null;
10983
11063
  let dragAnchor = null;
11064
+ let textCell = null;
10984
11065
  let headerDragAnchorKey = null;
10985
11066
  let snapshotCache = null;
10986
11067
  let latestContext = null;
@@ -11282,12 +11363,17 @@ function createCellSelectionPlugin(options = {}) {
11282
11363
  return;
11283
11364
  }
11284
11365
  if (!isSelectable(row, column, context)) return;
11285
- event.preventDefault();
11286
11366
  window.getSelection()?.removeAllRanges();
11287
11367
  focusTable(event.currentTarget);
11288
11368
  const address = { rowKey: row.key, columnKey: column.key };
11289
- dragAnchor = event.shiftKey && context.state.range ? context.state.range.anchor : address;
11290
- dragMode = "cells";
11369
+ const extendRange = event.shiftKey && context.state.range;
11370
+ dragAnchor = extendRange ? extendRange.anchor : address;
11371
+ dragMode = extendRange ? "cells" : "text";
11372
+ textCell = extendRange ? null : event.currentTarget;
11373
+ if (extendRange) {
11374
+ event.preventDefault();
11375
+ window.getSelection()?.removeAllRanges();
11376
+ }
11291
11377
  setSelection(context, { anchor: dragAnchor, focus: address });
11292
11378
  },
11293
11379
  onCellPointerMove(row, column, event, context) {
@@ -11295,6 +11381,7 @@ function createCellSelectionPlugin(options = {}) {
11295
11381
  if ((event.buttons & 1) === 0) {
11296
11382
  dragMode = null;
11297
11383
  dragAnchor = null;
11384
+ textCell = null;
11298
11385
  return;
11299
11386
  }
11300
11387
  if (dragMode === "rows") {
@@ -11304,6 +11391,12 @@ function createCellSelectionPlugin(options = {}) {
11304
11391
  return;
11305
11392
  }
11306
11393
  if (!isSelectable(row, column, context)) return;
11394
+ if (dragMode === "text") {
11395
+ if (sameCellAddress(dragAnchor, { rowKey: row.key, columnKey: column.key })) return;
11396
+ dragMode = "cells";
11397
+ textCell = null;
11398
+ focusTable(event.currentTarget);
11399
+ }
11307
11400
  event.preventDefault();
11308
11401
  window.getSelection()?.removeAllRanges();
11309
11402
  setSelection(context, {
@@ -11337,14 +11430,29 @@ function createCellSelectionPlugin(options = {}) {
11337
11430
  },
11338
11431
  onMount() {
11339
11432
  const stopDragging = () => {
11433
+ constrainTextSelection();
11340
11434
  dragMode = null;
11341
11435
  dragAnchor = null;
11436
+ textCell = null;
11342
11437
  headerDragAnchorKey = null;
11343
11438
  };
11439
+ const constrainTextSelection = () => {
11440
+ if (!dragMode) return;
11441
+ const selection = window.getSelection();
11442
+ if (!selection || selection.isCollapsed) return;
11443
+ if (dragMode !== "text" || !textCell?.contains(selection.anchorNode) || !textCell.contains(selection.focusNode)) {
11444
+ selection.removeAllRanges();
11445
+ }
11446
+ };
11447
+ const handleSelectStart = (event) => {
11448
+ if (dragMode && dragMode !== "text") event.preventDefault();
11449
+ };
11344
11450
  const handleCopy = (event) => {
11345
11451
  const context = latestContext;
11346
11452
  if (options.copyable === false || !context || !activeRoot || !activeRoot.contains(document.activeElement) || isInteractiveTableTarget(document.activeElement))
11347
11453
  return;
11454
+ const selection = window.getSelection();
11455
+ if (selection && !selection.isCollapsed && selection.toString()) return;
11348
11456
  const text = copyText(context);
11349
11457
  if (!text) return;
11350
11458
  event.preventDefault();
@@ -11352,11 +11460,18 @@ function createCellSelectionPlugin(options = {}) {
11352
11460
  options.onCopy?.(text, selectedCells(context));
11353
11461
  };
11354
11462
  window.addEventListener("pointerup", stopDragging);
11463
+ window.addEventListener("pointercancel", stopDragging);
11355
11464
  window.addEventListener("blur", stopDragging);
11465
+ document.addEventListener("selectionchange", constrainTextSelection);
11466
+ document.addEventListener("selectstart", handleSelectStart);
11356
11467
  document.addEventListener("copy", handleCopy);
11357
11468
  return () => {
11469
+ stopDragging();
11358
11470
  window.removeEventListener("pointerup", stopDragging);
11471
+ window.removeEventListener("pointercancel", stopDragging);
11359
11472
  window.removeEventListener("blur", stopDragging);
11473
+ document.removeEventListener("selectionchange", constrainTextSelection);
11474
+ document.removeEventListener("selectstart", handleSelectStart);
11360
11475
  document.removeEventListener("copy", handleCopy);
11361
11476
  };
11362
11477
  },
@@ -12088,6 +12203,7 @@ function createPaginationPlugin(options = {}) {
12088
12203
  Pagination,
12089
12204
  {
12090
12205
  className: "sia-table__pagination",
12206
+ currentPageCount: context.rows.length,
12091
12207
  current: page.current,
12092
12208
  pageSize: page.pageSize,
12093
12209
  pageSizeOptions: options.pageSizeOptions ?? DEFAULT_PAGE_SIZE_OPTIONS,
@@ -12856,7 +12972,6 @@ function ColumnSettingPanel({
12856
12972
  "span",
12857
12973
  {
12858
12974
  className: "sia-table-settings__name",
12859
- title: labels.get(item.key) ?? item.key,
12860
12975
  children: labels.get(item.key) ?? item.key
12861
12976
  }
12862
12977
  ),
@@ -13128,7 +13243,6 @@ function ToolbarItems({
13128
13243
  danger: item.danger,
13129
13244
  icon: item.icon,
13130
13245
  disabled,
13131
- title: typeof item.label === "string" ? item.label : void 0,
13132
13246
  onClick: () => void item.onClick?.(context),
13133
13247
  children: item.label
13134
13248
  },
@@ -13400,7 +13514,7 @@ var TableBodyRow = (0, import_react47.memo)(function TableBodyRow2({
13400
13514
  TableCellContent,
13401
13515
  {
13402
13516
  ellipsis: column.ellipsis !== false,
13403
- title: column.showTitle !== false && column.ellipsis !== false && typeof value === "string" ? value : void 0,
13517
+ title: column.showTitle === true && column.ellipsis !== false && typeof value === "string" ? value : void 0,
13404
13518
  children: pluginCellProps.content !== void 0 ? pluginCellProps.content : column.render ? column.render(value, row.record, row.sourceIndex, { row, rowIndex, column }) : value
13405
13519
  }
13406
13520
  )
@@ -13825,7 +13939,7 @@ function TableInner(props, ref) {
13825
13939
  const fixed = normalizeFixed(column.fixed);
13826
13940
  const fixedEdgeClass = fixed === "left" && column.key === leftFixedEdgeKey ? " sia-table__cell--fixed-left-edge" : fixed === "right" && column.key === rightFixedEdgeKey ? " sia-table__cell--fixed-right-edge" : "";
13827
13941
  const autoWidthClass = column.autoWidth ? " sia-table__cell--auto-width" : "";
13828
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("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__ */ (0, import_jsx_runtime49.jsx)("span", { className: "sia-table__summary-label", title: typeof content === "string" ? content : void 0, children: content }) : content }, column.key);
13942
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("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__ */ (0, import_jsx_runtime49.jsx)("span", { className: "sia-table__summary-label", children: content }) : content }, column.key);
13829
13943
  }) }, summary.key);
13830
13944
  }
13831
13945
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
@@ -14051,19 +14165,33 @@ var ThemeSwitch = (0, import_react48.forwardRef)(function ThemeSwitch2({
14051
14165
 
14052
14166
  // src/theme.ts
14053
14167
  var SIA_THEME = {
14168
+ /** 主色。 */
14054
14169
  colorPrimary: "#1677ff",
14170
+ /** 主色的悬停色。 */
14055
14171
  colorPrimaryHover: "#4096ff",
14172
+ /** 主色的按下色。 */
14056
14173
  colorPrimaryActive: "#0958d9",
14174
+ /** 主要文本颜色。 */
14057
14175
  colorText: "#1f1f1f",
14176
+ /** 次要文本颜色。 */
14058
14177
  colorTextSecondary: "#666666",
14178
+ /** 页面背景颜色。 */
14059
14179
  colorBackground: "#f5f7fa",
14180
+ /** 组件表面颜色。 */
14060
14181
  colorSurface: "#ffffff",
14182
+ /** 默认边框颜色。 */
14061
14183
  colorBorder: "#d9d9d9",
14184
+ /** 默认圆角半径,单位为像素。 */
14062
14185
  borderRadius: 6,
14186
+ /** 默认控件高度,单位为像素。 */
14063
14187
  controlHeight: 32,
14188
+ /** 默认布局间距,单位为像素。 */
14064
14189
  spacing: 16,
14190
+ /** 默认字号,单位为像素。 */
14065
14191
  fontSize: 16,
14192
+ /** 小号文字尺寸,单位为像素。 */
14066
14193
  fontSizeSmall: 14,
14194
+ /** 大号文字尺寸,单位为像素。 */
14067
14195
  fontSizeLarge: 18
14068
14196
  };
14069
14197
  function applySiaTheme(mode, target = document.documentElement) {
@@ -14238,7 +14366,16 @@ function Link({ disabled, className = "", onClick, href, target, rel, ...props }
14238
14366
  function TypographyRoot({ className = "", ...props }) {
14239
14367
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { ...props, className: `sia-typography ${className}`.trim() });
14240
14368
  }
14241
- var Typography = Object.assign(TypographyRoot, { Title, Text, Paragraph, Link });
14369
+ var Typography = Object.assign(TypographyRoot, {
14370
+ /** 语义化标题,支持标题级别、复制和编辑。 */
14371
+ Title,
14372
+ /** 行内文本,支持强调、复制、编辑和省略。 */
14373
+ Text,
14374
+ /** 段落文本,支持复制、编辑和省略。 */
14375
+ Paragraph,
14376
+ /** 具有排版样式的链接。 */
14377
+ Link
14378
+ });
14242
14379
 
14243
14380
  // src/components/FloatButton.tsx
14244
14381
  var import_react50 = require("react");
@@ -14369,7 +14506,12 @@ function FloatButtonBackTop({ target, visibilityHeight = 400, behavior = "smooth
14369
14506
  element?.scrollTo({ top: 0, behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : behavior });
14370
14507
  } });
14371
14508
  }
14372
- var FloatButton2 = Object.assign(FloatButtonRoot, { Group: FloatButtonGroup, BackTop: FloatButtonBackTop });
14509
+ var FloatButton2 = Object.assign(FloatButtonRoot, {
14510
+ /** 组合多个子项并统一管理布局或选择状态。 */
14511
+ Group: FloatButtonGroup,
14512
+ /** 滚动超过指定距离后显示的返回顶部按钮。 */
14513
+ BackTop: FloatButtonBackTop
14514
+ });
14373
14515
 
14374
14516
  // src/components/ChartWhirlingLoading.tsx
14375
14517
  var import_react51 = require("react");
@@ -22038,7 +22180,7 @@ function QueryForm({
22038
22180
  {
22039
22181
  className: "sia-query-form__field",
22040
22182
  hidden: collapsed && index >= Math.min(limit, fittingCount),
22041
- style: entry.width !== void 0 ? { flexBasis: entry.width, width: entry.width } : void 0,
22183
+ style: entry.width !== void 0 ? { "--sia-query-item-width": typeof entry.width === "number" ? `${entry.width}px` : entry.width } : void 0,
22042
22184
  children: entry.content
22043
22185
  },
22044
22186
  entry.key
package/dist/index.css CHANGED
@@ -4757,15 +4757,22 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4757
4757
  display: flex;
4758
4758
  flex-wrap: wrap;
4759
4759
  align-items: center;
4760
- gap: 12px;
4760
+ gap: var(--sia-query-field-gap, 12px);
4761
4761
  padding-top: 8px;
4762
4762
  }
4763
4763
  .sia-query-form__field {
4764
- flex: 0 1 var(--sia-query-field-width, 220px);
4765
- width: var(--sia-query-field-width, 220px);
4764
+ --sia-query-item-width: var(--sia-query-field-width, 220px);
4765
+ flex: 0 1 var(--sia-query-item-width);
4766
+ width: var(--sia-query-item-width);
4766
4767
  min-width: 0;
4767
4768
  max-width: 100%;
4768
4769
  }
4770
+ .sia-query-form__field:has(.sia-picker-range-control, .sia-time-range, .sia-select-date-range, .sia-space-compact:not(.sia-space-compact--vertical) > :nth-child(2)) {
4771
+ --sia-query-item-width: calc(var(--sia-query-field-width, 220px) + var(--sia-query-field-width, 220px) + var(--sia-query-field-gap, 12px));
4772
+ }
4773
+ .sia-query-form__field :is(.sia-picker-range-control, .sia-time-range, .sia-select-date-range, .sia-space-compact:not(.sia-space-compact--vertical)) {
4774
+ width: 100%;
4775
+ }
4769
4776
  .sia-query-form__field[hidden] {
4770
4777
  display: none;
4771
4778
  }
@@ -4848,7 +4855,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4848
4855
  @media (max-width: 600px) {
4849
4856
  .sia-query-form__fields.is-collapsed > .sia-query-form__field {
4850
4857
  flex-basis: auto !important;
4851
- width: var(--sia-query-field-width, 220px) !important;
4858
+ width: var(--sia-query-item-width) !important;
4852
4859
  }
4853
4860
  }
4854
4861
  .sia-query-form__quick > .sia-badge:has(.sia-badge__count) {
@@ -7377,6 +7384,14 @@ fieldset:disabled .sia-input-number__floating-placeholder {
7377
7384
  cursor: not-allowed;
7378
7385
  opacity: .55;
7379
7386
  }
7387
+ .sia-dropdown__trigger-content {
7388
+ display: inline-flex;
7389
+ align-items: center;
7390
+ gap: 8px;
7391
+ }
7392
+ .sia-dropdown__trigger-icon {
7393
+ flex: none;
7394
+ }
7380
7395
  .sia-dropdown__context-anchor {
7381
7396
  position: fixed;
7382
7397
  width: 0;
@@ -7514,6 +7529,9 @@ fieldset:disabled .sia-input-number__floating-placeholder {
7514
7529
  gap: 4px;
7515
7530
  white-space: nowrap;
7516
7531
  }
7532
+ .sia-pagination__current-count {
7533
+ white-space: nowrap;
7534
+ }
7517
7535
  .sia-pagination__size-select.sia-select {
7518
7536
  width: 94px;
7519
7537
  }
@@ -8529,6 +8547,12 @@ body > .sia-popup-portal[data-sia-popup-layer] {
8529
8547
  position: relative;
8530
8548
  display: inline-flex;
8531
8549
  }
8550
+ .sia-floating.sia-table__cell-tooltip {
8551
+ display: block;
8552
+ min-width: 0;
8553
+ overflow: hidden;
8554
+ text-overflow: ellipsis;
8555
+ }
8532
8556
  .sia-floating__overlay {
8533
8557
  --sia-floating-color: rgb(24 24 27 / 94%);
8534
8558
  --sia-floating-arrow-border: transparent;
@@ -9579,7 +9603,7 @@ button.sia-treemap__tile:focus-visible,
9579
9603
  min-width: 0;
9580
9604
  font: inherit;
9581
9605
  }
9582
- .sia-selection-panel__option:hover,
9606
+ .sia-selection-panel__option:hover:not([data-deselected-hover=true]),
9583
9607
  .sia-selection-panel__option.is-active {
9584
9608
  background: var(--sia-color-fill-secondary, #f2f5f8);
9585
9609
  }