@unicom-cloud/ui 0.8.101 → 0.8.103
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.
- package/Badge.js +7 -54
- package/Copy.js +6 -5
- package/LiquidFill.js +6 -5
- package/List.js +1 -1
- package/Marquee.js +6 -5
- package/QrCode.js +6 -5
- package/Tooltip.js +3 -4
- package/Tour.js +6 -5
- package/anchor/Anchor.js +12 -12
- package/anchor/util.js +10 -10
- package/back-top/index.js +7 -7
- package/badge/index.js +109 -162
- package/card/index.js +63 -43
- package/color-picker/InputHex.js +3 -4
- package/color-picker/InputRgb.js +7 -8
- package/color-picker/Palette.js +3 -4
- package/color-picker/Panel.js +3 -4
- package/color-picker/colors.js +5 -5
- package/color-picker/hooks/useColorPicker.js +3 -4
- package/color-picker/utils.js +14 -15
- package/components/common/space/index.js +24 -24
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/constant.js +6 -3
- package/components/common/utils/reactDOM.js +6 -4
- package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
- package/components/common/utils/setPrimaryColor.js +18 -18
- package/components/common/utils/setTheme.js +8 -9
- package/copy/index.js +4 -3
- package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
- package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
- package/dist/scroll-into-view-if-needed/src/index.js +19 -19
- package/form/FormItem.js +69 -65
- package/form/context.js +6 -7
- package/grid/Col-.js +86 -0
- package/grid/Col.js +156 -73
- package/grid/Grid.js +71 -67
- package/grid/Row.js +53 -44
- package/grid/index.js +13 -13
- package/index.js +639 -662
- package/input/Textarea.js +1 -1
- package/input/autoSizeTextAreaHeight.js +7 -7
- package/liquid-fill/index.js +6 -5
- package/liquid-fill/interface.js +1 -0
- package/list/index.js +1 -1
- package/marquee/index.js +141 -223
- package/marquee/interface.js +1 -0
- package/marquee-/index.js +260 -0
- package/marquee-/interface.js +1 -0
- package/menu/Item.js +9 -9
- package/package.json +1 -1
- package/qr-code/index.js +6 -5
- package/splitter/SplitBar.js +81 -79
- package/splitter/Splitter.js +70 -78
- package/splitter/hooks/useResizable.js +9 -18
- package/splitter/hooks/useResize.js +10 -10
- package/splitter/hooks/useSizes.js +28 -28
- package/statistic/index.js +10 -10
- package/style.css +1 -1
- package/table/Table.js +369 -370
- package/table/hook/useThResizable.js +6 -5
- package/table/th-resizable/index.js +13 -12
- package/time-picker/util.js +8 -8
- package/tooltip/index.js +1 -2
- package/tour/index.js +6 -5
- package/tour/interface.js +1 -0
- package/tree/NodeList.js +1 -1
- package/types/common/utils/constant.d.ts +1 -0
- package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
- package/types/common/utils/tree.d.ts +1 -0
- package/types/common/utils/tween.d.ts +1 -0
- package/types/pc/anchor/util.d.ts +1 -1
- package/types/pc/badge/interface.d.ts +2 -0
- package/types/pc/card/interface.d.ts +8 -0
- package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
- package/types/pc/color-picker/utils.d.ts +6 -1
- package/types/pc/config-provider/interface.d.ts +8 -8
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/grid/Col-.d.ts +4 -0
- package/types/pc/grid/Col.d.ts +3 -2
- package/types/pc/grid/Grid.d.ts +2 -2
- package/types/pc/grid/Item.d.ts +3 -3
- package/types/pc/grid/Row.d.ts +3 -2
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +13 -7
- package/types/pc/index.d.ts +4 -4
- package/types/pc/liquid-fill/index.d.ts +2 -113
- package/types/pc/liquid-fill/interface.d.ts +113 -0
- package/types/pc/marquee/index.d.ts +3 -60
- package/types/pc/marquee/interface.d.ts +95 -0
- package/types/pc/marquee-/index.d.ts +8 -0
- package/types/pc/marquee-/interface.d.ts +56 -0
- package/types/pc/qr-code/index.d.ts +1 -31
- package/types/pc/qr-code/interface.d.ts +26 -33
- package/types/pc/splitter/SplitBar.d.ts +0 -1
- package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
- package/types/pc/splitter/hooks/useResize.d.ts +1 -2
- package/types/pc/splitter/interface.d.ts +0 -8
- package/types/pc/tour/index.d.ts +2 -45
- package/types/pc/tour/interface.d.ts +46 -0
- package/types/pc/upload/interface.d.ts +1 -0
- package/types/pc/utils/constant.d.ts +1 -2
- package/types/pc/utils/dayjs.d.ts +2 -1
- package/types/pc/utils/index.d.ts +2 -5
- package/types/pc/utils/responsiveObserve.d.ts +8 -4
- package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
- package/types/pc/utils/tree.d.ts +2 -1
- package/types/pc/utils/tween.d.ts +1 -1
- package/typography/Ellipsis.js +6 -5
- package/typography/Operations.js +6 -5
- package/upload/request.js +12 -13
- package/upload/request_.js +2 -3
- package/utils/constant.js +5 -5
- package/utils/dayjs.js +13 -12
- package/utils/index.js +261 -284
- package/utils/responsiveObserve.js +32 -25
- package/utils/scrollIntoViewIfNeeded.js +12 -0
- package/utils/tree.js +11 -9
- package/utils/tween.js +5 -5
- package/version/index.js +1 -1
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/dist/compute-scroll-into-view/src/index.js +0 -126
- package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
- package/dist/tinycolor/customize/index.js +0 -12
- package/dist/tinycolor/src/conversion.js +0 -143
- package/dist/tinycolor/src/css-color-names.js +0 -153
- package/dist/tinycolor/src/format-input.js +0 -77
- package/dist/tinycolor/src/index.js +0 -388
- package/dist/tinycolor/src/util.js +0 -32
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/common/utils/scrollIntoView.d.ts +0 -4
- package/types/common/utils/tinycolor.d.ts +0 -1
- package/types/pc/utils/color.d.ts +0 -1
- package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/pc/utils/scrollIntoView.d.ts +0 -3
- package/types/pc/utils/tinycolor.d.ts +0 -1
- package/utils/color.js +0 -4
- package/utils/computeScrollIntoView.js +0 -6
- package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/utils/scrollIntoView.js +0 -6
- package/utils/tinycolor.js +0 -29
|
@@ -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/menu/Item.js
CHANGED
|
@@ -5,11 +5,11 @@ import U from "../components/common/hooks/useIsFirstRender.js";
|
|
|
5
5
|
import z from "../tooltip/index.js";
|
|
6
6
|
import A from "@unicom-cloud/utils/class-name";
|
|
7
7
|
import { Enter as H } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
8
|
-
import { omit as
|
|
8
|
+
import { omit as b } from "../components/common/utils/omit.js";
|
|
9
9
|
import V from "./Indent.js";
|
|
10
10
|
import W from "./context.js";
|
|
11
11
|
import { PROPS_NEED_TO_BE_PASSED_IN_SUBMENU as q } from "./util.js";
|
|
12
|
-
function G(
|
|
12
|
+
function G(C, c) {
|
|
13
13
|
const {
|
|
14
14
|
_key: a,
|
|
15
15
|
children: i,
|
|
@@ -21,7 +21,7 @@ function G(b, c) {
|
|
|
21
21
|
onClick: _,
|
|
22
22
|
renderItemInTooltip: d,
|
|
23
23
|
...$
|
|
24
|
-
} =
|
|
24
|
+
} = C, {
|
|
25
25
|
prefixCls: t,
|
|
26
26
|
mode: p,
|
|
27
27
|
collapse: m,
|
|
@@ -74,7 +74,7 @@ function G(b, c) {
|
|
|
74
74
|
onKeyDown: (e) => {
|
|
75
75
|
e.key === H.key && k(e);
|
|
76
76
|
},
|
|
77
|
-
...
|
|
77
|
+
...b(
|
|
78
78
|
$,
|
|
79
79
|
["key", "_key"].concat(q)
|
|
80
80
|
),
|
|
@@ -113,14 +113,14 @@ function G(b, c) {
|
|
|
113
113
|
className: `${t}-item-tooltip`,
|
|
114
114
|
...y?.triggerProps || {}
|
|
115
115
|
},
|
|
116
|
-
...
|
|
116
|
+
...b(y, ["triggerProps"]),
|
|
117
117
|
children: g
|
|
118
118
|
}
|
|
119
119
|
) : g;
|
|
120
120
|
}
|
|
121
|
-
const J = O(G),
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
const J = O(G), h = J;
|
|
122
|
+
h.displayName = "MenuItem";
|
|
123
|
+
h.menuType = "MenuItem";
|
|
124
124
|
export {
|
|
125
|
-
|
|
125
|
+
h as default
|
|
126
126
|
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui","version":"0.8.
|
|
1
|
+
{"name":"@unicom-cloud/ui","version":"0.8.103","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"}}
|
package/qr-code/index.js
CHANGED
|
@@ -13,12 +13,11 @@ import R from "../components/common/hooks/useMergeProps.js";
|
|
|
13
13
|
import "../components/common/utils/reactDOM.js";
|
|
14
14
|
import "@unicom-cloud/utils/constant";
|
|
15
15
|
import "lodash/debounce";
|
|
16
|
+
import "@unicom-cloud/utils/date";
|
|
16
17
|
import "@unicom-cloud/utils/case-name";
|
|
17
18
|
import S from "@unicom-cloud/utils/class-name";
|
|
18
|
-
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
19
19
|
import "@unicom-cloud/utils/constant/ui";
|
|
20
20
|
import "../utils/contextHolder.js";
|
|
21
|
-
import "@unicom-cloud/utils/dayjs";
|
|
22
21
|
import "@unicom-cloud/utils/clipboard-copy";
|
|
23
22
|
import "../components/common/utils/dayjs.js";
|
|
24
23
|
import "@unicom-cloud/utils/file/fileToURL";
|
|
@@ -47,13 +46,15 @@ import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
|
47
46
|
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
48
47
|
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
49
48
|
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
49
|
+
import "uuid";
|
|
50
50
|
import "@unicom-cloud/utils/file/saveAs";
|
|
51
51
|
import "@unicom-cloud/utils/screenfull";
|
|
52
|
+
import "@unicom-cloud/utils/tinycolor";
|
|
53
|
+
import "@unicom-cloud/utils/ui-color";
|
|
52
54
|
import "@unicom-cloud/utils/constant/ui.js";
|
|
53
55
|
import "react-is";
|
|
54
56
|
import "@unicom-cloud/utils/tree";
|
|
55
57
|
import "@unicom-cloud/utils/is";
|
|
56
|
-
import "uuid";
|
|
57
58
|
import "../dist/validate/src/index.js";
|
|
58
59
|
import h from "../config-provider/context.js";
|
|
59
60
|
const q = {
|
|
@@ -65,7 +66,7 @@ const q = {
|
|
|
65
66
|
bgColor: "#ffffff",
|
|
66
67
|
marginSize: 0,
|
|
67
68
|
value: "qr-code"
|
|
68
|
-
},
|
|
69
|
+
}, jo = (e) => {
|
|
69
70
|
const { getPrefixCls: s, componentConfig: n } = Q(h), d = R(
|
|
70
71
|
e,
|
|
71
72
|
q,
|
|
@@ -113,5 +114,5 @@ const q = {
|
|
|
113
114
|
);
|
|
114
115
|
};
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
jo as default
|
|
117
118
|
};
|
package/splitter/SplitBar.js
CHANGED
|
@@ -1,127 +1,129 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as G, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import H from "@unicom-cloud/icons/IconUiDown";
|
|
3
|
+
import J from "@unicom-cloud/icons/IconUiLeft";
|
|
4
|
+
import K from "@unicom-cloud/icons/IconUiRight";
|
|
5
|
+
import Q from "@unicom-cloud/icons/IconUiUp";
|
|
6
|
+
import E from "react";
|
|
7
7
|
import "../config-provider/ConfigProvider.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
function
|
|
12
|
-
return typeof
|
|
8
|
+
import f from "@unicom-cloud/utils/class-name";
|
|
9
|
+
import Y from "./hooks/useEvent.js";
|
|
10
|
+
import W from "../config-provider/context.js";
|
|
11
|
+
function O(d) {
|
|
12
|
+
return typeof d == "number" && !Number.isNaN(d) ? Math.round(d) : 0;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
const { getPrefixCls:
|
|
14
|
+
const ie = (d) => {
|
|
15
|
+
const { getPrefixCls: y } = E.useContext(W), {
|
|
16
16
|
prefixCls: I,
|
|
17
|
-
vertical:
|
|
18
|
-
index:
|
|
19
|
-
active:
|
|
17
|
+
vertical: s,
|
|
18
|
+
index: n,
|
|
19
|
+
active: z,
|
|
20
20
|
ariaNow: $,
|
|
21
|
-
ariaMin:
|
|
22
|
-
ariaMax:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
onCollapse: S,
|
|
21
|
+
ariaMin: M,
|
|
22
|
+
ariaMax: N,
|
|
23
|
+
startCollapsible: T,
|
|
24
|
+
endCollapsible: j,
|
|
25
|
+
onOffsetStart: S,
|
|
26
|
+
onOffsetUpdate: v,
|
|
27
|
+
onOffsetEnd: h,
|
|
28
|
+
onCollapse: P,
|
|
30
29
|
lazy: a,
|
|
31
30
|
containerSize: m
|
|
32
|
-
} =
|
|
31
|
+
} = d, e = y?.("bar", I), [r, w] = E.useState(
|
|
33
32
|
null
|
|
34
|
-
), [
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
if (
|
|
33
|
+
), [g, U] = E.useState(0), k = s ? 0 : g, A = s ? g : 0, D = (t) => {
|
|
34
|
+
t.currentTarget && (w([t.pageX, t.pageY]), S(n));
|
|
35
|
+
}, R = (t) => {
|
|
36
|
+
if (t.touches.length === 1) {
|
|
38
37
|
const o = t.touches[0];
|
|
39
|
-
|
|
38
|
+
w([o.pageX, o.pageY]), S(n);
|
|
40
39
|
}
|
|
41
|
-
},
|
|
42
|
-
const o = m * $ / 100, c = o + t,
|
|
43
|
-
return Math.max(
|
|
44
|
-
},
|
|
45
|
-
const c =
|
|
46
|
-
|
|
40
|
+
}, V = (t) => {
|
|
41
|
+
const o = m * $ / 100, c = o + t, x = Math.max(0, m * M / 100), i = Math.min(m, m * N / 100);
|
|
42
|
+
return Math.max(x, Math.min(i, c)) - o;
|
|
43
|
+
}, L = Y((t, o) => {
|
|
44
|
+
const c = V(
|
|
45
|
+
s ? o : t
|
|
47
46
|
);
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
|
|
47
|
+
U(c);
|
|
48
|
+
}), b = Y(() => {
|
|
49
|
+
v(n, k, A, !0), U(0), h(!0);
|
|
51
50
|
});
|
|
52
|
-
|
|
51
|
+
E.useEffect(() => {
|
|
53
52
|
if (r) {
|
|
54
53
|
const t = (i) => {
|
|
55
|
-
const { pageX: u, pageY:
|
|
56
|
-
a ?
|
|
54
|
+
const { pageX: u, pageY: C } = i, p = u - r[0], X = C - r[1];
|
|
55
|
+
a ? L(p, X) : v(n, p, X);
|
|
57
56
|
}, o = () => {
|
|
58
|
-
a ?
|
|
57
|
+
a ? b() : h(), w(null);
|
|
59
58
|
}, c = (i) => {
|
|
60
59
|
if (i.touches.length === 1) {
|
|
61
|
-
const u = i.touches[0],
|
|
62
|
-
a ?
|
|
60
|
+
const u = i.touches[0], C = u.pageX - r[0], p = u.pageY - r[1];
|
|
61
|
+
a ? L(C, p) : v(n, C, p);
|
|
63
62
|
}
|
|
64
|
-
},
|
|
65
|
-
a ?
|
|
63
|
+
}, x = () => {
|
|
64
|
+
a ? b() : h(), w(null);
|
|
66
65
|
};
|
|
67
|
-
return window.addEventListener("touchmove", c), window.addEventListener("touchend",
|
|
68
|
-
window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", o), window.removeEventListener("touchmove", c), window.removeEventListener("touchend",
|
|
66
|
+
return window.addEventListener("touchmove", c), window.addEventListener("touchend", x), window.addEventListener("mousemove", t), window.addEventListener("mouseup", o), () => {
|
|
67
|
+
window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", o), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", x);
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
70
|
}, [
|
|
72
71
|
r,
|
|
73
72
|
a,
|
|
74
|
-
n,
|
|
75
73
|
s,
|
|
74
|
+
n,
|
|
76
75
|
m,
|
|
77
76
|
$,
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
M,
|
|
78
|
+
N,
|
|
79
|
+
L,
|
|
80
|
+
v,
|
|
81
|
+
b,
|
|
82
|
+
h
|
|
80
83
|
]);
|
|
81
|
-
const
|
|
82
|
-
[`--${e}-preview-offset`]: `${
|
|
83
|
-
},
|
|
84
|
-
return /* @__PURE__ */
|
|
84
|
+
const B = {
|
|
85
|
+
[`--${e}-preview-offset`]: `${g}px`
|
|
86
|
+
}, q = s ? Q : J, F = s ? H : K;
|
|
87
|
+
return /* @__PURE__ */ G(
|
|
85
88
|
"div",
|
|
86
89
|
{
|
|
87
90
|
className: e,
|
|
88
91
|
role: "separator",
|
|
89
|
-
"aria-valuenow":
|
|
90
|
-
"aria-valuemin":
|
|
91
|
-
"aria-valuemax":
|
|
92
|
+
"aria-valuenow": O($),
|
|
93
|
+
"aria-valuemin": O(M),
|
|
94
|
+
"aria-valuemax": O(N),
|
|
92
95
|
children: [
|
|
93
96
|
a && /* @__PURE__ */ l(
|
|
94
97
|
"div",
|
|
95
98
|
{
|
|
96
|
-
className:
|
|
97
|
-
[`${e}-preview-active`]: !!
|
|
99
|
+
className: f(`${e}-preview`, {
|
|
100
|
+
[`${e}-preview-active`]: !!g
|
|
98
101
|
}),
|
|
99
|
-
style:
|
|
102
|
+
style: B
|
|
100
103
|
}
|
|
101
104
|
),
|
|
102
105
|
/* @__PURE__ */ l(
|
|
103
106
|
"div",
|
|
104
107
|
{
|
|
105
|
-
className:
|
|
106
|
-
[`${e}-dragger-
|
|
107
|
-
[`${e}-dragger-active`]: T
|
|
108
|
+
className: f(`${e}-dragger`, {
|
|
109
|
+
[`${e}-dragger-active`]: z
|
|
108
110
|
}),
|
|
109
|
-
onMouseDown:
|
|
110
|
-
onTouchStart:
|
|
111
|
+
onMouseDown: D,
|
|
112
|
+
onTouchStart: R
|
|
111
113
|
}
|
|
112
114
|
),
|
|
113
|
-
|
|
115
|
+
T && /* @__PURE__ */ l(
|
|
114
116
|
"div",
|
|
115
117
|
{
|
|
116
|
-
className:
|
|
118
|
+
className: f(
|
|
117
119
|
`${e}-collapse-bar`,
|
|
118
120
|
`${e}-collapse-bar-start`
|
|
119
121
|
),
|
|
120
|
-
onClick: () =>
|
|
122
|
+
onClick: () => P(n, "start"),
|
|
121
123
|
children: /* @__PURE__ */ l(
|
|
122
|
-
|
|
124
|
+
q,
|
|
123
125
|
{
|
|
124
|
-
className:
|
|
126
|
+
className: f(
|
|
125
127
|
`${e}-collapse-icon`,
|
|
126
128
|
`${e}-collapse-start`
|
|
127
129
|
)
|
|
@@ -129,18 +131,18 @@ const le = (f) => {
|
|
|
129
131
|
)
|
|
130
132
|
}
|
|
131
133
|
),
|
|
132
|
-
|
|
134
|
+
j && /* @__PURE__ */ l(
|
|
133
135
|
"div",
|
|
134
136
|
{
|
|
135
|
-
className:
|
|
137
|
+
className: f(
|
|
136
138
|
`${e}-collapse-bar`,
|
|
137
139
|
`${e}-collapse-bar-end`
|
|
138
140
|
),
|
|
139
|
-
onClick: () =>
|
|
141
|
+
onClick: () => P(n, "end"),
|
|
140
142
|
children: /* @__PURE__ */ l(
|
|
141
|
-
|
|
143
|
+
F,
|
|
142
144
|
{
|
|
143
|
-
className:
|
|
145
|
+
className: f(
|
|
144
146
|
`${e}-collapse-icon`,
|
|
145
147
|
`${e}-collapse-end`
|
|
146
148
|
)
|
|
@@ -153,5 +155,5 @@ const le = (f) => {
|
|
|
153
155
|
);
|
|
154
156
|
};
|
|
155
157
|
export {
|
|
156
|
-
|
|
158
|
+
ie as default
|
|
157
159
|
};
|