@unicom-cloud/ui 0.8.100 → 0.8.102

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 (301) hide show
  1. package/Badge.js +7 -54
  2. package/Copy.js +5 -4
  3. package/Details.js +13 -2
  4. package/Divider.js +3 -2
  5. package/Flex.js +14 -4
  6. package/LiquidFill.js +5 -4
  7. package/List.js +1 -1
  8. package/Loading.js +16 -3
  9. package/Marquee.js +5 -4
  10. package/QrCode.js +5 -4
  11. package/Space.js +3 -3
  12. package/Splitter.js +4 -3
  13. package/SuspenseFallbackTest.js +2 -4
  14. package/Tooltip.js +3 -4
  15. package/Tour.js +5 -4
  16. package/alert/index.js +60 -62
  17. package/anchor/Anchor.js +12 -12
  18. package/anchor/util.js +10 -10
  19. package/back-top/index.js +33 -34
  20. package/badge/index.js +109 -162
  21. package/calendar/index.js +85 -84
  22. package/card/index.js +63 -43
  23. package/color-picker/InputHex.js +3 -4
  24. package/color-picker/InputRgb.js +7 -8
  25. package/color-picker/Palette.js +3 -4
  26. package/color-picker/Panel.js +3 -4
  27. package/color-picker/colors.js +5 -5
  28. package/color-picker/hooks/useColorPicker.js +3 -4
  29. package/color-picker/utils.js +14 -15
  30. package/components/common/development/index.js +44 -29
  31. package/components/common/empty/index.js +35 -23
  32. package/components/common/flex/index.js +64 -0
  33. package/components/common/flex/interface.js +9 -0
  34. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  35. package/components/common/space/index.js +71 -91
  36. package/components/common/suspense-fallback-test/index.js +16 -0
  37. package/components/common/utils/PqbCSSTransition.js +1 -1
  38. package/components/common/utils/constant.js +6 -3
  39. package/components/common/utils/reactDOM.js +6 -4
  40. package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
  41. package/components/common/utils/setPrimaryColor.js +18 -18
  42. package/components/common/utils/setTheme.js +8 -9
  43. package/components/common/utils/toArray.js +12 -0
  44. package/copy/index.js +3 -2
  45. package/details/index.js +102 -62
  46. package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
  47. package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
  48. package/dist/scroll-into-view-if-needed/src/index.js +19 -19
  49. package/divider/index.js +27 -21
  50. package/empty/index.js +13 -13
  51. package/flex/index.js +43 -55
  52. package/flex/interface.js +1 -34
  53. package/form/FormItem.js +69 -65
  54. package/form/context.js +6 -7
  55. package/grid/Col-.js +86 -0
  56. package/grid/Col.js +156 -73
  57. package/grid/Grid.js +71 -67
  58. package/grid/Row.js +3 -3
  59. package/grid/index.js +13 -13
  60. package/icon/interface.js +1 -0
  61. package/icon-hover/interface.js +1 -0
  62. package/index.js +641 -663
  63. package/input/Textarea.js +1 -1
  64. package/input/autoSizeTextAreaHeight.js +7 -7
  65. package/liquid-fill/index.js +5 -4
  66. package/list/index.js +1 -1
  67. package/loading/index.js +72 -53
  68. package/loading/interface.js +1 -0
  69. package/marquee/index.js +5 -4
  70. package/menu/Item.js +9 -9
  71. package/modal/Modal.js +73 -74
  72. package/package.json +1 -1
  73. package/portal/interface.js +1 -0
  74. package/qr-code/index.js +5 -4
  75. package/segmented/index.js +47 -47
  76. package/space/index.js +41 -35
  77. package/speech-synthesis/interface.js +1 -0
  78. package/splitter/SplitBar.js +81 -79
  79. package/splitter/Splitter.js +92 -104
  80. package/splitter/hooks/useItems.js +1 -1
  81. package/splitter/hooks/useResizable.js +9 -18
  82. package/splitter/hooks/useResize.js +10 -10
  83. package/splitter/hooks/useSizes.js +28 -28
  84. package/splitter/index.js +5 -4
  85. package/statistic/index.js +10 -10
  86. package/style.css +1 -1
  87. package/suspense-fallback-test/index.js +2 -11
  88. package/suspense-fallback-test/interface.js +1 -0
  89. package/table/Table.js +376 -377
  90. package/table/hook/useThResizable.js +5 -4
  91. package/table/th-resizable/index.js +12 -11
  92. package/time-picker/util.js +8 -8
  93. package/tooltip/index.js +1 -2
  94. package/tour/index.js +5 -4
  95. package/tree/NodeList.js +1 -1
  96. package/trigger/index.js +67 -70
  97. package/types/common/development/index.d.ts +7 -1
  98. package/types/common/development/interface.d.ts +22 -0
  99. package/types/common/empty/index.d.ts +2 -1
  100. package/types/common/flex/index.d.ts +14 -0
  101. package/types/common/flex/interface.d.ts +62 -0
  102. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  103. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  104. package/types/common/space/index.d.ts +4 -4
  105. package/types/common/space/interface.d.ts +10 -18
  106. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  107. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  108. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  109. package/types/common/utils/constant.d.ts +1 -0
  110. package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
  111. package/types/common/utils/toArray.d.ts +13 -0
  112. package/types/common/utils/tree.d.ts +1 -0
  113. package/types/common/utils/tween.d.ts +1 -0
  114. package/types/pc/alert/index.d.ts +2 -1
  115. package/types/pc/alert/interface.d.ts +7 -1
  116. package/types/pc/anchor/util.d.ts +1 -1
  117. package/types/pc/badge/Count.d.ts +1 -1
  118. package/types/pc/badge/interface.d.ts +2 -0
  119. package/types/pc/breadcrumb/Item.d.ts +1 -1
  120. package/types/pc/calendar/Month.d.ts +1 -1
  121. package/types/pc/calendar/WeekList.d.ts +1 -1
  122. package/types/pc/calendar/Year.d.ts +1 -1
  123. package/types/pc/calendar/header/Panel.d.ts +1 -1
  124. package/types/pc/calendar/header/index.d.ts +1 -1
  125. package/types/pc/calendar/index.d.ts +1 -1
  126. package/types/pc/calendar/interface.d.ts +2 -1
  127. package/types/pc/card/interface.d.ts +8 -0
  128. package/types/pc/cascader/interface.d.ts +1 -1
  129. package/types/pc/cascader/panel/List.d.ts +1 -1
  130. package/types/pc/cascader/panel/Option.d.ts +1 -1
  131. package/types/pc/cascader/panel/Search.d.ts +1 -1
  132. package/types/pc/checkbox/Group.d.ts +2 -2
  133. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  134. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  135. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  136. package/types/pc/color-picker/Palette.d.ts +1 -1
  137. package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
  138. package/types/pc/color-picker/utils.d.ts +6 -1
  139. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  140. package/types/pc/config-provider/interface.d.ts +4 -0
  141. package/types/pc/copy/index.d.ts +1 -1
  142. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  143. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  144. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  145. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  146. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  147. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  148. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  149. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  150. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  151. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  152. package/types/pc/descriptions/index.d.ts +1 -1
  153. package/types/pc/details/index.d.ts +3 -2
  154. package/types/pc/details/interface.d.ts +16 -0
  155. package/types/pc/development/index.d.ts +2 -1
  156. package/types/pc/development/interface.d.ts +15 -0
  157. package/types/pc/divider/index.d.ts +7 -2
  158. package/types/pc/draggable/Item.d.ts +1 -1
  159. package/types/pc/draggable/index.d.ts +1 -1
  160. package/types/pc/flex/index.d.ts +4 -4
  161. package/types/pc/flex/interface.d.ts +8 -53
  162. package/types/pc/form/Control.d.ts +1 -1
  163. package/types/pc/form/FormItem.d.ts +1 -1
  164. package/types/pc/form/FormList.d.ts +1 -1
  165. package/types/pc/form/IconSymbol.d.ts +1 -1
  166. package/types/pc/grid/Col-.d.ts +4 -0
  167. package/types/pc/grid/Col.d.ts +3 -2
  168. package/types/pc/grid/Grid.d.ts +2 -2
  169. package/types/pc/grid/Item.d.ts +3 -3
  170. package/types/pc/grid/Row.d.ts +2 -2
  171. package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
  172. package/types/pc/grid/interface.d.ts +13 -7
  173. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  174. package/types/pc/icon/index.d.ts +2 -7
  175. package/types/pc/icon/interface.d.ts +13 -0
  176. package/types/pc/icon-hover/index.d.ts +2 -8
  177. package/types/pc/icon-hover/interface.d.ts +8 -0
  178. package/types/pc/image/ImageFooter.d.ts +1 -1
  179. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  180. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  181. package/types/pc/index.d.ts +60 -51
  182. package/types/pc/loading/index.d.ts +4 -3
  183. package/types/pc/loading/interface.d.ts +6 -0
  184. package/types/pc/menu/Indent.d.ts +1 -1
  185. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  186. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  187. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  188. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  189. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  190. package/types/pc/pagination/PageItem.d.ts +3 -3
  191. package/types/pc/pagination/PageJumper.d.ts +1 -1
  192. package/types/pc/pagination/PageOption.d.ts +1 -1
  193. package/types/pc/portal/Portal.d.ts +2 -6
  194. package/types/pc/portal/index.d.ts +2 -9
  195. package/types/pc/portal/interface.d.ts +14 -0
  196. package/types/pc/progress/CircleProgress.d.ts +1 -1
  197. package/types/pc/progress/LineProgess.d.ts +1 -1
  198. package/types/pc/progress/StepProgress.d.ts +1 -1
  199. package/types/pc/radio/Group.d.ts +2 -2
  200. package/types/pc/radio/GroupBlock.d.ts +1 -1
  201. package/types/pc/radio/Radio.d.ts +1 -1
  202. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  203. package/types/pc/result/403.d.ts +1 -1
  204. package/types/pc/result/404.d.ts +1 -1
  205. package/types/pc/result/500.d.ts +1 -1
  206. package/types/pc/segmented/interface.d.ts +6 -6
  207. package/types/pc/skeleton/Image.d.ts +1 -1
  208. package/types/pc/skeleton/Text.d.ts +2 -1
  209. package/types/pc/slider/Button.d.ts +1 -1
  210. package/types/pc/slider/Input.d.ts +1 -1
  211. package/types/pc/slider/Tick.d.ts +1 -1
  212. package/types/pc/space/index.d.ts +6 -5
  213. package/types/pc/speech-synthesis/index.d.ts +3 -1
  214. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  215. package/types/pc/spin/DotLoading.d.ts +1 -1
  216. package/types/pc/splitter/SplitBar.d.ts +0 -1
  217. package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
  218. package/types/pc/splitter/hooks/useResize.d.ts +1 -2
  219. package/types/pc/splitter/index.d.ts +5 -4
  220. package/types/pc/splitter/interface.d.ts +16 -24
  221. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  222. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  223. package/types/pc/table/ColGroup.d.ts +1 -1
  224. package/types/pc/table/summary/Cell.d.ts +1 -1
  225. package/types/pc/table/summary/Row.d.ts +1 -1
  226. package/types/pc/table/tbody/Td.d.ts +1 -1
  227. package/types/pc/table/tbody/index.d.ts +1 -1
  228. package/types/pc/table/tfoot/index.d.ts +1 -1
  229. package/types/pc/table/th-resizable/index.d.ts +1 -1
  230. package/types/pc/table/thead/Column.d.ts +1 -1
  231. package/types/pc/table/thead/index.d.ts +1 -1
  232. package/types/pc/tabs/TabContent.d.ts +1 -1
  233. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  234. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  235. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  236. package/types/pc/time-picker/Picker.d.ts +1 -1
  237. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  238. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  239. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  240. package/types/pc/time-picker/index.d.ts +1 -1
  241. package/types/pc/tour/index.d.ts +1 -1
  242. package/types/pc/transfer/Item.d.ts +1 -1
  243. package/types/pc/transfer/List.d.ts +1 -1
  244. package/types/pc/tree/Animation.d.ts +1 -1
  245. package/types/pc/typography/Operations.d.ts +1 -1
  246. package/types/pc/upload/interface.d.ts +1 -0
  247. package/types/pc/upload/list/index.d.ts +1 -1
  248. package/types/pc/utils/constant.d.ts +1 -2
  249. package/types/pc/utils/dayjs.d.ts +2 -1
  250. package/types/pc/utils/index.d.ts +2 -5
  251. package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
  252. package/types/pc/utils/toArray.d.ts +1 -5
  253. package/types/pc/utils/tree.d.ts +2 -1
  254. package/types/pc/utils/tween.d.ts +1 -1
  255. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  256. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  257. package/types/pc/virtual-list/index.d.ts +2 -1
  258. package/types/pc/virtual-list/interface.d.ts +56 -0
  259. package/types/pc/watermark/Watermark.d.ts +1 -1
  260. package/typography/Ellipsis.js +5 -4
  261. package/typography/Operations.js +5 -4
  262. package/upload/request.js +12 -13
  263. package/upload/request_.js +2 -3
  264. package/utils/constant.js +5 -5
  265. package/utils/dayjs.js +13 -12
  266. package/utils/index.js +261 -284
  267. package/utils/scrollIntoViewIfNeeded.js +12 -0
  268. package/utils/toArray.js +3 -10
  269. package/utils/tree.js +11 -9
  270. package/utils/tween.js +5 -5
  271. package/version/index.js +1 -1
  272. package/virtual-list/interface.js +1 -0
  273. package/components/common/space/toArray.js +0 -11
  274. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  275. package/dist/compute-scroll-into-view/src/index.js +0 -126
  276. package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
  277. package/dist/tinycolor/customize/index.js +0 -12
  278. package/dist/tinycolor/src/conversion.js +0 -143
  279. package/dist/tinycolor/src/css-color-names.js +0 -153
  280. package/dist/tinycolor/src/format-input.js +0 -77
  281. package/dist/tinycolor/src/index.js +0 -388
  282. package/dist/tinycolor/src/util.js +0 -32
  283. package/flex/utils.js +0 -13
  284. package/loading/style/index.module.less.js +0 -4
  285. package/types/common/space/toArray.d.ts +0 -3
  286. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  287. package/types/common/utils/scrollIntoView.d.ts +0 -4
  288. package/types/common/utils/tinycolor.d.ts +0 -1
  289. package/types/pc/flex/utils.d.ts +0 -9
  290. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  291. package/types/pc/utils/color.d.ts +0 -1
  292. package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
  293. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  294. package/types/pc/utils/scrollIntoView.d.ts +0 -3
  295. package/types/pc/utils/tinycolor.d.ts +0 -1
  296. package/utils/color.js +0 -4
  297. package/utils/computeScrollIntoView.js +0 -6
  298. package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  299. package/utils/scrollIntoView.js +0 -6
  300. package/utils/tinycolor.js +0 -29
  301. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
