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

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.
@@ -54,4 +54,4 @@ interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "def
54
54
  }
55
55
  declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
56
56
 
57
- export { Select as S, type SelectChangeValue as a, type SelectMode as b, type SelectOption as c, type SelectProps as d, type SelectValue as e };
57
+ export { type SelectOption as S, type SelectChangeValue as a, type SelectProps as b, Select as c, type SelectMode as d, type SelectValue as e };
@@ -54,4 +54,4 @@ interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "def
54
54
  }
55
55
  declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
56
56
 
57
- export { Select as S, type SelectChangeValue as a, type SelectMode as b, type SelectOption as c, type SelectProps as d, type SelectValue as e };
57
+ export { type SelectOption as S, type SelectChangeValue as a, type SelectProps as b, Select as c, type SelectMode as d, type SelectValue as e };
@@ -5,11 +5,11 @@ import {
5
5
  Popover,
6
6
  Tooltip,
7
7
  useOverlayLifecycle
8
- } from "./chunk-VXSG4EAO.js";
8
+ } from "./chunk-4HB6GC24.js";
9
9
  import {
10
10
  Dropdown,
11
11
  Icon
12
- } from "./chunk-ALWHRV4L.js";
12
+ } from "./chunk-SUMXP2SF.js";
13
13
  import {
14
14
  Button
15
15
  } from "./chunk-TZGUBGA4.js";
@@ -3,7 +3,7 @@ import {
3
3
  Icon,
4
4
  Input,
5
5
  PopupPortal
6
- } from "./chunk-ALWHRV4L.js";
6
+ } from "./chunk-SUMXP2SF.js";
7
7
  import {
8
8
  Button
9
9
  } from "./chunk-TZGUBGA4.js";
@@ -637,6 +637,7 @@ var ModalRoot = forwardRef2(function Modal({
637
637
  title,
638
638
  children,
639
639
  footer,
640
+ footerExtra,
640
641
  type = "default",
641
642
  okText = "\u786E\u5B9A",
642
643
  cancelText = "\u53D6\u6D88",
@@ -761,7 +762,10 @@ var ModalRoot = forwardRef2(function Modal({
761
762
  closable ? /* @__PURE__ */ jsx3("button", { type: "button", className: "sia-modal__close", "aria-label": "\u5173\u95ED\u5BF9\u8BDD\u6846", onClick: requestClose, children: /* @__PURE__ */ jsx3(Icon, { name: "close", size: 17 }) }) : null
762
763
  ] }),
763
764
  children !== void 0 ? /* @__PURE__ */ jsx3("div", { className: "sia-modal__body", children }) : null,
764
- footer !== null ? /* @__PURE__ */ jsx3("div", { className: "sia-modal__footer", children: footer ?? defaultFooter }) : null
765
+ footer !== null ? /* @__PURE__ */ jsxs3("div", { className: "sia-modal__footer", children: [
766
+ footer === void 0 && footerExtra != null ? /* @__PURE__ */ jsx3("div", { style: { marginRight: "auto" }, children: footerExtra }) : null,
767
+ footer ?? defaultFooter
768
+ ] }) : null
765
769
  ]
766
770
  }
767
771
  )
