@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
package/Tooltip.js
CHANGED
package/alert/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import P from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
3
|
+
import R from "@unicom-cloud/icons/IconUiClose";
|
|
4
|
+
import T from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
5
|
+
import _ from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
6
|
+
import f from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
7
7
|
import { forwardRef as g, useRef as q, useContext as z, useState as H } from "react";
|
|
8
8
|
import "../config-provider/ConfigProvider.js";
|
|
9
9
|
import M from "../components/common/hooks/useMergeProps.js";
|
|
@@ -12,81 +12,82 @@ import { PqbCSSTransition as V } from "../components/common/utils/PqbCSSTransiti
|
|
|
12
12
|
import B from "../config-provider/context.js";
|
|
13
13
|
const D = {
|
|
14
14
|
showIcon: !0,
|
|
15
|
-
type: "
|
|
15
|
+
type: "default"
|
|
16
16
|
};
|
|
17
|
-
function G(
|
|
17
|
+
function G(u, r) {
|
|
18
18
|
r || (r = q());
|
|
19
|
-
const { getPrefixCls: t, componentConfig:
|
|
20
|
-
|
|
19
|
+
const { getPrefixCls: t, componentConfig: l, rtl: N } = z(B), c = M(
|
|
20
|
+
u,
|
|
21
21
|
D,
|
|
22
|
-
|
|
22
|
+
l == null ? void 0 : l.Alert
|
|
23
23
|
), {
|
|
24
|
-
style:
|
|
25
|
-
className:
|
|
24
|
+
style: b,
|
|
25
|
+
className: h,
|
|
26
26
|
action: a,
|
|
27
|
-
type: m
|
|
28
|
-
title:
|
|
27
|
+
type: m,
|
|
28
|
+
title: n,
|
|
29
29
|
content: p,
|
|
30
|
-
icon:
|
|
31
|
-
showIcon:
|
|
32
|
-
closable:
|
|
33
|
-
closeable:
|
|
34
|
-
afterClose:
|
|
35
|
-
onClose:
|
|
36
|
-
closeElement:
|
|
37
|
-
banner:
|
|
38
|
-
...
|
|
39
|
-
} = c, o = t == null ? void 0 : t("alert"), [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
icon: $,
|
|
31
|
+
showIcon: C,
|
|
32
|
+
closable: I,
|
|
33
|
+
closeable: x,
|
|
34
|
+
afterClose: i,
|
|
35
|
+
onClose: s,
|
|
36
|
+
closeElement: v,
|
|
37
|
+
banner: w,
|
|
38
|
+
...y
|
|
39
|
+
} = c, o = t == null ? void 0 : t("alert"), [U, A] = H(!0), E = $ || {
|
|
40
|
+
default: /* @__PURE__ */ e(f, {}),
|
|
41
|
+
info: /* @__PURE__ */ e(f, {}),
|
|
42
|
+
success: /* @__PURE__ */ e(P, {}),
|
|
43
|
+
warning: /* @__PURE__ */ e(_, {}),
|
|
44
|
+
error: /* @__PURE__ */ e(T, {})
|
|
44
45
|
}[m];
|
|
45
|
-
function
|
|
46
|
-
|
|
46
|
+
function F(k) {
|
|
47
|
+
A(!1), s == null || s(k);
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
+
const S = O(
|
|
49
50
|
o,
|
|
50
51
|
`${o}-${m}`,
|
|
51
52
|
{
|
|
52
|
-
[`${o}-with-title`]:
|
|
53
|
-
[`${o}-banner`]:
|
|
54
|
-
[`${o}-rtl`]:
|
|
53
|
+
[`${o}-with-title`]: n,
|
|
54
|
+
[`${o}-banner`]: w,
|
|
55
|
+
[`${o}-rtl`]: N
|
|
55
56
|
},
|
|
56
|
-
|
|
57
|
-
),
|
|
57
|
+
h
|
|
58
|
+
), j = "closeable" in c ? x : I;
|
|
58
59
|
return /* @__PURE__ */ e(
|
|
59
60
|
V,
|
|
60
61
|
{
|
|
61
|
-
in:
|
|
62
|
+
in: U,
|
|
62
63
|
timeout: 300,
|
|
63
64
|
classNames: "zoomInTop",
|
|
64
65
|
unmountOnExit: !0,
|
|
65
66
|
onExited: () => {
|
|
66
|
-
|
|
67
|
+
i == null || i();
|
|
67
68
|
},
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ d(
|
|
69
70
|
"div",
|
|
70
71
|
{
|
|
71
72
|
ref: r,
|
|
72
|
-
style:
|
|
73
|
-
className:
|
|
73
|
+
style: b,
|
|
74
|
+
className: S,
|
|
74
75
|
role: "alert",
|
|
75
|
-
...
|
|
76
|
+
...y,
|
|
76
77
|
children: [
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
78
|
+
C && /* @__PURE__ */ e("div", { className: `${o}-icon-wrapper`, children: E }),
|
|
79
|
+
/* @__PURE__ */ d("div", { className: `${o}-content-wrapper`, children: [
|
|
80
|
+
n && /* @__PURE__ */ e("div", { className: `${o}-title`, children: n }),
|
|
80
81
|
p && /* @__PURE__ */ e("div", { className: `${o}-content`, children: p })
|
|
81
82
|
] }),
|
|
82
83
|
a && /* @__PURE__ */ e("div", { className: `${o}-action`, children: a }),
|
|
83
|
-
|
|
84
|
+
j && /* @__PURE__ */ e(
|
|
84
85
|
"button",
|
|
85
86
|
{
|
|
86
87
|
type: "button",
|
|
87
|
-
onClick:
|
|
88
|
+
onClick: F,
|
|
88
89
|
className: `${o}-close-btn`,
|
|
89
|
-
children:
|
|
90
|
+
children: v || /* @__PURE__ */ e(R, {})
|
|
90
91
|
}
|
|
91
92
|
)
|
|
92
93
|
]
|
package/badge/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as x, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import R from "lodash/isPlainObject";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as G, useContext as _ } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import { PqbCSSTransition as
|
|
5
|
+
import k from "../components/common/hooks/useMergeProps.js";
|
|
6
|
+
import { PqbCSSTransition as q } from "../components/common/utils/PqbCSSTransition.js";
|
|
7
7
|
import a from "@unicom-cloud/utils/class-name";
|
|
8
8
|
import y from "./Count.js";
|
|
9
9
|
import z from "../config-provider/context.js";
|
|
@@ -15,7 +15,7 @@ const N = [
|
|
|
15
15
|
"lime",
|
|
16
16
|
"green",
|
|
17
17
|
"cyan",
|
|
18
|
-
"
|
|
18
|
+
"primary",
|
|
19
19
|
"purple",
|
|
20
20
|
"magenta",
|
|
21
21
|
"gray"
|
|
@@ -23,9 +23,9 @@ const N = [
|
|
|
23
23
|
count: 0,
|
|
24
24
|
maxCount: 99
|
|
25
25
|
};
|
|
26
|
-
function L(
|
|
27
|
-
const { getPrefixCls: c, componentConfig: i, rtl:
|
|
28
|
-
|
|
26
|
+
function L(h, S) {
|
|
27
|
+
const { getPrefixCls: c, componentConfig: i, rtl: b } = _(z), O = k(
|
|
28
|
+
h,
|
|
29
29
|
I,
|
|
30
30
|
i == null ? void 0 : i.Badge
|
|
31
31
|
), {
|
|
@@ -83,7 +83,7 @@ function L(b, h) {
|
|
|
83
83
|
),
|
|
84
84
|
!!m && /* @__PURE__ */ s("span", { className: `${t}-status-text`, children: m })
|
|
85
85
|
] }) : (d || e) && typeof o == "number" && o > 0 ? /* @__PURE__ */ s(
|
|
86
|
-
|
|
86
|
+
q,
|
|
87
87
|
{
|
|
88
88
|
classNames: "badge-zoom",
|
|
89
89
|
in: d || !!e,
|
|
@@ -124,11 +124,11 @@ function L(b, h) {
|
|
|
124
124
|
{
|
|
125
125
|
[`${t}-status`]: l,
|
|
126
126
|
[`${t}-no-children`]: !f,
|
|
127
|
-
[`${t}-rtl`]:
|
|
127
|
+
[`${t}-rtl`]: b
|
|
128
128
|
},
|
|
129
129
|
B
|
|
130
130
|
),
|
|
131
|
-
ref:
|
|
131
|
+
ref: S,
|
|
132
132
|
style: P,
|
|
133
133
|
...j,
|
|
134
134
|
children: [
|
|
@@ -138,7 +138,7 @@ function L(b, h) {
|
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
|
-
const C =
|
|
141
|
+
const C = G(L);
|
|
142
142
|
C.displayName = "Badge";
|
|
143
143
|
C.Count = y;
|
|
144
144
|
const W = N, X = ["default", "processing", "success", "warning", "error"];
|
package/color-picker/InputHex.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as v, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import "../dist/tinycolor/chunk/
|
|
2
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
3
3
|
import { TinyColor as u } from "../dist/tinycolor/src/index.js";
|
|
4
4
|
import { useContext as I, useState as j, useEffect as D } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
package/color-picker/InputRgb.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import "../dist/tinycolor/chunk/
|
|
2
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
3
3
|
import { TinyColor as f } from "../dist/tinycolor/src/index.js";
|
|
4
4
|
import { useContext as x } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
package/color-picker/Palette.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import "../dist/tinycolor/chunk/
|
|
2
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
3
3
|
import { TinyColor as d } from "../dist/tinycolor/src/index.js";
|
|
4
4
|
import { useContext as h, useMemo as C } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
package/color-picker/Panel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../dist/tinycolor/chunk/
|
|
2
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
3
3
|
import { TinyColor as m } from "../dist/tinycolor/src/index.js";
|
|
4
4
|
import { useContext as ar, useState as lr, useMemo as sr } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
package/color-picker/colors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../dist/tinycolor/chunk/
|
|
1
|
+
import "../../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
2
2
|
import { TinyColor as F } from "../../dist/tinycolor/src/index.js";
|
|
3
3
|
import { useState as v, useRef as q, useMemo as M, useCallback as E, useEffect as y } from "react";
|
|
4
4
|
import w from "../../components/common/hooks/useIsFirstRender.js";
|
package/color-picker/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../dist/tinycolor/chunk/
|
|
1
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
2
2
|
import { TinyColor as s } from "../dist/tinycolor/src/index.js";
|
|
3
3
|
const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Object.keys(t).reduce(
|
|
4
4
|
(e, o) => ({
|
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as N, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import $ from "@unicom-cloud/icons/IconUiEmpty";
|
|
3
3
|
import { UI_COMMON_PREFIX as y } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
-
import { memo as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { memo as g, forwardRef as x } from "react";
|
|
5
|
+
import { SpaceVertical as u } from "../space/index.js";
|
|
6
|
+
import s from "@unicom-cloud/utils/class-name";
|
|
7
|
+
function C(c, n) {
|
|
8
|
+
const { style: a, className: p, description: m, icon: o, imgSrc: r, prefixCls: l, ...f } = c, e = `${y}-empty`, i = l ?? e, d = typeof m == "string" ? m : "empty";
|
|
9
|
+
return /* @__PURE__ */ N(
|
|
10
|
+
u,
|
|
11
|
+
{
|
|
12
|
+
ref: n,
|
|
13
|
+
className: s(e, i, p),
|
|
14
|
+
style: a,
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
gap: 5,
|
|
18
|
+
...f,
|
|
19
|
+
children: [
|
|
20
|
+
r ? /* @__PURE__ */ t(
|
|
21
|
+
"img",
|
|
22
|
+
{
|
|
23
|
+
className: s(`${e}-img`, `${i}-img`),
|
|
24
|
+
alt: d,
|
|
25
|
+
src: r
|
|
26
|
+
}
|
|
27
|
+
) : o ? /* @__PURE__ */ t("div", { className: s(`${e}-icon`, `${i}-icon`), children: o }) : /* @__PURE__ */ t($, { className: s(`${e}-icon`, `${i}-icon`) }),
|
|
28
|
+
/* @__PURE__ */ t("div", { className: s(`${e}-description`, `${i}-description`), children: m || "无数据" })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
12
32
|
}
|
|
13
|
-
const
|
|
14
|
-
|
|
33
|
+
const E = g(x(C));
|
|
34
|
+
E.displayName = "Empty";
|
|
15
35
|
export {
|
|
16
|
-
|
|
36
|
+
E as default
|
|
17
37
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const [
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
}, []), typeof
|
|
1
|
+
import { useState as d, useEffect as n } from "react";
|
|
2
|
+
const o = {};
|
|
3
|
+
function e(t) {
|
|
4
|
+
const [u, s] = d();
|
|
5
|
+
return n(() => {
|
|
6
|
+
o[t] ?? (o[t] = 0), s(o[t]), o[t] += 1;
|
|
7
|
+
}, []), typeof u == "number" ? `${t}${u}` : void 0;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
e as default
|
|
11
11
|
};
|
|
@@ -3,7 +3,7 @@ import { UI_COMMON_PREFIX as C } from "@unicom-cloud/utils/constant/ui";
|
|
|
3
3
|
import { forwardRef as c } from "react";
|
|
4
4
|
import "@unicom-cloud/utils/case-name";
|
|
5
5
|
import _ from "@unicom-cloud/utils/class-name";
|
|
6
|
-
import "../../../dist/tinycolor/chunk/
|
|
6
|
+
import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
7
7
|
import "@unicom-cloud/utils/clipboard-copy";
|
|
8
8
|
import "../utils/dayjs.js";
|
|
9
9
|
import "../utils/dom.js";
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { TinyColor as
|
|
3
|
-
import { UI_PC_PREFIX as
|
|
4
|
-
import { CSS_VARIABLE_ELEMENT as
|
|
5
|
-
function
|
|
1
|
+
import { a as o } from "../../../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
2
|
+
import { TinyColor as y } from "../../../dist/tinycolor/src/index.js";
|
|
3
|
+
import { UI_PC_PREFIX as c } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import { CSS_VARIABLE_ELEMENT as E } from "./constant.js";
|
|
5
|
+
function v(l) {
|
|
6
6
|
const {
|
|
7
|
-
color:
|
|
8
|
-
element:
|
|
7
|
+
color: e,
|
|
8
|
+
element: a = E,
|
|
9
9
|
isDark: f = !1,
|
|
10
|
-
prefix:
|
|
11
|
-
} =
|
|
12
|
-
color:
|
|
13
|
-
},
|
|
14
|
-
new
|
|
15
|
-
|
|
16
|
-
`--${
|
|
17
|
-
|
|
10
|
+
prefix: t = c
|
|
11
|
+
} = l ?? {}, i = {
|
|
12
|
+
color: e
|
|
13
|
+
}, m = f ? o.generateDark(i) : o.generate(i);
|
|
14
|
+
new y(e).equals(o.primary.value) ? n() : m.forEach((s, r, p) => {
|
|
15
|
+
a.style.setProperty(
|
|
16
|
+
`--${t}-primary-${r + 1}`,
|
|
17
|
+
s.toRgbArrayString()
|
|
18
18
|
);
|
|
19
19
|
});
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function n() {
|
|
21
|
+
m.forEach((s, r, p) => {
|
|
22
|
+
a.style.removeProperty(`--${t}-primary-${r + 1}`);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return n;
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
v as default,
|
|
29
|
+
v as setPrimaryColor
|
|
30
30
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { UI_PC_PREFIX as f } from "@unicom-cloud/utils/constant/ui.js";
|
|
2
2
|
import p from "lodash/isPlainObject";
|
|
3
3
|
import { CSS_VARIABLE_ELEMENT as $ } from "./constant.js";
|
|
4
|
-
import "../../../dist/tinycolor/chunk/
|
|
5
|
-
import { TinyColor as
|
|
6
|
-
function
|
|
7
|
-
if (!p(
|
|
8
|
-
const { prefix: e = f, ...
|
|
4
|
+
import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
5
|
+
import { TinyColor as n } from "../../../dist/tinycolor/src/index.js";
|
|
6
|
+
function b(s) {
|
|
7
|
+
if (!p(s)) return;
|
|
8
|
+
const { prefix: e = f, ...i } = s, c = {
|
|
9
9
|
primary: {
|
|
10
|
-
default: `--${e}-
|
|
11
|
-
hover: `--${e}-
|
|
12
|
-
active: `--${e}-
|
|
10
|
+
default: `--${e}-primary-6`,
|
|
11
|
+
hover: `--${e}-primary-5`,
|
|
12
|
+
active: `--${e}-primary-7`
|
|
13
13
|
},
|
|
14
14
|
success: {
|
|
15
15
|
default: `--${e}-green-6`,
|
|
@@ -17,9 +17,9 @@ function P(l) {
|
|
|
17
17
|
active: `--${e}-green-7`
|
|
18
18
|
},
|
|
19
19
|
info: {
|
|
20
|
-
default: `--${e}-
|
|
21
|
-
hover: `--${e}-
|
|
22
|
-
active: `--${e}-
|
|
20
|
+
default: `--${e}-primary-6`,
|
|
21
|
+
hover: `--${e}-primary-5`,
|
|
22
|
+
active: `--${e}-primary-7`
|
|
23
23
|
},
|
|
24
24
|
// warning: {
|
|
25
25
|
// default: `--${prefix}-orangered-6`,
|
|
@@ -37,19 +37,19 @@ function P(l) {
|
|
|
37
37
|
active: `--${e}-red-7`
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
Object.entries(
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
t.style.setProperty(r.default,
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
40
|
+
Object.entries(c).forEach(([o, r], m, h) => {
|
|
41
|
+
c[`${o}Color`] = r;
|
|
42
|
+
const l = i[o];
|
|
43
|
+
if (!l) return;
|
|
44
|
+
const a = new n(l), t = $;
|
|
45
|
+
t.style.setProperty(r.default, a.toRgbArrayString());
|
|
46
|
+
const y = i[`${o}Hover`];
|
|
47
|
+
y ? t.style.setProperty(r.hover, new n(y).toRgbArrayString()) : t.style.setProperty(r.hover, a.lighten(10).toRgbArrayString());
|
|
48
|
+
const g = i[`${o}Active`];
|
|
49
|
+
g ? t.style.setProperty(r.active, new n(g).toRgbArrayString()) : t.style.setProperty(r.active, a.lighten(-10).toRgbArrayString());
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
b as default,
|
|
54
|
+
b as setTheme
|
|
55
55
|
};
|
package/details/index.js
CHANGED
|
@@ -1,71 +1,72 @@
|
|
|
1
1
|
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import b from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
3
|
+
import j from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
4
|
+
import S from "@unicom-cloud/icons/IconUiDown";
|
|
5
|
+
import k from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
6
|
+
import d from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
7
7
|
import { forwardRef as E, useContext as M, useState as P } from "react";
|
|
8
8
|
import "../config-provider/ConfigProvider.js";
|
|
9
9
|
import R from "../components/common/hooks/useMergeProps.js";
|
|
10
|
-
import
|
|
10
|
+
import u from "@unicom-cloud/utils/class-name";
|
|
11
11
|
import T from "../config-provider/context.js";
|
|
12
12
|
const _ = {
|
|
13
|
-
type: "
|
|
13
|
+
type: "default"
|
|
14
14
|
};
|
|
15
15
|
function q(N, $) {
|
|
16
|
-
const { getPrefixCls: t, componentConfig: s, rtl:
|
|
16
|
+
const { getPrefixCls: t, componentConfig: s, rtl: C } = M(T), h = R(
|
|
17
17
|
N,
|
|
18
18
|
_,
|
|
19
19
|
s == null ? void 0 : s.Details
|
|
20
20
|
), {
|
|
21
|
-
style:
|
|
22
|
-
className:
|
|
23
|
-
type: r
|
|
21
|
+
style: x,
|
|
22
|
+
className: y,
|
|
23
|
+
type: r,
|
|
24
24
|
title: i,
|
|
25
25
|
content: n,
|
|
26
|
-
icon:
|
|
27
|
-
banner:
|
|
28
|
-
...
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
icon: I,
|
|
27
|
+
banner: g,
|
|
28
|
+
...w
|
|
29
|
+
} = h, e = t == null ? void 0 : t("details"), [D, U] = P({}), l = I || {
|
|
30
|
+
default: /* @__PURE__ */ o(d, {}),
|
|
31
|
+
info: /* @__PURE__ */ o(d, {}),
|
|
32
|
+
success: /* @__PURE__ */ o(b, {}),
|
|
33
|
+
warning: /* @__PURE__ */ o(k, {}),
|
|
34
|
+
error: /* @__PURE__ */ o(j, {})
|
|
35
|
+
}[r], v = u(
|
|
35
36
|
e,
|
|
36
37
|
`${e}-${r}`,
|
|
37
38
|
{
|
|
38
|
-
[`${e}-banner`]:
|
|
39
|
-
[`${e}-rtl`]:
|
|
39
|
+
[`${e}-banner`]: g,
|
|
40
|
+
[`${e}-rtl`]: C
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
+
y
|
|
42
43
|
);
|
|
43
44
|
return /* @__PURE__ */ f(
|
|
44
45
|
"details",
|
|
45
46
|
{
|
|
46
47
|
ref: $,
|
|
47
|
-
style:
|
|
48
|
-
className:
|
|
48
|
+
style: x,
|
|
49
|
+
className: v,
|
|
49
50
|
role: "details",
|
|
50
51
|
onToggle: (a) => {
|
|
51
52
|
var c;
|
|
52
|
-
(c = a.target) != null && c.open,
|
|
53
|
+
(c = a.target) != null && c.open, U((F) => {
|
|
53
54
|
var p;
|
|
54
|
-
const m = { ...
|
|
55
|
+
const m = { ...F };
|
|
55
56
|
return m.open = (p = a.target) == null ? void 0 : p.open, m;
|
|
56
57
|
});
|
|
57
58
|
},
|
|
58
|
-
...
|
|
59
|
+
...w,
|
|
59
60
|
children: [
|
|
60
61
|
/* @__PURE__ */ f("summary", { className: `${e}-summary-wrapper`, children: [
|
|
61
62
|
l && /* @__PURE__ */ o("div", { className: `${e}-icon`, children: l }),
|
|
62
63
|
i && /* @__PURE__ */ o("div", { className: `${e}-title`, children: i }),
|
|
63
64
|
/* @__PURE__ */ o(
|
|
64
|
-
|
|
65
|
+
S,
|
|
65
66
|
{
|
|
66
|
-
className:
|
|
67
|
+
className: u(
|
|
67
68
|
`${e}-collapse-icon`,
|
|
68
|
-
|
|
69
|
+
D.open && `${e}-collapse-icon-open`
|
|
69
70
|
)
|
|
70
71
|
}
|
|
71
72
|
)
|