@unicom-cloud/ui 0.8.107 → 0.8.108
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/ColorPicker.js +15 -14
- package/Constant.js +4 -0
- package/Copy.js +4 -3
- package/Countdown.js +25 -0
- package/Grid.js +8 -10
- package/LiquidFill.js +4 -3
- package/List.js +7 -6
- package/Marquee.js +4 -3
- package/PageHeader.js +3 -2
- package/QrCode.js +4 -3
- package/RowCol.js +8 -0
- package/Segmented.js +14 -4
- package/Statistic.js +5 -4
- package/Tour.js +4 -3
- package/Transfer.js +4 -2
- package/anchor/Link.js +1 -1
- package/avatar/Group.js +1 -1
- package/button/index.js +52 -51
- package/calendar/Lunar.js +21 -21
- package/cascader/base/node.js +22 -20
- package/cascader/base/store.js +10 -10
- package/cascader/util.js +29 -27
- package/color-picker/Mode.js +8 -7
- package/color-picker/hooks/useColorPicker.js +56 -55
- package/color-picker/index.js +54 -53
- package/color-picker/utils.js +58 -57
- package/components/common/empty/index.js +2 -2
- package/components/common/flex/index.js +64 -55
- package/components/common/flex/interface.js +6 -6
- package/components/common/hooks/useInterval.js +6 -6
- package/components/common/space/index.js +53 -53
- package/components/common/utils/dayjs.js +75 -62
- package/components/common/utils/toArray.js +7 -5
- package/constant/index.js +4 -0
- package/copy/index.js +2 -1
- package/countdown/index.js +113 -0
- package/countdown/interface.js +1 -0
- package/countdown/util.js +29 -0
- package/descriptions/index.js +26 -26
- package/dropdown/Button.js +1 -1
- package/flex/index.js +30 -29
- package/form/FormItem.js +126 -122
- package/grid/Grid.js +40 -41
- package/grid/Item.js +37 -37
- package/grid/context.js +2 -3
- package/grid/index.js +6 -8
- package/hooks/useResponsiveState.js +54 -0
- package/index.js +614 -610
- package/input/InputElement.js +25 -24
- package/layout/Sider.js +1 -1
- package/liquid-fill/index.js +4 -3
- package/list/Item.js +21 -21
- package/list/index.js +53 -52
- package/marquee/index.js +20 -19
- package/marquee-/index.js +4 -3
- package/mentions/util.js +9 -8
- package/package.json +1 -1
- package/page-header/index.js +57 -56
- package/pagination/Pagination.js +89 -92
- package/qr-code/index.js +4 -3
- package/radio/Group.js +1 -1
- package/row-col/Col-.js +88 -0
- package/row-col/Col.js +159 -0
- package/row-col/Row.js +73 -0
- package/row-col/context.js +5 -0
- package/row-col/index.js +11 -0
- package/row-col/interface.js +1 -0
- package/segmented/index.js +257 -206
- package/select/Select.js +191 -191
- package/select/util.js +50 -50
- package/space/index.js +15 -13
- package/statistic/index.js +56 -55
- package/statistic/interface.js +4 -1
- package/style.css +1 -1
- package/table/hook/useColumns.js +27 -26
- package/table/hook/useStickyClassNames.js +9 -8
- package/table/hook/useThResizable.js +4 -3
- package/table/th-resizable/index.js +11 -10
- package/table/thead/index.js +18 -16
- package/timeline/Item.js +1 -1
- package/tour/index.js +4 -3
- package/transfer/index.js +93 -91
- package/trigger/index.js +66 -66
- package/types/common/flex/index.d.ts +3 -9
- package/types/common/flex/interface.d.ts +15 -4
- package/types/common/space/index.d.ts +3 -5
- package/types/common/space/interface.d.ts +2 -0
- package/types/common/utils/dayjs.d.ts +3 -1
- package/types/pc/button/interface.d.ts +2 -2
- package/types/pc/config-provider/interface.d.ts +16 -11
- package/types/pc/constant/index.d.ts +1 -0
- package/types/pc/countdown/interface.d.ts +65 -0
- package/types/pc/countdown/util.d.ts +7 -0
- package/types/pc/flex/index.d.ts +8 -6
- package/types/pc/flex/interface.d.ts +3 -10
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/form/interface.d.ts +1 -1
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +1 -2
- package/types/pc/grid/context.d.ts +0 -5
- package/types/pc/grid/index.d.ts +4 -6
- package/types/pc/grid/interface.d.ts +7 -125
- package/types/pc/hooks/useResponsiveState.d.ts +3 -0
- package/types/pc/index.d.ts +7 -3
- package/types/pc/list/interface.d.ts +2 -1
- package/types/pc/pagination/PageOption.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +5 -6
- package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
- package/types/pc/{grid → row-col}/Col.d.ts +1 -2
- package/types/pc/{grid → row-col}/Row.d.ts +1 -2
- package/types/pc/row-col/context.d.ts +6 -0
- package/types/pc/row-col/index.d.ts +7 -0
- package/types/pc/row-col/interface.d.ts +112 -0
- package/types/pc/segmented/index.d.ts +3 -7
- package/types/pc/segmented/interface.d.ts +38 -5
- package/types/pc/space/index.d.ts +5 -7
- package/types/pc/space/interface.d.ts +3 -10
- package/types/pc/statistic/index.d.ts +1 -1
- package/types/pc/statistic/interface.d.ts +1 -49
- package/types/pc/utils/names.d.ts +121 -113
- package/types/pc/utils/responsiveObserve.d.ts +8 -8
- package/typography/Ellipsis.js +5 -4
- package/typography/Operations.js +4 -3
- package/utils/dayjs.js +13 -11
- package/utils/index.js +244 -242
- package/utils/names.js +15 -10
- package/utils/responsiveObserve.js +43 -36
- package/version/index.js +1 -1
- package/grid/Col-.js +0 -86
- package/grid/Col.js +0 -169
- package/grid/Row.js +0 -96
- package/grid/hook/useResponsiveState.js +0 -35
- package/statistic/Countdown.js +0 -56
- package/statistic/util.js +0 -33
- package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
- package/types/pc/statistic/util.d.ts +0 -1
- /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
package/input/InputElement.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsxs as H, Fragment as K, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import Y from "@unicom-cloud/icons/IconUiClose";
|
|
3
|
-
import Z from "lodash/
|
|
4
|
-
import _
|
|
5
|
-
import oe from "
|
|
6
|
-
import re from "../
|
|
3
|
+
import Z from "lodash/isArray";
|
|
4
|
+
import _ from "lodash/isFunction";
|
|
5
|
+
import ee, { useState as te, useRef as b, useImperativeHandle as oe, useEffect as L } from "react";
|
|
6
|
+
import re from "../components/common/hooks/useKeyboardEvent.js";
|
|
7
|
+
import ne from "../icon-hover/index.js";
|
|
7
8
|
import O from "@unicom-cloud/utils/class-name";
|
|
8
|
-
import { fillNBSP as
|
|
9
|
+
import { fillNBSP as ie } from "../components/common/utils/fillNBSP.js";
|
|
9
10
|
import "../components/common/utils/is.js";
|
|
10
|
-
import { omit as
|
|
11
|
-
import { resizeObserver as
|
|
12
|
-
import
|
|
11
|
+
import { omit as ae } from "../components/common/utils/omit.js";
|
|
12
|
+
import { resizeObserver as se } from "../components/common/utils/resizeObserver.js";
|
|
13
|
+
import le from "./useComposition.js";
|
|
13
14
|
import { isPlainObject as p } from "@unicom-cloud/utils/is";
|
|
14
|
-
const
|
|
15
|
+
const ue = 2, ce = (o) => {
|
|
15
16
|
if (!o)
|
|
16
17
|
return {};
|
|
17
18
|
const h = window.getComputedStyle(o);
|
|
@@ -31,7 +32,7 @@ const le = 2, ue = (o) => {
|
|
|
31
32
|
"borderRight",
|
|
32
33
|
"boxSizing"
|
|
33
34
|
].reduce((a, u) => (a[u] = h[u], a), {});
|
|
34
|
-
},
|
|
35
|
+
}, de = ee.forwardRef(
|
|
35
36
|
(o, h) => {
|
|
36
37
|
const {
|
|
37
38
|
allowClear: g,
|
|
@@ -53,7 +54,7 @@ const le = 2, ue = (o) => {
|
|
|
53
54
|
maxLength: c,
|
|
54
55
|
clearIcon: W,
|
|
55
56
|
...d
|
|
56
|
-
} = o, V =
|
|
57
|
+
} = o, V = ae(d, [
|
|
57
58
|
"error",
|
|
58
59
|
"status",
|
|
59
60
|
"showWordLimit",
|
|
@@ -68,17 +69,17 @@ const le = 2, ue = (o) => {
|
|
|
68
69
|
"normalize",
|
|
69
70
|
"normalizeTrigger",
|
|
70
71
|
"autoWidth"
|
|
71
|
-
]), [N,
|
|
72
|
+
]), [N, U] = te(), P = re(), r = b(), s = b(), $ = b(null), D = p(c) ? c.errorOnly ? void 0 : c.length : c, E = (e) => {
|
|
72
73
|
let i;
|
|
73
74
|
const R = o.normalizeTrigger || ["onBlur"];
|
|
74
|
-
return
|
|
75
|
+
return Z(R) && R.indexOf(e) > -1 && _(o.normalize) && (i = o.normalize), i;
|
|
75
76
|
}, {
|
|
76
|
-
compositionValue:
|
|
77
|
+
compositionValue: A,
|
|
77
78
|
valueChangeHandler: q,
|
|
78
79
|
compositionHandler: v,
|
|
79
80
|
keyDownHandler: G,
|
|
80
81
|
triggerValueChangeCallback: B
|
|
81
|
-
} =
|
|
82
|
+
} = le({
|
|
82
83
|
value: C,
|
|
83
84
|
maxLength: D,
|
|
84
85
|
onChange: T,
|
|
@@ -101,7 +102,7 @@ const le = 2, ue = (o) => {
|
|
|
101
102
|
maxLength: D,
|
|
102
103
|
disabled: a,
|
|
103
104
|
placeholder: u,
|
|
104
|
-
value:
|
|
105
|
+
value: A || C || "",
|
|
105
106
|
className: J,
|
|
106
107
|
onKeyDown: G,
|
|
107
108
|
onChange: q,
|
|
@@ -120,7 +121,7 @@ const le = 2, ue = (o) => {
|
|
|
120
121
|
i && B(i(e.target.value), e);
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
|
-
|
|
124
|
+
oe(h, () => ({
|
|
124
125
|
dom: r.current,
|
|
125
126
|
getRootDOMNode: () => r.current,
|
|
126
127
|
focus: () => {
|
|
@@ -133,11 +134,11 @@ const le = 2, ue = (o) => {
|
|
|
133
134
|
const m = () => {
|
|
134
135
|
if (s.current && r.current) {
|
|
135
136
|
const e = s.current.offsetWidth;
|
|
136
|
-
r.current.style.width = `${e +
|
|
137
|
+
r.current.style.width = `${e + ue}px`;
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
L(() => {
|
|
140
|
-
t && ((!p(t) || !t.pure) &&
|
|
141
|
+
t && ((!p(t) || !t.pure) && U(ce(r.current)), m());
|
|
141
142
|
}, [t]);
|
|
142
143
|
const Q = x.value || u, f = (e) => {
|
|
143
144
|
r.current && r.current.focus && r.current.focus(), B("", e), M?.();
|
|
@@ -152,7 +153,7 @@ const le = 2, ue = (o) => {
|
|
|
152
153
|
$.current = e;
|
|
153
154
|
}
|
|
154
155
|
return L(() => {
|
|
155
|
-
const e =
|
|
156
|
+
const e = se([s.current], X);
|
|
156
157
|
return () => {
|
|
157
158
|
e();
|
|
158
159
|
};
|
|
@@ -174,7 +175,7 @@ const le = 2, ue = (o) => {
|
|
|
174
175
|
children: W
|
|
175
176
|
}
|
|
176
177
|
) : /* @__PURE__ */ l(
|
|
177
|
-
|
|
178
|
+
ne,
|
|
178
179
|
{
|
|
179
180
|
tabIndex: 0,
|
|
180
181
|
className: `${n}-clear-icon`,
|
|
@@ -215,13 +216,13 @@ const le = 2, ue = (o) => {
|
|
|
215
216
|
..."height" in o ? { height: S } : {}
|
|
216
217
|
},
|
|
217
218
|
ref: s,
|
|
218
|
-
children:
|
|
219
|
+
children: ie(Q)
|
|
219
220
|
}
|
|
220
221
|
)
|
|
221
222
|
] });
|
|
222
223
|
}
|
|
223
224
|
);
|
|
224
|
-
|
|
225
|
+
de.displayName = "InputComponent";
|
|
225
226
|
export {
|
|
226
|
-
|
|
227
|
+
de as default
|
|
227
228
|
};
|
package/layout/Sider.js
CHANGED
|
@@ -40,7 +40,7 @@ function ae(o, p) {
|
|
|
40
40
|
defaultValue: o.defaultCollapsed
|
|
41
41
|
}), g = v(m) ? `${m}px` : String(m), L = v(r) ? `${r}` : String(r), [d, k] = ee(
|
|
42
42
|
e ? L : g
|
|
43
|
-
), h = B(
|
|
43
|
+
), h = B(), y = B(null);
|
|
44
44
|
y.current = {
|
|
45
45
|
breakpoint: $,
|
|
46
46
|
collapsed: e,
|
package/liquid-fill/index.js
CHANGED
|
@@ -46,7 +46,7 @@ import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
|
46
46
|
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
47
47
|
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
48
48
|
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
49
|
-
import
|
|
49
|
+
import "../utils/responsiveObserve.js";
|
|
50
50
|
import "@unicom-cloud/utils/file/saveAs";
|
|
51
51
|
import "@unicom-cloud/utils/screenfull";
|
|
52
52
|
import "@unicom-cloud/utils/tinycolor";
|
|
@@ -55,6 +55,7 @@ import "@unicom-cloud/utils/constant/ui.js";
|
|
|
55
55
|
import "react-is";
|
|
56
56
|
import "@unicom-cloud/utils/tree";
|
|
57
57
|
import { isNumber as ct } from "@unicom-cloud/utils/is";
|
|
58
|
+
import { v4 as A } from "uuid";
|
|
58
59
|
import "../dist/validate/src/index.js";
|
|
59
60
|
import pt from "../config-provider/context.js";
|
|
60
61
|
const dt = {
|
|
@@ -74,7 +75,7 @@ const dt = {
|
|
|
74
75
|
decimalPlaces: 0,
|
|
75
76
|
percentFontScale: 0.5,
|
|
76
77
|
waveSpeedVariation: 0.5
|
|
77
|
-
},
|
|
78
|
+
}, xe = (E) => {
|
|
78
79
|
const { getPrefixCls: I, componentConfig: _ } = at(pt), i = I?.("liquid-fill"), H = st(
|
|
79
80
|
E,
|
|
80
81
|
dt,
|
|
@@ -255,5 +256,5 @@ const dt = {
|
|
|
255
256
|
);
|
|
256
257
|
};
|
|
257
258
|
export {
|
|
258
|
-
|
|
259
|
+
xe as default
|
|
259
260
|
};
|
package/list/Item.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import m, { useContext as L } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
4
|
import M from "../components/common/hooks/useMergeProps.js";
|
|
5
5
|
import P from "@unicom-cloud/utils/class-name";
|
|
6
|
-
import
|
|
6
|
+
import p from "./Meta.js";
|
|
7
7
|
import R from "../config-provider/context.js";
|
|
8
8
|
const j = {
|
|
9
9
|
actionLayout: "horizontal"
|
|
10
10
|
};
|
|
11
|
-
function w(
|
|
12
|
-
const { getPrefixCls:
|
|
13
|
-
|
|
11
|
+
function w(d, h) {
|
|
12
|
+
const { getPrefixCls: u, componentConfig: C } = L(R), x = M(
|
|
13
|
+
d,
|
|
14
14
|
j,
|
|
15
|
-
|
|
16
|
-
), { children: N, className: $, actions: e, extra:
|
|
17
|
-
|
|
18
|
-
t && t.type && t.type ===
|
|
15
|
+
C?.ListItem
|
|
16
|
+
), { children: N, className: $, actions: e, extra: a, actionLayout: i, ...g } = x, o = `${u?.("list")}-item`, r = [], s = [];
|
|
17
|
+
m.Children.forEach(N, (t) => {
|
|
18
|
+
t && t.type && t.type === p ? r.push(t) : s.push(t);
|
|
19
19
|
});
|
|
20
|
-
const v = s.length ? /* @__PURE__ */ n("div", { className: `${o}-content`, children: s }) : null, y =
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
const v = s.length ? /* @__PURE__ */ n("div", { className: `${o}-content`, children: s }) : null, y = a ? /* @__PURE__ */ n("div", { className: `${o}-extra-content`, children: a }) : null, c = e && e.length ? /* @__PURE__ */ n("div", { className: `${o}-action`, children: e.map((t, I) => /* @__PURE__ */ n("li", { children: t }, `${o}-action-${I}`)) }) : null;
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
24
|
role: "listitem",
|
|
25
|
-
ref:
|
|
25
|
+
ref: h,
|
|
26
26
|
className: P(o, $),
|
|
27
27
|
...g,
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
29
|
+
/* @__PURE__ */ l("div", { className: `${o}-main`, children: [
|
|
30
|
+
r,
|
|
31
31
|
v,
|
|
32
|
-
|
|
32
|
+
i === "vertical" ? c : null
|
|
33
33
|
] }),
|
|
34
|
-
|
|
34
|
+
i === "horizontal" ? c : null,
|
|
35
35
|
y
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
const z =
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const z = m.forwardRef(w), f = z;
|
|
41
|
+
f.displayName = "ListItem";
|
|
42
|
+
f.Meta = p;
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
f as default
|
|
45
45
|
};
|
package/list/index.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { jsx as c, jsxs as N, Fragment as Rt } from "react/jsx-runtime";
|
|
2
2
|
import Y, { useContext as jt, useRef as h, useState as j, useImperativeHandle as xt, useCallback as Dt, createElement as Ft } from "react";
|
|
3
|
+
import Mt from "lodash/isArray";
|
|
3
4
|
import At from "lodash/throttle";
|
|
4
5
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import Tt from "../spin/index.js";
|
|
6
|
+
import Ht from "../components/common/hooks/useMergeProps.js";
|
|
7
|
+
import Tt from "../pagination/Pagination.js";
|
|
8
|
+
import J from "../row-col/index.js";
|
|
9
|
+
import Bt from "../spin/index.js";
|
|
10
10
|
import x from "@unicom-cloud/utils/class-name";
|
|
11
|
-
import { omit as
|
|
12
|
-
import { pickDataAttributes as
|
|
13
|
-
import { scrollIntoView as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
11
|
+
import { omit as Vt } from "../components/common/utils/omit.js";
|
|
12
|
+
import { pickDataAttributes as _t } from "../components/common/utils/pick.js";
|
|
13
|
+
import { scrollIntoView as kt } from "../components/common/utils/scrollIntoViewIfNeeded.js";
|
|
14
|
+
import Gt from "../virtual-list/VirtualList.js";
|
|
15
|
+
import Ot from "./Item.js";
|
|
16
|
+
import Ut from "../config-provider/context.js";
|
|
17
|
+
import K from "../row-col/Col.js";
|
|
18
|
+
const Q = 10, X = 1, Wt = ["small", "default", "large"], Zt = {
|
|
18
19
|
split: !0,
|
|
19
20
|
bordered: !0,
|
|
20
21
|
defaultCurrent: 1,
|
|
21
22
|
offsetBottom: 0,
|
|
22
23
|
throttleDelay: 500
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
+
function qt(et, D) {
|
|
25
26
|
const {
|
|
26
27
|
getPrefixCls: rt,
|
|
27
28
|
loadingElement: ot,
|
|
28
29
|
size: F,
|
|
29
30
|
renderEmpty: nt,
|
|
30
31
|
componentConfig: lt,
|
|
31
|
-
rtl:
|
|
32
|
-
} = jt(
|
|
32
|
+
rtl: M
|
|
33
|
+
} = jt(Ut), p = Ht(
|
|
33
34
|
et,
|
|
34
|
-
|
|
35
|
+
Zt,
|
|
35
36
|
lt?.List
|
|
36
37
|
), {
|
|
37
38
|
style: st,
|
|
@@ -41,15 +42,15 @@ function Zt(et, D) {
|
|
|
41
42
|
children: L = [],
|
|
42
43
|
dataSource: g = [],
|
|
43
44
|
size: ut,
|
|
44
|
-
footer:
|
|
45
|
+
footer: A,
|
|
45
46
|
header: H,
|
|
46
47
|
pagination: r,
|
|
47
48
|
bordered: mt,
|
|
48
49
|
split: pt,
|
|
49
50
|
render: P,
|
|
50
51
|
grid: u,
|
|
51
|
-
loading:
|
|
52
|
-
hoverable:
|
|
52
|
+
loading: ft,
|
|
53
|
+
hoverable: dt,
|
|
53
54
|
scrollLoading: C,
|
|
54
55
|
paginationInFooter: T,
|
|
55
56
|
offsetBottom: gt,
|
|
@@ -59,7 +60,7 @@ function Zt(et, D) {
|
|
|
59
60
|
listRef: St,
|
|
60
61
|
onReachBottom: y,
|
|
61
62
|
onListScroll: S
|
|
62
|
-
} = p, $t = ut || (
|
|
63
|
+
} = p, $t = ut || (Wt.indexOf(F) > -1 ? F : "default"), t = rt?.("list"), I = h(null), v = h(null), f = h(null), w = h(null), z = h(!0), [Nt, Lt] = j(
|
|
63
64
|
r && typeof r == "object" && (r.pageSize || r.defaultPageSize) || Q
|
|
64
65
|
), [Pt, yt] = j(
|
|
65
66
|
r && typeof r == "object" && (r.current || r.defaultCurrent) || X
|
|
@@ -71,8 +72,8 @@ function Zt(et, D) {
|
|
|
71
72
|
v.current.scrollTo({ index: o, options: n });
|
|
72
73
|
else if (w.current) {
|
|
73
74
|
const a = w.current.children[o];
|
|
74
|
-
a &&
|
|
75
|
-
boundary:
|
|
75
|
+
a && kt(a, {
|
|
76
|
+
boundary: f.current,
|
|
76
77
|
...n
|
|
77
78
|
});
|
|
78
79
|
}
|
|
@@ -98,12 +99,12 @@ function Zt(et, D) {
|
|
|
98
99
|
const _ = !!(S || y), k = Dt(
|
|
99
100
|
At(() => {
|
|
100
101
|
if (S) {
|
|
101
|
-
S(
|
|
102
|
+
S(f.current);
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
|
-
if (!
|
|
105
|
+
if (!f.current)
|
|
105
106
|
return;
|
|
106
|
-
const { scrollTop: o, scrollHeight: n, clientHeight: a } =
|
|
107
|
+
const { scrollTop: o, scrollHeight: n, clientHeight: a } = f.current, s = n - (o + a);
|
|
107
108
|
Math.abs(s) < gt + 1 ? z.current && (It(E + 1), y?.(E + 1), z.current = !1) : z.current = !0;
|
|
108
109
|
}, B),
|
|
109
110
|
[B, E, S, y]
|
|
@@ -124,39 +125,39 @@ function Zt(et, D) {
|
|
|
124
125
|
column: Et,
|
|
125
126
|
...O
|
|
126
127
|
} = u, R = Et || Math.floor(24 / u.span), bt = O.span || Math.floor(24 / R);
|
|
127
|
-
let
|
|
128
|
-
for (;
|
|
129
|
-
const U =
|
|
128
|
+
let d = 0;
|
|
129
|
+
for (; d < l.length; ) {
|
|
130
|
+
const U = d + R, W = ~~(d / R);
|
|
130
131
|
e.push(
|
|
131
132
|
/* @__PURE__ */ c(
|
|
132
|
-
|
|
133
|
+
J,
|
|
133
134
|
{
|
|
134
135
|
className: `${t}-row`,
|
|
135
136
|
gutter: $,
|
|
136
137
|
justify: wt,
|
|
137
138
|
align: zt,
|
|
138
|
-
children: l.slice(
|
|
139
|
-
|
|
139
|
+
children: l.slice(d, U).map((Z, q) => /* @__PURE__ */ c(
|
|
140
|
+
K,
|
|
140
141
|
{
|
|
141
142
|
className: `${t}-row-col`,
|
|
142
143
|
...O,
|
|
143
144
|
span: bt,
|
|
144
|
-
children: i ? i(Z,
|
|
145
|
+
children: i ? i(Z, d + q) : Z
|
|
145
146
|
},
|
|
146
147
|
`${W}_${q}`
|
|
147
148
|
))
|
|
148
149
|
},
|
|
149
150
|
W
|
|
150
151
|
)
|
|
151
|
-
),
|
|
152
|
+
), d = U;
|
|
152
153
|
}
|
|
153
154
|
return e;
|
|
154
155
|
}
|
|
155
|
-
return /* @__PURE__ */ c(
|
|
156
|
-
|
|
156
|
+
return /* @__PURE__ */ c(J, { className: `${t}-row`, gutter: u.gutter, children: l.map((e, $) => /* @__PURE__ */ Ft(
|
|
157
|
+
K,
|
|
157
158
|
{
|
|
158
159
|
className: `${t}-row-col`,
|
|
159
|
-
...
|
|
160
|
+
...Vt(u, ["gutter"]),
|
|
160
161
|
key: $
|
|
161
162
|
},
|
|
162
163
|
i ? i(e, $) : e
|
|
@@ -164,8 +165,8 @@ function Zt(et, D) {
|
|
|
164
165
|
};
|
|
165
166
|
return g.length > 0 && P ? u ? a(g, P) : n(g, P) : V > 0 ? u ? a(L) : n(L) : C ? null : Ct || nt("List");
|
|
166
167
|
}, G = () => {
|
|
167
|
-
const o = vt(), n = b && b.threshold !== null &&
|
|
168
|
-
|
|
168
|
+
const o = vt(), n = b && b.threshold !== null && Mt(o), a = r ? /* @__PURE__ */ c(
|
|
169
|
+
Tt,
|
|
169
170
|
{
|
|
170
171
|
...m,
|
|
171
172
|
className: x(
|
|
@@ -183,14 +184,14 @@ function Zt(et, D) {
|
|
|
183
184
|
style: it,
|
|
184
185
|
className: x(
|
|
185
186
|
`${t}-wrapper`,
|
|
186
|
-
{ [`${t}-wrapper-rtl`]:
|
|
187
|
+
{ [`${t}-wrapper-rtl`]: M },
|
|
187
188
|
ct
|
|
188
189
|
),
|
|
189
190
|
children: [
|
|
190
191
|
/* @__PURE__ */ N(
|
|
191
192
|
"div",
|
|
192
193
|
{
|
|
193
|
-
...
|
|
194
|
+
..._t(p),
|
|
194
195
|
style: st,
|
|
195
196
|
className: x(
|
|
196
197
|
t,
|
|
@@ -198,23 +199,23 @@ function Zt(et, D) {
|
|
|
198
199
|
{
|
|
199
200
|
[`${t}-no-border`]: !mt,
|
|
200
201
|
[`${t}-no-split`]: !pt,
|
|
201
|
-
[`${t}-hoverable`]:
|
|
202
|
-
[`${t}-rtl`]:
|
|
202
|
+
[`${t}-hoverable`]: dt,
|
|
203
|
+
[`${t}-rtl`]: M
|
|
203
204
|
},
|
|
204
205
|
at
|
|
205
206
|
),
|
|
206
207
|
ref: (e) => {
|
|
207
|
-
n || (
|
|
208
|
+
n || (f.current = e);
|
|
208
209
|
},
|
|
209
210
|
onScroll: !n && _ ? k : void 0,
|
|
210
211
|
children: [
|
|
211
212
|
H ? /* @__PURE__ */ c("div", { className: `${t}-header`, children: H }) : null,
|
|
212
213
|
n ? /* @__PURE__ */ c(Rt, { children: /* @__PURE__ */ c(
|
|
213
|
-
|
|
214
|
+
Gt,
|
|
214
215
|
{
|
|
215
216
|
role: "list",
|
|
216
217
|
ref: (e) => {
|
|
217
|
-
e && (v.current = e,
|
|
218
|
+
e && (v.current = e, f.current = e.dom);
|
|
218
219
|
},
|
|
219
220
|
className: `${t}-content ${t}-virtual`,
|
|
220
221
|
data: l ? o.concat(l) : o,
|
|
@@ -235,8 +236,8 @@ function Zt(et, D) {
|
|
|
235
236
|
]
|
|
236
237
|
}
|
|
237
238
|
),
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
A || s ? /* @__PURE__ */ N("div", { className: `${t}-footer`, children: [
|
|
240
|
+
A,
|
|
240
241
|
s
|
|
241
242
|
] }) : null
|
|
242
243
|
]
|
|
@@ -248,21 +249,21 @@ function Zt(et, D) {
|
|
|
248
249
|
);
|
|
249
250
|
};
|
|
250
251
|
return "loading" in p ? /* @__PURE__ */ c(
|
|
251
|
-
|
|
252
|
+
Bt,
|
|
252
253
|
{
|
|
253
254
|
style: { display: "block" },
|
|
254
|
-
loading:
|
|
255
|
+
loading: ft,
|
|
255
256
|
element: ot,
|
|
256
257
|
children: G()
|
|
257
258
|
}
|
|
258
259
|
) : G();
|
|
259
260
|
}
|
|
260
261
|
const tt = Y.forwardRef(
|
|
261
|
-
|
|
262
|
+
qt
|
|
262
263
|
);
|
|
263
264
|
tt.displayName = "List";
|
|
264
|
-
tt.Item =
|
|
265
|
+
tt.Item = Ot;
|
|
265
266
|
export {
|
|
266
|
-
|
|
267
|
+
Ot as ListItem,
|
|
267
268
|
tt as default
|
|
268
269
|
};
|
package/marquee/index.js
CHANGED
|
@@ -14,7 +14,7 @@ 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
|
|
17
|
+
import mt 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,8 +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
|
|
49
|
-
import "
|
|
48
|
+
import { resizeObserver as lt } from "../components/common/utils/resizeObserver.js";
|
|
49
|
+
import "../utils/responsiveObserve.js";
|
|
50
50
|
import "@unicom-cloud/utils/file/saveAs";
|
|
51
51
|
import "@unicom-cloud/utils/screenfull";
|
|
52
52
|
import "@unicom-cloud/utils/tinycolor";
|
|
@@ -55,6 +55,7 @@ import "@unicom-cloud/utils/constant/ui.js";
|
|
|
55
55
|
import "react-is";
|
|
56
56
|
import "@unicom-cloud/utils/tree";
|
|
57
57
|
import { isPlainObject as pt } from "@unicom-cloud/utils/is";
|
|
58
|
+
import "uuid";
|
|
58
59
|
import "../dist/validate/src/index.js";
|
|
59
60
|
import ct from "../config-provider/context.js";
|
|
60
61
|
const o = {
|
|
@@ -67,7 +68,7 @@ const o = {
|
|
|
67
68
|
delay: 0.0227,
|
|
68
69
|
// 设置非 0 为了解决 onAnimationEnd={onFinish} 立即被调用的问题
|
|
69
70
|
loop: 0
|
|
70
|
-
},
|
|
71
|
+
}, Ce = it(
|
|
71
72
|
function(E, I) {
|
|
72
73
|
const { getPrefixCls: z, componentConfig: V } = ot(ct), i = z?.("marquee"), t = z?.("marquee-var"), _ = st(
|
|
73
74
|
E,
|
|
@@ -76,7 +77,7 @@ const o = {
|
|
|
76
77
|
), {
|
|
77
78
|
style: F,
|
|
78
79
|
className: D,
|
|
79
|
-
autoFill:
|
|
80
|
+
autoFill: m = o.autoFill,
|
|
80
81
|
play: c = o.play,
|
|
81
82
|
pauseOnHover: v = o.pauseOnHover,
|
|
82
83
|
pauseOnClick: M = o.pauseOnClick,
|
|
@@ -95,29 +96,29 @@ const o = {
|
|
|
95
96
|
{ size: L ? 50 : 20, color: "#fff" },
|
|
96
97
|
r
|
|
97
98
|
));
|
|
98
|
-
const [k, Q] = C(0), [$, T] = C(0), [y, U] = C(1), [N, X] = C(!1), Y = j(null),
|
|
99
|
-
if (u.current &&
|
|
100
|
-
const n =
|
|
99
|
+
const [k, Q] = C(0), [$, T] = C(0), [y, U] = C(1), [N, X] = C(!1), Y = j(null), l = I || Y, u = j(null), d = A(() => {
|
|
100
|
+
if (u.current && l.current) {
|
|
101
|
+
const n = l.current.getBoundingClientRect(), f = u.current.getBoundingClientRect();
|
|
101
102
|
let a = n.width, p = f.width;
|
|
102
103
|
(e === "up" || e === "down") && (a = n.height, p = f.height), U(
|
|
103
|
-
|
|
104
|
+
m && a && p ? Math.max(2, Math.ceil(a / p)) : 1
|
|
104
105
|
), Q(a), T(p);
|
|
105
106
|
}
|
|
106
|
-
}, [
|
|
107
|
+
}, [m, l, e]);
|
|
107
108
|
O(() => {
|
|
108
109
|
if (!N) return;
|
|
109
110
|
d();
|
|
110
|
-
const n =
|
|
111
|
-
[
|
|
111
|
+
const n = lt(
|
|
112
|
+
[l.current, u.current],
|
|
112
113
|
d
|
|
113
114
|
);
|
|
114
115
|
return () => {
|
|
115
116
|
n();
|
|
116
117
|
};
|
|
117
|
-
}, [d,
|
|
118
|
+
}, [d, l, u, N]), O(() => (d(), () => {
|
|
118
119
|
}), [d, g]), O(() => (X(!0), w && w(), () => {
|
|
119
120
|
}), [w]);
|
|
120
|
-
const P = h(() => $ ?
|
|
121
|
+
const P = h(() => $ ? m ? $ * y / q : Math.max(k, $) / q : 0, [m, k, $, y, q]), Z = h(
|
|
121
122
|
() => ({
|
|
122
123
|
...F,
|
|
123
124
|
[`--${t}-pause-on-hover`]: !c || v ? "paused" : "running",
|
|
@@ -139,9 +140,9 @@ const o = {
|
|
|
139
140
|
[`--${t}-duration`]: `${P}s`,
|
|
140
141
|
[`--${t}-delay`]: `${W}s`,
|
|
141
142
|
[`--${t}-iteration-count`]: x ? `${x}` : "infinite",
|
|
142
|
-
[`--${t}-min-width`]:
|
|
143
|
+
[`--${t}-min-width`]: m ? "auto" : "100%"
|
|
143
144
|
}),
|
|
144
|
-
[t, c, e, P, W, x,
|
|
145
|
+
[t, c, e, P, W, x, m]
|
|
145
146
|
), R = h(
|
|
146
147
|
() => ({
|
|
147
148
|
[`--${t}-transform`]: e === "up" ? "rotate(90deg)" : e === "down" ? "rotate(-90deg)" : "none"
|
|
@@ -162,9 +163,9 @@ const o = {
|
|
|
162
163
|
return N ? /* @__PURE__ */ s(rt, { children: /* @__PURE__ */ H(
|
|
163
164
|
"div",
|
|
164
165
|
{
|
|
165
|
-
ref:
|
|
166
|
+
ref: l,
|
|
166
167
|
style: Z,
|
|
167
|
-
className:
|
|
168
|
+
className: mt(i, `${i}-${e}`, D),
|
|
168
169
|
children: [
|
|
169
170
|
!!r && /* @__PURE__ */ s("div", { style: tt, className: `${i}-overlay` }),
|
|
170
171
|
/* @__PURE__ */ H(
|
|
@@ -202,5 +203,5 @@ const o = {
|
|
|
202
203
|
}
|
|
203
204
|
);
|
|
204
205
|
export {
|
|
205
|
-
|
|
206
|
+
Ce as default
|
|
206
207
|
};
|
package/marquee-/index.js
CHANGED
|
@@ -46,7 +46,7 @@ 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
48
|
import { resizeObserver as et } from "../components/common/utils/resizeObserver.js";
|
|
49
|
-
import "
|
|
49
|
+
import "../utils/responsiveObserve.js";
|
|
50
50
|
import "@unicom-cloud/utils/file/saveAs";
|
|
51
51
|
import "@unicom-cloud/utils/screenfull";
|
|
52
52
|
import "@unicom-cloud/utils/tinycolor";
|
|
@@ -55,6 +55,7 @@ import "@unicom-cloud/utils/constant/ui.js";
|
|
|
55
55
|
import "react-is";
|
|
56
56
|
import "@unicom-cloud/utils/tree";
|
|
57
57
|
import { isPlainObject as q } from "@unicom-cloud/utils/is";
|
|
58
|
+
import "uuid";
|
|
58
59
|
import "../dist/validate/src/index.js";
|
|
59
60
|
import rt from "../config-provider/context.js";
|
|
60
61
|
const ot = {
|
|
@@ -62,7 +63,7 @@ const ot = {
|
|
|
62
63
|
direction: "left",
|
|
63
64
|
pauseOnHover: !1,
|
|
64
65
|
loop: 0
|
|
65
|
-
},
|
|
66
|
+
}, pe = (R) => {
|
|
66
67
|
const { getPrefixCls: L, componentConfig: D } = V(rt), s = L?.("marquee"), E = _(
|
|
67
68
|
R,
|
|
68
69
|
ot,
|
|
@@ -256,5 +257,5 @@ const ot = {
|
|
|
256
257
|
);
|
|
257
258
|
};
|
|
258
259
|
export {
|
|
259
|
-
|
|
260
|
+
pe as default
|
|
260
261
|
};
|