@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/input/Textarea.js CHANGED
@@ -1,57 +1,57 @@
1
- import { jsx as m, jsxs as A } from "react/jsx-runtime";
1
+ import { jsx as u, jsxs as V } from "react/jsx-runtime";
2
2
  import Z from "@unicom-cloud/icons/IconUiClose";
3
3
  import _, { useRef as ee, useState as te, useContext as oe, useImperativeHandle as re, useMemo as ne } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import ae from "../components/common/hooks/useIsomorphicLayoutEffect.js";
6
6
  import le from "../components/common/hooks/useMergeValue.js";
7
7
  import se from "../icon-hover/index.js";
8
- import C from "@unicom-cloud/utils/class-name";
8
+ import g from "@unicom-cloud/utils/class-name";
9
9
  import "../components/common/utils/is.js";
10
10
  import { omit as ie } from "../components/common/utils/omit.js";
11
- import { formatValue as L } from "./Input.js";
11
+ import { formatValue as D } from "./Input.js";
12
12
  import ce from "./autoSizeTextAreaHeight.js";
13
13
  import ue from "./useComposition.js";
14
14
  import me from "../config-provider/context.js";
15
- import { isPlainObject as T } from "@unicom-cloud/utils/is";
16
- const fe = (n, H) => {
15
+ import { isPlainObject as b } from "@unicom-cloud/utils/is";
16
+ const fe = (n, A) => {
17
17
  const {
18
- className: M,
19
- style: R,
20
- wrapperStyle: k,
21
- placeholder: I,
18
+ className: L,
19
+ style: T,
20
+ wrapperStyle: H,
21
+ placeholder: M,
22
22
  disabled: i,
23
- error: z,
23
+ error: R,
24
24
  maxLength: a,
25
- showWordLimit: v,
26
- allowClear: f,
27
- onChange: E,
28
- onClear: d,
29
- onKeyDown: W,
30
- onPressEnter: j,
31
- status: O,
32
- clearIcon: w,
33
- ...P
34
- } = n, l = T(a) ? a.length : a, r = T(a) ? a.errorOnly ? void 0 : a.length : a, t = ee(), [y, K] = te({}), [s, U] = le("", {
35
- defaultValue: "defaultValue" in n ? L(n.defaultValue, r) : void 0,
36
- value: "value" in n ? L(n.value, r) : void 0
25
+ showWordLimit: h,
26
+ allowClear: m,
27
+ onChange: k,
28
+ onClear: I,
29
+ onKeyDown: z,
30
+ onPressEnter: E,
31
+ status: P,
32
+ clearIcon: C,
33
+ ...W
34
+ } = n, l = b(a) ? a.length : a, r = b(a) ? a.errorOnly ? void 0 : a.length : a, t = ee(), [x, j] = te({}), [s, O] = le("", {
35
+ defaultValue: "defaultValue" in n ? D(n.defaultValue, r) : void 0,
36
+ value: "value" in n ? D(n.value, r) : void 0
37
37
  }), {
38
- compositionValue: F,
39
- compositionHandler: p,
40
- valueChangeHandler: q,
41
- keyDownHandler: B,
42
- triggerValueChangeCallback: G
38
+ compositionValue: K,
39
+ compositionHandler: f,
40
+ valueChangeHandler: U,
41
+ keyDownHandler: F,
42
+ triggerValueChangeCallback: q
43
43
  } = ue({
44
44
  value: s,
45
45
  maxLength: r,
46
- onChange: E,
47
- onKeyDown: W,
48
- onPressEnter: j,
46
+ onChange: k,
47
+ onKeyDown: z,
48
+ onPressEnter: E,
49
49
  beforeTriggerValueChangeCallback: (e) => {
50
- !("value" in n) && (r === void 0 || e.length <= r) && U(e);
50
+ !("value" in n) && (r === void 0 || e.length <= r) && O(e);
51
51
  }
52
- }), S = F || s || "", { getPrefixCls: h, rtl: g } = oe(me), o = h == null ? void 0 : h("textarea");
53
- i && (y.resize = "none");
54
- const $ = () => {
52
+ }), v = K || s || "", { getPrefixCls: B, rtl: d } = oe(me), o = B?.("textarea");
53
+ i && (x.resize = "none");
54
+ const w = () => {
55
55
  if (t.current && t.current.focus) {
56
56
  if (t.current.setSelectionRange) {
57
57
  const e = t.current.textContent.length;
@@ -59,98 +59,97 @@ const fe = (n, H) => {
59
59
  }
60
60
  t.current.focus();
61
61
  }
62
- }, J = () => {
62
+ }, G = () => {
63
63
  const e = ce(
64
64
  n.autoSize,
65
65
  t.current
66
66
  );
67
- e && K(e);
68
- }, N = (e) => {
69
- e.stopPropagation(), $(), G("", e), d == null || d();
67
+ e && j(e);
68
+ }, y = (e) => {
69
+ e.stopPropagation(), w(), q("", e), I?.();
70
70
  };
71
71
  ae(() => {
72
- J();
73
- }, [S]), re(
74
- H,
72
+ G();
73
+ }, [v]), re(
74
+ A,
75
75
  () => ({
76
76
  dom: t.current,
77
77
  focus: () => {
78
- $();
78
+ w();
79
79
  },
80
80
  blur: () => {
81
- var e, u;
82
- (u = (e = t.current) == null ? void 0 : e.blur) == null || u.call(e);
81
+ t.current?.blur?.();
83
82
  },
84
83
  getRootDOMNode: () => t.current
85
84
  }),
86
85
  []
87
86
  );
88
- const c = s ? s.length : 0, Q = l && v || f, V = ne(() => !r && l ? c > l : !1, [c, l, r]), D = O || (z || V ? "error" : void 0), X = C(
87
+ const c = s ? s.length : 0, J = l && h || m, S = ne(() => !r && l ? c > l : !1, [c, l, r]), $ = P || (R || S ? "error" : void 0), Q = g(
89
88
  o,
90
89
  {
91
- [`${o}-${D}`]: D,
90
+ [`${o}-${$}`]: $,
92
91
  // [`${prefixCls}-error`]: error || lengthError || status === 'error',
93
92
  [`${o}-disabled`]: i,
94
- [`${o}-rtl`]: g
93
+ [`${o}-rtl`]: d
95
94
  },
96
- M
97
- ), b = /* @__PURE__ */ m(
95
+ L
96
+ ), N = /* @__PURE__ */ u(
98
97
  "textarea",
99
98
  {
100
- ...ie(P, ["autoSize", "defaultValue"]),
99
+ ...ie(W, ["autoSize", "defaultValue"]),
101
100
  maxLength: r,
102
101
  ref: t,
103
- style: { ...R, ...y },
104
- className: X,
105
- placeholder: I,
102
+ style: { ...T, ...x },
103
+ className: Q,
104
+ placeholder: M,
106
105
  disabled: i,
107
- value: S,
108
- onChange: q,
109
- onKeyDown: B,
110
- onCompositionStart: p,
111
- onCompositionUpdate: p,
112
- onCompositionEnd: p
106
+ value: v,
107
+ onChange: U,
108
+ onKeyDown: F,
109
+ onCompositionStart: f,
110
+ onCompositionUpdate: f,
111
+ onCompositionEnd: f
113
112
  }
114
113
  );
115
- if (Q) {
116
- const e = !i && f && s, [u, Y] = g ? [l, c] : [c, l];
117
- return /* @__PURE__ */ A(
114
+ if (J) {
115
+ const e = !i && m && s, [X, Y] = d ? [l, c] : [c, l];
116
+ return /* @__PURE__ */ V(
118
117
  "div",
119
118
  {
120
- className: C(`${o}-wrapper`, {
121
- [`${o}-clear-wrapper`]: f,
122
- [`${o}-wrapper-rtl`]: g
119
+ className: g(`${o}-wrapper`, {
120
+ [`${o}-clear-wrapper`]: m,
121
+ [`${o}-wrapper-rtl`]: d
123
122
  }),
124
- style: k,
123
+ style: H,
125
124
  children: [
126
- b,
127
- e ? w !== void 0 ? /* @__PURE__ */ m(
125
+ N,
126
+ e ? C !== void 0 ? /* @__PURE__ */ u(
128
127
  "span",
129
128
  {
130
129
  className: `${o}-clear-icon`,
131
- onClick: N,
132
- onMouseDown: (x) => {
133
- x.preventDefault();
130
+ onClick: y,
131
+ onMouseDown: (p) => {
132
+ p.preventDefault();
134
133
  },
135
- children: w
134
+ children: C
136
135
  }
137
- ) : /* @__PURE__ */ m(se, { className: `${o}-clear-icon`, children: /* @__PURE__ */ m(
136
+ ) : /* @__PURE__ */ u(se, { className: `${o}-clear-icon`, children: /* @__PURE__ */ u(
138
137
  Z,
139
138
  {
140
- onClick: N,
141
- onMouseDown: (x) => {
142
- x.preventDefault();
139
+ onClick: y,
140
+ onMouseDown: (p) => {
141
+ p.preventDefault();
143
142
  }
144
143
  }
145
144
  ) }) : null,
146
- l && v && /* @__PURE__ */ A(
145
+ l && h && /* @__PURE__ */ V(
147
146
  "span",
148
147
  {
149
- className: C(`${o}-word-limit`, {
150
- [`${o}-word-limit-error`]: V
148
+ className: g(`${o}-word-limit`, {
149
+ [`${o}-word-limit-error`]: S
151
150
  }),
152
151
  children: [
153
- u,
152
+ X,
154
153
  "/",
155
154
  Y
156
155
  ]
@@ -160,7 +159,7 @@ const fe = (n, H) => {
160
159
  }
161
160
  );
162
161
  }
163
- return b;
162
+ return N;
164
163
  }, de = _.forwardRef(fe);
165
164
  de.displayName = "TextArea";
166
165
  export {
@@ -1,39 +1,39 @@
1
- import { useRef as d, useState as k } from "react";
1
+ import { useRef as d, useState as v } from "react";
2
2
  import { Enter as y } from "@unicom-cloud/utils/constant/keyboardCode";
3
- function S({
4
- value: a,
5
- maxLength: v,
6
- onChange: s,
7
- onKeyDown: u,
8
- onPressEnter: f,
9
- beforeTriggerValueChangeCallback: m,
10
- normalizeHandler: r
3
+ function C({
4
+ value: u,
5
+ maxLength: i,
6
+ onChange: f,
7
+ onKeyDown: l,
8
+ onPressEnter: m,
9
+ beforeTriggerValueChangeCallback: s,
10
+ normalizeHandler: p
11
11
  }) {
12
- const c = d(!1), [e, p] = k(""), o = (t, i) => {
13
- m && m(t), // Avoid triggering onChange repeatedly for the same value
12
+ const e = d(!1), [a, r] = v(""), n = (t, o) => {
13
+ s && s(t), // Avoid triggering onChange repeatedly for the same value
14
14
  // Compositionend is earlier than onchange in Firefox, different with chrome
15
- t !== a && (v === void 0 || t.length <= v) && (s == null || s(t, i));
15
+ t !== u && (i === void 0 || t.length <= i) && f?.(t, o);
16
16
  };
17
17
  return {
18
- compositionValue: e,
19
- triggerValueChangeCallback: o,
18
+ compositionValue: a,
19
+ triggerValueChangeCallback: n,
20
20
  compositionHandler: (t) => {
21
- c.current = t.type !== "compositionend", c.current || (p(void 0), o(t.target.value, t));
21
+ e.current = t.type !== "compositionend", e.current || (r(void 0), n(t.target.value, t));
22
22
  },
23
23
  valueChangeHandler: (t) => {
24
- const i = t.target.value;
25
- c.current ? (c.current = !1, p(i)) : (e && p(void 0), o(i, t));
24
+ const o = t.target.value;
25
+ e.current ? (e.current = !1, r(o)) : (a && r(void 0), n(o, t));
26
26
  },
27
27
  keyDownHandler: (t) => {
28
- const i = t.key;
29
- if (!c.current && (u == null || u(t), i === y.key)) {
30
- f == null || f(t);
31
- const l = r == null ? void 0 : r("onPressEnter");
32
- l && o(l(t.target.value), t);
28
+ const o = t.key;
29
+ if (!e.current && (l?.(t), o === y.key)) {
30
+ m?.(t);
31
+ const c = p?.("onPressEnter");
32
+ c && n(c(t.target.value), t);
33
33
  }
34
34
  }
35
35
  };
36
36
  }
37
37
  export {
38
- S as default
38
+ C as default
39
39
  };
@@ -1,16 +1,13 @@
1
- var b = Object.defineProperty;
2
- var I = (n, t, i) => t in n ? b(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
3
- var s = (n, t, i) => I(n, typeof t != "symbol" ? t + "" : t, i);
4
- import { supportBigInt as $, toSafeString as S, validateNumber as E, trimNumber as l, getNumberPrecision as N } from "./util.js";
5
- class g {
1
+ import { supportBigInt as f, toSafeString as N, validateNumber as b, trimNumber as c, getNumberPrecision as d } from "./util.js";
2
+ class h {
3
+ isEmpty;
4
+ isNaN;
5
+ isNegative;
6
+ origin = "";
7
+ integer;
8
+ decimal;
9
+ decimalLen;
6
10
  constructor(t) {
7
- s(this, "isEmpty");
8
- s(this, "isNaN");
9
- s(this, "isNegative");
10
- s(this, "origin", "");
11
- s(this, "integer");
12
- s(this, "decimal");
13
- s(this, "decimalLen");
14
11
  if (this.origin = String(t), !t && t !== 0 || !this.origin.trim()) {
15
12
  this.isEmpty = !0;
16
13
  return;
@@ -19,10 +16,10 @@ class g {
19
16
  this.isNaN = !0;
20
17
  return;
21
18
  }
22
- const i = S(t);
23
- if (E(i)) {
24
- const { negative: e, trimStr: r } = l(i), [u, a = "0"] = r.split(".");
25
- this.isNegative = e, this.integer = BigInt(u), this.decimal = BigInt(a), this.decimalLen = a.length;
19
+ const e = N(t);
20
+ if (b(e)) {
21
+ const { negative: i, trimStr: r } = c(e), [o, n = "0"] = r.split(".");
22
+ this.isNegative = i, this.integer = BigInt(o), this.decimal = BigInt(n), this.decimalLen = n.length;
26
23
  } else
27
24
  this.isNaN = !0;
28
25
  }
@@ -48,28 +45,28 @@ class g {
48
45
  }
49
46
  negate() {
50
47
  const t = this.toString();
51
- return new g(
48
+ return new h(
52
49
  t.startsWith("-") ? t.slice(1) : `-${t}`
53
50
  );
54
51
  }
55
52
  add(t) {
56
- const i = new g(t);
57
- if (i.isInvalid)
53
+ const e = new h(t);
54
+ if (e.isInvalid)
58
55
  return this;
59
56
  if (this.isInvalid)
60
- return i;
61
- const e = Math.max(this.decimalLen, i.decimalLen), r = this.alignDecimal(e), u = i.alignDecimal(e), a = (r + u).toString(), { negativeStr: c, trimStr: h } = l(a), m = `${c}${h.padStart(
62
- e + 1,
57
+ return e;
58
+ const i = Math.max(this.decimalLen, e.decimalLen), r = this.alignDecimal(i), o = e.alignDecimal(i), n = (r + o).toString(), { negativeStr: m, trimStr: u } = c(n), g = `${m}${u.padStart(
59
+ i + 1,
63
60
  "0"
64
61
  )}`;
65
- return new g(
66
- `${m.slice(0, -e)}.${m.slice(
67
- -e
62
+ return new h(
63
+ `${g.slice(0, -i)}.${g.slice(
64
+ -i
68
65
  )}`
69
66
  );
70
67
  }
71
68
  equals(t) {
72
- return this.toString() === (t == null ? void 0 : t.toString());
69
+ return this.toString() === t?.toString();
73
70
  }
74
71
  less(t) {
75
72
  return this.isInvalid || t.isInvalid ? !1 : this.add(t.negate().toString()).toNumber() < 0;
@@ -78,77 +75,77 @@ class g {
78
75
  return this.isNaN ? NaN : Number(this.toString());
79
76
  }
80
77
  toString(t = { safe: !0 }) {
81
- const { safe: i, precision: e } = t, r = i ? this.isInvalid ? "" : l(
78
+ const { safe: e, precision: i } = t, r = e ? this.isInvalid ? "" : c(
82
79
  `${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`
83
80
  ).fullStr : this.origin;
84
- return typeof e == "number" ? d(r, e) : r;
81
+ return typeof i == "number" ? l(r, i) : r;
85
82
  }
86
83
  }
87
- class o {
84
+ class s {
85
+ isEmpty;
86
+ isNaN;
87
+ origin = "";
88
+ number;
88
89
  constructor(t) {
89
- s(this, "isEmpty");
90
- s(this, "isNaN");
91
- s(this, "origin", "");
92
- s(this, "number");
93
90
  this.origin = String(t), this.number = Number(t), !t && t !== 0 || !this.origin.trim() ? this.isEmpty = !0 : this.isNaN = Number.isNaN(this.number);
94
91
  }
95
92
  get isInvalid() {
96
93
  return this.isEmpty || this.isNaN;
97
94
  }
98
95
  negate() {
99
- return new o(-this.toNumber());
96
+ return new s(-this.toNumber());
100
97
  }
101
98
  equals(t) {
102
- return this.toNumber() === (t == null ? void 0 : t.toNumber());
99
+ return this.toNumber() === t?.toNumber();
103
100
  }
104
101
  less(t) {
105
102
  return this.isInvalid || t.isInvalid ? !1 : this.add(t.negate().toString()).toNumber() < 0;
106
103
  }
107
104
  add(t) {
108
- const i = new o(t);
109
- if (i.isInvalid)
105
+ const e = new s(t);
106
+ if (e.isInvalid)
110
107
  return this;
111
108
  if (this.isInvalid)
112
- return i;
113
- const e = this.number + i.number;
114
- if (e > Number.MAX_SAFE_INTEGER)
115
- return new o(Number.MAX_SAFE_INTEGER);
116
- if (e < Number.MIN_SAFE_INTEGER)
117
- return new o(Number.MIN_SAFE_INTEGER);
109
+ return e;
110
+ const i = this.number + e.number;
111
+ if (i > Number.MAX_SAFE_INTEGER)
112
+ return new s(Number.MAX_SAFE_INTEGER);
113
+ if (i < Number.MIN_SAFE_INTEGER)
114
+ return new s(Number.MIN_SAFE_INTEGER);
118
115
  const r = Math.max(
119
- N(this.number),
120
- N(i.number)
116
+ d(this.number),
117
+ d(e.number)
121
118
  );
122
- return new o(e.toFixed(r));
119
+ return new s(i.toFixed(r));
123
120
  }
124
121
  toNumber() {
125
122
  return this.number;
126
123
  }
127
124
  toString(t = { safe: !0 }) {
128
- const { safe: i, precision: e } = t, r = i ? this.isInvalid ? "" : S(this.number) : this.origin;
129
- return typeof e == "number" ? d(r, e) : r;
125
+ const { safe: e, precision: i } = t, r = e ? this.isInvalid ? "" : N(this.number) : this.origin;
126
+ return typeof i == "number" ? l(r, i) : r;
130
127
  }
131
128
  }
132
- function p(n) {
133
- return $() ? new g(n) : new o(n);
129
+ function I(a) {
130
+ return f() ? new h(a) : new s(a);
134
131
  }
135
- function d(n, t, i = !1) {
136
- if (n === "")
132
+ function l(a, t, e = !1) {
133
+ if (a === "")
137
134
  return "";
138
- const e = ".", { negativeStr: r, integerStr: u, decimalStr: a } = l(n), c = `${e}${a}`, h = `${r}${u}`;
135
+ const i = ".", { negativeStr: r, integerStr: o, decimalStr: n } = c(a), m = `${i}${n}`, u = `${r}${o}`;
139
136
  if (t >= 0) {
140
- const m = Number(a[t]);
141
- if (m >= 5 && !i) {
142
- const f = p(n).add(
143
- `${r}0.${"0".repeat(t)}${10 - m}`
137
+ const g = Number(n[t]);
138
+ if (g >= 5 && !e) {
139
+ const S = I(a).add(
140
+ `${r}0.${"0".repeat(t)}${10 - g}`
144
141
  );
145
- return d(f.toString(), t, i);
142
+ return l(S.toString(), t, e);
146
143
  }
147
- return t === 0 ? h : `${h}${e}${a.padEnd(t, "0").slice(0, t)}`;
144
+ return t === 0 ? u : `${u}${i}${n.padEnd(t, "0").slice(0, t)}`;
148
145
  }
149
- return `${h}${c === ".0" ? "" : c}`;
146
+ return `${u}${m === ".0" ? "" : m}`;
150
147
  }
151
148
  export {
152
- p as getDecimal,
153
- d as toFixed
149
+ I as getDecimal,
150
+ l as toFixed
154
151
  };