@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/input/Textarea.js
CHANGED
|
@@ -49,7 +49,7 @@ const ge = (e, A) => {
|
|
|
49
49
|
beforeTriggerValueChangeCallback: (t) => {
|
|
50
50
|
!("value" in e) && (n === void 0 || t.length <= n) && U(t);
|
|
51
51
|
}
|
|
52
|
-
}), S = F || l || "", { getPrefixCls: J, rtl: g } = ne(de), o = J?.("textarea"), z = s || e.resize === "none" || C(e.autoSize) && !w(e.autoSize.minRows) && !w(e.autoSize.maxRows) && e.autoSize?.minRows === e.autoSize?.maxRows
|
|
52
|
+
}), S = F || l || "", { getPrefixCls: J, rtl: g } = ne(de), o = J?.("textarea"), z = s || e.resize === "none" || !w(e.rows) || C(e.autoSize) && !w(e.autoSize.minRows) && !w(e.autoSize.maxRows) && e.autoSize?.minRows === e.autoSize?.maxRows;
|
|
53
53
|
z ? f.resize = "none" : e.resize && (f.resize = e.resize);
|
|
54
54
|
const y = () => {
|
|
55
55
|
if (r.current && r.current.focus) {
|
|
@@ -32,11 +32,11 @@ function y(n) {
|
|
|
32
32
|
r || (r = document.createElement("textarea"), document.body.appendChild(r));
|
|
33
33
|
const t = window.getComputedStyle(n), m = w.map((a) => `${a}:${t.getPropertyValue(a)}`).join(";");
|
|
34
34
|
r.setAttribute("style", u + m);
|
|
35
|
-
const e = parseFloat(t.getPropertyValue("padding-top")) + parseFloat(t.getPropertyValue("padding-bottom")), i = t.getPropertyValue("box-sizing"),
|
|
35
|
+
const e = parseFloat(t.getPropertyValue("padding-top")) + parseFloat(t.getPropertyValue("padding-bottom")), i = t.getPropertyValue("box-sizing"), g = parseFloat(t.getPropertyValue("border-top-width")) + parseFloat(t.getPropertyValue("border-bottom-width"));
|
|
36
36
|
return {
|
|
37
37
|
paddingSize: e,
|
|
38
38
|
boxSizing: i,
|
|
39
|
-
borderSize:
|
|
39
|
+
borderSize: g
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
function H(n, t) {
|
|
@@ -48,16 +48,16 @@ function H(n, t) {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
if (n) {
|
|
51
|
-
const { minRows: e, maxRows: i } = m(),
|
|
52
|
-
r.value =
|
|
53
|
-
let d = r.scrollHeight + p,
|
|
51
|
+
const { minRows: e, maxRows: i } = m(), g = t, { paddingSize: a, boxSizing: x, borderSize: p } = y(g);
|
|
52
|
+
r.value = g.value || g.placeholder || "";
|
|
53
|
+
let d = r.scrollHeight + p, l, o, h;
|
|
54
54
|
if (e || i) {
|
|
55
55
|
r.value = "";
|
|
56
56
|
const f = r.scrollHeight - a;
|
|
57
|
-
c(e) && (
|
|
57
|
+
c(e) && (l = f * e, x === "border-box" && (l += a, l += p), d = Math.max(d, l)), c(i) && (o = f * i, x === "border-box" && (o += a, o += p), h = d > o ? "auto" : "", o = Math.min(d, o));
|
|
58
58
|
}
|
|
59
59
|
const s = {};
|
|
60
|
-
return s.height = d,
|
|
60
|
+
return s.height = d, l && (s.minHeight = l), o && (s.maxHeight = o), h && (s.overflowY = h), s;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
export {
|
package/liquid-fill/index.js
CHANGED
|
@@ -13,12 +13,11 @@ import "../components/common/utils/reactDOM.js";
|
|
|
13
13
|
import "@unicom-cloud/utils/constant";
|
|
14
14
|
import mt from "../components/common/hooks/useUpdateEffect.js";
|
|
15
15
|
import "lodash/debounce";
|
|
16
|
+
import "@unicom-cloud/utils/date";
|
|
16
17
|
import "@unicom-cloud/utils/case-name";
|
|
17
18
|
import lt 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 { v4 as A } from "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 { isNumber as ct } from "@unicom-cloud/utils/is";
|
|
56
|
-
import { v4 as A } from "uuid";
|
|
57
58
|
import "../dist/validate/src/index.js";
|
|
58
59
|
import pt from "../config-provider/context.js";
|
|
59
60
|
const dt = {
|
|
@@ -73,7 +74,7 @@ const dt = {
|
|
|
73
74
|
decimalPlaces: 0,
|
|
74
75
|
percentFontScale: 0.5,
|
|
75
76
|
waveSpeedVariation: 0.5
|
|
76
|
-
},
|
|
77
|
+
}, we = (E) => {
|
|
77
78
|
const { getPrefixCls: I, componentConfig: _ } = at(pt), i = I?.("liquid-fill"), H = st(
|
|
78
79
|
E,
|
|
79
80
|
dt,
|
|
@@ -254,5 +255,5 @@ const dt = {
|
|
|
254
255
|
);
|
|
255
256
|
};
|
|
256
257
|
export {
|
|
257
|
-
|
|
258
|
+
we as default
|
|
258
259
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/list/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import Tt from "../spin/index.js";
|
|
|
10
10
|
import x from "@unicom-cloud/utils/class-name";
|
|
11
11
|
import { omit as Bt } from "../components/common/utils/omit.js";
|
|
12
12
|
import { pickDataAttributes as Vt } from "../components/common/utils/pick.js";
|
|
13
|
-
import { scrollIntoView as _t } from "../components/common/utils/
|
|
13
|
+
import { scrollIntoView as _t } from "../components/common/utils/scrollIntoViewIfNeeded.js";
|
|
14
14
|
import kt from "../virtual-list/VirtualList.js";
|
|
15
15
|
import Gt from "./Item.js";
|
|
16
16
|
import Ot from "../config-provider/context.js";
|
package/marquee/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useContext as
|
|
1
|
+
import { jsx as s, Fragment as et, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as rt, useContext as it, useState as y, useRef as k, useCallback as A, useEffect as R, useMemo as f, Fragment as ot, Children as H } 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 nt from "lodash/merge";
|
|
9
9
|
import "../components/common/utils/dom.js";
|
|
10
10
|
import "../components/common/hooks/useIntersectionObserver.js";
|
|
11
|
-
import
|
|
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
|
+
import "@unicom-cloud/utils/date";
|
|
15
16
|
import "@unicom-cloud/utils/case-name";
|
|
16
|
-
import
|
|
17
|
-
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
17
|
+
import mt from "@unicom-cloud/utils/class-name";
|
|
18
18
|
import "@unicom-cloud/utils/constant/ui";
|
|
19
19
|
import "../utils/contextHolder.js";
|
|
20
|
-
import "@unicom-cloud/utils/dayjs";
|
|
21
20
|
import "@unicom-cloud/utils/clipboard-copy";
|
|
22
21
|
import "../components/common/utils/dayjs.js";
|
|
23
22
|
import "@unicom-cloud/utils/file/fileToURL";
|
|
@@ -46,238 +45,157 @@ import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
|
46
45
|
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
47
46
|
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
48
47
|
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
49
|
-
import { resizeObserver as
|
|
48
|
+
import { resizeObserver as at } from "../components/common/utils/resizeObserver.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
|
-
import "@unicom-cloud/utils/is";
|
|
56
|
-
import "uuid";
|
|
57
|
+
import { isPlainObject as lt } from "@unicom-cloud/utils/is";
|
|
57
58
|
import "../dist/validate/src/index.js";
|
|
58
|
-
import
|
|
59
|
-
const
|
|
59
|
+
import pt from "../config-provider/context.js";
|
|
60
|
+
const ct = {
|
|
60
61
|
speed: 50,
|
|
61
|
-
// 默认50像素/秒(数值越大越快)
|
|
62
62
|
direction: "left",
|
|
63
63
|
pauseOnHover: !1,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
64
|
+
loop: 0
|
|
65
|
+
}, ye = rt(
|
|
66
|
+
function(B, E) {
|
|
67
|
+
const { getPrefixCls: z, componentConfig: I } = it(pt), i = z?.("marquee"), t = z?.("marquee-var"), V = st(
|
|
68
|
+
B,
|
|
69
|
+
ct,
|
|
70
|
+
I?.Marquee
|
|
71
|
+
), {
|
|
72
|
+
style: W = {},
|
|
73
|
+
className: _,
|
|
74
|
+
autoFill: m = !1,
|
|
75
|
+
play: p = !0,
|
|
76
|
+
pauseOnHover: C = !1,
|
|
77
|
+
pauseOnClick: v = !1,
|
|
78
|
+
direction: e = "left",
|
|
79
|
+
speed: M = 50,
|
|
80
|
+
delay: F = 0,
|
|
81
|
+
loop: q = 0,
|
|
82
|
+
gradient: D,
|
|
83
|
+
onFinish: G,
|
|
84
|
+
onCycleComplete: J,
|
|
85
|
+
onMount: x,
|
|
86
|
+
children: h
|
|
87
|
+
} = V, K = e === "left" || e === "right";
|
|
88
|
+
let r = D;
|
|
89
|
+
r === !0 && (r = {}), lt(r) && (r = nt(
|
|
90
|
+
{ size: K ? 50 : 20, color: "#fff" },
|
|
91
|
+
r
|
|
92
|
+
));
|
|
93
|
+
const [O, L] = y(0), [g, Q] = y(0), [$, T] = y(1), [w, U] = y(!1), X = k(null), a = E || X, c = k(null), u = A(() => {
|
|
94
|
+
if (c.current && a.current) {
|
|
95
|
+
const o = a.current.getBoundingClientRect(), d = c.current.getBoundingClientRect();
|
|
96
|
+
let n = o.width, l = d.width;
|
|
97
|
+
(e === "up" || e === "down") && (n = o.height, l = d.height), T(
|
|
98
|
+
m && n && l ? Math.max(2, Math.ceil(n / l)) : 1
|
|
99
|
+
), L(n), Q(l);
|
|
98
100
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
}, [m, a, e]);
|
|
102
|
+
R(() => {
|
|
103
|
+
if (!w) return;
|
|
104
|
+
u();
|
|
105
|
+
const o = at(
|
|
106
|
+
[a.current, c.current],
|
|
107
|
+
u
|
|
108
|
+
);
|
|
109
|
+
return () => {
|
|
110
|
+
o();
|
|
111
|
+
};
|
|
112
|
+
}, [u, a, c, w]), R(() => (u(), () => {
|
|
113
|
+
}), [u, h]), R(() => (U(!0), x && x(), () => {
|
|
114
|
+
}), [x]);
|
|
115
|
+
const P = f(() => g ? m ? g * $ / M : Math.max(O, g) / M : 0, [m, O, g, $, M]), Y = f(
|
|
116
|
+
() => ({
|
|
117
|
+
...W,
|
|
118
|
+
[`--${t}-pause-on-hover`]: !p || C ? "paused" : "running",
|
|
119
|
+
[`--${t}-pause-on-click`]: !p || C && !v || v ? "paused" : "running",
|
|
120
|
+
[`--${t}-width`]: e === "up" || e === "down" ? "100vh" : "100%",
|
|
121
|
+
[`--${t}-transform`]: e === "up" ? "rotate(-90deg)" : e === "down" ? "rotate(90deg)" : "none"
|
|
122
|
+
}),
|
|
123
|
+
[W, t, p, C, v, e]
|
|
124
|
+
), Z = f(
|
|
125
|
+
() => ({
|
|
126
|
+
[`--${t}-gradient-color`]: r?.color,
|
|
127
|
+
[`--${t}-gradient-width`]: typeof r?.size == "number" ? `${r?.size}px` : r?.size
|
|
128
|
+
}),
|
|
129
|
+
[r?.color, r?.size, t]
|
|
130
|
+
), S = f(
|
|
131
|
+
() => ({
|
|
132
|
+
[`--${t}-play`]: p ? "running" : "paused",
|
|
133
|
+
[`--${t}-direction`]: e === "left" ? "normal" : "reverse",
|
|
134
|
+
[`--${t}-duration`]: `${P}s`,
|
|
135
|
+
[`--${t}-delay`]: `${F}s`,
|
|
136
|
+
[`--${t}-iteration-count`]: q ? `${q}` : "infinite",
|
|
137
|
+
[`--${t}-min-width`]: m ? "auto" : "100%"
|
|
138
|
+
}),
|
|
139
|
+
[t, p, e, P, F, q, m]
|
|
140
|
+
), N = f(
|
|
141
|
+
() => ({
|
|
142
|
+
[`--${t}-transform`]: e === "up" ? "rotate(90deg)" : e === "down" ? "rotate(-90deg)" : "none"
|
|
143
|
+
}),
|
|
144
|
+
[e, t]
|
|
145
|
+
), b = A(
|
|
146
|
+
(o) => Array.from({ length: o }).map((d, n) => /* @__PURE__ */ s(ot, { children: H.map(h, (l, tt) => /* @__PURE__ */ s(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
style: N,
|
|
150
|
+
className: `${i}-child`,
|
|
151
|
+
children: l
|
|
152
|
+
},
|
|
153
|
+
`child-${n}-${tt}`
|
|
154
|
+
)) }, n)),
|
|
155
|
+
[h, N, i]
|
|
105
156
|
);
|
|
106
|
-
return (
|
|
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(
|
|
157
|
+
return w ? /* @__PURE__ */ s(et, { children: /* @__PURE__ */ j(
|
|
169
158
|
"div",
|
|
170
159
|
{
|
|
171
|
-
ref:
|
|
172
|
-
style:
|
|
173
|
-
className: `${
|
|
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(
|
|
160
|
+
ref: a,
|
|
161
|
+
style: Y,
|
|
162
|
+
className: mt(i, `${i}-${e}`, _),
|
|
163
|
+
children: [
|
|
164
|
+
!!r && /* @__PURE__ */ s("div", { style: Z, className: `${i}-overlay` }),
|
|
165
|
+
/* @__PURE__ */ j(
|
|
231
166
|
"div",
|
|
232
167
|
{
|
|
233
|
-
style:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
pointerEvents: "none"
|
|
257
|
-
},
|
|
258
|
-
className: `${s}-linear-gradient-to-bottom`
|
|
168
|
+
style: S,
|
|
169
|
+
className: `${i}-item`,
|
|
170
|
+
onAnimationIteration: J,
|
|
171
|
+
onAnimationEnd: G,
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ s(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
ref: c,
|
|
177
|
+
className: `${i}-initial-child-container`,
|
|
178
|
+
children: H.map(h, (o, d) => /* @__PURE__ */ s(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
style: N,
|
|
182
|
+
className: `${i}-child`,
|
|
183
|
+
children: o
|
|
184
|
+
},
|
|
185
|
+
`original-${d}`
|
|
186
|
+
))
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
b($ - 1)
|
|
190
|
+
]
|
|
259
191
|
}
|
|
260
192
|
),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
};
|
|
193
|
+
/* @__PURE__ */ s("div", { style: S, className: `${i}-item`, children: b($) })
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
) }) : null;
|
|
197
|
+
}
|
|
198
|
+
);
|
|
281
199
|
export {
|
|
282
|
-
|
|
200
|
+
ye as default
|
|
283
201
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|