@unicom-cloud/ui 0.8.106 → 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/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- 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/Modal.js +4 -2
- 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/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/avatar/Group.js +1 -1
- package/back-top/index.js +44 -56
- package/button/index.js +52 -51
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- 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 +49 -48
- 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/icons/file/index.js +13 -11
- package/components/common/space/index.js +53 -53
- package/components/common/utils/dayjs.js +114 -126
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/components/common/utils/toArray.js +7 -5
- package/config-provider/ConfigProvider.js +32 -30
- 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 +45 -45
- package/divider/index.js +28 -20
- package/dropdown/Button.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +30 -29
- package/form/FormItem.js +126 -122
- package/grid/Grid.js +56 -90
- package/grid/Item.js +44 -65
- package/grid/context.js +2 -6
- package/grid/index.js +6 -8
- package/grid/util.js +6 -44
- package/hooks/useResponsiveState.js +54 -0
- package/index.js +614 -605
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/InputElement.js +25 -24
- package/input/Search.js +24 -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/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- 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/select-view/Core.js +31 -28
- package/space/index.js +15 -13
- package/splitter/SplitBar.js +44 -46
- package/statistic/index.js +56 -55
- package/statistic/interface.js +4 -1
- package/style.css +1 -1
- package/table/Table.js +198 -210
- 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 +2 -2
- package/table/thead/index.js +18 -16
- package/time-picker/util.js +20 -30
- 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/development/interface.d.ts +3 -3
- 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/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/button/interface.d.ts +2 -2
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +17 -12
- 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/divider/interface.d.ts +1 -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 +2 -4
- package/types/pc/grid/Item.d.ts +1 -5
- package/types/pc/grid/context.d.ts +4 -15
- package/types/pc/grid/index.d.ts +4 -6
- package/types/pc/grid/interface.d.ts +14 -142
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/hooks/useResponsiveState.d.ts +3 -0
- package/types/pc/index.d.ts +10 -4
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/list/interface.d.ts +2 -1
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- 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/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- 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/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +422 -111
- 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 +245 -244
- package/utils/is.js +65 -66
- package/utils/names.js +309 -150
- 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 -38
- 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,116 +1,110 @@
|
|
|
1
|
-
import { isPlainObject as
|
|
2
|
-
import {
|
|
3
|
-
import { isDayjs as c } from "dayjs";
|
|
1
|
+
import { isArguments as x, isArray as w, isArrayBuffer as O, isArrayLike as _, isArrayLikeObject as L, isBlob as v, isBoolean as W, isBuffer as h, isColor as k, isColor2 as B, isDate as D, isElement as V, isEmpty as I, isEmptyArray as Y, isEmptyObject as q, isEmptyValue as z, isEqual as U, isEqualWith as j, isError as J, isFile as G, isFinite as H, isFunction as K, isInteger as Q, isJSON as X, isLength as Z, isMap as ee, isMatch as ie, isMatchWith as re, isNaN as te, isNative as se, isNil as oe, isNull as ae, isNumber as ne, isObject as fe, isObjectLike as pe, isPlainObject as ue, isPromise as le, isReadableByteStreamControllerSupported as ye, isReadableStream as ce, isReadableStreamDefaultControllerSupported as me, isReadableStreamSupported as Re, isReadableStreamSymbolAsyncIteratorSupported as de, isRegExp as Ee, isSafeInteger as Se, isSet as Ce, isString as $e, isSymbol as be, isTypedArray as Ne, isUndefined as Te, isValidColor as Ae, isWeakMap as Fe, isWeakSet as Me } from "@unicom-cloud/utils/is";
|
|
2
|
+
import { isDayjs as ge } from "dayjs";
|
|
4
3
|
import { isValidElement as o } from "react";
|
|
5
4
|
import a from "react-dom";
|
|
6
|
-
import { isForwardRef as n, ForwardRef as
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
9
|
-
return
|
|
5
|
+
import { isForwardRef as n, ForwardRef as s, Memo as l } from "react-is";
|
|
6
|
+
import { isContextConsumer as we, isContextProvider as Oe, isElement as _e, isForwardRef as Le, isFragment as ve, isLazy as We, isMemo as he, isPortal as ke, isProfiler as Be, isStrictMode as De, isSuspense as Ve, isValidElementType as Ie } from "react-is";
|
|
7
|
+
function b(e) {
|
|
8
|
+
return e == null;
|
|
10
9
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
10
|
+
function N(e, i) {
|
|
11
|
+
return e == null || e === !1 || typeof e == "string" && (i ? e.trim() === "" : e === "");
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
13
|
+
function T(e) {
|
|
14
|
+
return e || e === 0;
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
16
|
+
function A(e) {
|
|
17
|
+
return e === window;
|
|
19
18
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (r === s || r === u) {
|
|
30
|
-
const e = i.type;
|
|
31
|
-
return (e && e.$$typeof) === p;
|
|
19
|
+
const f = (e) => e && o(e) && typeof e.type == "function", y = (e) => f(e) && !!e.type.prototype?.isReactComponent, c = (e) => o(e) && typeof e.type == "string", F = Number(a.version?.split(".")[0]) > 17, m = Number(a.version?.split(".")[0]) > 18, R = (e) => {
|
|
20
|
+
if (!m)
|
|
21
|
+
return n(e);
|
|
22
|
+
const i = Symbol.for("react.element"), p = Symbol.for("react.transitional.element"), u = Symbol.for("react.forward_ref");
|
|
23
|
+
if (typeof e == "object" && e !== null) {
|
|
24
|
+
const r = e.$$typeof;
|
|
25
|
+
if (r === i || r === p) {
|
|
26
|
+
const t = e.type;
|
|
27
|
+
return (t && t.$$typeof) === u;
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
return !1;
|
|
35
|
-
},
|
|
31
|
+
}, d = (e) => e ? c(e) || R(e) || n(e) || e.$$typeof === s ? !0 : e.$$typeof === l ? e.type?.$$typeof === s : f(e) ? y(e) : !1 : !1, M = d;
|
|
36
32
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Di as isReactAsyncMode,
|
|
33
|
+
x as isArguments,
|
|
34
|
+
w as isArray,
|
|
35
|
+
O as isArrayBuffer,
|
|
36
|
+
_ as isArrayLike,
|
|
37
|
+
L as isArrayLikeObject,
|
|
38
|
+
v as isBlob,
|
|
39
|
+
W as isBoolean,
|
|
40
|
+
h as isBuffer,
|
|
41
|
+
y as isClassComponent,
|
|
42
|
+
k as isColor,
|
|
43
|
+
B as isColor2,
|
|
44
|
+
c as isDOMElement,
|
|
45
|
+
D as isDate,
|
|
46
|
+
ge as isDayjs,
|
|
47
|
+
V as isElement,
|
|
48
|
+
I as isEmpty,
|
|
49
|
+
Y as isEmptyArray,
|
|
50
|
+
q as isEmptyObject,
|
|
51
|
+
N as isEmptyReactNode,
|
|
52
|
+
z as isEmptyValue,
|
|
53
|
+
U as isEqual,
|
|
54
|
+
j as isEqualWith,
|
|
55
|
+
J as isError,
|
|
56
|
+
T as isExist,
|
|
57
|
+
G as isFile,
|
|
58
|
+
H as isFinite,
|
|
59
|
+
R as isForwardRefReact,
|
|
60
|
+
K as isFunction,
|
|
61
|
+
Q as isInteger,
|
|
62
|
+
X as isJSON,
|
|
63
|
+
Z as isLength,
|
|
64
|
+
ee as isMap,
|
|
65
|
+
ie as isMatch,
|
|
66
|
+
re as isMatchWith,
|
|
67
|
+
te as isNaN,
|
|
68
|
+
se as isNative,
|
|
69
|
+
oe as isNil,
|
|
70
|
+
ae as isNull,
|
|
71
|
+
b as isNullOrUndefined,
|
|
72
|
+
ne as isNumber,
|
|
73
|
+
fe as isObject,
|
|
74
|
+
pe as isObjectLike,
|
|
75
|
+
ue as isPlainObject,
|
|
76
|
+
le as isPromise,
|
|
77
|
+
F as isReact18,
|
|
78
|
+
m as isReact19,
|
|
84
79
|
f as isReactComponent,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
S as supportRef
|
|
80
|
+
we as isReactContextConsumer,
|
|
81
|
+
Oe as isReactContextProvider,
|
|
82
|
+
_e as isReactElement,
|
|
83
|
+
Le as isReactForwardRef,
|
|
84
|
+
ve as isReactFragment,
|
|
85
|
+
We as isReactLazy,
|
|
86
|
+
he as isReactMemo,
|
|
87
|
+
ke as isReactPortal,
|
|
88
|
+
Be as isReactProfiler,
|
|
89
|
+
De as isReactStrictMode,
|
|
90
|
+
Ve as isReactSuspense,
|
|
91
|
+
Ie as isReactValidElementType,
|
|
92
|
+
ye as isReadableByteStreamControllerSupported,
|
|
93
|
+
ce as isReadableStream,
|
|
94
|
+
me as isReadableStreamDefaultControllerSupported,
|
|
95
|
+
Re as isReadableStreamSupported,
|
|
96
|
+
de as isReadableStreamSymbolAsyncIteratorSupported,
|
|
97
|
+
Ee as isRegExp,
|
|
98
|
+
Se as isSafeInteger,
|
|
99
|
+
Ce as isSet,
|
|
100
|
+
$e as isString,
|
|
101
|
+
M as isSupportRef,
|
|
102
|
+
be as isSymbol,
|
|
103
|
+
Ne as isTypedArray,
|
|
104
|
+
Te as isUndefined,
|
|
105
|
+
Ae as isValidColor,
|
|
106
|
+
Fe as isWeakMap,
|
|
107
|
+
Me as isWeakSet,
|
|
108
|
+
A as isWindow,
|
|
109
|
+
d as supportRef
|
|
116
110
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UI_PC_PREFIX as i } from "@unicom-cloud/utils/constant/ui.js";
|
|
2
|
+
import s from "lodash/isPlainObject";
|
|
3
|
+
import { CSS_VARIABLE_ELEMENT as o } from "./constant.js";
|
|
4
|
+
function n(r) {
|
|
5
|
+
if (!s(r)) return;
|
|
6
|
+
const { prefix: l = i, dir: e = "ltr" } = r, t = o;
|
|
7
|
+
t.setAttribute("dir", e), t.classList.remove("ltr"), t.classList.remove("rtl"), t.classList.add(e);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
n as default,
|
|
11
|
+
n as setDir
|
|
12
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { UI_PC_PREFIX as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { UI_PC_PREFIX as $ } from "@unicom-cloud/utils/constant/ui.js";
|
|
2
|
+
import a from "@unicom-cloud/utils/tinycolor";
|
|
3
|
+
import m from "lodash/isPlainObject";
|
|
4
4
|
import { CSS_VARIABLE_ELEMENT as p } from "./constant.js";
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
const { prefix: e = f, ...i } = s, c = {
|
|
5
|
+
function b(s) {
|
|
6
|
+
if (!m(s)) return;
|
|
7
|
+
const { prefix: e = $, element: f, ...i } = s, c = {
|
|
8
8
|
primary: {
|
|
9
9
|
default: `--${e}-primary-6`,
|
|
10
10
|
hover: `--${e}-primary-5`,
|
|
@@ -36,19 +36,19 @@ function P(s) {
|
|
|
36
36
|
active: `--${e}-red-7`
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
Object.entries(c).forEach(([o, r],
|
|
39
|
+
Object.entries(c).forEach(([o, r], h, d) => {
|
|
40
40
|
c[`${o}Color`] = r;
|
|
41
41
|
const l = i[o];
|
|
42
42
|
if (!l) return;
|
|
43
|
-
const
|
|
44
|
-
t.style.setProperty(r.default,
|
|
43
|
+
const n = new a(l), t = f || p;
|
|
44
|
+
t.style.setProperty(r.default, n.toRgbArrayString());
|
|
45
45
|
const y = i[`${o}Hover`];
|
|
46
|
-
y ? t.style.setProperty(r.hover, new
|
|
46
|
+
y ? t.style.setProperty(r.hover, new a(y).toRgbArrayString()) : t.style.setProperty(r.hover, n.lighten(7).toRgbArrayString());
|
|
47
47
|
const g = i[`${o}Active`];
|
|
48
|
-
g ? t.style.setProperty(r.active, new
|
|
48
|
+
g ? t.style.setProperty(r.active, new a(g).toRgbArrayString()) : t.style.setProperty(r.active, n.lighten(-7).toRgbArrayString());
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
b as default,
|
|
53
|
+
b as setTheme
|
|
54
54
|
};
|
|
@@ -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 {
|
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import b from "@unicom-cloud/icons/context";
|
|
3
3
|
import { UI_PC_PREFIX as e } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
-
import
|
|
4
|
+
import d from "lodash/merge";
|
|
5
5
|
import { useEffect as t } from "react";
|
|
6
|
+
import { setDir as D } from "../components/common/utils/setDir.js";
|
|
6
7
|
import { setTheme as E } from "../components/common/utils/setTheme.js";
|
|
7
8
|
import G from "../components/common/hooks/useMergeProps.js";
|
|
8
9
|
import R from "../message/index.js";
|
|
9
10
|
import { setConfigProviderProps as _ } from "../modal/config.js";
|
|
10
11
|
import $ from "../notification/index.js";
|
|
11
|
-
import
|
|
12
|
+
import n, { ConfigProviderDefaultProps as j } from "./context.js";
|
|
12
13
|
const k = j;
|
|
13
|
-
let
|
|
14
|
+
let f = {};
|
|
14
15
|
const y = {};
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
function P(x) {
|
|
17
|
+
const m = G(
|
|
18
|
+
x,
|
|
18
19
|
k,
|
|
19
20
|
y
|
|
20
21
|
), {
|
|
21
|
-
theme:
|
|
22
|
+
theme: s,
|
|
22
23
|
prefixCls: o = e,
|
|
23
|
-
locale:
|
|
24
|
+
locale: p,
|
|
24
25
|
rtl: r,
|
|
25
26
|
effectGlobalNotice: c = !0,
|
|
26
|
-
effectGlobalModal:
|
|
27
|
-
} =
|
|
28
|
-
children:
|
|
29
|
-
isRootConfig:
|
|
30
|
-
keepConfig:
|
|
27
|
+
effectGlobalModal: l = !0
|
|
28
|
+
} = m, {
|
|
29
|
+
children: C,
|
|
30
|
+
isRootConfig: i,
|
|
31
|
+
keepConfig: v,
|
|
31
32
|
// 潘启宝添加
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
(
|
|
35
|
-
const h =
|
|
33
|
+
...g
|
|
34
|
+
} = m;
|
|
35
|
+
(i || v) && (f = d({}, f, g));
|
|
36
|
+
const h = d({}, f, g, {
|
|
36
37
|
getPrefixCls: I
|
|
37
38
|
});
|
|
38
39
|
function I(M, N) {
|
|
39
40
|
return `${N || o || e}-${M}`;
|
|
40
41
|
}
|
|
41
|
-
t(() => (
|
|
42
|
-
}), [
|
|
42
|
+
t(() => (i && D({ prefix: e, dir: r ? "rtl" : "ltr" }), () => {
|
|
43
|
+
}), [i, r]), t(() => (E({ prefix: e, ...s }), () => {
|
|
44
|
+
}), [s]), t(() => {
|
|
43
45
|
c && (R.config({ prefixCls: o, rtl: r }), $.config({ prefixCls: o, rtl: r }));
|
|
44
46
|
}, [o, r, c]), t(() => {
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
let
|
|
48
|
-
return o && o !== e && (
|
|
47
|
+
l && _({ locale: p, prefixCls: o, rtl: r });
|
|
48
|
+
}, [p, o, r, l]);
|
|
49
|
+
let u = C;
|
|
50
|
+
return o && o !== e && (u = /* @__PURE__ */ a(b.Provider, { value: { prefixCls: o }, children: C })), /* @__PURE__ */ a(n.Provider, { value: h, children: u });
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
52
|
+
P.ConfigContext = n;
|
|
53
|
+
P.displayName = "ConfigProvider";
|
|
54
|
+
const L = n.Consumer;
|
|
53
55
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
L as ConfigConsumer,
|
|
57
|
+
n as ConfigContext,
|
|
56
58
|
j as ConfigProviderDefaultProps,
|
|
57
|
-
|
|
59
|
+
P as default
|
|
58
60
|
};
|
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
|
+
};
|