@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,30 +1,30 @@
1
- import { jsx as d, Fragment as I, jsxs as K } from "react/jsx-runtime";
1
+ import { jsx as u, Fragment as q, jsxs as I } from "react/jsx-runtime";
2
2
  import "../../dist/react-transition-group/src/CSSTransition.js";
3
3
  import "../../dist/react-transition-group/src/ReplaceTransition.js";
4
4
  import "../../dist/react-transition-group/src/SwitchTransition.js";
5
5
  import "../../dist/react-transition-group/chunk/CPfP7aNL.js";
6
- import z from "../../dist/react-transition-group/src/TransitionGroup.js";
7
- import H from "lodash/isEqualWith";
8
- import S from "lodash/isFunction";
9
- import G from "lodash/isString";
10
- import J, { useState as Q, useCallback as _, useEffect as M } from "react";
11
- import { getMultipleCheckValue as X } from "../util.js";
12
- import Y from "../../components/common/hooks/useForceUpdate.js";
13
- import Z from "../../components/common/hooks/useRefs.js";
14
- import ee from "../../components/common/hooks/useUpdateEffect.js";
15
- import { PqbCSSTransition as te } from "../../components/common/utils/PqbCSSTransition.js";
16
- import L from "@unicom-cloud/utils/class-name";
17
- import { on as le, off as R } from "../../components/common/utils/dom.js";
6
+ import K from "../../dist/react-transition-group/src/TransitionGroup.js";
7
+ import z from "lodash/isEqualWith";
8
+ import D from "lodash/isFunction";
9
+ import H from "lodash/isString";
10
+ import G, { useState as J, useCallback as P, useEffect as S } from "react";
11
+ import { getMultipleCheckValue as Q } from "../util.js";
12
+ import X from "../../components/common/hooks/useForceUpdate.js";
13
+ import Y from "../../components/common/hooks/useRefs.js";
14
+ import Z from "../../components/common/hooks/useUpdateEffect.js";
15
+ import { PqbCSSTransition as ee } from "../../components/common/utils/PqbCSSTransition.js";
16
+ import k from "@unicom-cloud/utils/class-name";
17
+ import { on as te, off as _ } from "../../components/common/utils/dom.js";
18
18
  import "../../components/common/utils/is.js";
