@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
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import i, { isDayjs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import i, { isDayjs as p } from "dayjs";
|
|
2
|
+
import v from "dayjs/plugin/advancedFormat";
|
|
3
|
+
import j from "dayjs/plugin/customParseFormat";
|
|
4
|
+
import M from "dayjs/plugin/isBetween";
|
|
5
5
|
import k from "dayjs/plugin/quarterOfYear";
|
|
6
6
|
import A from "dayjs/plugin/timezone";
|
|
7
|
-
import
|
|
7
|
+
import H from "dayjs/plugin/utc";
|
|
8
8
|
import S from "dayjs/plugin/weekOfYear";
|
|
9
9
|
import $ from "dayjs/plugin/weekYear";
|
|
10
|
-
import
|
|
11
|
-
import m from "
|
|
12
|
-
i.extend(F);
|
|
13
|
-
i.extend(Y);
|
|
14
|
-
i.extend(S);
|
|
10
|
+
import "./is.js";
|
|
11
|
+
import { isArray as d, isUndefined as m } from "@unicom-cloud/utils/is";
|
|
15
12
|
i.extend(j);
|
|
13
|
+
i.extend(M);
|
|
14
|
+
i.extend(S);
|
|
15
|
+
i.extend(v);
|
|
16
16
|
i.extend($);
|
|
17
17
|
i.extend(k);
|
|
18
|
-
i.extend(
|
|
18
|
+
i.extend(H);
|
|
19
19
|
i.extend(A);
|
|
20
20
|
const s = i, y = {
|
|
21
21
|
add(t, e, n) {
|
|
@@ -43,9 +43,9 @@ const s = i, y = {
|
|
|
43
43
|
hour: 3,
|
|
44
44
|
minute: 4,
|
|
45
45
|
second: 5
|
|
46
|
-
},
|
|
46
|
+
}, x = {}, P = (t, e) => {
|
|
47
47
|
const n = `${t}|short`;
|
|
48
|
-
let r =
|
|
48
|
+
let r = x[n];
|
|
49
49
|
return r || (r = new Intl.DateTimeFormat("en-US", {
|
|
50
50
|
hour12: !1,
|
|
51
51
|
timeZone: t,
|
|
@@ -55,15 +55,15 @@ const s = i, y = {
|
|
|
55
55
|
hour: "2-digit",
|
|
56
56
|
minute: "2-digit",
|
|
57
57
|
second: "2-digit"
|
|
58
|
-
}),
|
|
59
|
-
},
|
|
58
|
+
}), x[n] = r), r;
|
|
59
|
+
}, b = (t, e) => {
|
|
60
60
|
const n = new Date(t);
|
|
61
|
-
return
|
|
61
|
+
return P(e).formatToParts(n);
|
|
62
62
|
}, g = (t, e) => {
|
|
63
|
-
const n =
|
|
63
|
+
const n = b(t, e), r = [];
|
|
64
64
|
for (let c = 0; c < n.length; c += 1) {
|
|
65
|
-
const { type:
|
|
66
|
-
|
|
65
|
+
const { type: O, value: F } = n[c], T = C[O];
|
|
66
|
+
T >= 0 && (r[T] = parseInt(F, 10));
|
|
67
67
|
}
|
|
68
68
|
const o = r[3], f = o === 24 ? 0 : o, u = Date.UTC(
|
|
69
69
|
r[0],
|
|
@@ -75,9 +75,9 @@ const s = i, y = {
|
|
|
75
75
|
0
|
|
76
76
|
);
|
|
77
77
|
let a = +t;
|
|
78
|
-
const
|
|
79
|
-
return a -=
|
|
80
|
-
},
|
|
78
|
+
const l = a % 1e3;
|
|
79
|
+
return a -= l, (u - a) / (60 * 1e3);
|
|
80
|
+
}, U = (t, e, n) => {
|
|
81
81
|
let r = t - e * 60 * 1e3;
|
|
82
82
|
const o = g(r, n);
|
|
83
83
|
if (e === o)
|
|
@@ -86,29 +86,29 @@ const s = i, y = {
|
|
|
86
86
|
const f = g(r, n);
|
|
87
87
|
return o === f ? [r, o] : [t - Math.min(o, f) * 60 * 1e3, Math.max(o, f)];
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function Y(t, e) {
|
|
90
90
|
const n = g(t, e);
|
|
91
|
-
return
|
|
91
|
+
return U(t, n, e)[1];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
return m(t) && !e ? s() :
|
|
93
|
+
function K(t, e) {
|
|
94
|
+
return m(t) && !e ? s() : D(s(), t, e);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function D(t, e, n, r) {
|
|
97
97
|
if (!t || m(e) && !n)
|
|
98
98
|
return t;
|
|
99
|
-
const o = -t.toDate().getTimezoneOffset(), f = m(e) ? n ?
|
|
100
|
-
return s(s(t).valueOf() +
|
|
99
|
+
const o = -t.toDate().getTimezoneOffset(), f = m(e) ? n ? Y(t.valueOf(), n) : o : e, u = Math.abs(f) <= 16 ? f * 60 : f, a = r ? o - u : u - o, l = n ? Y(s(t).valueOf() + a * 60 * 1e3, n) : f, c = a - (f - l), O = r || !m(e) ? a : c;
|
|
100
|
+
return s(s(t).valueOf() + O * 60 * 1e3);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
102
|
+
function X(t, e, n) {
|
|
103
|
+
return D(t, e, n, !0);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function _(t) {
|
|
106
106
|
const e = ["H", "h", "m", "s", "A", "a"];
|
|
107
107
|
let n = "";
|
|
108
108
|
return e.some((r) => t.indexOf(r) !== -1 ? (n = `${r}${t.split(` ${r}`)[1]}`, !0) : !1), n || "HH:mm:ss";
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
110
|
+
function I(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
111
|
+
if (p(t))
|
|
112
112
|
return s(t.valueOf());
|
|
113
113
|
if (typeof t == "string") {
|
|
114
114
|
const n = s(t, e);
|
|
@@ -116,19 +116,30 @@ function U(t, e) {
|
|
|
116
116
|
}
|
|
117
117
|
return s(t);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let o =
|
|
121
|
-
return (n !== void 0 || r) && (o =
|
|
119
|
+
function w(t, e, n, r) {
|
|
120
|
+
let o = I(t, e);
|
|
121
|
+
return (n !== void 0 || r) && (o = D(o, n, r)), o;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
function z(t, e, n, r) {
|
|
124
|
+
if (t)
|
|
125
|
+
return d(t) ? t.map((o, f, u) => {
|
|
126
|
+
if (o)
|
|
127
|
+
return w(
|
|
128
|
+
o,
|
|
129
|
+
h(e, f),
|
|
130
|
+
n,
|
|
131
|
+
r
|
|
132
|
+
);
|
|
133
|
+
}) : w(t, h(e, 0), n, r);
|
|
130
134
|
}
|
|
131
|
-
function
|
|
135
|
+
function h(t = [], e = 0) {
|
|
136
|
+
const n = d(t) ? t : [t];
|
|
137
|
+
let r = n[e];
|
|
138
|
+
for (; !r && n.length > 0 && e > 0; )
|
|
139
|
+
r = n[--e];
|
|
140
|
+
return r;
|
|
141
|
+
}
|
|
142
|
+
function V(t, e) {
|
|
132
143
|
const n = t.year(), r = t.month(), o = t.date();
|
|
133
144
|
if (e) {
|
|
134
145
|
let f = e;
|
|
@@ -136,33 +147,35 @@ function z(t, e) {
|
|
|
136
147
|
}
|
|
137
148
|
return t;
|
|
138
149
|
}
|
|
139
|
-
function
|
|
150
|
+
function tt(t) {
|
|
140
151
|
if (!d(t) || !(t[0] && t[1]) || !(t[0].valueOf() > t[1].valueOf())) return t;
|
|
141
152
|
const e = [...t];
|
|
142
153
|
return e.sort((n, r) => n.valueOf() - r.valueOf()), e;
|
|
143
154
|
}
|
|
144
|
-
function
|
|
155
|
+
function et(t, e) {
|
|
145
156
|
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || s(e).valueOf() !== s(t).valueOf();
|
|
146
157
|
}
|
|
147
|
-
function
|
|
148
|
-
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) && s(e[0]).valueOf() !== s(t[0]).valueOf() || s(e[1]).valueOf() !== s(t[1]).valueOf();
|
|
158
|
+
function nt(t, e) {
|
|
159
|
+
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) && s(e[0]).valueOf() !== s(t[0]).valueOf() || s(e?.[1]).valueOf() !== s(t?.[1]).valueOf();
|
|
149
160
|
}
|
|
150
|
-
function
|
|
151
|
-
return typeof t == "string" && s(t, e).format(
|
|
161
|
+
function rt(t, e, n) {
|
|
162
|
+
return typeof t == "string" && s(t, e).format(h(e, n ?? 0)) === t;
|
|
152
163
|
}
|
|
153
164
|
export {
|
|
154
165
|
s as dayjs,
|
|
155
166
|
s as default,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
nt as
|
|
167
|
+
I as formatValue,
|
|
168
|
+
z as getDayjsValue,
|
|
169
|
+
K as getNow,
|
|
170
|
+
w as getRealTime,
|
|
171
|
+
tt as getSortedDayjsArray,
|
|
172
|
+
_ as getTimeFormat,
|
|
173
|
+
V as getValueWithTime,
|
|
174
|
+
nt as isDayjsArrayChange,
|
|
175
|
+
et as isDayjsChange,
|
|
176
|
+
rt as isValidTimeString,
|
|
164
177
|
y as methods,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
Y as timezoneToOffset,
|
|
179
|
+
X as toLocal,
|
|
180
|
+
D as toTimezone
|
|
168
181
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isFragment as
|
|
3
|
-
|
|
1
|
+
import s from "react";
|
|
2
|
+
import { isFragment as f } from "react-is";
|
|
3
|
+
import "./is.js";
|
|
4
|
+
import { isArray as m } from "@unicom-cloud/utils/is";
|
|
5
|
+
function t(o, p = {}) {
|
|
4
6
|
const e = [];
|
|
5
|
-
return
|
|
6
|
-
r == null && !p.keepEmpty || (
|
|
7
|
+
return s.Children.forEach(o, (r) => {
|
|
8
|
+
r == null && !p.keepEmpty || (m(r) ? e.push(...t(r, p)) : f(r) && "props" in r && r.props ? e.push(...t(r.props.children, p)) : e.push(r));
|
|
7
9
|
}), e;
|
|
8
10
|
}
|
|
9
11
|
export {
|
package/copy/index.js
CHANGED
|
@@ -44,7 +44,7 @@ import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
|
44
44
|
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
45
45
|
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
46
46
|
import "../components/common/utils/reactDOM.js";
|
|
47
|
-
import "
|
|
47
|
+
import "../utils/responsiveObserve.js";
|
|
48
48
|
import "@unicom-cloud/utils/file/saveAs";
|
|
49
49
|
import "@unicom-cloud/utils/screenfull";
|
|
50
50
|
import "@unicom-cloud/utils/tinycolor";
|
|
@@ -54,6 +54,7 @@ import "lodash/isPlainObject";
|
|
|
54
54
|
import "react-is";
|
|
55
55
|
import "@unicom-cloud/utils/tree";
|
|
56
56
|
import { isFunction as v } from "@unicom-cloud/utils/is";
|
|
57
|
+
import "uuid";
|
|
57
58
|
import "../dist/validate/src/index.js";
|
|
58
59
|
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
59
60
|
import F from "../config-provider/context.js";
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsxs as _, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import a from "dayjs";
|
|
3
|
+
import { forwardRef as A, useContext as E, useRef as H, useState as M, useEffect as x } from "react";
|
|
4
|
+
import "../config-provider/ConfigProvider.js";
|
|
5
|
+
import "lodash/isEqualWith";
|
|
6
|
+
import "../components/common/utils/is.js";
|
|
7
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
8
|
+
import "lodash/isNumber";
|
|
9
|
+
import "lodash/merge";
|
|
10
|
+
import "../components/common/utils/dom.js";
|
|
11
|
+
import "../components/common/hooks/useIntersectionObserver.js";
|
|
12
|
+
import O from "../components/common/hooks/useMergeProps.js";
|
|
13
|
+
import "../components/common/utils/reactDOM.js";
|
|
14
|
+
import "@unicom-cloud/utils/constant";
|
|
15
|
+
import "lodash/debounce";
|
|
16
|
+
import { PREFIX_CLASS_STATISTIC as b } from "../statistic/interface.js";
|
|
17
|
+
import l from "@unicom-cloud/utils/class-name";
|
|
18
|
+
import { getDayjsValue as k, getNow as L } from "../components/common/utils/dayjs.js";
|
|
19
|
+
import { getDateString as X } from "./util.js";
|
|
20
|
+
import q from "../config-provider/context.js";
|
|
21
|
+
import { isFunction as y } from "@unicom-cloud/utils/is";
|
|
22
|
+
function z(N, S) {
|
|
23
|
+
const { getPrefixCls: f, componentConfig: $, rtl: u } = E(q), h = O(
|
|
24
|
+
N,
|
|
25
|
+
{
|
|
26
|
+
noStyle: !1,
|
|
27
|
+
start: !0
|
|
28
|
+
},
|
|
29
|
+
$?.Countdown
|
|
30
|
+
), {
|
|
31
|
+
style: D,
|
|
32
|
+
className: P,
|
|
33
|
+
title: c,
|
|
34
|
+
styleValue: T,
|
|
35
|
+
value: j,
|
|
36
|
+
format: p = "HH:mm:ss",
|
|
37
|
+
start: d = !0,
|
|
38
|
+
noStyle: F,
|
|
39
|
+
loop: I,
|
|
40
|
+
renderFormat: C,
|
|
41
|
+
onFinish: v
|
|
42
|
+
} = h, t = !F && f?.(b), e = f?.("countdown"), o = H(null), [w, R] = M(r()());
|
|
43
|
+
function r() {
|
|
44
|
+
const i = a().valueOf() + a(j).valueOf(), s = k(i, p) || a();
|
|
45
|
+
return () => s.diff(L());
|
|
46
|
+
}
|
|
47
|
+
function n() {
|
|
48
|
+
o.current === null || (window.clearInterval(o.current), o.current = null);
|
|
49
|
+
}
|
|
50
|
+
function V() {
|
|
51
|
+
let i = r();
|
|
52
|
+
o.current = window.setInterval(() => {
|
|
53
|
+
const s = i();
|
|
54
|
+
s <= 0 && (I ? i = r() : n(), y(v) && v()), R(s);
|
|
55
|
+
}, 1e3 / 30);
|
|
56
|
+
}
|
|
57
|
+
const g = X(Math.max(w, 0), p);
|
|
58
|
+
return x(() => (d && o.current === null && r()() > 0 ? V() : n(), () => {
|
|
59
|
+
n();
|
|
60
|
+
}), [d]), x(() => () => {
|
|
61
|
+
n();
|
|
62
|
+
}, []), /* @__PURE__ */ _(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
ref: S,
|
|
66
|
+
style: D,
|
|
67
|
+
className: l(
|
|
68
|
+
!!t && t,
|
|
69
|
+
{ [`${t}-rtl`]: !!t && u },
|
|
70
|
+
e,
|
|
71
|
+
{ [`${e}-rtl`]: u },
|
|
72
|
+
P
|
|
73
|
+
),
|
|
74
|
+
children: [
|
|
75
|
+
c && /* @__PURE__ */ m(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: l(
|
|
79
|
+
!!t && `${t}-title`,
|
|
80
|
+
`${e}-title`
|
|
81
|
+
),
|
|
82
|
+
children: c
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ m(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: l(
|
|
89
|
+
!!t && `${t}-content`,
|
|
90
|
+
`${e}-content`
|
|
91
|
+
),
|
|
92
|
+
children: /* @__PURE__ */ m(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
style: T,
|
|
96
|
+
className: l(
|
|
97
|
+
!!t && `${t}-value`,
|
|
98
|
+
`${e}-value`
|
|
99
|
+
),
|
|
100
|
+
children: y(C) ? C(w, g) : g
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
const B = A(z);
|
|
110
|
+
B.displayName = "Countdown";
|
|
111
|
+
export {
|
|
112
|
+
B as default
|
|
113
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { padStart as a } from "../components/common/utils/pad.js";
|
|
2
|
+
const p = [
|
|
3
|
+
["Y", 1e3 * 60 * 60 * 24 * 365],
|
|
4
|
+
// 年
|
|
5
|
+
["M", 1e3 * 60 * 60 * 24 * 30],
|
|
6
|
+
// 月
|
|
7
|
+
["D", 1e3 * 60 * 60 * 24],
|
|
8
|
+
// 日
|
|
9
|
+
["H", 1e3 * 60 * 60],
|
|
10
|
+
// 小时
|
|
11
|
+
["m", 1e3 * 60],
|
|
12
|
+
// 分钟
|
|
13
|
+
["s", 1e3],
|
|
14
|
+
// 秒
|
|
15
|
+
["S", 1]
|
|
16
|
+
// 毫秒
|
|
17
|
+
];
|
|
18
|
+
function f(c, g) {
|
|
19
|
+
let t = c;
|
|
20
|
+
return p.reduce((e, [r, n]) => {
|
|
21
|
+
if (!e.includes(r))
|
|
22
|
+
return e;
|
|
23
|
+
const o = Math.floor(t / n);
|
|
24
|
+
return t -= o * n, e.replace(new RegExp(`${r}+`, "g"), (i) => a(o.toString(), i.length, "0"));
|
|
25
|
+
}, g);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
f as getDateString
|
|
29
|
+
};
|
package/descriptions/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function Y(u) {
|
|
|
18
18
|
getPrefixCls: f,
|
|
19
19
|
componentConfig: h,
|
|
20
20
|
rtl: I,
|
|
21
|
-
size:
|
|
21
|
+
size: v
|
|
22
22
|
} = B(W), w = Q(
|
|
23
23
|
u,
|
|
24
24
|
X,
|
|
@@ -27,17 +27,17 @@ function Y(u) {
|
|
|
27
27
|
style: D,
|
|
28
28
|
className: L,
|
|
29
29
|
column: p,
|
|
30
|
-
title:
|
|
30
|
+
title: g,
|
|
31
31
|
data: b,
|
|
32
32
|
border: O,
|
|
33
33
|
labelStyle: $,
|
|
34
34
|
valueStyle: y,
|
|
35
35
|
colon: N,
|
|
36
36
|
layout: m,
|
|
37
|
-
size:
|
|
37
|
+
size: S,
|
|
38
38
|
tableLayout: j
|
|
39
|
-
} = w, n = f?.("descriptions"), [A, E] = G(),
|
|
40
|
-
K(() => (
|
|
39
|
+
} = w, n = f?.("descriptions"), [A, E] = G(), d = J();
|
|
40
|
+
K(() => (d.current = P.subscribe((s) => {
|
|
41
41
|
for (let t = 0; t < k.length; t++) {
|
|
42
42
|
const e = k[t];
|
|
43
43
|
if (s[e]) {
|
|
@@ -46,41 +46,41 @@ function Y(u) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}), () => {
|
|
49
|
-
P.unsubscribe(
|
|
49
|
+
d.current && P.unsubscribe(d.current);
|
|
50
50
|
}), []);
|
|
51
|
-
let
|
|
52
|
-
q(p) && (
|
|
51
|
+
let r = 3;
|
|
52
|
+
q(p) && (r = p[A] || 3), V(p) && p > 0 && (r = p);
|
|
53
53
|
const i = [];
|
|
54
|
-
if (C(b) && b.length > 0 &&
|
|
54
|
+
if (C(b) && b.length > 0 && r) {
|
|
55
55
|
b.forEach((e) => {
|
|
56
|
-
const o = i[i.length - 1],
|
|
57
|
-
|
|
56
|
+
const o = i[i.length - 1], l = z(o);
|
|
57
|
+
l === 0 ? i.push([
|
|
58
58
|
{
|
|
59
59
|
...e,
|
|
60
|
-
span: e.span ? e.span >
|
|
60
|
+
span: e.span ? e.span > r ? r : e.span : 1
|
|
61
61
|
}
|
|
62
|
-
]) :
|
|
62
|
+
]) : l === r ? i.push([
|
|
63
63
|
{
|
|
64
64
|
...e,
|
|
65
|
-
span: e.span ? e.span >
|
|
65
|
+
span: e.span ? e.span > r ? r : e.span : 1
|
|
66
66
|
}
|
|
67
67
|
]) : o.push({
|
|
68
68
|
...e,
|
|
69
|
-
span: e.span ? e.span +
|
|
69
|
+
span: e.span ? e.span + l > r ? r - l : e.span : 1
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
const s = i[i.length - 1], t = z(s);
|
|
73
|
-
t <
|
|
73
|
+
t < r && (s[s.length - 1].span = s[s.length - 1].span + r - t);
|
|
74
74
|
}
|
|
75
75
|
function F(s, t) {
|
|
76
76
|
return /* @__PURE__ */ c(x, { children: [
|
|
77
77
|
/* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
|
|
78
|
-
const
|
|
78
|
+
const l = e.span > 1 ? { colSpan: e.span } : {};
|
|
79
79
|
return /* @__PURE__ */ c(
|
|
80
80
|
"td",
|
|
81
81
|
{
|
|
82
82
|
className: `${n}-item-label`,
|
|
83
|
-
...
|
|
83
|
+
...l,
|
|
84
84
|
style: $,
|
|
85
85
|
children: [
|
|
86
86
|
e.label,
|
|
@@ -91,12 +91,12 @@ function Y(u) {
|
|
|
91
91
|
);
|
|
92
92
|
}) }),
|
|
93
93
|
/* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
|
|
94
|
-
const
|
|
94
|
+
const l = e.span > 1 ? { colSpan: e.span } : {};
|
|
95
95
|
return /* @__PURE__ */ a(
|
|
96
96
|
"td",
|
|
97
97
|
{
|
|
98
98
|
className: `${n}-item-value`,
|
|
99
|
-
...
|
|
99
|
+
...l,
|
|
100
100
|
style: y,
|
|
101
101
|
children: e.value
|
|
102
102
|
},
|
|
@@ -107,7 +107,7 @@ function Y(u) {
|
|
|
107
107
|
}
|
|
108
108
|
function H(s, t) {
|
|
109
109
|
return /* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
|
|
110
|
-
const
|
|
110
|
+
const l = e.span > 1 ? { colSpan: e.span * 2 - 1 } : {};
|
|
111
111
|
return /* @__PURE__ */ c(x, { children: [
|
|
112
112
|
/* @__PURE__ */ c("td", { className: `${n}-item-label`, style: $, children: [
|
|
113
113
|
e.label,
|
|
@@ -117,7 +117,7 @@ function Y(u) {
|
|
|
117
117
|
"td",
|
|
118
118
|
{
|
|
119
119
|
className: `${n}-item-value`,
|
|
120
|
-
...
|
|
120
|
+
...l,
|
|
121
121
|
style: y,
|
|
122
122
|
children: e.value
|
|
123
123
|
}
|
|
@@ -127,11 +127,11 @@ function Y(u) {
|
|
|
127
127
|
}
|
|
128
128
|
function M(s, t) {
|
|
129
129
|
return /* @__PURE__ */ a("tr", { className: `${n}-row`, children: s.map((e, o) => {
|
|
130
|
-
const
|
|
130
|
+
const l = e.span > 1 ? { colSpan: e.span } : {};
|
|
131
131
|
return /* @__PURE__ */ c(
|
|
132
132
|
"td",
|
|
133
133
|
{
|
|
134
|
-
...
|
|
134
|
+
...l,
|
|
135
135
|
className: `${n}-item`,
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ c(
|
|
@@ -167,14 +167,14 @@ function Y(u) {
|
|
|
167
167
|
{
|
|
168
168
|
[`${n}-border`]: O,
|
|
169
169
|
[`${n}-layout-${m}`]: m,
|
|
170
|
-
[`${n}-size-${
|
|
170
|
+
[`${n}-size-${S || v}`]: S || v,
|
|
171
171
|
[`${n}-table-layout-fixed`]: j === "fixed"
|
|
172
172
|
},
|
|
173
173
|
I ? `${n}-rtl` : `${n}-ltr`,
|
|
174
174
|
L
|
|
175
175
|
);
|
|
176
176
|
return /* @__PURE__ */ c("div", { className: T, style: D, children: [
|
|
177
|
-
|
|
177
|
+
g && /* @__PURE__ */ a("div", { className: `${n}-title`, children: g }),
|
|
178
178
|
/* @__PURE__ */ a("div", { className: `${n}-body`, children: /* @__PURE__ */ a("table", { className: `${n}-table`, cellPadding: 0, cellSpacing: 0, children: /* @__PURE__ */ a("tbody", { children: i.map((s, t) => R(s, t)) }) }) })
|
|
179
179
|
] });
|
|
180
180
|
}
|
package/dropdown/Button.js
CHANGED
package/flex/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i, useContext as x } from "react";
|
|
3
3
|
import d from "../components/common/flex/index.js";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
5
|
import "lodash/isEqualWith";
|
|
@@ -9,39 +9,40 @@ import "lodash/isNumber";
|
|
|
9
9
|
import "lodash/merge";
|
|
10
10
|
import "../components/common/utils/dom.js";
|
|
11
11
|
import "../components/common/hooks/useIntersectionObserver.js";
|
|
12
|
-
import
|
|
12
|
+
import u 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
|
|
17
|
-
import
|
|
16
|
+
import C from "@unicom-cloud/utils/class-name";
|
|
17
|
+
import F from "../config-provider/context.js";
|
|
18
18
|
const N = {
|
|
19
19
|
children: void 0
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
r
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
}, m = i((o, t) => {
|
|
21
|
+
const { getPrefixCls: r, componentConfig: e, rtl: l } = x(F), n = u(
|
|
22
|
+
o,
|
|
23
|
+
N,
|
|
24
|
+
e?.Flex
|
|
25
|
+
), { className: c, ...a } = n, f = r?.("flex");
|
|
26
|
+
return /* @__PURE__ */ s(
|
|
27
|
+
d,
|
|
28
|
+
{
|
|
29
|
+
ref: t,
|
|
30
|
+
className: C(f, c),
|
|
31
|
+
rtl: l,
|
|
32
|
+
...a
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
m.displayName = "Flex";
|
|
37
|
+
const p = i((o, t) => {
|
|
38
|
+
const { direction: r = "column", ...e } = o;
|
|
39
|
+
return /* @__PURE__ */ s(m, { ...e, ref: t, direction: r });
|
|
40
|
+
});
|
|
41
|
+
p.displayName = "FlexVertical";
|
|
42
|
+
const B = Object.assign(m, {
|
|
43
|
+
Vertical: p
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
p as FlexVertical,
|
|
46
47
|
B as default
|
|
47
48
|
};
|