@unicom-cloud/ui 0.8.102 → 0.8.104

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 (48) hide show
  1. package/Copy.js +1 -1
  2. package/LiquidFill.js +1 -1
  3. package/Marquee.js +2 -2
  4. package/QrCode.js +1 -1
  5. package/Spin.js +6 -3
  6. package/Tour.js +1 -1
  7. package/badge/Count.js +12 -12
  8. package/badge/index.js +35 -35
  9. package/components/common/space/index.js +24 -24
  10. package/copy/index.js +1 -1
  11. package/divider/index.js +45 -31
  12. package/grid/Col.js +32 -32
  13. package/grid/Row.js +53 -44
  14. package/liquid-fill/index.js +1 -1
  15. package/liquid-fill/interface.js +1 -0
  16. package/marquee/index.js +143 -221
  17. package/marquee/interface.js +1 -0
  18. package/marquee-/index.js +260 -0
  19. package/marquee-/interface.js +1 -0
  20. package/package.json +1 -1
  21. package/qr-code/index.js +1 -1
  22. package/spin/DotLoading.js +3 -3
  23. package/spin/index.js +70 -57
  24. package/style.css +1 -1
  25. package/table/hook/useThResizable.js +1 -1
  26. package/table/th-resizable/index.js +1 -1
  27. package/tour/index.js +1 -1
  28. package/tour/interface.js +1 -0
  29. package/types/pc/config-provider/interface.d.ts +8 -8
  30. package/types/pc/divider/interface.d.ts +9 -1
  31. package/types/pc/grid/Row.d.ts +2 -1
  32. package/types/pc/index.d.ts +4 -4
  33. package/types/pc/liquid-fill/index.d.ts +2 -113
  34. package/types/pc/liquid-fill/interface.d.ts +113 -0
  35. package/types/pc/marquee/index.d.ts +3 -60
  36. package/types/pc/marquee/interface.d.ts +95 -0
  37. package/types/pc/marquee-/index.d.ts +8 -0
  38. package/types/pc/marquee-/interface.d.ts +56 -0
  39. package/types/pc/qr-code/index.d.ts +1 -31
  40. package/types/pc/qr-code/interface.d.ts +26 -33
  41. package/types/pc/spin/interface.d.ts +2 -3
  42. package/types/pc/tour/index.d.ts +2 -45
  43. package/types/pc/tour/interface.d.ts +46 -0
  44. package/types/pc/utils/responsiveObserve.d.ts +8 -4
  45. package/typography/Ellipsis.js +1 -1
  46. package/typography/Operations.js +1 -1
  47. package/utils/responsiveObserve.js +32 -25
  48. package/version/index.js +1 -1
package/marquee/index.js CHANGED
@@ -1,20 +1,20 @@
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";
1
+ import { jsx as s, Fragment as rt, jsxs as H } from "react/jsx-runtime";
2
+ import { forwardRef as it, useContext as ot, useState as C, useRef as j, useCallback as A, useEffect as O, useMemo as h, Fragment as nt, Children as B } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
4
  import "lodash/isEqualWith";
5
5
  import "../components/common/utils/is.js";
6
6
  import "@unicom-cloud/utils/constant/keyboardCode";
7
7
  import "lodash/isNumber";
8
- import "lodash/merge";
8
+ import at from "lodash/merge";
9
9
  import "../components/common/utils/dom.js";
10
10
  import "../components/common/hooks/useIntersectionObserver.js";
11
- import V from "../components/common/hooks/useMergeProps.js";
11
+ import st from "../components/common/hooks/useMergeProps.js";
12
12
  import "../components/common/utils/reactDOM.js";
13
13
  import "@unicom-cloud/utils/constant";
14
14
  import "lodash/debounce";
15
15
  import "@unicom-cloud/utils/date";
16
16
  import "@unicom-cloud/utils/case-name";
17
- import Z from "@unicom-cloud/utils/class-name";
17
+ import lt from "@unicom-cloud/utils/class-name";
18
18
  import "@unicom-cloud/utils/constant/ui";
