@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/input/Button.js CHANGED
@@ -1,69 +1,67 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import h from "lodash/isPlainObject";
3
- import $, { useContext as j } from "react";
4
- import k from "../button/index.js";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import d from "lodash/isPlainObject";
3
+ import A, { useContext as B } from "react";
4
+ import M from "../button/index.js";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import z from "../components/common/hooks/useMergeValue.js";
7
- import x from "@unicom-cloud/utils/class-name";
8
- import I, { formatValue as s } from "./Input.js";
9
- import O from "../config-provider/context.js";
10
- const R = $.forwardRef(
11
- (e, C) => {
12
- const { getPrefixCls: m } = j(O), {
13
- className: v,
14
- style: L,
15
- placeholder: N,
16
- disabled: u,
17
- loading: w,
18
- defaultValue: V,
19
- addAfter: f,
6
+ import P from "../components/common/hooks/useMergeValue.js";
7
+ import s from "@unicom-cloud/utils/class-name";
8
+ import $, { formatValue as f } from "./Input.js";
9
+ import j from "../config-provider/context.js";
10
+ const z = A.forwardRef(
11
+ (e, c) => {
12
+ const { getPrefixCls: g } = B(j), {
13
+ className: h,
14
+ style: x,
15
+ placeholder: C,
16
+ disabled: o,
17
+ loading: I,
18
+ defaultValue: b,
19
+ addAfter: l,
20
20
  buttonProps: a,
21
- label: y,
22
- onCallback: i,
23
- ...c
24
- } = e, d = m == null ? void 0 : m("input-button"), o = f === void 0 ? /* @__PURE__ */ g(
25
- k,
21
+ label: v,
22
+ onCallback: L,
23
+ ...i
24
+ } = e, n = g?.("input-button"), m = l === void 0 ? /* @__PURE__ */ u(
25
+ M,
26
26
  {
27
27
  type: "primary",
28
- disabled: u,
29
- size: c.size,
28
+ disabled: o,
29
+ size: i.size,
30
30
  loadingFixedWidth: !0,
31
31
  ...a,
32
- className: x(`${d}-btn`, a == null ? void 0 : a.className),
32
+ className: s(`${n}-btn`, a?.className),
33
33
  onClick: (t) => {
34
- var l, n;
35
- i == null || i(B), (l = e.onClick) == null || l.call(e, t), (n = a == null ? void 0 : a.onClick) == null || n.call(a, t);
34
+ L?.(V), e.onClick?.(t), a?.onClick?.(t);
36
35
  },
37
- children: y ?? "确定"
36
+ children: v ?? "确定"
38
37
  }
39
- ) : f, A = h(e.maxLength) ? e.maxLength.length : e.maxLength, r = h(e.maxLength) && e.maxLength.errorOnly ? void 0 : A, [B, M] = z("", {
40
- defaultValue: "defaultValue" in e ? s(e.defaultValue, r) : void 0,
41
- value: "value" in e ? s(e.value, r) : void 0
38
+ ) : l, N = d(e.maxLength) ? e.maxLength.length : e.maxLength, r = d(e.maxLength) && e.maxLength.errorOnly ? void 0 : N, [V, y] = P("", {
39
+ defaultValue: "defaultValue" in e ? f(e.defaultValue, r) : void 0,
40
+ value: "value" in e ? f(e.value, r) : void 0
42
41
  });
43
- return /* @__PURE__ */ g(
44
- I,
42
+ return /* @__PURE__ */ u(
43
+ $,
45
44
  {
46
- ...c,
47
- className: x(
48
- d,
49
- o && `${d}-has-after`,
50
- v
45
+ ...i,
46
+ className: s(
47
+ n,
48
+ m && `${n}-has-after`,
49
+ h
51
50
  ),
52
- style: L,
53
- ref: C,
54
- defaultValue: V,
55
- placeholder: N,
56
- addAfter: o,
57
- disabled: u,
58
- onChange: (t, l) => {
59
- var n;
60
- M(t), (n = e.onChange) == null || n.call(e, t, l);
51
+ style: x,
52
+ ref: c,
53
+ defaultValue: b,
54
+ placeholder: C,
55
+ addAfter: m,
56
+ disabled: o,
57
+ onChange: (t, k) => {
58
+ y(t), e.onChange?.(t, k);
61
59
  }
62
60
  }
63
61
  );
64
62
  }
65
63
  );
66
- R.displayName = "Input.Button";
64
+ z.displayName = "Input.Button";
67
65
  export {
68
- R as default
66
+ z as default
69
67
  };
package/input/Group.js CHANGED
@@ -1,19 +1,19 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import l, { useContext as f } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
4
  import u from "@unicom-cloud/utils/class-name";
5
- import N from "../config-provider/context.js";
6
- const d = l.forwardRef((s, r) => {
7
- const { getPrefixCls: o } = f(N), { className: a, style: m, children: c, compact: e, ...p } = s, t = o == null ? void 0 : o("input-group"), n = u(
5
+ import x from "../config-provider/context.js";
6
+ const N = l.forwardRef((o, s) => {
7
+ const { getPrefixCls: r } = f(x), { className: e, style: a, children: m, compact: c, ...p } = o, t = r?.("input-group"), i = u(
8
8
  t,
9
9
  {
10
- [`${t}-compact`]: e
10
+ [`${t}-compact`]: c
11
11
  },
12
- a
12
+ e
13
13
  );
14
- return /* @__PURE__ */ i("div", { ref: r, className: n, style: m, ...p, children: c });
14
+ return /* @__PURE__ */ n("div", { ref: s, className: i, style: a, ...p, children: m });
15
15
  });
16
- d.displayName = "InputGroup";
16
+ N.displayName = "InputGroup";
17
17
  export {
18
- d as default
18
+ N as default
19
19
  };
package/input/Input.js CHANGED
@@ -1,212 +1,203 @@
1
- import { jsxs as A, jsx as I } from "react/jsx-runtime";
2
- import ar from "lodash/isNil";
3
- import F from "lodash/isPlainObject";
4
- import ur from "lodash/isString";
5
- import { forwardRef as ir, useContext as pr, useState as lr, useRef as V, useImperativeHandle as cr, useMemo as fr } from "react";
1
+ import { jsxs as R, jsx as $ } from "react/jsx-runtime";
2
+ import nr from "lodash/isNil";
3
+ import B from "lodash/isPlainObject";
4
+ import sr from "lodash/isString";
5
+ import { forwardRef as ar, useContext as ir, useState as ur, useRef as A, useImperativeHandle as pr, useMemo as lr } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
- import mr from "../components/common/hooks/useMergeProps.js";
8
- import dr from "../components/common/hooks/useMergeValue.js";
9
- import $ from "@unicom-cloud/utils/class-name";
10
- import { contains as q } from "../components/common/utils/dom.js";
11
- import K from "./Button.js";
12
- import gr from "./Group.js";
13
- import hr from "./InputElement.js";
14
- import Q from "../input-number/index.js";
15
- import wr from "./Password.js";
16
- import $r from "./Search.js";
17
- import X from "../input-tag/InputTag.js";
18
- import xr from "./Textarea.js";
19
- import Ir from "../config-provider/context.js";
20
- const Nr = (o) => {
7
+ import cr from "../components/common/hooks/useMergeProps.js";
8
+ import fr from "../components/common/hooks/useMergeValue.js";
9
+ import h from "@unicom-cloud/utils/class-name";
10
+ import { contains as O } from "../components/common/utils/dom.js";
11
+ import U from "./Button.js";
12
+ import mr from "./Group.js";
13
+ import dr from "./InputElement.js";
14
+ import q from "../input-number/index.js";
15
+ import gr from "./Password.js";
16
+ import hr from "./Search.js";
17
+ import J from "../input-tag/InputTag.js";
18
+ import wr from "./Textarea.js";
19
+ import $r from "../config-provider/context.js";
20
+ const xr = (o) => {
21
21
  o.target.tagName === "INPUT" || o.preventDefault();
22
- }, x = (o, p, a = {}, N) => p ? /* @__PURE__ */ I("span", { style: a, className: o, onClick: N, children: p }) : null;
23
- function J(o, p) {
22
+ }, w = (o, i, a = {}, x) => i ? /* @__PURE__ */ $("span", { style: a, className: o, onClick: x, children: i }) : null;
23
+ function H(o, i) {
24
24
  let a = o || "";
25
- return ur(o) || ar(o) || (a = String(o)), p && (a = a.slice(0, p)), a;
25
+ return sr(o) || nr(o) || (a = String(o)), i && (a = a.slice(0, i)), a;
26
26
  }
27
- function br(o, p) {
27
+ function Ir(o, i) {
28
28
  const {
29
29
  getPrefixCls: a,
30
- size: N,
31
- componentConfig: b,
32
- rtl: C
33
- } = pr(Ir), e = mr(
30
+ size: x,
31
+ componentConfig: K,
32
+ rtl: I
33
+ } = ir($r), e = cr(
34
34
  o,
35
35
  {},
36
- b == null ? void 0 : b.Input
36
+ K?.Input
37
37
  ), {
38
- className: D,
39
- style: Y,
40
- addBefore: z,
41
- addAfter: L,
42
- suffix: Z,
43
- prefix: W,
44
- beforeStyle: _,
45
- afterStyle: rr,
46
- height: j,
47
- disabled: k,
48
- maxLength: c,
49
- showWordLimit: er,
50
- allowClear: v,
51
- autoWidth: S
52
- } = e, u = S ? {
38
+ className: F,
39
+ style: Q,
40
+ addBefore: V,
41
+ addAfter: D,
42
+ suffix: X,
43
+ prefix: N,
44
+ beforeStyle: Y,
45
+ afterStyle: Z,
46
+ height: z,
47
+ disabled: L,
48
+ maxLength: p,
49
+ showWordLimit: _,
50
+ allowClear: C,
51
+ autoWidth: W
52
+ } = e, l = W ? {
53
53
  minWidth: 0,
54
54
  maxWidth: "100%",
55
- ...F(S) ? S : {}
56
- } : null, y = {
57
- minWidth: u == null ? void 0 : u.minWidth,
58
- maxWidth: u == null ? void 0 : u.maxWidth,
59
- width: u && "auto",
60
- ...Y
61
- }, l = F(c) ? c.length : c, d = F(c) && c.errorOnly ? void 0 : l, [tr, E] = lr(!1), i = V(), T = V(), f = V(), [M, nr] = dr("", {
62
- defaultValue: "defaultValue" in e ? J(e.defaultValue, d) : void 0,
63
- value: "value" in e ? J(e.value, d) : void 0
55
+ ...B(W) ? W : {}
56
+ } : null, b = {
57
+ minWidth: l?.minWidth,
58
+ maxWidth: l?.maxWidth,
59
+ width: l && "auto",
60
+ ...Q
61
+ }, u = B(p) ? p.length : p, f = B(p) && p.errorOnly ? void 0 : u, [rr, j] = ur(!1), s = A(), v = A(), c = A(), [S, er] = fr("", {
62
+ defaultValue: "defaultValue" in e ? H(e.defaultValue, f) : void 0,
63
+ value: "value" in e ? H(e.value, f) : void 0
64
64
  });
65
- cr(
66
- p,
67
- () => {
68
- var t, n, m;
69
- return {
70
- focus: (t = i.current) == null ? void 0 : t.focus,
71
- blur: (n = i.current) == null ? void 0 : n.blur,
72
- dom: (m = i.current) == null ? void 0 : m.dom,
73
- // 保持之前逻辑
74
- getRootDOMNode: () => {
75
- var U;
76
- return T.current || ((U = i.current) == null ? void 0 : U.dom);
77
- }
78
- };
79
- },
65
+ pr(
66
+ i,
67
+ () => ({
68
+ focus: s.current?.focus,
69
+ blur: s.current?.blur,
70
+ dom: s.current?.dom,
71
+ // 保持之前逻辑
72
+ getRootDOMNode: () => v.current || s.current?.dom
73
+ }),
80
74
  []
81
75
  );
82
- const or = (t, n) => {
83
- var m;
84
- "value" in e || nr(t), (m = e.onChange) == null || m.call(e, t, n);
85
- }, r = a == null ? void 0 : a("input"), g = e.size || N, R = "height" in e;
86
- let h = Z;
87
- const w = M ? M.length : 0, G = fr(() => !d && l ? w > l : !1, [w, l, d]);
88
- if (l && er) {
89
- const [t, n] = C ? [l, w] : [w, l];
90
- h = /* @__PURE__ */ A(
76
+ const tr = (t, M) => {
77
+ "value" in e || er(t), e.onChange?.(t, M);
78
+ }, r = a?.("input"), m = e.size || x, y = "height" in e;
79
+ let d = X;
80
+ const g = S ? S.length : 0, k = lr(() => !f && u ? g > u : !1, [g, u, f]);
81
+ if (u && _) {
82
+ const [t, M] = I ? [u, g] : [g, u];
83
+ d = /* @__PURE__ */ R(
91
84
  "span",
92
85
  {
93
- className: $(`${r}-word-limit`, {
94
- [`${r}-word-limit-error`]: G
86
+ className: h(`${r}-word-limit`, {
87
+ [`${r}-word-limit-error`]: k
95
88
  }),
96
89
  children: [
97
90
  t,
98
91
  "/",
99
- n
92
+ M
100
93
  ]
101
94
  }
102
95
  );
103
96
  }
104
- const sr = $(
97
+ const or = h(
105
98
  `${r}-group-wrapper`,
106
- `${r}-group-wrapper-${g}`,
99
+ `${r}-group-wrapper-${m}`,
107
100
  {
108
- [`${r}-custom-height`]: R,
109
- [`${r}-has-suffix`]: h,
110
- [`${r}-group-wrapper-disabled`]: k,
111
- [`${r}-group-wrapper-rtl`]: C,
112
- [`${r}-group-wrapper-autowidth`]: u
101
+ [`${r}-custom-height`]: y,
102
+ [`${r}-has-suffix`]: d,
103
+ [`${r}-group-wrapper-disabled`]: L,
104
+ [`${r}-group-wrapper-rtl`]: I,
105
+ [`${r}-group-wrapper-autowidth`]: l
113
106
  },
114
- D
115
- ), B = e.status || (e.error || G ? "error" : void 0), O = z || L || h || W, P = /* @__PURE__ */ I(
116
- hr,
107
+ F
108
+ ), P = e.status || (e.error || k ? "error" : void 0), E = V || D || d || N, T = /* @__PURE__ */ $(
109
+ dr,
117
110
  {
118
- ref: i,
111
+ ref: s,
119
112
  ...e,
120
- autoFitWidth: !!u,
121
- style: y,
122
- status: B,
113
+ autoFitWidth: !!l,
114
+ style: b,
115
+ status: P,
123
116
  onFocus: (t) => {
124
- var n;
125
- E(!0), (n = e.onFocus) == null || n.call(e, t);
117
+ j(!0), e.onFocus?.(t);
126
118
  },
127
119
  onBlur: (t) => {
128
- var n;
129
- E(!1), (n = e.onBlur) == null || n.call(e, t);
120
+ j(!1), e.onBlur?.(t);
130
121
  },
131
- onChange: or,
122
+ onChange: tr,
132
123
  prefixCls: r,
133
- value: M,
134
- hasParent: !!O || v,
135
- size: g
124
+ value: S,
125
+ hasParent: !!E || C,
126
+ size: m
136
127
  }
137
- ), H = $(`${r}-inner-wrapper`, {
138
- [`${r}-inner-wrapper-${B}`]: B,
139
- [`${r}-inner-wrapper-disabled`]: k,
140
- [`${r}-inner-wrapper-focus`]: tr,
141
- [`${r}-inner-wrapper-has-prefix`]: W,
142
- [`${r}-inner-wrapper-${g}`]: g,
143
- [`${r}-clear-wrapper`]: v,
144
- [`${r}-inner-wrapper-rtl`]: C
128
+ ), G = h(`${r}-inner-wrapper`, {
129
+ [`${r}-inner-wrapper-${P}`]: P,
130
+ [`${r}-inner-wrapper-disabled`]: L,
131
+ [`${r}-inner-wrapper-focus`]: rr,
132
+ [`${r}-inner-wrapper-has-prefix`]: N,
133
+ [`${r}-inner-wrapper-${m}`]: m,
134
+ [`${r}-clear-wrapper`]: C,
135
+ [`${r}-inner-wrapper-rtl`]: I
145
136
  });
146
- return O ? /* @__PURE__ */ I(
137
+ return E ? /* @__PURE__ */ $(
147
138
  "div",
148
139
  {
149
- ref: T,
150
- className: sr,
151
- style: { ...y, ...R ? { height: j } : {} },
152
- children: /* @__PURE__ */ A("span", { className: `${r}-group`, children: [
153
- x(`${r}-group-addbefore`, z, _),
154
- /* @__PURE__ */ A(
140
+ ref: v,
141
+ className: or,
142
+ style: { ...b, ...y ? { height: z } : {} },
143
+ children: /* @__PURE__ */ R("span", { className: `${r}-group`, children: [
144
+ w(`${r}-group-addbefore`, V, Y),
145
+ /* @__PURE__ */ R(
155
146
  "span",
156
147
  {
157
- className: H,
158
- ref: f,
148
+ className: G,
149
+ ref: c,
159
150
  onMouseDown: (t) => {
160
- t.target.tagName !== "INPUT" && f.current && q(f.current, t.target) && t.preventDefault();
151
+ t.target.tagName !== "INPUT" && c.current && O(c.current, t.target) && t.preventDefault();
161
152
  },
162
153
  onClick: (t) => {
163
- f.current && q(f.current, t.target) && i.current && i.current.focus();
154
+ c.current && O(c.current, t.target) && s.current && s.current.focus();
164
155
  },
165
156
  children: [
166
- x(`${r}-group-prefix`, W),
167
- P,
168
- x(`${r}-group-suffix`, h)
157
+ w(`${r}-group-prefix`, N),
158
+ T,
159
+ w(`${r}-group-suffix`, d)
169
160
  ]
170
161
  }
171
162
  ),
172
- x(`${r}-group-addafter`, L, rr)
163
+ w(`${r}-group-addafter`, D, Z)
173
164
  ] })
174
165
  }
175
- ) : v ? /* @__PURE__ */ I(
166
+ ) : C ? /* @__PURE__ */ $(
176
167
  "span",
177
168
  {
178
- ref: T,
179
- className: $(D, H),
180
- style: { ...y, ...R ? { height: j } : {} },
181
- onMouseDown: Nr,
169
+ ref: v,
170
+ className: h(F, G),
171
+ style: { ...b, ...y ? { height: z } : {} },
172
+ onMouseDown: xr,
182
173
  onClick: () => {
183
- i.current && i.current.focus();
174
+ s.current && s.current.focus();
184
175
  },
185
- children: P
176
+ children: T
186
177
  }
187
- ) : P;
178
+ ) : T;
188
179
  }
189
- const Cr = ir(br), s = Cr;
190
- s.displayName = "Input";
191
- s.Search = $r;
192
- s.Button = K;
193
- s.InputButton = K;
194
- s.TextArea = xr;
195
- s.Password = wr;
196
- s.Number = Q;
197
- s.InputNumber = Q;
198
- s.Tag = X;
199
- s.InputTag = X;
200
- s.Group = gr;
180
+ const Nr = ar(Ir), n = Nr;
181
+ n.displayName = "Input";
182
+ n.Search = hr;
183
+ n.Button = U;
184
+ n.InputButton = U;
185
+ n.TextArea = wr;
186
+ n.Password = gr;
187
+ n.Number = q;
188
+ n.InputNumber = q;
189
+ n.Tag = J;
190
+ n.InputTag = J;
191
+ n.Group = mr;
201
192
  export {
202
- K as InputButton,
203
- gr as InputGroup,
204
- Q as InputNumber,
205
- wr as InputPassword,
206
- $r as InputSearch,
207
- X as InputTag,
208
- xr as InputTextArea,
209
- xr as TextArea,
210
- s as default,
211
- J as formatValue
193
+ U as InputButton,
194
+ mr as InputGroup,
195
+ q as InputNumber,
196
+ gr as InputPassword,
197
+ hr as InputSearch,
198
+ J as InputTag,
199
+ wr as InputTextArea,
200
+ wr as TextArea,
201
+ n as default,
202
+ H as formatValue
212
203
  };