@sia.soul/sia-react-ui 0.1.146 → 0.1.148

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 (40) hide show
  1. package/dist/{Button-C8W8ZHWV.d.ts → Button-B59TIes7.d.ts} +1 -1
  2. package/dist/{Button-CxKBjLda.d.cts → Button-xLR4Yt57.d.cts} +1 -1
  3. package/dist/{Select-bKLket9n.d.cts → Select-DKfT3fJR.d.cts} +1 -1
  4. package/dist/{Select-CTSd8zum.d.ts → Select-Wolx4zNc.d.ts} +1 -1
  5. package/dist/chart.cjs +0 -23
  6. package/dist/chart.js +2 -2
  7. package/dist/{chunk-KDG2P3JA.js → chunk-4PYHSNRA.js} +3 -3
  8. package/dist/{chunk-DEA5BI3R.js → chunk-6SSZVJO4.js} +1 -1
  9. package/dist/{chunk-KSXTC3PD.js → chunk-EZTF5TA2.js} +2 -2
  10. package/dist/{chunk-OTVK3HGP.js → chunk-PU2V3VB5.js} +0 -23
  11. package/dist/{chunk-HPPF5JGF.js → chunk-QLS2IXU4.js} +2 -2
  12. package/dist/{chunk-LY73KGUH.js → chunk-TH7BNDV4.js} +4 -4
  13. package/dist/{chunk-ROV3QYE6.js → chunk-W4HDN7MD.js} +3 -3
  14. package/dist/{chunk-HDN7EEGA.js → chunk-YHVFLSZW.js} +1 -1
  15. package/dist/{core-BbgdopTV.d.ts → core-BJa8K9R8.d.ts} +2 -2
  16. package/dist/{core-8jfdF5IF.d.cts → core-DC4cb_KT.d.cts} +2 -2
  17. package/dist/core.cjs +0 -23
  18. package/dist/core.css +5 -0
  19. package/dist/core.d.cts +3 -3
  20. package/dist/core.d.ts +3 -3
  21. package/dist/core.js +5 -5
  22. package/dist/game.cjs +0 -23
  23. package/dist/game.css +5 -0
  24. package/dist/game.d.cts +1 -1
  25. package/dist/game.d.ts +1 -1
  26. package/dist/game.js +2 -2
  27. package/dist/index.cjs +66 -33
  28. package/dist/index.css +5 -0
  29. package/dist/index.d.cts +10 -8
  30. package/dist/index.d.ts +10 -8
  31. package/dist/index.js +74 -18
  32. package/dist/rich-text-editor.cjs +0 -23
  33. package/dist/rich-text-editor.js +4 -4
  34. package/dist/{select-date-range-Dad0IdD4.d.cts → select-date-range-C5bNGxaY.d.cts} +1 -1
  35. package/dist/{select-date-range-C8cacfmb.d.ts → select-date-range-DfhpX7vv.d.ts} +1 -1
  36. package/dist/select-date-range.cjs +0 -23
  37. package/dist/select-date-range.d.cts +3 -3
  38. package/dist/select-date-range.d.ts +3 -3
  39. package/dist/select-date-range.js +5 -5
  40. package/package.json +1 -1
@@ -38,7 +38,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
38
38
  */
39
39
  iconPosition?: "start" | "end";
40
40
  }
41
- /** 按钮组件;有效点击默认播放 320ms 的缩小、弹起和回稳动效,鼠标、触摸及键盘激活共用此反馈。连续点击从当前缩放继续,onClick 和表单默认行为不等待动画;禁用、加载中或系统减少动态效果时不启动动效。 */
41
+ /** 按钮组件;鼠标、触摸和键盘激活立即执行 onClick 与表单默认行为,主按钮显示点击波纹。禁用或加载中禁止点击。 */
42
42
  declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
43
43
 
44
44
  export { type ButtonProps as B, type ButtonSize as a, Button as b, type ButtonVariant as c };
@@ -38,7 +38,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
38
38
  */
39
39
  iconPosition?: "start" | "end";
40
40
  }
41
- /** 按钮组件;有效点击默认播放 320ms 的缩小、弹起和回稳动效,鼠标、触摸及键盘激活共用此反馈。连续点击从当前缩放继续,onClick 和表单默认行为不等待动画;禁用、加载中或系统减少动态效果时不启动动效。 */
41
+ /** 按钮组件;鼠标、触摸和键盘激活立即执行 onClick 与表单默认行为,主按钮显示点击波纹。禁用或加载中禁止点击。 */
42
42
  declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
43
43
 
44
44
  export { type ButtonProps as B, type ButtonSize as a, Button as b, type ButtonVariant as c };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, ButtonHTMLAttributes } from 'react';
3
3
  import { I as InputPlaceholderMode, C as ControlSize, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
4
- import { B as ButtonProps } from './Button-CxKBjLda.cjs';
4
+ import { B as ButtonProps } from './Button-xLR4Yt57.cjs';
5
5
 
6
6
  /** 弹层挂载节点或返回挂载节点的函数。 */
7
7
  type OverlayContainer = HTMLElement | (() => HTMLElement);
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, ButtonHTMLAttributes } from 'react';
3
3
  import { I as InputPlaceholderMode, C as ControlSize, a as ControlStatus } from './shared-Bx4B28Wh.js';
4
- import { B as ButtonProps } from './Button-C8W8ZHWV.js';
4
+ import { B as ButtonProps } from './Button-B59TIes7.js';
5
5
 
6
6
  /** 弹层挂载节点或返回挂载节点的函数。 */
7
7
  type OverlayContainer = HTMLElement | (() => HTMLElement);
