@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
@@ -1,391 +1,383 @@
1
- import { jsx as i, jsxs as _, Fragment as Ue } from "react/jsx-runtime";
2
- import Ge from "@unicom-cloud/icons/IconUiClose";
1
+ import { jsx as i, jsxs as S, Fragment as Ke } from "react/jsx-runtime";
2
+ import Ue from "@unicom-cloud/icons/IconUiClose";
3
3
  import "../dist/react-transition-group/src/CSSTransition.js";
4
4
  import "../dist/react-transition-group/src/ReplaceTransition.js";
5
5
  import "../dist/react-transition-group/src/SwitchTransition.js";
6
6
  import "../dist/react-transition-group/chunk/CPfP7aNL.js";
7
- import Ke from "../dist/react-transition-group/src/TransitionGroup.js";
8
- import Te from "lodash/isArray";
9
- import Ce, { useContext as qe, useRef as C, useState as Xe, useImperativeHandle as Ye, useMemo as Je, useEffect as Qe } from "react";
7
+ import Ge from "../dist/react-transition-group/src/TransitionGroup.js";
8
+ import me from "lodash/isArray";
9
+ import de, { useContext as qe, useRef as $, useState as Xe, useImperativeHandle as Ye, useMemo as Je, useEffect as Qe } from "react";
10
10
  import "../config-provider/ConfigProvider.js";
11
11
  import Ze from "../draggable/index.js";
12
12
  import et from "../components/common/hooks/useMergeProps.js";
13
- import be from "../components/common/hooks/useMergeValue.js";
13
+ import ie from "../components/common/hooks/useMergeValue.js";
14
14
  import tt from "../icon-hover/index.js";
15
15
  import ot from "../input/InputElement.js";
16
- import at from "../overflow-ellipsis/index.js";
17
- import rt from "../popover/index.js";
18
- import nt from "../tag/index.js";
19
- import A from "@unicom-cloud/utils/class-name";
16
+ import nt from "../overflow-ellipsis/index.js";
17
+ import at from "../popover/index.js";
18
+ import rt from "../tag/index.js";
19
+ import _ from "@unicom-cloud/utils/class-name";
20
20
  import { fillNBSP as st } from "../components/common/utils/fillNBSP.js";
21
21
  import { getHotkeyHandler as lt } from "../components/common/utils/getHotkeyHandler.js";
22
22
  import "../components/common/utils/is.js";
23
23
  import { Backspace as ct } from "@unicom-cloud/utils/constant/keyboardCode";
24
24
  import { omit as it } from "../components/common/utils/omit.js";
25
- import { PqbCSSTransition as ye } from "../components/common/utils/PqbCSSTransition.js";
25
+ import { PqbCSSTransition as ue } from "../components/common/utils/PqbCSSTransition.js";
26
26
  import ut from "../config-provider/context.js";