@@ -843,6 +847,7 @@ function SelectionPanel({
843
847
  value,
844
848
  onChange,
845
849
  multiple = false,
850
+ allowDeselect = false,
846
851
  disabled = false,
847
852
  loading = false,
848
853
  showSearch = true,
@@ -908,7 +913,7 @@ function SelectionPanel({
908
913
  function toggle(option) {
909
914
  if (disabled || loading || option.disabled || option.optionType === "divider") return;
910
915
  setActive(option.value);
911
- onChange(multiple ? selected.has(option.value) ? value.filter((item) => item !== option.value) : [...value, option.value] : [option.value]);
916
+ onChange(multiple ? selected.has(option.value) ? value.filter((item) => item !== option.value) : [...value, option.value] : allowDeselect && selected.has(option.value) ? [] : [option.value]);
912
917
  }
913
918
  function batch(operation) {
914
919
  if (disabled || loading) return;
@@ -1847,6 +1852,7 @@ var Select = forwardRef3(function Select2({
1847
1852
  value: modalValues,
1848
1853
  onChange: setModalValues,
1849
1854
  multiple,
1855
+ allowDeselect: allowClear,
1850
1856
  selectedOnly,
1851
1857
  showValue,
1852
1858
  showSearch: false,
@@ -2,7 +2,7 @@ import {
2
2
  Dropdown,
3
3
  Icon,
4
4
  Input
5
- } from "./chunk-ALWHRV4L.js";
5
+ } from "./chunk-SUMXP2SF.js";
6
6
  import {
7
7
  Button
8
8
  } from "./chunk-TZGUBGA4.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Select
3
- } from "./chunk-VXSG4EAO.js";
3
+ } from "./chunk-4HB6GC24.js";
4
4
  import {
5
5
  Icon,
6
6
  PopupPortal
7
- } from "./chunk-ALWHRV4L.js";
7
+ } from "./chunk-SUMXP2SF.js";
8
8
  import {
9
9
  useControlSize,
10
10
  useControllableState,
@@ -974,7 +974,8 @@ function MenuEntry({
974
974
  item,
975
975
  level,
976
976
  parents,
977
- props
977
+ props,
978
+ reserveIcon
978
979
  }) {
979
980
  const anchorRef = useRef2(null);
980
981
  const closeTimerRef = useRef2(void 0);
@@ -1023,7 +1024,7 @@ function MenuEntry({
1023
1024
  "aria-expanded": hasChildren ? isOpen : void 0,
1024
1025
  onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
1025
1026
  children: [
1026
- item.icon ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__icon", children: item.icon }) : null,
1027
+ reserveIcon ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
1027
1028
  !collapsed ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__label", children: item.label }) : null,
1028
1029
  !collapsed && item.extra ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__extra", children: item.extra }) : null,
1029
1030
  !collapsed && hasChildren ? /* @__PURE__ */ jsx4(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
@@ -1047,19 +1048,23 @@ function MenuEntry({
1047
1048
  }
1048
1049
  );
1049
1050
  }
1051
+ function hasMenuIcon(items) {
1052
+ return items.some((item) => item.type === "group" ? hasMenuIcon(item.children ?? []) : item.type !== "divider" && Boolean(item.icon));
1053
+ }
1050
1054
  function MenuLevel({
1051
1055
  items,
1052
1056
  level,
1053
1057
  parents,
1054
- props
1058
+ props,
1059
+ reserveIcon = hasMenuIcon(items)
1055
1060
  }) {
1056
1061
  return /* @__PURE__ */ jsx4(Fragment3, { children: items.map((item, index) => {
1057
1062
  if (item.type === "divider") return /* @__PURE__ */ jsx4("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
1058
1063
  if (item.type === "group") return /* @__PURE__ */ jsxs3("li", { className: "sia-menu__group", children: [
1059
1064
  /* @__PURE__ */ jsx4("div", { className: "sia-menu__group-title", children: item.label }),
1060
- /* @__PURE__ */ jsx4("ul", { role: "group", children: /* @__PURE__ */ jsx4(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props }) })
1065
+ /* @__PURE__ */ jsx4("ul", { role: "group", children: /* @__PURE__ */ jsx4(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props, reserveIcon }) })
1061
1066
  ] }, item.key);
1062
- return /* @__PURE__ */ jsx4(MenuEntry, { item, level, parents, props }, item.key);
1067
+ return /* @__PURE__ */ jsx4(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
1063
1068
  }) });
1064
1069
  }
1065
1070
  function Menu({
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes } from 'react';
3
3
  import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-DAYZvZVu.cjs';
4
- import './Select-CVvF4mcy.cjs';
4
+ import './Select-Da9CLN0X.cjs';
5
5
 
6
6
  type ButtonVariant = "primary" | "default" | "dashed" | "filled" | "text" | "link";
7
7
  type ButtonSize = ControlSize;
@@ -917,6 +917,8 @@ interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "onS
917
917
  title?: ReactNode;
918
918
  children?: ReactNode;
919
919
  footer?: ReactNode | null;
920
+ /** 默认底部操作区左侧的扩展内容。 */
921
+ footerExtra?: ReactNode;
920
922
  type?: ModalType;
921
923
  okText?: ReactNode;
922
924
  cancelText?: ReactNode;
@@ -1079,4 +1081,4 @@ declare const FloatButton: react.ForwardRefExoticComponent<FloatButtonProps & re
1079
1081
  BackTop: typeof FloatButtonBackTop;
1080
1082
  };
1081
1083
 
1082
- export { type InputProps as $, type DropdownProps as A, type ButtonProps as B, Calendar as C, Dropdown as D, type DropdownTrigger as E, FILLED_ICON_NAMES as F, type FilledIconName as G, FloatButton as H, type FloatButtonBackTopProps as I, type FloatButtonGroupProps as J, type FloatButtonProps as K, type FloatButtonShape as L, type FloatingPlacement as M, type FloatingTrigger as N, type OverlayContainer as O, ICON_NAMES as P, Icon as Q, type IconName as R, type IconProps as S, type TagStatus as T, type IconVariant as U, Image as V, ImagePreview as W, type ImagePreviewConfig as X, type ImagePreviewProps as Y, type ImageProps as Z, Input as _, type OverlayApiHandle as a, type TypographyTitleProps as a$, Menu as a0, type MenuClickInfo as a1, type MenuItem as a2, type MenuMode as a3, type MenuProps as a4, type MenuTheme as a5, type MessageConfig as a6, type MessageHandle as a7, type MessageKey as a8, type MessageType as a9, type StepsProps as aA, type TabItem as aB, Tabs as aC, type TabsContextMenuClickInfo as aD, type TabsOrientation as aE, type TabsPosition as aF, type TabsProps as aG, type TabsType as aH, Tag as aI, type TagProps as aJ, type TagVariant as aK, Timeline as aL, type TimelineItem as aM, type TimelineProps as aN, Tooltip as aO, type TooltipProps as aP, Tour as aQ, type TourProps as aR, type TourStep as aS, Tree as aT, type TreeDropPosition as aU, type TreeKey as aV, type TreeNode as aW, type TreeProps as aX, Typography as aY, type TypographyLinkProps as aZ, type TypographyProps as a_, Modal as aa, type ModalActionResult as ab, type ModalOpenConfig as ac, type ModalProps as ad, type ModalType as ae, type NotificationConfig as af, type NotificationPlacement as ag, type NotificationType as ah, Popconfirm as ai, type PopconfirmProps as aj, Popover as ak, type PopoverProps as al, Progress as am, type ProgressProps as an, type ProgressStatus as ao, Rate as ap, type RateProps as aq, Segmented as ar, type SegmentedOption as as, type SegmentedProps as at, type SegmentedValue as au, Spin as av, type SpinProps as aw, type StepItem as ax, type StepStatus as ay, Steps as az, type ButtonSize as b, type TypographyType as b0, Upload as b1, type UploadChangeInfo as b2, type UploadDraggerProps as b3, type UploadFile as b4, type UploadFileStatus as b5, type UploadProps as b6, type UploadRequestOptions as b7, Watermark as b8, type WatermarkFont as b9, type WatermarkProps as ba, message as bb, notification as bc, type BadgeProps as c, Badge as d, type BadgeRibbonProps as e, type BadgeStatus as f, Breadcrumb as g, type BreadcrumbItem as h, type BreadcrumbProps as i, Button as j, type ButtonVariant as k, type CalendarProps as l, Card as m, type CardAccent as n, type CardProps as o, Carousel as p, type CarouselProps as q, type CarouselRef as r, Collapse as s, type CollapseItem as t, type CollapseKey as u, type CollapseProps as v, type DropdownButtonProps as w, type DropdownMenuProps as x, type DropdownOpenSource as y, type DropdownPlacement as z };
1084
+ export { type ImageProps as $, type DropdownPlacement as A, type ButtonProps as B, Calendar as C, Dropdown as D, type DropdownProps as E, type DropdownTrigger as F, FILLED_ICON_NAMES as G, type FilledIconName as H, FloatButton as I, type FloatButtonBackTopProps as J, type FloatButtonGroupProps as K, type FloatButtonProps as L, type ModalOpenConfig as M, type FloatButtonShape as N, type OverlayContainer as O, type FloatingPlacement as P, type FloatingTrigger as Q, ICON_NAMES as R, Icon as S, type TagStatus as T, type IconName as U, type IconProps as V, type IconVariant as W, Image as X, ImagePreview as Y, type ImagePreviewConfig as Z, type ImagePreviewProps as _, type OverlayApiHandle as a, type TypographyTitleProps as a$, Input as a0, type InputProps as a1, Menu as a2, type MenuClickInfo as a3, type MenuItem as a4, type MenuMode as a5, type MenuProps as a6, type MenuTheme as a7, type MessageConfig as a8, type MessageHandle as a9, type StepsProps as aA, type TabItem as aB, Tabs as aC, type TabsContextMenuClickInfo as aD, type TabsOrientation as aE, type TabsPosition as aF, type TabsProps as aG, type TabsType as aH, Tag as aI, type TagProps as aJ, type TagVariant as aK, Timeline as aL, type TimelineItem as aM, type TimelineProps as aN, Tooltip as aO, type TooltipProps as aP, Tour as aQ, type TourProps as aR, type TourStep as aS, Tree as aT, type TreeDropPosition as aU, type TreeKey as aV, type TreeNode as aW, type TreeProps as aX, Typography as aY, type TypographyLinkProps as aZ, type TypographyProps as a_, type MessageKey as aa, type MessageType as ab, Modal as ac, type ModalProps as ad, type ModalType as ae, type NotificationConfig as af, type NotificationPlacement as ag, type NotificationType as ah, Popconfirm as ai, type PopconfirmProps as aj, Popover as ak, type PopoverProps as al, Progress as am, type ProgressProps as an, type ProgressStatus as ao, Rate as ap, type RateProps as aq, Segmented as ar, type SegmentedOption as as, type SegmentedProps as at, type SegmentedValue as au, Spin as av, type SpinProps as aw, type StepItem as ax, type StepStatus as ay, Steps as az, type ModalActionResult as b, type TypographyType as b0, Upload as b1, type UploadChangeInfo as b2, type UploadDraggerProps as b3, type UploadFile as b4, type UploadFileStatus as b5, type UploadProps as b6, type UploadRequestOptions as b7, Watermark as b8, type WatermarkFont as b9, type WatermarkProps as ba, message as bb, notification as bc, type ButtonSize as c, type BadgeProps as d, Badge as e, type BadgeRibbonProps as f, type BadgeStatus as g, Breadcrumb as h, type BreadcrumbItem as i, type BreadcrumbProps as j, Button as k, type ButtonVariant as l, type CalendarProps as m, Card as n, type CardAccent as o, type CardProps as p, Carousel as q, type CarouselProps as r, type CarouselRef as s, Collapse as t, type CollapseItem as u, type CollapseKey as v, type CollapseProps as w, type DropdownButtonProps as x, type DropdownMenuProps as y, type DropdownOpenSource as z };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes } from 'react';
3
3
  import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-DAYZvZVu.js';
4
- import './Select-Ce2Irbpt.js';
4
+ import './Select-Cz3hzQl_.js';
5
5
 
6
6
  type ButtonVariant = "primary" | "default" | "dashed" | "filled" | "text" | "link";
7
7
  type ButtonSize = ControlSize;
@@ -917,6 +917,8 @@ interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "onS
917
917
  title?: ReactNode;
918
918
  children?: ReactNode;
919
919
  footer?: ReactNode | null;
920
+ /** 默认底部操作区左侧的扩展内容。 */
921
+ footerExtra?: ReactNode;
920
922
  type?: ModalType;
921
923
  okText?: ReactNode;
922
924
  cancelText?: ReactNode;
@@ -1079,4 +1081,4 @@ declare const FloatButton: react.ForwardRefExoticComponent<FloatButtonProps & re
1079
1081
  BackTop: typeof FloatButtonBackTop;
1080
1082
  };
1081
1083
 
1082
- export { type InputProps as $, type DropdownProps as A, type ButtonProps as B, Calendar as C, Dropdown as D, type DropdownTrigger as E, FILLED_ICON_NAMES as F, type FilledIconName as G, FloatButton as H, type FloatButtonBackTopProps as I, type FloatButtonGroupProps as J, type FloatButtonProps as K, type FloatButtonShape as L, type FloatingPlacement as M, type FloatingTrigger as N, type OverlayContainer as O, ICON_NAMES as P, Icon as Q, type IconName as R, type IconProps as S, type TagStatus as T, type IconVariant as U, Image as V, ImagePreview as W, type ImagePreviewConfig as X, type ImagePreviewProps as Y, type ImageProps as Z, Input as _, type OverlayApiHandle as a, type TypographyTitleProps as a$, Menu as a0, type MenuClickInfo as a1, type MenuItem as a2, type MenuMode as a3, type MenuProps as a4, type MenuTheme as a5, type MessageConfig as a6, type MessageHandle as a7, type MessageKey as a8, type MessageType as a9, type StepsProps as aA, type TabItem as aB, Tabs as aC, type TabsContextMenuClickInfo as aD, type TabsOrientation as aE, type TabsPosition as aF, type TabsProps as aG, type TabsType as aH, Tag as aI, type TagProps as aJ, type TagVariant as aK, Timeline as aL, type TimelineItem as aM, type TimelineProps as aN, Tooltip as aO, type TooltipProps as aP, Tour as aQ, type TourProps as aR, type TourStep as aS, Tree as aT, type TreeDropPosition as aU, type TreeKey as aV, type TreeNode as aW, type TreeProps as aX, Typography as aY, type TypographyLinkProps as aZ, type TypographyProps as a_, Modal as aa, type ModalActionResult as ab, type ModalOpenConfig as ac, type ModalProps as ad, type ModalType as ae, type NotificationConfig as af, type NotificationPlacement as ag, type NotificationType as ah, Popconfirm as ai, type PopconfirmProps as aj, Popover as ak, type PopoverProps as al, Progress as am, type ProgressProps as an, type ProgressStatus as ao, Rate as ap, type RateProps as aq, Segmented as ar, type SegmentedOption as as, type SegmentedProps as at, type SegmentedValue as au, Spin as av, type SpinProps as aw, type StepItem as ax, type StepStatus as ay, Steps as az, type ButtonSize as b, type TypographyType as b0, Upload as b1, type UploadChangeInfo as b2, type UploadDraggerProps as b3, type UploadFile as b4, type UploadFileStatus as b5, type UploadProps as b6, type UploadRequestOptions as b7, Watermark as b8, type WatermarkFont as b9, type WatermarkProps as ba, message as bb, notification as bc, type BadgeProps as c, Badge as d, type BadgeRibbonProps as e, type BadgeStatus as f, Breadcrumb as g, type BreadcrumbItem as h, type BreadcrumbProps as i, Button as j, type ButtonVariant as k, type CalendarProps as l, Card as m, type CardAccent as n, type CardProps as o, Carousel as p, type CarouselProps as q, type CarouselRef as r, Collapse as s, type CollapseItem as t, type CollapseKey as u, type CollapseProps as v, type DropdownButtonProps as w, type DropdownMenuProps as x, type DropdownOpenSource as y, type DropdownPlacement as z };
1084
+ export { type ImageProps as $, type DropdownPlacement as A, type ButtonProps as B, Calendar as C, Dropdown as D, type DropdownProps as E, type DropdownTrigger as F, FILLED_ICON_NAMES as G, type FilledIconName as H, FloatButton as I, type FloatButtonBackTopProps as J, type FloatButtonGroupProps as K, type FloatButtonProps as L, type ModalOpenConfig as M, type FloatButtonShape as N, type OverlayContainer as O, type FloatingPlacement as P, type FloatingTrigger as Q, ICON_NAMES as R, Icon as S, type TagStatus as T, type IconName as U, type IconProps as V, type IconVariant as W, Image as X, ImagePreview as Y, type ImagePreviewConfig as Z, type ImagePreviewProps as _, type OverlayApiHandle as a, type TypographyTitleProps as a$, Input as a0, type InputProps as a1, Menu as a2, type MenuClickInfo as a3, type MenuItem as a4, type MenuMode as a5, type MenuProps as a6, type MenuTheme as a7, type MessageConfig as a8, type MessageHandle as a9, type StepsProps as aA, type TabItem as aB, Tabs as aC, type TabsContextMenuClickInfo as aD, type TabsOrientation as aE, type TabsPosition as aF, type TabsProps as aG, type TabsType as aH, Tag as aI, type TagProps as aJ, type TagVariant as aK, Timeline as aL, type TimelineItem as aM, type TimelineProps as aN, Tooltip as aO, type TooltipProps as aP, Tour as aQ, type TourProps as aR, type TourStep as aS, Tree as aT, type TreeDropPosition as aU, type TreeKey as aV, type TreeNode as aW, type TreeProps as aX, Typography as aY, type TypographyLinkProps as aZ, type TypographyProps as a_, type MessageKey as aa, type MessageType as ab, Modal as ac, type ModalProps as ad, type ModalType as ae, type NotificationConfig as af, type NotificationPlacement as ag, type NotificationType as ah, Popconfirm as ai, type PopconfirmProps as aj, Popover as ak, type PopoverProps as al, Progress as am, type ProgressProps as an, type ProgressStatus as ao, Rate as ap, type RateProps as aq, Segmented as ar, type SegmentedOption as as, type SegmentedProps as at, type SegmentedValue as au, Spin as av, type SpinProps as aw, type StepItem as ax, type StepStatus as ay, Steps as az, type ModalActionResult as b, type TypographyType as b0, Upload as b1, type UploadChangeInfo as b2, type UploadDraggerProps as b3, type UploadFile as b4, type UploadFileStatus as b5, type UploadProps as b6, type UploadRequestOptions as b7, Watermark as b8, type WatermarkFont as b9, type WatermarkProps as ba, message as bb, notification as bc, type ButtonSize as c, type BadgeProps as d, Badge as e, type BadgeRibbonProps as f, type BadgeStatus as g, Breadcrumb as h, type BreadcrumbItem as i, type BreadcrumbProps as j, Button as k, type ButtonVariant as l, type CalendarProps as m, Card as n, type CardAccent as o, type CardProps as p, Carousel as q, type CarouselProps as r, type CarouselRef as s, Collapse as t, type CollapseItem as u, type CollapseKey as v, type CollapseProps as w, type DropdownButtonProps as x, type DropdownMenuProps as y, type DropdownOpenSource as z };
package/dist/core.cjs CHANGED
@@ -1188,7 +1188,8 @@ function MenuEntry({
1188
1188
  item,
1189
1189
  level,
1190
1190
  parents,
1191
- props
1191
+ props,
1192
+ reserveIcon
1192
1193
  }) {
1193
1194
  const anchorRef = (0, import_react6.useRef)(null);
1194
1195
  const closeTimerRef = (0, import_react6.useRef)(void 0);
@@ -1237,7 +1238,7 @@ function MenuEntry({
1237
1238
  "aria-expanded": hasChildren ? isOpen : void 0,
1238
1239
  onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
1239
1240
  children: [
1240
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__icon", children: item.icon }) : null,
1241
+ reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
1241
1242
  !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__label", children: item.label }) : null,
1242
1243
  !collapsed && item.extra ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__extra", children: item.extra }) : null,
1243
1244
  !collapsed && hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
@@ -1261,19 +1262,23 @@ function MenuEntry({
1261
1262
  }
1262
1263
  );
1263
1264
  }
1265
+ function hasMenuIcon(items) {
1266
+ return items.some((item) => item.type === "group" ? hasMenuIcon(item.children ?? []) : item.type !== "divider" && Boolean(item.icon));
1267
+ }
1264
1268
  function MenuLevel({
1265
1269
  items,
1266
1270
  level,
1267
1271
  parents,
1268
- props
1272
+ props,
1273
+ reserveIcon = hasMenuIcon(items)
1269
1274
  }) {
1270
1275
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: items.map((item, index) => {
1271
1276
  if (item.type === "divider") return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
1272
1277
  if (item.type === "group") return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { className: "sia-menu__group", children: [
1273
1278
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "sia-menu__group-title", children: item.label }),
1274
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props }) })
1279
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props, reserveIcon }) })
1275
1280
  ] }, item.key);
1276
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuEntry, { item, level, parents, props }, item.key);
1281
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
1277
1282
  }) });
