@unicom-cloud/ui 0.8.98 → 0.8.100

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 (180) hide show
  1. package/Anchor.js +3 -1
  2. package/Badge.js +54 -7
  3. package/Copy.js +49 -2
  4. package/Flex.js +12 -0
  5. package/Grid.js +1 -1
  6. package/LiquidFill.js +60 -2
  7. package/Marquee.js +62 -0
  8. package/QrCode.js +14 -9
  9. package/Segmented.js +11 -0
  10. package/Space.js +14 -6
  11. package/Splitter.js +6 -0
  12. package/Tag.js +3 -2
  13. package/Tour.js +14 -9
  14. package/alert/index.js +38 -39
  15. package/anchor/index.js +5 -3
  16. package/badge/index.js +174 -80
  17. package/collapse/Collapse.js +54 -48
  18. package/components/common/space/index.js +90 -106
  19. package/copy/index.js +83 -35
  20. package/flex/index.js +59 -0
  21. package/flex/interface.js +34 -0
  22. package/flex/utils.js +13 -0
  23. package/grid/{GridItem.js → Item.js} +15 -15
  24. package/grid/index.js +1 -1
  25. package/index.js +490 -477
  26. package/input/Button.js +39 -34
  27. package/input/Textarea.js +108 -104
  28. package/liquid-fill/index.js +256 -2
  29. package/marquee/index.js +283 -0
  30. package/menu/Item.js +17 -16
  31. package/package.json +1 -1
  32. package/qr-code/index.js +54 -36
  33. package/rate/index.js +8 -8
  34. package/segmented/index.js +225 -0
  35. package/space/index.js +28 -29
  36. package/spin/index.js +75 -62
  37. package/splitter/Panel.js +39 -0
  38. package/splitter/SplitBar.js +157 -0
  39. package/splitter/Splitter.js +139 -0
  40. package/splitter/hooks/useEvent.js +12 -0
  41. package/splitter/hooks/useItems.js +26 -0
  42. package/splitter/hooks/useResizable.js +26 -0
  43. package/splitter/hooks/useResize.js +68 -0
  44. package/splitter/hooks/useSizes.js +60 -0
  45. package/splitter/index.js +7 -0
  46. package/splitter/interface.js +1 -0
  47. package/style.css +1 -1
  48. package/table/Table.js +1 -1
  49. package/table/hook/useThResizable.js +72 -26
  50. package/table/tbody/Td.js +80 -77
  51. package/table/th-resizable/index.js +92 -35
  52. package/tag/index.js +42 -41
  53. package/tooltip/index.js +89 -82
  54. package/tour/index.js +110 -89
  55. package/types/common/hooks/useMergeProps.d.ts +1 -1
  56. package/types/common/space/index.d.ts +7 -5
  57. package/types/common/space/interface.d.ts +29 -16
  58. package/types/pc/affix/interface.d.ts +0 -2
  59. package/types/pc/alert/index.d.ts +2 -2
  60. package/types/pc/anchor/index.d.ts +2 -1
  61. package/types/pc/anchor/interface.d.ts +0 -2
  62. package/types/pc/auto-complete/interface.d.ts +0 -6
  63. package/types/pc/avatar/interface.d.ts +0 -4
  64. package/types/pc/badge/index.d.ts +4 -4
  65. package/types/pc/badge/interface.d.ts +26 -0
  66. package/types/pc/breadcrumb/interface.d.ts +0 -3
  67. package/types/pc/carousel/interface.d.ts +2 -6
  68. package/types/pc/cascader/interface.d.ts +6 -18
  69. package/types/pc/checkbox/interface.d.ts +0 -1
  70. package/types/pc/collapse/interface.d.ts +4 -2
  71. package/types/pc/color-picker/interface.d.ts +0 -2
  72. package/types/pc/config-provider/interface.d.ts +16 -14
  73. package/types/pc/copy/interface.d.ts +2 -1
  74. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  75. package/types/pc/date-picker/interface.d.ts +0 -17
  76. package/types/pc/descriptions/interface.d.ts +0 -1
  77. package/types/pc/drawer/interface.d.ts +0 -7
  78. package/types/pc/dropdown/interface.d.ts +0 -1
  79. package/types/pc/flex/index.d.ts +9 -0
  80. package/types/pc/flex/interface.d.ts +61 -0
  81. package/types/pc/flex/utils.d.ts +9 -0
  82. package/types/pc/form/interface.d.ts +9 -22
  83. package/types/pc/form/util.d.ts +1 -1
  84. package/types/pc/grid/index.d.ts +3 -3
  85. package/types/pc/grid/interface.d.ts +1 -6
  86. package/types/pc/image/interface.d.ts +0 -13
  87. package/types/pc/index.d.ts +16 -6
  88. package/types/pc/input/Textarea.d.ts +2 -6
  89. package/types/pc/input/interface.d.ts +5 -13
  90. package/types/pc/input-number/interface.d.ts +0 -4
  91. package/types/pc/input-tag/interface.d.ts +0 -13
  92. package/types/pc/layout/interface.d.ts +0 -1
  93. package/types/pc/link/interface.d.ts +0 -1
  94. package/types/pc/liquid-fill/index.d.ts +114 -1
  95. package/types/pc/list/interface.d.ts +0 -4
  96. package/types/pc/marquee/index.d.ts +61 -0
  97. package/types/pc/menu/context.d.ts +1 -1
  98. package/types/pc/menu/interface.d.ts +0 -8
  99. package/types/pc/message/interface.d.ts +0 -2
  100. package/types/pc/modal/interface.d.ts +0 -5
  101. package/types/pc/notification/interface.d.ts +0 -1
  102. package/types/pc/pagination/interface.d.ts +0 -2
  103. package/types/pc/popconfirm/interface.d.ts +8 -10
  104. package/types/pc/popover/interface.d.ts +0 -1
  105. package/types/pc/progress/interface.d.ts +0 -3
  106. package/types/pc/qr-code/index.d.ts +1 -1
  107. package/types/pc/rate/index.d.ts +2 -2
  108. package/types/pc/resize-box/interface.d.ts +1 -7
  109. package/types/pc/segmented/index.d.ts +8 -0
  110. package/types/pc/segmented/interface.d.ts +88 -0
  111. package/types/pc/select/interface.d.ts +0 -12
  112. package/types/pc/select-view/interface.d.ts +0 -7
  113. package/types/pc/slider/interface.d.ts +0 -4
  114. package/types/pc/space/index.d.ts +4 -1
  115. package/types/pc/space/interface.d.ts +6 -10
  116. package/types/pc/spin/interface.d.ts +4 -1
  117. package/types/pc/splitter/Panel.d.ts +8 -0
  118. package/types/pc/splitter/SplitBar.d.ts +21 -0
  119. package/types/pc/splitter/Splitter.d.ts +4 -0
  120. package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
  121. package/types/pc/splitter/hooks/useItems.d.ts +10 -0
  122. package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
  123. package/types/pc/splitter/hooks/useResize.d.ts +4 -0
  124. package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
  125. package/types/pc/splitter/index.d.ts +8 -0
  126. package/types/pc/splitter/interface.d.ts +213 -0
  127. package/types/pc/statistic/interface.d.ts +0 -4
  128. package/types/pc/steps/interface.d.ts +0 -3
  129. package/types/pc/table/hook/useThResizable.d.ts +2 -2
  130. package/types/pc/table/interface.d.ts +4 -15
  131. package/types/pc/tabs/interface.d.ts +0 -7
  132. package/types/pc/tag/index.d.ts +2 -0
  133. package/types/pc/tag/interface.d.ts +0 -1
  134. package/types/pc/time-picker/interface.d.ts +0 -7
  135. package/types/pc/tooltip/interface.d.ts +4 -1
  136. package/types/pc/tour/index.d.ts +6 -1
  137. package/types/pc/transfer/interface.d.ts +2 -9
  138. package/types/pc/tree/interface.d.ts +2 -8
  139. package/types/pc/tree-select/interface.d.ts +0 -8
  140. package/types/pc/trigger/interface.d.ts +0 -5
  141. package/types/pc/typography/EditContent.d.ts +2 -1
  142. package/types/pc/typography/interface.d.ts +45 -30
  143. package/types/pc/upload/interface.d.ts +6 -11
  144. package/types/pc/utils/index.d.ts +1 -0
  145. package/types/pc/utils/names.d.ts +24 -0
  146. package/types/pc/utils/toArray.d.ts +7 -0
  147. package/types/pc/verification-code/interface.d.ts +0 -2
  148. package/types/pc/watermark/interface.d.ts +0 -2
  149. package/typography/Base.js +73 -73
  150. package/typography/EditContent.js +43 -33
  151. package/typography/Ellipsis.js +117 -184
  152. package/typography/Operations.js +97 -49
  153. package/typography/useCssEllipsis.js +7 -6
  154. package/utils/index.js +117 -115
  155. package/utils/names.js +16 -0
  156. package/utils/toArray.js +12 -0
  157. package/version/index.js +1 -1
  158. package/_virtual/_commonjsHelpers.js +0 -6
  159. package/_virtual/index.js +0 -7
  160. package/_virtual/index2.js +0 -4
  161. package/liquid-fill/LiquidFill.js +0 -226
  162. package/liquid-fill/LiquidFill2.js +0 -3
  163. package/space-/index.js +0 -93
  164. package/types/common/utils/color.d.ts +0 -1
  165. package/types/common/utils/computeScrollIntoView.d.ts +0 -1
  166. package/types/common/utils/index.d.ts +0 -45
  167. package/types/common/utils/math.d.ts +0 -1
  168. package/types/common/utils/reactTransitionGroup.d.ts +0 -1
  169. package/types/common/utils/tree.d.ts +0 -1
  170. package/types/common/utils/tween.d.ts +0 -1
  171. package/types/common/utils/uuid.d.ts +0 -1
  172. package/types/common/utils/validate.d.ts +0 -1
  173. package/types/pc/liquid-fill/LiquidFill.d.ts +0 -115
  174. package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
  175. package/types/pc/space-/index.d.ts +0 -6
  176. package/types/pc/space-/interface.d.ts +0 -38
  177. /package/{space- → components/common/space}/toArray.js +0 -0
  178. /package/{space- → segmented}/interface.js +0 -0
  179. /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
  180. /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
