@unicom-cloud/ui 0.8.96 → 0.8.98

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 (302) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/OverflowEllipsis.js +1 -1
  5. package/PageHeader.js +1 -1
  6. package/QrCode.js +57 -0
  7. package/Tour.js +63 -0
  8. package/Trigger.js +1 -1
  9. package/_virtual/_commonjsHelpers.js +6 -0
  10. package/_virtual/index.js +7 -0
  11. package/_virtual/index2.js +4 -0
  12. package/affix/index.js +70 -72
  13. package/alert/index.js +56 -56
  14. package/anchor/Anchor.js +55 -55
  15. package/anchor/Link.js +34 -34
  16. package/anchor/util.js +5 -5
  17. package/auto-complete/index.js +116 -122
  18. package/avatar/Avatar.js +33 -33
  19. package/avatar/Group.js +26 -26
  20. package/back-top/index.js +58 -61
  21. package/badge/index.js +46 -46
  22. package/breadcrumb/Item.js +42 -43
  23. package/breadcrumb/index.js +47 -47
  24. package/button/Group.js +6 -6
  25. package/button/index.js +91 -91
  26. package/calendar/Month.js +75 -75
  27. package/calendar/Year.js +35 -35
  28. package/calendar/header/index.js +25 -25
  29. package/calendar/index.js +103 -103
  30. package/card/Grid.js +8 -8
  31. package/card/Meta.js +16 -16
  32. package/card/index.js +49 -49
  33. package/carousel/Arrow.js +19 -19
  34. package/carousel/Indicator.js +26 -26
  35. package/carousel/index.js +108 -108
  36. package/cascader/Cascader.js +178 -191
  37. package/cascader/base/node.js +133 -136
  38. package/cascader/base/store.js +82 -85
  39. package/cascader/panel/List.js +125 -129
  40. package/cascader/panel/Search.js +79 -81
  41. package/cascader/util.js +13 -13
  42. package/checkbox/Checkbox.js +94 -96
  43. package/checkbox/Group.js +54 -56
  44. package/checkbox/GroupBlock.js +28 -29
  45. package/collapse/Collapse.js +45 -45
  46. package/collapse/Item.js +53 -55
  47. package/color-picker/ControlBar.js +43 -43
  48. package/color-picker/InputAlpha.js +12 -12
  49. package/color-picker/InputHex.js +30 -31
  50. package/color-picker/InputRgb.js +24 -24
  51. package/color-picker/Palette.js +18 -18
  52. package/color-picker/Panel.js +122 -125
  53. package/color-picker/hooks/useColorPicker.js +85 -88
  54. package/color-picker/hooks/useControlBlock.js +38 -40
  55. package/color-picker/index.js +47 -47
  56. package/comment/index.js +29 -29
  57. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  58. package/components/common/hooks/useId.js +8 -8
  59. package/components/common/hooks/useInView.js +16 -16
  60. package/components/common/hooks/useIntersectionObserver.js +1 -1
  61. package/components/common/hooks/useKeyboardEvent.js +9 -10
  62. package/components/common/hooks/useOverflowHidden.js +1 -4
  63. package/components/common/hooks/usePersistCallback.js +7 -7
  64. package/components/common/hooks/useStateCallback.js +9 -10
  65. package/components/common/hooks/useWindowSize.js +8 -8
  66. package/components/common/space/index.js +9 -7
  67. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  68. package/components/common/utils/dom.js +27 -29
  69. package/components/common/utils/findScrollParent.js +17 -0
  70. package/components/common/utils/intersectionObserver.js +21 -0
  71. package/components/common/utils/is.js +99 -109
  72. package/components/common/utils/mutationObserver.js +19 -0
  73. package/components/common/utils/reactDOM.js +34 -34
  74. package/components/common/utils/resizeObserver.js +21 -0
  75. package/copy/index.js +38 -40
  76. package/date-picker/Picker.js +290 -295
  77. package/date-picker/RangePicker.js +367 -372
  78. package/date-picker/index.js +33 -35
  79. package/date-picker/panel/Body.js +46 -47
  80. package/date-picker/panel/Header.js +33 -33
  81. package/date-picker/panel/Shortcut.js +31 -31
  82. package/date-picker/panel/date/index.js +85 -85
  83. package/date-picker/panel/month/index.js +59 -59
  84. package/date-picker/panel/quarter/index.js +67 -70
  85. package/date-picker/panel/range/index.js +101 -101
  86. package/date-picker/panel/year/index.js +39 -39
  87. package/date-picker/util.js +17 -18
  88. package/descriptions/index.js +62 -62
  89. package/details/index.js +53 -55
  90. package/development/index.js +9 -9
  91. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  92. package/dist/validate/src/index.js +5 -5
  93. package/dist/validate/src/util.js +1 -1
  94. package/divider/index.js +21 -21
  95. package/draggable/Item.js +35 -35
  96. package/draggable/index.js +22 -22
  97. package/drawer/Drawer.js +142 -147
  98. package/dropdown/Button.js +48 -48
  99. package/dropdown/index.js +88 -92
  100. package/empty/index.js +16 -16
  101. package/form/Control.js +211 -225
  102. package/form/Form.js +109 -113
  103. package/form/FormItem.js +118 -120
  104. package/form/FormList.js +60 -66
  105. package/form/FormProvider.js +31 -34
  106. package/form/hook/useContext.js +17 -19
  107. package/form/hook/useState.js +22 -23
  108. package/form/hook/useWatch.js +26 -27
  109. package/form/promisify.js +14 -18
  110. package/form/store.js +304 -316
  111. package/form/util.js +14 -15
  112. package/grid/Col.js +64 -64
  113. package/grid/Grid.js +51 -51
  114. package/grid/GridItem.js +48 -48
  115. package/grid/Row.js +39 -39
  116. package/hooks/useVerificationCode.js +41 -43
  117. package/hooks/useWatermark.js +89 -92
  118. package/icon/index.js +23 -24
  119. package/icon-hover/index.js +16 -16
  120. package/icons/file.js +11 -11
  121. package/image/Image.js +140 -141
  122. package/image/ImagePreview.js +252 -255
  123. package/image/ImagePreviewArrow.js +25 -25
  124. package/image/ImagePreviewGroup.js +62 -62
  125. package/image/util/getScale.js +25 -28
  126. package/index.js +684 -675
  127. package/input/Button.js +48 -50
  128. package/input/Group.js +9 -9
  129. package/input/Input.js +145 -154
  130. package/input/InputElement.js +108 -115
  131. package/input/Password.js +38 -38
  132. package/input/Search.js +51 -55
  133. package/input/Textarea.js +80 -81
  134. package/input/useComposition.js +23 -23
  135. package/input-number/decimal.js +59 -62
  136. package/input-number/index.js +139 -141
  137. package/input-tag/InputTag.js +222 -230
  138. package/layout/Content.js +6 -6
  139. package/layout/Footer.js +8 -8
  140. package/layout/Header.js +7 -7
  141. package/layout/Sider.js +88 -90
  142. package/layout/index.js +30 -30
  143. package/link/index.js +45 -46
  144. package/liquid-fill/LiquidFill.js +226 -0
  145. package/liquid-fill/LiquidFill2.js +3 -0
  146. package/liquid-fill/index.js +4 -0
  147. package/list/Item.js +28 -28
  148. package/list/Meta.js +12 -12
  149. package/list/index.js +146 -148
  150. package/mentions/index.js +75 -76
  151. package/menu/Item.js +58 -58
  152. package/menu/Menu.js +125 -127
  153. package/menu/OverflowWrap.js +39 -40
  154. package/menu/sub-menu/Inline.js +45 -45
  155. package/menu/util.js +26 -28
  156. package/message/index.js +96 -99
  157. package/message/useMessage.js +26 -27
  158. package/modal/Confirm.js +47 -49
  159. package/modal/Modal.js +250 -257
  160. package/modal/use-modal/Hook.js +26 -28
  161. package/modal/use-modal/index.js +46 -49
  162. package/notice/index.js +89 -90
  163. package/notification/index.js +60 -65
  164. package/notification/withNotification.js +35 -35
  165. package/overflow-ellipsis/OverflowItem.js +19 -20
  166. package/overflow-ellipsis/index.js +45 -46
  167. package/package.json +1 -1
  168. package/page-header/index.js +45 -45
  169. package/pagination/PageItem.js +87 -91
  170. package/pagination/PageJumper.js +40 -41
  171. package/pagination/PageOption.js +31 -35
  172. package/pagination/Pagination.js +162 -163
  173. package/picker/Input.js +90 -96
  174. package/picker/InputRange.js +115 -122
  175. package/popconfirm/index.js +98 -100
  176. package/popover/index.js +28 -28
  177. package/portal/Portal.js +10 -11
  178. package/progress/index.js +36 -36
  179. package/qr-code/index.js +99 -0
  180. package/qr-code/interface.js +1 -0
  181. package/radio/Group.js +48 -48
  182. package/radio/GroupBlock.js +32 -33
  183. package/radio/Radio.js +62 -64
  184. package/rate/index.js +88 -88
  185. package/resize-box/ResizeTrigger.js +39 -39
  186. package/resize-box/Split.js +92 -96
  187. package/resize-box/SplitGroup.js +116 -122
  188. package/resize-box/index.js +112 -115
  189. package/result/index.js +44 -44
  190. package/select/Option.js +53 -56
  191. package/select/Select.js +365 -381
  192. package/select/util.js +95 -99
  193. package/select-view/Core.js +159 -160
  194. package/skeleton/index.js +23 -23
  195. package/slider/Button.js +84 -92
  196. package/slider/Input.js +47 -49
  197. package/slider/Tick.js +28 -31
  198. package/slider/index.js +107 -107
  199. package/space/index.js +26 -26
  200. package/space-/index.js +51 -51
  201. package/spin/DotLoading.js +8 -8
  202. package/spin/index.js +47 -47
  203. package/statistic/Countdown.js +37 -37
  204. package/statistic/index.js +58 -58
  205. package/steps/Step.js +42 -42
  206. package/steps/index.js +54 -54
  207. package/style.css +1 -1
  208. package/switch/index.js +77 -78
  209. package/table/ColGroup.js +36 -37
  210. package/table/Table.js +447 -450
  211. package/table/hook/useExpand.js +24 -24
  212. package/table/hook/useRowSelection.js +62 -62
  213. package/table/summary/Row.js +16 -17
  214. package/table/tbody/Td.js +119 -118
  215. package/table/tbody/Tr.js +119 -121
  216. package/table/tbody/index.js +62 -63
  217. package/table/th-resizable/index.js +30 -30
  218. package/table/thead/Column.js +148 -148
  219. package/table/thead/index.js +87 -88
  220. package/tabs/Tab.js +55 -55
  221. package/tabs/TabContent.js +8 -8
  222. package/tabs/TabPane.js +15 -15
  223. package/tabs/hook/useHeaderScroll.js +36 -36
  224. package/tabs/tab-header/TabInk.js +31 -33
  225. package/tabs/tab-header/TabNavIcon.js +34 -35
  226. package/tabs/tab-header/index.js +192 -195
  227. package/tag/index.js +94 -97
  228. package/time-picker/Picker.js +167 -172
  229. package/time-picker/RangePicker.js +28 -28
  230. package/time-picker/TimePicker.js +146 -146
  231. package/timeline/Item.js +46 -46
  232. package/timeline/Timeline.js +52 -52
  233. package/tooltip/index.js +89 -95
  234. package/tour/index.js +289 -0
  235. package/transfer/Item.js +54 -54
  236. package/transfer/List.js +134 -136
  237. package/transfer/index.js +91 -91
  238. package/tree/Animation.js +49 -52
  239. package/tree/Node.js +114 -122
  240. package/tree/NodeList.js +51 -51
  241. package/tree/Tree.js +386 -393
  242. package/tree-select/List.js +71 -72
  243. package/tree-select/Select.js +135 -143
  244. package/tree-select/hook/useKeyCache.js +39 -39
  245. package/tree-select/hook/useStateValue.js +12 -12
  246. package/trigger/getPopupStyle.js +60 -61
  247. package/trigger/index.js +337 -346
  248. package/types/common/space/interface.d.ts +1 -1
  249. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  250. package/types/common/utils/findScrollParent.d.ts +2 -0
  251. package/types/common/utils/index.d.ts +5 -0
  252. package/types/common/utils/intersectionObserver.d.ts +2 -0
  253. package/types/common/utils/mutationObserver.d.ts +2 -0
  254. package/types/common/utils/resizeObserver.d.ts +2 -0
  255. package/types/pc/config-provider/interface.d.ts +6 -0
  256. package/types/pc/index.d.ts +3 -0
  257. package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
  258. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  259. package/types/pc/liquid-fill/index.d.ts +2 -0
  260. package/types/pc/qr-code/index.d.ts +34 -0
  261. package/types/pc/qr-code/interface.d.ts +39 -0
  262. package/types/pc/table/interface.d.ts +2 -2
  263. package/types/pc/tour/index.d.ts +42 -0
  264. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  265. package/types/pc/utils/findScrollParent.d.ts +2 -0
  266. package/types/pc/utils/index.d.ts +5 -0
  267. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  268. package/types/pc/utils/mutationObserver.d.ts +2 -0
  269. package/types/pc/utils/names.d.ts +18 -0
  270. package/types/pc/utils/resizeObserver.d.ts +2 -0
  271. package/typography/Base.js +79 -81
  272. package/typography/EditContent.js +30 -33
  273. package/typography/Ellipsis.js +77 -73
  274. package/typography/Operations.js +50 -52
  275. package/typography/Paragraph.js +7 -7
  276. package/typography/Typography.js +7 -7
  277. package/typography/useEllipsis.js +105 -106
  278. package/upload/TriggerNode.js +69 -76
  279. package/upload/Upload.js +84 -87
  280. package/upload/Uploader.js +115 -118
  281. package/upload/list/PictureItem.js +61 -71
  282. package/upload/list/TextItem.js +61 -67
  283. package/upload/list/UploadProgress.js +42 -49
  284. package/upload/list/index.js +48 -49
  285. package/upload/request_.js +37 -38
  286. package/upload/util.js +39 -39
  287. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  288. package/utils/findScrollParent.js +4 -0
  289. package/utils/index.js +281 -278
  290. package/utils/intersectionObserver.js +4 -0
  291. package/utils/mutationObserver.js +4 -0
  292. package/utils/names.js +12 -0
  293. package/utils/resizeObserver.js +4 -0
  294. package/verification-code/VerificationCode.js +50 -51
  295. package/version/index.js +1 -1
  296. package/virtual-list/VirtualList.js +243 -244
  297. package/virtual-list/util/item.js +3 -4
  298. package/watermark/Watermark.js +27 -31
  299. package/components/common/utils/resizeObserverEffect.js +0 -23
  300. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  301. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  302. package/utils/resizeObserverEffect.js +0 -4