package/dist/chart.cjs CHANGED
@@ -4934,32 +4934,10 @@ var Button = (0, import_react33.forwardRef)(function Button2({
4934
4934
  }, forwardedRef) {
4935
4935
  const size = useControlSize(sizeProp);
4936
4936
  const localRef = (0, import_react33.useRef)(null);
4937
- const bounceRef = (0, import_react33.useRef)(null);
4938
4937
  const waveTimerRef = (0, import_react33.useRef)();
4939
4938
  (0, import_react33.useEffect)(() => () => {
4940
- bounceRef.current?.cancel();
4941
4939
  window.clearTimeout(waveTimerRef.current);
4942
4940
  }, []);
4943
- function playBounce(button) {
4944
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
4945
- const current = getComputedStyle(button).scale;
4946
- bounceRef.current?.cancel();
4947
- const base = getComputedStyle(button).scale;
4948
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
4949
- const scaled = (factor) => `${x * factor} ${y * factor}`;
4950
- const animation = button.animate([
4951
- { scale: current === "none" ? "1" : current, offset: 0 },
4952
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
4953
- { scale: scaled(0.9), offset: 0.2 },
4954
- { scale: scaled(1.09), offset: 0.52 },
4955
- { scale: scaled(0.96), offset: 0.78 },
4956
- { scale: scaled(1), offset: 1 }
4957
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
4958
- bounceRef.current = animation;
4959
- animation.onfinish = () => {
4960
- if (bounceRef.current === animation) bounceRef.current = null;
4961
- };
4962
- }
4963
4941
  function setRef(node) {
4964
4942
  localRef.current = node;
4965
4943
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -4968,7 +4946,6 @@ var Button = (0, import_react33.forwardRef)(function Button2({
4968
4946
  function handleClick(event) {
4969
4947
  const button = localRef.current;
4970
4948
  if (disabled || loading) return;
4971
- if (button) playBounce(button);
4972
4949
  if (button && variant === "primary") {
4973
4950
  const rect = button.getBoundingClientRect();
4974
4951
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
package/dist/chart.js CHANGED
@@ -56,9 +56,9 @@ import {
56
56
  smoothSvgPath,
57
57
  svgArcPath,
58
58
  transferCompositeValue
59
- } from "./chunk-DEA5BI3R.js";
59
+ } from "./chunk-6SSZVJO4.js";
60
60
  import "./chunk-NRLIOMXY.js";
61
- import "./chunk-OTVK3HGP.js";
61
+ import "./chunk-PU2V3VB5.js";
62
62
  import "./chunk-YO5OJQEH.js";
63
63
  import "./chunk-SRWUDTCS.js";
64
64
  export {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  Dropdown,
3
3
  Input
4
- } from "./chunk-KSXTC3PD.js";
4
+ } from "./chunk-EZTF5TA2.js";
5
5
  import {
6
6
  Icon,
7
7
  Modal,
8
8
  isAnchorBehindOverlay,
9
9
  subscribeOverlayLayers
10
- } from "./chunk-HDN7EEGA.js";
10
+ } from "./chunk-YHVFLSZW.js";
11
11
  import {
12
12
  Button
13
- } from "./chunk-OTVK3HGP.js";
13
+ } from "./chunk-PU2V3VB5.js";
14
14
  import {
15
15
  useFloatingPlaceholder
16
16
  } from "./chunk-YO5OJQEH.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-NRLIOMXY.js";
4
4
  import {
5
5
  Button
6
- } from "./chunk-OTVK3HGP.js";
6
+ } from "./chunk-PU2V3VB5.js";
7
7
  import {
8
8
  initializeDefaultScrollbars,
9
9
  withTitleTooltip
@@ -4,10 +4,10 @@ import {
4
4
  import {
5
5
  Icon,
6
6
  Modal
7
- } from "./chunk-HDN7EEGA.js";
7
+ } from "./chunk-YHVFLSZW.js";
8
8
  import {
9
9
  Button
10
- } from "./chunk-OTVK3HGP.js";
10
+ } from "./chunk-PU2V3VB5.js";
11
11
  import {
12
12
  PopupPortal,
13
13
  hasFloatingScrollbarInteraction,
@@ -23,32 +23,10 @@ var Button = forwardRef(function Button2({
23
23
  }, forwardedRef) {
24
24
  const size = useControlSize(sizeProp);
25
25
  const localRef = useRef(null);
26
- const bounceRef = useRef(null);
27
26
  const waveTimerRef = useRef();
28
27
  useEffect(() => () => {
29
- bounceRef.current?.cancel();
30
28
  window.clearTimeout(waveTimerRef.current);
31
29
  }, []);
32
- function playBounce(button) {
33
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
34
- const current = getComputedStyle(button).scale;
35
- bounceRef.current?.cancel();
36
- const base = getComputedStyle(button).scale;
37
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
38
- const scaled = (factor) => `${x * factor} ${y * factor}`;
39
- const animation = button.animate([
40
- { scale: current === "none" ? "1" : current, offset: 0 },
41
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
42
- { scale: scaled(0.9), offset: 0.2 },
43
- { scale: scaled(1.09), offset: 0.52 },
44
- { scale: scaled(0.96), offset: 0.78 },
45
- { scale: scaled(1), offset: 1 }
46
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
47
- bounceRef.current = animation;
48
- animation.onfinish = () => {
49
- if (bounceRef.current === animation) bounceRef.current = null;
50
- };
51
- }
52
30
  function setRef(node) {
53
31
  localRef.current = node;
54
32
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -57,7 +35,6 @@ var Button = forwardRef(function Button2({
57
35
  function handleClick(event) {
58
36
  const button = localRef.current;
59
37
  if (disabled || loading) return;
60
- if (button) playBounce(button);
61
38
  if (button && variant === "primary") {
62
39
  const rect = button.getBoundingClientRect();
63
40
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Select
3
- } from "./chunk-KDG2P3JA.js";
3
+ } from "./chunk-4PYHSNRA.js";
4
4
  import {
5
5
  Icon
6
- } from "./chunk-HDN7EEGA.js";
6
+ } from "./chunk-YHVFLSZW.js";
7
7
  import {
8
8
  useFloatingPlaceholder
9
9
  } from "./chunk-YO5OJQEH.js";
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  Popover,
3
3
  Tooltip
4
- } from "./chunk-KDG2P3JA.js";
4
+ } from "./chunk-4PYHSNRA.js";
5
5
  import {
6
6
  Dropdown
7
- } from "./chunk-KSXTC3PD.js";
7
+ } from "./chunk-EZTF5TA2.js";
8
8
  import {
9
9
  TextArea
10
10
  } from "./chunk-NRLIOMXY.js";
11
11
  import {
12
12
  Icon,
13
13
  useOverlayLifecycle
14
- } from "./chunk-HDN7EEGA.js";
14
+ } from "./chunk-YHVFLSZW.js";
15
15
  import {
16
16
  Button
17
- } from "./chunk-OTVK3HGP.js";
17
+ } from "./chunk-PU2V3VB5.js";
18
18
  import {
19
19
  useControlSize,
20
20
  useControllableState,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Dropdown,
3
3
  Input
4
- } from "./chunk-KSXTC3PD.js";
4
+ } from "./chunk-EZTF5TA2.js";
5
5
  import {
6
6
  Icon
7
- } from "./chunk-HDN7EEGA.js";
7
+ } from "./chunk-YHVFLSZW.js";
8
8
  import {
9
9
  Button
10
- } from "./chunk-OTVK3HGP.js";
10
+ } from "./chunk-PU2V3VB5.js";
11
11
  import {
12
12
  useFloatingPlaceholder
13
13
  } from "./chunk-YO5OJQEH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Button
3
- } from "./chunk-OTVK3HGP.js";
3
+ } from "./chunk-PU2V3VB5.js";
4
4
  import {
5
5
  useOverlayMotion,
6
6
  withTitleTooltip
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
3
- import { B as ButtonProps, b as Button } from './Button-C8W8ZHWV.js';
3
+ import { B as ButtonProps, b as Button } from './Button-B59TIes7.js';
4
4
  import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.js';
5
- import './Select-CTSd8zum.js';
5
+ import './Select-Wolx4zNc.js';
6
6
 
7
7
  /** 单个工具栏操作及其下拉菜单。 */
8
8
  interface ToolbarItem {
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
3
- import { B as ButtonProps, b as Button } from './Button-CxKBjLda.cjs';
3
+ import { B as ButtonProps, b as Button } from './Button-xLR4Yt57.cjs';
4
4
  import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.cjs';
5
- import './Select-bKLket9n.cjs';
5
+ import './Select-DKfT3fJR.cjs';
6
6
 
7
7
  /** 单个工具栏操作及其下拉菜单。 */
8
8
  interface ToolbarItem {
package/dist/core.cjs CHANGED
@@ -1058,32 +1058,10 @@ var Button = (0, import_react6.forwardRef)(function Button2({
1058
1058
  }, forwardedRef) {
1059
1059
  const size = useControlSize(sizeProp);
1060
1060
  const localRef = (0, import_react6.useRef)(null);
1061
- const bounceRef = (0, import_react6.useRef)(null);
1062
1061
  const waveTimerRef = (0, import_react6.useRef)();
1063
1062
  (0, import_react6.useEffect)(() => () => {
1064
- bounceRef.current?.cancel();
1065
1063
  window.clearTimeout(waveTimerRef.current);
1066
1064
  }, []);
1067
- function playBounce(button) {
1068
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
1069
- const current = getComputedStyle(button).scale;
1070
- bounceRef.current?.cancel();
1071
- const base = getComputedStyle(button).scale;
1072
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
1073
- const scaled = (factor) => `${x * factor} ${y * factor}`;
1074
- const animation = button.animate([
1075
- { scale: current === "none" ? "1" : current, offset: 0 },
1076
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
1077
- { scale: scaled(0.9), offset: 0.2 },
1078
- { scale: scaled(1.09), offset: 0.52 },
1079
- { scale: scaled(0.96), offset: 0.78 },
1080
- { scale: scaled(1), offset: 1 }
1081
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
1082
- bounceRef.current = animation;
1083
- animation.onfinish = () => {
1084
- if (bounceRef.current === animation) bounceRef.current = null;
1085
- };
1086
- }
1087
1065
  function setRef(node) {
1088
1066
  localRef.current = node;
1089
1067
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -1092,7 +1070,6 @@ var Button = (0, import_react6.forwardRef)(function Button2({
1092
1070
  function handleClick(event) {
1093
1071
  const button = localRef.current;
1094
1072
  if (disabled || loading) return;
1095
- if (button) playBounce(button);
1096
1073
  if (button && variant === "primary") {
1097
1074
  const rect = button.getBoundingClientRect();
1098
1075
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
package/dist/core.css CHANGED
@@ -5576,6 +5576,11 @@ fieldset:disabled .sia-input-number__floating-placeholder {
5576
5576
  .sia-sortable-list--vertical {
5577
5577
  flex-direction: column;
5578
5578
  }
5579
+ .sia-sortable-list--wrap {
5580
+ flex-wrap: wrap;
5581
+ align-items: flex-start;
5582
+ align-content: flex-start;
5583
+ }
5579
5584
  .sia-sortable-list__item {
5580
5585
  position: relative;
5581
5586
  flex-shrink: 0;
package/dist/core.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-8jfdF5IF.cjs';
2
- export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-CxKBjLda.cjs';
3
- export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-bKLket9n.cjs';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-DC4cb_KT.cjs';
2
+ export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-xLR4Yt57.cjs';
3
+ export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-DKfT3fJR.cjs';
4
4
  import 'react';
5
5
  import './shared-Bx4B28Wh.cjs';
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-BbgdopTV.js';
2
- export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-C8W8ZHWV.js';
3
- export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-CTSd8zum.js';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-BJa8K9R8.js';
2
+ export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-B59TIes7.js';
3
+ export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-Wolx4zNc.js';
4
4
  import 'react';
5
5
  import './shared-Bx4B28Wh.js';
package/dist/core.js CHANGED
@@ -11,24 +11,24 @@ import {
11
11
  Typography,
12
12
  Upload,
13
13
  message
14
- } from "./chunk-LY73KGUH.js";
14
+ } from "./chunk-TH7BNDV4.js";
15
15
  import "./chunk-RX242MUO.js";
16
16
  import {
17
17
  Select
18
- } from "./chunk-KDG2P3JA.js";
18
+ } from "./chunk-4PYHSNRA.js";
19
19
  import {
20
20
  Input,
21
21
  Segmented
22
- } from "./chunk-KSXTC3PD.js";
22
+ } from "./chunk-EZTF5TA2.js";
23
23
  import "./chunk-NRLIOMXY.js";
24
24
  import {
25
25
  Icon,
26
26
  Modal,
27
27
  Skeleton
28
- } from "./chunk-HDN7EEGA.js";
28
+ } from "./chunk-YHVFLSZW.js";
29
29
  import {
30
30
  Button
31
- } from "./chunk-OTVK3HGP.js";
31
+ } from "./chunk-PU2V3VB5.js";
32
32
  import "./chunk-YO5OJQEH.js";
33
33
  import {
34
34
  FloatingScrollbarProvider,
package/dist/game.cjs CHANGED
@@ -1421,32 +1421,10 @@ var Button = (0, import_react6.forwardRef)(function Button2({
1421
1421
  }, forwardedRef) {
1422
1422
  const size = useControlSize(sizeProp);
1423
1423
  const localRef = (0, import_react6.useRef)(null);
1424
- const bounceRef = (0, import_react6.useRef)(null);
1425
1424
  const waveTimerRef = (0, import_react6.useRef)();
1426
1425
  (0, import_react6.useEffect)(() => () => {
1427
- bounceRef.current?.cancel();
1428
1426
  window.clearTimeout(waveTimerRef.current);
1429
1427
  }, []);
1430
- function playBounce(button) {
1431
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
1432
- const current = getComputedStyle(button).scale;
1433
- bounceRef.current?.cancel();
1434
- const base = getComputedStyle(button).scale;
1435
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
1436
- const scaled = (factor) => `${x * factor} ${y * factor}`;
1437
- const animation = button.animate([
1438
- { scale: current === "none" ? "1" : current, offset: 0 },
1439
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
1440
- { scale: scaled(0.9), offset: 0.2 },
1441
- { scale: scaled(1.09), offset: 0.52 },
1442
- { scale: scaled(0.96), offset: 0.78 },
1443
- { scale: scaled(1), offset: 1 }
1444
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
1445
- bounceRef.current = animation;
1446
- animation.onfinish = () => {
1447
- if (bounceRef.current === animation) bounceRef.current = null;
1448
- };
1449
- }
1450
1428
  function setRef(node) {
1451
1429
  localRef.current = node;
1452
1430
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -1455,7 +1433,6 @@ var Button = (0, import_react6.forwardRef)(function Button2({
1455
1433
  function handleClick(event) {
1456
1434
  const button = localRef.current;
1457
1435
  if (disabled || loading) return;
1458
- if (button) playBounce(button);
1459
1436
  if (button && variant === "primary") {
1460
1437
  const rect = button.getBoundingClientRect();
1461
1438
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
package/dist/game.css CHANGED
@@ -5627,6 +5627,11 @@ fieldset:disabled .sia-input-number__floating-placeholder {
5627
5627
  .sia-sortable-list--vertical {
5628
5628
  flex-direction: column;
5629
5629
  }
5630
+ .sia-sortable-list--wrap {
5631
+ flex-wrap: wrap;
5632
+ align-items: flex-start;
5633
+ align-content: flex-start;
5634
+ }
5630
5635
  .sia-sortable-list__item {
5631
5636
  position: relative;
5632
5637
  flex-shrink: 0;
package/dist/game.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { B as ButtonProps } from './Button-CxKBjLda.cjs';
3
+ import { B as ButtonProps } from './Button-xLR4Yt57.cjs';
4
4
  import './shared-Bx4B28Wh.cjs';
5
5
 
6
6
  /** 放置游戏的可序列化数值;攻击、防御、气血均为非负整数。 */
package/dist/game.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { B as ButtonProps } from './Button-C8W8ZHWV.js';
3
+ import { B as ButtonProps } from './Button-B59TIes7.js';
4
4
  import './shared-Bx4B28Wh.js';
5
5
 
6
6
  /** 放置游戏的可序列化数值;攻击、防御、气血均为非负整数。 */
package/dist/game.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import "./chunk-RX242MUO.js";
2
2
  import {
3
3
  Modal
4
- } from "./chunk-HDN7EEGA.js";
4
+ } from "./chunk-YHVFLSZW.js";
5
5
  import {
6
6
  Button
7
- } from "./chunk-OTVK3HGP.js";
7
+ } from "./chunk-PU2V3VB5.js";
8
8
  import {
9
9
  initializeDefaultScrollbars
10
10
  } from "./chunk-SRWUDTCS.js";
package/dist/index.cjs CHANGED
@@ -2395,32 +2395,10 @@ var Button = (0, import_react8.forwardRef)(function Button2({
2395
2395
  }, forwardedRef) {
2396
2396
  const size = useControlSize(sizeProp);
2397
2397
  const localRef = (0, import_react8.useRef)(null);
2398
- const bounceRef = (0, import_react8.useRef)(null);
2399
2398
  const waveTimerRef = (0, import_react8.useRef)();
2400
2399
  (0, import_react8.useEffect)(() => () => {
2401
- bounceRef.current?.cancel();
2402
2400
  window.clearTimeout(waveTimerRef.current);
2403
2401
  }, []);
2404
- function playBounce(button) {
2405
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
2406
- const current = getComputedStyle(button).scale;
2407
- bounceRef.current?.cancel();
2408
- const base = getComputedStyle(button).scale;
2409
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
2410
- const scaled = (factor) => `${x * factor} ${y * factor}`;
2411
- const animation = button.animate([
2412
- { scale: current === "none" ? "1" : current, offset: 0 },
2413
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
2414
- { scale: scaled(0.9), offset: 0.2 },
2415
- { scale: scaled(1.09), offset: 0.52 },
2416
- { scale: scaled(0.96), offset: 0.78 },
2417
- { scale: scaled(1), offset: 1 }
2418
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
2419
- bounceRef.current = animation;
2420
- animation.onfinish = () => {
2421
- if (bounceRef.current === animation) bounceRef.current = null;
2422
- };
2423
- }
2424
2402
  function setRef(node) {
2425
2403
  localRef.current = node;
2426
2404
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -2429,7 +2407,6 @@ var Button = (0, import_react8.forwardRef)(function Button2({
2429
2407
  function handleClick(event) {
2430
2408
  const button = localRef.current;
2431
2409
  if (disabled || loading) return;
2432
- if (button) playBounce(button);
2433
2410
  if (button && variant === "primary") {
2434
2411
  const rect = button.getBoundingClientRect();
2435
2412
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
@@ -3146,7 +3123,7 @@ function FloatingPanel({ open, title, children, placement = "bottomRight" }) {
3146
3123
  children
3147
3124
  ] }), document.body);
3148
3125
  }
3149
- function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", disabled = false, handlePlacement = "before", handleContent }) {
3126
+ function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", wrap = false, disabled = false, handlePlacement = "before", handleContent }) {
3150
3127
  const rootRef = (0, import_react12.useRef)(null);
3151
3128
  const placeholderRef = (0, import_react12.useRef)(null);
3152
3129
  const latest = (0, import_react12.useRef)({ items, onOrderChange });
@@ -3158,6 +3135,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3158
3135
  const root = rootRef.current;
3159
3136
  if (!root) return;
3160
3137
  const horizontal = direction === "horizontal";
3138
+ const wrapping = horizontal && wrap;
3161
3139
  let session = null;
3162
3140
  let frame = 0;
3163
3141
  let settling = null;
@@ -3193,6 +3171,30 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3193
3171
  return offsets;
3194
3172
  };
3195
3173
  const transform = (offset) => horizontal ? `translate3d(${offset}px, 0, 0)` : `translate3d(0, ${offset}px, 0)`;
3174
+ const wrappedOffsets = (s) => {
3175
+ const indices = s.keys.map((_, index) => index);
3176
+ indices.splice(s.from, 1);
3177
+ indices.splice(s.to, 0, s.from);
3178
+ const style = getComputedStyle(root);
3179
+ const gapX = parseFloat(style.columnGap) || 0, gapY = parseFloat(style.rowGap) || 0;
3180
+ const width = root.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);
3181
+ const first = s.rects[0];
3182
+ let x = 0, y = 0, height = 0;
3183
+ const offsets = s.rects.map(() => ({ x: 0, y: 0 }));
3184
+ indices.forEach((index) => {
3185
+ const rect = s.rects[index];
3186
+ if (x > 0 && x + rect.width > width + 0.5) {
3187
+ x = 0;
3188
+ y += height + gapY;
3189
+ height = 0;
3190
+ }
3191
+ offsets[index] = { x: first.left + x - rect.left, y: first.top + y - rect.top };
3192
+ x += rect.width + gapX;
3193
+ height = Math.max(height, rect.height);
3194
+ });
3195
+ return offsets;
3196
+ };
3197
+ const vectorTransform = (point) => `translate3d(${point.x}px, ${point.y}px, 0)`;
3196
3198
  const paint = () => {
3197
3199
  const s = session;
3198
3200
  if (!s || !s.active || settling) return;
@@ -3200,6 +3202,32 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3200
3202
  const coordinate = horizontal ? s.clientX : s.clientY;
3201
3203
  const scroll = horizontal ? root.scrollLeft : root.scrollTop;
3202
3204
  const origin = s.rects[s.from];
3205
+ if (wrapping) {
3206
+ const dx = Math.max(Math.min(...s.rects.map((r) => r.left)) - origin.left, Math.min(Math.max(...s.rects.map((r) => r.right)) - origin.right, s.clientX - s.startX + root.scrollLeft - s.scrollX));
3207
+ const dy = Math.max(Math.min(...s.rects.map((r) => r.top)) - origin.top, Math.min(Math.max(...s.rects.map((r) => r.bottom)) - origin.bottom, s.clientY - s.startY + root.scrollTop - s.scrollY));
3208
+ const cx = origin.left + origin.width / 2 + dx, cy = origin.top + origin.height / 2 + dy;
3209
+ let distance3 = Infinity;
3210
+ s.rects.forEach((rect, index) => {
3211
+ const next = Math.pow(cx - rect.left - rect.width / 2, 2) + Math.pow(cy - rect.top - rect.height / 2, 2);
3212
+ if (next < distance3) {
3213
+ distance3 = next;
3214
+ s.to = index;
3215
+ }
3216
+ });
3217
+ const offsets2 = wrappedOffsets(s);
3218
+ s.nodes.forEach((node, index) => {
3219
+ node.style.transform = vectorTransform(index === s.from ? { x: dx, y: dy } : offsets2[index]);
3220
+ });
3221
+ const preview2 = placeholderRef.current;
3222
+ if (preview2) {
3223
+ preview2.hidden = false;
3224
+ preview2.style.width = `${origin.width}px`;
3225
+ preview2.style.height = `${origin.height}px`;
3226
+ preview2.style.left = `${origin.left - bounds.left + s.scrollX + offsets2[s.from].x}px`;
3227
+ preview2.style.top = `${origin.top - bounds.top + s.scrollY + offsets2[s.from].y}px`;
3228
+ }
3229
+ return;
3230
+ }
3203
3231
  const first = s.rects[0];
3204
3232
  const last = s.rects[s.rects.length - 1];
3205
3233
  const minimum = horizontal ? first.left - origin.left : first.top - origin.top;
@@ -3225,15 +3253,16 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3225
3253
  const s = session;
3226
3254
  if (!s || !s.active || settling) return;
3227
3255
  const bounds = root.getBoundingClientRect();
3228
- const point = horizontal ? s.clientX : s.clientY;
3229
- const start = horizontal ? bounds.left : bounds.top;
3230
- const end = horizontal ? bounds.right : bounds.bottom;
3231
- const crossInside = horizontal ? s.clientY >= bounds.top && s.clientY <= bounds.bottom : s.clientX >= bounds.left && s.clientX <= bounds.right;
3256
+ const scrollHorizontal = horizontal && !wrapping;
3257
+ const point = scrollHorizontal ? s.clientX : s.clientY;
3258
+ const start = scrollHorizontal ? bounds.left : bounds.top;
3259
+ const end = scrollHorizontal ? bounds.right : bounds.bottom;
3260
+ const crossInside = scrollHorizontal ? s.clientY >= bounds.top && s.clientY <= bounds.bottom : s.clientX >= bounds.left && s.clientX <= bounds.right;
3232
3261
  const edge = 44;
3233
3262
  const speed = !crossInside || point < start || point > end ? 0 : point < start + edge ? -Math.min(1, (start + edge - point) / edge) : point > end - edge ? Math.min(1, (point - end + edge) / edge) : 0;
3234
3263
  const distance3 = speed * Math.min(32, time - (lastTime || time)) * 0.65;
3235
3264
  lastTime = time;
3236
- if (horizontal) root.scrollLeft += distance3;
3265
+ if (scrollHorizontal) root.scrollLeft += distance3;
3237
3266
  else root.scrollTop += distance3;
3238
3267
  paint();
3239
3268
  frame = requestAnimationFrame(tick);
@@ -3256,6 +3285,10 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3256
3285
  start: horizontal ? event.clientX : event.clientY,
3257
3286
  clientX: event.clientX,
3258
3287
  clientY: event.clientY,
3288
+ startX: event.clientX,
3289
+ startY: event.clientY,
3290
+ scrollX: root.scrollLeft,
3291
+ scrollY: root.scrollTop,
3259
3292
  scroll: horizontal ? root.scrollLeft : root.scrollTop,
3260
3293
  active: false
3261
3294
  };
@@ -3266,7 +3299,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3266
3299
  if (!s || settling || event.pointerId !== s.pointer) return;
3267
3300
  s.clientX = event.clientX;
3268
3301
  s.clientY = event.clientY;
3269
- if (!s.active && Math.abs((horizontal ? event.clientX : event.clientY) - s.start) >= 4) {
3302
+ if (!s.active && (wrapping ? Math.hypot(event.clientX - s.startX, event.clientY - s.startY) : Math.abs((horizontal ? event.clientX : event.clientY) - s.start)) >= 4) {
3270
3303
  s.active = true;
3271
3304
  root.classList.add("is-sorting");
3272
3305
  s.nodes[s.from].classList.add("is-dragging");
@@ -3307,7 +3340,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3307
3340
  return;
3308
3341
  }
3309
3342
  const node = s.nodes[s.from];
3310
- settling = node.animate([{ transform: node.style.transform }, { transform: transform(displacement(s)[s.from]) }], { duration: 160, easing: "cubic-bezier(.2,.8,.2,1)", fill: "forwards" });
3343
+ settling = node.animate([{ transform: node.style.transform }, { transform: wrapping ? vectorTransform(wrappedOffsets(s)[s.from]) : transform(displacement(s)[s.from]) }], { duration: 160, easing: "cubic-bezier(.2,.8,.2,1)", fill: "forwards" });
3311
3344
  settling.finished.then(finish, () => {
3312
3345
  });
3313
3346
  };
@@ -3348,8 +3381,8 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
3348
3381
  root.removeEventListener("lostpointercapture", cancelPointer);
3349
3382
  root.removeEventListener("click", cancelClick, true);
3350
3383
  };
3351
- }, [disabled, direction, signature]);
3352
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: rootRef, className: `sia-sortable-list sia-sortable-list--${direction}`, role: "list", children: [
3384
+ }, [disabled, direction, wrap, signature]);
3385
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: rootRef, className: `sia-sortable-list sia-sortable-list--${direction}${wrap && direction === "horizontal" ? " sia-sortable-list--wrap" : ""}`, role: "list", children: [
3353
3386
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: placeholderRef, className: "sia-sortable-list__placeholder", "aria-hidden": "true", hidden: true }),
3354
3387
  items.map((key, index) => {
3355
3388
  const handle = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
package/dist/index.css CHANGED
@@ -5576,6 +5576,11 @@ fieldset:disabled .sia-input-number__floating-placeholder {
5576
5576
  .sia-sortable-list--vertical {
5577
5577
  flex-direction: column;
5578
5578
  }
5579
+ .sia-sortable-list--wrap {
5580
+ flex-wrap: wrap;
5581
+ align-items: flex-start;
5582
+ align-content: flex-start;
5583
+ }
5579
5584
  .sia-sortable-list__item {
5580
5585
  position: relative;
5581
5586
  flex-shrink: 0;
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, VideoHTMLAttributes } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-8jfdF5IF.cjs';
4
- export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-8jfdF5IF.cjs';
3
+ import { T as TagStatus, B as BadgeProps } from './core-DC4cb_KT.cjs';
4
+ export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-DC4cb_KT.cjs';
5
5
  import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
6
- import { B as ButtonProps, a as ButtonSize } from './Button-CxKBjLda.cjs';
7
- export { b as Button, c as ButtonVariant } from './Button-CxKBjLda.cjs';
8
- import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult } from './Select-bKLket9n.cjs';
9
- export { e as Modal, f as ModalProps, g as ModalType, h as Select, i as SelectMode, j as SelectValue } from './Select-bKLket9n.cjs';
10
- export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-Dad0IdD4.cjs';
6
+ import { B as ButtonProps, a as ButtonSize } from './Button-xLR4Yt57.cjs';
7
+ export { b as Button, c as ButtonVariant } from './Button-xLR4Yt57.cjs';
8
+ import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult } from './Select-DKfT3fJR.cjs';
9
+ export { e as Modal, f as ModalProps, g as ModalType, h as Select, i as SelectMode, j as SelectValue } from './Select-DKfT3fJR.cjs';
10
+ export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-C5bNGxaY.cjs';
11
11
  export { RichTextContent, RichTextContentFormat, RichTextContentProps, RichTextEditor, RichTextEditorProps, RichTextImagePasteHandler, RichTextToolbar } from './rich-text-editor.cjs';
12
12
  export { MarkdownEditor, MarkdownEditorMode, MarkdownEditorProps } from './markdown-editor.cjs';
13
13
  import * as Monaco from 'monaco-editor';
@@ -92,11 +92,13 @@ interface SortableListProps {
92
92
  onOrderChange: (items: SortableKey[]) => void;
93
93
  /** 排列及拖动轴;按轴移动至少 4px 开始预览,相邻项以 180ms 让位,靠近列表滚动边缘自动滚动。仅由手柄发起,不影响内部输入;减少动态效果时相邻项直接定位。@defaultValue "horizontal" */
94
94
  direction?: "horizontal" | "vertical";
95
+ /** 横向列表按容器宽度自动换行,拖动时同时预览横纵位置;方向键左右移动一项。vertical 时忽略。@defaultValue false */
96
+ wrap?: boolean;
95
97
  /** 禁止拖放和键盘排序,不禁用条目内部业务控件。@defaultValue false */
96
98
  disabled?: boolean;
97
99
  }
98
100
  /** 拖放与键盘共用受控顺序;指针预览不重挂载内容,也不改变 renderItem 的业务索引。 */
99
- declare function SortableList({ items, renderItem, onOrderChange, direction, disabled, handlePlacement, handleContent }: SortableListProps): react.JSX.Element;
101
+ declare function SortableList({ items, renderItem, onOrderChange, direction, wrap, disabled, handlePlacement, handleContent }: SortableListProps): react.JSX.Element;
100
102
 
101
103
  /** 警告提示的状态类型。 */
102
104
  type AlertStatus = "info" | "success" | "warning" | "error";
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, VideoHTMLAttributes } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-BbgdopTV.js';
4
- export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-BbgdopTV.js';
3
+ import { T as TagStatus, B as BadgeProps } from './core-BJa8K9R8.js';
4
+ export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-BJa8K9R8.js';
5
5
  import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
6
- import { B as ButtonProps, a as ButtonSize } from './Button-C8W8ZHWV.js';
7
- export { b as Button, c as ButtonVariant } from './Button-C8W8ZHWV.js';
8
- import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult } from './Select-CTSd8zum.js';
9
- export { e as Modal, f as ModalProps, g as ModalType, h as Select, i as SelectMode, j as SelectValue } from './Select-CTSd8zum.js';
10
- export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-C8cacfmb.js';
6
+ import { B as ButtonProps, a as ButtonSize } from './Button-B59TIes7.js';
7
+ export { b as Button, c as ButtonVariant } from './Button-B59TIes7.js';
8
+ import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult } from './Select-Wolx4zNc.js';
9
+ export { e as Modal, f as ModalProps, g as ModalType, h as Select, i as SelectMode, j as SelectValue } from './Select-Wolx4zNc.js';
10
+ export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-DfhpX7vv.js';
11
11
  export { RichTextContent, RichTextContentFormat, RichTextContentProps, RichTextEditor, RichTextEditorProps, RichTextImagePasteHandler, RichTextToolbar } from './rich-text-editor.js';
12
12
  export { MarkdownEditor, MarkdownEditorMode, MarkdownEditorProps } from './markdown-editor.js';
13
13
  import * as Monaco from 'monaco-editor';
@@ -92,11 +92,13 @@ interface SortableListProps {
92
92
  onOrderChange: (items: SortableKey[]) => void;
93
93
  /** 排列及拖动轴;按轴移动至少 4px 开始预览,相邻项以 180ms 让位,靠近列表滚动边缘自动滚动。仅由手柄发起,不影响内部输入;减少动态效果时相邻项直接定位。@defaultValue "horizontal" */
94
94
  direction?: "horizontal" | "vertical";
95
+ /** 横向列表按容器宽度自动换行,拖动时同时预览横纵位置;方向键左右移动一项。vertical 时忽略。@defaultValue false */
96
+ wrap?: boolean;
95
97
  /** 禁止拖放和键盘排序,不禁用条目内部业务控件。@defaultValue false */
96
98
  disabled?: boolean;
97
99
  }
98
100
  /** 拖放与键盘共用受控顺序;指针预览不重挂载内容,也不改变 renderItem 的业务索引。 */
99
- declare function SortableList({ items, renderItem, onOrderChange, direction, disabled, handlePlacement, handleContent }: SortableListProps): react.JSX.Element;
101
+ declare function SortableList({ items, renderItem, onOrderChange, direction, wrap, disabled, handlePlacement, handleContent }: SortableListProps): react.JSX.Element;
100
102
 
101
103
  /** 警告提示的状态类型。 */
102
104
  type AlertStatus = "info" | "success" | "warning" | "error";
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@ import {
56
56
  smoothSvgPath,
57
57
  svgArcPath,
58
58
  transferCompositeValue
59
- } from "./chunk-DEA5BI3R.js";
59
+ } from "./chunk-6SSZVJO4.js";
60
60
  import {
61
61
  Badge,
62
62
  Breadcrumb,
@@ -82,7 +82,7 @@ import {
82
82
  Watermark,
83
83
  message,
84
84
  notification
85
- } from "./chunk-LY73KGUH.js";
85
+ } from "./chunk-TH7BNDV4.js";
86
86
  import "./chunk-RX242MUO.js";
87
87
  import {
88
88
  MarkdownEditor
@@ -90,12 +90,12 @@ import {
90
90
  import {
91
91
  RichTextContent,
92
92
  RichTextEditor
93
- } from "./chunk-ROV3QYE6.js";
93
+ } from "./chunk-W4HDN7MD.js";
94
94
  import {
95
95
  DatePicker,
96
96
  SelectDateRange,
97
97
  TimePanel
98
- } from "./chunk-HPPF5JGF.js";
98
+ } from "./chunk-QLS2IXU4.js";
99
99
  import {
100
100
  Checkbox,
101
101
  OverflowTags,
@@ -107,14 +107,14 @@ import {
107
107
  Tree,
108
108
  normalizeSelectionValues,
109
109
  usePressFeedback
110
- } from "./chunk-KDG2P3JA.js";
110
+ } from "./chunk-4PYHSNRA.js";
111
111
  import {
112
112
  Dropdown,
113
113
  Input,
114
114
  Menu,
115
115
  Segmented,
116
116
  Steps
117
- } from "./chunk-KSXTC3PD.js";
117
+ } from "./chunk-EZTF5TA2.js";
118
118
  import {
119
119
  TextArea
120
120
  } from "./chunk-NRLIOMXY.js";
@@ -128,10 +128,10 @@ import {
128
128
  Skeleton,
129
129
  useOverlayExitPlaceholder,
130
130
  useOverlayLifecycle
131
- } from "./chunk-HDN7EEGA.js";
131
+ } from "./chunk-YHVFLSZW.js";
132
132
  import {
133
133
  Button
134
- } from "./chunk-OTVK3HGP.js";
134
+ } from "./chunk-PU2V3VB5.js";
135
135
  import {
136
136
  useFloatingPlaceholder
137
137
  } from "./chunk-YO5OJQEH.js";
@@ -309,7 +309,7 @@ function FloatingPanel({ open, title, children, placement = "bottomRight" }) {
309
309
  children
310
310
  ] }), document.body);
311
311
  }
312
- function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", disabled = false, handlePlacement = "before", handleContent }) {
312
+ function SortableList({ items, renderItem, onOrderChange, direction = "horizontal", wrap = false, disabled = false, handlePlacement = "before", handleContent }) {
313
313
  const rootRef = useRef2(null);
314
314
  const placeholderRef = useRef2(null);
315
315
  const latest = useRef2({ items, onOrderChange });
@@ -321,6 +321,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
321
321
  const root = rootRef.current;
322
322
  if (!root) return;
323
323
  const horizontal = direction === "horizontal";
324
+ const wrapping = horizontal && wrap;
324
325
  let session = null;
325
326
  let frame = 0;
326
327
  let settling = null;
@@ -356,6 +357,30 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
356
357
  return offsets;
357
358
  };
358
359
  const transform = (offset) => horizontal ? `translate3d(${offset}px, 0, 0)` : `translate3d(0, ${offset}px, 0)`;
360
+ const wrappedOffsets = (s) => {
361
+ const indices = s.keys.map((_, index) => index);
362
+ indices.splice(s.from, 1);
363
+ indices.splice(s.to, 0, s.from);
364
+ const style = getComputedStyle(root);
365
+ const gapX = parseFloat(style.columnGap) || 0, gapY = parseFloat(style.rowGap) || 0;
366
+ const width = root.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);
367
+ const first = s.rects[0];
368
+ let x = 0, y = 0, height = 0;
369
+ const offsets = s.rects.map(() => ({ x: 0, y: 0 }));
370
+ indices.forEach((index) => {
371
+ const rect = s.rects[index];
372
+ if (x > 0 && x + rect.width > width + 0.5) {
373
+ x = 0;
374
+ y += height + gapY;
375
+ height = 0;
376
+ }
377
+ offsets[index] = { x: first.left + x - rect.left, y: first.top + y - rect.top };
378
+ x += rect.width + gapX;
379
+ height = Math.max(height, rect.height);
380
+ });
381
+ return offsets;
382
+ };
383
+ const vectorTransform = (point) => `translate3d(${point.x}px, ${point.y}px, 0)`;
359
384
  const paint = () => {
360
385
  const s = session;
361
386
  if (!s || !s.active || settling) return;
@@ -363,6 +388,32 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
363
388
  const coordinate = horizontal ? s.clientX : s.clientY;
364
389
  const scroll = horizontal ? root.scrollLeft : root.scrollTop;
365
390
  const origin = s.rects[s.from];
391
+ if (wrapping) {
392
+ const dx = Math.max(Math.min(...s.rects.map((r) => r.left)) - origin.left, Math.min(Math.max(...s.rects.map((r) => r.right)) - origin.right, s.clientX - s.startX + root.scrollLeft - s.scrollX));
393
+ const dy = Math.max(Math.min(...s.rects.map((r) => r.top)) - origin.top, Math.min(Math.max(...s.rects.map((r) => r.bottom)) - origin.bottom, s.clientY - s.startY + root.scrollTop - s.scrollY));
394
+ const cx = origin.left + origin.width / 2 + dx, cy = origin.top + origin.height / 2 + dy;
395
+ let distance = Infinity;
396
+ s.rects.forEach((rect, index) => {
397
+ const next = Math.pow(cx - rect.left - rect.width / 2, 2) + Math.pow(cy - rect.top - rect.height / 2, 2);
398
+ if (next < distance) {
399
+ distance = next;
400
+ s.to = index;
401
+ }
402
+ });
403
+ const offsets2 = wrappedOffsets(s);
404
+ s.nodes.forEach((node, index) => {
405
+ node.style.transform = vectorTransform(index === s.from ? { x: dx, y: dy } : offsets2[index]);
406
+ });
407
+ const preview2 = placeholderRef.current;
408
+ if (preview2) {
409
+ preview2.hidden = false;
410
+ preview2.style.width = `${origin.width}px`;
411
+ preview2.style.height = `${origin.height}px`;
412
+ preview2.style.left = `${origin.left - bounds.left + s.scrollX + offsets2[s.from].x}px`;
413
+ preview2.style.top = `${origin.top - bounds.top + s.scrollY + offsets2[s.from].y}px`;
414
+ }
415
+ return;
416
+ }
366
417
  const first = s.rects[0];
367
418
  const last = s.rects[s.rects.length - 1];
368
419
  const minimum = horizontal ? first.left - origin.left : first.top - origin.top;
@@ -388,15 +439,16 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
388
439
  const s = session;
389
440
  if (!s || !s.active || settling) return;
390
441
  const bounds = root.getBoundingClientRect();
391
- const point = horizontal ? s.clientX : s.clientY;
392
- const start = horizontal ? bounds.left : bounds.top;
393
- const end = horizontal ? bounds.right : bounds.bottom;
394
- const crossInside = horizontal ? s.clientY >= bounds.top && s.clientY <= bounds.bottom : s.clientX >= bounds.left && s.clientX <= bounds.right;
442
+ const scrollHorizontal = horizontal && !wrapping;
443
+ const point = scrollHorizontal ? s.clientX : s.clientY;
444
+ const start = scrollHorizontal ? bounds.left : bounds.top;
445
+ const end = scrollHorizontal ? bounds.right : bounds.bottom;
446
+ const crossInside = scrollHorizontal ? s.clientY >= bounds.top && s.clientY <= bounds.bottom : s.clientX >= bounds.left && s.clientX <= bounds.right;
395
447
  const edge = 44;
396
448
  const speed = !crossInside || point < start || point > end ? 0 : point < start + edge ? -Math.min(1, (start + edge - point) / edge) : point > end - edge ? Math.min(1, (point - end + edge) / edge) : 0;
397
449
  const distance = speed * Math.min(32, time - (lastTime || time)) * 0.65;
398
450
  lastTime = time;
399
- if (horizontal) root.scrollLeft += distance;
451
+ if (scrollHorizontal) root.scrollLeft += distance;
400
452
  else root.scrollTop += distance;
401
453
  paint();
402
454
  frame = requestAnimationFrame(tick);
@@ -419,6 +471,10 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
419
471
  start: horizontal ? event.clientX : event.clientY,
420
472
  clientX: event.clientX,
421
473
  clientY: event.clientY,
474
+ startX: event.clientX,
475
+ startY: event.clientY,
476
+ scrollX: root.scrollLeft,
477
+ scrollY: root.scrollTop,
422
478
  scroll: horizontal ? root.scrollLeft : root.scrollTop,
423
479
  active: false
424
480
  };
@@ -429,7 +485,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
429
485
  if (!s || settling || event.pointerId !== s.pointer) return;
430
486
  s.clientX = event.clientX;
431
487
  s.clientY = event.clientY;
432
- if (!s.active && Math.abs((horizontal ? event.clientX : event.clientY) - s.start) >= 4) {
488
+ if (!s.active && (wrapping ? Math.hypot(event.clientX - s.startX, event.clientY - s.startY) : Math.abs((horizontal ? event.clientX : event.clientY) - s.start)) >= 4) {
433
489
  s.active = true;
434
490
  root.classList.add("is-sorting");
435
491
  s.nodes[s.from].classList.add("is-dragging");
@@ -470,7 +526,7 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
470
526
  return;
471
527
  }
472
528
  const node = s.nodes[s.from];
473
- settling = node.animate([{ transform: node.style.transform }, { transform: transform(displacement(s)[s.from]) }], { duration: 160, easing: "cubic-bezier(.2,.8,.2,1)", fill: "forwards" });
529
+ settling = node.animate([{ transform: node.style.transform }, { transform: wrapping ? vectorTransform(wrappedOffsets(s)[s.from]) : transform(displacement(s)[s.from]) }], { duration: 160, easing: "cubic-bezier(.2,.8,.2,1)", fill: "forwards" });
474
530
  settling.finished.then(finish, () => {
475
531
  });
476
532
  };
@@ -511,8 +567,8 @@ function SortableList({ items, renderItem, onOrderChange, direction = "horizonta
511
567
  root.removeEventListener("lostpointercapture", cancelPointer);
512
568
  root.removeEventListener("click", cancelClick, true);
513
569
  };
514
- }, [disabled, direction, signature]);
515
- return /* @__PURE__ */ jsxs2("div", { ref: rootRef, className: `sia-sortable-list sia-sortable-list--${direction}`, role: "list", children: [
570
+ }, [disabled, direction, wrap, signature]);
571
+ return /* @__PURE__ */ jsxs2("div", { ref: rootRef, className: `sia-sortable-list sia-sortable-list--${direction}${wrap && direction === "horizontal" ? " sia-sortable-list--wrap" : ""}`, role: "list", children: [
516
572
  /* @__PURE__ */ jsx2("div", { ref: placeholderRef, className: "sia-sortable-list__placeholder", "aria-hidden": "true", hidden: true }),
517
573
  items.map((key, index) => {
518
574
  const handle = /* @__PURE__ */ jsx2(
@@ -1060,32 +1060,10 @@ var Button = (0, import_react6.forwardRef)(function Button2({
1060
1060
  }, forwardedRef) {
1061
1061
  const size = useControlSize(sizeProp);
1062
1062
  const localRef = (0, import_react6.useRef)(null);
1063
- const bounceRef = (0, import_react6.useRef)(null);
1064
1063
  const waveTimerRef = (0, import_react6.useRef)();
1065
1064
  (0, import_react6.useEffect)(() => () => {
1066
- bounceRef.current?.cancel();
1067
1065
  window.clearTimeout(waveTimerRef.current);
1068
1066
  }, []);
1069
- function playBounce(button) {
1070
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
1071
- const current = getComputedStyle(button).scale;
1072
- bounceRef.current?.cancel();
1073
- const base = getComputedStyle(button).scale;
1074
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
1075
- const scaled = (factor) => `${x * factor} ${y * factor}`;
1076
- const animation = button.animate([
1077
- { scale: current === "none" ? "1" : current, offset: 0 },
1078
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
1079
- { scale: scaled(0.9), offset: 0.2 },
1080
- { scale: scaled(1.09), offset: 0.52 },
1081
- { scale: scaled(0.96), offset: 0.78 },
1082
- { scale: scaled(1), offset: 1 }
1083
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
1084
- bounceRef.current = animation;
1085
- animation.onfinish = () => {
1086
- if (bounceRef.current === animation) bounceRef.current = null;
1087
- };
1088
- }
1089
1067
  function setRef(node) {
1090
1068
  localRef.current = node;
1091
1069
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -1094,7 +1072,6 @@ var Button = (0, import_react6.forwardRef)(function Button2({
1094
1072
  function handleClick(event) {
1095
1073
  const button = localRef.current;
1096
1074
  if (disabled || loading) return;
1097
- if (button) playBounce(button);
1098
1075
  if (button && variant === "primary") {
1099
1076
  const rect = button.getBoundingClientRect();
1100
1077
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  RichTextContent,
3
3
  RichTextEditor
4
- } from "./chunk-ROV3QYE6.js";
5
- import "./chunk-KSXTC3PD.js";
4
+ } from "./chunk-W4HDN7MD.js";
5
+ import "./chunk-EZTF5TA2.js";
6
6
  import "./chunk-NRLIOMXY.js";
7
- import "./chunk-HDN7EEGA.js";
8
- import "./chunk-OTVK3HGP.js";
7
+ import "./chunk-YHVFLSZW.js";
8
+ import "./chunk-PU2V3VB5.js";
9
9
  import "./chunk-YO5OJQEH.js";
10
10
  import {
11
11
  initializeDefaultScrollbars
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { InputHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties } from 'react';
3
3
  import { I as InputPlaceholderMode, C as ControlSize, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
4
- import { S as SelectOption, j as SelectValue } from './Select-bKLket9n.cjs';
4
+ import { S as SelectOption, j as SelectValue } from './Select-DKfT3fJR.cjs';
5
5
 
6
6
  /** 日期选择附带的时间选择配置。 */
7
7
  type DatePickerShowTime = boolean | {
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { InputHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties } from 'react';
3
3
  import { I as InputPlaceholderMode, C as ControlSize, a as ControlStatus } from './shared-Bx4B28Wh.js';
4
- import { S as SelectOption, j as SelectValue } from './Select-CTSd8zum.js';
4
+ import { S as SelectOption, j as SelectValue } from './Select-Wolx4zNc.js';
5
5
 
6
6
  /** 日期选择附带的时间选择配置。 */
7
7
  type DatePickerShowTime = boolean | {
@@ -3185,32 +3185,10 @@ var Button = (0, import_react11.forwardRef)(function Button2({
3185
3185
  }, forwardedRef) {
3186
3186
  const size = useControlSize(sizeProp);
3187
3187
  const localRef = (0, import_react11.useRef)(null);
3188
- const bounceRef = (0, import_react11.useRef)(null);
3189
3188
  const waveTimerRef = (0, import_react11.useRef)();
3190
3189
  (0, import_react11.useEffect)(() => () => {
3191
- bounceRef.current?.cancel();
3192
3190
  window.clearTimeout(waveTimerRef.current);
3193
3191
  }, []);
3194
- function playBounce(button) {
3195
- if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
3196
- const current = getComputedStyle(button).scale;
3197
- bounceRef.current?.cancel();
3198
- const base = getComputedStyle(button).scale;
3199
- const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
3200
- const scaled = (factor) => `${x * factor} ${y * factor}`;
3201
- const animation = button.animate([
3202
- { scale: current === "none" ? "1" : current, offset: 0 },
3203
- // 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
3204
- { scale: scaled(0.9), offset: 0.2 },
3205
- { scale: scaled(1.09), offset: 0.52 },
3206
- { scale: scaled(0.96), offset: 0.78 },
3207
- { scale: scaled(1), offset: 1 }
3208
- ], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
3209
- bounceRef.current = animation;
3210
- animation.onfinish = () => {
3211
- if (bounceRef.current === animation) bounceRef.current = null;
3212
- };
3213
- }
3214
3192
  function setRef(node) {
3215
3193
  localRef.current = node;
3216
3194
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -3219,7 +3197,6 @@ var Button = (0, import_react11.forwardRef)(function Button2({
3219
3197
  function handleClick(event) {
3220
3198
  const button = localRef.current;
3221
3199
  if (disabled || loading) return;
3222
- if (button) playBounce(button);
3223
3200
  if (button && variant === "primary") {
3224
3201
  const rect = button.getBoundingClientRect();
3225
3202
  button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
@@ -1,5 +1,5 @@
1
- export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-Dad0IdD4.cjs';
1
+ export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-C5bNGxaY.cjs';
2
2
  import 'react';
3
3
  import './shared-Bx4B28Wh.cjs';
4
- import './Select-bKLket9n.cjs';
5
- import './Button-CxKBjLda.cjs';
4
+ import './Select-DKfT3fJR.cjs';
5
+ import './Button-xLR4Yt57.cjs';
@@ -1,5 +1,5 @@
1
- export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-C8cacfmb.js';
1
+ export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-DfhpX7vv.js';
2
2
  import 'react';
3
3
  import './shared-Bx4B28Wh.js';
4
- import './Select-CTSd8zum.js';
5
- import './Button-C8W8ZHWV.js';
4
+ import './Select-Wolx4zNc.js';
5
+ import './Button-B59TIes7.js';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  SelectDateRange
3
- } from "./chunk-HPPF5JGF.js";
4
- import "./chunk-KDG2P3JA.js";
5
- import "./chunk-KSXTC3PD.js";
3
+ } from "./chunk-QLS2IXU4.js";
4
+ import "./chunk-4PYHSNRA.js";
5
+ import "./chunk-EZTF5TA2.js";
6
6
  import "./chunk-NRLIOMXY.js";
7
- import "./chunk-HDN7EEGA.js";
8
- import "./chunk-OTVK3HGP.js";
7
+ import "./chunk-YHVFLSZW.js";
8
+ import "./chunk-PU2V3VB5.js";
9
9
  import "./chunk-YO5OJQEH.js";
10
10
  import {
11
11
  initializeDefaultScrollbars
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.146",
3
+ "version": "0.1.148",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",