@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/radio/Group.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import A from "lodash/isArray";
3
3
  import M from "lodash/isPlainObject";
4
4
  import { createContext as D, useContext as F } from "react";
@@ -8,89 +8,89 @@ import S from "../components/common/hooks/useMergeValue.js";
8
8
  import T from "@unicom-cloud/utils/class-name";
9
9
  import { pickTriggerPropsFromRest as _ } from "../utils/constant.js";
10
10
  import { pickDataAttributes as q } from "../components/common/utils/pick.js";
11
- import g from "./Radio.js";
11
+ import f from "./Radio.js";
12
12
  import w from "../config-provider/context.js";
13
- const $ = {
13
+ const g = {
14
14
  type: "radio"
15
15
  }, B = {
16
16
  type: "radio",
17
17
  mode: "outline",
18
18
  direction: "horizontal"
19
- }, x = D($), re = ({ children: s }) => /* @__PURE__ */ i(x.Provider, { value: $, children: s });
19
+ }, v = D(g), re = ({ children: s }) => /* @__PURE__ */ t(v.Provider, { value: g, children: s });
20
20
  function E(s) {
21
21
  const {
22
- getPrefixCls: l,
23
- size: b,
24
- componentConfig: u,
25
- rtl: h
22
+ getPrefixCls: C,
23
+ size: x,
24
+ componentConfig: h,
25
+ rtl: $
26
26
  } = F(w), e = O(
27
27
  s,
28
28
  B,
29
- u == null ? void 0 : u["Radio.Group"]
29
+ h?.["Radio.Group"]
30
30
  ), {
31
- style: z,
32
- className: C,
33
- name: y,
34
- children: V,
35
- direction: p,
36
- type: c,
37
- mode: m,
38
- options: n,
39
- disabled: a
40
- } = e, [f, N] = S(void 0, {
31
+ style: b,
32
+ className: z,
33
+ name: P,
34
+ children: y,
35
+ direction: u,
36
+ type: d,
37
+ mode: p,
38
+ options: l,
39
+ disabled: i
40
+ } = e, [c, V] = S(void 0, {
41
41
  defaultValue: e.defaultValue,
42
42
  value: e.value
43
- }), v = e.size || b, o = l == null ? void 0 : l("radio"), P = T(
43
+ }), m = e.size || x, o = C?.("radio"), N = T(
44
44
  `${o}-group`,
45
45
  {
46
- [`${o}-group-type-button`]: c !== "radio",
47
- [`${o}-size-${v}`]: !!v,
48
- [`${o}-mode-${m}`]: !!m,
49
- [`${o}-group-disabled`]: a,
50
- [`${o}-group-direction-horizontal`]: p === "horizontal",
46
+ [`${o}-group-type-button`]: d !== "radio",
47
+ [`${o}-size-${m}`]: !!m,
48
+ [`${o}-mode-${p}`]: !!p,
49
+ [`${o}-group-disabled`]: i,
50
+ [`${o}-group-direction-horizontal`]: u === "horizontal",
51
51
  // 潘启宝添加
52
- [`${o}-group-direction-vertical`]: p === "vertical",
53
- [`${o}-group-rtl`]: h
52
+ [`${o}-group-direction-vertical`]: u === "vertical",
53
+ [`${o}-group-rtl`]: $
54
54
  },
55
- C
55
+ z
56
56
  ), R = {
57
- onChangeValue: (r, d) => {
58
- const { onChange: t } = e;
59
- r !== f && ("value" in e || N(r), t == null || t(r, d));
57
+ onChangeValue: (r, n) => {
58
+ const { onChange: a } = e;
59
+ r !== c && ("value" in e || V(r), a?.(r, n));
60
60
  },
61
- type: c,
62
- value: f,
63
- disabled: a,
61
+ type: d,
62
+ value: c,
63
+ disabled: i,
64
64
  group: !0,
65
- name: y
65
+ name: P
66
66
  };
67
- return /* @__PURE__ */ i(x.Provider, { value: R, children: /* @__PURE__ */ i(
67
+ return /* @__PURE__ */ t(v.Provider, { value: R, children: /* @__PURE__ */ t(
68
68
  "div",
69
69
  {
70
- className: P,
70
+ className: N,
71
71
  role: "radiogroup",
72
- style: z,
72
+ style: b,
73
73
  ..._(e),
74
74
  ...q(e),
75
- children: n && A(n) ? n.map((r, d) => {
76
- const { value: t, label: G, disabled: j, ...k } = r;
77
- return M(r) ? /* @__PURE__ */ i(
78
- g,
75
+ children: l && A(l) ? l.map((r, n) => {
76
+ const { value: a, label: G, disabled: j, ...k } = r;
77
+ return M(r) ? /* @__PURE__ */ t(
78
+ f,
79
79
  {
80
80
  ...k,
81
- disabled: a || j,
82
- value: t,
81
+ disabled: i || j,
82
+ value: a,
83
83
  children: G
84
84
  },
85
- t
86
- ) : /* @__PURE__ */ i(g, { value: r, disabled: a, children: r }, d);
87
- }) : V
85
+ a
86
+ ) : /* @__PURE__ */ t(f, { value: r, disabled: i, children: r }, n);
87
+ }) : y
88
88
  }
89
89
  ) });
90
90
  }
91
91
  E.displayName = "RadioGroup";
92
92
  export {
93
93
  re as ClearRadioGroupContext,
94
- x as RadioGroupContext,
94
+ v as RadioGroupContext,
95
95
  E as default
96
96
  };
@@ -1,70 +1,69 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { useContext as N } from "react";
1
+ import { jsx as r, jsxs as t } from "react/jsx-runtime";
2
+ import { useContext as x } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
- import x from "../components/common/hooks/useMergeProps.js";
5
- import i from "../typography/index.js";
6
- import n from "@unicom-cloud/utils/class-name";
7
- import p from "./Radio.js";
4
+ import N from "../components/common/hooks/useMergeProps.js";
5
+ import l from "../typography/index.js";
6
+ import c from "@unicom-cloud/utils/class-name";
7
+ import n from "./Radio.js";
8
8
  import $ from "../config-provider/context.js";
9
- const v = {};
10
- function k(m) {
11
- const { getPrefixCls: l, componentConfig: t, rtl: w } = N($), s = x(
12
- m,
13
- v,
14
- t == null ? void 0 : t["Radio.Block"]
15
- ), { className: u, options: h, ...f } = s, o = l == null ? void 0 : l("radio-group-block");
9
+ const g = {};
10
+ function v(i) {
11
+ const { getPrefixCls: d, componentConfig: p, rtl: C } = x($), a = N(
12
+ i,
13
+ g,
14
+ p?.["Radio.Block"]
15
+ ), { className: m, options: f, ...u } = a, o = d?.("radio-group-block");
16
16
  return /* @__PURE__ */ r(
17
- p.Group,
17
+ n.Group,
18
18
  {
19
- className: n(`${o}`, u),
20
- ...f,
21
- onChange: (a, c) => {
22
- var e;
23
- (e = s.onChange) == null || e.call(s, a, c);
19
+ className: c(`${o}`, m),
20
+ ...u,
21
+ onChange: (e, s) => {
22
+ a.onChange?.(e, s);
24
23
  },
25
- children: h.map((a) => /* @__PURE__ */ r(p, { value: a.value, children: ({ checked: c }) => /* @__PURE__ */ d(
24
+ children: f.map((e) => /* @__PURE__ */ r(n, { value: e.value, children: ({ checked: s }) => /* @__PURE__ */ t(
26
25
  "div",
27
26
  {
28
- style: { width: a.width },
29
- className: n(
27
+ style: { width: e.width },
28
+ className: c(
30
29
  `${o}-card`,
31
- c && `${o}-card-checked`
30
+ s && `${o}-card-checked`
32
31
  ),
33
32
  children: [
34
33
  /* @__PURE__ */ r("div", { className: `${o}-card-mask`, children: /* @__PURE__ */ r("div", { className: `${o}-card-mask-dot` }) }),
35
- /* @__PURE__ */ d("div", { className: `${o}-card-content`, children: [
34
+ /* @__PURE__ */ t("div", { className: `${o}-card-content`, children: [
36
35
  /* @__PURE__ */ r(
37
- i.Ellipsis,
36
+ l.Ellipsis,
38
37
  {
39
38
  className: `${o}-card-content-title`,
40
39
  rows: 1,
41
40
  showTooltip: !0,
42
41
  expandable: !1,
43
- onExpand: (e) => {
42
+ onExpand: (h) => {
44
43
  },
45
- children: a.title
44
+ children: e.title
46
45
  }
47
46
  ),
48
47
  /* @__PURE__ */ r(
49
- i.Ellipsis,
48
+ l.Ellipsis,
50
49
  {
51
50
  className: `${o}-card-content-desc`,
52
51
  rows: 1,
53
52
  showTooltip: !0,
54
53
  expandable: !1,
55
- onExpand: (e) => {
54
+ onExpand: (h) => {
56
55
  },
57
- children: a.desc
56
+ children: e.desc
58
57
  }
59
58
  )
60
59
  ] })
61
60
  ]
62
61
  }
63
- ) }, a.title))
62
+ ) }, e.title))
64
63
  }
65
64
  );
66
65
  }
67
- k.displayName = "RadioGroupBlock";
66
+ v.displayName = "RadioGroupBlock";
68
67
  export {
69
- k as default
68
+ v as default
70
69
  };
package/radio/Radio.js CHANGED
@@ -1,94 +1,92 @@
1
- import { jsxs as h, jsx as c, Fragment as _ } from "react/jsx-runtime";
2
- import C from "lodash/isFunction";
3
- import j from "lodash/isNil";
4
- import D, { useRef as F, useContext as b } from "react";
1
+ import { jsxs as u, jsx as i, Fragment as V } from "react/jsx-runtime";
2
+ import d from "lodash/isFunction";
3
+ import _ from "lodash/isNil";
4
+ import j, { useRef as D, useContext as f } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import I from "../components/common/hooks/useMergeProps.js";
7
- import M from "../components/common/hooks/useMergeValue.js";
8
- import w from "../icon-hover/index.js";
9
- import A from "@unicom-cloud/utils/class-name";
10
- import { omit as H } from "../components/common/utils/omit.js";
11
- import L, { RadioGroupContext as N } from "./Group.js";
12
- import O from "./GroupBlock.js";
13
- import Q from "../config-provider/context.js";
14
- function u(g) {
15
- const d = F(null), { getPrefixCls: m, componentConfig: f, rtl: R } = b(Q), r = I(
16
- g,
6
+ import F from "../components/common/hooks/useMergeProps.js";
7
+ import I from "../components/common/hooks/useMergeValue.js";
8
+ import M from "../icon-hover/index.js";
9
+ import w from "@unicom-cloud/utils/class-name";
10
+ import { omit as A } from "../components/common/utils/omit.js";
11
+ import H, { RadioGroupContext as C } from "./Group.js";
12
+ import L from "./GroupBlock.js";
13
+ import O from "../config-provider/context.js";
14
+ function l(h) {
15
+ const p = D(null), { getPrefixCls: k, componentConfig: g, rtl: b } = f(O), r = F(
16
+ h,
17
17
  {},
18
- f == null ? void 0 : f.Radio
19
- ), e = b(N), a = m == null ? void 0 : m("radio"), t = { ...r };
20
- e.group && (t.checked = e.value === r.value, t.disabled = "disabled" in r ? r.disabled : e.disabled);
21
- const { disabled: p, children: l, value: $, style: v, className: x, ...n } = t, [s, G] = M(!1, {
22
- value: t.checked,
23
- defaultValue: t.defaultChecked
24
- }), y = A(
25
- `${a}${e.type === "button" ? "-button" : ""}`,
18
+ g?.Radio
19
+ ), e = f(C), t = k?.("radio"), a = { ...r };
20
+ e.group && (a.checked = e.value === r.value, a.disabled = "disabled" in r ? r.disabled : e.disabled);
21
+ const { disabled: c, children: s, value: x, style: N, className: R, ...m } = a, [n, $] = I(!1, {
22
+ value: a.checked,
23
+ defaultValue: a.defaultChecked
24
+ }), v = w(
25
+ `${t}${e.type === "button" ? "-button" : ""}`,
26
26
  {
27
- [`${a}-checked`]: s,
28
- [`${a}-disabled`]: p,
29
- [`${a}-rtl`]: R
27
+ [`${t}-checked`]: n,
28
+ [`${t}-disabled`]: c,
29
+ [`${t}-rtl`]: b
30
30
  },
31
- x
32
- ), B = (o) => {
33
- var k;
34
- const { onChange: i, value: V } = t;
35
- p || (e.group ? (k = e.onChangeValue) == null || k.call(e, V, o) : !("checked" in r) && !s && G(!0), !s && (i == null || i(!0, o)));
36
- }, P = D.useCallback(
31
+ R
32
+ ), G = (o) => {
33
+ const { onChange: P, value: B } = a;
34
+ c || (e.group ? e.onChangeValue?.(B, o) : !("checked" in r) && !n && $(!0), !n && P?.(!0, o));
35
+ }, y = j.useCallback(
37
36
  (o) => {
38
- var i;
39
- C(r.children) && (o.preventDefault(), d.current && d.current.click()), (i = n.onClick) == null || i.call(n, o);
37
+ d(r.children) && (o.preventDefault(), p.current && p.current.click()), m.onClick?.(o);
40
38
  },
41
- [r.children, n.onClick]
39
+ [r.children, m.onClick]
42
40
  );
43
- return /* @__PURE__ */ h(
41
+ return /* @__PURE__ */ u(
44
42
  "label",
45
43
  {
46
- ...H(n, ["checked", "onChange"]),
47
- onClick: P,
48
- style: v,
49
- className: y,
44
+ ...A(m, ["checked", "onChange"]),
45
+ onClick: y,
46
+ style: N,
47
+ className: v,
50
48
  children: [
51
- /* @__PURE__ */ c(
49
+ /* @__PURE__ */ i(
52
50
  "input",
53
51
  {
54
- ref: d,
55
- disabled: p,
56
- value: $ || "",
52
+ ref: p,
53
+ disabled: c,
54
+ value: x || "",
57
55
  type: "radio",
58
56
  ...e.name ? { name: e.name } : {},
59
- checked: s,
57
+ checked: n,
60
58
  onChange: (o) => {
61
- o.persist(), B(o);
59
+ o.persist(), G(o);
62
60
  },
63
61
  onClick: (o) => {
64
62
  o.stopPropagation();
65
63
  }
66
64
  }
67
65
  ),
68
- C(l) ? l({ checked: s }) : e.type === "radio" ? /* @__PURE__ */ h(_, { children: [
69
- /* @__PURE__ */ c(
70
- w,
66
+ d(s) ? s({ checked: n }) : e.type === "radio" ? /* @__PURE__ */ u(V, { children: [
67
+ /* @__PURE__ */ i(
68
+ M,
71
69
  {
72
- prefix: a,
73
- className: `${a}-mask-wrapper`,
74
- disabled: s || p,
75
- children: /* @__PURE__ */ c("div", { className: `${a}-mask` })
70
+ prefix: t,
71
+ className: `${t}-mask-wrapper`,
72
+ disabled: n || c,
73
+ children: /* @__PURE__ */ i("div", { className: `${t}-mask` })
76
74
  }
77
75
  ),
78
- !j(l) && /* @__PURE__ */ c("span", { className: `${a}-text`, children: l })
79
- ] }) : e.type === "button" && /* @__PURE__ */ c("span", { className: `${a}-button-inner`, children: l })
76
+ !_(s) && /* @__PURE__ */ i("span", { className: `${t}-text`, children: s })
77
+ ] }) : e.type === "button" && /* @__PURE__ */ i("span", { className: `${t}-button-inner`, children: s })
80
78
  ]
81
79
  }
82
80
  );
83
81
  }
84
- u.__PQB_RADIO = !0;
85
- u.displayName = "Radio";
86
- u.Group = L;
87
- u.GroupBlock = O;
88
- u.GroupContext = N;
82
+ l.__PQB_RADIO = !0;
83
+ l.displayName = "Radio";
84
+ l.Group = H;
85
+ l.GroupBlock = L;
86
+ l.GroupContext = C;
89
87
  export {
90
- L as RadioGroup,
91
- O as RadioGroupBlock,
92
- N as RadioGroupContext,
93
- u as default
88
+ H as RadioGroup,
89
+ L as RadioGroupBlock,
90
+ C as RadioGroupContext,
91
+ l as default
94
92
  };
package/rate/index.js CHANGED
@@ -1,128 +1,128 @@
1
- import { jsx as o, jsxs as Y } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as Y } from "react/jsx-runtime";
2
2
  import Z from "@unicom-cloud/icons/IconUiFaceFrownFill";
3
- import U from "@unicom-cloud/icons/IconUiFaceMehFill";
3
+ import A from "@unicom-cloud/icons/IconUiFaceMehFill";
4
4
  import x from "@unicom-cloud/icons/IconUiFaceSmileFill";
5
- import tt from "@unicom-cloud/icons/IconUiStarFill";
6
- import { times as rt, div as et } from "@unicom-cloud/utils/math";
7
- import _, { useContext as ot, useState as y } from "react";
5
+ import ee from "@unicom-cloud/icons/IconUiStarFill";
6
+ import { times as oe, div as te } from "@unicom-cloud/utils/math";
7
+ import E, { useContext as re, useState as d } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
- import at from "../components/common/hooks/useMergeProps.js";
10
- import st from "../tooltip/index.js";
11
- import S from "@unicom-cloud/utils/class-name";
12
- import { omit as ct } from "../components/common/utils/omit.js";
13
- import lt from "../config-provider/context.js";
14
- const it = {
15
- character: /* @__PURE__ */ o(tt, {}),
9
+ import ae from "../components/common/hooks/useMergeProps.js";
10
+ import se from "../tooltip/index.js";
11
+ import k from "@unicom-cloud/utils/class-name";
12
+ import { omit as ne } from "../components/common/utils/omit.js";
13
+ import ce from "../config-provider/context.js";
14
+ const le = {
15
+ character: /* @__PURE__ */ r(ee, {}),
16
16
  count: 5
17
17
  };
18
- function nt(j, g) {
19
- const { getPrefixCls: m, componentConfig: p, rtl: z } = ot(lt), F = at(
20
- j,
21
- it,
22
- p == null ? void 0 : p.Rate
18
+ function ie(H, U) {
19
+ const { getPrefixCls: S, componentConfig: _, rtl: j } = re(ce), C = ae(
20
+ H,
21
+ le,
22
+ _?.Rate
23
23
  ), {
24
- style: D = {},
25
- className: L,
26
- defaultValue: T,
27
- character: f,
28
- count: I,
29
- value: M,
30
- tooltips: b,
24
+ style: z = {},
25
+ className: D,
26
+ defaultValue: L,
27
+ character: l,
28
+ count: v,
29
+ value: g,
30
+ tooltips: $,
31
31
  allowHalf: a,
32
- allowClear: W,
33
- readonly: u,
34
- disabled: d,
35
- grading: w,
36
- onChange: c,
37
- onHoverChange: l,
38
- ...q
39
- } = F, [B, P] = y(T || M || 0), [h, R] = y(0), [$, V] = y(), e = m == null ? void 0 : m("rate"), G = S(
40
- e,
32
+ allowClear: T,
33
+ readonly: i,
34
+ disabled: m,
35
+ grading: N,
36
+ onChange: y,
37
+ onHoverChange: F,
38
+ ...W
39
+ } = C, [q, I] = d(L || g || 0), [f, P] = d(0), [p, M] = d(), t = S?.("rate"), B = k(
40
+ t,
41
41
  {
42
- [`${e}-readonly`]: u,
43
- [`${e}-disabled`]: d,
44
- [`${e}-rtl`]: z
42
+ [`${t}-readonly`]: i,
43
+ [`${t}-disabled`]: m,
44
+ [`${t}-rtl`]: j
45
45
  },
46
- L
47
- ), n = "value" in F ? M : B, A = () => {
48
- h && (R(0), l == null || l(0));
49
- }, C = (t, s) => {
50
- const r = s && a ? t + 0.5 : t + 1;
51
- r !== h && (R(r), l == null || l(r));
52
- }, k = (t, s) => {
53
- const r = s && a ? t + 0.5 : t + 1;
54
- V(!0), r !== n ? (P(r), c == null || c(r)) : W && (P(0), c == null || c(0), A());
55
- }, H = (t) => {
56
- const s = a ? rt(+et(n || 0, 0.5).toFixed(0), 0.5) : Math.round(n), r = h || s;
57
- let i = typeof f == "function" ? f(t) : f;
58
- w && (r <= 2 ? i = /* @__PURE__ */ o(Z, {}) : r <= 3 ? i = /* @__PURE__ */ o(U, {}) : i = /* @__PURE__ */ o(x, {}), r <= t && (i = /* @__PURE__ */ o(U, {})));
59
- const J = S(`${e}-character`, {
60
- [`${e}-character-half`]: a && t + 0.5 === r,
61
- [`${e}-character-full`]: t + 1 <= r,
62
- [`${e}-character-scale`]: $ && t + 1 < n
63
- }), K = u || d ? {} : {
64
- onMouseEnter: C.bind(this, t, !0),
65
- onClick: k.bind(this, t, !0)
66
- }, O = u || d ? {} : {
67
- onMouseEnter: C.bind(this, t, !1),
68
- onClick: k.bind(this, t, !1)
69
- }, v = b && b[t], Q = v ? st : _.Fragment, X = v ? { content: v } : {};
70
- function N(E) {
46
+ D
47
+ ), c = "value" in C ? g : q, b = () => {
48
+ f && (P(0), F?.(0));
49
+ }, w = (e, s) => {
50
+ const o = s && a ? e + 0.5 : e + 1;
51
+ o !== f && (P(o), F?.(o));
52
+ }, R = (e, s) => {
53
+ const o = s && a ? e + 0.5 : e + 1;
54
+ M(!0), o !== c ? (I(o), y?.(o)) : T && (I(0), y?.(0), b());
55
+ }, G = (e) => {
56
+ const s = a ? oe(+te(c || 0, 0.5).toFixed(0), 0.5) : Math.round(c), o = f || s;
57
+ let n = typeof l == "function" ? l(e) : l;
58
+ N && (o <= 2 ? n = /* @__PURE__ */ r(Z, {}) : o <= 3 ? n = /* @__PURE__ */ r(A, {}) : n = /* @__PURE__ */ r(x, {}), o <= e && (n = /* @__PURE__ */ r(A, {})));
59
+ const J = k(`${t}-character`, {
60
+ [`${t}-character-half`]: a && e + 0.5 === o,
61
+ [`${t}-character-full`]: e + 1 <= o,
62
+ [`${t}-character-scale`]: p && e + 1 < c
63
+ }), K = i || m ? {} : {
64
+ onMouseEnter: w.bind(this, e, !0),
65
+ onClick: R.bind(this, e, !0)
66
+ }, O = i || m ? {} : {
67
+ onMouseEnter: w.bind(this, e, !1),
68
+ onClick: R.bind(this, e, !1)
69
+ }, u = $ && $[e], Q = u ? se : E.Fragment, X = u ? { content: u } : {};
70
+ function h(V) {
71
71
  return {
72
72
  role: "radio",
73
- "aria-checked": t + (E ? 0.5 : 1) <= r,
74
- "aria-setsize": I,
75
- "aria-posinset": t + (E ? 0.5 : 1)
73
+ "aria-checked": e + (V ? 0.5 : 1) <= o,
74
+ "aria-setsize": v,
75
+ "aria-posinset": e + (V ? 0.5 : 1)
76
76
  };
77
77
  }
78
- return /* @__PURE__ */ o(Q, { ...X, children: /* @__PURE__ */ Y(
78
+ return /* @__PURE__ */ r(Q, { ...X, children: /* @__PURE__ */ Y(
79
79
  "div",
80
80
  {
81
81
  className: J,
82
- style: $ ? { animationDelay: `${50 * t}ms` } : {},
82
+ style: p ? { animationDelay: `${50 * e}ms` } : {},
83
83
  onAnimationEnd: () => {
84
- $ && t + 1 >= n - 1 && V(!1);
84
+ p && e + 1 >= c - 1 && M(!1);
85
85
  },
86
- ...a ? {} : N(),
86
+ ...a ? {} : h(),
87
87
  children: [
88
- /* @__PURE__ */ o(
88
+ /* @__PURE__ */ r(
89
89
  "div",
90
90
  {
91
- className: `${e}-character-left`,
91
+ className: `${t}-character-left`,
92
92
  ...K,
93
- ...a ? N(!0) : {},
94
- children: i
93
+ ...a ? h(!0) : {},
94
+ children: n
95
95
  }
96
96
  ),
97
- /* @__PURE__ */ o(
97
+ /* @__PURE__ */ r(
98
98
  "div",
99
99
  {
100
- className: `${e}-character-right`,
100
+ className: `${t}-character-right`,
101
101
  ...O,
102
- ...a ? N() : {},
103
- children: i
102
+ ...a ? h() : {},
103
+ children: n
104
104
  }
105
105
  )
106
106
  ]
107
107
  }
108
- ) }, t);
108
+ ) }, e);
109
109
  };
110
- return /* @__PURE__ */ o(
110
+ return /* @__PURE__ */ r(
111
111
  "div",
112
112
  {
113
- ref: g,
114
- ...ct(q, ["error"]),
115
- style: D,
116
- className: G,
117
- onMouseLeave: A,
118
- children: /* @__PURE__ */ o("div", { className: `${e}-inner`, children: Array.apply(null, Array(w ? 5 : I)).map(
119
- (t, s) => H(s)
113
+ ref: U,
114
+ ...ne(W, ["error"]),
115
+ style: z,
116
+ className: B,
117
+ onMouseLeave: b,
118
+ children: /* @__PURE__ */ r("div", { className: `${t}-inner`, children: Array.apply(null, Array(N ? 5 : v)).map(
119
+ (e, s) => G(s)
120
120
  ) })
121
121
  }
122
122
  );
123
123
  }
124
- const mt = _.forwardRef(nt);
125
- mt.displayName = "Rate";
124
+ const me = E.forwardRef(ie);
125
+ me.displayName = "Rate";
126
126
  export {
127
- mt as default
127
+ me as default
128
128
  };