package/slider/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { jsx as v, jsxs as oe } from "react/jsx-runtime";
1
+ import { jsx as v, jsxs as te } from "react/jsx-runtime";
2
2
  import { div as Fe, plus as Je, times as qe } from "@unicom-cloud/utils/math";
3
- import re from "lodash/isArray";
4
- import ae from "lodash/isFunction";
5
- import ie from "lodash/isPlainObject";
3
+ import ne from "lodash/isArray";
4
+ import oe from "lodash/isFunction";
5
+ import re from "lodash/isPlainObject";
6
6
  import ze, { forwardRef as Ge, useContext as He, useRef as V, useMemo as Ke } from "react";
7
7
  import "../config-provider/ConfigProvider.js";
8
8
  import Qe from "../components/common/hooks/useMergeProps.js";
9
9
  import We from "../components/common/hooks/useMergeValue.js";
10
10
  import Ze from "../components/common/hooks/useUpdateEffect.js";
11
- import se from "@unicom-cloud/utils/class-name";
12
- import { on as le, off as ue } from "../components/common/utils/dom.js";
11
+ import ae from "@unicom-cloud/utils/class-name";
12
+ import { on as ie, off as se } from "../components/common/utils/dom.js";
13
13
  import { omit as _e } from "../components/common/utils/omit.js";