@@ -0,0 +1,283 @@
1
+ import { jsxs as S, jsx as l, Fragment as A } from "react/jsx-runtime";
2
+ import { useContext as U, useRef as k, useState as u, useEffect as N } from "react";
3
+ import "../config-provider/ConfigProvider.js";
4
+ import "lodash/isEqualWith";
5
+ import "../components/common/utils/is.js";
6
+ import "@unicom-cloud/utils/constant/keyboardCode";
7
+ import "lodash/isNumber";
8
+ import "lodash/merge";
9
+ import "../components/common/utils/dom.js";
10
+ import "../components/common/hooks/useIntersectionObserver.js";
11
+ import V from "../components/common/hooks/useMergeProps.js";
12
+ import "../components/common/utils/reactDOM.js";
13
+ import "@unicom-cloud/utils/constant";
14
+ import "lodash/debounce";
15
+ import "@unicom-cloud/utils/case-name";
16
+ import Z from "@unicom-cloud/utils/class-name";
17
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
18
+ import "@unicom-cloud/utils/constant/ui";
19
+ import "../utils/contextHolder.js";
20
+ import "@unicom-cloud/utils/dayjs";
21
+ import "@unicom-cloud/utils/clipboard-copy";
22
+ import "../components/common/utils/dayjs.js";
23
+ import "@unicom-cloud/utils/file/fileToURL";
24
+ import "lodash/escapeRegExp";
25
+ import "lodash/isArray";
26
+ import "lodash/isString";
27
+ import "lodash/isFunction";
28
+ import "lodash/throttle";
29
+ import "lodash/camelCase";
30
+ import "lodash/capitalize";
31
+ import "lodash/cloneDeep";
32
+ import "lodash/get";
33
+ import "lodash/has";
34
+ import "lodash/kebabCase";
35
+ import "lodash/mergeWith";
36
+ import "lodash/set";
37
+ import "lodash/setWith";
38
+ import "lodash/snakeCase";
39
+ import "lodash/startCase";
40
+ import "lodash/uniq";
41
+ import "lodash/upperFirst";
42
+ import "@unicom-cloud/utils/math";
43
+ import "lodash/isPlainObject";
44
+ import "../dist/react-transition-group/src/CSSTransition.js";
45
+ import "../dist/react-transition-group/src/ReplaceTransition.js";
46
+ import "../dist/react-transition-group/src/SwitchTransition.js";
47
+ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
48
+ import "../dist/react-transition-group/src/TransitionGroup.js";
49
+ import { resizeObserver as _ } from "../components/common/utils/resizeObserver.js";
50
+ import "@unicom-cloud/utils/file/saveAs";
51
+ import "@unicom-cloud/utils/screenfull";
52
+ import "@unicom-cloud/utils/constant/ui.js";
53
+ import "react-is";
54
+ import "@unicom-cloud/utils/tree";
55
+ import "@unicom-cloud/utils/is";
56
+ import "uuid";
57
+ import "../dist/validate/src/index.js";
58
+ import tt from "../config-provider/context.js";
59
+ const et = {
60
+ speed: 50,
61
+ // 默认50像素/秒(数值越大越快)
62
+ direction: "left",
63
+ pauseOnHover: !1,
64
+ gradient: !0,
65
+ loop: 0,
66
+ // 0表示无限循环
67
+ gradientSize: 50
68
+ }, ae = (q) => {
69
+ const { getPrefixCls: O, componentConfig: P } = U(tt), s = O?.("marquee"), R = V(
70
+ q,
71
+ et,
72
+ P?.Marquee
73
+ );
74
+ let {
75
+ children: $,
76
+ style: L,
77
+ className: D,
78
+ speed: E,
79
+ // 默认50像素/秒(数值越大越快)
80
+ direction: c,
81
+ pauseOnHover: H,
82
+ gradient: W,
83
+ loop: a,
84
+ // 0表示无限循环
85
+ gradientSize: d,
86
+ onComplete: b
87
+ } = R;
88
+ const h = k(null), T = k(null), w = k(null), n = k(), [F, j] = u({ width: 0, height: 0 }), [rt, B] = u({ width: 0, height: 0 }), [y, I] = u(!1), [M, m] = u(!0), [x, p] = u(0), [X, g] = u(0), o = c === "left" || c === "right";
89
+ d = o ? 50 : 20;
90
+ const z = () => {
91
+ if (w.current && h.current) {
92
+ const r = w.current.scrollWidth, t = w.current.scrollHeight, i = h.current.offsetWidth, e = h.current.offsetHeight;
93
+ j({ width: r, height: t }), B({ width: i, height: e });
94
+ const f = o ? r > i : t > e;
95
+ if (I(f), f) {
96
+ const v = c === "right" ? -r : c === "down" ? -t : 0;
97
+ p(v);
98
+ }
99
+ }
100
+ };
101
+ N(() => {
102
+ const r = _(
103
+ [h.current],
104
+ z
105
+ );
106
+ return () => r();
107
+ }, []), N(() => {
108
+ z(), g(0);
109
+ }, [$]), N(() => {
110
+ if (!M || !y)
111
+ return;
112
+ let r = null, t = x;
113
+ const i = o ? F.width : F.height;
114
+ let e = X;
115
+ const f = (v) => {
116
+ if (!r) {
117
+ r = v, n.current = requestAnimationFrame(f);
118
+ return;
119
+ }
120
+ const Q = (v - r) / 1e3;
121
+ r = v;
122
+ const C = E * Q;
123
+ switch (c) {
124
+ case "left":
125
+ if (t -= C, t <= -i && (t += i, e += 1, g(e), a > 0 && e >= a)) {
126
+ cancelAnimationFrame(n.current), m(!1), p(0), b?.();
127
+ return;
128
+ }
129
+ break;
130
+ case "right":
131
+ if (t += C, t >= 0 && (t -= i, e += 1, g(e), a > 0 && e >= a)) {
132
+ cancelAnimationFrame(n.current), m(!1), p(-i), b?.();
133
+ return;
134
+ }
135
+ break;
136
+ case "up":
137
+ if (t -= C, t <= -i && (t += i, e += 1, g(e), a > 0 && e >= a)) {
138
+ cancelAnimationFrame(n.current), m(!1), p(0), b?.();
139
+ return;
140
+ }
141
+ break;
142
+ case "down":
143
+ if (t += C, t >= 0 && (t -= i, e += 1, g(e), a > 0 && e >= a)) {
144
+ cancelAnimationFrame(n.current), m(!1), p(-i), b?.();
145
+ return;
146
+ }
147
+ break;
148
+ }
149
+ p(t), n.current = requestAnimationFrame(f);
150
+ };
151
+ return n.current = requestAnimationFrame(f), () => {
152
+ n.current && cancelAnimationFrame(n.current);
153
+ };
154
+ }, [M, E, c, F, y, a]), N(() => (z(), () => {
155
+ n.current && cancelAnimationFrame(n.current);
156
+ }), []);
157
+ const Y = () => {
158
+ H && m(!1);
159
+ }, G = () => {
160
+ H && m(!0);
161
+ }, J = () => o ? `translateX(${x}px)` : `translateY(${x}px)`, K = () => {
162
+ const r = {
163
+ display: o ? "inline-block" : "block",
164
+ whiteSpace: o ? "nowrap" : "normal",
165
+ // 消除元素间默认间距
166
+ marginRight: o ? 0 : void 0,
167
+ marginBottom: o ? void 0 : 0
168
+ }, t = /* @__PURE__ */ l(
169
+ "div",
170
+ {
171
+ ref: w,
172
+ style: r,
173
+ className: `${s}-children`,
174
+ children: $
175
+ }
176
+ );
177
+ return y ? /* @__PURE__ */ S(A, { children: [
178
+ t,
179
+ /* @__PURE__ */ l("div", { style: r, className: `${s}-children`, children: $ })
180
+ ] }) : t;
181
+ };
182
+ return /* @__PURE__ */ S(
183
+ "div",
184
+ {
185
+ ref: h,
186
+ className: Z(
187
+ s,
188
+ `${s}-${c}`,
189
+ D
190
+ ),
191
+ style: {
192
+ overflow: "hidden",
193
+ position: "relative",
194
+ ...L
195
+ },
196
+ onMouseEnter: Y,
197
+ onMouseLeave: G,
198
+ children: [
199
+ /* @__PURE__ */ l(
200
+ "div",
201
+ {
202
+ ref: T,
203
+ style: {
204
+ display: o ? "inline-block" : "block",
205
+ whiteSpace: "nowrap",
206
+ willChange: "transform",
207
+ // 启用GPU加速
208
+ transform: J()
209
+ },
210
+ className: `${s}-content`,
211
+ children: K()
212
+ }
213
+ ),
214
+ W && y && (o ? /* @__PURE__ */ S(A, { children: [
215
+ /* @__PURE__ */ l(
216
+ "div",
217
+ {
218
+ style: {
219
+ position: "absolute",
220
+ top: 0,
221
+ left: 0,
222
+ width: d,
223
+ height: "100%",
224
+ background: "linear-gradient(to right, #fff, transparent)",
225
+ pointerEvents: "none"
226
+ },
227
+ className: `${s}-linear-gradient-to-right`
228
+ }
229
+ ),
230
+ /* @__PURE__ */ l(
231
+ "div",
232
+ {
233
+ style: {
234
+ position: "absolute",
235
+ top: 0,
236
+ right: 0,
237
+ width: d,
238
+ height: "100%",
239
+ background: "linear-gradient(to left, #fff, transparent)",
240
+ pointerEvents: "none"
241
+ },
242
+ className: `${s}-linear-gradient-to-left`
243
+ }
244
+ )
245
+ ] }) : /* @__PURE__ */ S(A, { children: [
246
+ /* @__PURE__ */ l(
247
+ "div",
248
+ {
249
+ style: {
250
+ position: "absolute",
251
+ top: 0,
252
+ left: 0,
253
+ width: "100%",
254
+ height: d,
255
+ background: "linear-gradient(to bottom, #fff, transparent)",
256
+ pointerEvents: "none"
257
+ },
258
+ className: `${s}-linear-gradient-to-bottom`
259
+ }
260
+ ),
261
+ /* @__PURE__ */ l(
262
+ "div",
263
+ {
264
+ style: {
265
+ position: "absolute",
266
+ bottom: 0,
267
+ left: 0,
268
+ width: "100%",
269
+ height: d,
270
+ background: "linear-gradient(to top, #fff, transparent)",
271
+ pointerEvents: "none"
272
+ },
273
+ className: `${s}-linear-gradient-to-top`
274
+ }
275
+ )
276
+ ] }))
277
+ ]
278
+ }
279
+ );
280
+ };
281
+ export {
282
+ ae as default
283
+ };
package/menu/Item.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsxs as N, jsx as o, Fragment as D } from "react/jsx-runtime";
1
+ import { jsxs as N, jsx as r, Fragment as D } from "react/jsx-runtime";
2
2
  import F from "../dist/scroll-into-view-if-needed/src/index.js";