1278
1283
  }
1279
1284
  function Menu({
@@ -2315,6 +2320,7 @@ var ModalRoot = (0, import_react14.forwardRef)(function Modal({
2315
2320
  title,
2316
2321
  children,
2317
2322
  footer,
2323
+ footerExtra,
2318
2324
  type = "default",
2319
2325
  okText = "\u786E\u5B9A",
2320
2326
  cancelText = "\u53D6\u6D88",
@@ -2439,7 +2445,10 @@ var ModalRoot = (0, import_react14.forwardRef)(function Modal({
2439
2445
  closable ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "sia-modal__close", "aria-label": "\u5173\u95ED\u5BF9\u8BDD\u6846", onClick: requestClose, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "close", size: 17 }) }) : null
2440
2446
  ] }),
2441
2447
  children !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sia-modal__body", children }) : null,
2442
- footer !== null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sia-modal__footer", children: footer ?? defaultFooter }) : null
2448
+ footer !== null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sia-modal__footer", children: [
2449
+ footer === void 0 && footerExtra != null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { marginRight: "auto" }, children: footerExtra }) : null,
2450
+ footer ?? defaultFooter
2451
+ ] }) : null
2443
2452
  ]
2444
2453
  }
2445
2454
  )
@@ -2625,6 +2634,7 @@ function SelectionPanel({
2625
2634
  value,
2626
2635
  onChange,
2627
2636
  multiple = false,
2637
+ allowDeselect = false,
2628
2638
  disabled = false,
2629
2639
  loading = false,
2630
2640
  showSearch = true,
@@ -2690,7 +2700,7 @@ function SelectionPanel({
2690
2700
  function toggle(option) {
2691
2701
  if (disabled || loading || option.disabled || option.optionType === "divider") return;
2692
2702
  setActive(option.value);
2693
- onChange(multiple ? selected.has(option.value) ? value.filter((item) => item !== option.value) : [...value, option.value] : [option.value]);
2703
+ onChange(multiple ? selected.has(option.value) ? value.filter((item) => item !== option.value) : [...value, option.value] : allowDeselect && selected.has(option.value) ? [] : [option.value]);
2694
2704
  }
2695
2705
  function batch(operation) {
2696
2706
  if (disabled || loading) return;
@@ -3626,6 +3636,7 @@ var Select = (0, import_react20.forwardRef)(function Select2({
3626
3636
  value: modalValues,
3627
3637
  onChange: setModalValues,
3628
3638
  multiple,
3639
+ allowDeselect: allowClear,
3629
3640
  selectedOnly,
3630
3641
  showValue,
3631
3642
  showSearch: false,
package/dist/core.css CHANGED
@@ -484,27 +484,47 @@ fieldset:disabled .sia-input-number__floating-placeholder {
484
484
  position: absolute;
485
485
  box-sizing: border-box;
486
486
  cursor: default;
487
+ touch-action: none;
488
+ }
489
+ .sia-floating-scrollbar__thumb::before {
490
+ content: none;
491
+ }
492
+ .sia-floating-scrollbar__thumb::after {
493
+ content: "";
494
+ position: absolute;
495
+ right: 0;
496
+ bottom: 0;
497
+ box-sizing: border-box;
498
+ pointer-events: none;
487
499
  background: var(--sia-scrollbar-thumb);
488
500
  border: 1px solid rgb(255 255 255 / 24%);
489
501
  border-radius: 999px;
490
502
  box-shadow: 0 1px 1px rgb(0 0 0 / 24%);
491
- touch-action: none;
492
- transition: background-color 120ms ease;
503
+ transition:
504
+ background-color 120ms ease,
505
+ width 150ms ease,
506
+ height 150ms ease;
493
507
  }
494
- .sia-floating-scrollbar__thumb:hover {
508
+ .sia-floating-scrollbar__thumb:hover::after {
495
509
  background: var(--sia-scrollbar-thumb-hover);
496
510
  }
497
511
  .sia-floating-scrollbar--horizontal .sia-floating-scrollbar__thumb {
498
512
  bottom: 0;
499
513
  left: 0;
514
+ height: 100%;
515
+ }
516
+ .sia-floating-scrollbar--horizontal .sia-floating-scrollbar__thumb::after {
517
+ width: 100%;
500
518
  height: var(--sia-scrollbar-size);
501
- transition: background-color 120ms ease, height 150ms ease;
502
519
  }
503
520
  .sia-floating-scrollbar--vertical .sia-floating-scrollbar__thumb {
504
521
  top: 0;
505
522
  right: 0;
523
+ width: 100%;
524
+ }
525
+ .sia-floating-scrollbar--vertical .sia-floating-scrollbar__thumb::after {
506
526
  width: var(--sia-scrollbar-size);
507
- transition: background-color 120ms ease, width 150ms ease;
527
+ height: 100%;
508
528
  }
509
529
  .sia-button,
510
530
  .sia-input,
@@ -7133,6 +7153,15 @@ fieldset:disabled .sia-input-number__floating-placeholder {
7133
7153
  display: inline-flex;
7134
7154
  flex: 0 0 auto;
7135
7155
  }
7156
+ .sia-menu__icon {
7157
+ justify-content: center;
7158
+ align-items: center;
7159
+ width: var(--sia-menu-icon-size, 16px);
7160
+ flex-basis: var(--sia-menu-icon-size, 16px);
7161
+ }
7162
+ .sia-menu__icon > * {
7163
+ max-width: 100%;
7164
+ }
7136
7165
  .sia-menu__extra {
7137
7166
  color: var(--sia-color-text-secondary);
7138
7167
  font-size: 12px;
package/dist/core.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { g as Breadcrumb, h as BreadcrumbItem, i as BreadcrumbProps, j as Button, B as ButtonProps, b as ButtonSize, k as ButtonVariant, m as Card, n as CardAccent, o as CardProps, s as Collapse, t as CollapseItem, u as CollapseKey, v as CollapseProps, G as FilledIconName, H as FloatButton, I as FloatButtonBackTopProps, J as FloatButtonGroupProps, K as FloatButtonProps, L as FloatButtonShape, Q as Icon, R as IconName, S as IconProps, U as IconVariant, _ as Input, $ as InputProps, a6 as MessageConfig, a7 as MessageHandle, a8 as MessageKey, a9 as MessageType, aa as Modal, ab as ModalActionResult, ac as ModalOpenConfig, ad as ModalProps, ae as ModalType, a as OverlayApiHandle, am as Progress, an as ProgressProps, ao as ProgressStatus, ar as Segmented, as as SegmentedOption, at as SegmentedProps, au as SegmentedValue, aB as TabItem, aC as Tabs, aE as TabsOrientation, aF as TabsPosition, aG as TabsProps, aH as TabsType, aI as Tag, aJ as TagProps, T as TagStatus, aK as TagVariant, aY as Typography, aZ as TypographyLinkProps, a_ as TypographyProps, a$ as TypographyTitleProps, b0 as TypographyType, b1 as Upload, b2 as UploadChangeInfo, b3 as UploadDraggerProps, b4 as UploadFile, b5 as UploadFileStatus, b6 as UploadProps, b7 as UploadRequestOptions, bb as message } from './core-AeKYVPDZ.cjs';
2
- export { S as Select, c as SelectOption, d as SelectProps, e as SelectValue } from './Select-CVvF4mcy.cjs';
1
+ export { h as Breadcrumb, i as BreadcrumbItem, j as BreadcrumbProps, k as Button, B as ButtonProps, c as ButtonSize, l as ButtonVariant, n as Card, o as CardAccent, p as CardProps, t as Collapse, u as CollapseItem, v as CollapseKey, w as CollapseProps, H as FilledIconName, I as FloatButton, J as FloatButtonBackTopProps, K as FloatButtonGroupProps, L as FloatButtonProps, N as FloatButtonShape, S as Icon, U as IconName, V as IconProps, W as IconVariant, a0 as Input, a1 as InputProps, a8 as MessageConfig, a9 as MessageHandle, aa as MessageKey, ab as MessageType, ac as Modal, b as ModalActionResult, M as ModalOpenConfig, ad as ModalProps, ae as ModalType, a as OverlayApiHandle, am as Progress, an as ProgressProps, ao as ProgressStatus, ar as Segmented, as as SegmentedOption, at as SegmentedProps, au as SegmentedValue, aB as TabItem, aC as Tabs, aE as TabsOrientation, aF as TabsPosition, aG as TabsProps, aH as TabsType, aI as Tag, aJ as TagProps, T as TagStatus, aK as TagVariant, aY as Typography, aZ as TypographyLinkProps, a_ as TypographyProps, a$ as TypographyTitleProps, b0 as TypographyType, b1 as Upload, b2 as UploadChangeInfo, b3 as UploadDraggerProps, b4 as UploadFile, b5 as UploadFileStatus, b6 as UploadProps, b7 as UploadRequestOptions, bb as message } from './core-CM79w-7A.cjs';
2
+ export { c as Select, S as SelectOption, b as SelectProps, e as SelectValue } from './Select-Da9CLN0X.cjs';
3
3
  import 'react';
4
4
  import './shared-DAYZvZVu.cjs';
package/dist/core.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { g as Breadcrumb, h as BreadcrumbItem, i as BreadcrumbProps, j as Button, B as ButtonProps, b as ButtonSize, k as ButtonVariant, m as Card, n as CardAccent, o as CardProps, s as Collapse, t as CollapseItem, u as CollapseKey, v as CollapseProps, G as FilledIconName, H as FloatButton, I as FloatButtonBackTopProps, J as FloatButtonGroupProps, K as FloatButtonProps, L as FloatButtonShape, Q as Icon, R as IconName, S as IconProps, U as IconVariant, _ as Input, $ as InputProps, a6 as MessageConfig, a7 as MessageHandle, a8 as MessageKey, a9 as MessageType, aa as Modal, ab as ModalActionResult, ac as ModalOpenConfig, ad as ModalProps, ae as ModalType, a as OverlayApiHandle, am as Progress, an as ProgressProps, ao as ProgressStatus, ar as Segmented, as as SegmentedOption, at as SegmentedProps, au as SegmentedValue, aB as TabItem, aC as Tabs, aE as TabsOrientation, aF as TabsPosition, aG as TabsProps, aH as TabsType, aI as Tag, aJ as TagProps, T as TagStatus, aK as TagVariant, aY as Typography, aZ as TypographyLinkProps, a_ as TypographyProps, a$ as TypographyTitleProps, b0 as TypographyType, b1 as Upload, b2 as UploadChangeInfo, b3 as UploadDraggerProps, b4 as UploadFile, b5 as UploadFileStatus, b6 as UploadProps, b7 as UploadRequestOptions, bb as message } from './core-DcSXqSRs.js';
2
- export { S as Select, c as SelectOption, d as SelectProps, e as SelectValue } from './Select-Ce2Irbpt.js';
1
+ export { h as Breadcrumb, i as BreadcrumbItem, j as BreadcrumbProps, k as Button, B as ButtonProps, c as ButtonSize, l as ButtonVariant, n as Card, o as CardAccent, p as CardProps, t as Collapse, u as CollapseItem, v as CollapseKey, w as CollapseProps, H as FilledIconName, I as FloatButton, J as FloatButtonBackTopProps, K as FloatButtonGroupProps, L as FloatButtonProps, N as FloatButtonShape, S as Icon, U as IconName, V as IconProps, W as IconVariant, a0 as Input, a1 as InputProps, a8 as MessageConfig, a9 as MessageHandle, aa as MessageKey, ab as MessageType, ac as Modal, b as ModalActionResult, M as ModalOpenConfig, ad as ModalProps, ae as ModalType, a as OverlayApiHandle, am as Progress, an as ProgressProps, ao as ProgressStatus, ar as Segmented, as as SegmentedOption, at as SegmentedProps, au as SegmentedValue, aB as TabItem, aC as Tabs, aE as TabsOrientation, aF as TabsPosition, aG as TabsProps, aH as TabsType, aI as Tag, aJ as TagProps, T as TagStatus, aK as TagVariant, aY as Typography, aZ as TypographyLinkProps, a_ as TypographyProps, a$ as TypographyTitleProps, b0 as TypographyType, b1 as Upload, b2 as UploadChangeInfo, b3 as UploadDraggerProps, b4 as UploadFile, b5 as UploadFileStatus, b6 as UploadProps, b7 as UploadRequestOptions, bb as message } from './core-CdoVqv0o.js';
2
+ export { c as Select, S as SelectOption, b as SelectProps, e as SelectValue } from './Select-Cz3hzQl_.js';
3
3
  import 'react';
4
4
  import './shared-DAYZvZVu.js';
package/dist/core.js CHANGED
@@ -9,17 +9,17 @@ import {
9
9
  Typography,
10
10
  Upload,
11
11
  message
12
- } from "./chunk-KJYKC5IV.js";
12
+ } from "./chunk-3RWL67CK.js";
13
13
  import "./chunk-YT6E3X2K.js";
14
14
  import {
15
15
  Modal,
16
16
  Select
17
- } from "./chunk-VXSG4EAO.js";
17
+ } from "./chunk-4HB6GC24.js";
18
18
  import {
19
19
  Icon,
20
20
  Input,
21
21
  Segmented
22
- } from "./chunk-ALWHRV4L.js";
22
+ } from "./chunk-SUMXP2SF.js";
23
23
  import {
24
24
  Button
25
25
  } from "./chunk-TZGUBGA4.js";