19
19
  import "../utils/contextHolder.js";
20
20
  import "@unicom-cloud/utils/clipboard-copy";
@@ -45,7 +45,8 @@ import "../dist/react-transition-group/src/ReplaceTransition.js";
45
45
  import "../dist/react-transition-group/src/SwitchTransition.js";
46
46
  import "../dist/react-transition-group/chunk/CPfP7aNL.js";
47
47
  import "../dist/react-transition-group/src/TransitionGroup.js";
48
- import { resizeObserver as _ } from "../components/common/utils/resizeObserver.js";
48
+ import { resizeObserver as mt } from "../components/common/utils/resizeObserver.js";
49
+ import "uuid";
49
50
  import "@unicom-cloud/utils/file/saveAs";
50
51
  import "@unicom-cloud/utils/screenfull";
51
52
  import "@unicom-cloud/utils/tinycolor";
@@ -53,232 +54,153 @@ import "@unicom-cloud/utils/ui-color";
53
54
  import "@unicom-cloud/utils/constant/ui.js";
54
55
  import "react-is";
55
56
  import "@unicom-cloud/utils/tree";
56
- import "@unicom-cloud/utils/is";
57
- import "uuid";
57
+ import { isPlainObject as pt } from "@unicom-cloud/utils/is";
58
58
  import "../dist/validate/src/index.js";