package/space/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as C, useContext as d } from "react";
3
- import u, { SpaceVertical as x } from "../components/common/space/index.js";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as s, useContext as S } from "react";
3
+ import x from "../components/common/space/index.js";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import "lodash/isEqualWith";
6
6
  import "../components/common/utils/is.js";
@@ -13,39 +13,45 @@ import N from "../components/common/hooks/useMergeProps.js";
13
13
  import "../components/common/utils/reactDOM.js";
14
14
  import "@unicom-cloud/utils/constant";
15
15
  import "lodash/debounce";
16
- import S from "@unicom-cloud/utils/class-name";
17
- import $ from "../config-provider/context.js";
18
- const g = {
16
+ import g from "@unicom-cloud/utils/class-name";
17
+ import u from "../config-provider/context.js";
18
+ const $ = {
19
19
  size: "small",
20
20
  direction: "horizontal"
21
- };
22
- function w(e, i) {
23
- const { getPrefixCls: m, componentConfig: s, rtl: a } = d($), c = N(
24
- e,
25
- g,
26
- s?.Space
27
- ), { className: n, direction: o, wrap: t, ...f } = c, r = m?.("space");
28
- return /* @__PURE__ */ l(
29
- u,
30
- {
31
- ref: i,
32
- className: S(
33
- r,
34
- t && `${r}-wrap`,
35
- o && `${r}-${o}`,
36
- n
37
- ),
38
- direction: o,
39
- wrap: t,
40
- rtl: a,
41
- ...f
42
- }
43
- );
44
- }
45
- const p = C(w);
46
- p.displayName = "Space";
47
- p.Vertical = x;
21
+ }, i = s(
22
+ (o, t) => {
23
+ const { getPrefixCls: c, componentConfig: n, rtl: l } = S(u), f = N(
24
+ o,
25
+ $,
26
+ n?.Space
27
+ ), { className: d, direction: r = "horizontal", wrap: p, ...C } = f, e = c?.("space");
28
+ return /* @__PURE__ */ a(
29
+ x,
30
+ {
31
+ ref: t,
32
+ className: g(
33
+ e,
34
+ {
35
+ [`${e}-wrap`]: p,
36
+ [`${e}-${r}`]: r
37
+ },
38
+ d
39
+ ),
40
+ direction: r,
41
+ wrap: p,
42
+ rtl: l,
43
+ ...C
44
+ }
45
+ );
46
+ }
47
+ );
48
+ i.displayName = "Space";
49
+ const m = s((o, t) => /* @__PURE__ */ a(i, { ref: t, direction: "vertical", ...o }));
50
+ m.displayName = "SpaceVertical";
51
+ const E = Object.assign(i, {
52
+ Vertical: m
53
+ });
48
54
  export {
49
- x as SpaceVertical,
50
- p as default
55
+ m as SpaceVertical,
56
+ E as default
51
57
  };