27
- import { isPlainObject as Ve } from "@unicom-cloud/utils/is";
28
- const X = 300, pt = "responsive", ft = `__input_${Math.random().toFixed(10).slice(2)}`, T = (s) => s == null, M = (s) => {
29
- s.target.tagName !== "INPUT" && s.preventDefault();
30
- }, Ie = (s) => Te(s) ? s.map((c) => Ve(c) ? {
31
- ...c,
32
- label: "label" in c ? c.label : c.value,
33
- value: c.value,
34
- closable: c.closable
27
+ import { isPlainObject as ge } from "@unicom-cloud/utils/is";
28
+ const O = 300, pt = "responsive", ft = `__input_${Math.random().toFixed(10).slice(2)}`, I = (r) => r == null, x = (r) => {
29
+ r.target.tagName !== "INPUT" && r.preventDefault();
30
+ }, pe = (r) => me(r) ? r.map((l) => ge(l) ? {
31
+ ...l,
32
+ label: "label" in l ? l.label : l.value,
33
+ value: l.value,
34
+ closable: l.closable
35
35
  } : {
36
- label: c,
37
- value: c
38
- }) : [], mt = (s) => {
39
- const c = C(0), f = C(s.length);
36
+ label: l,
37
+ value: l
38
+ }) : [], mt = (r) => {
39
+ const l = $(0), m = $(r.length);
40
40
  return Qe(() => {
41
- c.current = s.length === 0 && f.current > 0 ? X : 0, f.current = s.length;
42
- }, [s]), c;
43
- }, $e = ({
44
- prefixCls: s,
45
- children: c,
46
- animation: f
47
- }) => /* @__PURE__ */ i("div", { className: `${s}-inner`, children: f ? /* @__PURE__ */ i(Ke, { component: null, children: c }) : c }), dt = {
41
+ l.current = r.length === 0 && m.current > 0 ? O : 0, m.current = r.length;
42
+ }, [r]), l;
43
+ }, fe = ({
44
+ prefixCls: r,
45
+ children: l,
46
+ animation: m
47
+ }) => /* @__PURE__ */ i("div", { className: `${r}-inner`, children: m ? /* @__PURE__ */ i(Ge, { component: null, children: l }) : l }), dt = {
48
48
  animation: !0,
49
- validate: (s, c) => s && c.every((f) => f.value !== s)
49
+ validate: (r, l) => r && l.every((m) => m.value !== r)
50
50
  };