3
3
  import { forwardRef as O, useContext as j, useRef as B, useEffect as K } from "react";
4
4
  import U from "../components/common/hooks/useIsFirstRender.js";
@@ -12,8 +12,8 @@ import { PROPS_NEED_TO_BE_PASSED_IN_SUBMENU as q } from "./util.js";
12
12
  function G(b, c) {
13
13
  const {
14
14
  _key: a,
15
- children: s,
16
- level: i,
15
+ children: i,
16
+ level: s,
17
17
  disabled: l,
18
18
  className: x,
19
19
  style: E,
@@ -32,14 +32,15 @@ function G(b, c) {
32
32
  scrollConfig: S,
33
33
  tooltipProps: y,
34
34
  onClickMenuItem: w
35
- } = j(W), r = B(null), R = U(), I = p === "vertical" && i > 1, v = m && !M && i === 1, n = f && ~f.indexOf(a);
35
+ } = j(W), o = B(null), R = U(), I = p === "vertical" && s > 1, v = m && !M && s === 1, n = f && ~f.indexOf(a);
36
36
  K(() => {
37
37
  const e = n && u;
38
- r.current && e && setTimeout(
38
+ o.current && e && setTimeout(
39
39
  () => {
40
- r.current && F(r.current, {
40
+ o.current && F(o.current, {
41
41
  behavior: "smooth",
42
42
  block: "start",
43
+ inline: "start",
43
44
  scrollMode: "if-needed",
44
45
  boundary: document.body,
45
46
  ...S
@@ -47,7 +48,7 @@ function G(b, c) {
47
48
  },
48
49
  R ? 500 : 0
49
50
  );
50
- }, [n, u]);
51
+ }, [n, u, o.current]);
51
52
  const k = (e) => {
52
53
  l || (w?.(a, e), _?.(e));
53
54
  }, g = /* @__PURE__ */ N(
@@ -56,7 +57,7 @@ function G(b, c) {
56
57
  tabIndex: l ? -1 : 0,
57
58
  role: "menuitem",
58
59
  ref: (e) => {
59
- c = e, r.current = c;
60
+ c = e, o.current = c;
60
61
  },
61
62
  style: E,
62
63
  className: A(
@@ -79,35 +80,35 @@ function G(b, c) {
79
80
  ),
80
81
  children: [
81
82
  I && !m ? /* @__PURE__ */ N(D, { children: [
82
- /* @__PURE__ */ o(
83
+ /* @__PURE__ */ r(
83
84
  V,
84
85
  {
85
86
  prefixCls: t,
86
87
  levelIndent: P,
87
- level: i
88
+ level: s
88
89
  }
89
90
  ),
90
- /* @__PURE__ */ o(
91
+ /* @__PURE__ */ r(
91
92
  "span",
92
93
  {
93
94
  className: `${t}-item-inner`,
94
95
  style: {
95
96
  display: "block"
96
97
  },
97
- children: s
98
+ children: i
98
99
  }
99
100
  )
100
- ] }) : s,
101
- n && p === "horizontal" ? /* @__PURE__ */ o("div", { className: `${t}-selected-label` }) : null
101
+ ] }) : i,
102
+ n && p === "horizontal" ? /* @__PURE__ */ r("div", { className: `${t}-selected-label` }) : null
102
103
  ]
103
104
  }
104
105
  );
105
- return v ? /* @__PURE__ */ o(
106
+ return v ? /* @__PURE__ */ r(
106
107
  z,
107
108
  {
108
109
  trigger: "hover",
109
110
  position: "right",
110
- content: typeof d == "function" ? d() : /* @__PURE__ */ o("span", { children: s }),
111
+ content: typeof d == "function" ? d() : /* @__PURE__ */ r("span", { children: i }),
111
112
  triggerProps: {
112
113
  className: `${t}-item-tooltip`,
113
114
  ...y?.triggerProps || {}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.98","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/ui","version":"0.8.100","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
package/qr-code/index.js CHANGED
@@ -1,29 +1,35 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import Q from "lodash/merge";
3
- import { QRCodeCanvas as R, QRCodeSVG as h } from "qrcode.react";
4
- import { useContext as z } from "react";
2
+ import { QRCodeCanvas as b, QRCodeSVG as P } from "qrcode.react";
3
+ import { useContext as Q } from "react";
5
4
  import "../config-provider/ConfigProvider.js";
5
+ import "lodash/isEqualWith";
6
+ import "../components/common/utils/is.js";
7
+ import "@unicom-cloud/utils/constant/keyboardCode";
8
+ import "lodash/isNumber";
9
+ import "lodash/merge";
10
+ import "../components/common/utils/dom.js";
11
+ import "../components/common/hooks/useIntersectionObserver.js";
12
+ import R from "../components/common/hooks/useMergeProps.js";
13
+ import "../components/common/utils/reactDOM.js";
14
+ import "@unicom-cloud/utils/constant";
15
+ import "lodash/debounce";
6
16
  import "@unicom-cloud/utils/case-name";
7
- import N from "@unicom-cloud/utils/class-name";
17
+ import S from "@unicom-cloud/utils/class-name";
8
18
  import "../dist/tinycolor/chunk/BOzCVdr0.js";
9
19
  import "@unicom-cloud/utils/constant/ui";
10
20
  import "../utils/contextHolder.js";
11
21
  import "@unicom-cloud/utils/dayjs";
12
22
  import "@unicom-cloud/utils/clipboard-copy";
13
23
  import "../components/common/utils/dayjs.js";
14
- import "../components/common/utils/dom.js";
15
24
  import "@unicom-cloud/utils/file/fileToURL";
16
25
  import "lodash/escapeRegExp";
17
26
  import "lodash/isArray";
18
- import "lodash/isNumber";
19
27
  import "lodash/isString";
20
28
  import "lodash/isFunction";
21
29
  import "lodash/throttle";
22
- import "../components/common/utils/is.js";
23
30
  import "lodash/camelCase";
24
31
  import "lodash/capitalize";
25
32
  import "lodash/cloneDeep";
26
- import "lodash/debounce";
27
33
  import "lodash/get";
28
34
  import "lodash/has";
29
35
  import "lodash/kebabCase";
@@ -41,48 +47,60 @@ import "../dist/react-transition-group/src/ReplaceTransition.js";
41
47
  import "../dist/react-transition-group/src/SwitchTransition.js";
42
48
  import "../dist/react-transition-group/chunk/CPfP7aNL.js";
43
49
  import "../dist/react-transition-group/src/TransitionGroup.js";
44
- import "../components/common/utils/reactDOM.js";
45
50
  import "@unicom-cloud/utils/file/saveAs";
46
51
  import "@unicom-cloud/utils/screenfull";
47
52
  import "@unicom-cloud/utils/constant/ui.js";
53
+ import "react-is";
48
54
  import "@unicom-cloud/utils/tree";
49
55
  import "@unicom-cloud/utils/is";
50
56
  import "uuid";
51
57
  import "../dist/validate/src/index.js";
52
- import "@unicom-cloud/utils/constant/keyboardCode";
53
- import S from "../config-provider/context.js";
54
- const bo = (e) => {
55
- const { getPrefixCls: s, componentConfig: n } = z(S), {
56
- value: f,
57
- renderAs: t = "svg",
58
- size: o = 160,
59
- bordered: m = !0,
60
- errorLevel: a = "M",
61
- fgColor: c = "#000000",
62
- bgColor: d = "#ffffff",
63
- marginSize: l = 0,
64
- imageSettings: C,
65
- className: g,
58
+ import h from "../config-provider/context.js";
59
+ const q = {
60
+ renderAs: "svg",
61
+ size: 160,
62
+ bordered: !0,
63
+ errorLevel: "M",
64
+ fgColor: "#000000",
65
+ bgColor: "#ffffff",
66
+ marginSize: 0,
67
+ value: "qr-code"
68
+ }, $o = (e) => {
69
+ const { getPrefixCls: s, componentConfig: n } = Q(h), d = R(
70
+ e,
71
+ q,
72
+ n?.QRCode
73
+ ), {
74
+ value: l,
75
+ renderAs: t,
76
+ size: o,
77
+ bordered: i,
78
+ errorLevel: a,
79
+ fgColor: c,
80
+ bgColor: f,
81
+ marginSize: C = 0,
82
+ imageSettings: g,
83
+ className: u,
66
84
  style: v
67
- } = Q({}, n?.QRCode, e), i = s?.("qrcode"), u = o - (m ? 12 : 0), x = () => {
85
+ } = d, m = s?.("qrcode"), x = o - (i ? 12 : 0), z = () => {
68
86
  const p = {
69
- value: f,
70
- size: u,
87
+ value: l,
88
+ size: x,
71
89
  level: a,
72
90
  fgColor: c,
73
- bgColor: d,
74
- marginSize: l,
75
- imageSettings: C
91
+ bgColor: f,
92
+ marginSize: C,
93
+ imageSettings: g
76
94
  };
77
- return t === "canvas" ? /* @__PURE__ */ r(R, { ...p }) : /* @__PURE__ */ r(h, { ...p });
95
+ return t === "canvas" ? /* @__PURE__ */ r(b, { ...p }) : /* @__PURE__ */ r(P, { ...p });
78
96
  };
79
97
  return /* @__PURE__ */ r(
80
98
  "div",
81
99
  {
82
- className: N(
83
- i,
84
- m && `${i}-bordered`,
85
- g,
100
+ className: S(
101
+ m,
102
+ i && `${m}-bordered`,
103
+ u,
86
104
  `qrcode-${t}`
87
105
  ),
88
106
  style: {
@@ -90,10 +108,10 @@ const bo = (e) => {
90
108
  height: o,
91
109
  ...v
92
110
  },
93
- children: x()
111
+ children: z()
94
112
  }
95
113
  );
96
114
  };
97
115
  export {
98
- bo as default
116
+ $o as default
99
117
  };
package/rate/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as Y } from "react/jsx-runtime";
2
2
  import Z from "@unicom-cloud/icons/IconUiFaceFrownFill";
3
- import A from "@unicom-cloud/icons/IconUiFaceMehFill";
3
+ import R from "@unicom-cloud/icons/IconUiFaceMehFill";
4
4
  import x from "@unicom-cloud/icons/IconUiFaceSmileFill";
5
5
  import ee from "@unicom-cloud/icons/IconUiStarFill";
6
6
  import { times as oe, div as te } from "@unicom-cloud/utils/math";
@@ -49,30 +49,30 @@ function ie(H, U) {
49
49
  }, w = (e, s) => {
50
50
  const o = s && a ? e + 0.5 : e + 1;
51
51
  o !== f && (P(o), F?.(o));
52
- }, R = (e, s) => {
52
+ }, V = (e, s) => {
53
53
  const o = s && a ? e + 0.5 : e + 1;
54
54
  M(!0), o !== c ? (I(o), y?.(o)) : T && (I(0), y?.(0), b());
55
55
  }, G = (e) => {
56
56
  const s = a ? oe(+te(c || 0, 0.5).toFixed(0), 0.5) : Math.round(c), o = f || s;
57
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, {})));
58
+ N && (o <= 2 ? n = /* @__PURE__ */ r(Z, {}) : o <= 3 ? n = /* @__PURE__ */ r(R, {}) : n = /* @__PURE__ */ r(x, {}), o <= e && (n = /* @__PURE__ */ r(R, {})));
59
59
  const J = k(`${t}-character`, {
60
60
  [`${t}-character-half`]: a && e + 0.5 === o,
61
61
  [`${t}-character-full`]: e + 1 <= o,
62
62
  [`${t}-character-scale`]: p && e + 1 < c
63
63
  }), K = i || m ? {} : {
64
64
  onMouseEnter: w.bind(this, e, !0),
65
- onClick: R.bind(this, e, !0)
65
+ onClick: V.bind(this, e, !0)
66
66
  }, O = i || m ? {} : {
67
67
  onMouseEnter: w.bind(this, e, !1),
68
- onClick: R.bind(this, e, !1)
68
+ onClick: V.bind(this, e, !1)
69
69
  }, u = $ && $[e], Q = u ? se : E.Fragment, X = u ? { content: u } : {};
70
- function h(V) {
70
+ function h(A) {
71
71
  return {
72
72
  role: "radio",
73
- "aria-checked": e + (V ? 0.5 : 1) <= o,
73
+ "aria-checked": e + (A ? 0.5 : 1) <= o,
74
74
  "aria-setsize": v,
75
- "aria-posinset": e + (V ? 0.5 : 1)
75
+ "aria-posinset": e + (A ? 0.5 : 1)
76
76
  };
77
77
  }
78
78
  return /* @__PURE__ */ r(Q, { ...X, children: /* @__PURE__ */ Y(