@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
package/badge/index.js
CHANGED
|
@@ -1,58 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import _ from "lodash/isPlainObject";
|
|
3
|
+
import { forwardRef as q, useContext as z, useRef as H, useImperativeHandle as L } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import "
|
|
7
|
-
import
|
|
8
|
-
import "
|
|
9
|
-
import "@unicom-cloud/utils/constant/ui";
|
|
10
|
-
import "../utils/contextHolder.js";
|
|
11
|
-
import "@unicom-cloud/utils/dayjs";
|
|
12
|
-
import "@unicom-cloud/utils/clipboard-copy";
|
|
13
|
-
import "../components/common/utils/dayjs.js";
|
|
14
|
-
import "../components/common/utils/dom.js";
|
|
15
|
-
import "@unicom-cloud/utils/file/fileToURL";
|
|
16
|
-
import "lodash/escapeRegExp";
|
|
17
|
-
import "lodash/isArray";
|
|
18
|
-
import "lodash/isNumber";
|
|
19
|
-
import "lodash/isString";
|
|
20
|
-
import "lodash/isFunction";
|
|
21
|
-
import "lodash/throttle";
|
|
22
|
-
import "../components/common/utils/is.js";
|
|
23
|
-
import "lodash/camelCase";
|
|
24
|
-
import "lodash/capitalize";
|
|
25
|
-
import "lodash/cloneDeep";
|
|
26
|
-
import "lodash/debounce";
|
|
27
|
-
import "lodash/get";
|
|
28
|
-
import "lodash/has";
|
|
29
|
-
import "lodash/kebabCase";
|
|
30
|
-
import "lodash/merge";
|
|
31
|
-
import "lodash/mergeWith";
|
|
32
|
-
import "lodash/set";
|
|
33
|
-
import "lodash/setWith";
|
|
34
|
-
import "lodash/snakeCase";
|
|
35
|
-
import "lodash/startCase";
|
|
36
|
-
import "lodash/uniq";
|
|
37
|
-
import "lodash/upperFirst";
|
|
38
|
-
import "@unicom-cloud/utils/math";
|
|
39
|
-
import { PqbCSSTransition as U } from "../components/common/utils/PqbCSSTransition.js";
|
|
40
|
-
import "../components/common/utils/reactDOM.js";
|
|
41
|
-
import "../dist/react-transition-group/src/CSSTransition.js";
|
|
42
|
-
import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
43
|
-
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
44
|
-
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
45
|
-
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
46
|
-
import "@unicom-cloud/utils/file/saveAs";
|
|
47
|
-
import "@unicom-cloud/utils/screenfull";
|
|
48
|
-
import "@unicom-cloud/utils/constant/ui.js";
|
|
49
|
-
import "react-is";
|
|
50
|
-
import "@unicom-cloud/utils/tree";
|
|
51
|
-
import "@unicom-cloud/utils/is";
|
|
52
|
-
import { v4 as F } from "uuid";
|
|
53
|
-
import "../dist/validate/src/index.js";
|
|
54
|
-
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
55
|
-
import B from "./Count.js";
|
|
5
|
+
import U from "../components/common/hooks/useMergeProps.js";
|
|
6
|
+
import { PqbCSSTransition as F } from "../components/common/utils/PqbCSSTransition.js";
|
|
7
|
+
import l from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import h from "./Count.js";
|
|
56
9
|
import J from "../config-provider/context.js";
|
|
57
10
|
const f = [
|
|
58
11
|
"red",
|
|
@@ -72,164 +25,158 @@ const f = [
|
|
|
72
25
|
dotAnimation: !0
|
|
73
26
|
// 默认开启 dot 动画
|
|
74
27
|
};
|
|
75
|
-
function Q(
|
|
76
|
-
const { getPrefixCls:
|
|
77
|
-
|
|
28
|
+
function Q(O, B) {
|
|
29
|
+
const { getPrefixCls: D, componentConfig: P, rtl: $ } = z(J), R = U(
|
|
30
|
+
O,
|
|
78
31
|
K,
|
|
79
|
-
|
|
32
|
+
P?.Badge
|
|
80
33
|
), {
|
|
81
|
-
ribbon:
|
|
82
|
-
count:
|
|
83
|
-
prefixText:
|
|
84
|
-
text:
|
|
85
|
-
className:
|
|
86
|
-
dotClassName:
|
|
87
|
-
dot:
|
|
88
|
-
dotAnimation:
|
|
89
|
-
maxCount:
|
|
90
|
-
color:
|
|
91
|
-
dotStyle:
|
|
92
|
-
offset:
|
|
93
|
-
style:
|
|
94
|
-
status:
|
|
95
|
-
children:
|
|
96
|
-
...
|
|
97
|
-
} =
|
|
98
|
-
|
|
99
|
-
dom:
|
|
34
|
+
ribbon: s,
|
|
35
|
+
count: n,
|
|
36
|
+
prefixText: b,
|
|
37
|
+
text: u,
|
|
38
|
+
className: A,
|
|
39
|
+
dotClassName: i,
|
|
40
|
+
dot: g,
|
|
41
|
+
dotAnimation: C,
|
|
42
|
+
maxCount: T,
|
|
43
|
+
color: t,
|
|
44
|
+
dotStyle: w,
|
|
45
|
+
offset: E,
|
|
46
|
+
style: j,
|
|
47
|
+
status: m,
|
|
48
|
+
children: N,
|
|
49
|
+
...v
|
|
50
|
+
} = R, p = H(null), e = D?.("badge"), a = { ...w || {} }, [x, y] = E || [];
|
|
51
|
+
x && (a.marginRight = -x), y && (a.marginTop = y), L(B, () => ({
|
|
52
|
+
dom: p.current,
|
|
53
|
+
getRootDOMNode() {
|
|
54
|
+
return p.current;
|
|
55
|
+
}
|
|
100
56
|
}));
|
|
101
57
|
const k = () => {
|
|
102
|
-
if (
|
|
103
|
-
return /* @__PURE__ */
|
|
58
|
+
if (_(n))
|
|
59
|
+
return /* @__PURE__ */ o(
|
|
104
60
|
"span",
|
|
105
61
|
{
|
|
106
|
-
className:
|
|
107
|
-
style:
|
|
108
|
-
children:
|
|
62
|
+
className: l(`${e}-custom-dot`, i),
|
|
63
|
+
style: a,
|
|
64
|
+
children: n
|
|
109
65
|
}
|
|
110
66
|
);
|
|
111
|
-
const
|
|
112
|
-
return
|
|
67
|
+
const r = t ? f.includes(t) : !1, c = !t || r ? {} : { backgroundColor: t };
|
|
68
|
+
return u && !t && !m ? /* @__PURE__ */ o(
|
|
113
69
|
"span",
|
|
114
70
|
{
|
|
115
|
-
className:
|
|
116
|
-
style:
|
|
117
|
-
children:
|
|
71
|
+
className: l(`${e}-text`, i),
|
|
72
|
+
style: a,
|
|
73
|
+
children: u
|
|
118
74
|
}
|
|
119
|
-
) :
|
|
120
|
-
!!
|
|
121
|
-
/* @__PURE__ */
|
|
75
|
+
) : m || t && typeof n == "number" && n <= 0 ? /* @__PURE__ */ d("span", { className: `${e}-status-wrapper`, children: [
|
|
76
|
+
!!b && /* @__PURE__ */ o("span", { className: `${e}-status-prefix-text`, children: b }),
|
|
77
|
+
/* @__PURE__ */ o(
|
|
122
78
|
"span",
|
|
123
79
|
{
|
|
124
|
-
|
|
125
|
-
|
|
80
|
+
style: { ...c, ...a },
|
|
81
|
+
className: l(
|
|
82
|
+
`${e}-status-dot`,
|
|
126
83
|
{
|
|
127
|
-
[`${
|
|
128
|
-
[`${
|
|
129
|
-
[`${
|
|
84
|
+
[`${e}-dot-pulse`]: C,
|
|
85
|
+
[`${e}-status-${m}`]: m,
|
|
86
|
+
[`${e}-color-${t}`]: t && r
|
|
130
87
|
},
|
|
131
|
-
|
|
132
|
-
)
|
|
133
|
-
style: { ...a, ...i }
|
|
88
|
+
i
|
|
89
|
+
)
|
|
134
90
|
}
|
|
135
91
|
),
|
|
136
|
-
!!
|
|
137
|
-
] }) : (
|
|
138
|
-
|
|
92
|
+
!!u && /* @__PURE__ */ o("span", { className: `${e}-status-text`, children: u })
|
|
93
|
+
] }) : (g || t) && typeof n == "number" && n > 0 ? /* @__PURE__ */ o(
|
|
94
|
+
F,
|
|
139
95
|
{
|
|
140
96
|
classNames: "badge-zoom",
|
|
141
|
-
in:
|
|
97
|
+
in: g || !!t,
|
|
142
98
|
timeout: 200,
|
|
143
99
|
appear: !0,
|
|
144
100
|
mountOnEnter: !0,
|
|
145
101
|
unmountOnExit: !0,
|
|
146
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ o(
|
|
147
103
|
"span",
|
|
148
104
|
{
|
|
149
|
-
className:
|
|
150
|
-
`${
|
|
105
|
+
className: l(
|
|
106
|
+
`${e}-dot`,
|
|
151
107
|
{
|
|
152
|
-
[`${
|
|
153
|
-
[`${
|
|
108
|
+
[`${e}-dot-pulse`]: C,
|
|
109
|
+
[`${e}-color-${t}`]: t && r
|
|
154
110
|
},
|
|
155
|
-
|
|
111
|
+
i
|
|
156
112
|
),
|
|
157
|
-
style: { ...
|
|
113
|
+
style: { ...c, ...a }
|
|
158
114
|
}
|
|
159
115
|
)
|
|
160
116
|
}
|
|
161
|
-
) : /* @__PURE__ */
|
|
162
|
-
|
|
117
|
+
) : /* @__PURE__ */ o(
|
|
118
|
+
h,
|
|
163
119
|
{
|
|
164
|
-
prefixCls:
|
|
165
|
-
className:
|
|
166
|
-
style: { ...
|
|
167
|
-
maxCount:
|
|
168
|
-
count:
|
|
120
|
+
prefixCls: e,
|
|
121
|
+
className: l(`${e}-number`, i),
|
|
122
|
+
style: { ...c, ...a },
|
|
123
|
+
maxCount: T,
|
|
124
|
+
count: n
|
|
169
125
|
}
|
|
170
126
|
);
|
|
171
127
|
}, G = () => {
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
|
|
128
|
+
if (!s) return;
|
|
129
|
+
const r = s.color, c = r ? f.includes(r) : !1, I = {
|
|
130
|
+
...c ? {} : { backgroundColor: r },
|
|
131
|
+
...s.style
|
|
132
|
+
}, M = s.placement || "end";
|
|
133
|
+
return /* @__PURE__ */ d(
|
|
175
134
|
"div",
|
|
176
135
|
{
|
|
177
|
-
className:
|
|
178
|
-
`${
|
|
179
|
-
`${
|
|
136
|
+
className: l(
|
|
137
|
+
`${e}-ribbon`,
|
|
138
|
+
`${e}-ribbon-${M}`,
|
|
180
139
|
{
|
|
181
|
-
[`${
|
|
182
|
-
[`${
|
|
183
|
-
}
|
|
140
|
+
[`${e}-rtl`]: $,
|
|
141
|
+
[`${e}-color-${r}`]: r && c
|
|
142
|
+
},
|
|
143
|
+
s.className
|
|
184
144
|
),
|
|
185
|
-
style:
|
|
145
|
+
style: I,
|
|
186
146
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ o("span", { className: `${e}-ribbon-text`, children: s.text }),
|
|
148
|
+
/* @__PURE__ */ o("div", { className: `${e}-ribbon-corner` })
|
|
189
149
|
]
|
|
190
150
|
}
|
|
191
151
|
);
|
|
192
152
|
};
|
|
193
|
-
return
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
className: `${t}-ribbon-wrapper`,
|
|
197
|
-
ref: d,
|
|
198
|
-
style: N,
|
|
199
|
-
id: C.current,
|
|
200
|
-
...y,
|
|
201
|
-
children: [
|
|
202
|
-
u,
|
|
203
|
-
G()
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
) : /* @__PURE__ */ c(
|
|
153
|
+
return /* @__PURE__ */ d(
|
|
207
154
|
"span",
|
|
208
155
|
{
|
|
209
|
-
className:
|
|
210
|
-
|
|
156
|
+
className: l(
|
|
157
|
+
e,
|
|
211
158
|
{
|
|
212
|
-
[`${
|
|
213
|
-
[`${
|
|
214
|
-
[`${
|
|
159
|
+
[`${e}-status`]: m,
|
|
160
|
+
[`${e}-no-children`]: !N,
|
|
161
|
+
[`${e}-rtl`]: $
|
|
215
162
|
},
|
|
216
|
-
|
|
163
|
+
!!s && `${e}-ribbon-wrapper`,
|
|
164
|
+
A
|
|
217
165
|
),
|
|
218
|
-
ref:
|
|
219
|
-
style:
|
|
220
|
-
|
|
221
|
-
...y,
|
|
166
|
+
ref: p,
|
|
167
|
+
style: j,
|
|
168
|
+
...v,
|
|
222
169
|
children: [
|
|
223
|
-
|
|
224
|
-
k()
|
|
170
|
+
N,
|
|
171
|
+
s ? G() : k()
|
|
225
172
|
]
|
|
226
173
|
}
|
|
227
174
|
);
|
|
228
175
|
}
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const
|
|
176
|
+
const S = q(Q);
|
|
177
|
+
S.displayName = "Badge";
|
|
178
|
+
S.Count = h;
|
|
179
|
+
const se = f, ne = [
|
|
233
180
|
"default",
|
|
234
181
|
"processing",
|
|
235
182
|
"success",
|
|
@@ -237,8 +184,8 @@ const Xt = f, Yt = [
|
|
|
237
184
|
"error"
|
|
238
185
|
];
|
|
239
186
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
187
|
+
se as BADGE_COLORS,
|
|
188
|
+
ne as BADGE_STATUS,
|
|
189
|
+
h as BadgeCount,
|
|
190
|
+
S as default
|
|
244
191
|
};
|
package/card/index.js
CHANGED
|
@@ -1,102 +1,122 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import d, { useContext as q } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import A from "../components/common/hooks/useMergeProps.js";
|
|
5
|
+
import B from "../spin/index.js";
|
|
6
|
+
import n from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import h from "./Grid.js";
|
|
8
8
|
import $ from "./Meta.js";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
9
|
+
import D from "../config-provider/context.js";
|
|
10
|
+
const H = {
|
|
11
11
|
size: "default",
|
|
12
12
|
bordered: !0
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
const { getPrefixCls: v, loadingElement:
|
|
14
|
+
function I(u, N) {
|
|
15
|
+
const { getPrefixCls: v, loadingElement: y, componentConfig: g, rtl: x } = q(D), b = A(
|
|
16
16
|
u,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
H,
|
|
18
|
+
g?.Card
|
|
19
19
|
), {
|
|
20
20
|
className: M,
|
|
21
21
|
children: z,
|
|
22
22
|
bordered: G,
|
|
23
|
-
loading:
|
|
23
|
+
loading: c,
|
|
24
24
|
hoverable: P,
|
|
25
25
|
size: R,
|
|
26
26
|
title: t,
|
|
27
27
|
extra: o,
|
|
28
|
-
cover:
|
|
29
|
-
actions:
|
|
28
|
+
cover: m,
|
|
29
|
+
actions: s,
|
|
30
30
|
headerStyle: S,
|
|
31
31
|
bodyStyle: j,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
headerClassName: w,
|
|
33
|
+
// 潘启宝添加
|
|
34
|
+
bodyClassName: E,
|
|
35
|
+
// 潘启宝添加
|
|
36
|
+
...F
|
|
37
|
+
} = b, e = v?.("card"), p = s && s.length ? /* @__PURE__ */ a("div", { className: `${e}-actions`, children: /* @__PURE__ */ a("div", { className: `${e}-actions-right`, children: s.map((r, k) => /* @__PURE__ */ a(
|
|
34
38
|
"span",
|
|
35
39
|
{
|
|
36
40
|
className: `${e}-actions-item`,
|
|
37
41
|
children: r
|
|
38
42
|
},
|
|
39
|
-
`action-${
|
|
43
|
+
`action-${k}`
|
|
40
44
|
)) }) }) : null;
|
|
41
|
-
let
|
|
42
|
-
const
|
|
45
|
+
let f = !1, C = !1;
|
|
46
|
+
const L = d.Children.map(
|
|
43
47
|
z,
|
|
44
48
|
(r) => {
|
|
45
49
|
if (r && r.type) {
|
|
46
|
-
if (r.type ===
|
|
47
|
-
|
|
50
|
+
if (r.type === h)
|
|
51
|
+
f = !0;
|
|
48
52
|
else if (r.type === $)
|
|
49
|
-
return
|
|
53
|
+
return C = !0, d.cloneElement(r, { actionList: p });
|
|
50
54
|
}
|
|
51
55
|
return r;
|
|
52
56
|
}
|
|
53
57
|
);
|
|
54
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ i(
|
|
55
59
|
"div",
|
|
56
60
|
{
|
|
57
|
-
...
|
|
61
|
+
...F,
|
|
58
62
|
ref: N,
|
|
59
|
-
className:
|
|
63
|
+
className: n(
|
|
60
64
|
e,
|
|
61
65
|
`${e}-size-${R}`,
|
|
62
66
|
{
|
|
63
|
-
[`${e}-loading`]:
|
|
67
|
+
[`${e}-loading`]: c,
|
|
64
68
|
[`${e}-bordered`]: G,
|
|
65
69
|
[`${e}-hoverable`]: P,
|
|
66
|
-
[`${e}-contain-grid`]:
|
|
70
|
+
[`${e}-contain-grid`]: f,
|
|
67
71
|
[`${e}-rtl`]: x
|
|
68
72
|
},
|
|
69
73
|
M
|
|
70
74
|
),
|
|
71
75
|
children: [
|
|
72
|
-
t || o ? /* @__PURE__ */
|
|
76
|
+
t || o ? /* @__PURE__ */ i(
|
|
73
77
|
"div",
|
|
74
78
|
{
|
|
75
|
-
className: h(`${e}-header`, {
|
|
76
|
-
[`${e}-header-no-title`]: !t
|
|
77
|
-
}),
|
|
78
79
|
style: S,
|
|
80
|
+
className: n(
|
|
81
|
+
`${e}-header`,
|
|
82
|
+
{
|
|
83
|
+
[`${e}-header-no-title`]: !t
|
|
84
|
+
},
|
|
85
|
+
w
|
|
86
|
+
// 潘启宝添加
|
|
87
|
+
),
|
|
79
88
|
children: [
|
|
80
89
|
t && /* @__PURE__ */ a("div", { className: `${e}-header-title`, children: t }),
|
|
81
90
|
o && /* @__PURE__ */ a("div", { className: `${e}-header-extra`, children: o })
|
|
82
91
|
]
|
|
83
92
|
}
|
|
84
93
|
) : null,
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
m ? /* @__PURE__ */ a("div", { className: `${e}-cover`, children: m }) : null,
|
|
95
|
+
/* @__PURE__ */ i(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
style: j,
|
|
99
|
+
className: n(
|
|
100
|
+
`${e}-body`,
|
|
101
|
+
E
|
|
102
|
+
// 潘启宝添加
|
|
103
|
+
),
|
|
104
|
+
children: [
|
|
105
|
+
c ? y || /* @__PURE__ */ a(B, {}) : L,
|
|
106
|
+
C ? null : p
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
90
110
|
]
|
|
91
111
|
}
|
|
92
112
|
);
|
|
93
113
|
}
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
const J = d.forwardRef(I), l = J;
|
|
115
|
+
l.Meta = $;
|
|
116
|
+
l.Grid = h;
|
|
117
|
+
l.displayName = "Card";
|
|
98
118
|
export {
|
|
99
|
-
|
|
119
|
+
h as CardGrid,
|
|
100
120
|
$ as CardMeta,
|
|
101
|
-
|
|
121
|
+
l as default
|
|
102
122
|
};
|
package/color-picker/InputHex.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs as C, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as m } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import m from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as v, useState as I, useEffect as j } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import c from "../input/Input.js";
|
|
7
6
|
import { InputAlpha as D } from "./InputAlpha.js";
|
|
8
7
|
import H from "../config-provider/context.js";
|
|
9
|
-
const
|
|
8
|
+
const N = ({
|
|
10
9
|
color: o,
|
|
11
10
|
alpha: f,
|
|
12
11
|
onHsvChange: u,
|
|
@@ -52,5 +51,5 @@ const T = ({
|
|
|
52
51
|
] });
|
|
53
52
|
};
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
N as InputHex
|
|
56
55
|
};
|
package/color-picker/InputRgb.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as f } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import f from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as x } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import b from "../input/Input.js";
|
|
7
6
|
import m from "../input-number/index.js";
|
|
8
7
|
import { InputAlpha as I } from "./InputAlpha.js";
|
|
9
8
|
import d from "../config-provider/context.js";
|
|
10
|
-
const
|
|
9
|
+
const H = ({
|
|
11
10
|
color: p,
|
|
12
11
|
alpha: s,
|
|
13
12
|
onHsvChange: u,
|
|
14
|
-
onAlphaChange:
|
|
15
|
-
disabledAlpha:
|
|
13
|
+
onAlphaChange: c,
|
|
14
|
+
disabledAlpha: C
|
|
16
15
|
}) => {
|
|
17
|
-
const { getPrefixCls:
|
|
16
|
+
const { getPrefixCls: a } = x(d), g = a?.("color-picker"), r = (o) => {
|
|
18
17
|
const l = new f({
|
|
19
18
|
r: o.r,
|
|
20
19
|
g: o.g,
|
|
@@ -56,9 +55,9 @@ const P = ({
|
|
|
56
55
|
onChange: (o) => r({ r: t, g: e, b: o })
|
|
57
56
|
}
|
|
58
57
|
),
|
|
59
|
-
!
|
|
58
|
+
!C && /* @__PURE__ */ n(I, { value: s, onChange: c })
|
|
60
59
|
] });
|
|
61
60
|
};
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
H as InputRgb
|
|
64
63
|
};
|
package/color-picker/Palette.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as u } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import u from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as d, useMemo as h } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import { useControlBlock as g } from "./hooks/useControlBlock.js";
|
|
7
6
|
import x from "../config-provider/context.js";
|
|
8
|
-
const
|
|
7
|
+
const w = ({ color: l, onChange: c }) => {
|
|
9
8
|
const { getPrefixCls: i } = d(x), e = i?.("color-picker"), { h: r, s: t, v: n } = l.hsv, { blockRef: m, handlerRef: f, onMouseDown: a } = g({
|
|
10
9
|
value: [t, 1 - n],
|
|
11
10
|
onChange: (o) => c(o[0], 1 - o[1])
|
|
@@ -32,5 +31,5 @@ const M = ({ color: l, onChange: c }) => {
|
|
|
32
31
|
);
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
w as Palette
|
|
36
35
|
};
|
package/color-picker/Panel.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import { TinyColor as d } from "../dist/tinycolor/src/index.js";
|
|
2
|
+
import d from "@unicom-cloud/utils/tinycolor";
|
|
4
3
|
import { useContext as cr, useState as ar, useMemo as sr } from "react";
|
|
5
4
|
import "../config-provider/ConfigProvider.js";
|
|
6
5
|
import k from "../radio/Radio.js";
|
|
@@ -16,7 +15,7 @@ import { isMultiMode as X, isGradientMode as _ } from "./Mode.js";
|
|
|
16
15
|
import { Palette as gr } from "./Palette.js";
|
|
17
16
|
import { renderBackground as br, sortGradientColors as D, getColorByGradients as fr } from "./utils.js";
|
|
18
17
|
import vr from "../config-provider/context.js";
|
|
19
|
-
const hr = k.Group,
|
|
18
|
+
const hr = k.Group, qr = ({
|
|
20
19
|
value: F,
|
|
21
20
|
mode: y,
|
|
22
21
|
activeMode: h,
|
|
@@ -264,5 +263,5 @@ const hr = k.Group, Er = ({
|
|
|
264
263
|
] });
|
|
265
264
|
};
|
|
266
265
|
export {
|
|
267
|
-
|
|
266
|
+
qr as Panel
|
|
268
267
|
};
|
package/color-picker/colors.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
new
|
|
1
|
+
import t from "@unicom-cloud/utils/tinycolor";
|
|
2
|
+
import * as e from "@unicom-cloud/utils/ui-color";
|
|
3
|
+
new t("#eee");
|
|
4
4
|
const i = [
|
|
5
|
-
e.colors.map((o, r,
|
|
6
|
-
e.colors.map((o, r,
|
|
5
|
+
e.colors.map((o, r, l) => e.palette({ color: o.value, level: 4 }).toHexString()),
|
|
6
|
+
e.colors.map((o, r, l) => o.value)
|
|
7
7
|
// '#00B42A',
|
|
8
8
|
// '#3C7EFF',
|
|
9
9
|
// '#FF7D00',
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { TinyColor as P } from "../../dist/tinycolor/src/index.js";
|
|
1
|
+
import P from "@unicom-cloud/utils/tinycolor";
|
|
3
2
|
import { useState as C, useRef as k, useMemo as G, useCallback as F, useEffect as M } from "react";
|
|
4
3
|
import Z from "../../components/common/hooks/useIsFirstRender.js";
|
|
5
4
|
import q from "../../components/common/hooks/useMergeValue.js";
|
|
6
5
|
import { ColorPickerMode as y } from "../interface.js";
|
|
7
6
|
import { getModeByValue as $, isGradientMode as H, isSingleMode as w } from "../Mode.js";
|
|
8
7
|
import { mapValueToGradientColor as ee, getColorFromHsv as E, formatRgba as oe, formatHex as te, isEqualsColors as re, equalsHsv as ne, getRandomId as T } from "../utils.js";
|
|
9
|
-
const
|
|
8
|
+
const ge = (s) => {
|
|
10
9
|
const {
|
|
11
10
|
mode: B = y.Single,
|
|
12
11
|
defaultValue: j,
|
|
@@ -121,5 +120,5 @@ const Ce = (s) => {
|
|
|
121
120
|
};
|
|
122
121
|
};
|
|
123
122
|
export {
|
|
124
|
-
|
|
123
|
+
ge as useColorPicker
|
|
125
124
|
};
|