@@ -0,0 +1 @@
1
+
@@ -1,127 +1,129 @@
1
- import { jsxs as H, jsx as l } from "react/jsx-runtime";
2
- import J from "@unicom-cloud/icons/IconUiDown";
3
- import K from "@unicom-cloud/icons/IconUiLeft";
4
- import Q from "@unicom-cloud/icons/IconUiRight";
5
- import W from "@unicom-cloud/icons/IconUiUp";
6
- import x from "react";
1
+ import { jsxs as G, jsx as l } from "react/jsx-runtime";
2
+ import H from "@unicom-cloud/icons/IconUiDown";
3
+ import J from "@unicom-cloud/icons/IconUiLeft";
4
+ import K from "@unicom-cloud/icons/IconUiRight";
5
+ import Q from "@unicom-cloud/icons/IconUiUp";
6
+ import E from "react";
7
7
  import "../config-provider/ConfigProvider.js";
8
- import d from "@unicom-cloud/utils/class-name";
9
- import y from "./hooks/useEvent.js";
10
- import Z from "../config-provider/context.js";
11
- function L(f) {
12
- return typeof f == "number" && !Number.isNaN(f) ? Math.round(f) : 0;
8
+ import f from "@unicom-cloud/utils/class-name";
9
+ import Y from "./hooks/useEvent.js";
10
+ import W from "../config-provider/context.js";
11
+ function O(d) {
12
+ return typeof d == "number" && !Number.isNaN(d) ? Math.round(d) : 0;
13
13
  }
14
- const le = (f) => {
15
- const { getPrefixCls: z } = x.useContext(Z), {
14
+ const ie = (d) => {
15
+ const { getPrefixCls: y } = E.useContext(W), {
16
16
  prefixCls: I,
17
- vertical: n,
18
- index: s,
19
- active: T,
17
+ vertical: s,
18
+ index: n,
19
+ active: z,
20
20
  ariaNow: $,
21
- ariaMin: C,
22
- ariaMax: E,
23
- resizable: M,
24
- startCollapsible: j,
25
- endCollapsible: k,
26
- onOffsetStart: O,
27
- onOffsetUpdate: N,
28
- onOffsetEnd: b,
29
- onCollapse: S,
21
+ ariaMin: M,
22
+ ariaMax: N,
23
+ startCollapsible: T,
24
+ endCollapsible: j,
25
+ onOffsetStart: S,
26
+ onOffsetUpdate: v,
27
+ onOffsetEnd: h,
28
+ onCollapse: P,
30
29
  lazy: a,
31
30
  containerSize: m
32
- } = f, e = z?.("bar", I), [r, v] = x.useState(
31
+ } = d, e = y?.("bar", I), [r, w] = E.useState(
33
32
  null
34
- ), [h, P] = x.useState(0), A = n ? 0 : h, D = n ? h : 0, R = (t) => {
35
- M && t.currentTarget && (v([t.pageX, t.pageY]), O(s));
36
- }, V = (t) => {
37
- if (M && t.touches.length === 1) {
33
+ ), [g, U] = E.useState(0), k = s ? 0 : g, A = s ? g : 0, D = (t) => {
34
+ t.currentTarget && (w([t.pageX, t.pageY]), S(n));
35
+ }, R = (t) => {
36
+ if (t.touches.length === 1) {
38
37
  const o = t.touches[0];
39
- v([o.pageX, o.pageY]), O(s);
38
+ w([o.pageX, o.pageY]), S(n);
40
39
  }
41
- }, B = (t) => {
42
- const o = m * $ / 100, c = o + t, w = Math.max(0, m * C / 100), i = Math.min(m, m * E / 100);
43
- return Math.max(w, Math.min(i, c)) - o;
44
- }, U = y((t, o) => {
45
- const c = B(
46
- n ? o : t
40
+ }, V = (t) => {
41
+ const o = m * $ / 100, c = o + t, x = Math.max(0, m * M / 100), i = Math.min(m, m * N / 100);
42
+ return Math.max(x, Math.min(i, c)) - o;
43
+ }, L = Y((t, o) => {
44
+ const c = V(
45
+ s ? o : t
47
46
  );
48
- P(c);
49
- }), X = y(() => {
50
- N(s, A, D, !0), P(0), b(!0);
47
+ U(c);
48
+ }), b = Y(() => {
49
+ v(n, k, A, !0), U(0), h(!0);
51
50
  });
52
- x.useEffect(() => {
51
+ E.useEffect(() => {
53
52
  if (r) {
54
53
  const t = (i) => {
55
- const { pageX: u, pageY: g } = i, p = u - r[0], Y = g - r[1];
56
- a ? U(p, Y) : N(s, p, Y);
54
+ const { pageX: u, pageY: C } = i, p = u - r[0], X = C - r[1];
55
+ a ? L(p, X) : v(n, p, X);
57
56
  }, o = () => {
58
- a ? X() : b(), v(null);
57
+ a ? b() : h(), w(null);
59
58
  }, c = (i) => {
60
59
  if (i.touches.length === 1) {
61
- const u = i.touches[0], g = u.pageX - r[0], p = u.pageY - r[1];
62
- a ? U(g, p) : N(s, g, p);
60
+ const u = i.touches[0], C = u.pageX - r[0], p = u.pageY - r[1];
61
+ a ? L(C, p) : v(n, C, p);
63
62
  }
64
- }, w = () => {
65
- a ? X() : b(), v(null);
63
+ }, x = () => {
64
+ a ? b() : h(), w(null);
66
65
  };
67
- return window.addEventListener("touchmove", c), window.addEventListener("touchend", w), window.addEventListener("mousemove", t), window.addEventListener("mouseup", o), () => {
68
- window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", o), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", w);
66
+ return window.addEventListener("touchmove", c), window.addEventListener("touchend", x), window.addEventListener("mousemove", t), window.addEventListener("mouseup", o), () => {
67
+ window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", o), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", x);
69
68
  };
70
69
  }
71
70
  }, [
72
71
  r,
73
72
  a,
74
- n,
75
73
  s,
74
+ n,
76
75
  m,
77
76
  $,
78
- C,
79
- E
77
+ M,
78
+ N,
79
+ L,
80
+ v,
81
+ b,
82
+ h
80
83
  ]);
81
- const q = {
82
- [`--${e}-preview-offset`]: `${h}px`
83
- }, F = n ? W : K, G = n ? J : Q;
84
- return /* @__PURE__ */ H(
84
+ const B = {
85
+ [`--${e}-preview-offset`]: `${g}px`
86
+ }, q = s ? Q : J, F = s ? H : K;
87
+ return /* @__PURE__ */ G(
85
88
  "div",
86
89
  {
87
90
  className: e,
88
91
  role: "separator",
89
- "aria-valuenow": L($),
90
- "aria-valuemin": L(C),
91
- "aria-valuemax": L(E),
92
+ "aria-valuenow": O($),
93
+ "aria-valuemin": O(M),
94
+ "aria-valuemax": O(N),
92
95
  children: [
93
96
  a && /* @__PURE__ */ l(
94
97
  "div",
95
98
  {
96
- className: d(`${e}-preview`, {
97
- [`${e}-preview-active`]: !!h
99
+ className: f(`${e}-preview`, {
100
+ [`${e}-preview-active`]: !!g
98
101
  }),
99
- style: q
102
+ style: B
100
103
  }
101
104
  ),
102
105
  /* @__PURE__ */ l(
103
106
  "div",
104
107
  {
105
- className: d(`${e}-dragger`, {
106
- [`${e}-dragger-disabled`]: !M,
107
- [`${e}-dragger-active`]: T
108
+ className: f(`${e}-dragger`, {
109
+ [`${e}-dragger-active`]: z
108
110
  }),
109
- onMouseDown: R,
110
- onTouchStart: V
111
+ onMouseDown: D,
112
+ onTouchStart: R
111
113
  }
112
114
  ),
113
- j && /* @__PURE__ */ l(
115
+ T && /* @__PURE__ */ l(
114
116
  "div",
115
117
  {
116
- className: d(
118
+ className: f(
117
119
  `${e}-collapse-bar`,
118
120
  `${e}-collapse-bar-start`
119
121
  ),
120
- onClick: () => S(s, "start"),
122
+ onClick: () => P(n, "start"),
121
123
  children: /* @__PURE__ */ l(
122
- F,
124
+ q,
123
125
  {
124
- className: d(
126
+ className: f(
125
127
  `${e}-collapse-icon`,
126
128
  `${e}-collapse-start`
127
129
  )
@@ -129,18 +131,18 @@ const le = (f) => {
129
131
  )
130
132
  }
131
133
  ),
132
- k && /* @__PURE__ */ l(
134
+ j && /* @__PURE__ */ l(
133
135
  "div",
134
136
  {
135
- className: d(
137
+ className: f(
136
138
  `${e}-collapse-bar`,
137
139
  `${e}-collapse-bar-end`
138
140
  ),
139
- onClick: () => S(s, "end"),
141
+ onClick: () => P(n, "end"),
140
142
  children: /* @__PURE__ */ l(
141
- G,
143
+ F,
142
144
  {
143
- className: d(
145
+ className: f(
144
146
  `${e}-collapse-icon`,
145
147
  `${e}-collapse-end`
146
148
  )
@@ -153,5 +155,5 @@ const le = (f) => {
153
155
  );
154
156
  };
155
157
  export {
156
- le as default
158
+ ie as default
157
159
  };
@@ -1,139 +1,127 @@
1
- import { jsxs as I, jsx as g } from "react/jsx-runtime";
2
- import p, { useState as ce, useRef as fe, useEffect as me, useImperativeHandle as pe } from "react";
1
+ import { jsxs as v, jsx as h } from "react/jsx-runtime";
2
+ import m, { useState as re, useRef as ie, useEffect as ae, useImperativeHandle as le } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
- import ue from "../components/common/hooks/useMergeProps.js";
5
- import P from "@unicom-cloud/utils/class-name";
6
- import { resizeObserver as ze } from "../components/common/utils/resizeObserver.js";
7
- import m from "./hooks/useEvent.js";
8
- import Se from "./hooks/useItems.js";
9
- import Ce from "./hooks/useResizable.js";
10
- import de from "./hooks/useResize.js";
11
- import he from "./hooks/useSizes.js";
12
- import { InternalPanel as ge } from "./Panel.js";
13
- import Re from "./SplitBar.js";
14
- import Me from "../config-provider/context.js";
15
- const be = {
4
+ import ce from "../components/common/hooks/useMergeProps.js";
5
+ import fe from "@unicom-cloud/utils/class-name";
6
+ import { resizeObserver as me } from "../components/common/utils/resizeObserver.js";
7
+ import f from "./hooks/useEvent.js";
8
+ import pe from "./hooks/useItems.js";
9
+ import ue from "./hooks/useResizable.js";
10
+ import ze from "./hooks/useResize.js";
11
+ import Se from "./hooks/useSizes.js";
12
+ import { InternalPanel as Ce } from "./Panel.js";
13
+ import de from "./SplitBar.js";
14
+ import he from "../config-provider/context.js";
15
+ const ge = {
16
16
  layout: "horizontal"
17
17
  };
18
- function Ne(O, $) {
19
- const { getPrefixCls: x, componentConfig: y, rtl: k } = p.useContext(Me), H = ue(
20
- O,
21
- be,
22
- y?.Splitter
18
+ function Me(P, E) {
19
+ const { getPrefixCls: N, componentConfig: O, rtl: l } = m.useContext(he), x = ce(
20
+ P,
21
+ ge,
22
+ O?.Splitter
23
23
  ), {
24
- prefixCls: U,
25
- className: j,
26
- style: w,
27
- layout: u = "horizontal",
28
- children: B,
29
- rootClassName: D,
30
- onResizeStart: V,
31
- onResize: R,
32
- onResizeEnd: z,
33
- lazy: W,
34
- ...F
35
- } = H, n = x?.("splitter", U), l = u === "vertical", c = k, r = Se(B), [S, L] = ce(), o = fe(null), T = () => {
36
- const t = o.current?.offsetWidth, e = o.current?.offsetHeight, s = l ? e : t;
37
- s !== 0 && L(s);
24
+ prefixCls: y,
25
+ className: $,
26
+ style: k,
27
+ layout: g = "horizontal",
28
+ children: H,
29
+ onResizeStart: U,
30
+ onResize: M,
31
+ onResizeEnd: p,
32
+ lazy: j,
33
+ ...w
34
+ } = x, s = N?.("splitter", y), c = g === "vertical", o = pe(H), [u, B] = re(), r = ie(null), W = () => {
35
+ const t = r.current?.offsetWidth, e = r.current?.offsetHeight, n = c ? e : t;
36
+ n !== 0 && B(n);
38
37
  }, [
39
- _,
40
- C,
41
- d,
42
- M,
43
- b,
44
- q
45
- ] = he(r, S), N = Ce(r, C, c), [A, G, J, K, v] = de(
46
- r,
47
- N,
48
- d,
38
+ D,
39
+ z,
49
40
  S,
50
- q,
51
- c
52
- ), Q = m((t) => {
53
- A(t), V?.(C);
54
- }), X = m(
55
- (t, e, s) => {
56
- const a = G(t, e);
57
- s ? z?.(a) : R?.(a);
41
+ R,
42
+ I,
43
+ F
44
+ ] = Se(o, u), V = ue(o, z, l), [q, A, G, J, b] = ze(o, S, u, F, l), K = f((t) => {
45
+ q(t), U?.(z);
46
+ }), L = f(
47
+ (t, e, n) => {
48
+ const a = A(t, e);
49
+ n ? p?.(a) : M?.(a);
58
50
  }
59
- ), Y = m((t) => {
60
- J(), t || z?.(C);
61
- }), Z = m(
51
+ ), Q = f((t) => {
52
+ G(), t || p?.(z);
53
+ }), T = f(
62
54
  (t, e) => {
63
- const s = K(t, e);
64
- R?.(s), z?.(s);
55
+ const n = J(t, e);
56
+ M?.(n), p?.(n);
65
57
  }
66
- ), ee = P(
67
- n,
68
- j,
69
- `${n}-${u}`,
70
- {
71
- [`${n}-rtl`]: c
72
- },
73
- D
74
- ), E = `${n}-mask`, i = p.useMemo(() => {
58
+ ), X = fe(
59
+ s,
60
+ $,
61
+ `${s}-${g}`,
62
+ l && [`${s}-rtl`]
63
+ ), i = m.useMemo(() => {
75
64
  const t = [];
76
65
  let e = 0;
77
- for (let s = 0; s < r.length; s += 1)
78
- e += d[s], t.push(e);
66
+ for (let n = 0; n < o.length; n += 1)
67
+ e += S[n], t.push(e);
79
68
  return t;
80
- }, [d]);
81
- return me(() => {
82
- const t = ze([o.current], () => {
83
- T();
69
+ }, [S, o.length]);
70
+ return ae(() => {
71
+ const t = me([r.current], () => {
72
+ W();
84
73
  });
85
74
  return () => {
86
75
  t();
87
76
  };
88
- }, [o.current]), pe($, () => ({ dom: o.current })), /* @__PURE__ */ I("div", { style: w, className: ee, ref: o, ...F, children: [
89
- r.map((t, e) => {
90
- const s = /* @__PURE__ */ g(
91
- ge,
77
+ }, [r.current]), le(E, () => ({ dom: r.current })), /* @__PURE__ */ v("div", { style: k, className: X, ref: r, ...w, children: [
78
+ o.map((t, e) => {
79
+ const n = /* @__PURE__ */ h(
80
+ Ce,
92
81
  {
93
82
  ...t,
94
- prefixCls: n,
95
- size: _[e]
83
+ prefixCls: s,
84
+ size: D[e]
96
85
  }
97
86
  );
98
87
  let a = null;
99
- const f = N[e];
100
- if (f) {
101
- const te = (i[e - 1] || 0) + M[e], se = (i[e + 1] || 100) - b[e + 1], ne = (i[e - 1] || 0) + b[e], oe = (i[e + 1] || 100) - M[e + 1];
102
- a = /* @__PURE__ */ g(
103
- Re,
88
+ const C = V[e];
89
+ if (C) {
90
+ const Y = (i[e - 1] || 0) + R[e], Z = (i[e + 1] || 100) - I[e + 1], _ = (i[e - 1] || 0) + I[e], ee = (i[e + 1] || 100) - R[e + 1];
91
+ a = /* @__PURE__ */ h(
92
+ de,
104
93
  {
105
- lazy: W,
94
+ lazy: j,
106
95
  index: e,
107
- active: v === e,
108
- prefixCls: n,
109
- vertical: l,
110
- resizable: f.resizable,
96
+ active: b === e,
97
+ prefixCls: s,
98
+ vertical: c,
111
99
  ariaNow: i[e] * 100,
112
- ariaMin: Math.max(te, se) * 100,
113
- ariaMax: Math.min(ne, oe) * 100,
114
- startCollapsible: f.startCollapsible,
115
- endCollapsible: f.endCollapsible,
116
- onOffsetStart: Q,
117
- onOffsetUpdate: (re, ie, ae, le) => {
118
- let h = l ? ae : ie;
119
- c && !l && (h = -h), X(re, h, le);
100
+ ariaMin: Math.max(Y, Z) * 100,
101
+ ariaMax: Math.min(_, ee) * 100,
102
+ startCollapsible: C.startCollapsible,
103
+ endCollapsible: C.endCollapsible,
104
+ onOffsetStart: K,
105
+ onOffsetUpdate: (te, ne, se, oe) => {
106
+ let d = c ? se : ne;
107
+ l && !c && (d = -d), L(te, d, oe);
120
108
  },
121
- onOffsetEnd: Y,
122
- onCollapse: Z,
123
- containerSize: S || 0
109
+ onOffsetEnd: Q,
110
+ onCollapse: T,
111
+ containerSize: u || 0
124
112
  }
125
113
  );
126
114
  }
127
- return /* @__PURE__ */ I(p.Fragment, { children: [
128
- s,
115
+ return /* @__PURE__ */ v(m.Fragment, { children: [
116
+ n,
129
117
  a
130
118
  ] }, `split-panel-${e}`);
131
119
  }),
132
- typeof v == "number" && /* @__PURE__ */ g("div", { "aria-hidden": !0, className: P(E, `${E}-${u}`) })
120
+ typeof b == "number" && /* @__PURE__ */ h("div", { "aria-hidden": !0, className: `${s}-mask` })
133
121
  ] });
134
122
  }
135
- const ve = p.forwardRef(Ne);
136
- process.env.NODE_ENV !== "production" && (ve.displayName = "Splitter");
123
+ const Re = m.forwardRef(Me);
124
+ Re.displayName = "Splitter";
137
125
  export {
138
- ve as default
126
+ Re as default
139
127
  };
@@ -1,5 +1,5 @@
1
1
  import o from "react";
2
- import { toArray as i } from "../../utils/toArray.js";
2
+ import { toArray as i } from "../../components/common/utils/toArray.js";
3
3
  function p(t) {
4
4
  if (t && typeof t == "object")
5
5
  return t;
@@ -1,26 +1,17 @@
1
- import v from "react";
2
- function I(l, s, o) {
3
- return v.useMemo(() => {
1
+ import C from "react";
2
+ function v(t, l, n) {
3
+ return C.useMemo(() => {
4
4
  const r = [];
5
- for (let e = 0; e < l.length - 1; e += 1) {
6
- const p = l[e], u = l[e + 1], t = s[e], n = s[e + 1], {
7
- resizable: z = !0,
8
- min: d,
9
- collapsible: a
10
- } = p, {
11
- resizable: C = !0,
12
- min: f,
13
- collapsible: i
14
- } = u, m = z && C && (t !== 0 || !d) && (n !== 0 || !f), b = a.end && t > 0 || i.start && n === 0 && t > 0, c = i.start && n > 0 || a.end && t === 0 && n > 0;
5
+ for (let e = 0; e < t.length - 1; e += 1) {
6
+ const b = t[e], u = t[e + 1], o = l[e], s = l[e + 1], { min: d, collapsible: a } = b, { min: f, collapsible: c } = u, i = a.end && o > 0 || c.start && s === 0 && o > 0, p = c.start && s > 0 || a.end && o === 0 && s > 0;
15
7
  r[e] = {
16
- resizable: m,
17
- startCollapsible: !!(o ? c : b),
18
- endCollapsible: !!(o ? b : c)
8
+ startCollapsible: !!(n ? p : i),
9
+ endCollapsible: !!(n ? i : p)
19
10
  };
20
11
  }
21
12
  return r;
22
- }, [s, l, o]);
13
+ }, [l, t, n]);
23
14
  }
24
15
  export {
25
- I as default
16
+ v as default
26
17
  };
@@ -1,14 +1,14 @@
1
1
  import x from "react";
2
- import { getPtg as q } from "./useSizes.js";
3
- function J(b, v, P, j, C, k) {
4
- const i = b.map((t) => [t.min, t.max]), S = j || 0, M = (t) => t * S;
2
+ import { getPtg as T } from "./useSizes.js";
3
+ function H(v, P, b, C, j) {
4
+ const i = v.map((t) => [t.min, t.max]), S = b || 0, M = (t) => t * S;
5
5
  function a(t, f) {
6
- return typeof t == "string" ? M(q(t)) : t ?? f;
6
+ return typeof t == "string" ? M(T(t)) : t ?? f;
7
7
  }
8
- const [O, y] = x.useState([]), I = x.useRef([]), [g, p] = x.useState(null), U = () => P.map(M);
8
+ const [O, k] = x.useState([]), I = x.useRef([]), [g, p] = x.useState(null), U = () => P.map(M);
9
9
  return [
10
10
  (t) => {
11
- y(U()), p({
11
+ k(U()), p({
12
12
  index: t,
13
13
  confirmed: !1
14
14
  });
@@ -23,7 +23,7 @@ function J(b, v, P, j, C, k) {
23
23
  });
24
24
  else
25
25
  for (let r = t; r >= 0; r -= 1)
26
- if (O[r] > 0 && v[r].resizable) {
26
+ if (O[r] > 0) {
27
27
  n = r, p({
28
28
  index: r,
29
29
  confirmed: !0
@@ -45,7 +45,7 @@ function J(b, v, P, j, C, k) {
45
45
  p(null);
46
46
  },
47
47
  (t, f) => {
48
- const n = U(), c = k ? f === "start" ? "end" : "start" : f, e = c === "start" ? t : t + 1, s = c === "start" ? t + 1 : t, l = n[e], d = n[s];
48
+ const n = U(), c = j ? f === "start" ? "end" : "start" : f, e = c === "start" ? t : t + 1, s = c === "start" ? t + 1 : t, l = n[e], d = n[s];
49
49
  if (l !== 0 && d !== 0)
50
50
  n[e] = 0, n[s] += l, I.current[t] = l;
51
51
  else {
@@ -55,7 +55,7 @@ function J(b, v, P, j, C, k) {
55
55
  ), r = a(i[s][0], 0), E = a(
56
56
  i[s][1],
57
57
  S
58
- ), L = Math.max(m, u - E), T = Math.min(o, u - r), R = r || (T - L) / 2, z = I.current[t], h = u - z;
58
+ ), y = Math.max(m, u - E), L = Math.min(o, u - r), R = r || (L - y) / 2, z = I.current[t], h = u - z;
59
59
  z && z <= E && z >= r && h <= o && h >= m ? (n[s] = z, n[e] = h) : (n[e] -= R, n[s] += R);
60
60
  }
61
61
  return C(n), n;
@@ -64,5 +64,5 @@ function J(b, v, P, j, C, k) {
64
64
  ];
65
65
  }
66
66
  export {
67
- J as default
67
+ H as default
68
68
  };