@unicom-cloud/ui 0.8.105 → 0.8.107
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/Modal.js +4 -2
- package/Segmented.js +4 -2
- 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/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- 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/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- 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/segmented/index.js +93 -90
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- 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/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- 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/segmented/interface.d.ts +6 -0
- 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/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
|
@@ -1,76 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import i, { isDayjs as w } from "dayjs";
|
|
2
|
+
import j from "dayjs/plugin/advancedFormat";
|
|
3
|
+
import F from "dayjs/plugin/customParseFormat";
|
|
4
|
+
import Y from "dayjs/plugin/isBetween";
|
|
5
|
+
import k from "dayjs/plugin/quarterOfYear";
|
|
6
|
+
import A from "dayjs/plugin/timezone";
|
|
7
|
+
import M from "dayjs/plugin/utc";
|
|
8
|
+
import S from "dayjs/plugin/weekOfYear";
|
|
9
|
+
import $ from "dayjs/plugin/weekYear";
|
|
10
10
|
import d from "lodash/isArray";
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
const r = e.prototype, s = r.$utils;
|
|
23
|
-
r.$utils = function() {
|
|
24
|
-
const o = s();
|
|
25
|
-
return o.i = l, o;
|
|
26
|
-
}, n.isDayjs = l;
|
|
27
|
-
};
|
|
28
|
-
a.extend(C);
|
|
29
|
-
a.extend(b);
|
|
30
|
-
a.extend(v);
|
|
31
|
-
a.extend(W);
|
|
32
|
-
a.extend($);
|
|
33
|
-
a.extend(U);
|
|
34
|
-
a.extend(F);
|
|
35
|
-
a.extend(A);
|
|
36
|
-
a.extend(Y);
|
|
37
|
-
const f = a;
|
|
38
|
-
function T(t, e) {
|
|
39
|
-
const n = (t.day() - e + 7) % 7;
|
|
40
|
-
return t.clone().startOf("day").subtract(n, "day").valueOf();
|
|
41
|
-
}
|
|
42
|
-
function H(t, e, n) {
|
|
43
|
-
return T(t, n) === T(e, n);
|
|
44
|
-
}
|
|
45
|
-
const h = {
|
|
11
|
+
import m from "lodash/isUndefined";
|
|
12
|
+
i.extend(F);
|
|
13
|
+
i.extend(Y);
|
|
14
|
+
i.extend(S);
|
|
15
|
+
i.extend(j);
|
|
16
|
+
i.extend($);
|
|
17
|
+
i.extend(k);
|
|
18
|
+
i.extend(M);
|
|
19
|
+
i.extend(A);
|
|
20
|
+
const s = i, y = {
|
|
46
21
|
add(t, e, n) {
|
|
47
|
-
return
|
|
22
|
+
return t.add(e, n);
|
|
48
23
|
},
|
|
49
24
|
subtract(t, e, n) {
|
|
50
|
-
return
|
|
25
|
+
return t.subtract(e, n);
|
|
51
26
|
},
|
|
52
27
|
startOf(t, e) {
|
|
53
|
-
return
|
|
28
|
+
return t.startOf(e);
|
|
54
29
|
},
|
|
55
30
|
endOf(t, e) {
|
|
56
|
-
return
|
|
31
|
+
return t.endOf(e);
|
|
57
32
|
},
|
|
58
33
|
set(t, e, n) {
|
|
59
|
-
return
|
|
34
|
+
return t.set(e, n);
|
|
60
35
|
},
|
|
61
36
|
isSameWeek(t, e, n, r) {
|
|
62
|
-
return
|
|
37
|
+
return t.locale({ ...s.Ls[r], weekStart: n }).isSame(e, "week");
|
|
63
38
|
}
|
|
64
|
-
},
|
|
39
|
+
}, C = {
|
|
65
40
|
year: 0,
|
|
66
41
|
month: 1,
|
|
67
42
|
day: 2,
|
|
68
43
|
hour: 3,
|
|
69
44
|
minute: 4,
|
|
70
45
|
second: 5
|
|
71
|
-
},
|
|
46
|
+
}, D = {}, H = (t, e) => {
|
|
72
47
|
const n = `${t}|short`;
|
|
73
|
-
let r =
|
|
48
|
+
let r = D[n];
|
|
74
49
|
return r || (r = new Intl.DateTimeFormat("en-US", {
|
|
75
50
|
hour12: !1,
|
|
76
51
|
timeZone: t,
|
|
@@ -80,114 +55,114 @@ const h = {
|
|
|
80
55
|
hour: "2-digit",
|
|
81
56
|
minute: "2-digit",
|
|
82
57
|
second: "2-digit"
|
|
83
|
-
}),
|
|
84
|
-
},
|
|
58
|
+
}), D[n] = r), r;
|
|
59
|
+
}, P = (t, e) => {
|
|
85
60
|
const n = new Date(t);
|
|
86
|
-
return
|
|
87
|
-
},
|
|
88
|
-
const n =
|
|
89
|
-
for (let
|
|
90
|
-
const { type:
|
|
91
|
-
|
|
61
|
+
return H(e).formatToParts(n);
|
|
62
|
+
}, g = (t, e) => {
|
|
63
|
+
const n = P(t, e), r = [];
|
|
64
|
+
for (let c = 0; c < n.length; c += 1) {
|
|
65
|
+
const { type: l, value: v } = n[c], x = C[l];
|
|
66
|
+
x >= 0 && (r[x] = parseInt(v, 10));
|
|
92
67
|
}
|
|
93
|
-
const
|
|
68
|
+
const o = r[3], f = o === 24 ? 0 : o, u = Date.UTC(
|
|
94
69
|
r[0],
|
|
95
70
|
r[1] - 1,
|
|
96
71
|
r[2],
|
|
97
|
-
|
|
72
|
+
f,
|
|
98
73
|
r[4],
|
|
99
74
|
r[5],
|
|
100
75
|
0
|
|
101
76
|
);
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
},
|
|
77
|
+
let a = +t;
|
|
78
|
+
const O = a % 1e3;
|
|
79
|
+
return a -= O, (u - a) / (60 * 1e3);
|
|
80
|
+
}, b = (t, e, n) => {
|
|
106
81
|
let r = t - e * 60 * 1e3;
|
|
107
|
-
const
|
|
108
|
-
if (e ===
|
|
82
|
+
const o = g(r, n);
|
|
83
|
+
if (e === o)
|
|
109
84
|
return [r, e];
|
|
110
|
-
r -= (
|
|
111
|
-
const
|
|
112
|
-
return
|
|
85
|
+
r -= (o - e) * 60 * 1e3;
|
|
86
|
+
const f = g(r, n);
|
|
87
|
+
return o === f ? [r, o] : [t - Math.min(o, f) * 60 * 1e3, Math.max(o, f)];
|
|
113
88
|
};
|
|
114
|
-
function
|
|
115
|
-
const n =
|
|
116
|
-
return
|
|
89
|
+
function T(t, e) {
|
|
90
|
+
const n = g(t, e);
|
|
91
|
+
return b(t, n, e)[1];
|
|
117
92
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
93
|
+
function E(t, e) {
|
|
94
|
+
return m(t) && !e ? s() : h(s(), t, e);
|
|
120
95
|
}
|
|
121
|
-
function
|
|
122
|
-
if (!t ||
|
|
96
|
+
function h(t, e, n, r) {
|
|
97
|
+
if (!t || m(e) && !n)
|
|
123
98
|
return t;
|
|
124
|
-
const
|
|
125
|
-
return
|
|
99
|
+
const o = -t.toDate().getTimezoneOffset(), f = m(e) ? n ? T(t.valueOf(), n) : o : e, u = Math.abs(f) <= 16 ? f * 60 : f, a = r ? o - u : u - o, O = n ? T(s(t).valueOf() + a * 60 * 1e3, n) : f, c = a - (f - O), l = r || !m(e) ? a : c;
|
|
100
|
+
return s(s(t).valueOf() + l * 60 * 1e3);
|
|
126
101
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
102
|
+
function J(t, e, n) {
|
|
103
|
+
return h(t, e, n, !0);
|
|
129
104
|
}
|
|
130
|
-
function
|
|
105
|
+
function K(t) {
|
|
131
106
|
const e = ["H", "h", "m", "s", "A", "a"];
|
|
132
107
|
let n = "";
|
|
133
108
|
return e.some((r) => t.indexOf(r) !== -1 ? (n = `${r}${t.split(` ${r}`)[1]}`, !0) : !1), n || "HH:mm:ss";
|
|
134
109
|
}
|
|
135
|
-
function
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
110
|
+
function U(t, e) {
|
|
111
|
+
if (w(t))
|
|
112
|
+
return s(t.valueOf());
|
|
138
113
|
if (typeof t == "string") {
|
|
139
|
-
const n =
|
|
140
|
-
return n.isValid() ? n :
|
|
114
|
+
const n = s(t, e);
|
|
115
|
+
return n.isValid() ? n : s(t, "YYYY-MM-DD");
|
|
141
116
|
}
|
|
142
|
-
return
|
|
117
|
+
return s(t);
|
|
143
118
|
}
|
|
144
|
-
function
|
|
145
|
-
let
|
|
146
|
-
return (n !== void 0 || r) && (
|
|
119
|
+
function p(t, e, n, r) {
|
|
120
|
+
let o = U(t, e);
|
|
121
|
+
return (n !== void 0 || r) && (o = h(o, n, r)), o;
|
|
147
122
|
}
|
|
148
|
-
function
|
|
123
|
+
function X(t, e, n, r) {
|
|
149
124
|
if (!t) return;
|
|
150
|
-
const
|
|
151
|
-
return d(t) ? t.map((
|
|
152
|
-
if (
|
|
153
|
-
return
|
|
154
|
-
}) :
|
|
125
|
+
const o = d(e) ? e : [e];
|
|
126
|
+
return d(t) ? t.map((f, u, a) => {
|
|
127
|
+
if (f)
|
|
128
|
+
return p(f, o[u], n, r);
|
|
129
|
+
}) : p(t, o[0], n, r);
|
|
155
130
|
}
|
|
156
|
-
function
|
|
157
|
-
const n = t.year(), r = t.month(),
|
|
131
|
+
function z(t, e) {
|
|
132
|
+
const n = t.year(), r = t.month(), o = t.date();
|
|
158
133
|
if (e) {
|
|
159
|
-
let
|
|
160
|
-
return
|
|
134
|
+
let f = e;
|
|
135
|
+
return f = y.set(f, "year", n), f = y.set(f, "month", r), f = y.set(f, "date", o), f;
|
|
161
136
|
}
|
|
162
137
|
return t;
|
|
163
138
|
}
|
|
164
|
-
function
|
|
139
|
+
function V(t) {
|
|
165
140
|
if (!d(t) || !(t[0] && t[1]) || !(t[0].valueOf() > t[1].valueOf())) return t;
|
|
166
141
|
const e = [...t];
|
|
167
142
|
return e.sort((n, r) => n.valueOf() - r.valueOf()), e;
|
|
168
143
|
}
|
|
169
|
-
function
|
|
170
|
-
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t ||
|
|
144
|
+
function tt(t, e) {
|
|
145
|
+
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || s(e).valueOf() !== s(t).valueOf();
|
|
171
146
|
}
|
|
172
|
-
function
|
|
173
|
-
return e === void 0 && t === void 0 ? !1 : e && !t || !e && t || d(e) && d(t) &&
|
|
147
|
+
function et(t, e) {
|
|
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();
|
|
174
149
|
}
|
|
175
|
-
function
|
|
176
|
-
return typeof t == "string" &&
|
|
150
|
+
function nt(t, e, n) {
|
|
151
|
+
return typeof t == "string" && s(t, e).format(d(e) ? e[n] : e) === t;
|
|
177
152
|
}
|
|
178
153
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
154
|
+
s as dayjs,
|
|
155
|
+
s as default,
|
|
156
|
+
X as getDayjsValue,
|
|
157
|
+
E as getNow,
|
|
158
|
+
V as getSortedDayjsArray,
|
|
159
|
+
K as getTimeFormat,
|
|
160
|
+
z as getValueWithTime,
|
|
161
|
+
et as isDayjsArrayChange,
|
|
162
|
+
tt as isDayjsChange,
|
|
163
|
+
nt as isValidTimeString,
|
|
164
|
+
y as methods,
|
|
165
|
+
T as timezoneToOffset,
|
|
166
|
+
J as toLocal,
|
|
167
|
+
h as toTimezone
|
|
193
168
|
};
|
|
@@ -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
|
};
|