@amateescu/portal-ui-components 0.0.23 → 0.0.25-react19
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/dist/Box-DQNjUj2G.js +102 -0
- package/dist/Button-D2XVkO19.js +676 -0
- package/dist/ButtonBase-D-XlpvIZ.js +954 -0
- package/dist/CircularProgress-BOkP0juA.js +247 -0
- package/dist/{EllipsisOutlined-CtmB5yDB.js → EllipsisOutlined-DfTPoz8U.js} +667 -672
- package/dist/PurePanel-ByiFMw5U.js +2213 -0
- package/dist/{Skeleton-XFbjx7LJ.js → Skeleton-Imy-56Lv.js} +161 -158
- package/dist/{UserInfoDropdown-DGaplQo6.js → UserInfoDropdown-6aB5cQyF.js} +1540 -1505
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.js +1 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +1 -1
- package/dist/components/CustomButton/CustomButton.js +1 -1
- package/dist/components/CustomPagination/CustomPagination.js +455 -344
- package/dist/components/ErrorModal/ErrorModal.js +5 -6
- package/dist/components/ErrorModal/ErrorModal.stories.js +1 -1
- package/dist/components/InfoModal/InfoModal.js +1 -1
- package/dist/components/InfoModal/InfoModal.stories.js +1 -1
- package/dist/components/KpiCard/KpiCard.js +1003 -892
- package/dist/components/LoadingAnimation/LoadingAnimation.js +6 -215
- package/dist/components/Login/Login.js +4485 -3820
- package/dist/components/Login/Login.stories.js +1586 -1546
- package/dist/components/SideMenu/SideMenu.js +1 -1
- package/dist/components/SideMenu/SideMenu.types.d.ts +1 -0
- package/dist/components/TotalDataGrid/TotalDataGrid.js +6 -6
- package/dist/components/UserInfoDropdown/UserInfoDropdown.js +1 -1
- package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/context-D_FWkiDE.js +7383 -0
- package/dist/createSimplePaletteValueFilter-CshNo3IR.js +3439 -0
- package/dist/index-CR8gh-dS.js +1689 -0
- package/dist/index-CyFfYou3.js +411 -0
- package/dist/main.js +33 -30
- package/dist/objectWithoutPropertiesLoose-BTau6TOn.js +33 -0
- package/dist/portal-utils/formatters.js +68 -0
- package/dist/portal-utils/index.d.ts +1 -0
- package/dist/portal-utils/index.js +13 -10
- package/dist/portal-utils/loggerService.d.ts +12 -0
- package/dist/portal-utils/loggerService.js +16 -0
- package/dist/useSlot-kDVPuVrn.js +431 -0
- package/package.json +38 -38
- package/dist/Box-CmKt1PwF.js +0 -68
- package/dist/Button-BT8r3F_d.js +0 -355
- package/dist/ButtonBase-By486Sca.js +0 -966
- package/dist/PurePanel-CfZ1n-M8.js +0 -4782
- package/dist/assertThisInitialized-BUtkG-md.js +0 -13
- package/dist/createSvgIcon-B8ya7kb4.js +0 -250
- package/dist/generateUtilityClasses-Bhjgm_6-.js +0 -3270
- package/dist/index-1vDmwq0E.js +0 -19089
- package/dist/index-DsP9yT3s.js +0 -1551
- package/dist/objectWithoutPropertiesLoose-CIT-1_kH.js +0 -227
- package/dist/useId-DbfH3PlN.js +0 -5397
|
@@ -0,0 +1,2213 @@
|
|
|
1
|
+
import * as m from "react";
|
|
2
|
+
import c, { useContext as _e, useRef as D, forwardRef as me, useState as je, useEffect as te, useMemo as oe, Children as kt } from "react";
|
|
3
|
+
import { I as eo, U as We, v as Ge, e as M, Z as pt, $ as le, h as vt, Y as to, a0 as oo, a1 as ro, w as ce, q as bt, c as N, a2 as Ct, a as re, k as Fe, a3 as no, a4 as ao, a5 as io, g as ht, m as ne, E as yt, x as so, l as lo, a6 as co, a7 as uo, a8 as St, a9 as xt, p as Et, aa as Ot, _ as J, i as Te, s as $t, H as mo, K as T, ab as Re, u as ue, ac as go, B as fo, ad as po, T as vo, b as bo, ae as Co, n as ho, o as yo, af as So, C as xo } from "./context-D_FWkiDE.js";
|
|
4
|
+
import { R as It } from "./index-CyFfYou3.js";
|
|
5
|
+
import { _ as se } from "./objectWithoutPropertiesLoose-BTau6TOn.js";
|
|
6
|
+
const Ve = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
|
|
7
|
+
function Eo(e) {
|
|
8
|
+
return e && /* @__PURE__ */ c.isValidElement(e) && e.type === c.Fragment;
|
|
9
|
+
}
|
|
10
|
+
const Oo = (e, t, o) => /* @__PURE__ */ c.isValidElement(e) ? /* @__PURE__ */ c.cloneElement(e, typeof o == "function" ? o(e.props || {}) : o) : t;
|
|
11
|
+
function Rt(e, t) {
|
|
12
|
+
return Oo(e, e, t);
|
|
13
|
+
}
|
|
14
|
+
var $o = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, name: "loading", theme: "outlined" }, Io = function(t, o) {
|
|
15
|
+
return /* @__PURE__ */ m.createElement(eo, se({}, t, {
|
|
16
|
+
ref: o,
|
|
17
|
+
icon: $o
|
|
18
|
+
}));
|
|
19
|
+
}, wt = /* @__PURE__ */ m.forwardRef(Io);
|
|
20
|
+
process.env.NODE_ENV !== "production" && (wt.displayName = "LoadingOutlined");
|
|
21
|
+
const Bt = /* @__PURE__ */ c.createContext(void 0);
|
|
22
|
+
process.env.NODE_ENV !== "production" && (Bt.displayName = "zIndexContext");
|
|
23
|
+
const V = 100, Ro = 10, wo = V * Ro, Bo = wo + V, Nt = {
|
|
24
|
+
Modal: V,
|
|
25
|
+
Drawer: V,
|
|
26
|
+
Popover: V,
|
|
27
|
+
Popconfirm: V,
|
|
28
|
+
Tooltip: V,
|
|
29
|
+
Tour: V,
|
|
30
|
+
FloatButton: V
|
|
31
|
+
}, No = {
|
|
32
|
+
SelectLike: 50,
|
|
33
|
+
Dropdown: 50,
|
|
34
|
+
DatePicker: 50,
|
|
35
|
+
Menu: 50,
|
|
36
|
+
ImagePreview: 1
|
|
37
|
+
};
|
|
38
|
+
function Ho(e) {
|
|
39
|
+
return e in Nt;
|
|
40
|
+
}
|
|
41
|
+
const yn = (e, t) => {
|
|
42
|
+
const [, o] = We(), r = c.useContext(Bt), n = Ho(e);
|
|
43
|
+
let a;
|
|
44
|
+
if (t !== void 0)
|
|
45
|
+
a = [t, t];
|
|
46
|
+
else {
|
|
47
|
+
let i = r ?? 0;
|
|
48
|
+
n ? i += // Use preset token zIndex by default but not stack when has parent container
|
|
49
|
+
(r ? 0 : o.zIndexPopupBase) + // Container offset
|
|
50
|
+
Nt[e] : i += No[e], a = [r === void 0 ? t : i, i];
|
|
51
|
+
}
|
|
52
|
+
if (process.env.NODE_ENV !== "production") {
|
|
53
|
+
const i = Ge(e), s = o.zIndexPopupBase + Bo, l = a[0] || 0;
|
|
54
|
+
process.env.NODE_ENV !== "production" && i(t !== void 0 || l <= s, "usage", "`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.");
|
|
55
|
+
}
|
|
56
|
+
return a;
|
|
57
|
+
};
|
|
58
|
+
var ae = M({}, It), zo = ae.version, we = ae.render, Po = ae.unmountComponentAtNode, ge;
|
|
59
|
+
try {
|
|
60
|
+
var _o = Number((zo || "").split(".")[0]);
|
|
61
|
+
_o >= 18 && (ge = ae.createRoot);
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
function lt(e) {
|
|
65
|
+
var t = ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
66
|
+
t && vt(t) === "object" && (t.usingClientEntryPoint = e);
|
|
67
|
+
}
|
|
68
|
+
var de = "__rc_react_root__";
|
|
69
|
+
function jo(e, t) {
|
|
70
|
+
lt(!0);
|
|
71
|
+
var o = t[de] || ge(t);
|
|
72
|
+
lt(!1), o.render(e), t[de] = o;
|
|
73
|
+
}
|
|
74
|
+
function To(e, t) {
|
|
75
|
+
we == null || we(e, t);
|
|
76
|
+
}
|
|
77
|
+
function Do(e, t) {
|
|
78
|
+
if (ge) {
|
|
79
|
+
jo(e, t);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
To(e, t);
|
|
83
|
+
}
|
|
84
|
+
function Lo(e) {
|
|
85
|
+
return De.apply(this, arguments);
|
|
86
|
+
}
|
|
87
|
+
function De() {
|
|
88
|
+
return De = pt(/* @__PURE__ */ le().mark(function e(t) {
|
|
89
|
+
return le().wrap(function(r) {
|
|
90
|
+
for (; ; ) switch (r.prev = r.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
return r.abrupt("return", Promise.resolve().then(function() {
|
|
93
|
+
var n;
|
|
94
|
+
(n = t[de]) === null || n === void 0 || n.unmount(), delete t[de];
|
|
95
|
+
}));
|
|
96
|
+
case 1:
|
|
97
|
+
case "end":
|
|
98
|
+
return r.stop();
|
|
99
|
+
}
|
|
100
|
+
}, e);
|
|
101
|
+
})), De.apply(this, arguments);
|
|
102
|
+
}
|
|
103
|
+
function Ao(e) {
|
|
104
|
+
Po(e);
|
|
105
|
+
}
|
|
106
|
+
function Mo(e) {
|
|
107
|
+
return Le.apply(this, arguments);
|
|
108
|
+
}
|
|
109
|
+
function Le() {
|
|
110
|
+
return Le = pt(/* @__PURE__ */ le().mark(function e(t) {
|
|
111
|
+
return le().wrap(function(r) {
|
|
112
|
+
for (; ; ) switch (r.prev = r.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
if (ge === void 0) {
|
|
115
|
+
r.next = 2;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
return r.abrupt("return", Lo(t));
|
|
119
|
+
case 2:
|
|
120
|
+
Ao(t);
|
|
121
|
+
case 3:
|
|
122
|
+
case "end":
|
|
123
|
+
return r.stop();
|
|
124
|
+
}
|
|
125
|
+
}, e);
|
|
126
|
+
})), Le.apply(this, arguments);
|
|
127
|
+
}
|
|
128
|
+
const Wo = (e, t) => {
|
|
129
|
+
if (process.env.NODE_ENV !== "production") {
|
|
130
|
+
const o = parseInt(m.version.split(".")[0], 10), r = Object.keys(It);
|
|
131
|
+
process.env.NODE_ENV !== "production" && to(o < 19 || r.includes("createRoot"), "compatible", "antd v5 support React is 16 ~ 18. see https://u.ant.design/v5-for-19 for compatible.");
|
|
132
|
+
}
|
|
133
|
+
return Do(e, t), () => Mo(t);
|
|
134
|
+
};
|
|
135
|
+
let Go = Wo;
|
|
136
|
+
function Fo() {
|
|
137
|
+
return Go;
|
|
138
|
+
}
|
|
139
|
+
const Vo = (e) => {
|
|
140
|
+
const {
|
|
141
|
+
componentCls: t,
|
|
142
|
+
colorPrimary: o
|
|
143
|
+
} = e;
|
|
144
|
+
return {
|
|
145
|
+
[t]: {
|
|
146
|
+
position: "absolute",
|
|
147
|
+
background: "transparent",
|
|
148
|
+
pointerEvents: "none",
|
|
149
|
+
boxSizing: "border-box",
|
|
150
|
+
color: `var(--wave-color, ${o})`,
|
|
151
|
+
boxShadow: "0 0 0 0 currentcolor",
|
|
152
|
+
opacity: 0.2,
|
|
153
|
+
// =================== Motion ===================
|
|
154
|
+
"&.wave-motion-appear": {
|
|
155
|
+
transition: [`box-shadow 0.4s ${e.motionEaseOutCirc}`, `opacity 2s ${e.motionEaseOutCirc}`].join(","),
|
|
156
|
+
"&-active": {
|
|
157
|
+
boxShadow: "0 0 0 6px currentcolor",
|
|
158
|
+
opacity: 0
|
|
159
|
+
},
|
|
160
|
+
"&.wave-quick": {
|
|
161
|
+
transition: [`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`, `opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}, Uo = oo("Wave", (e) => [Vo(e)]), Ht = `${ro}-wave-target`;
|
|
167
|
+
function Be(e) {
|
|
168
|
+
return e && e !== "#fff" && e !== "#ffffff" && e !== "rgb(255, 255, 255)" && e !== "rgba(255, 255, 255, 1)" && !/rgba\((?:\d*, ){3}0\)/.test(e) && // any transparent rgba color
|
|
169
|
+
e !== "transparent";
|
|
170
|
+
}
|
|
171
|
+
function qo(e) {
|
|
172
|
+
const {
|
|
173
|
+
borderTopColor: t,
|
|
174
|
+
borderColor: o,
|
|
175
|
+
backgroundColor: r
|
|
176
|
+
} = getComputedStyle(e);
|
|
177
|
+
return Be(t) ? t : Be(o) ? o : Be(r) ? r : null;
|
|
178
|
+
}
|
|
179
|
+
function Ne(e) {
|
|
180
|
+
return Number.isNaN(e) ? 0 : e;
|
|
181
|
+
}
|
|
182
|
+
const Xo = (e) => {
|
|
183
|
+
const {
|
|
184
|
+
className: t,
|
|
185
|
+
target: o,
|
|
186
|
+
component: r,
|
|
187
|
+
registerUnmount: n
|
|
188
|
+
} = e, a = m.useRef(null), i = m.useRef(null);
|
|
189
|
+
m.useEffect(() => {
|
|
190
|
+
i.current = n();
|
|
191
|
+
}, []);
|
|
192
|
+
const [s, l] = m.useState(null), [u, d] = m.useState([]), [g, p] = m.useState(0), [C, h] = m.useState(0), [x, f] = m.useState(0), [b, w] = m.useState(0), [E, v] = m.useState(!1), y = {
|
|
193
|
+
left: g,
|
|
194
|
+
top: C,
|
|
195
|
+
width: x,
|
|
196
|
+
height: b,
|
|
197
|
+
borderRadius: u.map((S) => `${S}px`).join(" ")
|
|
198
|
+
};
|
|
199
|
+
s && (y["--wave-color"] = s);
|
|
200
|
+
function B() {
|
|
201
|
+
const S = getComputedStyle(o);
|
|
202
|
+
l(qo(o));
|
|
203
|
+
const $ = S.position === "static", {
|
|
204
|
+
borderLeftWidth: H,
|
|
205
|
+
borderTopWidth: z
|
|
206
|
+
} = S;
|
|
207
|
+
p($ ? o.offsetLeft : Ne(-parseFloat(H))), h($ ? o.offsetTop : Ne(-parseFloat(z))), f(o.offsetWidth), w(o.offsetHeight);
|
|
208
|
+
const {
|
|
209
|
+
borderTopLeftRadius: j,
|
|
210
|
+
borderTopRightRadius: P,
|
|
211
|
+
borderBottomLeftRadius: q,
|
|
212
|
+
borderBottomRightRadius: L
|
|
213
|
+
} = S;
|
|
214
|
+
d([j, P, L, q].map((G) => Ne(parseFloat(G))));
|
|
215
|
+
}
|
|
216
|
+
if (m.useEffect(() => {
|
|
217
|
+
if (o) {
|
|
218
|
+
const S = ce(() => {
|
|
219
|
+
B(), v(!0);
|
|
220
|
+
});
|
|
221
|
+
let $;
|
|
222
|
+
return typeof ResizeObserver < "u" && ($ = new ResizeObserver(B), $.observe(o)), () => {
|
|
223
|
+
ce.cancel(S), $ == null || $.disconnect();
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}, []), !E)
|
|
227
|
+
return null;
|
|
228
|
+
const _ = (r === "Checkbox" || r === "Radio") && (o == null ? void 0 : o.classList.contains(Ht));
|
|
229
|
+
return /* @__PURE__ */ m.createElement(bt, {
|
|
230
|
+
visible: !0,
|
|
231
|
+
motionAppear: !0,
|
|
232
|
+
motionName: "wave-motion",
|
|
233
|
+
motionDeadline: 5e3,
|
|
234
|
+
onAppearEnd: (S, $) => {
|
|
235
|
+
var H, z;
|
|
236
|
+
if ($.deadline || $.propertyName === "opacity") {
|
|
237
|
+
const j = (H = a.current) === null || H === void 0 ? void 0 : H.parentElement;
|
|
238
|
+
(z = i.current) === null || z === void 0 || z.call(i).then(() => {
|
|
239
|
+
j == null || j.remove();
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return !1;
|
|
243
|
+
}
|
|
244
|
+
}, (S, $) => {
|
|
245
|
+
let {
|
|
246
|
+
className: H
|
|
247
|
+
} = S;
|
|
248
|
+
return /* @__PURE__ */ m.createElement("div", {
|
|
249
|
+
ref: Ct(a, $),
|
|
250
|
+
className: N(t, H, {
|
|
251
|
+
"wave-quick": _
|
|
252
|
+
}),
|
|
253
|
+
style: y
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}, Zo = (e, t) => {
|
|
257
|
+
var o;
|
|
258
|
+
const {
|
|
259
|
+
component: r
|
|
260
|
+
} = t;
|
|
261
|
+
if (r === "Checkbox" && !(!((o = e.querySelector("input")) === null || o === void 0) && o.checked))
|
|
262
|
+
return;
|
|
263
|
+
const n = document.createElement("div");
|
|
264
|
+
n.style.position = "absolute", n.style.left = "0px", n.style.top = "0px", e == null || e.insertBefore(n, e == null ? void 0 : e.firstChild);
|
|
265
|
+
const a = Fo();
|
|
266
|
+
let i = null;
|
|
267
|
+
function s() {
|
|
268
|
+
return i;
|
|
269
|
+
}
|
|
270
|
+
i = a(/* @__PURE__ */ m.createElement(Xo, Object.assign({}, t, {
|
|
271
|
+
target: e,
|
|
272
|
+
registerUnmount: s
|
|
273
|
+
})), n);
|
|
274
|
+
}, Yo = (e, t, o) => {
|
|
275
|
+
const {
|
|
276
|
+
wave: r
|
|
277
|
+
} = m.useContext(re), [, n, a] = We(), i = Fe((u) => {
|
|
278
|
+
const d = e.current;
|
|
279
|
+
if (r != null && r.disabled || !d)
|
|
280
|
+
return;
|
|
281
|
+
const g = d.querySelector(`.${Ht}`) || d, {
|
|
282
|
+
showEffect: p
|
|
283
|
+
} = r || {};
|
|
284
|
+
(p || Zo)(g, {
|
|
285
|
+
className: t,
|
|
286
|
+
token: n,
|
|
287
|
+
component: o,
|
|
288
|
+
event: u,
|
|
289
|
+
hashId: a
|
|
290
|
+
});
|
|
291
|
+
}), s = m.useRef(null);
|
|
292
|
+
return (u) => {
|
|
293
|
+
ce.cancel(s.current), s.current = ce(() => {
|
|
294
|
+
i(u);
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
}, zt = (e) => {
|
|
298
|
+
const {
|
|
299
|
+
children: t,
|
|
300
|
+
disabled: o,
|
|
301
|
+
component: r
|
|
302
|
+
} = e, {
|
|
303
|
+
getPrefixCls: n
|
|
304
|
+
} = _e(re), a = D(null), i = n("wave"), [, s] = Uo(i), l = Yo(a, N(i, s), r);
|
|
305
|
+
if (c.useEffect(() => {
|
|
306
|
+
const d = a.current;
|
|
307
|
+
if (!d || d.nodeType !== 1 || o)
|
|
308
|
+
return;
|
|
309
|
+
const g = (p) => {
|
|
310
|
+
!io(p.target) || // No need wave
|
|
311
|
+
!d.getAttribute || d.getAttribute("disabled") || d.disabled || d.className.includes("disabled") || d.className.includes("-leave") || l(p);
|
|
312
|
+
};
|
|
313
|
+
return d.addEventListener("click", g, !0), () => {
|
|
314
|
+
d.removeEventListener("click", g, !0);
|
|
315
|
+
};
|
|
316
|
+
}, [o]), !/* @__PURE__ */ c.isValidElement(t))
|
|
317
|
+
return t ?? null;
|
|
318
|
+
const u = no(t) ? Ct(ao(t), a) : a;
|
|
319
|
+
return Rt(t, {
|
|
320
|
+
ref: u
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
process.env.NODE_ENV !== "production" && (zt.displayName = "Wave");
|
|
324
|
+
const Ko = (e) => {
|
|
325
|
+
const {
|
|
326
|
+
componentCls: t
|
|
327
|
+
} = e;
|
|
328
|
+
return {
|
|
329
|
+
[t]: {
|
|
330
|
+
"&-block": {
|
|
331
|
+
display: "flex",
|
|
332
|
+
width: "100%"
|
|
333
|
+
},
|
|
334
|
+
"&-vertical": {
|
|
335
|
+
flexDirection: "column"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}, Jo = (e) => {
|
|
340
|
+
const {
|
|
341
|
+
componentCls: t,
|
|
342
|
+
antCls: o
|
|
343
|
+
} = e;
|
|
344
|
+
return {
|
|
345
|
+
[t]: {
|
|
346
|
+
display: "inline-flex",
|
|
347
|
+
"&-rtl": {
|
|
348
|
+
direction: "rtl"
|
|
349
|
+
},
|
|
350
|
+
"&-vertical": {
|
|
351
|
+
flexDirection: "column"
|
|
352
|
+
},
|
|
353
|
+
"&-align": {
|
|
354
|
+
flexDirection: "column",
|
|
355
|
+
"&-center": {
|
|
356
|
+
alignItems: "center"
|
|
357
|
+
},
|
|
358
|
+
"&-start": {
|
|
359
|
+
alignItems: "flex-start"
|
|
360
|
+
},
|
|
361
|
+
"&-end": {
|
|
362
|
+
alignItems: "flex-end"
|
|
363
|
+
},
|
|
364
|
+
"&-baseline": {
|
|
365
|
+
alignItems: "baseline"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
[`${t}-item:empty`]: {
|
|
369
|
+
display: "none"
|
|
370
|
+
},
|
|
371
|
+
// https://github.com/ant-design/ant-design/issues/47875
|
|
372
|
+
[`${t}-item > ${o}-badge-not-a-wrapper:only-child`]: {
|
|
373
|
+
display: "block"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}, Qo = (e) => {
|
|
378
|
+
const {
|
|
379
|
+
componentCls: t
|
|
380
|
+
} = e;
|
|
381
|
+
return {
|
|
382
|
+
[t]: {
|
|
383
|
+
"&-gap-row-small": {
|
|
384
|
+
rowGap: e.spaceGapSmallSize
|
|
385
|
+
},
|
|
386
|
+
"&-gap-row-middle": {
|
|
387
|
+
rowGap: e.spaceGapMiddleSize
|
|
388
|
+
},
|
|
389
|
+
"&-gap-row-large": {
|
|
390
|
+
rowGap: e.spaceGapLargeSize
|
|
391
|
+
},
|
|
392
|
+
"&-gap-col-small": {
|
|
393
|
+
columnGap: e.spaceGapSmallSize
|
|
394
|
+
},
|
|
395
|
+
"&-gap-col-middle": {
|
|
396
|
+
columnGap: e.spaceGapMiddleSize
|
|
397
|
+
},
|
|
398
|
+
"&-gap-col-large": {
|
|
399
|
+
columnGap: e.spaceGapLargeSize
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
}, ko = ht("Space", (e) => {
|
|
404
|
+
const t = ne(e, {
|
|
405
|
+
spaceGapSmallSize: e.paddingXS,
|
|
406
|
+
spaceGapMiddleSize: e.padding,
|
|
407
|
+
spaceGapLargeSize: e.paddingLG
|
|
408
|
+
});
|
|
409
|
+
return [Jo(t), Qo(t), Ko(t)];
|
|
410
|
+
}, () => ({}), {
|
|
411
|
+
// Space component don't apply extra font style
|
|
412
|
+
// https://github.com/ant-design/ant-design/issues/40315
|
|
413
|
+
resetStyle: !1
|
|
414
|
+
});
|
|
415
|
+
var Pt = function(e, t) {
|
|
416
|
+
var o = {};
|
|
417
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
|
|
418
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
|
|
419
|
+
t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (o[r[n]] = e[r[n]]);
|
|
420
|
+
return o;
|
|
421
|
+
};
|
|
422
|
+
const fe = /* @__PURE__ */ m.createContext(null), er = (e, t) => {
|
|
423
|
+
const o = m.useContext(fe), r = m.useMemo(() => {
|
|
424
|
+
if (!o)
|
|
425
|
+
return "";
|
|
426
|
+
const {
|
|
427
|
+
compactDirection: n,
|
|
428
|
+
isFirstItem: a,
|
|
429
|
+
isLastItem: i
|
|
430
|
+
} = o, s = n === "vertical" ? "-vertical-" : "-";
|
|
431
|
+
return N(`${e}-compact${s}item`, {
|
|
432
|
+
[`${e}-compact${s}first-item`]: a,
|
|
433
|
+
[`${e}-compact${s}last-item`]: i,
|
|
434
|
+
[`${e}-compact${s}item-rtl`]: t === "rtl"
|
|
435
|
+
});
|
|
436
|
+
}, [e, t, o]);
|
|
437
|
+
return {
|
|
438
|
+
compactSize: o == null ? void 0 : o.compactSize,
|
|
439
|
+
compactDirection: o == null ? void 0 : o.compactDirection,
|
|
440
|
+
compactItemClassnames: r
|
|
441
|
+
};
|
|
442
|
+
}, tr = (e) => {
|
|
443
|
+
const {
|
|
444
|
+
children: t
|
|
445
|
+
} = e;
|
|
446
|
+
return /* @__PURE__ */ m.createElement(fe.Provider, {
|
|
447
|
+
value: null
|
|
448
|
+
}, t);
|
|
449
|
+
}, or = (e) => {
|
|
450
|
+
const {
|
|
451
|
+
children: t
|
|
452
|
+
} = e, o = Pt(e, ["children"]);
|
|
453
|
+
return /* @__PURE__ */ m.createElement(fe.Provider, {
|
|
454
|
+
value: m.useMemo(() => o, [o])
|
|
455
|
+
}, t);
|
|
456
|
+
}, Sn = (e) => {
|
|
457
|
+
const {
|
|
458
|
+
getPrefixCls: t,
|
|
459
|
+
direction: o
|
|
460
|
+
} = m.useContext(re), {
|
|
461
|
+
size: r,
|
|
462
|
+
direction: n,
|
|
463
|
+
block: a,
|
|
464
|
+
prefixCls: i,
|
|
465
|
+
className: s,
|
|
466
|
+
rootClassName: l,
|
|
467
|
+
children: u
|
|
468
|
+
} = e, d = Pt(e, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]), g = yt((E) => r ?? E), p = t("space-compact", i), [C, h] = ko(p), x = N(p, h, {
|
|
469
|
+
[`${p}-rtl`]: o === "rtl",
|
|
470
|
+
[`${p}-block`]: a,
|
|
471
|
+
[`${p}-vertical`]: n === "vertical"
|
|
472
|
+
}, s, l), f = m.useContext(fe), b = so(u), w = m.useMemo(() => b.map((E, v) => {
|
|
473
|
+
const y = (E == null ? void 0 : E.key) || `${p}-item-${v}`;
|
|
474
|
+
return /* @__PURE__ */ m.createElement(or, {
|
|
475
|
+
key: y,
|
|
476
|
+
compactSize: g,
|
|
477
|
+
compactDirection: n,
|
|
478
|
+
isFirstItem: v === 0 && (!f || (f == null ? void 0 : f.isFirstItem)),
|
|
479
|
+
isLastItem: v === b.length - 1 && (!f || (f == null ? void 0 : f.isLastItem))
|
|
480
|
+
}, E);
|
|
481
|
+
}), [r, b, f]);
|
|
482
|
+
return b.length === 0 ? null : C(/* @__PURE__ */ m.createElement("div", Object.assign({
|
|
483
|
+
className: x
|
|
484
|
+
}, d), w));
|
|
485
|
+
};
|
|
486
|
+
var rr = function(e, t) {
|
|
487
|
+
var o = {};
|
|
488
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
|
|
489
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
|
|
490
|
+
t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (o[r[n]] = e[r[n]]);
|
|
491
|
+
return o;
|
|
492
|
+
};
|
|
493
|
+
const _t = /* @__PURE__ */ m.createContext(void 0), nr = (e) => {
|
|
494
|
+
const {
|
|
495
|
+
getPrefixCls: t,
|
|
496
|
+
direction: o
|
|
497
|
+
} = m.useContext(re), {
|
|
498
|
+
prefixCls: r,
|
|
499
|
+
size: n,
|
|
500
|
+
className: a
|
|
501
|
+
} = e, i = rr(e, ["prefixCls", "size", "className"]), s = t("btn-group", r), [, , l] = We(), u = m.useMemo(() => {
|
|
502
|
+
switch (n) {
|
|
503
|
+
case "large":
|
|
504
|
+
return "lg";
|
|
505
|
+
case "small":
|
|
506
|
+
return "sm";
|
|
507
|
+
default:
|
|
508
|
+
return "";
|
|
509
|
+
}
|
|
510
|
+
}, [n]);
|
|
511
|
+
if (process.env.NODE_ENV !== "production") {
|
|
512
|
+
const g = Ge("Button.Group");
|
|
513
|
+
g.deprecated(!1, "Button.Group", "Space.Compact"), process.env.NODE_ENV !== "production" && g(!n || ["large", "small", "middle"].includes(n), "usage", "Invalid prop `size`.");
|
|
514
|
+
}
|
|
515
|
+
const d = N(s, {
|
|
516
|
+
[`${s}-${u}`]: u,
|
|
517
|
+
[`${s}-rtl`]: o === "rtl"
|
|
518
|
+
}, a, l);
|
|
519
|
+
return /* @__PURE__ */ m.createElement(_t.Provider, {
|
|
520
|
+
value: n
|
|
521
|
+
}, /* @__PURE__ */ m.createElement("div", Object.assign({}, i, {
|
|
522
|
+
className: d
|
|
523
|
+
})));
|
|
524
|
+
}, ct = /^[\u4E00-\u9FA5]{2}$/, Ae = ct.test.bind(ct);
|
|
525
|
+
function xn(e) {
|
|
526
|
+
return e === "danger" ? {
|
|
527
|
+
danger: !0
|
|
528
|
+
} : {
|
|
529
|
+
type: e
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
function ut(e) {
|
|
533
|
+
return typeof e == "string";
|
|
534
|
+
}
|
|
535
|
+
function ie(e) {
|
|
536
|
+
return e === "text" || e === "link";
|
|
537
|
+
}
|
|
538
|
+
function ar(e, t) {
|
|
539
|
+
if (e == null)
|
|
540
|
+
return;
|
|
541
|
+
const o = t ? " " : "";
|
|
542
|
+
return typeof e != "string" && typeof e != "number" && ut(e.type) && Ae(e.props.children) ? Rt(e, {
|
|
543
|
+
children: e.props.children.split("").join(o)
|
|
544
|
+
}) : ut(e) ? Ae(e) ? /* @__PURE__ */ c.createElement("span", null, e.split("").join(o)) : /* @__PURE__ */ c.createElement("span", null, e) : Eo(e) ? /* @__PURE__ */ c.createElement("span", null, e) : e;
|
|
545
|
+
}
|
|
546
|
+
function ir(e, t) {
|
|
547
|
+
let o = !1;
|
|
548
|
+
const r = [];
|
|
549
|
+
return c.Children.forEach(e, (n) => {
|
|
550
|
+
const a = typeof n, i = a === "string" || a === "number";
|
|
551
|
+
if (o && i) {
|
|
552
|
+
const s = r.length - 1, l = r[s];
|
|
553
|
+
r[s] = `${l}${n}`;
|
|
554
|
+
} else
|
|
555
|
+
r.push(n);
|
|
556
|
+
o = i;
|
|
557
|
+
}), c.Children.map(r, (n) => ar(n, t));
|
|
558
|
+
}
|
|
559
|
+
["default", "primary", "danger"].concat(lo(Ve));
|
|
560
|
+
const Me = /* @__PURE__ */ me((e, t) => {
|
|
561
|
+
const {
|
|
562
|
+
className: o,
|
|
563
|
+
style: r,
|
|
564
|
+
children: n,
|
|
565
|
+
prefixCls: a
|
|
566
|
+
} = e, i = N(`${a}-icon`, o);
|
|
567
|
+
return /* @__PURE__ */ c.createElement("span", {
|
|
568
|
+
ref: t,
|
|
569
|
+
className: i,
|
|
570
|
+
style: r
|
|
571
|
+
}, n);
|
|
572
|
+
}), dt = /* @__PURE__ */ me((e, t) => {
|
|
573
|
+
const {
|
|
574
|
+
prefixCls: o,
|
|
575
|
+
className: r,
|
|
576
|
+
style: n,
|
|
577
|
+
iconClassName: a
|
|
578
|
+
} = e, i = N(`${o}-loading-icon`, r);
|
|
579
|
+
return /* @__PURE__ */ c.createElement(Me, {
|
|
580
|
+
prefixCls: o,
|
|
581
|
+
className: i,
|
|
582
|
+
style: n,
|
|
583
|
+
ref: t
|
|
584
|
+
}, /* @__PURE__ */ c.createElement(wt, {
|
|
585
|
+
className: a
|
|
586
|
+
}));
|
|
587
|
+
}), He = () => ({
|
|
588
|
+
width: 0,
|
|
589
|
+
opacity: 0,
|
|
590
|
+
transform: "scale(0)"
|
|
591
|
+
}), ze = (e) => ({
|
|
592
|
+
width: e.scrollWidth,
|
|
593
|
+
opacity: 1,
|
|
594
|
+
transform: "scale(1)"
|
|
595
|
+
}), sr = (e) => {
|
|
596
|
+
const {
|
|
597
|
+
prefixCls: t,
|
|
598
|
+
loading: o,
|
|
599
|
+
existIcon: r,
|
|
600
|
+
className: n,
|
|
601
|
+
style: a,
|
|
602
|
+
mount: i
|
|
603
|
+
} = e, s = !!o;
|
|
604
|
+
return r ? /* @__PURE__ */ c.createElement(dt, {
|
|
605
|
+
prefixCls: t,
|
|
606
|
+
className: n,
|
|
607
|
+
style: a
|
|
608
|
+
}) : /* @__PURE__ */ c.createElement(bt, {
|
|
609
|
+
visible: s,
|
|
610
|
+
// Used for minus flex gap style only
|
|
611
|
+
motionName: `${t}-loading-icon-motion`,
|
|
612
|
+
motionAppear: !i,
|
|
613
|
+
motionEnter: !i,
|
|
614
|
+
motionLeave: !i,
|
|
615
|
+
removeOnLeave: !0,
|
|
616
|
+
onAppearStart: He,
|
|
617
|
+
onAppearActive: ze,
|
|
618
|
+
onEnterStart: He,
|
|
619
|
+
onEnterActive: ze,
|
|
620
|
+
onLeaveStart: ze,
|
|
621
|
+
onLeaveActive: He
|
|
622
|
+
}, (l, u) => {
|
|
623
|
+
let {
|
|
624
|
+
className: d,
|
|
625
|
+
style: g
|
|
626
|
+
} = l;
|
|
627
|
+
const p = Object.assign(Object.assign({}, a), g);
|
|
628
|
+
return /* @__PURE__ */ c.createElement(dt, {
|
|
629
|
+
prefixCls: t,
|
|
630
|
+
className: N(n, d),
|
|
631
|
+
style: p,
|
|
632
|
+
ref: u
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
}, mt = (e, t) => ({
|
|
636
|
+
// Border
|
|
637
|
+
[`> span, > ${e}`]: {
|
|
638
|
+
"&:not(:last-child)": {
|
|
639
|
+
[`&, & > ${e}`]: {
|
|
640
|
+
"&:not(:disabled)": {
|
|
641
|
+
borderInlineEndColor: t
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
"&:not(:first-child)": {
|
|
646
|
+
[`&, & > ${e}`]: {
|
|
647
|
+
"&:not(:disabled)": {
|
|
648
|
+
borderInlineStartColor: t
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}), lr = (e) => {
|
|
654
|
+
const {
|
|
655
|
+
componentCls: t,
|
|
656
|
+
fontSize: o,
|
|
657
|
+
lineWidth: r,
|
|
658
|
+
groupBorderColor: n,
|
|
659
|
+
colorErrorHover: a
|
|
660
|
+
} = e;
|
|
661
|
+
return {
|
|
662
|
+
[`${t}-group`]: [
|
|
663
|
+
{
|
|
664
|
+
position: "relative",
|
|
665
|
+
display: "inline-flex",
|
|
666
|
+
// Border
|
|
667
|
+
[`> span, > ${t}`]: {
|
|
668
|
+
"&:not(:last-child)": {
|
|
669
|
+
[`&, & > ${t}`]: {
|
|
670
|
+
borderStartEndRadius: 0,
|
|
671
|
+
borderEndEndRadius: 0
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
"&:not(:first-child)": {
|
|
675
|
+
marginInlineStart: e.calc(r).mul(-1).equal(),
|
|
676
|
+
[`&, & > ${t}`]: {
|
|
677
|
+
borderStartStartRadius: 0,
|
|
678
|
+
borderEndStartRadius: 0
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
[t]: {
|
|
683
|
+
position: "relative",
|
|
684
|
+
zIndex: 1,
|
|
685
|
+
"&:hover, &:focus, &:active": {
|
|
686
|
+
zIndex: 2
|
|
687
|
+
},
|
|
688
|
+
"&[disabled]": {
|
|
689
|
+
zIndex: 0
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
[`${t}-icon-only`]: {
|
|
693
|
+
fontSize: o
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
// Border Color
|
|
697
|
+
mt(`${t}-primary`, n),
|
|
698
|
+
mt(`${t}-danger`, a)
|
|
699
|
+
]
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
var cr = ["b"], ur = ["v"], Pe = function(t) {
|
|
703
|
+
return Math.round(Number(t || 0));
|
|
704
|
+
}, dr = function(t) {
|
|
705
|
+
if (t instanceof Ot)
|
|
706
|
+
return t;
|
|
707
|
+
if (t && vt(t) === "object" && "h" in t && "b" in t) {
|
|
708
|
+
var o = t, r = o.b, n = Et(o, cr);
|
|
709
|
+
return M(M({}, n), {}, {
|
|
710
|
+
v: r
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
return typeof t == "string" && /hsb/.test(t) ? t.replace(/hsb/, "hsv") : t;
|
|
714
|
+
}, U = /* @__PURE__ */ function(e) {
|
|
715
|
+
co(o, e);
|
|
716
|
+
var t = uo(o);
|
|
717
|
+
function o(r) {
|
|
718
|
+
return St(this, o), t.call(this, dr(r));
|
|
719
|
+
}
|
|
720
|
+
return xt(o, [{
|
|
721
|
+
key: "toHsbString",
|
|
722
|
+
value: function() {
|
|
723
|
+
var n = this.toHsb(), a = Pe(n.s * 100), i = Pe(n.b * 100), s = Pe(n.h), l = n.a, u = "hsb(".concat(s, ", ").concat(a, "%, ").concat(i, "%)"), d = "hsba(".concat(s, ", ").concat(a, "%, ").concat(i, "%, ").concat(l.toFixed(l === 0 ? 0 : 2), ")");
|
|
724
|
+
return l === 1 ? u : d;
|
|
725
|
+
}
|
|
726
|
+
}, {
|
|
727
|
+
key: "toHsb",
|
|
728
|
+
value: function() {
|
|
729
|
+
var n = this.toHsv(), a = n.v, i = Et(n, ur);
|
|
730
|
+
return M(M({}, i), {}, {
|
|
731
|
+
b: a,
|
|
732
|
+
a: this.a
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
}]), o;
|
|
736
|
+
}(Ot), mr = "rc-color-picker", K = function(t) {
|
|
737
|
+
return t instanceof U ? t : new U(t);
|
|
738
|
+
}, gr = K("#1677ff"), jt = function(t) {
|
|
739
|
+
var o = t.offset, r = t.targetRef, n = t.containerRef, a = t.color, i = t.type, s = n.current.getBoundingClientRect(), l = s.width, u = s.height, d = r.current.getBoundingClientRect(), g = d.width, p = d.height, C = g / 2, h = p / 2, x = (o.x + C) / l, f = 1 - (o.y + h) / u, b = a.toHsb(), w = x, E = (o.x + C) / l * 360;
|
|
740
|
+
if (i)
|
|
741
|
+
switch (i) {
|
|
742
|
+
case "hue":
|
|
743
|
+
return K(M(M({}, b), {}, {
|
|
744
|
+
h: E <= 0 ? 0 : E
|
|
745
|
+
}));
|
|
746
|
+
case "alpha":
|
|
747
|
+
return K(M(M({}, b), {}, {
|
|
748
|
+
a: w <= 0 ? 0 : w
|
|
749
|
+
}));
|
|
750
|
+
}
|
|
751
|
+
return K({
|
|
752
|
+
h: b.h,
|
|
753
|
+
s: x <= 0 ? 0 : x,
|
|
754
|
+
b: f >= 1 ? 1 : f,
|
|
755
|
+
a: b.a
|
|
756
|
+
});
|
|
757
|
+
}, Tt = function(t, o) {
|
|
758
|
+
var r = t.toHsb();
|
|
759
|
+
switch (o) {
|
|
760
|
+
case "hue":
|
|
761
|
+
return {
|
|
762
|
+
x: r.h / 360 * 100,
|
|
763
|
+
y: 50
|
|
764
|
+
};
|
|
765
|
+
case "alpha":
|
|
766
|
+
return {
|
|
767
|
+
x: t.a * 100,
|
|
768
|
+
y: 50
|
|
769
|
+
};
|
|
770
|
+
// Picker panel
|
|
771
|
+
default:
|
|
772
|
+
return {
|
|
773
|
+
x: r.s * 100,
|
|
774
|
+
y: (1 - r.b) * 100
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
}, fr = function(t) {
|
|
778
|
+
var o = t.color, r = t.prefixCls, n = t.className, a = t.style, i = t.onClick, s = "".concat(r, "-color-block");
|
|
779
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
780
|
+
className: N(s, n),
|
|
781
|
+
style: a,
|
|
782
|
+
onClick: i
|
|
783
|
+
}, /* @__PURE__ */ c.createElement("div", {
|
|
784
|
+
className: "".concat(s, "-inner"),
|
|
785
|
+
style: {
|
|
786
|
+
background: o
|
|
787
|
+
}
|
|
788
|
+
}));
|
|
789
|
+
};
|
|
790
|
+
function pr(e) {
|
|
791
|
+
var t = "touches" in e ? e.touches[0] : e, o = document.documentElement.scrollLeft || document.body.scrollLeft || window.pageXOffset, r = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset;
|
|
792
|
+
return {
|
|
793
|
+
pageX: t.pageX - o,
|
|
794
|
+
pageY: t.pageY - r
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
function Dt(e) {
|
|
798
|
+
var t = e.targetRef, o = e.containerRef, r = e.direction, n = e.onDragChange, a = e.onDragChangeComplete, i = e.calculate, s = e.color, l = e.disabledDrag, u = je({
|
|
799
|
+
x: 0,
|
|
800
|
+
y: 0
|
|
801
|
+
}), d = J(u, 2), g = d[0], p = d[1], C = D(null), h = D(null);
|
|
802
|
+
te(function() {
|
|
803
|
+
p(i());
|
|
804
|
+
}, [s]), te(function() {
|
|
805
|
+
return function() {
|
|
806
|
+
document.removeEventListener("mousemove", C.current), document.removeEventListener("mouseup", h.current), document.removeEventListener("touchmove", C.current), document.removeEventListener("touchend", h.current), C.current = null, h.current = null;
|
|
807
|
+
};
|
|
808
|
+
}, []);
|
|
809
|
+
var x = function(v) {
|
|
810
|
+
var y = pr(v), B = y.pageX, _ = y.pageY, S = o.current.getBoundingClientRect(), $ = S.x, H = S.y, z = S.width, j = S.height, P = t.current.getBoundingClientRect(), q = P.width, L = P.height, G = q / 2, Z = L / 2, A = Math.max(0, Math.min(B - $, z)) - G, I = Math.max(0, Math.min(_ - H, j)) - Z, Q = {
|
|
811
|
+
x: A,
|
|
812
|
+
y: r === "x" ? g.y : I
|
|
813
|
+
};
|
|
814
|
+
if (q === 0 && L === 0 || q !== L)
|
|
815
|
+
return !1;
|
|
816
|
+
n == null || n(Q);
|
|
817
|
+
}, f = function(v) {
|
|
818
|
+
v.preventDefault(), x(v);
|
|
819
|
+
}, b = function(v) {
|
|
820
|
+
v.preventDefault(), document.removeEventListener("mousemove", C.current), document.removeEventListener("mouseup", h.current), document.removeEventListener("touchmove", C.current), document.removeEventListener("touchend", h.current), C.current = null, h.current = null, a == null || a();
|
|
821
|
+
}, w = function(v) {
|
|
822
|
+
document.removeEventListener("mousemove", C.current), document.removeEventListener("mouseup", h.current), !l && (x(v), document.addEventListener("mousemove", f), document.addEventListener("mouseup", b), document.addEventListener("touchmove", f), document.addEventListener("touchend", b), C.current = f, h.current = b);
|
|
823
|
+
};
|
|
824
|
+
return [g, w];
|
|
825
|
+
}
|
|
826
|
+
var Lt = function(t) {
|
|
827
|
+
var o = t.size, r = o === void 0 ? "default" : o, n = t.color, a = t.prefixCls;
|
|
828
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
829
|
+
className: N("".concat(a, "-handler"), Te({}, "".concat(a, "-handler-sm"), r === "small")),
|
|
830
|
+
style: {
|
|
831
|
+
backgroundColor: n
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
}, At = function(t) {
|
|
835
|
+
var o = t.children, r = t.style, n = t.prefixCls;
|
|
836
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
837
|
+
className: "".concat(n, "-palette"),
|
|
838
|
+
style: M({
|
|
839
|
+
position: "relative"
|
|
840
|
+
}, r)
|
|
841
|
+
}, o);
|
|
842
|
+
}, Mt = /* @__PURE__ */ me(function(e, t) {
|
|
843
|
+
var o = e.children, r = e.x, n = e.y;
|
|
844
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
845
|
+
ref: t,
|
|
846
|
+
style: {
|
|
847
|
+
position: "absolute",
|
|
848
|
+
left: "".concat(r, "%"),
|
|
849
|
+
top: "".concat(n, "%"),
|
|
850
|
+
zIndex: 1,
|
|
851
|
+
transform: "translate(-50%, -50%)"
|
|
852
|
+
}
|
|
853
|
+
}, o);
|
|
854
|
+
}), vr = function(t) {
|
|
855
|
+
var o = t.color, r = t.onChange, n = t.prefixCls, a = t.onChangeComplete, i = t.disabled, s = D(), l = D(), u = D(o), d = Fe(function(x) {
|
|
856
|
+
var f = jt({
|
|
857
|
+
offset: x,
|
|
858
|
+
targetRef: l,
|
|
859
|
+
containerRef: s,
|
|
860
|
+
color: o
|
|
861
|
+
});
|
|
862
|
+
u.current = f, r(f);
|
|
863
|
+
}), g = Dt({
|
|
864
|
+
color: o,
|
|
865
|
+
containerRef: s,
|
|
866
|
+
targetRef: l,
|
|
867
|
+
calculate: function() {
|
|
868
|
+
return Tt(o);
|
|
869
|
+
},
|
|
870
|
+
onDragChange: d,
|
|
871
|
+
onDragChangeComplete: function() {
|
|
872
|
+
return a == null ? void 0 : a(u.current);
|
|
873
|
+
},
|
|
874
|
+
disabledDrag: i
|
|
875
|
+
}), p = J(g, 2), C = p[0], h = p[1];
|
|
876
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
877
|
+
ref: s,
|
|
878
|
+
className: "".concat(n, "-select"),
|
|
879
|
+
onMouseDown: h,
|
|
880
|
+
onTouchStart: h
|
|
881
|
+
}, /* @__PURE__ */ c.createElement(At, {
|
|
882
|
+
prefixCls: n
|
|
883
|
+
}, /* @__PURE__ */ c.createElement(Mt, {
|
|
884
|
+
x: C.x,
|
|
885
|
+
y: C.y,
|
|
886
|
+
ref: l
|
|
887
|
+
}, /* @__PURE__ */ c.createElement(Lt, {
|
|
888
|
+
color: o.toRgbString(),
|
|
889
|
+
prefixCls: n
|
|
890
|
+
})), /* @__PURE__ */ c.createElement("div", {
|
|
891
|
+
className: "".concat(n, "-saturation"),
|
|
892
|
+
style: {
|
|
893
|
+
backgroundColor: "hsl(".concat(o.toHsb().h, ",100%, 50%)"),
|
|
894
|
+
backgroundImage: "linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"
|
|
895
|
+
}
|
|
896
|
+
})));
|
|
897
|
+
}, br = function(t, o) {
|
|
898
|
+
var r = $t(t, {
|
|
899
|
+
value: o
|
|
900
|
+
}), n = J(r, 2), a = n[0], i = n[1], s = oe(function() {
|
|
901
|
+
return K(a);
|
|
902
|
+
}, [a]);
|
|
903
|
+
return [s, i];
|
|
904
|
+
}, Cr = function(t) {
|
|
905
|
+
var o = t.colors, r = t.children, n = t.direction, a = n === void 0 ? "to right" : n, i = t.type, s = t.prefixCls, l = oe(function() {
|
|
906
|
+
return o.map(function(u, d) {
|
|
907
|
+
var g = K(u);
|
|
908
|
+
return i === "alpha" && d === o.length - 1 && (g = new U(g.setA(1))), g.toRgbString();
|
|
909
|
+
}).join(",");
|
|
910
|
+
}, [o, i]);
|
|
911
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
912
|
+
className: "".concat(s, "-gradient"),
|
|
913
|
+
style: {
|
|
914
|
+
position: "absolute",
|
|
915
|
+
inset: 0,
|
|
916
|
+
background: "linear-gradient(".concat(a, ", ").concat(l, ")")
|
|
917
|
+
}
|
|
918
|
+
}, r);
|
|
919
|
+
}, hr = function(t) {
|
|
920
|
+
var o = t.prefixCls, r = t.colors, n = t.disabled, a = t.onChange, i = t.onChangeComplete, s = t.color, l = t.type, u = D(), d = D(), g = D(s), p = function(y) {
|
|
921
|
+
return l === "hue" ? y.getHue() : y.a * 100;
|
|
922
|
+
}, C = Fe(function(v) {
|
|
923
|
+
var y = jt({
|
|
924
|
+
offset: v,
|
|
925
|
+
targetRef: d,
|
|
926
|
+
containerRef: u,
|
|
927
|
+
color: s,
|
|
928
|
+
type: l
|
|
929
|
+
});
|
|
930
|
+
g.current = y, a(p(y));
|
|
931
|
+
}), h = Dt({
|
|
932
|
+
color: s,
|
|
933
|
+
targetRef: d,
|
|
934
|
+
containerRef: u,
|
|
935
|
+
calculate: function() {
|
|
936
|
+
return Tt(s, l);
|
|
937
|
+
},
|
|
938
|
+
onDragChange: C,
|
|
939
|
+
onDragChangeComplete: function() {
|
|
940
|
+
i(p(g.current));
|
|
941
|
+
},
|
|
942
|
+
direction: "x",
|
|
943
|
+
disabledDrag: n
|
|
944
|
+
}), x = J(h, 2), f = x[0], b = x[1], w = c.useMemo(function() {
|
|
945
|
+
if (l === "hue") {
|
|
946
|
+
var v = s.toHsb();
|
|
947
|
+
v.s = 1, v.b = 1, v.a = 1;
|
|
948
|
+
var y = new U(v);
|
|
949
|
+
return y;
|
|
950
|
+
}
|
|
951
|
+
return s;
|
|
952
|
+
}, [s, l]), E = c.useMemo(function() {
|
|
953
|
+
return r.map(function(v) {
|
|
954
|
+
return "".concat(v.color, " ").concat(v.percent, "%");
|
|
955
|
+
});
|
|
956
|
+
}, [r]);
|
|
957
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
958
|
+
ref: u,
|
|
959
|
+
className: N("".concat(o, "-slider"), "".concat(o, "-slider-").concat(l)),
|
|
960
|
+
onMouseDown: b,
|
|
961
|
+
onTouchStart: b
|
|
962
|
+
}, /* @__PURE__ */ c.createElement(At, {
|
|
963
|
+
prefixCls: o
|
|
964
|
+
}, /* @__PURE__ */ c.createElement(Mt, {
|
|
965
|
+
x: f.x,
|
|
966
|
+
y: f.y,
|
|
967
|
+
ref: d
|
|
968
|
+
}, /* @__PURE__ */ c.createElement(Lt, {
|
|
969
|
+
size: "small",
|
|
970
|
+
color: w.toHexString(),
|
|
971
|
+
prefixCls: o
|
|
972
|
+
})), /* @__PURE__ */ c.createElement(Cr, {
|
|
973
|
+
colors: E,
|
|
974
|
+
type: l,
|
|
975
|
+
prefixCls: o
|
|
976
|
+
})));
|
|
977
|
+
};
|
|
978
|
+
function yr(e) {
|
|
979
|
+
return m.useMemo(function() {
|
|
980
|
+
var t = e || {}, o = t.slider;
|
|
981
|
+
return [o || hr];
|
|
982
|
+
}, [e]);
|
|
983
|
+
}
|
|
984
|
+
var Sr = [{
|
|
985
|
+
color: "rgb(255, 0, 0)",
|
|
986
|
+
percent: 0
|
|
987
|
+
}, {
|
|
988
|
+
color: "rgb(255, 255, 0)",
|
|
989
|
+
percent: 17
|
|
990
|
+
}, {
|
|
991
|
+
color: "rgb(0, 255, 0)",
|
|
992
|
+
percent: 33
|
|
993
|
+
}, {
|
|
994
|
+
color: "rgb(0, 255, 255)",
|
|
995
|
+
percent: 50
|
|
996
|
+
}, {
|
|
997
|
+
color: "rgb(0, 0, 255)",
|
|
998
|
+
percent: 67
|
|
999
|
+
}, {
|
|
1000
|
+
color: "rgb(255, 0, 255)",
|
|
1001
|
+
percent: 83
|
|
1002
|
+
}, {
|
|
1003
|
+
color: "rgb(255, 0, 0)",
|
|
1004
|
+
percent: 100
|
|
1005
|
+
}], xr = /* @__PURE__ */ me(function(e, t) {
|
|
1006
|
+
var o = e.value, r = e.defaultValue, n = e.prefixCls, a = n === void 0 ? mr : n, i = e.onChange, s = e.onChangeComplete, l = e.className, u = e.style, d = e.panelRender, g = e.disabledAlpha, p = g === void 0 ? !1 : g, C = e.disabled, h = C === void 0 ? !1 : C, x = e.components, f = yr(x), b = J(f, 1), w = b[0], E = br(r || gr, o), v = J(E, 2), y = v[0], B = v[1], _ = oe(function() {
|
|
1007
|
+
return y.setA(1).toRgbString();
|
|
1008
|
+
}, [y]), S = function(I, Q) {
|
|
1009
|
+
o || B(I), i == null || i(I, Q);
|
|
1010
|
+
}, $ = function(I) {
|
|
1011
|
+
return new U(y.setHue(I));
|
|
1012
|
+
}, H = function(I) {
|
|
1013
|
+
return new U(y.setA(I / 100));
|
|
1014
|
+
}, z = function(I) {
|
|
1015
|
+
S($(I), {
|
|
1016
|
+
type: "hue",
|
|
1017
|
+
value: I
|
|
1018
|
+
});
|
|
1019
|
+
}, j = function(I) {
|
|
1020
|
+
S(H(I), {
|
|
1021
|
+
type: "alpha",
|
|
1022
|
+
value: I
|
|
1023
|
+
});
|
|
1024
|
+
}, P = function(I) {
|
|
1025
|
+
s && s($(I));
|
|
1026
|
+
}, q = function(I) {
|
|
1027
|
+
s && s(H(I));
|
|
1028
|
+
}, L = N("".concat(a, "-panel"), l, Te({}, "".concat(a, "-panel-disabled"), h)), G = {
|
|
1029
|
+
prefixCls: a,
|
|
1030
|
+
disabled: h,
|
|
1031
|
+
color: y
|
|
1032
|
+
}, Z = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(vr, se({
|
|
1033
|
+
onChange: S
|
|
1034
|
+
}, G, {
|
|
1035
|
+
onChangeComplete: s
|
|
1036
|
+
})), /* @__PURE__ */ c.createElement("div", {
|
|
1037
|
+
className: "".concat(a, "-slider-container")
|
|
1038
|
+
}, /* @__PURE__ */ c.createElement("div", {
|
|
1039
|
+
className: N("".concat(a, "-slider-group"), Te({}, "".concat(a, "-slider-group-disabled-alpha"), p))
|
|
1040
|
+
}, /* @__PURE__ */ c.createElement(w, se({}, G, {
|
|
1041
|
+
type: "hue",
|
|
1042
|
+
colors: Sr,
|
|
1043
|
+
min: 0,
|
|
1044
|
+
max: 359,
|
|
1045
|
+
value: y.getHue(),
|
|
1046
|
+
onChange: z,
|
|
1047
|
+
onChangeComplete: P
|
|
1048
|
+
})), !p && /* @__PURE__ */ c.createElement(w, se({}, G, {
|
|
1049
|
+
type: "alpha",
|
|
1050
|
+
colors: [{
|
|
1051
|
+
percent: 0,
|
|
1052
|
+
color: "rgba(255, 0, 4, 0)"
|
|
1053
|
+
}, {
|
|
1054
|
+
percent: 100,
|
|
1055
|
+
color: _
|
|
1056
|
+
}],
|
|
1057
|
+
min: 0,
|
|
1058
|
+
max: 100,
|
|
1059
|
+
value: y.a * 100,
|
|
1060
|
+
onChange: j,
|
|
1061
|
+
onChangeComplete: q
|
|
1062
|
+
}))), /* @__PURE__ */ c.createElement(fr, {
|
|
1063
|
+
color: y.toRgbString(),
|
|
1064
|
+
prefixCls: a
|
|
1065
|
+
})));
|
|
1066
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
1067
|
+
className: L,
|
|
1068
|
+
style: u,
|
|
1069
|
+
ref: t
|
|
1070
|
+
}, typeof d == "function" ? d(Z) : Z);
|
|
1071
|
+
});
|
|
1072
|
+
process.env.NODE_ENV !== "production" && (xr.displayName = "ColorPicker");
|
|
1073
|
+
const Er = (e, t) => (e == null ? void 0 : e.replace(/[^\w/]/g, "").slice(0, t ? 8 : 6)) || "", Or = (e, t) => e ? Er(e, t) : "";
|
|
1074
|
+
let $r = /* @__PURE__ */ function() {
|
|
1075
|
+
function e(t) {
|
|
1076
|
+
St(this, e);
|
|
1077
|
+
var o;
|
|
1078
|
+
if (this.cleared = !1, t instanceof e) {
|
|
1079
|
+
this.metaColor = t.metaColor.clone(), this.colors = (o = t.colors) === null || o === void 0 ? void 0 : o.map((n) => ({
|
|
1080
|
+
color: new e(n.color),
|
|
1081
|
+
percent: n.percent
|
|
1082
|
+
})), this.cleared = t.cleared;
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
const r = Array.isArray(t);
|
|
1086
|
+
r && t.length ? (this.colors = t.map((n) => {
|
|
1087
|
+
let {
|
|
1088
|
+
color: a,
|
|
1089
|
+
percent: i
|
|
1090
|
+
} = n;
|
|
1091
|
+
return {
|
|
1092
|
+
color: new e(a),
|
|
1093
|
+
percent: i
|
|
1094
|
+
};
|
|
1095
|
+
}), this.metaColor = new U(this.colors[0].color.metaColor)) : this.metaColor = new U(r ? "" : t), (!t || r && !this.colors) && (this.metaColor = this.metaColor.setA(0), this.cleared = !0);
|
|
1096
|
+
}
|
|
1097
|
+
return xt(e, [{
|
|
1098
|
+
key: "toHsb",
|
|
1099
|
+
value: function() {
|
|
1100
|
+
return this.metaColor.toHsb();
|
|
1101
|
+
}
|
|
1102
|
+
}, {
|
|
1103
|
+
key: "toHsbString",
|
|
1104
|
+
value: function() {
|
|
1105
|
+
return this.metaColor.toHsbString();
|
|
1106
|
+
}
|
|
1107
|
+
}, {
|
|
1108
|
+
key: "toHex",
|
|
1109
|
+
value: function() {
|
|
1110
|
+
return Or(this.toHexString(), this.metaColor.a < 1);
|
|
1111
|
+
}
|
|
1112
|
+
}, {
|
|
1113
|
+
key: "toHexString",
|
|
1114
|
+
value: function() {
|
|
1115
|
+
return this.metaColor.toHexString();
|
|
1116
|
+
}
|
|
1117
|
+
}, {
|
|
1118
|
+
key: "toRgb",
|
|
1119
|
+
value: function() {
|
|
1120
|
+
return this.metaColor.toRgb();
|
|
1121
|
+
}
|
|
1122
|
+
}, {
|
|
1123
|
+
key: "toRgbString",
|
|
1124
|
+
value: function() {
|
|
1125
|
+
return this.metaColor.toRgbString();
|
|
1126
|
+
}
|
|
1127
|
+
}, {
|
|
1128
|
+
key: "isGradient",
|
|
1129
|
+
value: function() {
|
|
1130
|
+
return !!this.colors && !this.cleared;
|
|
1131
|
+
}
|
|
1132
|
+
}, {
|
|
1133
|
+
key: "getColors",
|
|
1134
|
+
value: function() {
|
|
1135
|
+
return this.colors || [{
|
|
1136
|
+
color: this,
|
|
1137
|
+
percent: 0
|
|
1138
|
+
}];
|
|
1139
|
+
}
|
|
1140
|
+
}, {
|
|
1141
|
+
key: "toCssString",
|
|
1142
|
+
value: function() {
|
|
1143
|
+
const {
|
|
1144
|
+
colors: o
|
|
1145
|
+
} = this;
|
|
1146
|
+
return o ? `linear-gradient(90deg, ${o.map((n) => `${n.color.toRgbString()} ${n.percent}%`).join(", ")})` : this.metaColor.toRgbString();
|
|
1147
|
+
}
|
|
1148
|
+
}, {
|
|
1149
|
+
key: "equals",
|
|
1150
|
+
value: function(o) {
|
|
1151
|
+
return !o || this.isGradient() !== o.isGradient() ? !1 : this.isGradient() ? this.colors.length === o.colors.length && this.colors.every((r, n) => {
|
|
1152
|
+
const a = o.colors[n];
|
|
1153
|
+
return r.percent === a.percent && r.color.equals(a.color);
|
|
1154
|
+
}) : this.toHexString() === o.toHexString();
|
|
1155
|
+
}
|
|
1156
|
+
}]);
|
|
1157
|
+
}();
|
|
1158
|
+
const Ir = new T("antZoomIn", {
|
|
1159
|
+
"0%": {
|
|
1160
|
+
transform: "scale(0.2)",
|
|
1161
|
+
opacity: 0
|
|
1162
|
+
},
|
|
1163
|
+
"100%": {
|
|
1164
|
+
transform: "scale(1)",
|
|
1165
|
+
opacity: 1
|
|
1166
|
+
}
|
|
1167
|
+
}), Rr = new T("antZoomOut", {
|
|
1168
|
+
"0%": {
|
|
1169
|
+
transform: "scale(1)"
|
|
1170
|
+
},
|
|
1171
|
+
"100%": {
|
|
1172
|
+
transform: "scale(0.2)",
|
|
1173
|
+
opacity: 0
|
|
1174
|
+
}
|
|
1175
|
+
}), gt = new T("antZoomBigIn", {
|
|
1176
|
+
"0%": {
|
|
1177
|
+
transform: "scale(0.8)",
|
|
1178
|
+
opacity: 0
|
|
1179
|
+
},
|
|
1180
|
+
"100%": {
|
|
1181
|
+
transform: "scale(1)",
|
|
1182
|
+
opacity: 1
|
|
1183
|
+
}
|
|
1184
|
+
}), ft = new T("antZoomBigOut", {
|
|
1185
|
+
"0%": {
|
|
1186
|
+
transform: "scale(1)"
|
|
1187
|
+
},
|
|
1188
|
+
"100%": {
|
|
1189
|
+
transform: "scale(0.8)",
|
|
1190
|
+
opacity: 0
|
|
1191
|
+
}
|
|
1192
|
+
}), wr = new T("antZoomUpIn", {
|
|
1193
|
+
"0%": {
|
|
1194
|
+
transform: "scale(0.8)",
|
|
1195
|
+
transformOrigin: "50% 0%",
|
|
1196
|
+
opacity: 0
|
|
1197
|
+
},
|
|
1198
|
+
"100%": {
|
|
1199
|
+
transform: "scale(1)",
|
|
1200
|
+
transformOrigin: "50% 0%"
|
|
1201
|
+
}
|
|
1202
|
+
}), Br = new T("antZoomUpOut", {
|
|
1203
|
+
"0%": {
|
|
1204
|
+
transform: "scale(1)",
|
|
1205
|
+
transformOrigin: "50% 0%"
|
|
1206
|
+
},
|
|
1207
|
+
"100%": {
|
|
1208
|
+
transform: "scale(0.8)",
|
|
1209
|
+
transformOrigin: "50% 0%",
|
|
1210
|
+
opacity: 0
|
|
1211
|
+
}
|
|
1212
|
+
}), Nr = new T("antZoomLeftIn", {
|
|
1213
|
+
"0%": {
|
|
1214
|
+
transform: "scale(0.8)",
|
|
1215
|
+
transformOrigin: "0% 50%",
|
|
1216
|
+
opacity: 0
|
|
1217
|
+
},
|
|
1218
|
+
"100%": {
|
|
1219
|
+
transform: "scale(1)",
|
|
1220
|
+
transformOrigin: "0% 50%"
|
|
1221
|
+
}
|
|
1222
|
+
}), Hr = new T("antZoomLeftOut", {
|
|
1223
|
+
"0%": {
|
|
1224
|
+
transform: "scale(1)",
|
|
1225
|
+
transformOrigin: "0% 50%"
|
|
1226
|
+
},
|
|
1227
|
+
"100%": {
|
|
1228
|
+
transform: "scale(0.8)",
|
|
1229
|
+
transformOrigin: "0% 50%",
|
|
1230
|
+
opacity: 0
|
|
1231
|
+
}
|
|
1232
|
+
}), zr = new T("antZoomRightIn", {
|
|
1233
|
+
"0%": {
|
|
1234
|
+
transform: "scale(0.8)",
|
|
1235
|
+
transformOrigin: "100% 50%",
|
|
1236
|
+
opacity: 0
|
|
1237
|
+
},
|
|
1238
|
+
"100%": {
|
|
1239
|
+
transform: "scale(1)",
|
|
1240
|
+
transformOrigin: "100% 50%"
|
|
1241
|
+
}
|
|
1242
|
+
}), Pr = new T("antZoomRightOut", {
|
|
1243
|
+
"0%": {
|
|
1244
|
+
transform: "scale(1)",
|
|
1245
|
+
transformOrigin: "100% 50%"
|
|
1246
|
+
},
|
|
1247
|
+
"100%": {
|
|
1248
|
+
transform: "scale(0.8)",
|
|
1249
|
+
transformOrigin: "100% 50%",
|
|
1250
|
+
opacity: 0
|
|
1251
|
+
}
|
|
1252
|
+
}), _r = new T("antZoomDownIn", {
|
|
1253
|
+
"0%": {
|
|
1254
|
+
transform: "scale(0.8)",
|
|
1255
|
+
transformOrigin: "50% 100%",
|
|
1256
|
+
opacity: 0
|
|
1257
|
+
},
|
|
1258
|
+
"100%": {
|
|
1259
|
+
transform: "scale(1)",
|
|
1260
|
+
transformOrigin: "50% 100%"
|
|
1261
|
+
}
|
|
1262
|
+
}), jr = new T("antZoomDownOut", {
|
|
1263
|
+
"0%": {
|
|
1264
|
+
transform: "scale(1)",
|
|
1265
|
+
transformOrigin: "50% 100%"
|
|
1266
|
+
},
|
|
1267
|
+
"100%": {
|
|
1268
|
+
transform: "scale(0.8)",
|
|
1269
|
+
transformOrigin: "50% 100%",
|
|
1270
|
+
opacity: 0
|
|
1271
|
+
}
|
|
1272
|
+
}), Tr = {
|
|
1273
|
+
zoom: {
|
|
1274
|
+
inKeyframes: Ir,
|
|
1275
|
+
outKeyframes: Rr
|
|
1276
|
+
},
|
|
1277
|
+
"zoom-big": {
|
|
1278
|
+
inKeyframes: gt,
|
|
1279
|
+
outKeyframes: ft
|
|
1280
|
+
},
|
|
1281
|
+
"zoom-big-fast": {
|
|
1282
|
+
inKeyframes: gt,
|
|
1283
|
+
outKeyframes: ft
|
|
1284
|
+
},
|
|
1285
|
+
"zoom-left": {
|
|
1286
|
+
inKeyframes: Nr,
|
|
1287
|
+
outKeyframes: Hr
|
|
1288
|
+
},
|
|
1289
|
+
"zoom-right": {
|
|
1290
|
+
inKeyframes: zr,
|
|
1291
|
+
outKeyframes: Pr
|
|
1292
|
+
},
|
|
1293
|
+
"zoom-up": {
|
|
1294
|
+
inKeyframes: wr,
|
|
1295
|
+
outKeyframes: Br
|
|
1296
|
+
},
|
|
1297
|
+
"zoom-down": {
|
|
1298
|
+
inKeyframes: _r,
|
|
1299
|
+
outKeyframes: jr
|
|
1300
|
+
}
|
|
1301
|
+
}, En = (e, t) => {
|
|
1302
|
+
const {
|
|
1303
|
+
antCls: o
|
|
1304
|
+
} = e, r = `${o}-${t}`, {
|
|
1305
|
+
inKeyframes: n,
|
|
1306
|
+
outKeyframes: a
|
|
1307
|
+
} = Tr[t];
|
|
1308
|
+
return [mo(r, n, a, t === "zoom-big-fast" ? e.motionDurationFast : e.motionDurationMid), {
|
|
1309
|
+
[`
|
|
1310
|
+
${r}-enter,
|
|
1311
|
+
${r}-appear
|
|
1312
|
+
`]: {
|
|
1313
|
+
transform: "scale(0)",
|
|
1314
|
+
opacity: 0,
|
|
1315
|
+
animationTimingFunction: e.motionEaseOutCirc,
|
|
1316
|
+
"&-prepare": {
|
|
1317
|
+
transform: "none"
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
[`${r}-leave`]: {
|
|
1321
|
+
animationTimingFunction: e.motionEaseInOutCirc
|
|
1322
|
+
}
|
|
1323
|
+
}];
|
|
1324
|
+
}, Dr = (e, t) => {
|
|
1325
|
+
const {
|
|
1326
|
+
r: o,
|
|
1327
|
+
g: r,
|
|
1328
|
+
b: n,
|
|
1329
|
+
a
|
|
1330
|
+
} = e.toRgb(), i = new U(e.toRgbString()).onBackground(t).toHsv();
|
|
1331
|
+
return a <= 0.5 ? i.v > 0.5 : o * 0.299 + r * 0.587 + n * 0.114 > 192;
|
|
1332
|
+
}, Wt = (e) => {
|
|
1333
|
+
const {
|
|
1334
|
+
paddingInline: t,
|
|
1335
|
+
onlyIconSize: o
|
|
1336
|
+
} = e;
|
|
1337
|
+
return ne(e, {
|
|
1338
|
+
buttonPaddingHorizontal: t,
|
|
1339
|
+
buttonPaddingVertical: 0,
|
|
1340
|
+
buttonIconOnlyFontSize: o
|
|
1341
|
+
});
|
|
1342
|
+
}, Gt = (e) => {
|
|
1343
|
+
var t, o, r, n, a, i;
|
|
1344
|
+
const s = (t = e.contentFontSize) !== null && t !== void 0 ? t : e.fontSize, l = (o = e.contentFontSizeSM) !== null && o !== void 0 ? o : e.fontSize, u = (r = e.contentFontSizeLG) !== null && r !== void 0 ? r : e.fontSizeLG, d = (n = e.contentLineHeight) !== null && n !== void 0 ? n : Re(s), g = (a = e.contentLineHeightSM) !== null && a !== void 0 ? a : Re(l), p = (i = e.contentLineHeightLG) !== null && i !== void 0 ? i : Re(u), C = Dr(new $r(e.colorBgSolid), "#fff") ? "#000" : "#fff", h = Ve.reduce((x, f) => Object.assign(Object.assign({}, x), {
|
|
1345
|
+
[`${f}ShadowColor`]: `0 ${ue(e.controlOutlineWidth)} 0 ${go(e[`${f}1`], e.colorBgContainer)}`
|
|
1346
|
+
}), {});
|
|
1347
|
+
return Object.assign(Object.assign({}, h), {
|
|
1348
|
+
fontWeight: 400,
|
|
1349
|
+
defaultShadow: `0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,
|
|
1350
|
+
primaryShadow: `0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,
|
|
1351
|
+
dangerShadow: `0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,
|
|
1352
|
+
primaryColor: e.colorTextLightSolid,
|
|
1353
|
+
dangerColor: e.colorTextLightSolid,
|
|
1354
|
+
borderColorDisabled: e.colorBorder,
|
|
1355
|
+
defaultGhostColor: e.colorBgContainer,
|
|
1356
|
+
ghostBg: "transparent",
|
|
1357
|
+
defaultGhostBorderColor: e.colorBgContainer,
|
|
1358
|
+
paddingInline: e.paddingContentHorizontal - e.lineWidth,
|
|
1359
|
+
paddingInlineLG: e.paddingContentHorizontal - e.lineWidth,
|
|
1360
|
+
paddingInlineSM: 8 - e.lineWidth,
|
|
1361
|
+
onlyIconSize: "inherit",
|
|
1362
|
+
onlyIconSizeSM: "inherit",
|
|
1363
|
+
onlyIconSizeLG: "inherit",
|
|
1364
|
+
groupBorderColor: e.colorPrimaryHover,
|
|
1365
|
+
linkHoverBg: "transparent",
|
|
1366
|
+
textTextColor: e.colorText,
|
|
1367
|
+
textTextHoverColor: e.colorText,
|
|
1368
|
+
textTextActiveColor: e.colorText,
|
|
1369
|
+
textHoverBg: e.colorFillTertiary,
|
|
1370
|
+
defaultColor: e.colorText,
|
|
1371
|
+
defaultBg: e.colorBgContainer,
|
|
1372
|
+
defaultBorderColor: e.colorBorder,
|
|
1373
|
+
defaultBorderColorDisabled: e.colorBorder,
|
|
1374
|
+
defaultHoverBg: e.colorBgContainer,
|
|
1375
|
+
defaultHoverColor: e.colorPrimaryHover,
|
|
1376
|
+
defaultHoverBorderColor: e.colorPrimaryHover,
|
|
1377
|
+
defaultActiveBg: e.colorBgContainer,
|
|
1378
|
+
defaultActiveColor: e.colorPrimaryActive,
|
|
1379
|
+
defaultActiveBorderColor: e.colorPrimaryActive,
|
|
1380
|
+
solidTextColor: C,
|
|
1381
|
+
contentFontSize: s,
|
|
1382
|
+
contentFontSizeSM: l,
|
|
1383
|
+
contentFontSizeLG: u,
|
|
1384
|
+
contentLineHeight: d,
|
|
1385
|
+
contentLineHeightSM: g,
|
|
1386
|
+
contentLineHeightLG: p,
|
|
1387
|
+
paddingBlock: Math.max((e.controlHeight - s * d) / 2 - e.lineWidth, 0),
|
|
1388
|
+
paddingBlockSM: Math.max((e.controlHeightSM - l * g) / 2 - e.lineWidth, 0),
|
|
1389
|
+
paddingBlockLG: Math.max((e.controlHeightLG - u * p) / 2 - e.lineWidth, 0)
|
|
1390
|
+
});
|
|
1391
|
+
}, Lr = (e) => {
|
|
1392
|
+
const {
|
|
1393
|
+
componentCls: t,
|
|
1394
|
+
iconCls: o,
|
|
1395
|
+
fontWeight: r,
|
|
1396
|
+
opacityLoading: n,
|
|
1397
|
+
motionDurationSlow: a,
|
|
1398
|
+
motionEaseInOut: i,
|
|
1399
|
+
marginXS: s,
|
|
1400
|
+
calc: l
|
|
1401
|
+
} = e;
|
|
1402
|
+
return {
|
|
1403
|
+
[t]: {
|
|
1404
|
+
outline: "none",
|
|
1405
|
+
position: "relative",
|
|
1406
|
+
display: "inline-flex",
|
|
1407
|
+
gap: e.marginXS,
|
|
1408
|
+
alignItems: "center",
|
|
1409
|
+
justifyContent: "center",
|
|
1410
|
+
fontWeight: r,
|
|
1411
|
+
whiteSpace: "nowrap",
|
|
1412
|
+
textAlign: "center",
|
|
1413
|
+
backgroundImage: "none",
|
|
1414
|
+
background: "transparent",
|
|
1415
|
+
border: `${ue(e.lineWidth)} ${e.lineType} transparent`,
|
|
1416
|
+
cursor: "pointer",
|
|
1417
|
+
transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`,
|
|
1418
|
+
userSelect: "none",
|
|
1419
|
+
touchAction: "manipulation",
|
|
1420
|
+
color: e.colorText,
|
|
1421
|
+
"&:disabled > *": {
|
|
1422
|
+
pointerEvents: "none"
|
|
1423
|
+
},
|
|
1424
|
+
// https://github.com/ant-design/ant-design/issues/51380
|
|
1425
|
+
[`${t}-icon > svg`]: po(),
|
|
1426
|
+
"> a": {
|
|
1427
|
+
color: "currentColor"
|
|
1428
|
+
},
|
|
1429
|
+
"&:not(:disabled)": fo(e),
|
|
1430
|
+
[`&${t}-two-chinese-chars::first-letter`]: {
|
|
1431
|
+
letterSpacing: "0.34em"
|
|
1432
|
+
},
|
|
1433
|
+
[`&${t}-two-chinese-chars > *:not(${o})`]: {
|
|
1434
|
+
marginInlineEnd: "-0.34em",
|
|
1435
|
+
letterSpacing: "0.34em"
|
|
1436
|
+
},
|
|
1437
|
+
[`&${t}-icon-only`]: {
|
|
1438
|
+
paddingInline: 0,
|
|
1439
|
+
// make `btn-icon-only` not too narrow
|
|
1440
|
+
[`&${t}-compact-item`]: {
|
|
1441
|
+
flex: "none"
|
|
1442
|
+
},
|
|
1443
|
+
[`&${t}-round`]: {
|
|
1444
|
+
width: "auto"
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
// Loading
|
|
1448
|
+
[`&${t}-loading`]: {
|
|
1449
|
+
opacity: n,
|
|
1450
|
+
cursor: "default"
|
|
1451
|
+
},
|
|
1452
|
+
[`${t}-loading-icon`]: {
|
|
1453
|
+
transition: ["width", "opacity", "margin"].map((u) => `${u} ${a} ${i}`).join(",")
|
|
1454
|
+
},
|
|
1455
|
+
// iconPosition
|
|
1456
|
+
[`&:not(${t}-icon-end)`]: {
|
|
1457
|
+
[`${t}-loading-icon-motion`]: {
|
|
1458
|
+
"&-appear-start, &-enter-start": {
|
|
1459
|
+
marginInlineEnd: l(s).mul(-1).equal()
|
|
1460
|
+
},
|
|
1461
|
+
"&-appear-active, &-enter-active": {
|
|
1462
|
+
marginInlineEnd: 0
|
|
1463
|
+
},
|
|
1464
|
+
"&-leave-start": {
|
|
1465
|
+
marginInlineEnd: 0
|
|
1466
|
+
},
|
|
1467
|
+
"&-leave-active": {
|
|
1468
|
+
marginInlineEnd: l(s).mul(-1).equal()
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
"&-icon-end": {
|
|
1473
|
+
flexDirection: "row-reverse",
|
|
1474
|
+
[`${t}-loading-icon-motion`]: {
|
|
1475
|
+
"&-appear-start, &-enter-start": {
|
|
1476
|
+
marginInlineStart: l(s).mul(-1).equal()
|
|
1477
|
+
},
|
|
1478
|
+
"&-appear-active, &-enter-active": {
|
|
1479
|
+
marginInlineStart: 0
|
|
1480
|
+
},
|
|
1481
|
+
"&-leave-start": {
|
|
1482
|
+
marginInlineStart: 0
|
|
1483
|
+
},
|
|
1484
|
+
"&-leave-active": {
|
|
1485
|
+
marginInlineStart: l(s).mul(-1).equal()
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
}, Ft = (e, t, o) => ({
|
|
1492
|
+
[`&:not(:disabled):not(${e}-disabled)`]: {
|
|
1493
|
+
"&:hover": t,
|
|
1494
|
+
"&:active": o
|
|
1495
|
+
}
|
|
1496
|
+
}), Ar = (e) => ({
|
|
1497
|
+
minWidth: e.controlHeight,
|
|
1498
|
+
paddingInlineStart: 0,
|
|
1499
|
+
paddingInlineEnd: 0,
|
|
1500
|
+
borderRadius: "50%"
|
|
1501
|
+
}), Mr = (e) => ({
|
|
1502
|
+
borderRadius: e.controlHeight,
|
|
1503
|
+
paddingInlineStart: e.calc(e.controlHeight).div(2).equal(),
|
|
1504
|
+
paddingInlineEnd: e.calc(e.controlHeight).div(2).equal()
|
|
1505
|
+
}), Wr = (e) => ({
|
|
1506
|
+
cursor: "not-allowed",
|
|
1507
|
+
borderColor: e.borderColorDisabled,
|
|
1508
|
+
color: e.colorTextDisabled,
|
|
1509
|
+
background: e.colorBgContainerDisabled,
|
|
1510
|
+
boxShadow: "none"
|
|
1511
|
+
}), pe = (e, t, o, r, n, a, i, s) => ({
|
|
1512
|
+
[`&${e}-background-ghost`]: Object.assign(Object.assign({
|
|
1513
|
+
color: o || void 0,
|
|
1514
|
+
background: t,
|
|
1515
|
+
borderColor: r || void 0,
|
|
1516
|
+
boxShadow: "none"
|
|
1517
|
+
}, Ft(e, Object.assign({
|
|
1518
|
+
background: t
|
|
1519
|
+
}, i), Object.assign({
|
|
1520
|
+
background: t
|
|
1521
|
+
}, s))), {
|
|
1522
|
+
"&:disabled": {
|
|
1523
|
+
cursor: "not-allowed",
|
|
1524
|
+
color: n || void 0,
|
|
1525
|
+
borderColor: a || void 0
|
|
1526
|
+
}
|
|
1527
|
+
})
|
|
1528
|
+
}), Gr = (e) => ({
|
|
1529
|
+
[`&:disabled, &${e.componentCls}-disabled`]: Object.assign({}, Wr(e))
|
|
1530
|
+
}), Fr = (e) => ({
|
|
1531
|
+
[`&:disabled, &${e.componentCls}-disabled`]: {
|
|
1532
|
+
cursor: "not-allowed",
|
|
1533
|
+
color: e.colorTextDisabled
|
|
1534
|
+
}
|
|
1535
|
+
}), ve = (e, t, o, r) => {
|
|
1536
|
+
const a = r && ["link", "text"].includes(r) ? Fr : Gr;
|
|
1537
|
+
return Object.assign(Object.assign({}, a(e)), Ft(e.componentCls, t, o));
|
|
1538
|
+
}, be = (e, t, o, r, n) => ({
|
|
1539
|
+
[`&${e.componentCls}-variant-solid`]: Object.assign({
|
|
1540
|
+
color: t,
|
|
1541
|
+
background: o
|
|
1542
|
+
}, ve(e, r, n))
|
|
1543
|
+
}), Ce = (e, t, o, r, n) => ({
|
|
1544
|
+
[`&${e.componentCls}-variant-outlined, &${e.componentCls}-variant-dashed`]: Object.assign({
|
|
1545
|
+
borderColor: t,
|
|
1546
|
+
background: o
|
|
1547
|
+
}, ve(e, r, n))
|
|
1548
|
+
}), he = (e) => ({
|
|
1549
|
+
[`&${e.componentCls}-variant-dashed`]: {
|
|
1550
|
+
borderStyle: "dashed"
|
|
1551
|
+
}
|
|
1552
|
+
}), ye = (e, t, o, r) => ({
|
|
1553
|
+
[`&${e.componentCls}-variant-filled`]: Object.assign({
|
|
1554
|
+
boxShadow: "none",
|
|
1555
|
+
background: t
|
|
1556
|
+
}, ve(e, o, r))
|
|
1557
|
+
}), W = (e, t, o, r, n) => ({
|
|
1558
|
+
[`&${e.componentCls}-variant-${o}`]: Object.assign({
|
|
1559
|
+
color: t,
|
|
1560
|
+
boxShadow: "none"
|
|
1561
|
+
}, ve(e, r, n, o))
|
|
1562
|
+
}), Vr = (e) => {
|
|
1563
|
+
const {
|
|
1564
|
+
componentCls: t
|
|
1565
|
+
} = e;
|
|
1566
|
+
return Ve.reduce((o, r) => {
|
|
1567
|
+
const n = e[`${r}6`], a = e[`${r}1`], i = e[`${r}5`], s = e[`${r}2`], l = e[`${r}3`], u = e[`${r}7`];
|
|
1568
|
+
return Object.assign(Object.assign({}, o), {
|
|
1569
|
+
[`&${t}-color-${r}`]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
1570
|
+
color: n,
|
|
1571
|
+
boxShadow: e[`${r}ShadowColor`]
|
|
1572
|
+
}, be(e, e.colorTextLightSolid, n, {
|
|
1573
|
+
background: i
|
|
1574
|
+
}, {
|
|
1575
|
+
background: u
|
|
1576
|
+
})), Ce(e, n, e.colorBgContainer, {
|
|
1577
|
+
color: i,
|
|
1578
|
+
borderColor: i,
|
|
1579
|
+
background: e.colorBgContainer
|
|
1580
|
+
}, {
|
|
1581
|
+
color: u,
|
|
1582
|
+
borderColor: u,
|
|
1583
|
+
background: e.colorBgContainer
|
|
1584
|
+
})), he(e)), ye(e, a, {
|
|
1585
|
+
background: s
|
|
1586
|
+
}, {
|
|
1587
|
+
background: l
|
|
1588
|
+
})), W(e, n, "link", {
|
|
1589
|
+
color: i
|
|
1590
|
+
}, {
|
|
1591
|
+
color: u
|
|
1592
|
+
})), W(e, n, "text", {
|
|
1593
|
+
color: i,
|
|
1594
|
+
background: a
|
|
1595
|
+
}, {
|
|
1596
|
+
color: u,
|
|
1597
|
+
background: l
|
|
1598
|
+
}))
|
|
1599
|
+
});
|
|
1600
|
+
}, {});
|
|
1601
|
+
}, Ur = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
1602
|
+
color: e.defaultColor,
|
|
1603
|
+
boxShadow: e.defaultShadow
|
|
1604
|
+
}, be(e, e.solidTextColor, e.colorBgSolid, {
|
|
1605
|
+
color: e.solidTextColor,
|
|
1606
|
+
background: e.colorBgSolidHover
|
|
1607
|
+
}, {
|
|
1608
|
+
color: e.solidTextColor,
|
|
1609
|
+
background: e.colorBgSolidActive
|
|
1610
|
+
})), he(e)), ye(e, e.colorFillTertiary, {
|
|
1611
|
+
background: e.colorFillSecondary
|
|
1612
|
+
}, {
|
|
1613
|
+
background: e.colorFill
|
|
1614
|
+
})), pe(e.componentCls, e.ghostBg, e.defaultGhostColor, e.defaultGhostBorderColor, e.colorTextDisabled, e.colorBorder)), W(e, e.textTextColor, "link", {
|
|
1615
|
+
color: e.colorLinkHover,
|
|
1616
|
+
background: e.linkHoverBg
|
|
1617
|
+
}, {
|
|
1618
|
+
color: e.colorLinkActive
|
|
1619
|
+
})), qr = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
1620
|
+
color: e.colorPrimary,
|
|
1621
|
+
boxShadow: e.primaryShadow
|
|
1622
|
+
}, Ce(e, e.colorPrimary, e.colorBgContainer, {
|
|
1623
|
+
color: e.colorPrimaryTextHover,
|
|
1624
|
+
borderColor: e.colorPrimaryHover,
|
|
1625
|
+
background: e.colorBgContainer
|
|
1626
|
+
}, {
|
|
1627
|
+
color: e.colorPrimaryTextActive,
|
|
1628
|
+
borderColor: e.colorPrimaryActive,
|
|
1629
|
+
background: e.colorBgContainer
|
|
1630
|
+
})), he(e)), ye(e, e.colorPrimaryBg, {
|
|
1631
|
+
background: e.colorPrimaryBgHover
|
|
1632
|
+
}, {
|
|
1633
|
+
background: e.colorPrimaryBorder
|
|
1634
|
+
})), W(e, e.colorPrimaryText, "text", {
|
|
1635
|
+
color: e.colorPrimaryTextHover,
|
|
1636
|
+
background: e.colorPrimaryBg
|
|
1637
|
+
}, {
|
|
1638
|
+
color: e.colorPrimaryTextActive,
|
|
1639
|
+
background: e.colorPrimaryBorder
|
|
1640
|
+
})), W(e, e.colorPrimaryText, "link", {
|
|
1641
|
+
color: e.colorPrimaryTextHover,
|
|
1642
|
+
background: e.linkHoverBg
|
|
1643
|
+
}, {
|
|
1644
|
+
color: e.colorPrimaryTextActive
|
|
1645
|
+
})), pe(e.componentCls, e.ghostBg, e.colorPrimary, e.colorPrimary, e.colorTextDisabled, e.colorBorder, {
|
|
1646
|
+
color: e.colorPrimaryHover,
|
|
1647
|
+
borderColor: e.colorPrimaryHover
|
|
1648
|
+
}, {
|
|
1649
|
+
color: e.colorPrimaryActive,
|
|
1650
|
+
borderColor: e.colorPrimaryActive
|
|
1651
|
+
})), Xr = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
1652
|
+
color: e.colorError,
|
|
1653
|
+
boxShadow: e.dangerShadow
|
|
1654
|
+
}, be(e, e.dangerColor, e.colorError, {
|
|
1655
|
+
background: e.colorErrorHover
|
|
1656
|
+
}, {
|
|
1657
|
+
background: e.colorErrorActive
|
|
1658
|
+
})), Ce(e, e.colorError, e.colorBgContainer, {
|
|
1659
|
+
color: e.colorErrorHover,
|
|
1660
|
+
borderColor: e.colorErrorBorderHover
|
|
1661
|
+
}, {
|
|
1662
|
+
color: e.colorErrorActive,
|
|
1663
|
+
borderColor: e.colorErrorActive
|
|
1664
|
+
})), he(e)), ye(e, e.colorErrorBg, {
|
|
1665
|
+
background: e.colorErrorBgFilledHover
|
|
1666
|
+
}, {
|
|
1667
|
+
background: e.colorErrorBgActive
|
|
1668
|
+
})), W(e, e.colorError, "text", {
|
|
1669
|
+
color: e.colorErrorHover,
|
|
1670
|
+
background: e.colorErrorBg
|
|
1671
|
+
}, {
|
|
1672
|
+
color: e.colorErrorHover,
|
|
1673
|
+
background: e.colorErrorBgActive
|
|
1674
|
+
})), W(e, e.colorError, "link", {
|
|
1675
|
+
color: e.colorErrorHover
|
|
1676
|
+
}, {
|
|
1677
|
+
color: e.colorErrorActive
|
|
1678
|
+
})), pe(e.componentCls, e.ghostBg, e.colorError, e.colorError, e.colorTextDisabled, e.colorBorder, {
|
|
1679
|
+
color: e.colorErrorHover,
|
|
1680
|
+
borderColor: e.colorErrorHover
|
|
1681
|
+
}, {
|
|
1682
|
+
color: e.colorErrorActive,
|
|
1683
|
+
borderColor: e.colorErrorActive
|
|
1684
|
+
})), Zr = (e) => Object.assign(Object.assign({}, W(e, e.colorLink, "link", {
|
|
1685
|
+
color: e.colorLinkHover
|
|
1686
|
+
}, {
|
|
1687
|
+
color: e.colorLinkActive
|
|
1688
|
+
})), pe(e.componentCls, e.ghostBg, e.colorInfo, e.colorInfo, e.colorTextDisabled, e.colorBorder, {
|
|
1689
|
+
color: e.colorInfoHover,
|
|
1690
|
+
borderColor: e.colorInfoHover
|
|
1691
|
+
}, {
|
|
1692
|
+
color: e.colorInfoActive,
|
|
1693
|
+
borderColor: e.colorInfoActive
|
|
1694
|
+
})), Yr = (e) => {
|
|
1695
|
+
const {
|
|
1696
|
+
componentCls: t
|
|
1697
|
+
} = e;
|
|
1698
|
+
return Object.assign({
|
|
1699
|
+
[`${t}-color-default`]: Ur(e),
|
|
1700
|
+
[`${t}-color-primary`]: qr(e),
|
|
1701
|
+
[`${t}-color-dangerous`]: Xr(e),
|
|
1702
|
+
[`${t}-color-link`]: Zr(e)
|
|
1703
|
+
}, Vr(e));
|
|
1704
|
+
}, Kr = (e) => Object.assign(Object.assign(Object.assign(Object.assign({}, Ce(e, e.defaultBorderColor, e.defaultBg, {
|
|
1705
|
+
color: e.defaultHoverColor,
|
|
1706
|
+
borderColor: e.defaultHoverBorderColor,
|
|
1707
|
+
background: e.defaultHoverBg
|
|
1708
|
+
}, {
|
|
1709
|
+
color: e.defaultActiveColor,
|
|
1710
|
+
borderColor: e.defaultActiveBorderColor,
|
|
1711
|
+
background: e.defaultActiveBg
|
|
1712
|
+
})), W(e, e.textTextColor, "text", {
|
|
1713
|
+
color: e.textTextHoverColor,
|
|
1714
|
+
background: e.textHoverBg
|
|
1715
|
+
}, {
|
|
1716
|
+
color: e.textTextActiveColor,
|
|
1717
|
+
background: e.colorBgTextActive
|
|
1718
|
+
})), be(e, e.primaryColor, e.colorPrimary, {
|
|
1719
|
+
background: e.colorPrimaryHover,
|
|
1720
|
+
color: e.primaryColor
|
|
1721
|
+
}, {
|
|
1722
|
+
background: e.colorPrimaryActive,
|
|
1723
|
+
color: e.primaryColor
|
|
1724
|
+
})), W(e, e.colorLink, "link", {
|
|
1725
|
+
color: e.colorLinkHover,
|
|
1726
|
+
background: e.linkHoverBg
|
|
1727
|
+
}, {
|
|
1728
|
+
color: e.colorLinkActive
|
|
1729
|
+
})), Ue = function(e) {
|
|
1730
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1731
|
+
const {
|
|
1732
|
+
componentCls: o,
|
|
1733
|
+
controlHeight: r,
|
|
1734
|
+
fontSize: n,
|
|
1735
|
+
borderRadius: a,
|
|
1736
|
+
buttonPaddingHorizontal: i,
|
|
1737
|
+
iconCls: s,
|
|
1738
|
+
buttonPaddingVertical: l,
|
|
1739
|
+
buttonIconOnlyFontSize: u
|
|
1740
|
+
} = e;
|
|
1741
|
+
return [
|
|
1742
|
+
{
|
|
1743
|
+
[t]: {
|
|
1744
|
+
fontSize: n,
|
|
1745
|
+
height: r,
|
|
1746
|
+
padding: `${ue(l)} ${ue(i)}`,
|
|
1747
|
+
borderRadius: a,
|
|
1748
|
+
[`&${o}-icon-only`]: {
|
|
1749
|
+
width: r,
|
|
1750
|
+
[s]: {
|
|
1751
|
+
fontSize: u
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
// Shape - patch prefixCls again to override solid border radius style
|
|
1757
|
+
{
|
|
1758
|
+
[`${o}${o}-circle${t}`]: Ar(e)
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
[`${o}${o}-round${t}`]: Mr(e)
|
|
1762
|
+
}
|
|
1763
|
+
];
|
|
1764
|
+
}, Jr = (e) => {
|
|
1765
|
+
const t = ne(e, {
|
|
1766
|
+
fontSize: e.contentFontSize
|
|
1767
|
+
});
|
|
1768
|
+
return Ue(t, e.componentCls);
|
|
1769
|
+
}, Qr = (e) => {
|
|
1770
|
+
const t = ne(e, {
|
|
1771
|
+
controlHeight: e.controlHeightSM,
|
|
1772
|
+
fontSize: e.contentFontSizeSM,
|
|
1773
|
+
padding: e.paddingXS,
|
|
1774
|
+
buttonPaddingHorizontal: e.paddingInlineSM,
|
|
1775
|
+
buttonPaddingVertical: 0,
|
|
1776
|
+
borderRadius: e.borderRadiusSM,
|
|
1777
|
+
buttonIconOnlyFontSize: e.onlyIconSizeSM
|
|
1778
|
+
});
|
|
1779
|
+
return Ue(t, `${e.componentCls}-sm`);
|
|
1780
|
+
}, kr = (e) => {
|
|
1781
|
+
const t = ne(e, {
|
|
1782
|
+
controlHeight: e.controlHeightLG,
|
|
1783
|
+
fontSize: e.contentFontSizeLG,
|
|
1784
|
+
buttonPaddingHorizontal: e.paddingInlineLG,
|
|
1785
|
+
buttonPaddingVertical: 0,
|
|
1786
|
+
borderRadius: e.borderRadiusLG,
|
|
1787
|
+
buttonIconOnlyFontSize: e.onlyIconSizeLG
|
|
1788
|
+
});
|
|
1789
|
+
return Ue(t, `${e.componentCls}-lg`);
|
|
1790
|
+
}, en = (e) => {
|
|
1791
|
+
const {
|
|
1792
|
+
componentCls: t
|
|
1793
|
+
} = e;
|
|
1794
|
+
return {
|
|
1795
|
+
[t]: {
|
|
1796
|
+
[`&${t}-block`]: {
|
|
1797
|
+
width: "100%"
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
};
|
|
1801
|
+
}, tn = ht("Button", (e) => {
|
|
1802
|
+
const t = Wt(e);
|
|
1803
|
+
return [
|
|
1804
|
+
// Shared
|
|
1805
|
+
Lr(t),
|
|
1806
|
+
// Size
|
|
1807
|
+
Jr(t),
|
|
1808
|
+
Qr(t),
|
|
1809
|
+
kr(t),
|
|
1810
|
+
// Block
|
|
1811
|
+
en(t),
|
|
1812
|
+
// Color
|
|
1813
|
+
Yr(t),
|
|
1814
|
+
// https://github.com/ant-design/ant-design/issues/50969
|
|
1815
|
+
Kr(t),
|
|
1816
|
+
// Button Group
|
|
1817
|
+
lr(t)
|
|
1818
|
+
];
|
|
1819
|
+
}, Gt, {
|
|
1820
|
+
unitless: {
|
|
1821
|
+
fontWeight: !0,
|
|
1822
|
+
contentLineHeight: !0,
|
|
1823
|
+
contentLineHeightSM: !0,
|
|
1824
|
+
contentLineHeightLG: !0
|
|
1825
|
+
}
|
|
1826
|
+
});
|
|
1827
|
+
function on(e, t, o) {
|
|
1828
|
+
const {
|
|
1829
|
+
focusElCls: r,
|
|
1830
|
+
focus: n,
|
|
1831
|
+
borderElCls: a
|
|
1832
|
+
} = o, i = a ? "> *" : "", s = ["hover", n ? "focus" : null, "active"].filter(Boolean).map((l) => `&:${l} ${i}`).join(",");
|
|
1833
|
+
return {
|
|
1834
|
+
[`&-item:not(${t}-last-item)`]: {
|
|
1835
|
+
marginInlineEnd: e.calc(e.lineWidth).mul(-1).equal()
|
|
1836
|
+
},
|
|
1837
|
+
"&-item": Object.assign(Object.assign({
|
|
1838
|
+
[s]: {
|
|
1839
|
+
zIndex: 2
|
|
1840
|
+
}
|
|
1841
|
+
}, r ? {
|
|
1842
|
+
[`&${r}`]: {
|
|
1843
|
+
zIndex: 2
|
|
1844
|
+
}
|
|
1845
|
+
} : {}), {
|
|
1846
|
+
[`&[disabled] ${i}`]: {
|
|
1847
|
+
zIndex: 0
|
|
1848
|
+
}
|
|
1849
|
+
})
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
function rn(e, t, o) {
|
|
1853
|
+
const {
|
|
1854
|
+
borderElCls: r
|
|
1855
|
+
} = o, n = r ? `> ${r}` : "";
|
|
1856
|
+
return {
|
|
1857
|
+
[`&-item:not(${t}-first-item):not(${t}-last-item) ${n}`]: {
|
|
1858
|
+
borderRadius: 0
|
|
1859
|
+
},
|
|
1860
|
+
[`&-item:not(${t}-last-item)${t}-first-item`]: {
|
|
1861
|
+
[`& ${n}, &${e}-sm ${n}, &${e}-lg ${n}`]: {
|
|
1862
|
+
borderStartEndRadius: 0,
|
|
1863
|
+
borderEndEndRadius: 0
|
|
1864
|
+
}
|
|
1865
|
+
},
|
|
1866
|
+
[`&-item:not(${t}-first-item)${t}-last-item`]: {
|
|
1867
|
+
[`& ${n}, &${e}-sm ${n}, &${e}-lg ${n}`]: {
|
|
1868
|
+
borderStartStartRadius: 0,
|
|
1869
|
+
borderEndStartRadius: 0
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
function nn(e) {
|
|
1875
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
1876
|
+
focus: !0
|
|
1877
|
+
};
|
|
1878
|
+
const {
|
|
1879
|
+
componentCls: o
|
|
1880
|
+
} = e, r = `${o}-compact`;
|
|
1881
|
+
return {
|
|
1882
|
+
[r]: Object.assign(Object.assign({}, on(e, r, t)), rn(o, r, t))
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
function an(e, t) {
|
|
1886
|
+
return {
|
|
1887
|
+
// border collapse
|
|
1888
|
+
[`&-item:not(${t}-last-item)`]: {
|
|
1889
|
+
marginBottom: e.calc(e.lineWidth).mul(-1).equal()
|
|
1890
|
+
},
|
|
1891
|
+
"&-item": {
|
|
1892
|
+
"&:hover,&:focus,&:active": {
|
|
1893
|
+
zIndex: 2
|
|
1894
|
+
},
|
|
1895
|
+
"&[disabled]": {
|
|
1896
|
+
zIndex: 0
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
}
|
|
1901
|
+
function sn(e, t) {
|
|
1902
|
+
return {
|
|
1903
|
+
[`&-item:not(${t}-first-item):not(${t}-last-item)`]: {
|
|
1904
|
+
borderRadius: 0
|
|
1905
|
+
},
|
|
1906
|
+
[`&-item${t}-first-item:not(${t}-last-item)`]: {
|
|
1907
|
+
[`&, &${e}-sm, &${e}-lg`]: {
|
|
1908
|
+
borderEndEndRadius: 0,
|
|
1909
|
+
borderEndStartRadius: 0
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
[`&-item${t}-last-item:not(${t}-first-item)`]: {
|
|
1913
|
+
[`&, &${e}-sm, &${e}-lg`]: {
|
|
1914
|
+
borderStartStartRadius: 0,
|
|
1915
|
+
borderStartEndRadius: 0
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
function ln(e) {
|
|
1921
|
+
const t = `${e.componentCls}-compact-vertical`;
|
|
1922
|
+
return {
|
|
1923
|
+
[t]: Object.assign(Object.assign({}, an(e, t)), sn(e.componentCls, t))
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
const cn = (e) => {
|
|
1927
|
+
const {
|
|
1928
|
+
componentCls: t,
|
|
1929
|
+
colorPrimaryHover: o,
|
|
1930
|
+
lineWidth: r,
|
|
1931
|
+
calc: n
|
|
1932
|
+
} = e, a = n(r).mul(-1).equal(), i = (s) => {
|
|
1933
|
+
const l = `${t}-compact${s ? "-vertical" : ""}-item${t}-primary:not([disabled])`;
|
|
1934
|
+
return {
|
|
1935
|
+
[`${l} + ${l}::before`]: {
|
|
1936
|
+
position: "absolute",
|
|
1937
|
+
top: s ? a : 0,
|
|
1938
|
+
insetInlineStart: s ? 0 : a,
|
|
1939
|
+
backgroundColor: o,
|
|
1940
|
+
content: '""',
|
|
1941
|
+
width: s ? "100%" : r,
|
|
1942
|
+
height: s ? r : "100%"
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
};
|
|
1946
|
+
return Object.assign(Object.assign({}, i()), i(!0));
|
|
1947
|
+
}, un = vo(["Button", "compact"], (e) => {
|
|
1948
|
+
const t = Wt(e);
|
|
1949
|
+
return [
|
|
1950
|
+
// Space Compact
|
|
1951
|
+
nn(t),
|
|
1952
|
+
ln(t),
|
|
1953
|
+
cn(t)
|
|
1954
|
+
];
|
|
1955
|
+
}, Gt);
|
|
1956
|
+
var dn = function(e, t) {
|
|
1957
|
+
var o = {};
|
|
1958
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
|
|
1959
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
|
|
1960
|
+
t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (o[r[n]] = e[r[n]]);
|
|
1961
|
+
return o;
|
|
1962
|
+
};
|
|
1963
|
+
function mn(e) {
|
|
1964
|
+
if (typeof e == "object" && e) {
|
|
1965
|
+
let t = e == null ? void 0 : e.delay;
|
|
1966
|
+
return t = !Number.isNaN(t) && typeof t == "number" ? t : 0, {
|
|
1967
|
+
loading: t <= 0,
|
|
1968
|
+
delay: t
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
return {
|
|
1972
|
+
loading: !!e,
|
|
1973
|
+
delay: 0
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
const gn = {
|
|
1977
|
+
default: ["default", "outlined"],
|
|
1978
|
+
primary: ["primary", "solid"],
|
|
1979
|
+
dashed: ["default", "dashed"],
|
|
1980
|
+
// `link` is not a real color but we should compatible with it
|
|
1981
|
+
link: ["link", "link"],
|
|
1982
|
+
text: ["default", "text"]
|
|
1983
|
+
}, fn = /* @__PURE__ */ c.forwardRef((e, t) => {
|
|
1984
|
+
var o, r;
|
|
1985
|
+
const {
|
|
1986
|
+
loading: n = !1,
|
|
1987
|
+
prefixCls: a,
|
|
1988
|
+
color: i,
|
|
1989
|
+
variant: s,
|
|
1990
|
+
type: l,
|
|
1991
|
+
danger: u = !1,
|
|
1992
|
+
shape: d = "default",
|
|
1993
|
+
size: g,
|
|
1994
|
+
styles: p,
|
|
1995
|
+
disabled: C,
|
|
1996
|
+
className: h,
|
|
1997
|
+
rootClassName: x,
|
|
1998
|
+
children: f,
|
|
1999
|
+
icon: b,
|
|
2000
|
+
iconPosition: w = "start",
|
|
2001
|
+
ghost: E = !1,
|
|
2002
|
+
block: v = !1,
|
|
2003
|
+
// React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
|
|
2004
|
+
htmlType: y = "button",
|
|
2005
|
+
classNames: B,
|
|
2006
|
+
style: _ = {},
|
|
2007
|
+
autoInsertSpace: S,
|
|
2008
|
+
autoFocus: $
|
|
2009
|
+
} = e, H = dn(e, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]), z = l || "default", [j, P] = oe(() => {
|
|
2010
|
+
if (i && s)
|
|
2011
|
+
return [i, s];
|
|
2012
|
+
const R = gn[z] || [];
|
|
2013
|
+
return u ? ["danger", R[1]] : R;
|
|
2014
|
+
}, [l, i, s, u]), L = j === "danger" ? "dangerous" : j, {
|
|
2015
|
+
getPrefixCls: G,
|
|
2016
|
+
direction: Z,
|
|
2017
|
+
autoInsertSpace: A,
|
|
2018
|
+
className: I,
|
|
2019
|
+
style: Q,
|
|
2020
|
+
classNames: Vt,
|
|
2021
|
+
styles: Ut
|
|
2022
|
+
} = bo("button"), Se = (o = S ?? A) !== null && o !== void 0 ? o : !0, O = G("btn", a), [Xe, qt, Xt] = tn(O), Zt = _e(Co), Y = C ?? Zt, Yt = _e(_t), k = oe(() => mn(n), [n]), [X, Ze] = je(k.loading), [xe, Ye] = je(!1), ee = D(null), Ke = ho(t, ee), Je = kt.count(f) === 1 && !b && !ie(P), Ee = D(!0);
|
|
2023
|
+
c.useEffect(() => (Ee.current = !1, () => {
|
|
2024
|
+
Ee.current = !0;
|
|
2025
|
+
}), []), te(() => {
|
|
2026
|
+
let R = null;
|
|
2027
|
+
k.delay > 0 ? R = setTimeout(() => {
|
|
2028
|
+
R = null, Ze(!0);
|
|
2029
|
+
}, k.delay) : Ze(k.loading);
|
|
2030
|
+
function F() {
|
|
2031
|
+
R && (clearTimeout(R), R = null);
|
|
2032
|
+
}
|
|
2033
|
+
return F;
|
|
2034
|
+
}, [k]), te(() => {
|
|
2035
|
+
if (!ee.current || !Se)
|
|
2036
|
+
return;
|
|
2037
|
+
const R = ee.current.textContent || "";
|
|
2038
|
+
Je && Ae(R) ? xe || Ye(!0) : xe && Ye(!1);
|
|
2039
|
+
}), te(() => {
|
|
2040
|
+
$ && ee.current && ee.current.focus();
|
|
2041
|
+
}, []);
|
|
2042
|
+
const Qe = c.useCallback((R) => {
|
|
2043
|
+
var F;
|
|
2044
|
+
if (X || Y) {
|
|
2045
|
+
R.preventDefault();
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
(F = e.onClick) === null || F === void 0 || F.call(e, ("href" in e, R));
|
|
2049
|
+
}, [e.onClick, X, Y]);
|
|
2050
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2051
|
+
const R = Ge("Button");
|
|
2052
|
+
process.env.NODE_ENV !== "production" && R(!(typeof b == "string" && b.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${b}\` at https://ant.design/components/icon`), process.env.NODE_ENV !== "production" && R(!(E && ie(P)), "usage", "`link` or `text` button can't be a `ghost` button.");
|
|
2053
|
+
}
|
|
2054
|
+
const {
|
|
2055
|
+
compactSize: Kt,
|
|
2056
|
+
compactItemClassnames: ke
|
|
2057
|
+
} = er(O, Z), Jt = {
|
|
2058
|
+
large: "lg",
|
|
2059
|
+
small: "sm",
|
|
2060
|
+
middle: void 0
|
|
2061
|
+
}, et = yt((R) => {
|
|
2062
|
+
var F, Ie;
|
|
2063
|
+
return (Ie = (F = g ?? Kt) !== null && F !== void 0 ? F : Yt) !== null && Ie !== void 0 ? Ie : R;
|
|
2064
|
+
}), tt = et && (r = Jt[et]) !== null && r !== void 0 ? r : "", Qt = X ? "loading" : b, Oe = yo(H, ["navigate"]), ot = N(O, qt, Xt, {
|
|
2065
|
+
[`${O}-${d}`]: d !== "default" && d,
|
|
2066
|
+
// line(253 - 254): Compatible with versions earlier than 5.21.0
|
|
2067
|
+
[`${O}-${z}`]: z,
|
|
2068
|
+
[`${O}-dangerous`]: u,
|
|
2069
|
+
[`${O}-color-${L}`]: L,
|
|
2070
|
+
[`${O}-variant-${P}`]: P,
|
|
2071
|
+
[`${O}-${tt}`]: tt,
|
|
2072
|
+
[`${O}-icon-only`]: !f && f !== 0 && !!Qt,
|
|
2073
|
+
[`${O}-background-ghost`]: E && !ie(P),
|
|
2074
|
+
[`${O}-loading`]: X,
|
|
2075
|
+
[`${O}-two-chinese-chars`]: xe && Se && !X,
|
|
2076
|
+
[`${O}-block`]: v,
|
|
2077
|
+
[`${O}-rtl`]: Z === "rtl",
|
|
2078
|
+
[`${O}-icon-end`]: w === "end"
|
|
2079
|
+
}, ke, h, x, I), rt = Object.assign(Object.assign({}, Q), _), nt = N(B == null ? void 0 : B.icon, Vt.icon), at = Object.assign(Object.assign({}, (p == null ? void 0 : p.icon) || {}), Ut.icon || {}), it = b && !X ? /* @__PURE__ */ c.createElement(Me, {
|
|
2080
|
+
prefixCls: O,
|
|
2081
|
+
className: nt,
|
|
2082
|
+
style: at
|
|
2083
|
+
}, b) : n && typeof n == "object" && n.icon ? /* @__PURE__ */ c.createElement(Me, {
|
|
2084
|
+
prefixCls: O,
|
|
2085
|
+
className: nt,
|
|
2086
|
+
style: at
|
|
2087
|
+
}, n.icon) : /* @__PURE__ */ c.createElement(sr, {
|
|
2088
|
+
existIcon: !!b,
|
|
2089
|
+
prefixCls: O,
|
|
2090
|
+
loading: X,
|
|
2091
|
+
mount: Ee.current
|
|
2092
|
+
}), st = f || f === 0 ? ir(f, Je && Se) : null;
|
|
2093
|
+
if (Oe.href !== void 0)
|
|
2094
|
+
return Xe(/* @__PURE__ */ c.createElement("a", Object.assign({}, Oe, {
|
|
2095
|
+
className: N(ot, {
|
|
2096
|
+
[`${O}-disabled`]: Y
|
|
2097
|
+
}),
|
|
2098
|
+
href: Y ? void 0 : Oe.href,
|
|
2099
|
+
style: rt,
|
|
2100
|
+
onClick: Qe,
|
|
2101
|
+
ref: Ke,
|
|
2102
|
+
tabIndex: Y ? -1 : 0
|
|
2103
|
+
}), it, st));
|
|
2104
|
+
let $e = /* @__PURE__ */ c.createElement("button", Object.assign({}, H, {
|
|
2105
|
+
type: y,
|
|
2106
|
+
className: ot,
|
|
2107
|
+
style: rt,
|
|
2108
|
+
onClick: Qe,
|
|
2109
|
+
disabled: Y,
|
|
2110
|
+
ref: Ke
|
|
2111
|
+
}), it, st, ke && /* @__PURE__ */ c.createElement(un, {
|
|
2112
|
+
prefixCls: O
|
|
2113
|
+
}));
|
|
2114
|
+
return ie(P) || ($e = /* @__PURE__ */ c.createElement(zt, {
|
|
2115
|
+
component: "Button",
|
|
2116
|
+
disabled: X
|
|
2117
|
+
}, $e)), Xe($e);
|
|
2118
|
+
}), qe = fn;
|
|
2119
|
+
qe.Group = nr;
|
|
2120
|
+
qe.__ANT_BUTTON = !0;
|
|
2121
|
+
process.env.NODE_ENV !== "production" && (qe.displayName = "Button");
|
|
2122
|
+
const On = (e) => {
|
|
2123
|
+
const {
|
|
2124
|
+
space: t,
|
|
2125
|
+
form: o,
|
|
2126
|
+
children: r
|
|
2127
|
+
} = e;
|
|
2128
|
+
if (r == null)
|
|
2129
|
+
return null;
|
|
2130
|
+
let n = r;
|
|
2131
|
+
return o && (n = /* @__PURE__ */ c.createElement(So, {
|
|
2132
|
+
override: !0,
|
|
2133
|
+
status: !0
|
|
2134
|
+
}, n)), t && (n = /* @__PURE__ */ c.createElement(tr, null, n)), n;
|
|
2135
|
+
};
|
|
2136
|
+
function pn(e) {
|
|
2137
|
+
return (t) => /* @__PURE__ */ m.createElement(xo, {
|
|
2138
|
+
theme: {
|
|
2139
|
+
token: {
|
|
2140
|
+
motion: !1,
|
|
2141
|
+
zIndexPopupBase: 0
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
}, /* @__PURE__ */ m.createElement(e, Object.assign({}, t)));
|
|
2145
|
+
}
|
|
2146
|
+
const $n = (e, t, o, r, n) => pn((i) => {
|
|
2147
|
+
const {
|
|
2148
|
+
prefixCls: s,
|
|
2149
|
+
style: l
|
|
2150
|
+
} = i, u = m.useRef(null), [d, g] = m.useState(0), [p, C] = m.useState(0), [h, x] = $t(!1, {
|
|
2151
|
+
value: i.open
|
|
2152
|
+
}), {
|
|
2153
|
+
getPrefixCls: f
|
|
2154
|
+
} = m.useContext(re), b = f(r, s);
|
|
2155
|
+
m.useEffect(() => {
|
|
2156
|
+
if (x(!0), typeof ResizeObserver < "u") {
|
|
2157
|
+
const v = new ResizeObserver((B) => {
|
|
2158
|
+
const _ = B[0].target;
|
|
2159
|
+
g(_.offsetHeight + 8), C(_.offsetWidth);
|
|
2160
|
+
}), y = setInterval(() => {
|
|
2161
|
+
var B;
|
|
2162
|
+
const _ = n ? `.${n(b)}` : `.${b}-dropdown`, S = (B = u.current) === null || B === void 0 ? void 0 : B.querySelector(_);
|
|
2163
|
+
S && (clearInterval(y), v.observe(S));
|
|
2164
|
+
}, 10);
|
|
2165
|
+
return () => {
|
|
2166
|
+
clearInterval(y), v.disconnect();
|
|
2167
|
+
};
|
|
2168
|
+
}
|
|
2169
|
+
}, []);
|
|
2170
|
+
let w = Object.assign(Object.assign({}, i), {
|
|
2171
|
+
style: Object.assign(Object.assign({}, l), {
|
|
2172
|
+
margin: 0
|
|
2173
|
+
}),
|
|
2174
|
+
open: h,
|
|
2175
|
+
visible: h,
|
|
2176
|
+
getPopupContainer: () => u.current
|
|
2177
|
+
});
|
|
2178
|
+
Object.assign(w, {
|
|
2179
|
+
[t]: {
|
|
2180
|
+
overflow: {
|
|
2181
|
+
adjustX: !1,
|
|
2182
|
+
adjustY: !1
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
});
|
|
2186
|
+
const E = {
|
|
2187
|
+
paddingBottom: d,
|
|
2188
|
+
position: "relative",
|
|
2189
|
+
minWidth: p
|
|
2190
|
+
};
|
|
2191
|
+
return /* @__PURE__ */ m.createElement("div", {
|
|
2192
|
+
ref: u,
|
|
2193
|
+
style: E
|
|
2194
|
+
}, /* @__PURE__ */ m.createElement(e, Object.assign({}, w)));
|
|
2195
|
+
});
|
|
2196
|
+
export {
|
|
2197
|
+
qe as B,
|
|
2198
|
+
On as C,
|
|
2199
|
+
Ve as P,
|
|
2200
|
+
wo as a,
|
|
2201
|
+
Eo as b,
|
|
2202
|
+
xn as c,
|
|
2203
|
+
Rt as d,
|
|
2204
|
+
$n as e,
|
|
2205
|
+
ko as f,
|
|
2206
|
+
Fo as g,
|
|
2207
|
+
Sn as h,
|
|
2208
|
+
En as i,
|
|
2209
|
+
er as j,
|
|
2210
|
+
yn as u,
|
|
2211
|
+
pn as w,
|
|
2212
|
+
Bt as z
|
|
2213
|
+
};
|