59
- import tt from "../config-provider/context.js";
60
- const et = {
59
+ import ct from "../config-provider/context.js";
60
+ const o = {
61
+ autoFill: !1,
62
+ play: !0,
61
63
  speed: 50,
62
- // 默认50像素/秒(数值越大越快)
63
64
  direction: "left",
64
65
  pauseOnHover: !1,
65
- gradient: !0,
66
- loop: 0,
67
- // 0表示无限循环
68
- gradientSize: 50
69
- }, ce = (q) => {
70
- const { getPrefixCls: O, componentConfig: P } = U(tt), s = O?.("marquee"), R = V(
71
- q,
72
- et,
73
- P?.Marquee
74
- );
75
- let {
76
- children: $,
77
- style: L,
78
- className: D,
79
- speed: E,
80
- // 默认50像素/秒(数值越大越快)
81
- direction: c,
82
- pauseOnHover: H,
83
- gradient: W,
84
- loop: a,
85
- // 0表示无限循环
86
- gradientSize: d,
87
- onComplete: b
88
- } = R;
89
- 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";
90
- d = o ? 50 : 20;
91
- const z = () => {
92
- if (w.current && h.current) {
93
- const r = w.current.scrollWidth, t = w.current.scrollHeight, i = h.current.offsetWidth, e = h.current.offsetHeight;
94
- j({ width: r, height: t }), B({ width: i, height: e });
95
- const f = o ? r > i : t > e;
96
- if (I(f), f) {
97
- const v = c === "right" ? -r : c === "down" ? -t : 0;
98
- p(v);
66
+ pauseOnClick: !1,
67
+ delay: 0.0227,
68
+ // 设置非 0 为了解决 onAnimationEnd={onFinish} 立即被调用的问题
69
+ loop: 0
70
+ }, ye = it(
71
+ function(E, I) {
72
+ const { getPrefixCls: z, componentConfig: V } = ot(ct), i = z?.("marquee"), t = z?.("marquee-var"), _ = st(
73
+ E,
74
+ o,
75
+ V?.Marquee
76
+ ), {
77
+ style: F,
78
+ className: D,
79
+ autoFill: l = o.autoFill,
80
+ play: c = o.play,
81
+ pauseOnHover: v = o.pauseOnHover,
82
+ pauseOnClick: M = o.pauseOnClick,
83
+ direction: e = o.direction,
84
+ speed: q = o.speed,
85
+ delay: W = o.delay,
86
+ loop: x = o.loop,
87
+ gradient: G,
88
+ onFinish: J,
89
+ onCycleComplete: K,
90
+ onMount: w,
91
+ children: g
92
+ } = _, L = e === "left" || e === "right";
93
+ let r = G;
94
+ r === !0 && (r = {}), pt(r) && (r = at(
95
+ { size: L ? 50 : 20, color: "#fff" },
96
+ r
97
+ ));
98
+ const [k, Q] = C(0), [$, T] = C(0), [y, U] = C(1), [N, X] = C(!1), Y = j(null), m = I || Y, u = j(null), d = A(() => {
99
+ if (u.current && m.current) {
100
+ const n = m.current.getBoundingClientRect(), f = u.current.getBoundingClientRect();
101
+ let a = n.width, p = f.width;
102
+ (e === "up" || e === "down") && (a = n.height, p = f.height), U(
103
+ l && a && p ? Math.max(2, Math.ceil(a / p)) : 1
104
+ ), Q(a), T(p);
99
105
  }
100
- }
101
- };
102
- N(() => {
103
- const r = _(
104
- [h.current],
105
- z
106
+ }, [l, m, e]);
107
+ O(() => {
108
+ if (!N) return;
109
+ d();
110
+ const n = mt(
111
+ [m.current, u.current],
112
+ d
113
+ );
114
+ return () => {
115
+ n();
116
+ };
117
+ }, [d, m, u, N]), O(() => (d(), () => {
118
+ }), [d, g]), O(() => (X(!0), w && w(), () => {
119
+ }), [w]);
120
+ const P = h(() => $ ? l ? $ * y / q : Math.max(k, $) / q : 0, [l, k, $, y, q]), Z = h(
121
+ () => ({
122
+ ...F,
123
+ [`--${t}-pause-on-hover`]: !c || v ? "paused" : "running",
124
+ [`--${t}-pause-on-click`]: !c || v && !M || M ? "paused" : "running",
125
+ [`--${t}-width`]: e === "up" || e === "down" ? "100vh" : "100%",
126
+ [`--${t}-transform`]: e === "up" ? "rotate(-90deg)" : e === "down" ? "rotate(90deg)" : "none"
127
+ }),
128
+ [F, t, c, v, M, e]
129
+ ), tt = h(
130
+ () => ({
131
+ [`--${t}-gradient-color`]: r?.color,
132
+ [`--${t}-gradient-width`]: typeof r?.size == "number" ? `${r?.size}px` : r?.size
133
+ }),
134
+ [r?.color, r?.size, t]
135
+ ), S = h(
136
+ () => ({
137
+ [`--${t}-play`]: c ? "running" : "paused",
138
+ [`--${t}-direction`]: e === "left" ? "normal" : "reverse",
139
+ [`--${t}-duration`]: `${P}s`,
140
+ [`--${t}-delay`]: `${W}s`,
141
+ [`--${t}-iteration-count`]: x ? `${x}` : "infinite",
142
+ [`--${t}-min-width`]: l ? "auto" : "100%"
143
+ }),
144
+ [t, c, e, P, W, x, l]
145
+ ), R = h(
146
+ () => ({
147
+ [`--${t}-transform`]: e === "up" ? "rotate(90deg)" : e === "down" ? "rotate(-90deg)" : "none"
148
+ }),
149
+ [e, t]
150
+ ), b = A(
151
+ (n) => Array.from({ length: n }).map((f, a) => /* @__PURE__ */ s(nt, { children: B.map(g, (p, et) => /* @__PURE__ */ s(
152
+ "div",
153
+ {
154
+ style: R,
155
+ className: `${i}-child`,
156
+ children: p
157
+ },
158
+ `child-${a}-${et}`
159
+ )) }, a)),
160
+ [g, R, i]
106
161
  );
107
- return () => r();
108
- }, []), N(() => {
109
- z(), g(0);
110
- }, [$]), N(() => {
111
- if (!M || !y)
112
- return;
113
- let r = null, t = x;
114
- const i = o ? F.width : F.height;
115
- let e = X;
116
- const f = (v) => {
117
- if (!r) {
118
- r = v, n.current = requestAnimationFrame(f);
119
- return;
120
- }
121
- const Q = (v - r) / 1e3;
122
- r = v;
123
- const C = E * Q;
124
- switch (c) {
125
- case "left":
126
- if (t -= C, t <= -i && (t += i, e += 1, g(e), a > 0 && e >= a)) {
127
- cancelAnimationFrame(n.current), m(!1), p(0), b?.();
128
- return;
129
- }
130
- break;
131
- case "right":
132
- if (t += C, t >= 0 && (t -= i, e += 1, g(e), a > 0 && e >= a)) {
133
- cancelAnimationFrame(n.current), m(!1), p(-i), b?.();
134
- return;
135
- }
136
- break;
137
- case "up":
138
- if (t -= C, t <= -i && (t += i, e += 1, g(e), a > 0 && e >= a)) {
139
- cancelAnimationFrame(n.current), m(!1), p(0), b?.();
140
- return;
141
- }
142
- break;
143
- case "down":
144
- if (t += C, t >= 0 && (t -= i, e += 1, g(e), a > 0 && e >= a)) {
145
- cancelAnimationFrame(n.current), m(!1), p(-i), b?.();
146
- return;
147
- }
148
- break;
149
- }
150
- p(t), n.current = requestAnimationFrame(f);
151
- };
152
- return n.current = requestAnimationFrame(f), () => {
153
- n.current && cancelAnimationFrame(n.current);
154
- };
155
- }, [M, E, c, F, y, a]), N(() => (z(), () => {
156
- n.current && cancelAnimationFrame(n.current);
157
- }), []);
158
- const Y = () => {
159
- H && m(!1);
160
- }, G = () => {
161
- H && m(!0);
162
- }, J = () => o ? `translateX(${x}px)` : `translateY(${x}px)`, K = () => {
163
- const r = {
164
- display: o ? "inline-block" : "block",
165
- whiteSpace: o ? "nowrap" : "normal",
166
- // 消除元素间默认间距
167
- marginRight: o ? 0 : void 0,
168
- marginBottom: o ? void 0 : 0
169
- }, t = /* @__PURE__ */ l(
162
+ return N ? /* @__PURE__ */ s(rt, { children: /* @__PURE__ */ H(
170
163
  "div",
171
164
  {
172
- ref: w,
173
- style: r,
174
- className: `${s}-children`,
175
- children: $
176
- }
177
- );
178
- return y ? /* @__PURE__ */ S(A, { children: [
179
- t,
180
- /* @__PURE__ */ l("div", { style: r, className: `${s}-children`, children: $ })
181
- ] }) : t;
182
- };
183
- return /* @__PURE__ */ S(
184
- "div",
185
- {
186
- ref: h,
187
- className: Z(
188
- s,
189
- `${s}-${c}`,
190
- D
191
- ),
192
- style: {
193
- overflow: "hidden",
194
- position: "relative",
195
- ...L
196
- },
197
- onMouseEnter: Y,
198
- onMouseLeave: G,
199
- children: [
200
- /* @__PURE__ */ l(
201
- "div",
202
- {
203
- ref: T,
204
- style: {
205
- display: o ? "inline-block" : "block",
206
- whiteSpace: "nowrap",
207
- willChange: "transform",
208
- // 启用GPU加速
209
- transform: J()
210
- },
211
- className: `${s}-content`,
212
- children: K()
213
- }
214
- ),
215
- W && y && (o ? /* @__PURE__ */ S(A, { children: [
216
- /* @__PURE__ */ l(
217
- "div",
218
- {
219
- style: {
220
- position: "absolute",
221
- top: 0,
222
- left: 0,
223
- width: d,
224
- height: "100%",
225
- background: "linear-gradient(to right, #fff, transparent)",
226
- pointerEvents: "none"
227
- },
228
- className: `${s}-linear-gradient-to-right`
229
- }
230
- ),
231
- /* @__PURE__ */ l(
165
+ ref: m,
166
+ style: Z,
167
+ className: lt(i, `${i}-${e}`, D),
168
+ children: [
169
+ !!r && /* @__PURE__ */ s("div", { style: tt, className: `${i}-overlay` }),
170
+ /* @__PURE__ */ H(
232
171
  "div",
233
172
  {
234
- style: {
235
- position: "absolute",
236
- top: 0,
237
- right: 0,
238
- width: d,
239
- height: "100%",
240
- background: "linear-gradient(to left, #fff, transparent)",
241
- pointerEvents: "none"
242
- },
243
- className: `${s}-linear-gradient-to-left`
244
- }
245
- )
246
- ] }) : /* @__PURE__ */ S(A, { children: [
247
- /* @__PURE__ */ l(
248
- "div",
249
- {
250
- style: {
251
- position: "absolute",
252
- top: 0,
253
- left: 0,
254
- width: "100%",
255
- height: d,
256
- background: "linear-gradient(to bottom, #fff, transparent)",
257
- pointerEvents: "none"
258
- },
259
- className: `${s}-linear-gradient-to-bottom`
173
+ style: S,
174
+ className: `${i}-item`,
175
+ onAnimationIteration: K,
176
+ onAnimationEnd: J,
177
+ children: [
178
+ /* @__PURE__ */ s(
179
+ "div",
180
+ {
181
+ ref: u,
182
+ className: `${i}-initial-child-container`,
183
+ children: B.map(g, (n, f) => /* @__PURE__ */ s(
184
+ "div",
185
+ {
186
+ style: R,
187
+ className: `${i}-child`,
188
+ children: n
189
+ },
190
+ `original-${f}`
191
+ ))
192
+ }
193
+ ),
194
+ b(y - 1)
195
+ ]
260
196
  }
261
197
  ),
262
- /* @__PURE__ */ l(
263
- "div",
264
- {
265
- style: {
266
- position: "absolute",
267
- bottom: 0,
268
- left: 0,
269
- width: "100%",
270
- height: d,
271
- background: "linear-gradient(to top, #fff, transparent)",
272
- pointerEvents: "none"
273
- },
274
- className: `${s}-linear-gradient-to-top`
275
- }
276
- )
277
- ] }))
278
- ]
279
- }
280
- );
281
- };
198
+ /* @__PURE__ */ s("div", { style: S, className: `${i}-item`, children: b(y) })
199
+ ]
200
+ }
201
+ ) }) : null;
202
+ }
203
+ );
282
204
  export {
283
- ce as default
205
+ ye as default
284
206
  };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,260 @@
1
+ import { jsxs as z, jsx as m, Fragment as x } from "react/jsx-runtime";
2
+ import { useContext as V, useRef as C, useState as d, useEffect as F } 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 Z from "lodash/merge";
9
+ import "../components/common/utils/dom.js";
10
+ import "../components/common/hooks/useIntersectionObserver.js";
11
+ import _ 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/date";
16
+ import "@unicom-cloud/utils/case-name";
17
+ import tt from "@unicom-cloud/utils/class-name";
18
+ import "@unicom-cloud/utils/constant/ui";
19
+ import "../utils/contextHolder.js";
20
+ import "@unicom-cloud/utils/clipboard-copy";
21
+ import "../components/common/utils/dayjs.js";
22
+ import "@unicom-cloud/utils/file/fileToURL";
23
+ import "lodash/escapeRegExp";
24
+ import "lodash/isArray";
25
+ import "lodash/isString";
26
+ import "lodash/isFunction";
27
+ import "lodash/throttle";
28
+ import "lodash/camelCase";
29
+ import "lodash/capitalize";
30
+ import "lodash/cloneDeep";
31
+ import "lodash/get";
32
+ import "lodash/has";
33
+ import "lodash/kebabCase";
34
+ import "lodash/mergeWith";
35
+ import "lodash/set";
36
+ import "lodash/setWith";
37
+ import "lodash/snakeCase";
38
+ import "lodash/startCase";
39
+ import "lodash/uniq";
40
+ import "lodash/upperFirst";
41
+ import "@unicom-cloud/utils/math";
42
+ import "lodash/isPlainObject";
43
+ import "../dist/react-transition-group/src/CSSTransition.js";
44
+ import "../dist/react-transition-group/src/ReplaceTransition.js";
45
+ import "../dist/react-transition-group/src/SwitchTransition.js";
46
+ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
47
+ import "../dist/react-transition-group/src/TransitionGroup.js";
48
+ import { resizeObserver as et } from "../components/common/utils/resizeObserver.js";
49
+ import "uuid";
50
+ import "@unicom-cloud/utils/file/saveAs";
51
+ import "@unicom-cloud/utils/screenfull";
52
+ import "@unicom-cloud/utils/tinycolor";
53
+ import "@unicom-cloud/utils/ui-color";
54
+ import "@unicom-cloud/utils/constant/ui.js";
55
+ import "react-is";
56
+ import "@unicom-cloud/utils/tree";
57
+ import { isPlainObject as q } from "@unicom-cloud/utils/is";
58
+ import "../dist/validate/src/index.js";
59
+ import rt from "../config-provider/context.js";
60
+ const ot = {
61
+ speed: 50,
62
+ direction: "left",
63
+ pauseOnHover: !1,
64
+ loop: 0
65
+ }, me = (R) => {
66
+ const { getPrefixCls: L, componentConfig: D } = V(rt), s = L?.("marquee"), E = _(
67
+ R,
68
+ ot,
69
+ D?.Marquee
70
+ ), {
71
+ children: N,
72
+ style: W,
73
+ className: j,
74
+ speed: A = 50,
75
+ direction: l = "left",
76
+ pauseOnHover: P = !1,
77
+ loop: a = 0,
78
+ gradient: T = { color: "#fff" },
79
+ onComplete: h
80
+ } = E, g = C(null), B = C(null), $ = C(null), c = C(), [S, I] = d({ width: 0, height: 0 }), [it, X] = d({ width: 0, height: 0 }), [y, Y] = d(!1), [H, p] = d(!0), [k, f] = d(0), [M, b] = d(0), i = l === "left" || l === "right";
81
+ let o = T;
82
+ q(o) && (o = Z(
83
+ { size: i ? 50 : 20, color: "#fff" },
84
+ o
85
+ ));
86
+ const O = () => {
87
+ if ($.current && g.current) {
88
+ const r = $.current.scrollWidth, t = $.current.scrollHeight, n = g.current.offsetWidth, e = g.current.offsetHeight;
89
+ I({ width: r, height: t }), X({ width: n, height: e });
90
+ const u = i ? r > n : t > e;
91
+ if (Y(u), u) {
92
+ const v = l === "right" ? -r : l === "down" ? -t : 0;
93
+ f(v);
94
+ }
95
+ }
96
+ };
97
+ F(() => {
98
+ const r = g.current;
99
+ if (!r)
100
+ return;
101
+ const t = et([r], O);
102
+ return () => t();
103
+ }, []), F(() => {
104
+ O(), b(0);
105
+ }, [N]), F(() => {
106
+ if (!H || !y)
107
+ return;
108
+ let r = null, t = k;
109
+ const n = i ? S.width : S.height;
110
+ let e = M;
111
+ const u = (v) => {
112
+ if (!r) {
113
+ r = v, c.current = requestAnimationFrame(u);
114
+ return;
115
+ }
116
+ const U = (v - r) / 1e3;
117
+ r = v;
118
+ const w = A * U;
119
+ switch (l) {
120
+ case "left":
121
+ if (t -= w, t <= -n && (t += n, e += 1, b(e), a > 0 && e >= a)) {
122
+ cancelAnimationFrame(c.current), p(!1), f(0), h?.();
123
+ return;
124
+ }
125
+ break;
126
+ case "right":
127
+ if (t += w, t >= 0 && (t -= n, e += 1, b(e), a > 0 && e >= a)) {
128
+ cancelAnimationFrame(c.current), p(!1), f(-n), h?.();
129
+ return;
130
+ }
131
+ break;
132
+ case "up":
133
+ if (t -= w, t <= -n && (t += n, e += 1, b(e), a > 0 && e >= a)) {
134
+ cancelAnimationFrame(c.current), p(!1), f(0), h?.();
135
+ return;
136
+ }
137
+ break;
138
+ case "down":
139
+ if (t += w, t >= 0 && (t -= n, e += 1, b(e), a > 0 && e >= a)) {
140
+ cancelAnimationFrame(c.current), p(!1), f(-n), h?.();
141
+ return;
142
+ }
143
+ break;
144
+ }
145
+ f(t), c.current = requestAnimationFrame(u);
146
+ };
147
+ return c.current = requestAnimationFrame(u), () => {
148
+ c.current && cancelAnimationFrame(c.current);
149
+ };
150
+ }, [
151
+ H,
152
+ A,
153
+ l,
154
+ S,
155
+ y,
156
+ a,
157
+ M,
158
+ k,
159
+ i,
160
+ h
161
+ ]);
162
+ const G = () => {
163
+ P && p(!1);
164
+ }, J = () => {
165
+ P && p(!0);
166
+ }, K = () => i ? `translateX(${k}px)` : `translateY(${k}px)`, Q = () => {
167
+ const r = {
168
+ display: i ? "inline-block" : "block",
169
+ whiteSpace: i ? "nowrap" : "normal",
170
+ marginRight: i ? 0 : void 0,
171
+ marginBottom: i ? void 0 : 0
172
+ }, t = /* @__PURE__ */ m(
173
+ "div",
174
+ {
175
+ ref: $,
176
+ style: r,
177
+ className: `${s}-children`,
178
+ children: N
179
+ }
180
+ );
181
+ return y ? /* @__PURE__ */ z(x, { children: [
182
+ t,
183
+ /* @__PURE__ */ m("div", { style: r, className: `${s}-children`, children: N })
184
+ ] }) : t;
185
+ };
186
+ return /* @__PURE__ */ z(
187
+ "div",
188
+ {
189
+ ref: g,
190
+ style: W,
191
+ className: tt(
192
+ s,
193
+ `${s}-${l}`,
194
+ j
195
+ ),
196
+ onMouseEnter: G,
197
+ onMouseLeave: J,
198
+ children: [
199
+ /* @__PURE__ */ m(
200
+ "div",
201
+ {
202
+ ref: B,
203
+ style: {
204
+ display: i ? "inline-block" : "block",
205
+ transform: K()
206
+ },
207
+ className: `${s}-content`,
208
+ children: Q()
209
+ }
210
+ ),
211
+ q(o) && y && (i ? /* @__PURE__ */ z(x, { children: [
212
+ /* @__PURE__ */ m(
213
+ "div",
214
+ {
215
+ style: {
216
+ width: o.size,
217
+ background: `linear-gradient(to right, ${o.color}, transparent)`
218
+ },
219
+ className: `${s}-linear-gradient-to-right`
220
+ }
221
+ ),
222
+ /* @__PURE__ */ m(
223
+ "div",
224
+ {
225
+ style: {
226
+ width: o.size,
227
+ background: `linear-gradient(to left, ${o.color}, transparent)`
228
+ },
229
+ className: `${s}-linear-gradient-to-left`
230
+ }
231
+ )
232
+ ] }) : /* @__PURE__ */ z(x, { children: [
233
+ /* @__PURE__ */ m(
234
+ "div",
235
+ {
236
+ style: {
237
+ height: o.size,
238
+ background: `linear-gradient(to top, ${o.color}, transparent)`
239
+ },
240
+ className: `${s}-linear-gradient-to-bottom`
241
+ }
242
+ ),
243
+ /* @__PURE__ */ m(
244
+ "div",
245
+ {
246
+ style: {
247
+ height: o.size,
248
+ background: `linear-gradient(to bottom, ${o.color}, transparent)`
249
+ },
250
+ className: `${s}-linear-gradient-to-top`
251
+ }
252
+ )
253
+ ] }))
254
+ ]
255
+ }
256
+ );
257
+ };
258
+ export {
259
+ me as default
260
+ };
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.102","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.104","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"react":"^18.3.1","react-dom":"^18.3.1","dayjs":"^1.11.10","lodash":"^4.17.21","uuid":"^11.1.0","qrcode.react":"^4.2.0"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}