19
- import { Enter as re, ArrowLeft as ie, ArrowRight as ae, ArrowUp as ne, ArrowDown as F, Esc as se } from "@unicom-cloud/utils/constant/keyboardCode";
20
- import ce from "../../virtual-list/VirtualList.js";
21
- import de from "./Option.js";
22
- import { isPlainObject as ue } from "@unicom-cloud/utils/is";
23
- const fe = (l) => {
19
+ import { Enter as le, ArrowLeft as re, ArrowRight as ie, ArrowUp as ae, ArrowDown as M, Esc as ne } from "@unicom-cloud/utils/constant/keyboardCode";
20
+ import se from "../../virtual-list/VirtualList.js";
21
+ import ce from "./Option.js";
22
+ import { isPlainObject as de } from "@unicom-cloud/utils/is";
23
+ const ue = (l) => {
24
24
  for (let n = 0; n < l.length; n++)
25
25
  if (!l[n].disabled)
26
26
  return l[n];
27
- }, T = (l) => {
27
+ }, R = (l) => {
28
28
  if (l && l.disabled) {
29
29
  let n = l;
30
30
  for (; n.parent && n.parent.disabled; )
@@ -32,127 +32,123 @@ const fe = (l) => {
32
32
  return n;
33
33
  }
34
34
  return l;
35
- }, U = (l, n) => l < 0 ? n : l > n ? 0 : l, _e = (l) => {
36
- var P;
37
- const [n, W] = Z(), C = Y(), {
38
- store: u,
35
+ }, F = (l, n) => l < 0 ? n : l > n ? 0 : l, Se = (l) => {
36
+ const [n, T] = Y(), w = X(), {
37
+ store: o,
39
38
  prefixCls: s,
40
- value: x,
39
+ value: y,
41
40
  multiple: f,
42
- renderFooter: $,
43
- renderOption: A,
44
- showEmptyChildren: j,
41
+ renderFooter: V,
42
+ renderOption: N,
43
+ showEmptyChildren: U,
45
44
  loadMore: E,
46
- renderEmpty: v,
47
- rtl: V,
48
- icons: B
49
- } = l, [a, k] = Q(
50
- u.findNodeByValue(x && x[x.length - 1]) || null
51
- ), g = u.getOptions(), O = (e) => {
52
- var r;
53
- (r = l.onChange) == null || r.call(l, e);
54
- }, N = async (e) => {
55
- if (!e.isLeaf && S(E) && !e.children) {
56
- e.setLoading(!0), C();
45
+ renderEmpty: $,
46
+ rtl: L,
47
+ icons: W
48
+ } = l, [i, b] = J(
49
+ o.findNodeByValue(y && y[y.length - 1]) || null
50
+ ), m = o.getOptions(), A = (e) => {
51
+ l.onChange?.(e);
52
+ }, C = async (e) => {
53
+ if (!e.isLeaf && D(E) && !e.children) {
54
+ e.setLoading(!0), w();
57
55
  try {
58
56
  const r = await E(
59
57
  e.pathValue,
60
58
  e.pathValue.length
61
59
  );
62
- u.appendOptionChildren(e, r), u.setNodeCheckedByValue(l.value);
60
+ o.appendOptionChildren(e, r), o.setNodeCheckedByValue(l.value);
63
61
  } catch (r) {
64
62
  console.error(r);
65
63
  }
66
- e.setLoading(!1), C();
64
+ e.setLoading(!1), w();
67
65
  }
68
- }, b = async (e, r = !0) => {
69
- !e || e.disabled || (k(e), N(e), !f && r && (l.changeOnSelect || e.isLeaf) && O([e.pathValue]));
70
- }, p = (e, r) => {
71
- const i = X(l.value, u, e, r);
72
- e === a && C(), k(e), l.changeOnSelect || N(e), O(i);
73
- }, D = _(
74
- (e = a) => {
75
- var i;
66
+ }, h = async (e, r = !0) => {
67
+ !e || e.disabled || (b(e), C(e), !f && r && (l.changeOnSelect || e.isLeaf) && A([e.pathValue]));
68
+ }, x = (e, r) => {
69
+ const a = Q(l.value, o, e, r);
70
+ e === i && w(), b(e), l.changeOnSelect || C(e), A(a);
71
+ }, O = P(
72
+ (e = i) => {
76
73
  let r = e;
77
74
  for (; r; )
78
- (i = n[r._level]) == null || i.scrollTo({
75
+ n[r._level]?.scrollTo({
79
76
  index: r._index,
80
77
  options: { block: "nearest" }
81
78
  }), r = r._level < 1 ? null : r.parent;
82
79
  },
83
- [a]
84
- ), w = _(
80
+ [i]
81
+ ), p = P(
85
82
  (e) => {
86
- var t;
87
83
  const r = e.key;
88
- let i;
84
+ let a;
89
85
  switch (r) {
90
- case se.key: {
91
- e.preventDefault(), (t = l.onEsc) == null || t.call(l);
86
+ case ne.key: {
87
+ e.preventDefault(), l.onEsc?.();
92
88
  break;
93
89
  }
94
- case F.key:
95
- case ne.key: {
96
- if (!a)
97
- i = fe(g);
90
+ case M.key:
91
+ case ae.key: {
92
+ if (!i)
93
+ a = ue(m);
98
94
  else {
99
- const c = T(a), o = c.parent && c.parent.children || g, m = r === F.key ? 1 : -1;
100
- let h = U(
101
- c._index + m,
102
- o.length - 1
95
+ const t = R(i), c = t.parent && t.parent.children || m, g = r === M.key ? 1 : -1;
96
+ let d = F(
97
+ t._index + g,
98
+ c.length - 1
103
99
  );
104
- for (; h !== c._index && (i = o[h], i.disabled); )
105
- h = U(h + m, o.length - 1);
100
+ for (; d !== t._index && (a = c[d], a.disabled); )
101
+ d = F(d + g, c.length - 1);
106
102
  }
107
- return D(i), b(i, !1), e.preventDefault(), !1;
103
+ return O(a), h(a, !1), e.preventDefault(), !1;
108
104
  }
109
- case ae.key:
110
- return a && !a.disabled && (i = (a.children || [])[0] || a, b(i, !1)), e.preventDefault(), !1;
111
- case ie.key: {
112
- if (a) {
113
- const c = T(a);
114
- i = c.parent || c;
105
+ case ie.key:
106
+ return i && !i.disabled && (a = (i.children || [])[0] || i, h(a, !1)), e.preventDefault(), !1;
107
+ case re.key: {
108
+ if (i) {
109
+ const t = R(i);
110
+ a = t.parent || t;
115
111
  }
116
- return b(i, !1), e.preventDefault(), !1;
112
+ return h(a, !1), e.preventDefault(), !1;
117
113
  }
118
- case re.key:
119
- return a && (f ? p(a, !a._checked) : b(a)), e.preventDefault(), !1;
114
+ case le.key:
115
+ return i && (f ? x(i, !i._checked) : h(i)), e.preventDefault(), !1;
120
116
  }
121
117
  },
122
- [a]
118
+ [i]
123
119
  );
124
- ee(() => {
125
- k((e) => {
120
+ Z(() => {
121
+ b((e) => {
126
122
  let r;
127
123
  if (e && e.pathValue && e.pathValue.length) {
128
- const i = e.pathValue;
129
- let t = { children: g };
130
- i.map((c) => {
131
- const m = (t.children || []).find((h) => h.value === c);
132
- m && (t = m, r = m);
124
+ const a = e.pathValue;
125
+ let t = { children: m };
126
+ a.map((c) => {
127
+ const d = (t.children || []).find((B) => B.value === c);
128
+ d && (t = d, r = d);
133
129
  });
134
130
  }
135
131
  return r;
136
132
  });
137
- }, [u]), M(() => {
138
- l.popupVisible && g.length && setTimeout(D);
139
- }, [l.popupVisible]), M(() => {
133
+ }, [o]), S(() => {
134
+ l.popupVisible && m.length && setTimeout(O);
135
+ }, [l.popupVisible]), S(() => {
140
136
  const e = l.getTriggerElement();
141
137
  if (e)
142
- return l.popupVisible ? le(e, "keydown", w) : R(e, "keydown", w), () => {
143
- R(e, "keydown", w);
138
+ return l.popupVisible ? te(e, "keydown", p) : _(e, "keydown", p), () => {
139
+ _(e, "keydown", p);
144
140
  };
145
- }, [l.popupVisible, w]);
146
- const y = (() => {
147
- const e = [g];
148
- return (a ? a.getPathNodes() : []).forEach((i) => {
149
- i && i.children && e.push(i.children);
141
+ }, [l.popupVisible, p]);
142
+ const v = (() => {
143
+ const e = [m];
144
+ return (i ? i.getPathNodes() : []).forEach((a) => {
145
+ a && a.children && e.push(a.children);
150
146
  }), e;
151
- })(), q = S(l.dropdownColumnRender) ? l.dropdownColumnRender : (e) => e;
152
- return !y.length || !((P = y[0]) != null && P.length) ? /* @__PURE__ */ d(I, { children: v() }) : /* @__PURE__ */ d(z, { component: J.Fragment, children: y.map((e, r) => {
153
- const i = $ ? $(r, a || null) : null;
154
- return e.length === 0 && !j ? null : /* @__PURE__ */ d(
155
- te,
147
+ })(), j = D(l.dropdownColumnRender) ? l.dropdownColumnRender : (e) => e;
148
+ return !v.length || !v[0]?.length ? /* @__PURE__ */ u(q, { children: $() }) : /* @__PURE__ */ u(K, { component: G.Fragment, children: v.map((e, r) => {
149
+ const a = V ? V(r, i || null) : null;
150
+ return e.length === 0 && !U ? null : /* @__PURE__ */ u(
151
+ ee,
156
152
  {
157
153
  timeout: {
158
154
  enter: 300,
@@ -168,48 +164,48 @@ const fe = (l) => {
168
164
  onEntered: (t) => {
169
165
  t && (t.style.marginLeft = "");
170
166
  },
171
- children: /* @__PURE__ */ d(
167
+ children: /* @__PURE__ */ u(
172
168
  "div",
173
169
  {
174
- className: L(`${s}-list-column`, {
170
+ className: k(`${s}-list-column`, {
175
171
  [`${s}-list-column-virtual`]: l.virtualListProps && l.virtualListProps.threshold !== null,
176
- [`${s}-list-column-rtl`]: V
172
+ [`${s}-list-column-rtl`]: L
177
173
  }),
178
174
  style: {
179
- zIndex: y.length - r,
175
+ zIndex: v.length - r,
180
176
  ...l.dropdownMenuColumnStyle
181
177
  },
182
- children: q(
183
- /* @__PURE__ */ K(
178
+ children: j(
179
+ /* @__PURE__ */ I(
184
180
  "div",
185
181
  {
186
- className: L(`${s}-list-wrapper`, {
187
- [`${s}-list-wrapper-with-footer`]: i !== null
182
+ className: k(`${s}-list-wrapper`, {
183
+ [`${s}-list-wrapper-with-footer`]: a !== null
188
184
  }),
189
185
  children: [
190
- e.length === 0 ? v == null ? void 0 : v(l.virtualListProps ? "100%" : 120) : /* @__PURE__ */ d(
191
- ce,
186
+ e.length === 0 ? $?.(l.virtualListProps ? "100%" : 120) : /* @__PURE__ */ u(
187
+ se,
192
188
  {
193
189
  needFiller: !1,
194
190
  threshold: l.virtualListProps ? 100 : null,
195
191
  data: e,
196
192
  isStaticItemHeight: !0,
197
193
  itemKey: "value",
198
- ...ue(l.virtualListProps) ? l.virtualListProps : {},
194
+ ...de(l.virtualListProps) ? l.virtualListProps : {},
199
195
  wrapper: "ul",
200
196
  role: "menu",
201
- ref: (t) => W(t, r),
202
- className: L(
197
+ ref: (t) => T(t, r),
198
+ className: k(
203
199
  `${s}-list`,
204
200
  `${s}-list-select`,
205
201
  {
206
202
  [`${s}-list-multiple`]: f,
207
- [`${s}-list-rtl`]: V
203
+ [`${s}-list-rtl`]: L
208
204
  }
209
205
  ),
210
206
  children: (t) => {
211
207
  let c = !1;
212
- return a && (c = a.pathValue[r] === t.value), /* @__PURE__ */ d(
208
+ return i && (c = i.pathValue[r] === t.value), /* @__PURE__ */ u(
213
209
  "li",
214
210
  {
215
211
  tabIndex: 0,
@@ -217,29 +213,29 @@ const fe = (l) => {
217
213
  "aria-haspopup": !t.isLeaf,
218
214
  "aria-expanded": c && !t.isLeaf,
219
215
  "aria-disabled": t.disabled,
220
- title: G(t.label) ? t.label : void 0,
221
- className: L(`${s}-list-item`, {
216
+ title: H(t.label) ? t.label : void 0,
217
+ className: k(`${s}-list-item`, {
222
218
  [`${s}-list-item-active`]: c,
223
219
  [`${s}-list-item-disabled`]: t.disabled
224
220
  }),
225
- children: /* @__PURE__ */ d(
226
- de,
221
+ children: /* @__PURE__ */ u(
222
+ ce,
227
223
  {
228
224
  prefixCls: s,
229
- rtl: V,
225
+ rtl: L,
230
226
  multiple: f,
231
227
  option: t,
232
- selected: !f && t.isLeaf && H(l.value, t.pathValue),
233
- icons: B,
228
+ selected: !f && t.isLeaf && z(l.value, t.pathValue),
229
+ icons: W,
234
230
  onMouseEnter: () => {
235
- t.disabled || l.expandTrigger === "hover" && (k(t), !t.isLeaf && N(t));
231
+ t.disabled || l.expandTrigger === "hover" && (b(t), !t.isLeaf && C(t));
236
232
  },
237
- renderOption: A && (() => A(t._data, r)),
233
+ renderOption: N && (() => N(t._data, r)),
238
234
  onClickOption: () => {
239
- t.isLeaf && f && !t.disableCheckbox ? p(t, !t._checked) : b(t);
235
+ t.isLeaf && f && !t.disableCheckbox ? x(t, !t._checked) : h(t);
240
236
  },
241
- onMultipleChecked: (o) => {
242
- p(t, o);
237
+ onMultipleChecked: (g) => {
238
+ x(t, g);
243
239
  },
244
240
  onDoubleClickOption: l.onDoubleClickOption
245
241
  }
@@ -250,14 +246,14 @@ const fe = (l) => {
250
246
  }
251
247
  }
252
248
  ),
253
- i && /* @__PURE__ */ d(
249
+ a && /* @__PURE__ */ u(
254
250
  "div",
255
251
  {
256
252
  className: `${s}-list-footer`,
257
253
  onMouseDown: (t) => {
258
254
  t.stopPropagation();
259
255
  },
260
- children: i
256
+ children: a
261
257
  }
262
258
  )
263
259
  ]
@@ -273,6 +269,6 @@ const fe = (l) => {
273
269
  }) });
274
270
  };
275
271
  export {
276
- _e as default,
277
- U as getLegalIndex
272
+ Se as default,
273
+ F as getLegalIndex
278
274
  };
@@ -1,9 +1,9 @@
1
- import { jsx as m, jsxs as N, Fragment as w } from "react/jsx-runtime";
1
+ import { jsx as f, jsxs as N, Fragment as C } from "react/jsx-runtime";
2
2
  import B from "../../dist/scroll-into-view-if-needed/src/index.js";
3
3
  import D from "lodash/isEqualWith";
4
- import O from "lodash/isFunction";
5
- import L from "lodash/isString";
6
- import { useState as P, useRef as E, useEffect as F } from "react";
4
+ import E from "lodash/isFunction";
5
+ import w from "lodash/isString";
6
+ import { useState as O, useRef as P, useEffect as F } from "react";
7
7
  import { getMultipleCheckValue as K } from "../util.js";
8
8
  import q from "../../checkbox/Checkbox.js";
9
9
  import "../../checkbox/Group.js";
@@ -16,153 +16,151 @@ import { Enter as G, ArrowUp as J, ArrowDown as A, Esc as Q } from "@unicom-clou
16
16
  import X from "../../virtual-list/VirtualList.js";
17
17
  import { isPlainObject as Y } from "@unicom-cloud/utils/is";
18
18
  const H = (t, r) => t < 0 ? r : t > r ? 0 : t, Z = (t, r, s) => {
19
- let b = r;
20
- if (L(r)) {
21
- const o = r.toUpperCase().indexOf(t.toUpperCase());
22
- if (o > -1) {
23
- const h = r.substring(0, o + 1), g = r.substring(o + t.length);
24
- b = /* @__PURE__ */ N(w, { children: [
25
- h,
26
- /* @__PURE__ */ m("span", { className: `${s}-highlight`, children: r.substring(o, t.length + 1) }),
27
- g
19
+ let g = r;
20
+ if (w(r)) {
21
+ const h = r.toUpperCase().indexOf(t.toUpperCase());
22
+ if (h > -1) {
23
+ const m = r.substring(0, h + 1), y = r.substring(h + t.length);
24
+ g = /* @__PURE__ */ N(C, { children: [
25
+ m,
26
+ /* @__PURE__ */ f("span", { className: `${s}-highlight`, children: r.substring(h, t.length + 1) }),
27
+ y
28
28
  ] });
29
29
  }
30
30
  }
31
- return b;
31
+ return g;
32
32
  }, ke = (t) => {
33
33
  const {
34
34
  store: r,
35
35
  prefixCls: s,
36
- multiple: b,
37
- onChange: o,
38
- inputValue: h,
39
- renderEmpty: g,
36
+ multiple: g,
37
+ onChange: h,
38
+ inputValue: m,
39
+ renderEmpty: y,
40
40
  style: U,
41
41
  defaultActiveFirstOption: $,
42
42
  rtl: V,
43
43
  icons: _
44
- } = t, x = t.value || [], [c, j] = P(
45
- r.searchNodeByLabel(h) || []
46
- ), k = E(), v = E(), I = T(), [p, y] = P(
44
+ } = t, L = t.value || [], [i, j] = O(
45
+ r.searchNodeByLabel(m) || []
46
+ ), b = P(), k = P(), I = T(), [p, v] = O(
47
47
  $ ? 0 : -1
48
- ), C = (e, n, d) => {
49
- if (d.stopPropagation(), !e.disabled)
50
- if (b) {
51
- const u = K(
48
+ ), x = (e, o, a) => {
49
+ if (a.stopPropagation(), !e.disabled)
50
+ if (g) {
51
+ const c = K(
52
52
  t.value,
53
53
  r,
54
54
  e,
55
- n
55
+ o
56
56
  );
57
- o == null || o(u);
57
+ h?.(c);
58
58
  } else
59
- o == null || o([e.pathValue]);
59
+ h?.([e.pathValue]);
60
60
  };
61
61
  return M(() => {
62
- j(r.searchNodeByLabel(h));
63
- }, [h, r]), M(() => {
64
- y((e) => e > c.length - 1 ? $ ? 0 : -1 : e);
65
- }, [c]), F(() => {
62
+ j(r.searchNodeByLabel(m));
63
+ }, [m, r]), M(() => {
64
+ v((e) => e > i.length - 1 ? $ ? 0 : -1 : e);
65
+ }, [i]), F(() => {
66
66
  const e = t.getTriggerElement();
67
67
  if (!e)
68
68
  return;
69
- const n = (d) => {
70
- var a;
71
- d.stopPropagation();
72
- const u = d.key;
73
- switch (u) {
69
+ const o = (a) => {
70
+ a.stopPropagation();
71
+ const c = a.key;
72
+ switch (c) {
74
73
  case Q.key:
75
- return (a = t.onEsc) == null || a.call(t), !1;
74
+ return t.onEsc?.(), !1;
76
75
  case A.key:
77
76
  case J.key: {
78
- v.current = !0;
79
- const f = A.key === u ? 1 : -1;
80
- let i = H(
81
- p + f,
82
- c.length - 1
77
+ k.current = !0;
78
+ const n = A.key === c ? 1 : -1;
79
+ let l = H(
80
+ p + n,
81
+ i.length - 1
83
82
  );
84
- for (; i !== p && c[i].disabled; )
85
- i = H(i + f, c.length - 1);
86
- return y(i), !1;
83
+ for (; l !== p && i[l].disabled; )
84
+ l = H(l + n, i.length - 1);
85
+ return v(l), !1;
87
86
  }
88
87
  case G.key: {
89
- const f = c[p];
90
- if (f) {
91
- const i = x.some((l) => D(l, f.pathValue));
92
- C(f, !i, d);
88
+ const n = i[p];
89
+ if (n) {
90
+ const l = L.some((d) => D(d, n.pathValue));
91
+ x(n, !l, a);
93
92
  }
94
93
  return !1;
95
94
  }
96
95
  }
97
96
  };
98
- return W(e, "keydown", n), () => {
99
- z(e, "keydown", n);
97
+ return W(e, "keydown", o), () => {
98
+ z(e, "keydown", o);
100
99
  };
101
- }, [c, p, x]), F(() => {
102
- var n;
103
- const e = k.current;
104
- e && (v.current || I) && B(e, {
100
+ }, [i, p, L]), F(() => {
101
+ const e = b.current;
102
+ e && (k.current || I) && B(e, {
105
103
  behavior: "auto",
106
104
  block: "nearest",
107
105
  scrollMode: "if-needed",
108
- boundary: (n = e.parentNode) == null ? void 0 : n.parentNode
106
+ boundary: e.parentNode?.parentNode
109
107
  });
110
- }, [p, c]), k.current = null, c.length ? /* @__PURE__ */ m("div", { className: `${s}-list-wrapper`, children: /* @__PURE__ */ m(
108
+ }, [p, i]), b.current = null, i.length ? /* @__PURE__ */ f("div", { className: `${s}-list-wrapper`, children: /* @__PURE__ */ f(
111
109
  X,
112
110
  {
113
111
  needFiller: !1,
114
112
  wrapper: "ul",
115
113
  role: "menu",
116
114
  style: U,
117
- data: c,
115
+ data: i,
118
116
  isStaticItemHeight: !0,
119
117
  threshold: t.virtualListProps ? 100 : null,
120
118
  ...Y(t.virtualListProps) ? t.virtualListProps : {},
121
119
  onMouseMove: () => {
122
- v.current = !1;
120
+ k.current = !1;
123
121
  },
124
122
  className: S(`${s}-list`, `${s}-list-search`, {
125
- [`${s}-list-multiple`]: b,
123
+ [`${s}-list-multiple`]: g,
126
124
  [`${s}-list-rtl`]: V
127
125
  }),
128
- children: (e, n) => {
129
- const d = e.getPathNodes(), u = d.map((l, R, ee) => /* @__PURE__ */ N("span", { children: [
130
- l.label,
131
- d.length === R + 1 ? "" : " / "
132
- ] }, `${l.label}_${l._level}`)), a = e._checked, f = { checked: a }, i = O(t.renderOption) ? t.renderOption(h, e._data, f) : Z(h, u, s);
133
- return /* @__PURE__ */ m(
126
+ children: (e, o) => {
127
+ const a = e.getPathNodes(), c = a.map((u, R, ee) => /* @__PURE__ */ N("span", { children: [
128
+ u.label,
129
+ a.length === R + 1 ? "" : " / "
130
+ ] }, `${u.label}_${u._level}`)), n = e._checked, l = { checked: n }, d = E(t.renderOption) ? t.renderOption(m, e._data, l) : Z(m, c, s);
131
+ return /* @__PURE__ */ f(
134
132
  "li",
135
133
  {
136
- title: L(i) ? i : L(u) ? u : void 0,
134
+ title: w(d) ? d : w(c) ? c : void 0,
137
135
  role: "menuitem",
138
136
  "aria-disabled": e.disabled,
139
- ref: (l) => {
140
- n === p && (k.current = l), a && !k.current && (k.current = l);
137
+ ref: (u) => {
138
+ o === p && (b.current = u), n && !b.current && (b.current = u);
141
139
  },
142
140
  className: S(`${s}-list-search-item`, {
143
- [`${s}-list-search-item-active`]: a,
144
- [`${s}-list-search-item-hover`]: n === p,
141
+ [`${s}-list-search-item-active`]: n,
142
+ [`${s}-list-search-item-hover`]: o === p,
145
143
  [`${s}-list-search-item-disabled`]: e.disabled
146
144
  }),
147
- onClick: (l) => {
148
- C(e, !a, l);
145
+ onClick: (u) => {
146
+ x(e, !n, u);
149
147
  },
150
148
  onMouseEnter: () => {
151
- !v.current && !e.disabled && y(n);
149
+ !k.current && !e.disabled && v(o);
152
150
  },
153
151
  onMouseLeave: () => {
154
- !v.current && !e.disabled && y($ ? 0 : -1);
152
+ !k.current && !e.disabled && v($ ? 0 : -1);
155
153
  },
156
- children: /* @__PURE__ */ m("div", { className: `${s}-list-item-label`, children: O(t.renderOption) ? i : b ? /* @__PURE__ */ m(q, { checked: a, disabled: e.disabled, children: i }) : /* @__PURE__ */ N(w, { children: [
157
- i,
158
- a && /* @__PURE__ */ m("span", { className: `${s}-check-icon`, children: _.checked })
154
+ children: /* @__PURE__ */ f("div", { className: `${s}-list-item-label`, children: E(t.renderOption) ? d : g ? /* @__PURE__ */ f(q, { checked: n, disabled: e.disabled, children: d }) : /* @__PURE__ */ N(C, { children: [
155
+ d,
156
+ n && /* @__PURE__ */ f("span", { className: `${s}-check-icon`, children: _.checked })
159
157
  ] }) })
160
158
  },
161
- n
159
+ o
162
160
  );
163
161
  }
164
162
  }
165
- ) }) : /* @__PURE__ */ m(w, { children: g == null ? void 0 : g() });
163
+ ) }) : /* @__PURE__ */ f(C, { children: y?.() });
166
164
  };
167
165
  export {
168
166
  ke as default,