@unicom-cloud/ui 0.8.95 → 0.8.97

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 (326) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/Message.js +1 -1
  5. package/Notification.js +1 -1
  6. package/OverflowEllipsis.js +1 -1
  7. package/PageHeader.js +1 -1
  8. package/QrCode.js +57 -0
  9. package/Switch.js +1 -1
  10. package/Tour.js +63 -0
  11. package/Trigger.js +2 -2
  12. package/_virtual/_commonjsHelpers.js +6 -0
  13. package/_virtual/index.js +7 -0
  14. package/_virtual/index2.js +4 -0
  15. package/affix/index.js +70 -72
  16. package/alert/index.js +52 -51
  17. package/anchor/Anchor.js +55 -55
  18. package/anchor/Link.js +34 -34
  19. package/anchor/util.js +5 -5
  20. package/auto-complete/index.js +116 -122
  21. package/avatar/Avatar.js +33 -33
  22. package/avatar/Group.js +26 -26
  23. package/back-top/index.js +58 -61
  24. package/badge/index.js +46 -46
  25. package/breadcrumb/Item.js +42 -43
  26. package/breadcrumb/index.js +47 -47
  27. package/button/Group.js +6 -6
  28. package/button/index.js +91 -91
  29. package/calendar/Month.js +75 -75
  30. package/calendar/Year.js +35 -35
  31. package/calendar/header/index.js +25 -25
  32. package/calendar/index.js +103 -103
  33. package/card/Grid.js +8 -8
  34. package/card/Meta.js +16 -16
  35. package/card/index.js +49 -49
  36. package/carousel/Arrow.js +19 -19
  37. package/carousel/Indicator.js +26 -26
  38. package/carousel/index.js +108 -108
  39. package/cascader/Cascader.js +178 -191
  40. package/cascader/base/node.js +133 -136
  41. package/cascader/base/store.js +82 -85
  42. package/cascader/panel/List.js +126 -130
  43. package/cascader/panel/Search.js +79 -81
  44. package/cascader/util.js +13 -13
  45. package/checkbox/Checkbox.js +94 -96
  46. package/checkbox/Group.js +54 -56
  47. package/checkbox/GroupBlock.js +28 -29
  48. package/collapse/Collapse.js +45 -45
  49. package/collapse/Item.js +53 -55
  50. package/color-picker/ControlBar.js +43 -43
  51. package/color-picker/InputAlpha.js +12 -12
  52. package/color-picker/InputHex.js +30 -31
  53. package/color-picker/InputRgb.js +24 -24
  54. package/color-picker/Palette.js +18 -18
  55. package/color-picker/Panel.js +122 -125
  56. package/color-picker/hooks/useColorPicker.js +85 -88
  57. package/color-picker/hooks/useControlBlock.js +38 -40
  58. package/color-picker/index.js +47 -47
  59. package/comment/index.js +29 -29
  60. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  61. package/components/common/hooks/useForceUpdate.js +6 -2
  62. package/components/common/hooks/useId.js +4 -4
  63. package/components/common/hooks/useInView.js +16 -16
  64. package/components/common/hooks/useIntersectionObserver.js +1 -1
  65. package/components/common/hooks/useKeyboardEvent.js +9 -10
  66. package/components/common/hooks/useOverflowHidden.js +1 -4
  67. package/components/common/hooks/usePersistCallback.js +7 -7
  68. package/components/common/hooks/useStateCallback.js +9 -10
  69. package/components/common/hooks/useWindowSize.js +8 -8
  70. package/components/common/space/index.js +11 -10
  71. package/components/common/utils/PqbCSSTransition.js +1 -1
  72. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  73. package/components/common/utils/dom.js +27 -29
  74. package/components/common/utils/findScrollParent.js +17 -0
  75. package/components/common/utils/intersectionObserver.js +21 -0
  76. package/components/common/utils/is.js +99 -109
  77. package/components/common/utils/mutationObserver.js +19 -0
  78. package/components/common/utils/reactDOM.js +34 -34
  79. package/components/common/utils/resizeObserver.js +21 -0
  80. package/copy/index.js +38 -40
  81. package/date-picker/Picker.js +290 -295
  82. package/date-picker/RangePicker.js +367 -372
  83. package/date-picker/index.js +33 -35
  84. package/date-picker/panel/Body.js +46 -47
  85. package/date-picker/panel/Header.js +33 -33
  86. package/date-picker/panel/Shortcut.js +31 -31
  87. package/date-picker/panel/date/index.js +85 -85
  88. package/date-picker/panel/month/index.js +59 -59
  89. package/date-picker/panel/quarter/index.js +67 -70
  90. package/date-picker/panel/range/index.js +101 -101
  91. package/date-picker/panel/year/index.js +39 -39
  92. package/date-picker/util.js +17 -18
  93. package/descriptions/index.js +62 -62
  94. package/details/index.js +55 -56
  95. package/development/index.js +9 -9
  96. package/dist/react-transition-group/src/CSSTransition.js +1 -1
  97. package/dist/react-transition-group/src/SwitchTransition.js +1 -1
  98. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  99. package/dist/tween/src/tween.js +24 -25
  100. package/dist/validate/src/index.js +5 -5
  101. package/dist/validate/src/util.js +1 -1
  102. package/divider/index.js +21 -21
  103. package/draggable/Item.js +35 -35
  104. package/draggable/index.js +22 -22
  105. package/drawer/Drawer.js +142 -147
  106. package/dropdown/Button.js +48 -48
  107. package/dropdown/index.js +88 -92
  108. package/empty/index.js +16 -16
  109. package/form/Control.js +211 -225
  110. package/form/Form.js +109 -113
  111. package/form/FormItem.js +118 -120
  112. package/form/FormList.js +60 -66
  113. package/form/FormProvider.js +31 -34
  114. package/form/hook/useContext.js +17 -19
  115. package/form/hook/useState.js +22 -23
  116. package/form/hook/useWatch.js +26 -27
  117. package/form/promisify.js +14 -18
  118. package/form/store.js +304 -316
  119. package/form/util.js +14 -15
  120. package/grid/Col.js +64 -64
  121. package/grid/Grid.js +51 -51
  122. package/grid/GridItem.js +48 -48
  123. package/grid/Row.js +39 -39
  124. package/hooks/index.js +50 -52
  125. package/hooks/useVerificationCode.js +41 -43
  126. package/hooks/useWatermark.js +89 -92
  127. package/icon/index.js +23 -24
  128. package/icon-hover/index.js +16 -16
  129. package/icons/file.js +11 -11
  130. package/image/Image.js +140 -141
  131. package/image/ImagePreview.js +252 -255
  132. package/image/ImagePreviewArrow.js +25 -25
  133. package/image/ImagePreviewGroup.js +62 -62
  134. package/image/util/getScale.js +25 -28
  135. package/index.js +682 -679
  136. package/input/Button.js +48 -50
  137. package/input/Group.js +9 -9
  138. package/input/Input.js +145 -154
  139. package/input/InputElement.js +108 -115
  140. package/input/Password.js +38 -38
  141. package/input/Search.js +51 -55
  142. package/input/Textarea.js +80 -81
  143. package/input/useComposition.js +23 -23
  144. package/input-number/decimal.js +59 -62
  145. package/input-number/index.js +139 -141
  146. package/input-tag/InputTag.js +223 -231
  147. package/layout/Content.js +6 -6
  148. package/layout/Footer.js +8 -8
  149. package/layout/Header.js +7 -7
  150. package/layout/Sider.js +88 -90
  151. package/layout/index.js +30 -30
  152. package/link/index.js +45 -46
  153. package/liquid-fill/LiquidFill.js +189 -0
  154. package/liquid-fill/LiquidFill2.js +3 -0
  155. package/liquid-fill/index.js +4 -0
  156. package/liquid-fill/interface.js +1 -0
  157. package/list/Item.js +28 -28
  158. package/list/Meta.js +12 -12
  159. package/list/index.js +146 -148
  160. package/mentions/index.js +75 -76
  161. package/menu/Item.js +58 -58
  162. package/menu/Menu.js +125 -127
  163. package/menu/OverflowWrap.js +39 -40
  164. package/menu/sub-menu/Inline.js +45 -45
  165. package/menu/util.js +26 -28
  166. package/message/index.js +97 -100
  167. package/message/useMessage.js +26 -27
  168. package/modal/Confirm.js +47 -49
  169. package/modal/Modal.js +250 -257
  170. package/modal/use-modal/Hook.js +26 -28
  171. package/modal/use-modal/index.js +46 -49
  172. package/notice/index.js +89 -90
  173. package/notification/index.js +61 -66
  174. package/notification/withNotification.js +35 -35
  175. package/overflow-ellipsis/OverflowItem.js +19 -20
  176. package/overflow-ellipsis/index.js +45 -46
  177. package/package.json +1 -1
  178. package/page-header/index.js +45 -45
  179. package/pagination/PageItem.js +87 -91
  180. package/pagination/PageJumper.js +40 -41
  181. package/pagination/PageOption.js +31 -35
  182. package/pagination/Pagination.js +162 -163
  183. package/picker/Input.js +90 -96
  184. package/picker/InputRange.js +115 -122
  185. package/popconfirm/index.js +98 -100
  186. package/popover/index.js +28 -28
  187. package/portal/Portal.js +10 -11
  188. package/progress/index.js +36 -36
  189. package/qr-code/index.js +99 -0
  190. package/qr-code/interface.js +1 -0
  191. package/radio/Group.js +48 -48
  192. package/radio/GroupBlock.js +32 -33
  193. package/radio/Radio.js +62 -64
  194. package/rate/index.js +88 -88
  195. package/resize-box/ResizeTrigger.js +39 -39
  196. package/resize-box/Split.js +92 -96
  197. package/resize-box/SplitGroup.js +116 -122
  198. package/resize-box/index.js +112 -115
  199. package/result/index.js +44 -44
  200. package/select/Option.js +53 -56
  201. package/select/Select.js +365 -381
  202. package/select/util.js +95 -99
  203. package/select-view/Core.js +159 -160
  204. package/skeleton/index.js +23 -23
  205. package/slider/Button.js +84 -92
  206. package/slider/Input.js +47 -49
  207. package/slider/Tick.js +28 -31
  208. package/slider/index.js +108 -108
  209. package/slider/util.js +1 -1
  210. package/space/index.js +26 -26
  211. package/space-/index.js +51 -51
  212. package/spin/DotLoading.js +8 -8
  213. package/spin/index.js +47 -47
  214. package/statistic/Countdown.js +37 -37
  215. package/statistic/index.js +61 -61
  216. package/steps/Step.js +42 -42
  217. package/steps/index.js +54 -54
  218. package/style.css +1 -1
  219. package/switch/index.js +78 -79
  220. package/table/ColGroup.js +36 -37
  221. package/table/Table.js +447 -450
  222. package/table/hook/useExpand.js +24 -24
  223. package/table/hook/useRowSelection.js +62 -62
  224. package/table/summary/Row.js +16 -17
  225. package/table/tbody/Td.js +119 -118
  226. package/table/tbody/Tr.js +119 -121
  227. package/table/tbody/index.js +62 -63
  228. package/table/th-resizable/index.js +30 -30
  229. package/table/thead/Column.js +148 -148
  230. package/table/thead/index.js +87 -88
  231. package/tabs/Tab.js +55 -55
  232. package/tabs/TabContent.js +8 -8
  233. package/tabs/TabPane.js +15 -15
  234. package/tabs/hook/useHeaderScroll.js +36 -36
  235. package/tabs/tab-header/TabInk.js +31 -33
  236. package/tabs/tab-header/TabNavIcon.js +34 -35
  237. package/tabs/tab-header/index.js +192 -195
  238. package/tag/index.js +94 -97
  239. package/time-picker/Picker.js +167 -172
  240. package/time-picker/RangePicker.js +28 -28
  241. package/time-picker/TimePicker.js +146 -146
  242. package/time-picker/util.js +4 -4
  243. package/timeline/Item.js +46 -46
  244. package/timeline/Timeline.js +52 -52
  245. package/tooltip/index.js +89 -95
  246. package/tour/index.js +289 -0
  247. package/transfer/Item.js +54 -54
  248. package/transfer/List.js +134 -136
  249. package/transfer/index.js +91 -91
  250. package/tree/Animation.js +49 -52
  251. package/tree/Node.js +114 -122
  252. package/tree/NodeList.js +51 -51
  253. package/tree/Tree.js +386 -393
  254. package/tree-select/List.js +71 -72
  255. package/tree-select/Select.js +135 -143
  256. package/tree-select/hook/useKeyCache.js +39 -39
  257. package/tree-select/hook/useStateValue.js +12 -12
  258. package/trigger/getPopupStyle.js +60 -61
  259. package/trigger/index.js +338 -347
  260. package/types/common/space/interface.d.ts +1 -1
  261. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  262. package/types/common/utils/findScrollParent.d.ts +2 -0
  263. package/types/common/utils/index.d.ts +5 -0
  264. package/types/common/utils/intersectionObserver.d.ts +2 -0
  265. package/types/common/utils/math.d.ts +1 -1
  266. package/types/common/utils/mutationObserver.d.ts +2 -0
  267. package/types/common/utils/resizeObserver.d.ts +2 -0
  268. package/types/pc/alert/interface.d.ts +2 -2
  269. package/types/pc/details/interface.d.ts +2 -2
  270. package/types/pc/hooks/index.d.ts +0 -1
  271. package/types/pc/index.d.ts +3 -0
  272. package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
  273. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  274. package/types/pc/liquid-fill/index.d.ts +4 -0
  275. package/types/pc/liquid-fill/interface.d.ts +0 -0
  276. package/types/pc/qr-code/index.d.ts +34 -0
  277. package/types/pc/qr-code/interface.d.ts +39 -0
  278. package/types/pc/table/interface.d.ts +2 -2
  279. package/types/pc/tour/index.d.ts +42 -0
  280. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  281. package/types/pc/utils/findScrollParent.d.ts +2 -0
  282. package/types/pc/utils/index.d.ts +5 -0
  283. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  284. package/types/pc/utils/math.d.ts +1 -1
  285. package/types/pc/utils/mutationObserver.d.ts +2 -0
  286. package/types/pc/utils/names.d.ts +18 -0
  287. package/types/pc/utils/resizeObserver.d.ts +2 -0
  288. package/typography/Base.js +79 -81
  289. package/typography/EditContent.js +30 -33
  290. package/typography/Ellipsis.js +78 -75
  291. package/typography/Operations.js +50 -52
  292. package/typography/Paragraph.js +7 -7
  293. package/typography/Typography.js +7 -7
  294. package/typography/useEllipsis.js +105 -106
  295. package/upload/TriggerNode.js +69 -76
  296. package/upload/Upload.js +84 -87
  297. package/upload/Uploader.js +115 -118
  298. package/upload/list/PictureItem.js +61 -71
  299. package/upload/list/TextItem.js +61 -67
  300. package/upload/list/UploadProgress.js +42 -49
  301. package/upload/list/index.js +49 -50
  302. package/upload/request_.js +37 -38
  303. package/upload/util.js +39 -39
  304. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  305. package/utils/findScrollParent.js +4 -0
  306. package/utils/index.js +274 -275
  307. package/utils/intersectionObserver.js +4 -0
  308. package/utils/math.js +7 -11
  309. package/utils/mutationObserver.js +4 -0
  310. package/utils/names.js +12 -0
  311. package/utils/reactTransitionGroup.js +1 -1
  312. package/utils/resizeObserver.js +4 -0
  313. package/verification-code/VerificationCode.js +50 -51
  314. package/version/index.js +1 -1
  315. package/virtual-list/VirtualList.js +243 -244
  316. package/virtual-list/util/item.js +3 -4
  317. package/watermark/Watermark.js +27 -31
  318. package/components/common/hooks/useComputedState.js +0 -11
  319. package/components/common/utils/resizeObserverEffect.js +0 -23
  320. package/hooks/useComputedState.js +0 -4
  321. package/types/common/hooks/useComputedState.d.ts +0 -4
  322. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  323. package/types/pc/hooks/useComputedState.d.ts +0 -1
  324. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  325. package/utils/resizeObserverEffect.js +0 -4
  326. /package/dist/react-transition-group/chunk/{C6QwjD4L.js → CPfP7aNL.js} +0 -0
package/slider/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { jsx as v, jsxs as oe } from "react/jsx-runtime";
2
- import { divide 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";
1
+ import { jsx as v, jsxs as te } from "react/jsx-runtime";
2
+ import { div as Fe, plus as Je, times as qe } from "@unicom-cloud/utils/math";
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/slider/util.js CHANGED
@@ -1,4 +1,4 @@
1
- import { minus as i, times as d, plus as m, divide as l } from "@unicom-cloud/utils/math";
1
+ import { minus as i, times as d, plus as m, div as l } from "@unicom-cloud/utils/math";
2
2
  function I(t) {
3
3
  const n = `${t}`.split(".")[1];
4
4
  return n && n.length || 0;
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
  };