@unicom-cloud/ui 0.8.101 → 0.8.103
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/Badge.js +7 -54
- package/Copy.js +6 -5
- package/LiquidFill.js +6 -5
- package/List.js +1 -1
- package/Marquee.js +6 -5
- package/QrCode.js +6 -5
- package/Tooltip.js +3 -4
- package/Tour.js +6 -5
- package/anchor/Anchor.js +12 -12
- package/anchor/util.js +10 -10
- package/back-top/index.js +7 -7
- package/badge/index.js +109 -162
- package/card/index.js +63 -43
- package/color-picker/InputHex.js +3 -4
- package/color-picker/InputRgb.js +7 -8
- package/color-picker/Palette.js +3 -4
- package/color-picker/Panel.js +3 -4
- package/color-picker/colors.js +5 -5
- package/color-picker/hooks/useColorPicker.js +3 -4
- package/color-picker/utils.js +14 -15
- package/components/common/space/index.js +24 -24
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/constant.js +6 -3
- package/components/common/utils/reactDOM.js +6 -4
- package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
- package/components/common/utils/setPrimaryColor.js +18 -18
- package/components/common/utils/setTheme.js +8 -9
- package/copy/index.js +4 -3
- package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
- package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
- package/dist/scroll-into-view-if-needed/src/index.js +19 -19
- package/form/FormItem.js +69 -65
- package/form/context.js +6 -7
- package/grid/Col-.js +86 -0
- package/grid/Col.js +156 -73
- package/grid/Grid.js +71 -67
- package/grid/Row.js +53 -44
- package/grid/index.js +13 -13
- package/index.js +639 -662
- package/input/Textarea.js +1 -1
- package/input/autoSizeTextAreaHeight.js +7 -7
- package/liquid-fill/index.js +6 -5
- package/liquid-fill/interface.js +1 -0
- package/list/index.js +1 -1
- package/marquee/index.js +141 -223
- package/marquee/interface.js +1 -0
- package/marquee-/index.js +260 -0
- package/marquee-/interface.js +1 -0
- package/menu/Item.js +9 -9
- package/package.json +1 -1
- package/qr-code/index.js +6 -5
- package/splitter/SplitBar.js +81 -79
- package/splitter/Splitter.js +70 -78
- package/splitter/hooks/useResizable.js +9 -18
- package/splitter/hooks/useResize.js +10 -10
- package/splitter/hooks/useSizes.js +28 -28
- package/statistic/index.js +10 -10
- package/style.css +1 -1
- package/table/Table.js +369 -370
- package/table/hook/useThResizable.js +6 -5
- package/table/th-resizable/index.js +13 -12
- package/time-picker/util.js +8 -8
- package/tooltip/index.js +1 -2
- package/tour/index.js +6 -5
- package/tour/interface.js +1 -0
- package/tree/NodeList.js +1 -1
- package/types/common/utils/constant.d.ts +1 -0
- package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
- package/types/common/utils/tree.d.ts +1 -0
- package/types/common/utils/tween.d.ts +1 -0
- package/types/pc/anchor/util.d.ts +1 -1
- package/types/pc/badge/interface.d.ts +2 -0
- package/types/pc/card/interface.d.ts +8 -0
- package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
- package/types/pc/color-picker/utils.d.ts +6 -1
- package/types/pc/config-provider/interface.d.ts +8 -8
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/grid/Col-.d.ts +4 -0
- package/types/pc/grid/Col.d.ts +3 -2
- package/types/pc/grid/Grid.d.ts +2 -2
- package/types/pc/grid/Item.d.ts +3 -3
- package/types/pc/grid/Row.d.ts +3 -2
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +13 -7
- package/types/pc/index.d.ts +4 -4
- package/types/pc/liquid-fill/index.d.ts +2 -113
- package/types/pc/liquid-fill/interface.d.ts +113 -0
- package/types/pc/marquee/index.d.ts +3 -60
- package/types/pc/marquee/interface.d.ts +95 -0
- package/types/pc/marquee-/index.d.ts +8 -0
- package/types/pc/marquee-/interface.d.ts +56 -0
- package/types/pc/qr-code/index.d.ts +1 -31
- package/types/pc/qr-code/interface.d.ts +26 -33
- package/types/pc/splitter/SplitBar.d.ts +0 -1
- package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
- package/types/pc/splitter/hooks/useResize.d.ts +1 -2
- package/types/pc/splitter/interface.d.ts +0 -8
- package/types/pc/tour/index.d.ts +2 -45
- package/types/pc/tour/interface.d.ts +46 -0
- package/types/pc/upload/interface.d.ts +1 -0
- package/types/pc/utils/constant.d.ts +1 -2
- package/types/pc/utils/dayjs.d.ts +2 -1
- package/types/pc/utils/index.d.ts +2 -5
- package/types/pc/utils/responsiveObserve.d.ts +8 -4
- package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
- package/types/pc/utils/tree.d.ts +2 -1
- package/types/pc/utils/tween.d.ts +1 -1
- package/typography/Ellipsis.js +6 -5
- package/typography/Operations.js +6 -5
- package/upload/request.js +12 -13
- package/upload/request_.js +2 -3
- package/utils/constant.js +5 -5
- package/utils/dayjs.js +13 -12
- package/utils/index.js +261 -284
- package/utils/responsiveObserve.js +32 -25
- package/utils/scrollIntoViewIfNeeded.js +12 -0
- package/utils/tree.js +11 -9
- package/utils/tween.js +5 -5
- package/version/index.js +1 -1
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/dist/compute-scroll-into-view/src/index.js +0 -126
- package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
- package/dist/tinycolor/customize/index.js +0 -12
- package/dist/tinycolor/src/conversion.js +0 -143
- package/dist/tinycolor/src/css-color-names.js +0 -153
- package/dist/tinycolor/src/format-input.js +0 -77
- package/dist/tinycolor/src/index.js +0 -388
- package/dist/tinycolor/src/util.js +0 -32
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/common/utils/scrollIntoView.d.ts +0 -4
- package/types/common/utils/tinycolor.d.ts +0 -1
- package/types/pc/utils/color.d.ts +0 -1
- package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/pc/utils/scrollIntoView.d.ts +0 -3
- package/types/pc/utils/tinycolor.d.ts +0 -1
- package/utils/color.js +0 -4
- package/utils/computeScrollIntoView.js +0 -6
- package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/utils/scrollIntoView.js +0 -6
- package/utils/tinycolor.js +0 -29
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { v4 as a } from "uuid";
|
|
2
|
+
const m = [
|
|
2
3
|
"xxxl",
|
|
3
4
|
"xxl",
|
|
4
5
|
"xl",
|
|
@@ -6,7 +7,7 @@ const c = [
|
|
|
6
7
|
"md",
|
|
7
8
|
"sm",
|
|
8
9
|
"xs"
|
|
9
|
-
],
|
|
10
|
+
], h = {
|
|
10
11
|
xs: "(max-width: 575px)",
|
|
11
12
|
sm: "(min-width: 576px)",
|
|
12
13
|
md: "(min-width: 768px)",
|
|
@@ -15,52 +16,58 @@ const c = [
|
|
|
15
16
|
xxl: "(min-width: 1600px)",
|
|
16
17
|
xxxl: "(min-width: 2000px)"
|
|
17
18
|
};
|
|
18
|
-
let i = [],
|
|
19
|
-
const
|
|
19
|
+
let i = [], n = {};
|
|
20
|
+
const x = {
|
|
20
21
|
matchHandlers: {},
|
|
21
22
|
dispatch(e, t) {
|
|
22
|
-
return
|
|
23
|
-
s.func(
|
|
23
|
+
return n = e, i.length < 1 ? !1 : (i.forEach((s) => {
|
|
24
|
+
s.func(n, t);
|
|
24
25
|
}), !0);
|
|
25
26
|
},
|
|
26
27
|
subscribe(e) {
|
|
27
28
|
i.length === 0 && this.register();
|
|
28
|
-
const t =
|
|
29
|
+
const t = a();
|
|
29
30
|
return i.push({
|
|
30
31
|
token: t,
|
|
31
32
|
func: e
|
|
32
|
-
}), e(
|
|
33
|
+
}), e(n, null), t;
|
|
33
34
|
},
|
|
34
35
|
unsubscribe(e) {
|
|
35
36
|
i = i.filter((t) => t.token !== e), i.length === 0 && this.unregister();
|
|
36
37
|
},
|
|
37
38
|
unregister() {
|
|
38
|
-
Object.
|
|
39
|
-
const
|
|
40
|
-
s && s.mql && s.listener && s.mql.
|
|
41
|
-
});
|
|
39
|
+
Object.entries(h).forEach(([e, t]) => {
|
|
40
|
+
const s = this.matchHandlers[t];
|
|
41
|
+
s && s.mql && s.listener && s.mql.removeEventListener("change", s.listener);
|
|
42
|
+
}), this.matchHandlers = {};
|
|
42
43
|
},
|
|
43
44
|
register() {
|
|
44
|
-
Object.
|
|
45
|
-
const
|
|
45
|
+
Object.entries(h).forEach(([e, t]) => {
|
|
46
|
+
const s = window.matchMedia(t), r = (l) => {
|
|
46
47
|
this.dispatch(
|
|
47
48
|
{
|
|
48
|
-
...
|
|
49
|
-
[e]: l
|
|
49
|
+
...n,
|
|
50
|
+
[e]: l.matches
|
|
50
51
|
},
|
|
51
52
|
e
|
|
52
53
|
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
mql:
|
|
56
|
-
listener:
|
|
57
|
-
},
|
|
54
|
+
};
|
|
55
|
+
s.addEventListener("change", r), this.matchHandlers[t] = {
|
|
56
|
+
mql: s,
|
|
57
|
+
listener: r
|
|
58
|
+
}, this.dispatch(
|
|
59
|
+
{
|
|
60
|
+
...n,
|
|
61
|
+
[e]: s.matches
|
|
62
|
+
},
|
|
63
|
+
e
|
|
64
|
+
);
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
};
|
|
61
68
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
x as default,
|
|
70
|
+
m as responsiveArray,
|
|
71
|
+
h as responsiveMap,
|
|
72
|
+
x as responsiveObserve
|
|
66
73
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { scrollIntoView as o } from "../components/common/utils/scrollIntoViewIfNeeded.js";
|
|
2
|
+
import { compute as l } from "../dist/scroll-into-view-if-needed/compute/index.js";
|
|
3
|
+
import { default as d } from "../dist/scroll-into-view-if-needed/src/index.js";
|
|
4
|
+
import { default as m, default as s } from "../dist/scroll-into-view-if-needed/smooth/index.js";
|
|
5
|
+
export {
|
|
6
|
+
l as compute,
|
|
7
|
+
o as default,
|
|
8
|
+
o as scrollIntoView,
|
|
9
|
+
d as scrollIntoViewIfNeeded,
|
|
10
|
+
m as scrollIntoViewIfNeededSmooth,
|
|
11
|
+
s as smoothScrollIntoViewIfNeeded
|
|
12
|
+
};
|
package/utils/tree.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as a, findNodeBy as r, getChildWithParentBy as y, getItemBy as B, getItemBy2 as g, getItemBy3 as m, getItemByID as d, getLabelFromDictionaryByValue as i, searchTree as l, default as o } from "@unicom-cloud/utils/tree";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
a as default,
|
|
4
|
+
r as findNodeBy,
|
|
5
|
+
y as getChildWithParentBy,
|
|
6
|
+
B as getItemBy,
|
|
7
|
+
g as getItemBy2,
|
|
8
|
+
m as getItemBy3,
|
|
9
|
+
d as getItemByID,
|
|
10
|
+
i as getLabelFromDictionaryByValue,
|
|
11
|
+
l as searchTree,
|
|
12
|
+
o as tree
|
|
11
13
|
};
|
package/utils/tween.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Tween as
|
|
2
|
-
import { default as
|
|
1
|
+
import { Tween as f, Tween as o } from "../dist/tween/src/tween.js";
|
|
2
|
+
import { default as t } from "../dist/tween/src/easing.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
o as
|
|
6
|
-
|
|
4
|
+
f as Tween,
|
|
5
|
+
o as default,
|
|
6
|
+
t as easing
|
|
7
7
|
};
|
package/version/index.js
CHANGED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
const Z = (t) => typeof t == "object" && t != null && t.nodeType === 1, _ = (t, e) => e && t === "hidden" ? !1 : t !== "visible" && t !== "clip", et = (t) => {
|
|
2
|
-
if (!t.ownerDocument || !t.ownerDocument.defaultView)
|
|
3
|
-
return null;
|
|
4
|
-
try {
|
|
5
|
-
return t.ownerDocument.defaultView.frameElement;
|
|
6
|
-
} catch {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
}, ot = (t) => {
|
|
10
|
-
const e = et(t);
|
|
11
|
-
return e ? e.clientHeight < t.scrollHeight || e.clientWidth < t.scrollWidth : !1;
|
|
12
|
-
}, D = (t, e) => {
|
|
13
|
-
if (t.clientHeight < t.scrollHeight || t.clientWidth < t.scrollWidth) {
|
|
14
|
-
const h = getComputedStyle(t, null);
|
|
15
|
-
return _(h.overflowY, e) || _(h.overflowX, e) || ot(t);
|
|
16
|
-
}
|
|
17
|
-
return !1;
|
|
18
|
-
}, L = (t, e, h, b, S, n, l, f) => n < t && l > e || n > t && l < e ? 0 : n <= t && f <= h || l >= e && f >= h ? n - t - b : l > e && f < h || n < t && f > h ? l - e + S : 0, nt = (t) => t.parentElement ?? (t.getRootNode().host || null), lt = (t) => {
|
|
19
|
-
const e = window.getComputedStyle(t);
|
|
20
|
-
return {
|
|
21
|
-
top: parseFloat(e.scrollMarginTop) || 0,
|
|
22
|
-
right: parseFloat(e.scrollMarginRight) || 0,
|
|
23
|
-
bottom: parseFloat(e.scrollMarginBottom) || 0,
|
|
24
|
-
left: parseFloat(e.scrollMarginLeft) || 0
|
|
25
|
-
};
|
|
26
|
-
}, rt = (t, e) => {
|
|
27
|
-
var h, b;
|
|
28
|
-
if (typeof document > "u")
|
|
29
|
-
return [];
|
|
30
|
-
const { scrollMode: S, block: n, inline: l, boundary: f, skipOverflowHiddenElements: $ } = e, tt = typeof f == "function" ? f : (W) => W !== f;
|
|
31
|
-
if (!Z(t))
|
|
32
|
-
throw new TypeError("Invalid target");
|
|
33
|
-
const X = document.scrollingElement || document.documentElement, H = [];
|
|
34
|
-
let s = t;
|
|
35
|
-
for (; Z(s) && tt(s); ) {
|
|
36
|
-
if (s = nt(s), s === X) {
|
|
37
|
-
H.push(s);
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
s != null && s === document.body && D(s) && !D(document.documentElement) || s != null && D(s, $) && H.push(s);
|
|
41
|
-
}
|
|
42
|
-
const a = ((h = window.visualViewport) == null ? void 0 : h.width) ?? innerWidth, u = ((b = window.visualViewport) == null ? void 0 : b.height) ?? innerHeight, { scrollX: g, scrollY: p } = window, {
|
|
43
|
-
height: m,
|
|
44
|
-
width: w,
|
|
45
|
-
top: y,
|
|
46
|
-
right: Y,
|
|
47
|
-
bottom: j,
|
|
48
|
-
left: M
|
|
49
|
-
} = t.getBoundingClientRect(), {
|
|
50
|
-
top: G,
|
|
51
|
-
right: J,
|
|
52
|
-
bottom: K,
|
|
53
|
-
left: P
|
|
54
|
-
} = lt(t);
|
|
55
|
-
let d = n === "start" || n === "nearest" ? y - G : n === "end" ? j + K : y + m / 2 - G + K, c = l === "center" ? M + w / 2 - P + J : l === "end" ? Y + J : M - P;
|
|
56
|
-
const N = [];
|
|
57
|
-
for (let W = 0; W < H.length; W++) {
|
|
58
|
-
const o = H[W], { height: v, width: E, top: x, right: O, bottom: q, left: C } = o.getBoundingClientRect();
|
|
59
|
-
if (S === "if-needed" && y >= 0 && M >= 0 && j <= u && Y <= a && // scrollingElement is added to the frames array even if it's not scrollable, in which case checking its bounds is not required
|
|
60
|
-
(o === X && !D(o) || y >= x && j <= q && M >= C && Y <= O))
|
|
61
|
-
return N;
|
|
62
|
-
const I = getComputedStyle(o), R = parseInt(I.borderLeftWidth, 10), T = parseInt(I.borderTopWidth, 10), B = parseInt(I.borderRightWidth, 10), F = parseInt(I.borderBottomWidth, 10);
|
|
63
|
-
let r = 0, i = 0;
|
|
64
|
-
const V = "offsetWidth" in o ? o.offsetWidth - o.clientWidth - R - B : 0, k = "offsetHeight" in o ? o.offsetHeight - o.clientHeight - T - F : 0, z = "offsetWidth" in o ? o.offsetWidth === 0 ? 0 : E / o.offsetWidth : 0, A = "offsetHeight" in o ? o.offsetHeight === 0 ? 0 : v / o.offsetHeight : 0;
|
|
65
|
-
if (X === o)
|
|
66
|
-
n === "start" ? r = d : n === "end" ? r = d - u : n === "nearest" ? r = L(
|
|
67
|
-
p,
|
|
68
|
-
p + u,
|
|
69
|
-
u,
|
|
70
|
-
T,
|
|
71
|
-
F,
|
|
72
|
-
p + d,
|
|
73
|
-
p + d + m,
|
|
74
|
-
m
|
|
75
|
-
) : r = d - u / 2, l === "start" ? i = c : l === "center" ? i = c - a / 2 : l === "end" ? i = c - a : i = L(
|
|
76
|
-
g,
|
|
77
|
-
g + a,
|
|
78
|
-
a,
|
|
79
|
-
R,
|
|
80
|
-
B,
|
|
81
|
-
g + c,
|
|
82
|
-
g + c + w,
|
|
83
|
-
w
|
|
84
|
-
), r = Math.max(0, r + p), i = Math.max(0, i + g);
|
|
85
|
-
else {
|
|
86
|
-
n === "start" ? r = d - x - T : n === "end" ? r = d - q + F + k : n === "nearest" ? r = L(
|
|
87
|
-
x,
|
|
88
|
-
q,
|
|
89
|
-
v,
|
|
90
|
-
T,
|
|
91
|
-
F + k,
|
|
92
|
-
d,
|
|
93
|
-
d + m,
|
|
94
|
-
m
|
|
95
|
-
) : r = d - (x + v / 2) + k / 2, l === "start" ? i = c - C - R : l === "center" ? i = c - (C + E / 2) + V / 2 : l === "end" ? i = c - O + B + V : i = L(
|
|
96
|
-
C,
|
|
97
|
-
O,
|
|
98
|
-
E,
|
|
99
|
-
R,
|
|
100
|
-
B + V,
|
|
101
|
-
c,
|
|
102
|
-
c + w,
|
|
103
|
-
w
|
|
104
|
-
);
|
|
105
|
-
const { scrollLeft: Q, scrollTop: U } = o;
|
|
106
|
-
r = A === 0 ? 0 : Math.max(
|
|
107
|
-
0,
|
|
108
|
-
Math.min(
|
|
109
|
-
U + r / A,
|
|
110
|
-
o.scrollHeight - v / A + k
|
|
111
|
-
)
|
|
112
|
-
), i = z === 0 ? 0 : Math.max(
|
|
113
|
-
0,
|
|
114
|
-
Math.min(
|
|
115
|
-
Q + i / z,
|
|
116
|
-
o.scrollWidth - E / z + V
|
|
117
|
-
)
|
|
118
|
-
), d += U - r, c += Q - i;
|
|
119
|
-
}
|
|
120
|
-
N.push({ el: o, top: r, left: i });
|
|
121
|
-
}
|
|
122
|
-
return N;
|
|
123
|
-
};
|
|
124
|
-
export {
|
|
125
|
-
rt as compute
|
|
126
|
-
};
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { TinyColor as e } from "../src/index.js";
|
|
2
|
-
const o = 10, k = {
|
|
3
|
-
name: { zh: "浪漫红", en: "red" },
|
|
4
|
-
value: "#F53F3F"
|
|
5
|
-
}, f = {
|
|
6
|
-
name: { zh: "晚秋红", en: "orangered" },
|
|
7
|
-
value: "#FF702E"
|
|
8
|
-
}, C = {
|
|
9
|
-
name: { zh: "活力橙", en: "orange" },
|
|
10
|
-
value: "#FFA500"
|
|
11
|
-
}, b = {
|
|
12
|
-
name: { zh: "黄昏", en: "gold" },
|
|
13
|
-
value: "#FFBD14"
|
|
14
|
-
}, _ = {
|
|
15
|
-
name: { zh: "柠檬黄", en: "yellow" },
|
|
16
|
-
value: "#FFE014"
|
|
17
|
-
}, j = {
|
|
18
|
-
name: { zh: "新生绿", en: "lime" },
|
|
19
|
-
value: "#A1E619"
|
|
20
|
-
}, P = {
|
|
21
|
-
name: { zh: "仙野绿", en: "green" },
|
|
22
|
-
value: "#00B82B"
|
|
23
|
-
}, T = {
|
|
24
|
-
name: { zh: "碧涛青", en: "cyan" },
|
|
25
|
-
value: "#0BD0D0"
|
|
26
|
-
}, H = {
|
|
27
|
-
name: { zh: "海蔚蓝", en: "blue" },
|
|
28
|
-
value: "#2E8FFF"
|
|
29
|
-
}, L = {
|
|
30
|
-
name: { zh: "主题色(极致蓝)", en: "primary" },
|
|
31
|
-
value: "#1A5EFF"
|
|
32
|
-
}, M = {
|
|
33
|
-
name: { zh: "暗夜紫", en: "purple" },
|
|
34
|
-
value: "#7126D9"
|
|
35
|
-
}, O = {
|
|
36
|
-
name: { zh: "青春紫", en: "pinkpurple" },
|
|
37
|
-
value: "#D91AD9"
|
|
38
|
-
}, S = {
|
|
39
|
-
name: { zh: "品红", en: "magenta" },
|
|
40
|
-
value: "#FF299F"
|
|
41
|
-
}, t = {
|
|
42
|
-
name: { zh: "中性灰", en: "gray" },
|
|
43
|
-
value: "#6B6C6D"
|
|
44
|
-
}, i = [
|
|
45
|
-
k,
|
|
46
|
-
f,
|
|
47
|
-
C,
|
|
48
|
-
b,
|
|
49
|
-
_,
|
|
50
|
-
j,
|
|
51
|
-
P,
|
|
52
|
-
T,
|
|
53
|
-
H,
|
|
54
|
-
L,
|
|
55
|
-
M,
|
|
56
|
-
O,
|
|
57
|
-
S
|
|
58
|
-
];
|
|
59
|
-
var A, B;
|
|
60
|
-
const q = {
|
|
61
|
-
key: ((A = t.name) == null ? void 0 : A.en) ?? ((B = t.name) == null ? void 0 : B.zh) ?? t.name,
|
|
62
|
-
name: t.name,
|
|
63
|
-
primary: t.value,
|
|
64
|
-
light: [
|
|
65
|
-
new e("#F7F8F9"),
|
|
66
|
-
new e("#F2F3F4"),
|
|
67
|
-
new e("#E5E6E7"),
|
|
68
|
-
new e("#C9CACB"),
|
|
69
|
-
new e("#A9ABAC"),
|
|
70
|
-
new e("#868788"),
|
|
71
|
-
new e(t.value),
|
|
72
|
-
new e("#4D4E4F"),
|
|
73
|
-
new e("#28292A"),
|
|
74
|
-
new e("#1E1F20")
|
|
75
|
-
],
|
|
76
|
-
dark: [
|
|
77
|
-
new e("#121213"),
|
|
78
|
-
new e("#1C1C1D"),
|
|
79
|
-
new e("#404142"),
|
|
80
|
-
new e("#5E5F60"),
|
|
81
|
-
new e("#797A7B"),
|
|
82
|
-
new e("#9C9E9F"),
|
|
83
|
-
new e("#BCBDBE"),
|
|
84
|
-
new e("#D8D9DB"),
|
|
85
|
-
new e("#E4E6E8"),
|
|
86
|
-
new e("#E8EBEE")
|
|
87
|
-
]
|
|
88
|
-
}, K = i.map((n, s, F) => {
|
|
89
|
-
const r = n.name, a = r?.en ?? r?.zh ?? r, u = n.value;
|
|
90
|
-
return {
|
|
91
|
-
key: a,
|
|
92
|
-
name: r,
|
|
93
|
-
primary: u,
|
|
94
|
-
light: G({ color: u, length: o }),
|
|
95
|
-
dark: N({ color: u, length: o })
|
|
96
|
-
};
|
|
97
|
-
}).concat([q]);
|
|
98
|
-
function p(n = {}) {
|
|
99
|
-
const { length: s, color: F, level: r } = n, a = (s ?? o) / 2 + 1, u = r ?? a;
|
|
100
|
-
let m = new e(F);
|
|
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
|
-
let v = l;
|
|
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
|
-
let w = c;
|
|
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
|
-
s: v,
|
|
109
|
-
v: w
|
|
110
|
-
}), n.dark && (m = m.darken(n.amount ?? 10)), m;
|
|
111
|
-
}
|
|
112
|
-
function x(n = {}) {
|
|
113
|
-
return p({ ...n, dark: !0 });
|
|
114
|
-
}
|
|
115
|
-
function G(n = {}) {
|
|
116
|
-
const { length: s } = n;
|
|
117
|
-
return Array.from(new Array(s ?? o), (F, r) => {
|
|
118
|
-
const a = r + 1;
|
|
119
|
-
return p({ ...n, level: a });
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function N(n = {}) {
|
|
123
|
-
const { length: s } = n;
|
|
124
|
-
return Array.from(new Array(s ?? o), (F, r) => {
|
|
125
|
-
const a = r + 1;
|
|
126
|
-
return x({
|
|
127
|
-
...n,
|
|
128
|
-
level: o - a + 1
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
133
|
-
__proto__: null,
|
|
134
|
-
LENGTH: o,
|
|
135
|
-
blue: H,
|
|
136
|
-
colorPresets: K,
|
|
137
|
-
colors: i,
|
|
138
|
-
cyan: T,
|
|
139
|
-
default: i,
|
|
140
|
-
generate: G,
|
|
141
|
-
generateDark: N,
|
|
142
|
-
gold: b,
|
|
143
|
-
gray: t,
|
|
144
|
-
grayPresets: q,
|
|
145
|
-
green: P,
|
|
146
|
-
lime: j,
|
|
147
|
-
magenta: S,
|
|
148
|
-
orange: C,
|
|
149
|
-
orangered: f,
|
|
150
|
-
palette: p,
|
|
151
|
-
paletteDark: x,
|
|
152
|
-
pinkpurple: O,
|
|
153
|
-
primary: L,
|
|
154
|
-
purple: M,
|
|
155
|
-
red: k,
|
|
156
|
-
yellow: _
|
|
157
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
158
|
-
export {
|
|
159
|
-
o as L,
|
|
160
|
-
Q as a,
|
|
161
|
-
H as b,
|
|
162
|
-
i as c,
|
|
163
|
-
K as d,
|
|
164
|
-
T as e,
|
|
165
|
-
N as f,
|
|
166
|
-
G as g,
|
|
167
|
-
b as h,
|
|
168
|
-
t as i,
|
|
169
|
-
q as j,
|
|
170
|
-
P as k,
|
|
171
|
-
j as l,
|
|
172
|
-
S as m,
|
|
173
|
-
f as n,
|
|
174
|
-
C as o,
|
|
175
|
-
p,
|
|
176
|
-
x as q,
|
|
177
|
-
O as r,
|
|
178
|
-
L as s,
|
|
179
|
-
M as t,
|
|
180
|
-
k as u,
|
|
181
|
-
_ as y
|
|
182
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { c as f, a as h } from "../chunk/BOzCVdr0.js";
|
|
2
|
-
function p(c = [34797, 15747172]) {
|
|
3
|
-
return (a = 1) => {
|
|
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;
|
|
5
|
-
return `rgb(${u},${i},${m})`;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
f as colors,
|
|
10
|
-
p as compareColorByRange,
|
|
11
|
-
h as uiColor
|
|
12
|
-
};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { bound01 as i, pad2 as h } from "./util.js";
|
|
2
|
-
function l(a, o, t) {
|
|
3
|
-
return {
|
|
4
|
-
r: i(a, 255) * 255,
|
|
5
|
-
g: i(o, 255) * 255,
|
|
6
|
-
b: i(t, 255) * 255
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function T(a, o, t) {
|
|
10
|
-
a = i(a, 255), o = i(o, 255), t = i(t, 255);
|
|
11
|
-
const c = Math.max(a, o, t), n = Math.min(a, o, t);
|
|
12
|
-
let r = 0, s = 0;
|
|
13
|
-
const e = (c + n) / 2;
|
|
14
|
-
if (c === n)
|
|
15
|
-
s = 0, r = 0;
|
|
16
|
-
else {
|
|
17
|
-
const u = c - n;
|
|
18
|
-
switch (s = e > 0.5 ? u / (2 - c - n) : u / (c + n), c) {
|
|
19
|
-
case a:
|
|
20
|
-
r = (o - t) / u + (o < t ? 6 : 0);
|
|
21
|
-
break;
|
|
22
|
-
case o:
|
|
23
|
-
r = (t - a) / u + 2;
|
|
24
|
-
break;
|
|
25
|
-
case t:
|
|
26
|
-
r = (a - o) / u + 4;
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
r /= 6;
|
|
30
|
-
}
|
|
31
|
-
return { h: r, s, l: e };
|
|
32
|
-
}
|
|
33
|
-
function f(a, o, t) {
|
|
34
|
-
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? a + (o - a) * (6 * t) : t < 1 / 2 ? o : t < 2 / 3 ? a + (o - a) * (2 / 3 - t) * 6 : a;
|
|
35
|
-
}
|
|
36
|
-
function S(a, o, t) {
|
|
37
|
-
let c, n, r;
|
|
38
|
-
if (a = i(a, 360), o = i(o, 100), t = i(t, 100), o === 0)
|
|
39
|
-
n = t, r = t, c = t;
|
|
40
|
-
else {
|
|
41
|
-
const s = t < 0.5 ? t * (1 + o) : t + o - t * o, e = 2 * t - s;
|
|
42
|
-
c = f(e, s, a + 1 / 3), n = f(e, s, a), r = f(e, s, a - 1 / 3);
|
|
43
|
-
}
|
|
44
|
-
return { r: c * 255, g: n * 255, b: r * 255 };
|
|
45
|
-
}
|
|
46
|
-
function k(a, o, t) {
|
|
47
|
-
a = i(a, 255), o = i(o, 255), t = i(t, 255);
|
|
48
|
-
const c = Math.max(a, o, t), n = Math.min(a, o, t);
|
|
49
|
-
let r = 0;
|
|
50
|
-
const s = c, e = c - n, u = c === 0 ? 0 : e / c;
|
|
51
|
-
if (c === n)
|
|
52
|
-
r = 0;
|
|
53
|
-
else {
|
|
54
|
-
switch (c) {
|
|
55
|
-
case a:
|
|
56
|
-
r = (o - t) / e + (o < t ? 6 : 0);
|
|
57
|
-
break;
|
|
58
|
-
case o:
|
|
59
|
-
r = (t - a) / e + 2;
|
|
60
|
-
break;
|
|
61
|
-
case t:
|
|
62
|
-
r = (a - o) / e + 4;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
r /= 6;
|
|
66
|
-
}
|
|
67
|
-
return { h: r, s: u, v: s };
|
|
68
|
-
}
|
|
69
|
-
function p(a, o, t) {
|
|
70
|
-
a = i(a, 360) * 6, o = i(o, 100), t = i(t, 100);
|
|
71
|
-
const c = Math.floor(a), n = a - c, r = t * (1 - o), s = t * (1 - n * o), e = t * (1 - (1 - n) * o), u = c % 6, g = [t, s, r, r, e, t][u], b = [e, t, t, s, r, r][u], d = [r, r, e, t, t, s][u];
|
|
72
|
-
return { r: g * 255, g: b * 255, b: d * 255 };
|
|
73
|
-
}
|
|
74
|
-
function x(a, o, t, c) {
|
|
75
|
-
const n = [
|
|
76
|
-
h(Math.round(a).toString(16)),
|
|
77
|
-
h(Math.round(o).toString(16)),
|
|
78
|
-
h(Math.round(t).toString(16))
|
|
79
|
-
];
|
|
80
|
-
return c && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
|
|
81
|
-
}
|
|
82
|
-
function H(a, o, t, c, n) {
|
|
83
|
-
const r = [
|
|
84
|
-
h(Math.round(a).toString(16)),
|
|
85
|
-
h(Math.round(o).toString(16)),
|
|
86
|
-
h(Math.round(t).toString(16)),
|
|
87
|
-
h(M(c))
|
|
88
|
-
];
|
|
89
|
-
return n && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) && r[3].startsWith(r[3].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
|
|
90
|
-
}
|
|
91
|
-
function W(a, o, t, c) {
|
|
92
|
-
return [
|
|
93
|
-
h(M(c)),
|
|
94
|
-
h(Math.round(a).toString(16)),
|
|
95
|
-
h(Math.round(o).toString(16)),
|
|
96
|
-
h(Math.round(t).toString(16))
|
|
97
|
-
].join("");
|
|
98
|
-
}
|
|
99
|
-
function j(a, o, t, c) {
|
|
100
|
-
const n = a / 100, r = o / 100, s = t / 100, e = c / 100, u = 255 * (1 - n) * (1 - e), g = 255 * (1 - r) * (1 - e), b = 255 * (1 - s) * (1 - e);
|
|
101
|
-
return { r: u, g, b };
|
|
102
|
-
}
|
|
103
|
-
function v(a, o, t) {
|
|
104
|
-
let c = 1 - a / 255, n = 1 - o / 255, r = 1 - t / 255, s = Math.min(c, n, r);
|
|
105
|
-
return s === 1 ? (c = 0, n = 0, r = 0) : (c = (c - s) / (1 - s) * 100, n = (n - s) / (1 - s) * 100, r = (r - s) / (1 - s) * 100), s *= 100, {
|
|
106
|
-
c: Math.round(c),
|
|
107
|
-
m: Math.round(n),
|
|
108
|
-
y: Math.round(r),
|
|
109
|
-
k: Math.round(s)
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function M(a) {
|
|
113
|
-
return Math.round(parseFloat(a) * 255).toString(16);
|
|
114
|
-
}
|
|
115
|
-
function R(a) {
|
|
116
|
-
return m(a) / 255;
|
|
117
|
-
}
|
|
118
|
-
function m(a) {
|
|
119
|
-
return parseInt(a, 16);
|
|
120
|
-
}
|
|
121
|
-
function $(a) {
|
|
122
|
-
return {
|
|
123
|
-
r: a >> 16,
|
|
124
|
-
g: (a & 65280) >> 8,
|
|
125
|
-
b: a & 255
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
export {
|
|
129
|
-
j as cmykToRgb,
|
|
130
|
-
M as convertDecimalToHex,
|
|
131
|
-
R as convertHexToDecimal,
|
|
132
|
-
S as hslToRgb,
|
|
133
|
-
p as hsvToRgb,
|
|
134
|
-
$ as numberInputToObject,
|
|
135
|
-
m as parseIntFromHex,
|
|
136
|
-
v as rgbToCmyk,
|
|
137
|
-
x as rgbToHex,
|
|
138
|
-
T as rgbToHsl,
|
|
139
|
-
k as rgbToHsv,
|
|
140
|
-
l as rgbToRgb,
|
|
141
|
-
W as rgbaToArgbHex,
|
|
142
|
-
H as rgbaToHex
|
|
143
|
-
};
|