@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
package/splitter/Splitter.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as v, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import m, { useState as re, useRef as ie, useEffect as ae, useImperativeHandle as le } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
4
|
import ce from "../components/common/hooks/useMergeProps.js";
|
|
5
5
|
import fe from "@unicom-cloud/utils/class-name";
|
|
6
6
|
import { resizeObserver as me } from "../components/common/utils/resizeObserver.js";
|
|
7
|
-
import
|
|
7
|
+
import f from "./hooks/useEvent.js";
|
|
8
8
|
import pe from "./hooks/useItems.js";
|
|
9
9
|
import ue from "./hooks/useResizable.js";
|
|
10
10
|
import ze from "./hooks/useResize.js";
|
|
@@ -15,121 +15,113 @@ import he from "../config-provider/context.js";
|
|
|
15
15
|
const ge = {
|
|
16
16
|
layout: "horizontal"
|
|
17
17
|
};
|
|
18
|
-
function Me(
|
|
19
|
-
const { getPrefixCls:
|
|
20
|
-
|
|
18
|
+
function Me(P, E) {
|
|
19
|
+
const { getPrefixCls: N, componentConfig: O, rtl: l } = m.useContext(he), x = ce(
|
|
20
|
+
P,
|
|
21
21
|
ge,
|
|
22
|
-
|
|
22
|
+
O?.Splitter
|
|
23
23
|
), {
|
|
24
|
-
prefixCls:
|
|
25
|
-
className:
|
|
26
|
-
style:
|
|
24
|
+
prefixCls: y,
|
|
25
|
+
className: $,
|
|
26
|
+
style: k,
|
|
27
27
|
layout: g = "horizontal",
|
|
28
|
-
children:
|
|
29
|
-
onResizeStart:
|
|
28
|
+
children: H,
|
|
29
|
+
onResizeStart: U,
|
|
30
30
|
onResize: M,
|
|
31
|
-
onResizeEnd:
|
|
32
|
-
lazy:
|
|
33
|
-
...
|
|
34
|
-
} =
|
|
35
|
-
const t =
|
|
36
|
-
|
|
31
|
+
onResizeEnd: p,
|
|
32
|
+
lazy: j,
|
|
33
|
+
...w
|
|
34
|
+
} = x, s = N?.("splitter", y), c = g === "vertical", o = pe(H), [u, B] = re(), r = ie(null), W = () => {
|
|
35
|
+
const t = r.current?.offsetWidth, e = r.current?.offsetHeight, n = c ? e : t;
|
|
36
|
+
n !== 0 && B(n);
|
|
37
37
|
}, [
|
|
38
|
-
|
|
38
|
+
D,
|
|
39
|
+
z,
|
|
39
40
|
S,
|
|
40
|
-
C,
|
|
41
41
|
R,
|
|
42
|
-
|
|
42
|
+
I,
|
|
43
43
|
F
|
|
44
|
-
] = Se(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
l
|
|
51
|
-
), J = m((t) => {
|
|
52
|
-
_(t), j?.(S);
|
|
53
|
-
}), K = m(
|
|
54
|
-
(t, e, s) => {
|
|
55
|
-
const a = q(t, e);
|
|
56
|
-
s ? u?.(a) : M?.(a);
|
|
44
|
+
] = Se(o, u), V = ue(o, z, l), [q, A, G, J, b] = ze(o, S, u, F, l), K = f((t) => {
|
|
45
|
+
q(t), U?.(z);
|
|
46
|
+
}), L = f(
|
|
47
|
+
(t, e, n) => {
|
|
48
|
+
const a = A(t, e);
|
|
49
|
+
n ? p?.(a) : M?.(a);
|
|
57
50
|
}
|
|
58
|
-
),
|
|
59
|
-
|
|
60
|
-
}),
|
|
51
|
+
), Q = f((t) => {
|
|
52
|
+
G(), t || p?.(z);
|
|
53
|
+
}), T = f(
|
|
61
54
|
(t, e) => {
|
|
62
|
-
const
|
|
63
|
-
M?.(
|
|
55
|
+
const n = J(t, e);
|
|
56
|
+
M?.(n), p?.(n);
|
|
64
57
|
}
|
|
65
|
-
),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`${
|
|
69
|
-
l && [`${
|
|
70
|
-
), i =
|
|
58
|
+
), X = fe(
|
|
59
|
+
s,
|
|
60
|
+
$,
|
|
61
|
+
`${s}-${g}`,
|
|
62
|
+
l && [`${s}-rtl`]
|
|
63
|
+
), i = m.useMemo(() => {
|
|
71
64
|
const t = [];
|
|
72
65
|
let e = 0;
|
|
73
|
-
for (let
|
|
74
|
-
e +=
|
|
66
|
+
for (let n = 0; n < o.length; n += 1)
|
|
67
|
+
e += S[n], t.push(e);
|
|
75
68
|
return t;
|
|
76
|
-
}, [
|
|
69
|
+
}, [S, o.length]);
|
|
77
70
|
return ae(() => {
|
|
78
|
-
const t = me([
|
|
79
|
-
|
|
71
|
+
const t = me([r.current], () => {
|
|
72
|
+
W();
|
|
80
73
|
});
|
|
81
74
|
return () => {
|
|
82
75
|
t();
|
|
83
76
|
};
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
const
|
|
77
|
+
}, [r.current]), le(E, () => ({ dom: r.current })), /* @__PURE__ */ v("div", { style: k, className: X, ref: r, ...w, children: [
|
|
78
|
+
o.map((t, e) => {
|
|
79
|
+
const n = /* @__PURE__ */ h(
|
|
87
80
|
Ce,
|
|
88
81
|
{
|
|
89
82
|
...t,
|
|
90
|
-
prefixCls:
|
|
91
|
-
size:
|
|
83
|
+
prefixCls: s,
|
|
84
|
+
size: D[e]
|
|
92
85
|
}
|
|
93
86
|
);
|
|
94
87
|
let a = null;
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
88
|
+
const C = V[e];
|
|
89
|
+
if (C) {
|
|
90
|
+
const Y = (i[e - 1] || 0) + R[e], Z = (i[e + 1] || 100) - I[e + 1], _ = (i[e - 1] || 0) + I[e], ee = (i[e + 1] || 100) - R[e + 1];
|
|
98
91
|
a = /* @__PURE__ */ h(
|
|
99
92
|
de,
|
|
100
93
|
{
|
|
101
|
-
lazy:
|
|
94
|
+
lazy: j,
|
|
102
95
|
index: e,
|
|
103
|
-
active:
|
|
104
|
-
prefixCls:
|
|
96
|
+
active: b === e,
|
|
97
|
+
prefixCls: s,
|
|
105
98
|
vertical: c,
|
|
106
|
-
resizable: f.resizable,
|
|
107
99
|
ariaNow: i[e] * 100,
|
|
108
|
-
ariaMin: Math.max(
|
|
109
|
-
ariaMax: Math.min(
|
|
110
|
-
startCollapsible:
|
|
111
|
-
endCollapsible:
|
|
112
|
-
onOffsetStart:
|
|
113
|
-
onOffsetUpdate: (te,
|
|
114
|
-
let d = c ?
|
|
115
|
-
l && !c && (d = -d),
|
|
100
|
+
ariaMin: Math.max(Y, Z) * 100,
|
|
101
|
+
ariaMax: Math.min(_, ee) * 100,
|
|
102
|
+
startCollapsible: C.startCollapsible,
|
|
103
|
+
endCollapsible: C.endCollapsible,
|
|
104
|
+
onOffsetStart: K,
|
|
105
|
+
onOffsetUpdate: (te, ne, se, oe) => {
|
|
106
|
+
let d = c ? se : ne;
|
|
107
|
+
l && !c && (d = -d), L(te, d, oe);
|
|
116
108
|
},
|
|
117
|
-
onOffsetEnd:
|
|
118
|
-
onCollapse:
|
|
119
|
-
containerSize:
|
|
109
|
+
onOffsetEnd: Q,
|
|
110
|
+
onCollapse: T,
|
|
111
|
+
containerSize: u || 0
|
|
120
112
|
}
|
|
121
113
|
);
|
|
122
114
|
}
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
|
|
115
|
+
return /* @__PURE__ */ v(m.Fragment, { children: [
|
|
116
|
+
n,
|
|
125
117
|
a
|
|
126
118
|
] }, `split-panel-${e}`);
|
|
127
119
|
}),
|
|
128
|
-
typeof
|
|
120
|
+
typeof b == "number" && /* @__PURE__ */ h("div", { "aria-hidden": !0, className: `${s}-mask` })
|
|
129
121
|
] });
|
|
130
122
|
}
|
|
131
|
-
const Re =
|
|
132
|
-
|
|
123
|
+
const Re = m.forwardRef(Me);
|
|
124
|
+
Re.displayName = "Splitter";
|
|
133
125
|
export {
|
|
134
126
|
Re as default
|
|
135
127
|
};
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import C from "react";
|
|
2
|
+
function v(t, l, n) {
|
|
3
|
+
return C.useMemo(() => {
|
|
4
4
|
const r = [];
|
|
5
|
-
for (let e = 0; e <
|
|
6
|
-
const
|
|
7
|
-
resizable: z = !0,
|
|
8
|
-
min: d,
|
|
9
|
-
collapsible: a
|
|
10
|
-
} = p, {
|
|
11
|
-
resizable: C = !0,
|
|
12
|
-
min: f,
|
|
13
|
-
collapsible: i
|
|
14
|
-
} = u, m = z && C && (t !== 0 || !d) && (n !== 0 || !f), b = a.end && t > 0 || i.start && n === 0 && t > 0, c = i.start && n > 0 || a.end && t === 0 && n > 0;
|
|
5
|
+
for (let e = 0; e < t.length - 1; e += 1) {
|
|
6
|
+
const b = t[e], u = t[e + 1], o = l[e], s = l[e + 1], { min: d, collapsible: a } = b, { min: f, collapsible: c } = u, i = a.end && o > 0 || c.start && s === 0 && o > 0, p = c.start && s > 0 || a.end && o === 0 && s > 0;
|
|
15
7
|
r[e] = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
endCollapsible: !!(o ? b : c)
|
|
8
|
+
startCollapsible: !!(n ? p : i),
|
|
9
|
+
endCollapsible: !!(n ? i : p)
|
|
19
10
|
};
|
|
20
11
|
}
|
|
21
12
|
return r;
|
|
22
|
-
}, [
|
|
13
|
+
}, [l, t, n]);
|
|
23
14
|
}
|
|
24
15
|
export {
|
|
25
|
-
|
|
16
|
+
v as default
|
|
26
17
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import x from "react";
|
|
2
|
-
import { getPtg as
|
|
3
|
-
function
|
|
4
|
-
const i =
|
|
2
|
+
import { getPtg as T } from "./useSizes.js";
|
|
3
|
+
function H(v, P, b, C, j) {
|
|
4
|
+
const i = v.map((t) => [t.min, t.max]), S = b || 0, M = (t) => t * S;
|
|
5
5
|
function a(t, f) {
|
|
6
|
-
return typeof t == "string" ? M(
|
|
6
|
+
return typeof t == "string" ? M(T(t)) : t ?? f;
|
|
7
7
|
}
|
|
8
|
-
const [O,
|
|
8
|
+
const [O, k] = x.useState([]), I = x.useRef([]), [g, p] = x.useState(null), U = () => P.map(M);
|
|
9
9
|
return [
|
|
10
10
|
(t) => {
|
|
11
|
-
|
|
11
|
+
k(U()), p({
|
|
12
12
|
index: t,
|
|
13
13
|
confirmed: !1
|
|
14
14
|
});
|
|
@@ -23,7 +23,7 @@ function J(b, v, P, j, C, k) {
|
|
|
23
23
|
});
|
|
24
24
|
else
|
|
25
25
|
for (let r = t; r >= 0; r -= 1)
|
|
26
|
-
if (O[r] > 0
|
|
26
|
+
if (O[r] > 0) {
|
|
27
27
|
n = r, p({
|
|
28
28
|
index: r,
|
|
29
29
|
confirmed: !0
|
|
@@ -45,7 +45,7 @@ function J(b, v, P, j, C, k) {
|
|
|
45
45
|
p(null);
|
|
46
46
|
},
|
|
47
47
|
(t, f) => {
|
|
48
|
-
const n = U(), c =
|
|
48
|
+
const n = U(), c = j ? f === "start" ? "end" : "start" : f, e = c === "start" ? t : t + 1, s = c === "start" ? t + 1 : t, l = n[e], d = n[s];
|
|
49
49
|
if (l !== 0 && d !== 0)
|
|
50
50
|
n[e] = 0, n[s] += l, I.current[t] = l;
|
|
51
51
|
else {
|
|
@@ -55,7 +55,7 @@ function J(b, v, P, j, C, k) {
|
|
|
55
55
|
), r = a(i[s][0], 0), E = a(
|
|
56
56
|
i[s][1],
|
|
57
57
|
S
|
|
58
|
-
),
|
|
58
|
+
), y = Math.max(m, u - E), L = Math.min(o, u - r), R = r || (L - y) / 2, z = I.current[t], h = u - z;
|
|
59
59
|
z && z <= E && z >= r && h <= o && h >= m ? (n[s] = z, n[e] = h) : (n[e] -= R, n[s] += R);
|
|
60
60
|
}
|
|
61
61
|
return C(n), n;
|
|
@@ -64,5 +64,5 @@ function J(b, v, P, j, C, k) {
|
|
|
64
64
|
];
|
|
65
65
|
}
|
|
66
66
|
export {
|
|
67
|
-
|
|
67
|
+
H as default
|
|
68
68
|
};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from "react";
|
|
2
2
|
function l(s) {
|
|
3
3
|
return Number(s.slice(0, -1)) / 100;
|
|
4
4
|
}
|
|
5
5
|
function z(s) {
|
|
6
6
|
return typeof s == "string" && s.endsWith("%");
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const S = s.map((e) => e.size),
|
|
8
|
+
function b(s, a) {
|
|
9
|
+
const S = s.map((e) => e.size), i = s.length, r = a || 0, [d, M] = u.useState(() => s.map((e) => e.defaultSize)), c = u.useMemo(() => {
|
|
10
10
|
const e = [];
|
|
11
|
-
for (let
|
|
12
|
-
e[
|
|
11
|
+
for (let o = 0; o < i; o += 1)
|
|
12
|
+
e[o] = S[o] ?? d[o];
|
|
13
13
|
return e;
|
|
14
|
-
}, [
|
|
15
|
-
let e = [],
|
|
16
|
-
for (let n = 0; n <
|
|
17
|
-
const t =
|
|
14
|
+
}, [i, d, S]), p = u.useMemo(() => {
|
|
15
|
+
let e = [], o = 0;
|
|
16
|
+
for (let n = 0; n < i; n += 1) {
|
|
17
|
+
const t = c[n];
|
|
18
18
|
if (z(t))
|
|
19
19
|
e[n] = l(t);
|
|
20
20
|
else if (t || t === 0) {
|
|
21
21
|
const g = Number(t);
|
|
22
|
-
Number.isNaN(g) || (e[n] = g /
|
|
22
|
+
Number.isNaN(g) || (e[n] = g / r);
|
|
23
23
|
} else
|
|
24
|
-
|
|
24
|
+
o += 1, e[n] = void 0;
|
|
25
25
|
}
|
|
26
26
|
const f = e.reduce((n, t) => n + (t || 0), 0);
|
|
27
|
-
if (f > 1 || !
|
|
27
|
+
if (f > 1 || !o) {
|
|
28
28
|
const n = 1 / f;
|
|
29
29
|
e = e.map((t) => t === void 0 ? 0 : t * n);
|
|
30
30
|
} else {
|
|
31
|
-
const n = (1 - f) /
|
|
31
|
+
const n = (1 - f) / o;
|
|
32
32
|
e = e.map((t) => t === void 0 ? n : t);
|
|
33
33
|
}
|
|
34
34
|
return e;
|
|
35
|
-
}, [
|
|
36
|
-
() =>
|
|
37
|
-
|
|
38
|
-
),
|
|
39
|
-
() => s.map((e) => z(e.min) ? l(e.min) : (e.min || 0) /
|
|
40
|
-
[s,
|
|
41
|
-
),
|
|
42
|
-
() => s.map((e) => z(e.max) ? l(e.max) : (e.max ||
|
|
43
|
-
[s,
|
|
35
|
+
}, [i, c, r]), m = u.useMemo(() => {
|
|
36
|
+
const e = (o) => o * r;
|
|
37
|
+
return p.map(e);
|
|
38
|
+
}, [r, p]), x = u.useMemo(
|
|
39
|
+
() => s.map((e) => z(e.min) ? l(e.min) : (e.min || 0) / r),
|
|
40
|
+
[s, r]
|
|
41
|
+
), P = u.useMemo(
|
|
42
|
+
() => s.map((e) => z(e.max) ? l(e.max) : (e.max || r) / r),
|
|
43
|
+
[s, r]
|
|
44
44
|
);
|
|
45
45
|
return [
|
|
46
|
-
|
|
47
|
-
() =>
|
|
48
|
-
[m,
|
|
46
|
+
u.useMemo(
|
|
47
|
+
() => a ? m : c,
|
|
48
|
+
[a, m, c]
|
|
49
49
|
),
|
|
50
50
|
m,
|
|
51
51
|
p,
|
|
52
|
+
x,
|
|
52
53
|
P,
|
|
53
|
-
|
|
54
|
-
x
|
|
54
|
+
M
|
|
55
55
|
];
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
b as default,
|
|
59
59
|
l as getPtg
|
|
60
60
|
};
|
package/statistic/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, Fragment as L, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Tween as T } from "../dist/tween/src/tween.js";
|
|
3
|
-
import
|
|
3
|
+
import W from "../dist/tween/src/easing.js";
|
|
4
4
|
import z from "dayjs";
|
|
5
5
|
import A from "lodash/isFunction";
|
|
6
6
|
import c from "lodash/isNumber";
|
|
@@ -31,10 +31,10 @@ function nt(y, D) {
|
|
|
31
31
|
suffix: u,
|
|
32
32
|
format: p,
|
|
33
33
|
renderFormat: S,
|
|
34
|
-
styleValue:
|
|
35
|
-
styleDecimal:
|
|
36
|
-
loading:
|
|
37
|
-
...
|
|
34
|
+
styleValue: O,
|
|
35
|
+
styleDecimal: _,
|
|
36
|
+
loading: k,
|
|
37
|
+
...q
|
|
38
38
|
} = t, i = F(), C = F(), [e, d] = J(
|
|
39
39
|
"value" in t ? t.value : void 0
|
|
40
40
|
), o = U?.("statistic"), f = (n = t.countFrom, r = t.value) => {
|
|
@@ -47,7 +47,7 @@ function nt(y, D) {
|
|
|
47
47
|
value: r
|
|
48
48
|
},
|
|
49
49
|
duration: N,
|
|
50
|
-
easing: W,
|
|
50
|
+
easing: W.quartOut,
|
|
51
51
|
onUpdate: (I) => {
|
|
52
52
|
d(I.value.toFixed(s));
|
|
53
53
|
},
|
|
@@ -80,7 +80,7 @@ function nt(y, D) {
|
|
|
80
80
|
{
|
|
81
81
|
className: tt(`${o}`, { [`${o}-rtl`]: V }, j),
|
|
82
82
|
style: M,
|
|
83
|
-
...et(
|
|
83
|
+
...et(q, ["value", "countUp", "countFrom", "countDuration"]),
|
|
84
84
|
ref: C,
|
|
85
85
|
children: [
|
|
86
86
|
x && /* @__PURE__ */ a("div", { className: `${o}-title`, children: x }),
|
|
@@ -89,15 +89,15 @@ function nt(y, D) {
|
|
|
89
89
|
Z,
|
|
90
90
|
{
|
|
91
91
|
animation: !0,
|
|
92
|
-
loading: !!
|
|
92
|
+
loading: !!k,
|
|
93
93
|
text: { rows: 1, width: "100%" },
|
|
94
|
-
children: /* @__PURE__ */ l("div", { className: `${o}-value`, style:
|
|
94
|
+
children: /* @__PURE__ */ l("div", { className: `${o}-value`, style: O, children: [
|
|
95
95
|
$ ? /* @__PURE__ */ a("span", { className: `${o}-value-int`, children: w }) : w,
|
|
96
96
|
v !== void 0 || u ? /* @__PURE__ */ l(
|
|
97
97
|
"span",
|
|
98
98
|
{
|
|
99
99
|
className: `${o}-value-decimal`,
|
|
100
|
-
style:
|
|
100
|
+
style: _,
|
|
101
101
|
children: [
|
|
102
102
|
c(Number(e)) && v !== void 0 && `.${v}`,
|
|
103
103
|
u != null ? /* @__PURE__ */ a("span", { className: `${o}-value-suffix`, children: u }) : null
|