@unicom-cloud/ui 0.8.94 → 0.8.96
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/Tooltip.js +1 -1
- package/alert/index.js +50 -49
- package/badge/index.js +11 -11
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +1 -1
- package/color-picker/colors.js +1 -1
- package/color-picker/hooks/useColorPicker.js +1 -1
- package/color-picker/utils.js +1 -1
- package/components/common/empty/index.js +33 -13
- package/components/common/hooks/useForceUpdate.js +6 -2
- package/components/common/hooks/useId.js +8 -8
- package/components/common/space/index.js +1 -1
- package/components/common/utils/setPrimaryColor.js +21 -21
- package/components/common/utils/setTheme.js +23 -23
- package/details/index.js +32 -31
- package/dist/tinycolor/chunk/{DGZSWe7E.js → BOzCVdr0.js} +43 -43
- package/dist/tinycolor/customize/index.js +1 -1
- package/hooks/index.js +50 -52
- package/index.js +674 -680
- package/package.json +1 -1
- package/rate/index.js +1 -1
- package/slider/index.js +1 -1
- package/slider/util.js +1 -1
- package/style.css +1 -1
- package/table/Table.js +145 -145
- package/tag/index.js +24 -24
- package/tooltip/index.js +1 -1
- package/types/common/utils/math.d.ts +1 -1
- package/types/pc/alert/interface.d.ts +2 -2
- package/types/pc/badge/interface.d.ts +1 -1
- package/types/pc/details/interface.d.ts +2 -2
- package/types/pc/hooks/index.d.ts +0 -1
- package/types/pc/menu/context.d.ts +1 -1
- package/types/pc/utils/math.d.ts +1 -1
- package/typography/Ellipsis.js +1 -1
- package/utils/color.js +1 -1
- package/utils/index.js +174 -178
- package/utils/math.js +7 -11
- package/utils/tinycolor.js +1 -1
- package/version/index.js +1 -1
- package/components/common/hooks/useComputedState.js +0 -11
- package/hooks/useComputedState.js +0 -4
- package/types/common/hooks/useComputedState.d.ts +0 -4
- package/types/pc/hooks/useComputedState.d.ts +0 -1
|
@@ -2,13 +2,13 @@ import { TinyColor as e } from "../src/index.js";
|
|
|
2
2
|
const o = 10, k = {
|
|
3
3
|
name: { zh: "浪漫红", en: "red" },
|
|
4
4
|
value: "#F53F3F"
|
|
5
|
-
},
|
|
5
|
+
}, f = {
|
|
6
6
|
name: { zh: "晚秋红", en: "orangered" },
|
|
7
7
|
value: "#FF702E"
|
|
8
|
-
},
|
|
8
|
+
}, C = {
|
|
9
9
|
name: { zh: "活力橙", en: "orange" },
|
|
10
10
|
value: "#FFA500"
|
|
11
|
-
},
|
|
11
|
+
}, b = {
|
|
12
12
|
name: { zh: "黄昏", en: "gold" },
|
|
13
13
|
value: "#FFBD14"
|
|
14
14
|
}, _ = {
|
|
@@ -17,25 +17,25 @@ const o = 10, k = {
|
|
|
17
17
|
}, j = {
|
|
18
18
|
name: { zh: "新生绿", en: "lime" },
|
|
19
19
|
value: "#A1E619"
|
|
20
|
-
},
|
|
20
|
+
}, P = {
|
|
21
21
|
name: { zh: "仙野绿", en: "green" },
|
|
22
22
|
value: "#00B82B"
|
|
23
|
-
},
|
|
23
|
+
}, T = {
|
|
24
24
|
name: { zh: "碧涛青", en: "cyan" },
|
|
25
25
|
value: "#0BD0D0"
|
|
26
|
-
},
|
|
26
|
+
}, H = {
|
|
27
27
|
name: { zh: "海蔚蓝", en: "blue" },
|
|
28
28
|
value: "#2E8FFF"
|
|
29
|
-
}, H = {
|
|
30
|
-
name: { zh: "极致蓝", en: "pqbblue" },
|
|
31
|
-
value: "#1A5EFF"
|
|
32
29
|
}, L = {
|
|
30
|
+
name: { zh: "主题色(极致蓝)", en: "primary" },
|
|
31
|
+
value: "#1A5EFF"
|
|
32
|
+
}, M = {
|
|
33
33
|
name: { zh: "暗夜紫", en: "purple" },
|
|
34
34
|
value: "#7126D9"
|
|
35
|
-
},
|
|
35
|
+
}, O = {
|
|
36
36
|
name: { zh: "青春紫", en: "pinkpurple" },
|
|
37
37
|
value: "#D91AD9"
|
|
38
|
-
},
|
|
38
|
+
}, S = {
|
|
39
39
|
name: { zh: "品红", en: "magenta" },
|
|
40
40
|
value: "#FF299F"
|
|
41
41
|
}, t = {
|
|
@@ -43,21 +43,21 @@ const o = 10, k = {
|
|
|
43
43
|
value: "#6B6C6D"
|
|
44
44
|
}, i = [
|
|
45
45
|
k,
|
|
46
|
-
b,
|
|
47
46
|
f,
|
|
48
47
|
C,
|
|
48
|
+
b,
|
|
49
49
|
_,
|
|
50
50
|
j,
|
|
51
|
-
q,
|
|
52
51
|
P,
|
|
53
52
|
T,
|
|
54
53
|
H,
|
|
55
54
|
L,
|
|
56
55
|
M,
|
|
57
|
-
O
|
|
56
|
+
O,
|
|
57
|
+
S
|
|
58
58
|
];
|
|
59
59
|
var A, B;
|
|
60
|
-
const
|
|
60
|
+
const q = {
|
|
61
61
|
key: ((A = t.name) == null ? void 0 : A.en) ?? ((B = t.name) == null ? void 0 : B.zh) ?? t.name,
|
|
62
62
|
name: t.name,
|
|
63
63
|
primary: t.value,
|
|
@@ -94,17 +94,17 @@ const S = {
|
|
|
94
94
|
light: G({ color: u, length: o }),
|
|
95
95
|
dark: N({ color: u, length: o })
|
|
96
96
|
};
|
|
97
|
-
}).concat([
|
|
97
|
+
}).concat([q]);
|
|
98
98
|
function p(n = {}) {
|
|
99
99
|
const { length: s, color: F, level: r } = n, a = (s ?? o) / 2 + 1, u = r ?? a;
|
|
100
100
|
let m = new e(F);
|
|
101
|
-
const g = m.toHsv(),
|
|
101
|
+
const g = m.toHsv(), y = g.h, l = g.s, c = g.v, E = y === 0 && l === 0, d = u < a, h = Math.abs(a - u), I = 1, z = 0.1;
|
|
102
102
|
let v = l;
|
|
103
|
-
v > z && (
|
|
104
|
-
const J =
|
|
103
|
+
v > z && (d ? v = l - (l - z) / (a - 1) * h : v = l + (I - l) / (a - 1) * h), E && (v = l);
|
|
104
|
+
const J = E ? 0.97 : 1, D = 0.1;
|
|
105
105
|
let w = c;
|
|
106
|
-
return w > D && (
|
|
107
|
-
h:
|
|
106
|
+
return w > D && (d ? w = c + (J - c) / (a - 1) * h : w = c - (c - D) / (a - 1) * h), m = new e({
|
|
107
|
+
h: y,
|
|
108
108
|
s: v,
|
|
109
109
|
v: w
|
|
110
110
|
}), n.dark && (m = m.darken(n.amount ?? 10)), m;
|
|
@@ -132,51 +132,51 @@ function N(n = {}) {
|
|
|
132
132
|
const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
133
133
|
__proto__: null,
|
|
134
134
|
LENGTH: o,
|
|
135
|
-
blue:
|
|
135
|
+
blue: H,
|
|
136
136
|
colorPresets: K,
|
|
137
137
|
colors: i,
|
|
138
|
-
cyan:
|
|
138
|
+
cyan: T,
|
|
139
139
|
default: i,
|
|
140
140
|
generate: G,
|
|
141
141
|
generateDark: N,
|
|
142
|
-
gold:
|
|
142
|
+
gold: b,
|
|
143
143
|
gray: t,
|
|
144
|
-
grayPresets:
|
|
145
|
-
green:
|
|
144
|
+
grayPresets: q,
|
|
145
|
+
green: P,
|
|
146
146
|
lime: j,
|
|
147
|
-
magenta:
|
|
148
|
-
orange:
|
|
149
|
-
orangered:
|
|
147
|
+
magenta: S,
|
|
148
|
+
orange: C,
|
|
149
|
+
orangered: f,
|
|
150
150
|
palette: p,
|
|
151
151
|
paletteDark: x,
|
|
152
|
-
pinkpurple:
|
|
153
|
-
|
|
154
|
-
purple:
|
|
152
|
+
pinkpurple: O,
|
|
153
|
+
primary: L,
|
|
154
|
+
purple: M,
|
|
155
155
|
red: k,
|
|
156
156
|
yellow: _
|
|
157
157
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
158
158
|
export {
|
|
159
159
|
o as L,
|
|
160
160
|
Q as a,
|
|
161
|
-
|
|
161
|
+
H as b,
|
|
162
162
|
i as c,
|
|
163
163
|
K as d,
|
|
164
|
-
|
|
164
|
+
T as e,
|
|
165
165
|
N as f,
|
|
166
166
|
G as g,
|
|
167
|
-
|
|
167
|
+
b as h,
|
|
168
168
|
t as i,
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
q as j,
|
|
170
|
+
P as k,
|
|
171
171
|
j as l,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
S as m,
|
|
173
|
+
f as n,
|
|
174
|
+
C as o,
|
|
175
175
|
p,
|
|
176
176
|
x as q,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
O as r,
|
|
178
|
+
L as s,
|
|
179
|
+
M as t,
|
|
180
180
|
k as u,
|
|
181
181
|
_ as y
|
|
182
182
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as f, a as h } from "../chunk/
|
|
1
|
+
import { c as f, a as h } from "../chunk/BOzCVdr0.js";
|
|
2
2
|
function p(c = [34797, 15747172]) {
|
|
3
3
|
return (a = 1) => {
|
|
4
4
|
const o = c, r = Math.log(256) / Math.log(2), l = o[0] >>> r * 2 & 255, s = o[0] >>> r * 1 & 255, g = o[0] >>> r * 0 & 255, t = o[1] >>> r * 2 & 255, e = o[1] >>> r * 1 & 255, n = o[1] >>> r * 0 & 255, u = t - (t - l) * a, i = e - (e - s) * a, m = n - (n - g) * a;
|
package/hooks/index.js
CHANGED
|
@@ -1,60 +1,58 @@
|
|
|
1
1
|
import { useVerificationCode as t } from "./useVerificationCode.js";
|
|
2
2
|
import { useWatermark as o } from "./useWatermark.js";
|
|
3
|
-
import { default as f } from "../components/common/hooks/
|
|
4
|
-
import { default as d } from "../components/common/hooks/
|
|
5
|
-
import { default as m } from "../components/common/hooks/
|
|
6
|
-
import { default as x } from "../components/common/hooks/
|
|
7
|
-
import { default as n } from "../components/common/hooks/
|
|
8
|
-
import { default as v } from "../components/common/hooks/
|
|
9
|
-
import { default as I } from "../components/common/hooks/useInView.js";
|
|
3
|
+
import { default as f } from "../components/common/hooks/useCreate.js";
|
|
4
|
+
import { default as d } from "../components/common/hooks/useForceUpdate.js";
|
|
5
|
+
import { default as m } from "../components/common/hooks/useId.js";
|
|
6
|
+
import { default as x } from "../components/common/hooks/useIntersectionObserver.js";
|
|
7
|
+
import { default as n } from "../components/common/hooks/useInterval.js";
|
|
8
|
+
import { default as v } from "../components/common/hooks/useInView.js";
|
|
10
9
|
import { default as b } from "../components/common/hooks/useIsFirstRender.js";
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
10
|
+
import { default as O } from "../components/common/hooks/useIsomorphicLayoutEffect.js";
|
|
11
|
+
import { default as R } from "../components/common/hooks/useKeyboardEvent.js";
|
|
12
|
+
import { default as h } from "../components/common/hooks/useListenResize.js";
|
|
13
|
+
import { default as W } from "../components/common/hooks/useMedia.js";
|
|
14
|
+
import { default as z } from "../components/common/hooks/useMergeProps.js";
|
|
15
|
+
import { default as M } from "../components/common/hooks/useMergeValue.js";
|
|
16
|
+
import { default as g } from "../components/common/hooks/useOnlineStatus.js";
|
|
17
|
+
import { default as F } from "../components/common/hooks/useOverflowHidden.js";
|
|
18
|
+
import { default as U } from "../components/common/hooks/useOverrideRef.js";
|
|
19
|
+
import { default as H } from "../components/common/hooks/usePersistCallback.js";
|
|
20
|
+
import { default as j } from "../components/common/hooks/usePrefersColorSchemeDark.js";
|
|
21
|
+
import { default as A } from "../components/common/hooks/usePrevious.js";
|
|
22
|
+
import { default as G } from "../components/common/hooks/useRefs.js";
|
|
23
|
+
import { default as N } from "../components/common/hooks/useResizeObserver.js";
|
|
24
|
+
import { default as T } from "../components/common/hooks/useStateCallback.js";
|
|
25
|
+
import { default as Y } from "../components/common/hooks/useStateWithPromise.js";
|
|
26
|
+
import { default as _ } from "../components/common/hooks/useUpdateEffect.js";
|
|
27
|
+
import { default as ee } from "../components/common/hooks/useWatch.js";
|
|
28
|
+
import { default as te } from "../components/common/hooks/useWindowSize.js";
|
|
30
29
|
export {
|
|
31
|
-
f as
|
|
32
|
-
d as
|
|
33
|
-
m as
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
n as
|
|
37
|
-
v as useInterval,
|
|
30
|
+
f as useCreate,
|
|
31
|
+
d as useForceUpdate,
|
|
32
|
+
m as useId,
|
|
33
|
+
v as useInView,
|
|
34
|
+
x as useIntersectionObserver,
|
|
35
|
+
n as useInterval,
|
|
38
36
|
b as useIsFirstRender,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
O as useIsomorphicLayoutEffect,
|
|
38
|
+
R as useKeyboardEvent,
|
|
39
|
+
h as useListenResize,
|
|
40
|
+
W as useMedia,
|
|
41
|
+
z as useMergeProps,
|
|
42
|
+
M as useMergeValue,
|
|
43
|
+
g as useOnlineStatus,
|
|
44
|
+
F as useOverflowHidden,
|
|
45
|
+
U as useOverrideRef,
|
|
46
|
+
H as usePersistCallback,
|
|
47
|
+
j as usePrefersColorSchemeDark,
|
|
48
|
+
A as usePrevious,
|
|
49
|
+
G as useRefs,
|
|
50
|
+
N as useResizeObserver,
|
|
51
|
+
T as useStateCallback,
|
|
52
|
+
Y as useStateWithPromise,
|
|
53
|
+
_ as useUpdateEffect,
|
|
56
54
|
t as useVerificationCode,
|
|
57
|
-
|
|
55
|
+
ee as useWatch,
|
|
58
56
|
o as useWatermark,
|
|
59
|
-
|
|
57
|
+
te as useWindowSize
|
|
60
58
|
};
|