14
14
  import et from "./Button.js";
15
15
  import tt from "./Dot.js";
@@ -18,83 +18,83 @@ import ot from "./Mark.js";
18
18
  import rt from "./Tick.js";
19
19
  import at from "./hook/useInterval.js";
20
20
  import it from "./hook/useLegalValue.js";
21
- import { needSort as st, sortNumberArray as ce, getIntervalOffset as j, formatPercent as I, findNearestIndex as lt } from "./util.js";
21
+ import { needSort as st, sortNumberArray as le, getIntervalOffset as E, formatPercent as y, findNearestIndex as lt } from "./util.js";
22
22
  import ut from "../config-provider/context.js";
23
23
  const ct = {
24
24
  max: 100,
25
25
  min: 0,
26
26
  step: 1
27
27
  };
28
- function ft(me, pe) {
29
- const { getPrefixCls: x, componentConfig: P, rtl: U } = He(ut), l = Qe(
30
- me,
28
+ function ft(ce, fe) {
29
+ const { getPrefixCls: me, componentConfig: pe, rtl: L } = He(ut), l = Qe(
30
+ ce,
31
31
  ct,
32
- P == null ? void 0 : P.Slider
32
+ pe?.Slider
33
33
  ), {
34
34
  className: ge,
35
35
  style: de,
36
36
  tooltipVisible: ve,
37
37
  tooltipPosition: he,
38
- disabled: w,
38
+ disabled: C,
39
39
  min: f,
40
- max: C,
41
- range: R,
42
- step: N,
40
+ max: w,
41
+ range: I,
42
+ step: P,
43
43
  showTicks: Ve,
44
- marks: k,
45
- onlyMarkValue: X,
44
+ marks: R,
45
+ onlyMarkValue: j,
46
46
  vertical: u,
47
47
  showInput: m,
48
- reverse: Y,
49
- getIntervalConfig: we,
50
- ...Ce
51
- } = l, p = !!R, Me = ie(R) ? { ...R } : { draggableBar: !1 }, s = U ? !Y : Y, { intervalConfigs: g, markList: F } = at({
48
+ reverse: U,
49
+ getIntervalConfig: Ce,
50
+ ...we
51
+ } = l, p = !!I, Me = re(I) ? { ...I } : { draggableBar: !1 }, s = L ? !U : U, { intervalConfigs: g, markList: X } = at({
52
52
  min: f,
53
- max: C,
54
- step: N,
55
- marks: k,
56
- getIntervalConfig: we
57
- }), { getLegalValue: b, getLegalRangeValue: B, isLegalValue: be, getNextMarkValue: ye } = it({
53
+ max: w,
54
+ step: P,
55
+ marks: R,
56
+ getIntervalConfig: Ce
57
+ }), { getLegalValue: b, getLegalRangeValue: N, isLegalValue: be, getNextMarkValue: xe } = it({
58
58
  isRange: p,
59
59
  min: f,
60
- max: C,
61
- onlyMarkValue: X,
62
- step: N,
60
+ max: w,
61
+ onlyMarkValue: j,
62
+ step: P,
63
63
  intervalConfigs: g,
64
- marks: k
65
- }), [O, Ie] = We(
64
+ marks: R
65
+ }), [k, ye] = We(
66
66
  p ? [f, f] : f,
67
67
  {
68
68
  defaultValue: l.defaultValue,
69
69
  value: l.value
70
70
  }
71
71
  );
72
- let o = B(O);
73
- const S = V(o), T = V(st(o));
72
+ let o = N(k);
73
+ const B = V(o), O = V(st(o));
74
74
  Ze(() => {
75
- S.current = B(O);
76
- }, [O, B]), T.current && (o = ce(o));
77
- const $ = o[o.length - 1], A = o[0], D = m && !X && (!p || o.length < 3), xe = Ke(() => D && (re(m) || ie(m)) ? re(m) ? [...m] : [{ ...m }, { ...m }] : [], [D, m]), a = x == null ? void 0 : x("slider"), J = V(null), q = V({
75
+ B.current = N(k);
76
+ }, [k, N]), O.current && (o = le(o));
77
+ const S = o[o.length - 1], T = o[0], $ = m && !j && (!p || o.length < 3), Ie = Ke(() => $ && (ne(m) || re(m)) ? ne(m) ? [...m] : [{ ...m }, { ...m }] : [], [$, m]), a = me?.("slider"), Y = V(null), F = V({
78
78
  left: 0,
79
79
  height: 0,
80
80
  top: 0,
81
81
  width: 0
82
- }), z = V(!1), G = V(0);
83
- function H(t) {
84
- const e = ce(t);
82
+ }), J = V(!1), q = V(0);
83
+ function z(t) {
84
+ const e = le(t);
85
85
  return p ? e : e[e.length - 1];
86
86
  }
87
87
  function Pe(t) {
88
88
  const e = t.map((n) => b(n));
89
- return S.current = e, e;
89
+ return B.current = e, e;
90
90
  }
91
91
  function h(t, e) {
92
- const n = Pe(t), r = H(n);
93
- Ie(r), e === "inputValueChange" ? T.current = n.some((i, d) => i > n[d]) : T.current = !1, ae(l.onChange) && l.onChange(r);
92
+ const n = Pe(t), r = z(n);
93
+ ye(r), e === "inputValueChange" ? O.current = n.some((i, d) => i > n[d]) : O.current = !1, oe(l.onChange) && l.onChange(r);
94
94
  }
95
- function y() {
96
- if (ae(l.onAfterChange)) {
97
- const t = H(S.current);
95
+ function x() {
96
+ if (oe(l.onAfterChange)) {
97
+ const t = z(B.current);
98
98
  l.onAfterChange(t);
99
99
  }
100
100
  }
@@ -102,26 +102,26 @@ function ft(me, pe) {
102
102
  let [e, n] = [o[0], o[o.length - 1]];
103
103
  return e > n && ([e, n] = [n, e]), p ? t >= e && t <= n : t <= n;
104
104
  }
105
- function E(t, e) {
106
- const { left: n, top: r, width: i, height: d } = q.current;
107
- let c = i, Z = s ? n + i - t : t - n;
108
- if (u && (c = d, Z = s ? e - r : r + d - e), c <= 0)
105
+ function A(t, e) {
106
+ const { left: n, top: r, width: i, height: d } = F.current;
107
+ let c = i, Q = s ? n + i - t : t - n;
108
+ if (u && (c = d, Q = s ? e - r : r + d - e), c <= 0)
109
109
  return 0;
110
- let M = Math.max(Fe(Z, c), 0);
110
+ let M = Math.max(Fe(Q, c), 0);
111
111
  M = Math.min(1, M);
112
- const De = g.find((ne) => M >= ne.beginOffset && M <= ne.endOffset), {
113
- begin: _,
114
- beginOffset: ee,
115
- step: te,
112
+ const De = g.find((ee) => M >= ee.beginOffset && M <= ee.endOffset), {
113
+ begin: W,
114
+ beginOffset: Z,
115
+ step: _,
116
116
  endOffset: Ee,
117
117
  end: Le
118
- } = De, je = M - ee, Ue = Ee - ee, Xe = je / Ue * (Le - _), Ye = Math.round(Xe / te);
119
- return Je(_, qe(Ye, te));
118
+ } = De, je = M - Z, Ue = Ee - Z, Xe = je / Ue * (Le - W), Ye = Math.round(Xe / _);
119
+ return Je(W, qe(Ye, _));
120
120
  }
121
121
  function Ne(t) {
122
122
  let [e, n] = t;
123
123
  e > n && ([e, n] = [n, e]);
124
- const r = I(e), i = I(1 - n);
124
+ const r = y(e), i = y(1 - n);
125
125
  return u ? {
126
126
  [s ? "top" : "bottom"]: r,
127
127
  [s ? "bottom" : "top"]: i
@@ -131,7 +131,7 @@ function ft(me, pe) {
131
131
  };
132
132
  }
133
133
  function ke(t) {
134
- return u ? { [s ? "top" : "bottom"]: I(t) } : { [s ? "right" : "left"]: I(t) };
134
+ return u ? { [s ? "top" : "bottom"]: y(t) } : { [s ? "right" : "left"]: y(t) };
135
135
  }
136
136
  function Be() {
137
137
  const t = {
@@ -140,48 +140,48 @@ function ft(me, pe) {
140
140
  };
141
141
  return "tooltipPosition" in l && (t.tooltipPosition = he), "tooltipVisible" in l && (t.tooltipVisible = ve), t;
142
142
  }
143
- function K() {
144
- q.current = J.current.getBoundingClientRect();
143
+ function G() {
144
+ F.current = Y.current.getBoundingClientRect();
145
145
  }
146
146
  function Oe(t) {
147
- K();
148
- const e = E(t.clientX, t.clientY);
149
- Me.draggableBar && Re(e) ? (G.current = b(e), le(window, "mousemove", Q), le(window, "mouseup", W)) : L(e);
147
+ G();
148
+ const e = A(t.clientX, t.clientY);
149
+ Me.draggableBar && Re(e) ? (q.current = b(e), ie(window, "mousemove", H), ie(window, "mouseup", K)) : D(e);
150
150
  }
151
- function L(t) {
152
- if (w)
151
+ function D(t) {
152
+ if (C)
153
153
  return;
154
154
  const e = b(t), [n, r] = lt(e, o), i = o[n], d = o[r], c = o.slice(0);
155
- p && d - e > e - i ? (c[n] = e, h(c, "jumpToClick")) : (c[r] = e, h(c, "jumpToClick")), y();
155
+ p && d - e > e - i ? (c[n] = e, h(c, "jumpToClick")) : (c[r] = e, h(c, "jumpToClick")), x();
156
156
  }
157
157
  function Se(t) {
158
- h(t, "inputValueChange"), y();
158
+ h(t, "inputValueChange"), x();
159
159
  }
160
160
  function Te(t, e, n) {
161
- z.current = !0;
161
+ J.current = !0;
162
162
  const r = o.slice(0);
163
- r[n] = E(t, e), h(r, "mousemove");
163
+ r[n] = A(t, e), h(r, "mousemove");
164
164
  }
165
165
  function $e() {
166
- z.current = !1, y();
166
+ J.current = !1, x();
167
167
  }
168
168
  function Ae(t, e) {
169
- if (w)
169
+ if (C)
170
170
  return;
171
171
  const n = o.slice(0);
172
- n[e] = ye(o[e], t), h(n);
172
+ n[e] = xe(o[e], t), h(n);
173
173
  }
174
- function Q(t) {
175
- const n = b(E(t.clientX, t.clientY)) - G.current, r = o.map((i) => i + n);
174
+ function H(t) {
175
+ const n = b(A(t.clientX, t.clientY)) - q.current, r = o.map((i) => i + n);
176
176
  r.every((i, d, c) => be(i)) && h(r, "mousemove");
177
177
  }
178
- function W() {
179
- ue(window, "mousemove", Q), ue(window, "mouseup", W), y();
178
+ function K() {
179
+ se(window, "mousemove", H), se(window, "mouseup", K), x();
180
180
  }
181
181
  return /* @__PURE__ */ v(
182
182
  "div",
183
183
  {
184
- ..._e(Ce, [
184
+ ..._e(we, [
185
185
  "defaultValue",
186
186
  "value",
187
187
  "onChange",
@@ -189,25 +189,25 @@ function ft(me, pe) {
189
189
  "formatTooltip",
190
190
  "onAfterChange"
191
191
  ]),
192
- className: se(
192
+ className: ae(
193
193
  a,
194
194
  {
195
195
  [`${a}-vertical`]: u,
196
- [`${a}-with-marks`]: k,
196
+ [`${a}-with-marks`]: R,
197
197
  [`${a}-reverse`]: s,
198
- [`${a}-rtl`]: U
198
+ [`${a}-rtl`]: L
199
199
  },
200
200
  ge
201
201
  ),
202
202
  style: de,
203
- ref: pe,
204
- children: /* @__PURE__ */ oe("div", { className: `${a}-wrapper`, children: [
205
- /* @__PURE__ */ oe(
203
+ ref: fe,
204
+ children: /* @__PURE__ */ te("div", { className: `${a}-wrapper`, children: [
205
+ /* @__PURE__ */ te(
206
206
  "div",
207
207
  {
208
- ref: J,
209
- className: se(`${a}-road`, {
210
- [`${a}-road-disabled`]: w,
208
+ ref: Y,
209
+ className: ae(`${a}-road`, {
210
+ [`${a}-road-disabled`]: C,
211
211
  [`${a}-road-vertical`]: u
212
212
  }),
213
213
  onMouseDown: Oe,
@@ -217,8 +217,8 @@ function ft(me, pe) {
217
217
  {
218
218
  className: `${a}-bar`,
219
219
  style: Ne([
220
- j(A, g),
221
- j($, g)
220
+ E(T, g),
221
+ E(S, g)
222
222
  ])
223
223
  }
224
224
  ),
@@ -227,8 +227,8 @@ function ft(me, pe) {
227
227
  {
228
228
  intervalConfigs: g,
229
229
  min: f,
230
- max: C,
231
- valueRange: [A, $],
230
+ max: w,
231
+ valueRange: [T, S],
232
232
  prefixCls: a,
233
233
  vertical: u,
234
234
  reverse: s
@@ -237,38 +237,38 @@ function ft(me, pe) {
237
237
  /* @__PURE__ */ v(
238
238
  tt,
239
239
  {
240
- data: F,
240
+ data: X,
241
241
  intervalConfigs: g,
242
- valueRange: [A, $],
242
+ valueRange: [T, S],
243
243
  vertical: u,
244
244
  prefixCls: a,
245
245
  reverse: s,
246
- onMouseDown: L
246
+ onMouseDown: D
247
247
  }
248
248
  ),
249
249
  /* @__PURE__ */ v(
250
250
  ot,
251
251
  {
252
- data: F,
252
+ data: X,
253
253
  intervalConfigs: g,
254
254
  vertical: u,
255
255
  prefixCls: a,
256
256
  reverse: s,
257
- onMouseDown: L
257
+ onMouseDown: D
258
258
  }
259
259
  ),
260
260
  o.map((t, e) => !p && e !== o.length - 1 ? null : /* @__PURE__ */ v(
261
261
  et,
262
262
  {
263
- style: ke(j(t, g)),
264
- disabled: w,
263
+ style: ke(E(t, g)),
264
+ disabled: C,
265
265
  prefixCls: a,
266
266
  value: t,
267
- maxValue: C,
267
+ maxValue: w,
268
268
  minValue: f,
269
269
  vertical: u,
270
270
  ...Be(),
271
- onMoveBegin: K,
271
+ onMoveBegin: G,
272
272
  onMoving: (n, r) => Te(n, r, e),
273
273
  onMoveEnd: $e,
274
274
  onArrowEvent: (n) => Ae(n, e)
@@ -278,27 +278,27 @@ function ft(me, pe) {
278
278
  ]
279
279
  }
280
280
  ),
281
- D && /* @__PURE__ */ v(
281
+ $ && /* @__PURE__ */ v(
282
282
  nt,
283
283
  {
284
284
  min: f,
285
- max: C,
286
- step: N,
285
+ max: w,
286
+ step: P,
287
287
  value: o,
288
288
  range: p,
289
- disabled: w,
289
+ disabled: C,
290
290
  prefixCls: a,
291
291
  onChange: Se,
292
- extra: xe
292
+ extra: Ie
293
293
  }
294
294
  )
295
295
  ] })
296
296
  }
297
297
  );
298
298
  }
299
- const fe = Ge(ft);
300
- fe.displayName = "Slider";
301
- const $t = ze.memo(fe);
299
+ const ue = Ge(ft);
300
+ ue.displayName = "Slider";
301
+ const $t = ze.memo(ue);
302
302
  export {
303
303
  $t as default
304
304
  };
package/space/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as d, useContext as u } from "react";
3
- import $ from "../components/common/space/index.js";
2
+ import { forwardRef as g, useContext as x } from "react";
3
+ import C from "../components/common/space/index.js";
4
4
  import { SpaceVertical as J } from "../components/common/space/index.js";
5
5
  import "../config-provider/ConfigProvider.js";
6
6
  import "lodash/isEqualWith";
@@ -10,43 +10,43 @@ import "lodash/isNumber";
10
10
  import "lodash/merge";
11
11
  import "../components/common/utils/dom.js";
12
12
  import "../components/common/hooks/useIntersectionObserver.js";
13
- import x from "../components/common/hooks/useMergeProps.js";
13
+ import d from "../components/common/hooks/useMergeProps.js";
14
14
  import "../components/common/utils/reactDOM.js";
15
15
  import "@unicom-cloud/utils/constant";
16
16
  import "lodash/debounce";
17
- import N from "@unicom-cloud/utils/class-name";
18
- import S from "../config-provider/context.js";
19
- const g = {
17
+ import u from "@unicom-cloud/utils/class-name";
18
+ import $ from "../config-provider/context.js";
19
+ const N = {
20
20
  gap: "small",
21
21
  direction: "horizontal"
22
22
  };
23
- function w(s, c) {
24
- const { getPrefixCls: o, componentConfig: r, rtl: z } = u(S), n = x(
25
- s,
26
- g,
27
- r == null ? void 0 : r.Space
28
- ), { className: f, direction: m, wrap: i, size: a, align: e, ...t } = n;
29
- a && (t.gap = a), e && (t.alignItems = e);
30
- const p = o == null ? void 0 : o("space");
23
+ function S(m, a) {
24
+ const { getPrefixCls: s, componentConfig: n, rtl: P } = x($), c = d(
25
+ m,
26
+ N,
27
+ n?.Space
28
+ ), { className: f, direction: t, wrap: p, size: e, align: i, ...o } = c;
29
+ e && (o.gap = e), i && (o.alignItems = i);
30
+ const r = s?.("space");
31
31
  return /* @__PURE__ */ l(
32
- $,
32
+ C,
33
33
  {
34
- ref: c,
35
- className: N(
36
- `${p}`,
37
- i && `${p}-wrap`,
38
- `${p}-${m}`,
34
+ ref: a,
35
+ className: u(
36
+ `${r}`,
37
+ p && `${r}-wrap`,
38
+ `${r}-${t}`,
39
39
  f
40
40
  ),
41
- direction: m,
42
- wrap: i,
43
- ...t
41
+ direction: t,
42
+ wrap: p,
43
+ ...o
44
44
  }
45
45
  );
46
46
  }
47
- const C = d(w);
48
- C.displayName = "Space";
47
+ const w = g(S);
48
+ w.displayName = "Space";
49
49
  export {
50
50
  J as SpaceVertical,
51
- C as default
51
+ w as default
52
52
  };
package/space-/index.js CHANGED
@@ -1,45 +1,45 @@
1
1
  import { jsx as c, jsxs as M } from "react/jsx-runtime";
2
- import R from "lodash/isArray";
3
- import V from "lodash/isNumber";
4
- import { forwardRef as h, useContext as b, Fragment as j } from "react";
2
+ import P from "lodash/isArray";
3
+ import R from "lodash/isNumber";
4
+ import { forwardRef as $, useContext as V, Fragment as b } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import k from "../components/common/hooks/useMergeProps.js";
7
- import D from "@unicom-cloud/utils/class-name";
8
- import F from "./toArray.js";
9
- import H from "../config-provider/context.js";
10
- const O = {
6
+ import j from "../components/common/hooks/useMergeProps.js";
7
+ import k from "@unicom-cloud/utils/class-name";
8
+ import D from "./toArray.js";
9
+ import F from "../config-provider/context.js";
10
+ const H = {
11
11
  size: "small",
12
12
  direction: "horizontal"
13
13
  };
14
- function P(s, m) {
15
- const { getPrefixCls: l, componentConfig: p, rtl: $ } = b(H), S = k(
14
+ function O(s, m) {
15
+ const { getPrefixCls: N, componentConfig: C, rtl: g } = V(F), v = j(
16
16
  s,
17
- O,
18
- p == null ? void 0 : p.Space
17
+ H,
18
+ C?.Space
19
19
  ), {
20
- className: w,
21
- style: B,
22
- children: C,
20
+ className: S,
21
+ style: x,
22
+ children: w,
23
23
  size: i,
24
24
  direction: a,
25
- align: x,
26
- wrap: u,
27
- split: f,
25
+ align: B,
26
+ wrap: l,
27
+ split: p,
28
28
  ...z
29
- } = S, e = l == null ? void 0 : l("space-"), y = x || (a === "horizontal" ? "center" : ""), A = D(
29
+ } = v, e = N?.("space-"), d = B || (a === "horizontal" ? "center" : ""), A = k(
30
30
  e,
31
31
  {
32
32
  [`${e}-${a}`]: a,
33
- [`${e}-align-${y}`]: y,
34
- [`${e}-wrap`]: u,
35
- [`${e}-rtl`]: $
33
+ [`${e}-align-${d}`]: d,
34
+ [`${e}-wrap`]: l,
35
+ [`${e}-rtl`]: g
36
36
  },
37
- w
37
+ S
38
38
  );
39
- function g(r) {
40
- if (V(r))
41
- return r;
42
- switch (r) {
39
+ function f(t) {
40
+ if (R(t))
41
+ return t;
42
+ switch (t) {
43
43
  case "mini":
44
44
  return 4;
45
45
  case "small":
@@ -52,42 +52,42 @@ function P(s, m) {
52
52
  return 8;
53
53
  }
54
54
  }
55
- const N = F(C);
56
- function L(r) {
57
- const n = N.length === r + 1, o = $ ? "marginLeft" : "marginRight";
55
+ const h = D(w);
56
+ function L(t) {
57
+ const n = h.length === t + 1, o = g ? "marginLeft" : "marginRight";
58
58
  if (typeof i == "string" || typeof i == "number") {
59
- const t = g(i);
60
- return u ? n ? { marginBottom: t } : {
61
- [`${o}`]: t,
62
- marginBottom: t
59
+ const r = f(i);
60
+ return l ? n ? { marginBottom: r } : {
61
+ [`${o}`]: r,
62
+ marginBottom: r
63
63
  } : n ? {} : {
64
- [a === "vertical" ? "marginBottom" : o]: t
64
+ [a === "vertical" ? "marginBottom" : o]: r
65
65
  };
66
66
  }
67
- if (R(i)) {
68
- const t = g(i[0]), d = g(i[1]);
69
- return u ? n ? { marginBottom: d } : {
70
- [`${o}`]: t,
71
- marginBottom: d
72
- } : a === "vertical" ? { marginBottom: d } : { [`${o}`]: t };
67
+ if (P(i)) {
68
+ const r = f(i[0]), u = f(i[1]);
69
+ return l ? n ? { marginBottom: u } : {
70
+ [`${o}`]: r,
71
+ marginBottom: u
72
+ } : a === "vertical" ? { marginBottom: u } : { [`${o}`]: r };
73
73
  }
74
74
  }
75
- return /* @__PURE__ */ c("div", { ref: m, className: A, style: B, ...z, children: N.map((r, n) => {
76
- const o = (r == null ? void 0 : r.key) || n, t = f != null && n > 0;
77
- return /* @__PURE__ */ M(j, { children: [
78
- t && /* @__PURE__ */ c("div", { className: `${e}-item-split`, children: f }),
79
- /* @__PURE__ */ c("div", { className: `${e}-item`, style: L(n), children: r })
75
+ return /* @__PURE__ */ c("div", { ref: m, className: A, style: x, ...z, children: h.map((t, n) => {
76
+ const o = t?.key || n, r = p != null && n > 0;
77
+ return /* @__PURE__ */ M(b, { children: [
78
+ r && /* @__PURE__ */ c("div", { className: `${e}-item-split`, children: p }),
79
+ /* @__PURE__ */ c("div", { className: `${e}-item`, style: L(n), children: t })
80
80
  ] }, o);
81
81
  }) });
82
82
  }
83
- const v = h(P);
84
- v.displayName = "Space-";
83
+ const y = $(O);
84
+ y.displayName = "Space-";
85
85
  function q(s, m) {
86
- return /* @__PURE__ */ c(v, { ref: m, ...s, direction: "vertical", children: s.children });
86
+ return /* @__PURE__ */ c(y, { ref: m, ...s, direction: "vertical", children: s.children });
87
87
  }
88
- const E = h(q);
88
+ const E = $(q);
89
89
  E.displayName = "SpaceVertical-";
90
90
  export {
91
91
  E as SpaceVertical,
92
- v as default
92
+ y as default
93
93
  };
@@ -1,25 +1,25 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import m from "lodash/isNumber";
3
3
  import { useContext as a } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import d from "../config-provider/context.js";
6
- function g(t) {
7
- const { getPrefixCls: i } = a(d), s = `${i == null ? void 0 : i("spin")}-dot`, n = {
5
+ import l from "../config-provider/context.js";
6
+ function x(t) {
7
+ const { getPrefixCls: r } = a(l), i = `${r?.("spin")}-dot`, o = {
8
8
  width: t.size,
9
9
  height: t.size
10
10
  }, e = t.size ? parseInt(String(t.size)) : 0;
11
- return /* @__PURE__ */ o(
11
+ return /* @__PURE__ */ s(
12
12
  "div",
13
13
  {
14
- className: `${s}-list`,
14
+ className: `${i}-list`,
15
15
  style: {
16
16
  height: t.size,
17
17
  width: m(e) && e > 0 ? e * 7 : ""
18
18
  },
19
- children: [...new Array(5)].map((c, r) => /* @__PURE__ */ o("div", { className: s, style: n }, r))
19
+ children: [...new Array(5)].map((d, n) => /* @__PURE__ */ s("div", { className: i, style: o }, n))
20
20
  }
21
21
  );
22
22
  }
23
23
  export {
24
- g as default
24
+ x as default
25
25
  };