51
- function gt(s, c) {
51
+ function gt(r, l) {
52
52
  const {
53
- getPrefixCls: f,
54
- size: we,
55
- componentConfig: E,
56
- rtl: Y
57
- } = qe(ut), m = et(
58
- s,
53
+ getPrefixCls: m,
54
+ size: he,
55
+ componentConfig: ve,
56
+ rtl: j
57
+ } = qe(ut), p = et(
58
+ r,
59
59
  dt,
60
- E == null ? void 0 : E.InputTag
60
+ ve?.InputTag
61
61
  ), {
62
- className: Pe,
63
- style: Se,
64
- placeholder: De,
65
- error: Re,
66
- disabled: h,
62
+ className: ye,
63
+ style: Ne,
64
+ placeholder: be,
65
+ error: Ce,
66
+ disabled: v,
67
67
  readOnly: g,
68
- allowClear: _e,
69
- autoFocus: Ae,
70
- labelInValue: Me,
71
- disableInput: Ee,
72
- animation: J,
73
- saveOnBlur: ke,
74
- dragToSort: ze,
75
- icon: N,
76
- prefix: Q,
77
- suffix: Z,
78
- addBefore: ee,
79
- addAfter: te,
80
- tokenSeparators: k,
81
- validate: V,
82
- renderTag: oe,
83
- tagClassName: ae,
68
+ allowClear: Ie,
69
+ autoFocus: $e,
70
+ labelInValue: Te,
71
+ disableInput: Pe,
72
+ animation: B,
73
+ saveOnBlur: we,
74
+ dragToSort: Ve,
75
+ icon: A,
76
+ prefix: H,
77
+ suffix: W,
78
+ addBefore: L,
79
+ addAfter: K,
80
+ tokenSeparators: E,
81
+ validate: T,
82
+ renderTag: U,
83
+ tagClassName: G,
84
84
  maxTagCount: d,
85
- onInputChange: z,
86
- onKeyDown: O,
87
- onPaste: x,
88
- onChange: F,
89
- onFocus: j,
90
- onBlur: H,
91
- onPressEnter: W,
92
- onRemove: L,
93
- onClear: B,
94
- onClick: re,
95
- ...Oe
96
- } = m, o = f == null ? void 0 : f("input-tag"), w = "size" in m ? m.size : we, b = typeof d == "object" ? d.count : d, y = C(), U = C(null), G = C(), [P, ne] = Xe(!1), [a, xe] = be([], {
97
- defaultValue: "defaultValue" in m ? Ie(m.defaultValue) : void 0,
98
- value: "value" in m ? Ie(m.value) : void 0
99
- }), [I, S] = be("", {
100
- value: m.inputValue
101
- }), Fe = mt(a), je = !!(ze && !g && !h);
102
- Ye(c, () => {
103
- var e, t;
104
- return {
105
- blur: (e = y.current) == null ? void 0 : e.blur,
106
- focus: (t = y.current) == null ? void 0 : t.focus,
107
- getRootDOMNode: () => G.current
108
- };
109
- }, []);
110
- const $ = (e, t) => {
111
- h || g || ("value" in m || xe(e), F == null || F(Me ? e : e.map((r) => r == null ? void 0 : r.value), t));
112
- }, se = (e, t, r) => {
113
- L == null || L(e, t, r), $(
114
- [...a.slice(0, t), ...a.slice(t + 1)],
85
+ onInputChange: De,
86
+ onKeyDown: Re,
87
+ onPaste: Se,
88
+ onChange: _e,
89
+ onFocus: xe,
90
+ onBlur: Ae,
91
+ onPressEnter: Ee,
92
+ onRemove: Me,
93
+ onClear: ke,
94
+ onClick: q,
95
+ ...ze
96
+ } = p, o = m?.("input-tag"), P = "size" in p ? p.size : he, y = typeof d == "object" ? d.count : d, N = $(), M = $(null), k = $(), [w, X] = Xe(!1), [n, Fe] = ie([], {
97
+ defaultValue: "defaultValue" in p ? pe(p.defaultValue) : void 0,
98
+ value: "value" in p ? pe(p.value) : void 0
99
+ }), [b, V] = ie("", {
100
+ value: p.inputValue
101
+ }), Oe = mt(n), je = !!(Ve && !g && !v);
102
+ Ye(l, () => ({
103
+ blur: N.current?.blur,
104
+ focus: N.current?.focus,
105
+ getRootDOMNode: () => k.current
106
+ }), []);
107
+ const C = (e, t) => {
108
+ v || g || ("value" in p || Fe(e), _e?.(Te ? e : e.map((c) => c?.value), t));
109
+ }, Y = (e, t, c) => {
110
+ Me?.(e, t, c), C(
111
+ [...n.slice(0, t), ...n.slice(t + 1)],
115
112
  "remove"
116
113
  );
117
- }, He = lt(
114
+ }, Be = lt(
118
115
  /* @__PURE__ */ new Map([
119
116
  [
120
117
  ct.key,
121
118
  (e) => {
122
- if (!e.target.value && a.length)
123
- for (let t = a.length - 1; t >= 0; t--) {
124
- const r = a[t];
125
- if (r.closable !== !1) {
126
- se(r, t, e);
119
+ if (!e.target.value && n.length)
120
+ for (let t = n.length - 1; t >= 0; t--) {
121
+ const c = n[t];
122
+ if (c.closable !== !1) {
123
+ Y(c, t, e);
127
124
  return;
128
125
  }
129
126
  }
130
127
  }
131
128
  ]
132
129
  ])
133
- ), le = async () => {
130
+ ), J = async () => {
134
131
  try {
135
- const e = typeof V == "function" ? await V(I, a) : !0;
136
- e && ($(
137
- a.concat({
138
- value: e === !0 ? I : e,
139
- label: I
132
+ const e = typeof T == "function" ? await T(b, n) : !0;
133
+ e && (C(
134
+ n.concat({
135
+ value: e === !0 ? b : e,
136
+ label: b
140
137
  }),
141
138
  "add"
142
- ), S(""));
139
+ ), V(""));
143
140
  } catch (e) {
144
141
  console.error(e);
145
142
  }
146
- }, ce = (e, t, r = !1) => {
147
- const n = e.value;
148
- let l = e.label, u = !g && !h && e.closable !== !1;
149
- const p = typeof n == "object" ? t : n, v = (Be) => {
150
- se(e, t, Be);
143
+ }, Q = (e, t, c = !1) => {
144
+ const a = e.value;
145
+ let s = e.label, f = !g && !v && e.closable !== !1;
146
+ const u = typeof a == "object" ? t : a, h = (Le) => {
147
+ Y(e, t, Le);
151
148
  };
152
- if (!r && typeof b == "number" && t >= b)
153
- return t === a.length - 1 ? (l = ie(a.length - Number(b)), u = !1, { valueKey: p, dom: l }) : { valueKey: p, dom: null };
154
- if (oe)
149
+ if (!c && typeof y == "number" && t >= y)
150
+ return t === n.length - 1 ? (s = Z(n.length - Number(y)), f = !1, { valueKey: u, dom: s }) : { valueKey: u, dom: null };
151
+ if (U)
155
152
  return {
156
- valueKey: p,
157
- dom: oe(
153
+ valueKey: u,
154
+ dom: U(
158
155
  {
159
- value: n,
160
- label: l,
161
- closable: u,
162
- onClose: v
156
+ value: a,
157
+ label: s,
158
+ closable: f,
159
+ onClose: h
163
160
  },
164
161
  t,
165
- a
162
+ n
166
163
  )
167
164
  };
168
- const Le = {
169
- closable: u,
170
- onClose: v,
165
+ const We = {
166
+ closable: f,
167
+ onClose: h,
171
168
  visible: !0,
172
- children: st(l),
173
- closeIcon: N == null ? void 0 : N.removeIcon,
169
+ children: st(s),
170
+ closeIcon: A?.removeIcon,
174
171
  __closeIconProps: {
175
- onMouseDown: M
172
+ onMouseDown: x
176
173
  },
177
- className: A(`${o}-tag`, {
178
- [ae]: ae
174
+ className: _(`${o}-tag`, {
175
+ [G]: G
179
176
  }),
180
- title: typeof l == "string" ? l : void 0
177
+ title: typeof s == "string" ? s : void 0
181
178
  };
182
- return { valueKey: p, dom: /* @__PURE__ */ i(nt, { ...Le }, `${p}-tag`) };
179
+ return { valueKey: u, dom: /* @__PURE__ */ i(rt, { ...We }, `${u}-tag`) };
183
180
  };
184
- function ie(e) {
185
- const t = typeof d == "object" && d.render ? d.render : () => /* @__PURE__ */ _("span", { className: `${o}-tag-ellipsis`, children: [
181
+ function Z(e) {
182
+ const t = typeof d == "object" && d.render ? d.render : () => /* @__PURE__ */ S("span", { className: `${o}-tag-ellipsis`, children: [
186
183
  "+",
187
184
  e
188
- ] }), r = Ve(d) && d.popoverProps;
185
+ ] }), c = ge(d) && d.popoverProps;
189
186
  return /* @__PURE__ */ i(
190
- rt,
187
+ at,
191
188
  {
192
- content: /* @__PURE__ */ i(Ue, { children: a.map((n, l) => ({ tagValue: n, tagIndex: l })).slice(-e).map(
193
- ({ tagValue: n, tagIndex: l }) => {
194
- var u;
195
- return (u = ce(n, l, !0)) == null ? void 0 : u.dom;
196
- }
189
+ content: /* @__PURE__ */ i(Ke, { children: n.map((a, s) => ({ tagValue: a, tagIndex: s })).slice(-e).map(
190
+ ({ tagValue: a, tagIndex: s }) => Q(a, s, !0)?.dom
197
191
  ) }),
198
- ...r || {},
199
- children: t(e, a)
192
+ ...c || {},
193
+ children: t(e, n)
200
194
  }
201
195
  );
202
196
  }
203
- const ue = async (e) => {
204
- if (U.current = null, Te(k) && k.length) {
197
+ const ee = async (e) => {
198
+ if (M.current = null, me(E) && E.length) {
205
199
  const t = e.split(
206
- new RegExp(`[${k.join("")}]`)
200
+ new RegExp(`[${E.join("")}]`)
207
201
  );
208
202
  if (t.length > 1) {
209
- U.current = Date.now();
210
- const r = [];
203
+ M.current = Date.now();
204
+ const c = [];
211
205
  await Promise.all(
212
- t.map(async (n) => {
213
- const l = n ? typeof V == "function" ? await V(n, a) : !0 : !1;
214
- l && r.push({
215
- value: l === !0 ? n : l,
216
- label: n
206
+ t.map(async (a) => {
207
+ const s = a ? typeof T == "function" ? await T(a, n) : !0 : !1;
208
+ s && c.push({
209
+ value: s === !0 ? a : s,
210
+ label: a
217
211
  });
218
212
  })
219
- ), r.length && $(a.concat(r), "add");
213
+ ), c.length && C(n.concat(c), "add");
220
214
  }
221
215
  }
222
- }, pe = _e && !h && !g && a.length ? /* @__PURE__ */ i(
216
+ }, te = Ie && !v && !g && n.length ? /* @__PURE__ */ i(
223
217
  tt,
224
218
  {
225
- size: w,
219
+ size: P,
226
220
  className: `${o}-clear-icon`,
227
221
  onClick: (e) => {
228
- var t;
229
- e.stopPropagation(), $([], "clear"), P || (t = y.current) == null || t.focus(), B == null || B();
222
+ e.stopPropagation(), C([], "clear"), w || N.current?.focus(), ke?.();
230
223
  },
231
- children: N && N.clearIcon || /* @__PURE__ */ i(Ge, {})
224
+ children: A && A.clearIcon || /* @__PURE__ */ i(Ue, {})
232
225
  },
233
226
  "clearIcon"
234
- ) : null, fe = h || Ee, K = Je(() => {
227
+ ) : null, oe = v || Pe, z = Je(() => {
235
228
  const e = {};
236
- return a.map((r, n) => {
237
- const l = e[r.value] || 0, u = l >= 1;
238
- e[r.value] = l + 1;
239
- const { dom: p, valueKey: v } = ce(r, n);
240
- return Ce.isValidElement(p) ? /* @__PURE__ */ i(
241
- ye,
229
+ return n.map((c, a) => {
230
+ const s = e[c.value] || 0, f = s >= 1;
231
+ e[c.value] = s + 1;
232
+ const { dom: u, valueKey: h } = Q(c, a);
233
+ return de.isValidElement(u) ? /* @__PURE__ */ i(
234
+ ue,
242
235
  {
243
- timeout: X,
236
+ timeout: O,
244
237
  classNames: "zoomIn",
245
- children: p
238
+ children: u
246
239
  },
247
- u ? `${v}-${n}` : v
248
- ) : p;
240
+ f ? `${h}-${a}` : h
241
+ ) : u;
249
242
  });
250
- }, [a]), q = [
243
+ }, [n]), F = [
251
244
  /* @__PURE__ */ i(
252
- ye,
245
+ ue,
253
246
  {
254
- timeout: X,
247
+ timeout: O,
255
248
  classNames: "zoomIn",
256
249
  children: /* @__PURE__ */ i(
257
250
  ot,
258
251
  {
259
252
  autoComplete: "off",
260
- size: w,
261
- disabled: fe,
253
+ size: P,
254
+ disabled: oe,
262
255
  readOnly: g,
263
- ref: y,
264
- autoFocus: Ae,
265
- placeholder: a.length ? "" : De,
256
+ ref: N,
257
+ autoFocus: $e,
258
+ placeholder: n.length ? "" : be,
266
259
  prefixCls: `${o}-input`,
267
260
  autoFitWidth: {
268
- delay: () => Fe.current,
261
+ delay: () => Oe.current,
269
262
  pure: !0
270
263
  },
271
264
  onPressEnter: async (e) => {
272
- I && e.preventDefault(), W == null || W(e), await le();
265
+ b && e.preventDefault(), Ee?.(e), await J();
273
266
  },
274
267
  onFocus: (e) => {
275
- !fe && !g && (ne(!0), j == null || j(e));
268
+ !oe && !g && (X(!0), xe?.(e));
276
269
  },
277
270
  onBlur: async (e) => {
278
- ne(!1), H == null || H(e), ke && await le(), S("");
271
+ X(!1), Ae?.(e), we && await J(), V("");
279
272
  },
280
- value: I,
273
+ value: b,
281
274
  onChange: (e, t) => {
282
- z == null || z(e, t), t.nativeEvent.inputType !== "insertFromPaste" && ue(e), U.current ? S("") : S(e);
275
+ De?.(e, t), t.nativeEvent.inputType !== "insertFromPaste" && ee(e), M.current ? V("") : V(e);
283
276
  },
284
277
  onKeyDown: (e) => {
285
- He(e), O == null || O(e);
278
+ Be(e), Re?.(e);
286
279
  },
287
280
  onPaste: (e) => {
288
- x == null || x(e), ue(e.clipboardData.getData("text"));
281
+ Se?.(e), ee(e.clipboardData.getData("text"));
289
282
  }
290
283
  }
291
284
  )
292
285
  },
293
286
  ft
294
287
  )
295
- ], We = !T(Q), me = !T(Z) || !T(pe), de = !T(ee), ge = !T(te), D = de || ge, ve = m.status || (Re ? "error" : void 0), he = A(o, {
296
- [`${o}-size-${w}`]: w,
297
- [`${o}-disabled`]: h,
298
- [`${o}-${ve}`]: ve,
299
- [`${o}-focus`]: P,
288
+ ], He = !I(H), ne = !I(W) || !I(te), ae = !I(L), re = !I(K), D = ae || re, se = p.status || (Ce ? "error" : void 0), le = _(o, {
289
+ [`${o}-size-${P}`]: P,
290
+ [`${o}-disabled`]: v,
291
+ [`${o}-${se}`]: se,
292
+ [`${o}-focus`]: w,
300
293
  [`${o}-readonly`]: g,
301
- [`${o}-has-suffix`]: me,
302
- [`${o}-has-placeholder`]: !a.length,
303
- [`${o}-rtl`]: Y
304
- }), R = { style: Se, className: Pe }, Ne = /* @__PURE__ */ i(
294
+ [`${o}-has-suffix`]: ne,
295
+ [`${o}-has-placeholder`]: !n.length,
296
+ [`${o}-rtl`]: j
297
+ }), R = { style: Ne, className: ye }, ce = /* @__PURE__ */ i(
305
298
  "div",
306
299
  {
307
- ...it(Oe, ["status", "size", "defaultValue", "value", "inputValue"]),
300
+ ...it(ze, ["status", "size", "defaultValue", "value", "inputValue"]),
308
301
  ...D ? {} : R,
309
- className: D ? he : A(he, R.className),
302
+ className: D ? le : _(le, R.className),
310
303
  onMouseDown: (e) => {
311
- P && M(e);
304
+ w && x(e);
312
305
  },
313
306
  onClick: (e) => {
314
- var t;
315
- !P && ((t = y.current) == null || t.focus()), re && re(e);
307
+ !w && N.current?.focus(), q && q(e);
316
308
  },
317
- ref: D ? void 0 : G,
318
- children: /* @__PURE__ */ _("div", { className: `${o}-view`, children: [
319
- We && /* @__PURE__ */ i("div", { className: `${o}-prefix`, onMouseDown: M, children: Q }),
309
+ ref: D ? void 0 : k,
310
+ children: /* @__PURE__ */ S("div", { className: `${o}-view`, children: [
311
+ He && /* @__PURE__ */ i("div", { className: `${o}-prefix`, onMouseDown: x, children: H }),
320
312
  je ? /* @__PURE__ */ i(
321
- $e,
313
+ fe,
322
314
  {
323
315
  prefixCls: o,
324
- animation: J,
316
+ animation: B,
325
317
  children: /* @__PURE__ */ i(
326
318
  Ze,
327
319
  {
328
320
  itemWrapperStyle: { display: "inline-block" },
329
321
  direction: "horizontal",
330
322
  onIndexChange: (e, t) => {
331
- $(function(n, l, u) {
332
- n = n.slice();
333
- const p = l > u, [v] = n.splice(l, 1);
334
- return n.splice(p ? u : u - 1, 0, v), n;
335
- }(a, t, e), "sort");
323
+ C(function(a, s, f) {
324
+ a = a.slice();
325
+ const u = s > f, [h] = a.splice(s, 1);
326
+ return a.splice(u ? f : f - 1, 0, h), a;
327
+ }(n, t, e), "sort");
336
328
  },
337
- children: K.concat(q)
329
+ children: z.concat(F)
338
330
  }
339
331
  )
340
332
  },
341
333
  "transitionGroupWithDrag"
342
334
  ) : /* @__PURE__ */ i(
343
- $e,
335
+ fe,
344
336
  {
345
337
  prefixCls: o,
346
- animation: J,
347
- children: b === pt ? /* @__PURE__ */ i(
348
- at,
338
+ animation: B,
339
+ children: y === pt ? /* @__PURE__ */ i(
340
+ nt,
349
341
  {
350
- items: K,
351
- suffixItems: q,
352
- ellipsisNode: ({ ellipsisCount: e }) => ie(e)
342
+ items: z,
343
+ suffixItems: F,
344
+ ellipsisNode: ({ ellipsisCount: e }) => Z(e)
353
345
  }
354
- ) : K.concat(q)
346
+ ) : z.concat(F)
355
347
  },
356
- `max_tag_group_${b}`
348
+ `max_tag_group_${y}`
357
349
  ),
358
- me && /* @__PURE__ */ _("div", { className: `${o}-suffix`, onMouseDown: M, children: [
359
- pe,
360
- Z
350
+ ne && /* @__PURE__ */ S("div", { className: `${o}-suffix`, onMouseDown: x, children: [
351
+ te,
352
+ W
361
353
  ] })
362
354
  ] })
363
355
  }
364
356
  );
365
- return D ? /* @__PURE__ */ _(
357
+ return D ? /* @__PURE__ */ S(
366
358
  "div",
367
359
  {
368
360
  ...R,
369
- className: A(
361
+ className: _(
370
362
  `${o}-wrapper`,
371
363
  {
372
- [`${o}-wrapper-rtl`]: Y
364
+ [`${o}-wrapper-rtl`]: j
373
365
  },
374
366
  R.className
375
367
  ),
376
- ref: G,
368
+ ref: k,
377
369
  children: [
378
- de && /* @__PURE__ */ i("div", { className: `${o}-addbefore`, children: ee }),
379
- Ne,
380
- ge && /* @__PURE__ */ i("div", { className: `${o}-addafter`, children: te })
370
+ ae && /* @__PURE__ */ i("div", { className: `${o}-addbefore`, children: L }),
371
+ ce,
372
+ re && /* @__PURE__ */ i("div", { className: `${o}-addafter`, children: K })
381
373
  ]
382
374
  }
383
- ) : Ne;
375
+ ) : ce;
384
376
  }
385
- const vt = Ce.forwardRef(
377
+ const ht = de.forwardRef(
386
378
  gt
387
379
  );
388
- vt.displayName = "InputTag";
380
+ ht.displayName = "InputTag";
389
381
  export {
390
- vt as default
382
+ ht as default
391
383
  };
package/layout/Content.js CHANGED
@@ -3,12 +3,12 @@ import { forwardRef as i, useContext as f } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
4
  import l from "@unicom-cloud/utils/class-name";
5
5
  import p from "../config-provider/context.js";
6
- function u(o, n) {
7
- const { className: s, children: e, ...a } = o, { getPrefixCls: t } = f(p), m = t == null ? void 0 : t("layout-content"), r = l(m, s);
8
- return /* @__PURE__ */ c("main", { ref: n, ...a, className: r, children: e });
6
+ function C(t, o) {
7
+ const { className: e, children: n, ...s } = t, { getPrefixCls: a } = f(p), r = a?.("layout-content"), m = l(r, e);
8
+ return /* @__PURE__ */ c("main", { ref: o, ...s, className: m, children: n });
9
9
  }
10
- const C = i(u);
11
- C.displayName = "LayoutContent";
10
+ const u = i(C);
11
+ u.displayName = "LayoutContent";
12
12
  export {
13
- C as default
13
+ u as default
14
14
  };