@notificationapi/react 0.0.5 → 0.0.6
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/api.js +20 -0
- package/dist/assets/BellOutlined.js +57 -0
- package/dist/assets/Inbox.js +6197 -0
- package/dist/assets/Notification.js +3971 -0
- package/dist/assets/Preferences.js +2035 -0
- package/dist/assets/PurePanel.js +66 -0
- package/dist/assets/button.js +832 -0
- package/dist/assets/colors.js +9478 -0
- package/dist/assets/index.js +269 -0
- package/dist/assets/index2.js +652 -0
- package/dist/assets/index3.js +8257 -0
- package/dist/components/Notifications/Inbox.js +10 -0
- package/dist/components/Notifications/InboxHeader.js +51 -0
- package/dist/components/Notifications/Notification.js +9 -0
- package/dist/components/Notifications/NotificationCounter.js +9 -0
- package/dist/components/Notifications/NotificationFeed.js +46 -0
- package/dist/components/Notifications/NotificationLauncher.js +111 -0
- package/dist/components/Notifications/NotificationPopup.js +12 -0
- package/dist/components/Notifications/UnreadBadge.js +29 -0
- package/dist/components/Notifications/index.js +10 -0
- package/dist/components/Preferences/NotificationPreferencesInline.js +7 -0
- package/dist/components/Preferences/NotificationPreferencesPopup.js +1465 -0
- package/dist/components/Preferences/PreferenceGroup.js +8 -0
- package/dist/components/Preferences/Preferences.js +12 -0
- package/dist/components/Preferences/index.js +6 -0
- package/dist/components/Provider/index.js +168 -0
- package/dist/main.js +14 -33390
- package/package.json +3 -2
|
@@ -0,0 +1,2035 @@
|
|
|
1
|
+
import { jsx as R, jsxs as G, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import { NotificationAPIContext as ke, DeliveryOptions as A, Channels as H } from "../components/Provider/index.js";
|
|
3
|
+
import * as d from "react";
|
|
4
|
+
import j, { forwardRef as Ge, useRef as me, useImperativeHandle as Ve, useContext as Oe } from "react";
|
|
5
|
+
import { G as ie, v as oe, c as D, H as _, _ as W, d as fe, g as ae, m as re, r as V, u as N, I as Pe, a as q, o as Ke, D as Ee, f as Xe, J as Ue, t as Ye, p as Je, L as Qe, b as be, l as Ze, T as en, M as F } from "./colors.js";
|
|
6
|
+
import { u as J, F as nn, p as Me, W as Ne, w as tn, j as ue, K as ne, x as he, y as on, o as pe, A as an, B as rn, e as ln, I as Q, T as ze } from "./index3.js";
|
|
7
|
+
import { p as Re, a as cn, R as sn } from "./BellOutlined.js";
|
|
8
|
+
const dn = (e) => ({
|
|
9
|
+
[e.componentCls]: {
|
|
10
|
+
// For common/openAnimation
|
|
11
|
+
[`${e.antCls}-motion-collapse-legacy`]: {
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
"&-active": {
|
|
14
|
+
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
15
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
[`${e.antCls}-motion-collapse`]: {
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
21
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}), Be = /* @__PURE__ */ d.createContext(null), un = Be.Provider, je = /* @__PURE__ */ d.createContext(null), hn = je.Provider;
|
|
25
|
+
var gn = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"], mn = /* @__PURE__ */ Ge(function(e, n) {
|
|
26
|
+
var o = e.prefixCls, t = o === void 0 ? "rc-checkbox" : o, i = e.className, r = e.style, c = e.checked, a = e.disabled, l = e.defaultChecked, s = l === void 0 ? !1 : l, m = e.type, h = m === void 0 ? "checkbox" : m, C = e.title, u = e.onChange, w = ie(e, gn), f = me(null), p = me(null), I = J(s, {
|
|
27
|
+
value: c
|
|
28
|
+
}), $ = oe(I, 2), S = $[0], v = $[1];
|
|
29
|
+
Ve(n, function() {
|
|
30
|
+
return {
|
|
31
|
+
focus: function(b) {
|
|
32
|
+
var k;
|
|
33
|
+
(k = f.current) === null || k === void 0 || k.focus(b);
|
|
34
|
+
},
|
|
35
|
+
blur: function() {
|
|
36
|
+
var b;
|
|
37
|
+
(b = f.current) === null || b === void 0 || b.blur();
|
|
38
|
+
},
|
|
39
|
+
input: f.current,
|
|
40
|
+
nativeElement: p.current
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
var x = D(t, i, _(_({}, "".concat(t, "-checked"), S), "".concat(t, "-disabled"), a)), g = function(b) {
|
|
44
|
+
a || ("checked" in e || v(b.target.checked), u == null || u({
|
|
45
|
+
target: fe(fe({}, e), {}, {
|
|
46
|
+
type: h,
|
|
47
|
+
checked: b.target.checked
|
|
48
|
+
}),
|
|
49
|
+
stopPropagation: function() {
|
|
50
|
+
b.stopPropagation();
|
|
51
|
+
},
|
|
52
|
+
preventDefault: function() {
|
|
53
|
+
b.preventDefault();
|
|
54
|
+
},
|
|
55
|
+
nativeEvent: b.nativeEvent
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ d.createElement("span", {
|
|
59
|
+
className: x,
|
|
60
|
+
title: C,
|
|
61
|
+
style: r,
|
|
62
|
+
ref: p
|
|
63
|
+
}, /* @__PURE__ */ d.createElement("input", W({}, w, {
|
|
64
|
+
className: "".concat(t, "-input"),
|
|
65
|
+
ref: f,
|
|
66
|
+
onChange: g,
|
|
67
|
+
disabled: a,
|
|
68
|
+
checked: !!S,
|
|
69
|
+
type: h
|
|
70
|
+
})), /* @__PURE__ */ d.createElement("span", {
|
|
71
|
+
className: "".concat(t, "-inner")
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
const fn = (e) => {
|
|
75
|
+
const {
|
|
76
|
+
componentCls: n,
|
|
77
|
+
antCls: o
|
|
78
|
+
} = e, t = `${n}-group`;
|
|
79
|
+
return {
|
|
80
|
+
[t]: Object.assign(Object.assign({}, V(e)), {
|
|
81
|
+
display: "inline-block",
|
|
82
|
+
fontSize: 0,
|
|
83
|
+
// RTL
|
|
84
|
+
[`&${t}-rtl`]: {
|
|
85
|
+
direction: "rtl"
|
|
86
|
+
},
|
|
87
|
+
[`${o}-badge ${o}-badge-count`]: {
|
|
88
|
+
zIndex: 1
|
|
89
|
+
},
|
|
90
|
+
[`> ${o}-badge:not(:first-child) > ${o}-button-wrapper`]: {
|
|
91
|
+
borderInlineStart: "none"
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
};
|
|
95
|
+
}, bn = (e) => {
|
|
96
|
+
const {
|
|
97
|
+
componentCls: n,
|
|
98
|
+
wrapperMarginInlineEnd: o,
|
|
99
|
+
colorPrimary: t,
|
|
100
|
+
radioSize: i,
|
|
101
|
+
motionDurationSlow: r,
|
|
102
|
+
motionDurationMid: c,
|
|
103
|
+
motionEaseInOutCirc: a,
|
|
104
|
+
colorBgContainer: l,
|
|
105
|
+
colorBorder: s,
|
|
106
|
+
lineWidth: m,
|
|
107
|
+
colorBgContainerDisabled: h,
|
|
108
|
+
colorTextDisabled: C,
|
|
109
|
+
paddingXS: u,
|
|
110
|
+
dotColorDisabled: w,
|
|
111
|
+
lineType: f,
|
|
112
|
+
radioColor: p,
|
|
113
|
+
radioBgColor: I,
|
|
114
|
+
calc: $
|
|
115
|
+
} = e, S = `${n}-inner`, x = $(i).sub($(4).mul(2)), g = $(1).mul(i).equal();
|
|
116
|
+
return {
|
|
117
|
+
[`${n}-wrapper`]: Object.assign(Object.assign({}, V(e)), {
|
|
118
|
+
display: "inline-flex",
|
|
119
|
+
alignItems: "baseline",
|
|
120
|
+
marginInlineStart: 0,
|
|
121
|
+
marginInlineEnd: o,
|
|
122
|
+
cursor: "pointer",
|
|
123
|
+
// RTL
|
|
124
|
+
[`&${n}-wrapper-rtl`]: {
|
|
125
|
+
direction: "rtl"
|
|
126
|
+
},
|
|
127
|
+
"&-disabled": {
|
|
128
|
+
cursor: "not-allowed",
|
|
129
|
+
color: e.colorTextDisabled
|
|
130
|
+
},
|
|
131
|
+
"&::after": {
|
|
132
|
+
display: "inline-block",
|
|
133
|
+
width: 0,
|
|
134
|
+
overflow: "hidden",
|
|
135
|
+
content: '"\\a0"'
|
|
136
|
+
},
|
|
137
|
+
// hashId 在 wrapper 上,只能铺平
|
|
138
|
+
[`${n}-checked::after`]: {
|
|
139
|
+
position: "absolute",
|
|
140
|
+
insetBlockStart: 0,
|
|
141
|
+
insetInlineStart: 0,
|
|
142
|
+
width: "100%",
|
|
143
|
+
height: "100%",
|
|
144
|
+
border: `${N(m)} ${f} ${t}`,
|
|
145
|
+
borderRadius: "50%",
|
|
146
|
+
visibility: "hidden",
|
|
147
|
+
opacity: 0,
|
|
148
|
+
content: '""'
|
|
149
|
+
},
|
|
150
|
+
[n]: Object.assign(Object.assign({}, V(e)), {
|
|
151
|
+
position: "relative",
|
|
152
|
+
display: "inline-block",
|
|
153
|
+
outline: "none",
|
|
154
|
+
cursor: "pointer",
|
|
155
|
+
alignSelf: "center",
|
|
156
|
+
borderRadius: "50%"
|
|
157
|
+
}),
|
|
158
|
+
[`${n}-wrapper:hover &,
|
|
159
|
+
&:hover ${S}`]: {
|
|
160
|
+
borderColor: t
|
|
161
|
+
},
|
|
162
|
+
[`${n}-input:focus-visible + ${S}`]: Object.assign({}, Pe(e)),
|
|
163
|
+
[`${n}:hover::after, ${n}-wrapper:hover &::after`]: {
|
|
164
|
+
visibility: "visible"
|
|
165
|
+
},
|
|
166
|
+
[`${n}-inner`]: {
|
|
167
|
+
"&::after": {
|
|
168
|
+
boxSizing: "border-box",
|
|
169
|
+
position: "absolute",
|
|
170
|
+
insetBlockStart: "50%",
|
|
171
|
+
insetInlineStart: "50%",
|
|
172
|
+
display: "block",
|
|
173
|
+
width: g,
|
|
174
|
+
height: g,
|
|
175
|
+
marginBlockStart: $(1).mul(i).div(-2).equal(),
|
|
176
|
+
marginInlineStart: $(1).mul(i).div(-2).equal(),
|
|
177
|
+
backgroundColor: p,
|
|
178
|
+
borderBlockStart: 0,
|
|
179
|
+
borderInlineStart: 0,
|
|
180
|
+
borderRadius: g,
|
|
181
|
+
transform: "scale(0)",
|
|
182
|
+
opacity: 0,
|
|
183
|
+
transition: `all ${r} ${a}`,
|
|
184
|
+
content: '""'
|
|
185
|
+
},
|
|
186
|
+
boxSizing: "border-box",
|
|
187
|
+
position: "relative",
|
|
188
|
+
insetBlockStart: 0,
|
|
189
|
+
insetInlineStart: 0,
|
|
190
|
+
display: "block",
|
|
191
|
+
width: g,
|
|
192
|
+
height: g,
|
|
193
|
+
backgroundColor: l,
|
|
194
|
+
borderColor: s,
|
|
195
|
+
borderStyle: "solid",
|
|
196
|
+
borderWidth: m,
|
|
197
|
+
borderRadius: "50%",
|
|
198
|
+
transition: `all ${c}`
|
|
199
|
+
},
|
|
200
|
+
[`${n}-input`]: {
|
|
201
|
+
position: "absolute",
|
|
202
|
+
inset: 0,
|
|
203
|
+
zIndex: 1,
|
|
204
|
+
cursor: "pointer",
|
|
205
|
+
opacity: 0
|
|
206
|
+
},
|
|
207
|
+
// 选中状态
|
|
208
|
+
[`${n}-checked`]: {
|
|
209
|
+
[S]: {
|
|
210
|
+
borderColor: t,
|
|
211
|
+
backgroundColor: I,
|
|
212
|
+
"&::after": {
|
|
213
|
+
transform: `scale(${e.calc(e.dotSize).div(i).equal()})`,
|
|
214
|
+
opacity: 1,
|
|
215
|
+
transition: `all ${r} ${a}`
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
[`${n}-disabled`]: {
|
|
220
|
+
cursor: "not-allowed",
|
|
221
|
+
[S]: {
|
|
222
|
+
backgroundColor: h,
|
|
223
|
+
borderColor: s,
|
|
224
|
+
cursor: "not-allowed",
|
|
225
|
+
"&::after": {
|
|
226
|
+
backgroundColor: w
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
[`${n}-input`]: {
|
|
230
|
+
cursor: "not-allowed"
|
|
231
|
+
},
|
|
232
|
+
[`${n}-disabled + span`]: {
|
|
233
|
+
color: C,
|
|
234
|
+
cursor: "not-allowed"
|
|
235
|
+
},
|
|
236
|
+
[`&${n}-checked`]: {
|
|
237
|
+
[S]: {
|
|
238
|
+
"&::after": {
|
|
239
|
+
transform: `scale(${$(x).div(i).equal({
|
|
240
|
+
unit: !1
|
|
241
|
+
})})`
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
[`span${n} + *`]: {
|
|
247
|
+
paddingInlineStart: u,
|
|
248
|
+
paddingInlineEnd: u
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
};
|
|
252
|
+
}, pn = (e) => {
|
|
253
|
+
const {
|
|
254
|
+
buttonColor: n,
|
|
255
|
+
controlHeight: o,
|
|
256
|
+
componentCls: t,
|
|
257
|
+
lineWidth: i,
|
|
258
|
+
lineType: r,
|
|
259
|
+
colorBorder: c,
|
|
260
|
+
motionDurationSlow: a,
|
|
261
|
+
motionDurationMid: l,
|
|
262
|
+
buttonPaddingInline: s,
|
|
263
|
+
fontSize: m,
|
|
264
|
+
buttonBg: h,
|
|
265
|
+
fontSizeLG: C,
|
|
266
|
+
controlHeightLG: u,
|
|
267
|
+
controlHeightSM: w,
|
|
268
|
+
paddingXS: f,
|
|
269
|
+
borderRadius: p,
|
|
270
|
+
borderRadiusSM: I,
|
|
271
|
+
borderRadiusLG: $,
|
|
272
|
+
buttonCheckedBg: S,
|
|
273
|
+
buttonSolidCheckedColor: v,
|
|
274
|
+
colorTextDisabled: x,
|
|
275
|
+
colorBgContainerDisabled: g,
|
|
276
|
+
buttonCheckedBgDisabled: P,
|
|
277
|
+
buttonCheckedColorDisabled: b,
|
|
278
|
+
colorPrimary: k,
|
|
279
|
+
colorPrimaryHover: M,
|
|
280
|
+
colorPrimaryActive: y,
|
|
281
|
+
buttonSolidCheckedBg: E,
|
|
282
|
+
buttonSolidCheckedHoverBg: B,
|
|
283
|
+
buttonSolidCheckedActiveBg: O,
|
|
284
|
+
calc: z
|
|
285
|
+
} = e;
|
|
286
|
+
return {
|
|
287
|
+
[`${t}-button-wrapper`]: {
|
|
288
|
+
position: "relative",
|
|
289
|
+
display: "inline-block",
|
|
290
|
+
height: o,
|
|
291
|
+
margin: 0,
|
|
292
|
+
paddingInline: s,
|
|
293
|
+
paddingBlock: 0,
|
|
294
|
+
color: n,
|
|
295
|
+
fontSize: m,
|
|
296
|
+
lineHeight: N(z(o).sub(z(i).mul(2)).equal()),
|
|
297
|
+
background: h,
|
|
298
|
+
border: `${N(i)} ${r} ${c}`,
|
|
299
|
+
// strange align fix for chrome but works
|
|
300
|
+
// https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
|
|
301
|
+
borderBlockStartWidth: z(i).add(0.02).equal(),
|
|
302
|
+
borderInlineStartWidth: 0,
|
|
303
|
+
borderInlineEndWidth: i,
|
|
304
|
+
cursor: "pointer",
|
|
305
|
+
transition: [`color ${l}`, `background ${l}`, `box-shadow ${l}`].join(","),
|
|
306
|
+
a: {
|
|
307
|
+
color: n
|
|
308
|
+
},
|
|
309
|
+
[`> ${t}-button`]: {
|
|
310
|
+
position: "absolute",
|
|
311
|
+
insetBlockStart: 0,
|
|
312
|
+
insetInlineStart: 0,
|
|
313
|
+
zIndex: -1,
|
|
314
|
+
width: "100%",
|
|
315
|
+
height: "100%"
|
|
316
|
+
},
|
|
317
|
+
"&:not(:first-child)": {
|
|
318
|
+
"&::before": {
|
|
319
|
+
position: "absolute",
|
|
320
|
+
insetBlockStart: z(i).mul(-1).equal(),
|
|
321
|
+
insetInlineStart: z(i).mul(-1).equal(),
|
|
322
|
+
display: "block",
|
|
323
|
+
boxSizing: "content-box",
|
|
324
|
+
width: 1,
|
|
325
|
+
height: "100%",
|
|
326
|
+
paddingBlock: i,
|
|
327
|
+
paddingInline: 0,
|
|
328
|
+
backgroundColor: c,
|
|
329
|
+
transition: `background-color ${a}`,
|
|
330
|
+
content: '""'
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"&:first-child": {
|
|
334
|
+
borderInlineStart: `${N(i)} ${r} ${c}`,
|
|
335
|
+
borderStartStartRadius: p,
|
|
336
|
+
borderEndStartRadius: p
|
|
337
|
+
},
|
|
338
|
+
"&:last-child": {
|
|
339
|
+
borderStartEndRadius: p,
|
|
340
|
+
borderEndEndRadius: p
|
|
341
|
+
},
|
|
342
|
+
"&:first-child:last-child": {
|
|
343
|
+
borderRadius: p
|
|
344
|
+
},
|
|
345
|
+
[`${t}-group-large &`]: {
|
|
346
|
+
height: u,
|
|
347
|
+
fontSize: C,
|
|
348
|
+
lineHeight: N(z(u).sub(z(i).mul(2)).equal()),
|
|
349
|
+
"&:first-child": {
|
|
350
|
+
borderStartStartRadius: $,
|
|
351
|
+
borderEndStartRadius: $
|
|
352
|
+
},
|
|
353
|
+
"&:last-child": {
|
|
354
|
+
borderStartEndRadius: $,
|
|
355
|
+
borderEndEndRadius: $
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
[`${t}-group-small &`]: {
|
|
359
|
+
height: w,
|
|
360
|
+
paddingInline: z(f).sub(i).equal(),
|
|
361
|
+
paddingBlock: 0,
|
|
362
|
+
lineHeight: N(z(w).sub(z(i).mul(2)).equal()),
|
|
363
|
+
"&:first-child": {
|
|
364
|
+
borderStartStartRadius: I,
|
|
365
|
+
borderEndStartRadius: I
|
|
366
|
+
},
|
|
367
|
+
"&:last-child": {
|
|
368
|
+
borderStartEndRadius: I,
|
|
369
|
+
borderEndEndRadius: I
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"&:hover": {
|
|
373
|
+
position: "relative",
|
|
374
|
+
color: k
|
|
375
|
+
},
|
|
376
|
+
"&:has(:focus-visible)": Object.assign({}, Pe(e)),
|
|
377
|
+
[`${t}-inner, input[type='checkbox'], input[type='radio']`]: {
|
|
378
|
+
width: 0,
|
|
379
|
+
height: 0,
|
|
380
|
+
opacity: 0,
|
|
381
|
+
pointerEvents: "none"
|
|
382
|
+
},
|
|
383
|
+
[`&-checked:not(${t}-button-wrapper-disabled)`]: {
|
|
384
|
+
zIndex: 1,
|
|
385
|
+
color: k,
|
|
386
|
+
background: S,
|
|
387
|
+
borderColor: k,
|
|
388
|
+
"&::before": {
|
|
389
|
+
backgroundColor: k
|
|
390
|
+
},
|
|
391
|
+
"&:first-child": {
|
|
392
|
+
borderColor: k
|
|
393
|
+
},
|
|
394
|
+
"&:hover": {
|
|
395
|
+
color: M,
|
|
396
|
+
borderColor: M,
|
|
397
|
+
"&::before": {
|
|
398
|
+
backgroundColor: M
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"&:active": {
|
|
402
|
+
color: y,
|
|
403
|
+
borderColor: y,
|
|
404
|
+
"&::before": {
|
|
405
|
+
backgroundColor: y
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
[`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]: {
|
|
410
|
+
color: v,
|
|
411
|
+
background: E,
|
|
412
|
+
borderColor: E,
|
|
413
|
+
"&:hover": {
|
|
414
|
+
color: v,
|
|
415
|
+
background: B,
|
|
416
|
+
borderColor: B
|
|
417
|
+
},
|
|
418
|
+
"&:active": {
|
|
419
|
+
color: v,
|
|
420
|
+
background: O,
|
|
421
|
+
borderColor: O
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
"&-disabled": {
|
|
425
|
+
color: x,
|
|
426
|
+
backgroundColor: g,
|
|
427
|
+
borderColor: c,
|
|
428
|
+
cursor: "not-allowed",
|
|
429
|
+
"&:first-child, &:hover": {
|
|
430
|
+
color: x,
|
|
431
|
+
backgroundColor: g,
|
|
432
|
+
borderColor: c
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
[`&-disabled${t}-button-wrapper-checked`]: {
|
|
436
|
+
color: b,
|
|
437
|
+
backgroundColor: P,
|
|
438
|
+
borderColor: c,
|
|
439
|
+
boxShadow: "none"
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
}, vn = (e) => {
|
|
444
|
+
const {
|
|
445
|
+
wireframe: n,
|
|
446
|
+
padding: o,
|
|
447
|
+
marginXS: t,
|
|
448
|
+
lineWidth: i,
|
|
449
|
+
fontSizeLG: r,
|
|
450
|
+
colorText: c,
|
|
451
|
+
colorBgContainer: a,
|
|
452
|
+
colorTextDisabled: l,
|
|
453
|
+
controlItemBgActiveDisabled: s,
|
|
454
|
+
colorTextLightSolid: m,
|
|
455
|
+
colorPrimary: h,
|
|
456
|
+
colorPrimaryHover: C,
|
|
457
|
+
colorPrimaryActive: u,
|
|
458
|
+
colorWhite: w
|
|
459
|
+
} = e, f = 4, p = r, I = n ? p - f * 2 : p - (f + i) * 2;
|
|
460
|
+
return {
|
|
461
|
+
// Radio
|
|
462
|
+
radioSize: p,
|
|
463
|
+
dotSize: I,
|
|
464
|
+
dotColorDisabled: l,
|
|
465
|
+
// Radio buttons
|
|
466
|
+
buttonSolidCheckedColor: m,
|
|
467
|
+
buttonSolidCheckedBg: h,
|
|
468
|
+
buttonSolidCheckedHoverBg: C,
|
|
469
|
+
buttonSolidCheckedActiveBg: u,
|
|
470
|
+
buttonBg: a,
|
|
471
|
+
buttonCheckedBg: a,
|
|
472
|
+
buttonColor: c,
|
|
473
|
+
buttonCheckedBgDisabled: s,
|
|
474
|
+
buttonCheckedColorDisabled: l,
|
|
475
|
+
buttonPaddingInline: o - i,
|
|
476
|
+
wrapperMarginInlineEnd: t,
|
|
477
|
+
// internal
|
|
478
|
+
radioColor: n ? h : w,
|
|
479
|
+
radioBgColor: n ? a : h
|
|
480
|
+
};
|
|
481
|
+
}, Ae = ae("Radio", (e) => {
|
|
482
|
+
const {
|
|
483
|
+
controlOutline: n,
|
|
484
|
+
controlOutlineWidth: o
|
|
485
|
+
} = e, t = `0 0 0 ${N(o)} ${n}`, r = re(e, {
|
|
486
|
+
radioFocusShadow: t,
|
|
487
|
+
radioButtonFocusShadow: t
|
|
488
|
+
});
|
|
489
|
+
return [fn(r), bn(r), pn(r)];
|
|
490
|
+
}, vn, {
|
|
491
|
+
unitless: {
|
|
492
|
+
radioSize: !0,
|
|
493
|
+
dotSize: !0
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
var Cn = function(e, n) {
|
|
497
|
+
var o = {};
|
|
498
|
+
for (var t in e)
|
|
499
|
+
Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
|
|
500
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
501
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
|
|
502
|
+
n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
|
|
503
|
+
return o;
|
|
504
|
+
};
|
|
505
|
+
const $n = (e, n) => {
|
|
506
|
+
var o, t;
|
|
507
|
+
const i = d.useContext(Be), r = d.useContext(je), {
|
|
508
|
+
getPrefixCls: c,
|
|
509
|
+
direction: a,
|
|
510
|
+
radio: l
|
|
511
|
+
} = d.useContext(q), s = d.useRef(null), m = Ke(n, s), {
|
|
512
|
+
isFormItemInput: h
|
|
513
|
+
} = d.useContext(nn), C = (O) => {
|
|
514
|
+
var z, T;
|
|
515
|
+
(z = e.onChange) === null || z === void 0 || z.call(e, O), (T = i == null ? void 0 : i.onChange) === null || T === void 0 || T.call(i, O);
|
|
516
|
+
}, {
|
|
517
|
+
prefixCls: u,
|
|
518
|
+
className: w,
|
|
519
|
+
rootClassName: f,
|
|
520
|
+
children: p,
|
|
521
|
+
style: I,
|
|
522
|
+
title: $
|
|
523
|
+
} = e, S = Cn(e, ["prefixCls", "className", "rootClassName", "children", "style", "title"]), v = c("radio", u), x = ((i == null ? void 0 : i.optionType) || r) === "button", g = x ? `${v}-button` : v, P = Me(v), [b, k, M] = Ae(v, P), y = Object.assign({}, S), E = d.useContext(Ee);
|
|
524
|
+
i && (y.name = i.name, y.onChange = C, y.checked = e.value === i.value, y.disabled = (o = y.disabled) !== null && o !== void 0 ? o : i.disabled), y.disabled = (t = y.disabled) !== null && t !== void 0 ? t : E;
|
|
525
|
+
const B = D(`${g}-wrapper`, {
|
|
526
|
+
[`${g}-wrapper-checked`]: y.checked,
|
|
527
|
+
[`${g}-wrapper-disabled`]: y.disabled,
|
|
528
|
+
[`${g}-wrapper-rtl`]: a === "rtl",
|
|
529
|
+
[`${g}-wrapper-in-form-item`]: h
|
|
530
|
+
}, l == null ? void 0 : l.className, w, f, k, M, P);
|
|
531
|
+
return b(/* @__PURE__ */ d.createElement(Ne, {
|
|
532
|
+
component: "Radio",
|
|
533
|
+
disabled: y.disabled
|
|
534
|
+
}, /* @__PURE__ */ d.createElement("label", {
|
|
535
|
+
className: B,
|
|
536
|
+
style: Object.assign(Object.assign({}, l == null ? void 0 : l.style), I),
|
|
537
|
+
onMouseEnter: e.onMouseEnter,
|
|
538
|
+
onMouseLeave: e.onMouseLeave,
|
|
539
|
+
title: $
|
|
540
|
+
}, /* @__PURE__ */ d.createElement(mn, Object.assign({}, y, {
|
|
541
|
+
className: D(y.className, !x && tn),
|
|
542
|
+
type: "radio",
|
|
543
|
+
prefixCls: g,
|
|
544
|
+
ref: m
|
|
545
|
+
})), p !== void 0 ? /* @__PURE__ */ d.createElement("span", null, p) : null)));
|
|
546
|
+
}, te = /* @__PURE__ */ d.forwardRef($n), yn = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
547
|
+
const {
|
|
548
|
+
getPrefixCls: o,
|
|
549
|
+
direction: t
|
|
550
|
+
} = d.useContext(q), [i, r] = J(e.defaultValue, {
|
|
551
|
+
value: e.value
|
|
552
|
+
}), c = (O) => {
|
|
553
|
+
const z = i, T = O.target.value;
|
|
554
|
+
"value" in e || r(T);
|
|
555
|
+
const {
|
|
556
|
+
onChange: L
|
|
557
|
+
} = e;
|
|
558
|
+
L && T !== z && L(O);
|
|
559
|
+
}, {
|
|
560
|
+
prefixCls: a,
|
|
561
|
+
className: l,
|
|
562
|
+
rootClassName: s,
|
|
563
|
+
options: m,
|
|
564
|
+
buttonStyle: h = "outline",
|
|
565
|
+
disabled: C,
|
|
566
|
+
children: u,
|
|
567
|
+
size: w,
|
|
568
|
+
style: f,
|
|
569
|
+
id: p,
|
|
570
|
+
onMouseEnter: I,
|
|
571
|
+
onMouseLeave: $,
|
|
572
|
+
onFocus: S,
|
|
573
|
+
onBlur: v
|
|
574
|
+
} = e, x = o("radio", a), g = `${x}-group`, P = Me(x), [b, k, M] = Ae(x, P);
|
|
575
|
+
let y = u;
|
|
576
|
+
m && m.length > 0 && (y = m.map((O) => typeof O == "string" || typeof O == "number" ? /* @__PURE__ */ d.createElement(te, {
|
|
577
|
+
key: O.toString(),
|
|
578
|
+
prefixCls: x,
|
|
579
|
+
disabled: C,
|
|
580
|
+
value: O,
|
|
581
|
+
checked: i === O
|
|
582
|
+
}, O) : /* @__PURE__ */ d.createElement(te, {
|
|
583
|
+
key: `radio-group-value-options-${O.value}`,
|
|
584
|
+
prefixCls: x,
|
|
585
|
+
disabled: O.disabled || C,
|
|
586
|
+
value: O.value,
|
|
587
|
+
checked: i === O.value,
|
|
588
|
+
title: O.title,
|
|
589
|
+
style: O.style,
|
|
590
|
+
id: O.id,
|
|
591
|
+
required: O.required
|
|
592
|
+
}, O.label)));
|
|
593
|
+
const E = ue(w), B = D(g, `${g}-${h}`, {
|
|
594
|
+
[`${g}-${E}`]: E,
|
|
595
|
+
[`${g}-rtl`]: t === "rtl"
|
|
596
|
+
}, l, s, k, M, P);
|
|
597
|
+
return b(/* @__PURE__ */ d.createElement("div", Object.assign({}, Re(e, {
|
|
598
|
+
aria: !0,
|
|
599
|
+
data: !0
|
|
600
|
+
}), {
|
|
601
|
+
className: B,
|
|
602
|
+
style: f,
|
|
603
|
+
onMouseEnter: I,
|
|
604
|
+
onMouseLeave: $,
|
|
605
|
+
onFocus: S,
|
|
606
|
+
onBlur: v,
|
|
607
|
+
id: p,
|
|
608
|
+
ref: n
|
|
609
|
+
}), /* @__PURE__ */ d.createElement(un, {
|
|
610
|
+
value: {
|
|
611
|
+
onChange: c,
|
|
612
|
+
value: i,
|
|
613
|
+
disabled: e.disabled,
|
|
614
|
+
name: e.name,
|
|
615
|
+
optionType: e.optionType
|
|
616
|
+
}
|
|
617
|
+
}, y)));
|
|
618
|
+
}), Sn = /* @__PURE__ */ d.memo(yn);
|
|
619
|
+
var xn = function(e, n) {
|
|
620
|
+
var o = {};
|
|
621
|
+
for (var t in e)
|
|
622
|
+
Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
|
|
623
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
624
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
|
|
625
|
+
n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
|
|
626
|
+
return o;
|
|
627
|
+
};
|
|
628
|
+
const In = (e, n) => {
|
|
629
|
+
const {
|
|
630
|
+
getPrefixCls: o
|
|
631
|
+
} = d.useContext(q), {
|
|
632
|
+
prefixCls: t
|
|
633
|
+
} = e, i = xn(e, ["prefixCls"]), r = o("radio", t);
|
|
634
|
+
return /* @__PURE__ */ d.createElement(hn, {
|
|
635
|
+
value: "button"
|
|
636
|
+
}, /* @__PURE__ */ d.createElement(te, Object.assign({
|
|
637
|
+
prefixCls: r
|
|
638
|
+
}, i, {
|
|
639
|
+
type: "radio",
|
|
640
|
+
ref: n
|
|
641
|
+
})));
|
|
642
|
+
}, wn = /* @__PURE__ */ d.forwardRef(In), Y = te;
|
|
643
|
+
Y.Button = wn;
|
|
644
|
+
Y.Group = Sn;
|
|
645
|
+
Y.__ANT_RADIO = !0;
|
|
646
|
+
var De = /* @__PURE__ */ j.forwardRef(function(e, n) {
|
|
647
|
+
var o = e.prefixCls, t = e.forceRender, i = e.className, r = e.style, c = e.children, a = e.isActive, l = e.role, s = j.useState(a || t), m = oe(s, 2), h = m[0], C = m[1];
|
|
648
|
+
return j.useEffect(function() {
|
|
649
|
+
(t || a) && C(!0);
|
|
650
|
+
}, [t, a]), h ? /* @__PURE__ */ j.createElement("div", {
|
|
651
|
+
ref: n,
|
|
652
|
+
className: D("".concat(o, "-content"), _(_({}, "".concat(o, "-content-active"), a), "".concat(o, "-content-inactive"), !a), i),
|
|
653
|
+
style: r,
|
|
654
|
+
role: l
|
|
655
|
+
}, /* @__PURE__ */ j.createElement("div", {
|
|
656
|
+
className: "".concat(o, "-content-box")
|
|
657
|
+
}, c)) : null;
|
|
658
|
+
});
|
|
659
|
+
De.displayName = "PanelContent";
|
|
660
|
+
var kn = ["showArrow", "headerClass", "isActive", "onItemClick", "forceRender", "className", "prefixCls", "collapsible", "accordion", "panelKey", "extra", "header", "expandIcon", "openMotion", "destroyInactivePanel", "children"], Te = /* @__PURE__ */ j.forwardRef(function(e, n) {
|
|
661
|
+
var o = e.showArrow, t = o === void 0 ? !0 : o, i = e.headerClass, r = e.isActive, c = e.onItemClick, a = e.forceRender, l = e.className, s = e.prefixCls, m = e.collapsible, h = e.accordion, C = e.panelKey, u = e.extra, w = e.header, f = e.expandIcon, p = e.openMotion, I = e.destroyInactivePanel, $ = e.children, S = ie(e, kn), v = m === "disabled", x = m === "header", g = m === "icon", P = u != null && typeof u != "boolean", b = function() {
|
|
662
|
+
c == null || c(C);
|
|
663
|
+
}, k = function(z) {
|
|
664
|
+
(z.key === "Enter" || z.keyCode === ne.ENTER || z.which === ne.ENTER) && b();
|
|
665
|
+
}, M = typeof f == "function" ? f(e) : /* @__PURE__ */ j.createElement("i", {
|
|
666
|
+
className: "arrow"
|
|
667
|
+
});
|
|
668
|
+
M && (M = /* @__PURE__ */ j.createElement("div", {
|
|
669
|
+
className: "".concat(s, "-expand-icon"),
|
|
670
|
+
onClick: ["header", "icon"].includes(m) ? b : void 0
|
|
671
|
+
}, M));
|
|
672
|
+
var y = D(_(_(_({}, "".concat(s, "-item"), !0), "".concat(s, "-item-active"), r), "".concat(s, "-item-disabled"), v), l), E = D(i, _(_(_({}, "".concat(s, "-header"), !0), "".concat(s, "-header-collapsible-only"), x), "".concat(s, "-icon-collapsible-only"), g)), B = {
|
|
673
|
+
className: E,
|
|
674
|
+
"aria-expanded": r,
|
|
675
|
+
"aria-disabled": v,
|
|
676
|
+
onKeyDown: k
|
|
677
|
+
};
|
|
678
|
+
return !x && !g && (B.onClick = b, B.role = h ? "tab" : "button", B.tabIndex = v ? -1 : 0), /* @__PURE__ */ j.createElement("div", W({}, S, {
|
|
679
|
+
ref: n,
|
|
680
|
+
className: y
|
|
681
|
+
}), /* @__PURE__ */ j.createElement("div", B, t && M, /* @__PURE__ */ j.createElement("span", {
|
|
682
|
+
className: "".concat(s, "-header-text"),
|
|
683
|
+
onClick: m === "header" ? b : void 0
|
|
684
|
+
}, w), P && /* @__PURE__ */ j.createElement("div", {
|
|
685
|
+
className: "".concat(s, "-extra")
|
|
686
|
+
}, u)), /* @__PURE__ */ j.createElement(Xe, W({
|
|
687
|
+
visible: r,
|
|
688
|
+
leavedClassName: "".concat(s, "-content-hidden")
|
|
689
|
+
}, p, {
|
|
690
|
+
forceRender: a,
|
|
691
|
+
removeOnLeave: I
|
|
692
|
+
}), function(O, z) {
|
|
693
|
+
var T = O.className, L = O.style;
|
|
694
|
+
return /* @__PURE__ */ j.createElement(De, {
|
|
695
|
+
ref: z,
|
|
696
|
+
prefixCls: s,
|
|
697
|
+
className: T,
|
|
698
|
+
style: L,
|
|
699
|
+
isActive: r,
|
|
700
|
+
forceRender: a,
|
|
701
|
+
role: h ? "tabpanel" : void 0
|
|
702
|
+
}, $);
|
|
703
|
+
}));
|
|
704
|
+
}), On = ["children", "label", "key", "collapsible", "onItemClick", "destroyInactivePanel"], Pn = function(n, o) {
|
|
705
|
+
var t = o.prefixCls, i = o.accordion, r = o.collapsible, c = o.destroyInactivePanel, a = o.onItemClick, l = o.activeKey, s = o.openMotion, m = o.expandIcon;
|
|
706
|
+
return n.map(function(h, C) {
|
|
707
|
+
var u = h.children, w = h.label, f = h.key, p = h.collapsible, I = h.onItemClick, $ = h.destroyInactivePanel, S = ie(h, On), v = String(f ?? C), x = p ?? r, g = $ ?? c, P = function(M) {
|
|
708
|
+
x !== "disabled" && (a(M), I == null || I(M));
|
|
709
|
+
}, b = !1;
|
|
710
|
+
return i ? b = l[0] === v : b = l.indexOf(v) > -1, /* @__PURE__ */ j.createElement(Te, W({}, S, {
|
|
711
|
+
prefixCls: t,
|
|
712
|
+
key: v,
|
|
713
|
+
panelKey: v,
|
|
714
|
+
isActive: b,
|
|
715
|
+
accordion: i,
|
|
716
|
+
openMotion: s,
|
|
717
|
+
expandIcon: m,
|
|
718
|
+
header: w,
|
|
719
|
+
collapsible: x,
|
|
720
|
+
onItemClick: P,
|
|
721
|
+
destroyInactivePanel: g
|
|
722
|
+
}), u);
|
|
723
|
+
});
|
|
724
|
+
}, En = function(n, o, t) {
|
|
725
|
+
if (!n)
|
|
726
|
+
return null;
|
|
727
|
+
var i = t.prefixCls, r = t.accordion, c = t.collapsible, a = t.destroyInactivePanel, l = t.onItemClick, s = t.activeKey, m = t.openMotion, h = t.expandIcon, C = n.key || String(o), u = n.props, w = u.header, f = u.headerClass, p = u.destroyInactivePanel, I = u.collapsible, $ = u.onItemClick, S = !1;
|
|
728
|
+
r ? S = s[0] === C : S = s.indexOf(C) > -1;
|
|
729
|
+
var v = I ?? c, x = function(b) {
|
|
730
|
+
v !== "disabled" && (l(b), $ == null || $(b));
|
|
731
|
+
}, g = {
|
|
732
|
+
key: C,
|
|
733
|
+
panelKey: C,
|
|
734
|
+
header: w,
|
|
735
|
+
headerClass: f,
|
|
736
|
+
isActive: S,
|
|
737
|
+
prefixCls: i,
|
|
738
|
+
destroyInactivePanel: p ?? a,
|
|
739
|
+
openMotion: m,
|
|
740
|
+
accordion: r,
|
|
741
|
+
children: n.props.children,
|
|
742
|
+
onItemClick: x,
|
|
743
|
+
expandIcon: h,
|
|
744
|
+
collapsible: v
|
|
745
|
+
};
|
|
746
|
+
return typeof n.type == "string" ? n : (Object.keys(g).forEach(function(P) {
|
|
747
|
+
typeof g[P] > "u" && delete g[P];
|
|
748
|
+
}), /* @__PURE__ */ j.cloneElement(n, g));
|
|
749
|
+
};
|
|
750
|
+
function Mn(e, n, o) {
|
|
751
|
+
return Array.isArray(e) ? Pn(e, o) : he(n).map(function(t, i) {
|
|
752
|
+
return En(t, i, o);
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function Nn(e) {
|
|
756
|
+
var n = e;
|
|
757
|
+
if (!Array.isArray(n)) {
|
|
758
|
+
var o = Ye(n);
|
|
759
|
+
n = o === "number" || o === "string" ? [n] : [];
|
|
760
|
+
}
|
|
761
|
+
return n.map(function(t) {
|
|
762
|
+
return String(t);
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
var zn = /* @__PURE__ */ j.forwardRef(function(e, n) {
|
|
766
|
+
var o = e.prefixCls, t = o === void 0 ? "rc-collapse" : o, i = e.destroyInactivePanel, r = i === void 0 ? !1 : i, c = e.style, a = e.accordion, l = e.className, s = e.children, m = e.collapsible, h = e.openMotion, C = e.expandIcon, u = e.activeKey, w = e.defaultActiveKey, f = e.onChange, p = e.items, I = D(t, l), $ = J([], {
|
|
767
|
+
value: u,
|
|
768
|
+
onChange: function(k) {
|
|
769
|
+
return f == null ? void 0 : f(k);
|
|
770
|
+
},
|
|
771
|
+
defaultValue: w,
|
|
772
|
+
postState: Nn
|
|
773
|
+
}), S = oe($, 2), v = S[0], x = S[1], g = function(k) {
|
|
774
|
+
return x(function() {
|
|
775
|
+
if (a)
|
|
776
|
+
return v[0] === k ? [] : [k];
|
|
777
|
+
var M = v.indexOf(k), y = M > -1;
|
|
778
|
+
return y ? v.filter(function(E) {
|
|
779
|
+
return E !== k;
|
|
780
|
+
}) : [].concat(Je(v), [k]);
|
|
781
|
+
});
|
|
782
|
+
};
|
|
783
|
+
Ue(!s, "[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");
|
|
784
|
+
var P = Mn(p, s, {
|
|
785
|
+
prefixCls: t,
|
|
786
|
+
accordion: a,
|
|
787
|
+
openMotion: h,
|
|
788
|
+
expandIcon: C,
|
|
789
|
+
collapsible: m,
|
|
790
|
+
destroyInactivePanel: r,
|
|
791
|
+
onItemClick: g,
|
|
792
|
+
activeKey: v
|
|
793
|
+
});
|
|
794
|
+
return /* @__PURE__ */ j.createElement("div", W({
|
|
795
|
+
ref: n,
|
|
796
|
+
className: I,
|
|
797
|
+
style: c,
|
|
798
|
+
role: a ? "tablist" : void 0
|
|
799
|
+
}, Re(e, {
|
|
800
|
+
aria: !0,
|
|
801
|
+
data: !0
|
|
802
|
+
})), P);
|
|
803
|
+
});
|
|
804
|
+
const ge = Object.assign(zn, {
|
|
805
|
+
/**
|
|
806
|
+
* @deprecated use `items` instead, will be removed in `v4.0.0`
|
|
807
|
+
*/
|
|
808
|
+
Panel: Te
|
|
809
|
+
});
|
|
810
|
+
ge.Panel;
|
|
811
|
+
const Rn = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
812
|
+
const {
|
|
813
|
+
getPrefixCls: o
|
|
814
|
+
} = d.useContext(q), {
|
|
815
|
+
prefixCls: t,
|
|
816
|
+
className: i,
|
|
817
|
+
showArrow: r = !0
|
|
818
|
+
} = e, c = o("collapse", t), a = D({
|
|
819
|
+
[`${c}-no-arrow`]: !r
|
|
820
|
+
}, i);
|
|
821
|
+
return /* @__PURE__ */ d.createElement(ge.Panel, Object.assign({
|
|
822
|
+
ref: n
|
|
823
|
+
}, e, {
|
|
824
|
+
prefixCls: c,
|
|
825
|
+
className: a
|
|
826
|
+
}));
|
|
827
|
+
}), Bn = (e) => {
|
|
828
|
+
const {
|
|
829
|
+
componentCls: n,
|
|
830
|
+
contentBg: o,
|
|
831
|
+
padding: t,
|
|
832
|
+
headerBg: i,
|
|
833
|
+
headerPadding: r,
|
|
834
|
+
collapseHeaderPaddingSM: c,
|
|
835
|
+
collapseHeaderPaddingLG: a,
|
|
836
|
+
collapsePanelBorderRadius: l,
|
|
837
|
+
lineWidth: s,
|
|
838
|
+
lineType: m,
|
|
839
|
+
colorBorder: h,
|
|
840
|
+
colorText: C,
|
|
841
|
+
colorTextHeading: u,
|
|
842
|
+
colorTextDisabled: w,
|
|
843
|
+
fontSizeLG: f,
|
|
844
|
+
lineHeight: p,
|
|
845
|
+
lineHeightLG: I,
|
|
846
|
+
marginSM: $,
|
|
847
|
+
paddingSM: S,
|
|
848
|
+
paddingLG: v,
|
|
849
|
+
paddingXS: x,
|
|
850
|
+
motionDurationSlow: g,
|
|
851
|
+
fontSizeIcon: P,
|
|
852
|
+
contentPadding: b,
|
|
853
|
+
fontHeight: k,
|
|
854
|
+
fontHeightLG: M
|
|
855
|
+
} = e, y = `${N(s)} ${m} ${h}`;
|
|
856
|
+
return {
|
|
857
|
+
[n]: Object.assign(Object.assign({}, V(e)), {
|
|
858
|
+
backgroundColor: i,
|
|
859
|
+
border: y,
|
|
860
|
+
borderRadius: l,
|
|
861
|
+
"&-rtl": {
|
|
862
|
+
direction: "rtl"
|
|
863
|
+
},
|
|
864
|
+
[`& > ${n}-item`]: {
|
|
865
|
+
borderBottom: y,
|
|
866
|
+
"&:last-child": {
|
|
867
|
+
[`
|
|
868
|
+
&,
|
|
869
|
+
& > ${n}-header`]: {
|
|
870
|
+
borderRadius: `0 0 ${N(l)} ${N(l)}`
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
[`> ${n}-header`]: {
|
|
874
|
+
position: "relative",
|
|
875
|
+
// Compatible with old version of antd, should remove in next version
|
|
876
|
+
display: "flex",
|
|
877
|
+
flexWrap: "nowrap",
|
|
878
|
+
alignItems: "flex-start",
|
|
879
|
+
padding: r,
|
|
880
|
+
color: u,
|
|
881
|
+
lineHeight: p,
|
|
882
|
+
cursor: "pointer",
|
|
883
|
+
transition: `all ${g}, visibility 0s`,
|
|
884
|
+
[`> ${n}-header-text`]: {
|
|
885
|
+
flex: "auto"
|
|
886
|
+
},
|
|
887
|
+
"&:focus": {
|
|
888
|
+
outline: "none"
|
|
889
|
+
},
|
|
890
|
+
// >>>>> Arrow
|
|
891
|
+
[`${n}-expand-icon`]: {
|
|
892
|
+
height: k,
|
|
893
|
+
display: "flex",
|
|
894
|
+
alignItems: "center",
|
|
895
|
+
paddingInlineEnd: $
|
|
896
|
+
},
|
|
897
|
+
[`${n}-arrow`]: Object.assign(Object.assign({}, Qe()), {
|
|
898
|
+
fontSize: P,
|
|
899
|
+
// when `transform: rotate()` is applied to icon's root element
|
|
900
|
+
transition: `transform ${g}`,
|
|
901
|
+
// when `transform: rotate()` is applied to icon's child element
|
|
902
|
+
svg: {
|
|
903
|
+
transition: `transform ${g}`
|
|
904
|
+
}
|
|
905
|
+
}),
|
|
906
|
+
// >>>>> Text
|
|
907
|
+
[`${n}-header-text`]: {
|
|
908
|
+
marginInlineEnd: "auto"
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
[`${n}-icon-collapsible-only`]: {
|
|
912
|
+
cursor: "unset",
|
|
913
|
+
[`${n}-expand-icon`]: {
|
|
914
|
+
cursor: "pointer"
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
},
|
|
918
|
+
[`${n}-content`]: {
|
|
919
|
+
color: C,
|
|
920
|
+
backgroundColor: o,
|
|
921
|
+
borderTop: y,
|
|
922
|
+
[`& > ${n}-content-box`]: {
|
|
923
|
+
padding: b
|
|
924
|
+
},
|
|
925
|
+
"&-hidden": {
|
|
926
|
+
display: "none"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
"&-small": {
|
|
930
|
+
[`> ${n}-item`]: {
|
|
931
|
+
[`> ${n}-header`]: {
|
|
932
|
+
padding: c,
|
|
933
|
+
paddingInlineStart: x,
|
|
934
|
+
[`> ${n}-expand-icon`]: {
|
|
935
|
+
// Arrow offset
|
|
936
|
+
marginInlineStart: e.calc(S).sub(x).equal()
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
[`> ${n}-content > ${n}-content-box`]: {
|
|
940
|
+
padding: S
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
"&-large": {
|
|
945
|
+
[`> ${n}-item`]: {
|
|
946
|
+
fontSize: f,
|
|
947
|
+
lineHeight: I,
|
|
948
|
+
[`> ${n}-header`]: {
|
|
949
|
+
padding: a,
|
|
950
|
+
paddingInlineStart: t,
|
|
951
|
+
[`> ${n}-expand-icon`]: {
|
|
952
|
+
height: M,
|
|
953
|
+
// Arrow offset
|
|
954
|
+
marginInlineStart: e.calc(v).sub(t).equal()
|
|
955
|
+
}
|
|
956
|
+
},
|
|
957
|
+
[`> ${n}-content > ${n}-content-box`]: {
|
|
958
|
+
padding: v
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
[`${n}-item:last-child`]: {
|
|
963
|
+
borderBottom: 0,
|
|
964
|
+
[`> ${n}-content`]: {
|
|
965
|
+
borderRadius: `0 0 ${N(l)} ${N(l)}`
|
|
966
|
+
}
|
|
967
|
+
},
|
|
968
|
+
[`& ${n}-item-disabled > ${n}-header`]: {
|
|
969
|
+
"\n &,\n & > .arrow\n ": {
|
|
970
|
+
color: w,
|
|
971
|
+
cursor: "not-allowed"
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
// ========================== Icon Position ==========================
|
|
975
|
+
[`&${n}-icon-position-end`]: {
|
|
976
|
+
[`& > ${n}-item`]: {
|
|
977
|
+
[`> ${n}-header`]: {
|
|
978
|
+
[`${n}-expand-icon`]: {
|
|
979
|
+
order: 1,
|
|
980
|
+
paddingInlineEnd: 0,
|
|
981
|
+
paddingInlineStart: $
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
})
|
|
987
|
+
};
|
|
988
|
+
}, jn = (e) => {
|
|
989
|
+
const {
|
|
990
|
+
componentCls: n
|
|
991
|
+
} = e, o = `> ${n}-item > ${n}-header ${n}-arrow`;
|
|
992
|
+
return {
|
|
993
|
+
[`${n}-rtl`]: {
|
|
994
|
+
[o]: {
|
|
995
|
+
transform: "rotate(180deg)"
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
}, An = (e) => {
|
|
1000
|
+
const {
|
|
1001
|
+
componentCls: n,
|
|
1002
|
+
headerBg: o,
|
|
1003
|
+
paddingXXS: t,
|
|
1004
|
+
colorBorder: i
|
|
1005
|
+
} = e;
|
|
1006
|
+
return {
|
|
1007
|
+
[`${n}-borderless`]: {
|
|
1008
|
+
backgroundColor: o,
|
|
1009
|
+
border: 0,
|
|
1010
|
+
[`> ${n}-item`]: {
|
|
1011
|
+
borderBottom: `1px solid ${i}`
|
|
1012
|
+
},
|
|
1013
|
+
[`
|
|
1014
|
+
> ${n}-item:last-child,
|
|
1015
|
+
> ${n}-item:last-child ${n}-header
|
|
1016
|
+
`]: {
|
|
1017
|
+
borderRadius: 0
|
|
1018
|
+
},
|
|
1019
|
+
[`> ${n}-item:last-child`]: {
|
|
1020
|
+
borderBottom: 0
|
|
1021
|
+
},
|
|
1022
|
+
[`> ${n}-item > ${n}-content`]: {
|
|
1023
|
+
backgroundColor: "transparent",
|
|
1024
|
+
borderTop: 0
|
|
1025
|
+
},
|
|
1026
|
+
[`> ${n}-item > ${n}-content > ${n}-content-box`]: {
|
|
1027
|
+
paddingTop: t
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
}, Dn = (e) => {
|
|
1032
|
+
const {
|
|
1033
|
+
componentCls: n,
|
|
1034
|
+
paddingSM: o
|
|
1035
|
+
} = e;
|
|
1036
|
+
return {
|
|
1037
|
+
[`${n}-ghost`]: {
|
|
1038
|
+
backgroundColor: "transparent",
|
|
1039
|
+
border: 0,
|
|
1040
|
+
[`> ${n}-item`]: {
|
|
1041
|
+
borderBottom: 0,
|
|
1042
|
+
[`> ${n}-content`]: {
|
|
1043
|
+
backgroundColor: "transparent",
|
|
1044
|
+
border: 0,
|
|
1045
|
+
[`> ${n}-content-box`]: {
|
|
1046
|
+
paddingBlock: o
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
}, Tn = (e) => ({
|
|
1053
|
+
headerPadding: `${e.paddingSM}px ${e.padding}px`,
|
|
1054
|
+
headerBg: e.colorFillAlter,
|
|
1055
|
+
contentPadding: `${e.padding}px 16px`,
|
|
1056
|
+
// Fixed Value
|
|
1057
|
+
contentBg: e.colorBgContainer
|
|
1058
|
+
}), Hn = ae("Collapse", (e) => {
|
|
1059
|
+
const n = re(e, {
|
|
1060
|
+
collapseHeaderPaddingSM: `${N(e.paddingXS)} ${N(e.paddingSM)}`,
|
|
1061
|
+
collapseHeaderPaddingLG: `${N(e.padding)} ${N(e.paddingLG)}`,
|
|
1062
|
+
collapsePanelBorderRadius: e.borderRadiusLG
|
|
1063
|
+
});
|
|
1064
|
+
return [Bn(n), An(n), Dn(n), jn(n), dn(n)];
|
|
1065
|
+
}, Tn), _n = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
1066
|
+
const {
|
|
1067
|
+
getPrefixCls: o,
|
|
1068
|
+
direction: t,
|
|
1069
|
+
collapse: i
|
|
1070
|
+
} = d.useContext(q), {
|
|
1071
|
+
prefixCls: r,
|
|
1072
|
+
className: c,
|
|
1073
|
+
rootClassName: a,
|
|
1074
|
+
style: l,
|
|
1075
|
+
bordered: s = !0,
|
|
1076
|
+
ghost: m,
|
|
1077
|
+
size: h,
|
|
1078
|
+
expandIconPosition: C = "start",
|
|
1079
|
+
children: u,
|
|
1080
|
+
expandIcon: w
|
|
1081
|
+
} = e, f = ue((y) => {
|
|
1082
|
+
var E;
|
|
1083
|
+
return (E = h ?? y) !== null && E !== void 0 ? E : "middle";
|
|
1084
|
+
}), p = o("collapse", r), I = o(), [$, S, v] = Hn(p), x = d.useMemo(() => C === "left" ? "start" : C === "right" ? "end" : C, [C]), g = w ?? (i == null ? void 0 : i.expandIcon), P = d.useCallback(function() {
|
|
1085
|
+
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1086
|
+
const E = typeof g == "function" ? g(y) : /* @__PURE__ */ d.createElement(cn, {
|
|
1087
|
+
rotate: y.isActive ? 90 : void 0
|
|
1088
|
+
});
|
|
1089
|
+
return be(E, () => {
|
|
1090
|
+
var B;
|
|
1091
|
+
return {
|
|
1092
|
+
className: D((B = E == null ? void 0 : E.props) === null || B === void 0 ? void 0 : B.className, `${p}-arrow`)
|
|
1093
|
+
};
|
|
1094
|
+
});
|
|
1095
|
+
}, [g, p]), b = D(`${p}-icon-position-${x}`, {
|
|
1096
|
+
[`${p}-borderless`]: !s,
|
|
1097
|
+
[`${p}-rtl`]: t === "rtl",
|
|
1098
|
+
[`${p}-ghost`]: !!m,
|
|
1099
|
+
[`${p}-${f}`]: f !== "middle"
|
|
1100
|
+
}, i == null ? void 0 : i.className, c, a, S, v), k = Object.assign(Object.assign({}, on(I)), {
|
|
1101
|
+
motionAppear: !1,
|
|
1102
|
+
leavedClassName: `${p}-content-hidden`
|
|
1103
|
+
}), M = d.useMemo(() => u ? he(u).map((y, E) => {
|
|
1104
|
+
var B, O;
|
|
1105
|
+
if (!((B = y.props) === null || B === void 0) && B.disabled) {
|
|
1106
|
+
const z = (O = y.key) !== null && O !== void 0 ? O : String(E), {
|
|
1107
|
+
disabled: T,
|
|
1108
|
+
collapsible: L
|
|
1109
|
+
} = y.props, K = Object.assign(Object.assign({}, pe(y.props, ["disabled"])), {
|
|
1110
|
+
key: z,
|
|
1111
|
+
collapsible: L ?? (T ? "disabled" : void 0)
|
|
1112
|
+
});
|
|
1113
|
+
return be(y, K);
|
|
1114
|
+
}
|
|
1115
|
+
return y;
|
|
1116
|
+
}) : null, [u]);
|
|
1117
|
+
return $(
|
|
1118
|
+
// @ts-ignore
|
|
1119
|
+
/* @__PURE__ */ d.createElement(ge, Object.assign({
|
|
1120
|
+
ref: n,
|
|
1121
|
+
openMotion: k
|
|
1122
|
+
}, pe(e, ["rootClassName"]), {
|
|
1123
|
+
expandIcon: P,
|
|
1124
|
+
prefixCls: p,
|
|
1125
|
+
className: b,
|
|
1126
|
+
style: Object.assign(Object.assign({}, i == null ? void 0 : i.style), l)
|
|
1127
|
+
}), M)
|
|
1128
|
+
);
|
|
1129
|
+
}), Ln = Object.assign(_n, {
|
|
1130
|
+
Panel: Rn
|
|
1131
|
+
}), Wn = (e) => {
|
|
1132
|
+
const {
|
|
1133
|
+
componentCls: n,
|
|
1134
|
+
sizePaddingEdgeHorizontal: o,
|
|
1135
|
+
colorSplit: t,
|
|
1136
|
+
lineWidth: i,
|
|
1137
|
+
textPaddingInline: r,
|
|
1138
|
+
orientationMargin: c,
|
|
1139
|
+
verticalMarginInline: a
|
|
1140
|
+
} = e;
|
|
1141
|
+
return {
|
|
1142
|
+
[n]: Object.assign(Object.assign({}, V(e)), {
|
|
1143
|
+
borderBlockStart: `${N(i)} solid ${t}`,
|
|
1144
|
+
// vertical
|
|
1145
|
+
"&-vertical": {
|
|
1146
|
+
position: "relative",
|
|
1147
|
+
top: "-0.06em",
|
|
1148
|
+
display: "inline-block",
|
|
1149
|
+
height: "0.9em",
|
|
1150
|
+
marginInline: a,
|
|
1151
|
+
marginBlock: 0,
|
|
1152
|
+
verticalAlign: "middle",
|
|
1153
|
+
borderTop: 0,
|
|
1154
|
+
borderInlineStart: `${N(i)} solid ${t}`
|
|
1155
|
+
},
|
|
1156
|
+
"&-horizontal": {
|
|
1157
|
+
display: "flex",
|
|
1158
|
+
clear: "both",
|
|
1159
|
+
width: "100%",
|
|
1160
|
+
minWidth: "100%",
|
|
1161
|
+
// Fix https://github.com/ant-design/ant-design/issues/10914
|
|
1162
|
+
margin: `${N(e.dividerHorizontalGutterMargin)} 0`
|
|
1163
|
+
},
|
|
1164
|
+
[`&-horizontal${n}-with-text`]: {
|
|
1165
|
+
display: "flex",
|
|
1166
|
+
alignItems: "center",
|
|
1167
|
+
margin: `${N(e.dividerHorizontalWithTextGutterMargin)} 0`,
|
|
1168
|
+
color: e.colorTextHeading,
|
|
1169
|
+
fontWeight: 500,
|
|
1170
|
+
fontSize: e.fontSizeLG,
|
|
1171
|
+
whiteSpace: "nowrap",
|
|
1172
|
+
textAlign: "center",
|
|
1173
|
+
borderBlockStart: `0 ${t}`,
|
|
1174
|
+
"&::before, &::after": {
|
|
1175
|
+
position: "relative",
|
|
1176
|
+
width: "50%",
|
|
1177
|
+
borderBlockStart: `${N(i)} solid transparent`,
|
|
1178
|
+
// Chrome not accept `inherit` in `border-top`
|
|
1179
|
+
borderBlockStartColor: "inherit",
|
|
1180
|
+
borderBlockEnd: 0,
|
|
1181
|
+
transform: "translateY(50%)",
|
|
1182
|
+
content: "''"
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
[`&-horizontal${n}-with-text-left`]: {
|
|
1186
|
+
"&::before": {
|
|
1187
|
+
width: `calc(${c} * 100%)`
|
|
1188
|
+
},
|
|
1189
|
+
"&::after": {
|
|
1190
|
+
width: `calc(100% - ${c} * 100%)`
|
|
1191
|
+
}
|
|
1192
|
+
},
|
|
1193
|
+
[`&-horizontal${n}-with-text-right`]: {
|
|
1194
|
+
"&::before": {
|
|
1195
|
+
width: `calc(100% - ${c} * 100%)`
|
|
1196
|
+
},
|
|
1197
|
+
"&::after": {
|
|
1198
|
+
width: `calc(${c} * 100%)`
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
[`${n}-inner-text`]: {
|
|
1202
|
+
display: "inline-block",
|
|
1203
|
+
paddingBlock: 0,
|
|
1204
|
+
paddingInline: r
|
|
1205
|
+
},
|
|
1206
|
+
"&-dashed": {
|
|
1207
|
+
background: "none",
|
|
1208
|
+
borderColor: t,
|
|
1209
|
+
borderStyle: "dashed",
|
|
1210
|
+
borderWidth: `${N(i)} 0 0`
|
|
1211
|
+
},
|
|
1212
|
+
[`&-horizontal${n}-with-text${n}-dashed`]: {
|
|
1213
|
+
"&::before, &::after": {
|
|
1214
|
+
borderStyle: "dashed none none"
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
[`&-vertical${n}-dashed`]: {
|
|
1218
|
+
borderInlineStartWidth: i,
|
|
1219
|
+
borderInlineEnd: 0,
|
|
1220
|
+
borderBlockStart: 0,
|
|
1221
|
+
borderBlockEnd: 0
|
|
1222
|
+
},
|
|
1223
|
+
[`&-plain${n}-with-text`]: {
|
|
1224
|
+
color: e.colorText,
|
|
1225
|
+
fontWeight: "normal",
|
|
1226
|
+
fontSize: e.fontSize
|
|
1227
|
+
},
|
|
1228
|
+
[`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]: {
|
|
1229
|
+
"&::before": {
|
|
1230
|
+
width: 0
|
|
1231
|
+
},
|
|
1232
|
+
"&::after": {
|
|
1233
|
+
width: "100%"
|
|
1234
|
+
},
|
|
1235
|
+
[`${n}-inner-text`]: {
|
|
1236
|
+
paddingInlineStart: o
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
[`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]: {
|
|
1240
|
+
"&::before": {
|
|
1241
|
+
width: "100%"
|
|
1242
|
+
},
|
|
1243
|
+
"&::after": {
|
|
1244
|
+
width: 0
|
|
1245
|
+
},
|
|
1246
|
+
[`${n}-inner-text`]: {
|
|
1247
|
+
paddingInlineEnd: o
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
})
|
|
1251
|
+
};
|
|
1252
|
+
}, qn = (e) => ({
|
|
1253
|
+
textPaddingInline: "1em",
|
|
1254
|
+
orientationMargin: 0.05,
|
|
1255
|
+
verticalMarginInline: e.marginXS
|
|
1256
|
+
}), Fn = ae("Divider", (e) => {
|
|
1257
|
+
const n = re(e, {
|
|
1258
|
+
dividerHorizontalWithTextGutterMargin: e.margin,
|
|
1259
|
+
dividerHorizontalGutterMargin: e.marginLG,
|
|
1260
|
+
sizePaddingEdgeHorizontal: 0
|
|
1261
|
+
});
|
|
1262
|
+
return [Wn(n)];
|
|
1263
|
+
}, qn, {
|
|
1264
|
+
unitless: {
|
|
1265
|
+
orientationMargin: !0
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
var Gn = function(e, n) {
|
|
1269
|
+
var o = {};
|
|
1270
|
+
for (var t in e)
|
|
1271
|
+
Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
|
|
1272
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1273
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
|
|
1274
|
+
n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
|
|
1275
|
+
return o;
|
|
1276
|
+
};
|
|
1277
|
+
const Vn = (e) => {
|
|
1278
|
+
const {
|
|
1279
|
+
getPrefixCls: n,
|
|
1280
|
+
direction: o,
|
|
1281
|
+
divider: t
|
|
1282
|
+
} = d.useContext(q), {
|
|
1283
|
+
prefixCls: i,
|
|
1284
|
+
type: r = "horizontal",
|
|
1285
|
+
orientation: c = "center",
|
|
1286
|
+
orientationMargin: a,
|
|
1287
|
+
className: l,
|
|
1288
|
+
rootClassName: s,
|
|
1289
|
+
children: m,
|
|
1290
|
+
dashed: h,
|
|
1291
|
+
plain: C,
|
|
1292
|
+
style: u
|
|
1293
|
+
} = e, w = Gn(e, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]), f = n("divider", i), [p, I, $] = Fn(f), S = c.length > 0 ? `-${c}` : c, v = !!m, x = c === "left" && a != null, g = c === "right" && a != null, P = D(f, t == null ? void 0 : t.className, I, $, `${f}-${r}`, {
|
|
1294
|
+
[`${f}-with-text`]: v,
|
|
1295
|
+
[`${f}-with-text${S}`]: v,
|
|
1296
|
+
[`${f}-dashed`]: !!h,
|
|
1297
|
+
[`${f}-plain`]: !!C,
|
|
1298
|
+
[`${f}-rtl`]: o === "rtl",
|
|
1299
|
+
[`${f}-no-default-orientation-margin-left`]: x,
|
|
1300
|
+
[`${f}-no-default-orientation-margin-right`]: g
|
|
1301
|
+
}, l, s), b = d.useMemo(() => typeof a == "number" ? a : /^\d+$/.test(a) ? Number(a) : a, [a]), k = Object.assign(Object.assign({}, x && {
|
|
1302
|
+
marginLeft: b
|
|
1303
|
+
}), g && {
|
|
1304
|
+
marginRight: b
|
|
1305
|
+
});
|
|
1306
|
+
return p(/* @__PURE__ */ d.createElement("div", Object.assign({
|
|
1307
|
+
className: P,
|
|
1308
|
+
style: Object.assign(Object.assign({}, t == null ? void 0 : t.style), u)
|
|
1309
|
+
}, w, {
|
|
1310
|
+
role: "separator"
|
|
1311
|
+
}), m && r !== "vertical" && /* @__PURE__ */ d.createElement("span", {
|
|
1312
|
+
className: `${f}-inner-text`,
|
|
1313
|
+
style: k
|
|
1314
|
+
}, m)));
|
|
1315
|
+
};
|
|
1316
|
+
function ve(e) {
|
|
1317
|
+
return ["small", "middle", "large"].includes(e);
|
|
1318
|
+
}
|
|
1319
|
+
function Ce(e) {
|
|
1320
|
+
return e ? typeof e == "number" && !Number.isNaN(e) : !1;
|
|
1321
|
+
}
|
|
1322
|
+
const He = /* @__PURE__ */ j.createContext({
|
|
1323
|
+
latestIndex: 0
|
|
1324
|
+
}), Kn = He.Provider, Xn = (e) => {
|
|
1325
|
+
let {
|
|
1326
|
+
className: n,
|
|
1327
|
+
index: o,
|
|
1328
|
+
children: t,
|
|
1329
|
+
split: i,
|
|
1330
|
+
style: r
|
|
1331
|
+
} = e;
|
|
1332
|
+
const {
|
|
1333
|
+
latestIndex: c
|
|
1334
|
+
} = d.useContext(He);
|
|
1335
|
+
return t == null ? null : /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", {
|
|
1336
|
+
className: n,
|
|
1337
|
+
style: r
|
|
1338
|
+
}, t), o < c && i && /* @__PURE__ */ d.createElement("span", {
|
|
1339
|
+
className: `${n}-split`
|
|
1340
|
+
}, i));
|
|
1341
|
+
};
|
|
1342
|
+
var Un = function(e, n) {
|
|
1343
|
+
var o = {};
|
|
1344
|
+
for (var t in e)
|
|
1345
|
+
Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
|
|
1346
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1347
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
|
|
1348
|
+
n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
|
|
1349
|
+
return o;
|
|
1350
|
+
};
|
|
1351
|
+
const Yn = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
1352
|
+
var o, t;
|
|
1353
|
+
const {
|
|
1354
|
+
getPrefixCls: i,
|
|
1355
|
+
space: r,
|
|
1356
|
+
direction: c
|
|
1357
|
+
} = d.useContext(q), {
|
|
1358
|
+
size: a = (r == null ? void 0 : r.size) || "small",
|
|
1359
|
+
align: l,
|
|
1360
|
+
className: s,
|
|
1361
|
+
rootClassName: m,
|
|
1362
|
+
children: h,
|
|
1363
|
+
direction: C = "horizontal",
|
|
1364
|
+
prefixCls: u,
|
|
1365
|
+
split: w,
|
|
1366
|
+
style: f,
|
|
1367
|
+
wrap: p = !1,
|
|
1368
|
+
classNames: I,
|
|
1369
|
+
styles: $
|
|
1370
|
+
} = e, S = Un(e, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]), [v, x] = Array.isArray(a) ? a : [a, a], g = ve(x), P = ve(v), b = Ce(x), k = Ce(v), M = he(h, {
|
|
1371
|
+
keepEmpty: !0
|
|
1372
|
+
}), y = l === void 0 && C === "horizontal" ? "center" : l, E = i("space", u), [B, O, z] = rn(E), T = D(E, r == null ? void 0 : r.className, O, `${E}-${C}`, {
|
|
1373
|
+
[`${E}-rtl`]: c === "rtl",
|
|
1374
|
+
[`${E}-align-${y}`]: y,
|
|
1375
|
+
[`${E}-gap-row-${x}`]: g,
|
|
1376
|
+
[`${E}-gap-col-${v}`]: P
|
|
1377
|
+
}, s, m, z), L = D(`${E}-item`, (o = I == null ? void 0 : I.item) !== null && o !== void 0 ? o : (t = r == null ? void 0 : r.classNames) === null || t === void 0 ? void 0 : t.item);
|
|
1378
|
+
let K = 0;
|
|
1379
|
+
const We = M.map((X, le) => {
|
|
1380
|
+
var ce, se;
|
|
1381
|
+
X != null && (K = le);
|
|
1382
|
+
const Fe = X && X.key || `${L}-${le}`;
|
|
1383
|
+
return /* @__PURE__ */ d.createElement(Xn, {
|
|
1384
|
+
className: L,
|
|
1385
|
+
key: Fe,
|
|
1386
|
+
index: le,
|
|
1387
|
+
split: w,
|
|
1388
|
+
style: (ce = $ == null ? void 0 : $.item) !== null && ce !== void 0 ? ce : (se = r == null ? void 0 : r.styles) === null || se === void 0 ? void 0 : se.item
|
|
1389
|
+
}, X);
|
|
1390
|
+
}), qe = d.useMemo(() => ({
|
|
1391
|
+
latestIndex: K
|
|
1392
|
+
}), [K]);
|
|
1393
|
+
if (M.length === 0)
|
|
1394
|
+
return null;
|
|
1395
|
+
const Z = {};
|
|
1396
|
+
return p && (Z.flexWrap = "wrap"), !P && k && (Z.columnGap = v), !g && b && (Z.rowGap = x), B(/* @__PURE__ */ d.createElement("div", Object.assign({
|
|
1397
|
+
ref: n,
|
|
1398
|
+
className: T,
|
|
1399
|
+
style: Object.assign(Object.assign(Object.assign({}, Z), r == null ? void 0 : r.style), f)
|
|
1400
|
+
}, S), /* @__PURE__ */ d.createElement(Kn, {
|
|
1401
|
+
value: qe
|
|
1402
|
+
}, We)));
|
|
1403
|
+
}), _e = Yn;
|
|
1404
|
+
_e.Compact = an;
|
|
1405
|
+
var Jn = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"], Le = /* @__PURE__ */ d.forwardRef(function(e, n) {
|
|
1406
|
+
var o, t = e.prefixCls, i = t === void 0 ? "rc-switch" : t, r = e.className, c = e.checked, a = e.defaultChecked, l = e.disabled, s = e.loadingIcon, m = e.checkedChildren, h = e.unCheckedChildren, C = e.onClick, u = e.onChange, w = e.onKeyDown, f = ie(e, Jn), p = J(!1, {
|
|
1407
|
+
value: c,
|
|
1408
|
+
defaultValue: a
|
|
1409
|
+
}), I = oe(p, 2), $ = I[0], S = I[1];
|
|
1410
|
+
function v(b, k) {
|
|
1411
|
+
var M = $;
|
|
1412
|
+
return l || (M = b, S(M), u == null || u(M, k)), M;
|
|
1413
|
+
}
|
|
1414
|
+
function x(b) {
|
|
1415
|
+
b.which === ne.LEFT ? v(!1, b) : b.which === ne.RIGHT && v(!0, b), w == null || w(b);
|
|
1416
|
+
}
|
|
1417
|
+
function g(b) {
|
|
1418
|
+
var k = v(!$, b);
|
|
1419
|
+
C == null || C(k, b);
|
|
1420
|
+
}
|
|
1421
|
+
var P = D(i, r, (o = {}, _(o, "".concat(i, "-checked"), $), _(o, "".concat(i, "-disabled"), l), o));
|
|
1422
|
+
return /* @__PURE__ */ d.createElement("button", W({}, f, {
|
|
1423
|
+
type: "button",
|
|
1424
|
+
role: "switch",
|
|
1425
|
+
"aria-checked": $,
|
|
1426
|
+
disabled: l,
|
|
1427
|
+
className: P,
|
|
1428
|
+
ref: n,
|
|
1429
|
+
onKeyDown: x,
|
|
1430
|
+
onClick: g
|
|
1431
|
+
}), s, /* @__PURE__ */ d.createElement("span", {
|
|
1432
|
+
className: "".concat(i, "-inner")
|
|
1433
|
+
}, /* @__PURE__ */ d.createElement("span", {
|
|
1434
|
+
className: "".concat(i, "-inner-checked")
|
|
1435
|
+
}, m), /* @__PURE__ */ d.createElement("span", {
|
|
1436
|
+
className: "".concat(i, "-inner-unchecked")
|
|
1437
|
+
}, h)));
|
|
1438
|
+
});
|
|
1439
|
+
Le.displayName = "Switch";
|
|
1440
|
+
const Qn = (e) => {
|
|
1441
|
+
const {
|
|
1442
|
+
componentCls: n,
|
|
1443
|
+
trackHeightSM: o,
|
|
1444
|
+
trackPadding: t,
|
|
1445
|
+
trackMinWidthSM: i,
|
|
1446
|
+
innerMinMarginSM: r,
|
|
1447
|
+
innerMaxMarginSM: c,
|
|
1448
|
+
handleSizeSM: a,
|
|
1449
|
+
calc: l
|
|
1450
|
+
} = e, s = `${n}-inner`, m = N(l(a).add(l(t).mul(2)).equal()), h = N(l(c).mul(2).equal());
|
|
1451
|
+
return {
|
|
1452
|
+
[n]: {
|
|
1453
|
+
[`&${n}-small`]: {
|
|
1454
|
+
minWidth: i,
|
|
1455
|
+
height: o,
|
|
1456
|
+
lineHeight: N(o),
|
|
1457
|
+
[`${n}-inner`]: {
|
|
1458
|
+
paddingInlineStart: c,
|
|
1459
|
+
paddingInlineEnd: r,
|
|
1460
|
+
[`${s}-checked, ${s}-unchecked`]: {
|
|
1461
|
+
minHeight: o
|
|
1462
|
+
},
|
|
1463
|
+
[`${s}-checked`]: {
|
|
1464
|
+
marginInlineStart: `calc(-100% + ${m} - ${h})`,
|
|
1465
|
+
marginInlineEnd: `calc(100% - ${m} + ${h})`
|
|
1466
|
+
},
|
|
1467
|
+
[`${s}-unchecked`]: {
|
|
1468
|
+
marginTop: l(o).mul(-1).equal(),
|
|
1469
|
+
marginInlineStart: 0,
|
|
1470
|
+
marginInlineEnd: 0
|
|
1471
|
+
}
|
|
1472
|
+
},
|
|
1473
|
+
[`${n}-handle`]: {
|
|
1474
|
+
width: a,
|
|
1475
|
+
height: a
|
|
1476
|
+
},
|
|
1477
|
+
[`${n}-loading-icon`]: {
|
|
1478
|
+
top: l(l(a).sub(e.switchLoadingIconSize)).div(2).equal(),
|
|
1479
|
+
fontSize: e.switchLoadingIconSize
|
|
1480
|
+
},
|
|
1481
|
+
[`&${n}-checked`]: {
|
|
1482
|
+
[`${n}-inner`]: {
|
|
1483
|
+
paddingInlineStart: r,
|
|
1484
|
+
paddingInlineEnd: c,
|
|
1485
|
+
[`${s}-checked`]: {
|
|
1486
|
+
marginInlineStart: 0,
|
|
1487
|
+
marginInlineEnd: 0
|
|
1488
|
+
},
|
|
1489
|
+
[`${s}-unchecked`]: {
|
|
1490
|
+
marginInlineStart: `calc(100% - ${m} + ${h})`,
|
|
1491
|
+
marginInlineEnd: `calc(-100% + ${m} - ${h})`
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
[`${n}-handle`]: {
|
|
1495
|
+
insetInlineStart: `calc(100% - ${N(l(a).add(t).equal())})`
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
[`&:not(${n}-disabled):active`]: {
|
|
1499
|
+
[`&:not(${n}-checked) ${s}`]: {
|
|
1500
|
+
[`${s}-unchecked`]: {
|
|
1501
|
+
marginInlineStart: l(e.marginXXS).div(2).equal(),
|
|
1502
|
+
marginInlineEnd: l(e.marginXXS).mul(-1).div(2).equal()
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
[`&${n}-checked ${s}`]: {
|
|
1506
|
+
[`${s}-checked`]: {
|
|
1507
|
+
marginInlineStart: l(e.marginXXS).mul(-1).div(2).equal(),
|
|
1508
|
+
marginInlineEnd: l(e.marginXXS).div(2).equal()
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
};
|
|
1515
|
+
}, Zn = (e) => {
|
|
1516
|
+
const {
|
|
1517
|
+
componentCls: n,
|
|
1518
|
+
handleSize: o,
|
|
1519
|
+
calc: t
|
|
1520
|
+
} = e;
|
|
1521
|
+
return {
|
|
1522
|
+
[n]: {
|
|
1523
|
+
[`${n}-loading-icon${e.iconCls}`]: {
|
|
1524
|
+
position: "relative",
|
|
1525
|
+
top: t(t(o).sub(e.fontSize)).div(2).equal(),
|
|
1526
|
+
color: e.switchLoadingIconColor,
|
|
1527
|
+
verticalAlign: "top"
|
|
1528
|
+
},
|
|
1529
|
+
[`&${n}-checked ${n}-loading-icon`]: {
|
|
1530
|
+
color: e.switchColor
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
}, et = (e) => {
|
|
1535
|
+
const {
|
|
1536
|
+
componentCls: n,
|
|
1537
|
+
trackPadding: o,
|
|
1538
|
+
handleBg: t,
|
|
1539
|
+
handleShadow: i,
|
|
1540
|
+
handleSize: r,
|
|
1541
|
+
calc: c
|
|
1542
|
+
} = e, a = `${n}-handle`;
|
|
1543
|
+
return {
|
|
1544
|
+
[n]: {
|
|
1545
|
+
[a]: {
|
|
1546
|
+
position: "absolute",
|
|
1547
|
+
top: o,
|
|
1548
|
+
insetInlineStart: o,
|
|
1549
|
+
width: r,
|
|
1550
|
+
height: r,
|
|
1551
|
+
transition: `all ${e.switchDuration} ease-in-out`,
|
|
1552
|
+
"&::before": {
|
|
1553
|
+
position: "absolute",
|
|
1554
|
+
top: 0,
|
|
1555
|
+
insetInlineEnd: 0,
|
|
1556
|
+
bottom: 0,
|
|
1557
|
+
insetInlineStart: 0,
|
|
1558
|
+
backgroundColor: t,
|
|
1559
|
+
borderRadius: c(r).div(2).equal(),
|
|
1560
|
+
boxShadow: i,
|
|
1561
|
+
transition: `all ${e.switchDuration} ease-in-out`,
|
|
1562
|
+
content: '""'
|
|
1563
|
+
}
|
|
1564
|
+
},
|
|
1565
|
+
[`&${n}-checked ${a}`]: {
|
|
1566
|
+
insetInlineStart: `calc(100% - ${N(c(r).add(o).equal())})`
|
|
1567
|
+
},
|
|
1568
|
+
[`&:not(${n}-disabled):active`]: {
|
|
1569
|
+
[`${a}::before`]: {
|
|
1570
|
+
insetInlineEnd: e.switchHandleActiveInset,
|
|
1571
|
+
insetInlineStart: 0
|
|
1572
|
+
},
|
|
1573
|
+
[`&${n}-checked ${a}::before`]: {
|
|
1574
|
+
insetInlineEnd: 0,
|
|
1575
|
+
insetInlineStart: e.switchHandleActiveInset
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
}, nt = (e) => {
|
|
1581
|
+
const {
|
|
1582
|
+
componentCls: n,
|
|
1583
|
+
trackHeight: o,
|
|
1584
|
+
trackPadding: t,
|
|
1585
|
+
innerMinMargin: i,
|
|
1586
|
+
innerMaxMargin: r,
|
|
1587
|
+
handleSize: c,
|
|
1588
|
+
calc: a
|
|
1589
|
+
} = e, l = `${n}-inner`, s = N(a(c).add(a(t).mul(2)).equal()), m = N(a(r).mul(2).equal());
|
|
1590
|
+
return {
|
|
1591
|
+
[n]: {
|
|
1592
|
+
[l]: {
|
|
1593
|
+
display: "block",
|
|
1594
|
+
overflow: "hidden",
|
|
1595
|
+
borderRadius: 100,
|
|
1596
|
+
height: "100%",
|
|
1597
|
+
paddingInlineStart: r,
|
|
1598
|
+
paddingInlineEnd: i,
|
|
1599
|
+
transition: `padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,
|
|
1600
|
+
[`${l}-checked, ${l}-unchecked`]: {
|
|
1601
|
+
display: "block",
|
|
1602
|
+
color: e.colorTextLightSolid,
|
|
1603
|
+
fontSize: e.fontSizeSM,
|
|
1604
|
+
transition: `margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,
|
|
1605
|
+
pointerEvents: "none",
|
|
1606
|
+
minHeight: o
|
|
1607
|
+
},
|
|
1608
|
+
[`${l}-checked`]: {
|
|
1609
|
+
marginInlineStart: `calc(-100% + ${s} - ${m})`,
|
|
1610
|
+
marginInlineEnd: `calc(100% - ${s} + ${m})`
|
|
1611
|
+
},
|
|
1612
|
+
[`${l}-unchecked`]: {
|
|
1613
|
+
marginTop: a(o).mul(-1).equal(),
|
|
1614
|
+
marginInlineStart: 0,
|
|
1615
|
+
marginInlineEnd: 0
|
|
1616
|
+
}
|
|
1617
|
+
},
|
|
1618
|
+
[`&${n}-checked ${l}`]: {
|
|
1619
|
+
paddingInlineStart: i,
|
|
1620
|
+
paddingInlineEnd: r,
|
|
1621
|
+
[`${l}-checked`]: {
|
|
1622
|
+
marginInlineStart: 0,
|
|
1623
|
+
marginInlineEnd: 0
|
|
1624
|
+
},
|
|
1625
|
+
[`${l}-unchecked`]: {
|
|
1626
|
+
marginInlineStart: `calc(100% - ${s} + ${m})`,
|
|
1627
|
+
marginInlineEnd: `calc(-100% + ${s} - ${m})`
|
|
1628
|
+
}
|
|
1629
|
+
},
|
|
1630
|
+
[`&:not(${n}-disabled):active`]: {
|
|
1631
|
+
[`&:not(${n}-checked) ${l}`]: {
|
|
1632
|
+
[`${l}-unchecked`]: {
|
|
1633
|
+
marginInlineStart: a(t).mul(2).equal(),
|
|
1634
|
+
marginInlineEnd: a(t).mul(-1).mul(2).equal()
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
[`&${n}-checked ${l}`]: {
|
|
1638
|
+
[`${l}-checked`]: {
|
|
1639
|
+
marginInlineStart: a(t).mul(-1).mul(2).equal(),
|
|
1640
|
+
marginInlineEnd: a(t).mul(2).equal()
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
}, tt = (e) => {
|
|
1647
|
+
const {
|
|
1648
|
+
componentCls: n,
|
|
1649
|
+
trackHeight: o,
|
|
1650
|
+
trackMinWidth: t
|
|
1651
|
+
} = e;
|
|
1652
|
+
return {
|
|
1653
|
+
[n]: Object.assign(Object.assign(Object.assign(Object.assign({}, V(e)), {
|
|
1654
|
+
position: "relative",
|
|
1655
|
+
display: "inline-block",
|
|
1656
|
+
boxSizing: "border-box",
|
|
1657
|
+
minWidth: t,
|
|
1658
|
+
height: o,
|
|
1659
|
+
lineHeight: `${N(o)}`,
|
|
1660
|
+
verticalAlign: "middle",
|
|
1661
|
+
background: e.colorTextQuaternary,
|
|
1662
|
+
border: "0",
|
|
1663
|
+
borderRadius: 100,
|
|
1664
|
+
cursor: "pointer",
|
|
1665
|
+
transition: `all ${e.motionDurationMid}`,
|
|
1666
|
+
userSelect: "none",
|
|
1667
|
+
[`&:hover:not(${n}-disabled)`]: {
|
|
1668
|
+
background: e.colorTextTertiary
|
|
1669
|
+
}
|
|
1670
|
+
}), Ze(e)), {
|
|
1671
|
+
[`&${n}-checked`]: {
|
|
1672
|
+
background: e.switchColor,
|
|
1673
|
+
[`&:hover:not(${n}-disabled)`]: {
|
|
1674
|
+
background: e.colorPrimaryHover
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
[`&${n}-loading, &${n}-disabled`]: {
|
|
1678
|
+
cursor: "not-allowed",
|
|
1679
|
+
opacity: e.switchDisabledOpacity,
|
|
1680
|
+
"*": {
|
|
1681
|
+
boxShadow: "none",
|
|
1682
|
+
cursor: "not-allowed"
|
|
1683
|
+
}
|
|
1684
|
+
},
|
|
1685
|
+
// rtl style
|
|
1686
|
+
[`&${n}-rtl`]: {
|
|
1687
|
+
direction: "rtl"
|
|
1688
|
+
}
|
|
1689
|
+
})
|
|
1690
|
+
};
|
|
1691
|
+
}, it = (e) => {
|
|
1692
|
+
const {
|
|
1693
|
+
fontSize: n,
|
|
1694
|
+
lineHeight: o,
|
|
1695
|
+
controlHeight: t,
|
|
1696
|
+
colorWhite: i
|
|
1697
|
+
} = e, r = n * o, c = t / 2, a = 2, l = r - a * 2, s = c - a * 2;
|
|
1698
|
+
return {
|
|
1699
|
+
trackHeight: r,
|
|
1700
|
+
trackHeightSM: c,
|
|
1701
|
+
trackMinWidth: l * 2 + a * 4,
|
|
1702
|
+
trackMinWidthSM: s * 2 + a * 2,
|
|
1703
|
+
trackPadding: a,
|
|
1704
|
+
// Fixed value
|
|
1705
|
+
handleBg: i,
|
|
1706
|
+
handleSize: l,
|
|
1707
|
+
handleSizeSM: s,
|
|
1708
|
+
handleShadow: `0 2px 4px 0 ${new en("#00230b").setAlpha(0.2).toRgbString()}`,
|
|
1709
|
+
innerMinMargin: l / 2,
|
|
1710
|
+
innerMaxMargin: l + a + a * 2,
|
|
1711
|
+
innerMinMarginSM: s / 2,
|
|
1712
|
+
innerMaxMarginSM: s + a + a * 2
|
|
1713
|
+
};
|
|
1714
|
+
}, ot = ae("Switch", (e) => {
|
|
1715
|
+
const n = re(e, {
|
|
1716
|
+
switchDuration: e.motionDurationMid,
|
|
1717
|
+
switchColor: e.colorPrimary,
|
|
1718
|
+
switchDisabledOpacity: e.opacityLoading,
|
|
1719
|
+
switchLoadingIconSize: e.calc(e.fontSizeIcon).mul(0.75).equal(),
|
|
1720
|
+
switchLoadingIconColor: `rgba(0, 0, 0, ${e.opacityLoading})`,
|
|
1721
|
+
switchHandleActiveInset: "-30%"
|
|
1722
|
+
});
|
|
1723
|
+
return [
|
|
1724
|
+
tt(n),
|
|
1725
|
+
// inner style
|
|
1726
|
+
nt(n),
|
|
1727
|
+
// handle style
|
|
1728
|
+
et(n),
|
|
1729
|
+
// loading style
|
|
1730
|
+
Zn(n),
|
|
1731
|
+
// small style
|
|
1732
|
+
Qn(n)
|
|
1733
|
+
];
|
|
1734
|
+
}, it);
|
|
1735
|
+
var at = function(e, n) {
|
|
1736
|
+
var o = {};
|
|
1737
|
+
for (var t in e)
|
|
1738
|
+
Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
|
|
1739
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1740
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
|
|
1741
|
+
n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (o[t[i]] = e[t[i]]);
|
|
1742
|
+
return o;
|
|
1743
|
+
};
|
|
1744
|
+
const rt = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
1745
|
+
const {
|
|
1746
|
+
prefixCls: o,
|
|
1747
|
+
size: t,
|
|
1748
|
+
disabled: i,
|
|
1749
|
+
loading: r,
|
|
1750
|
+
className: c,
|
|
1751
|
+
rootClassName: a,
|
|
1752
|
+
style: l,
|
|
1753
|
+
checked: s,
|
|
1754
|
+
value: m,
|
|
1755
|
+
defaultChecked: h,
|
|
1756
|
+
defaultValue: C,
|
|
1757
|
+
onChange: u
|
|
1758
|
+
} = e, w = at(e, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]), [f, p] = J(!1, {
|
|
1759
|
+
value: s ?? m,
|
|
1760
|
+
defaultValue: h ?? C
|
|
1761
|
+
}), {
|
|
1762
|
+
getPrefixCls: I,
|
|
1763
|
+
direction: $,
|
|
1764
|
+
switch: S
|
|
1765
|
+
} = d.useContext(q), v = d.useContext(Ee), x = (i ?? v) || r, g = I("switch", o), P = /* @__PURE__ */ d.createElement("div", {
|
|
1766
|
+
className: `${g}-handle`
|
|
1767
|
+
}, r && /* @__PURE__ */ d.createElement(ln, {
|
|
1768
|
+
className: `${g}-loading-icon`
|
|
1769
|
+
})), [b, k, M] = ot(g), y = ue(t), E = D(S == null ? void 0 : S.className, {
|
|
1770
|
+
[`${g}-small`]: y === "small",
|
|
1771
|
+
[`${g}-loading`]: r,
|
|
1772
|
+
[`${g}-rtl`]: $ === "rtl"
|
|
1773
|
+
}, c, a, k, M), B = Object.assign(Object.assign({}, S == null ? void 0 : S.style), l), O = function() {
|
|
1774
|
+
p(arguments.length <= 0 ? void 0 : arguments[0]), u == null || u.apply(void 0, arguments);
|
|
1775
|
+
};
|
|
1776
|
+
return b(/* @__PURE__ */ d.createElement(Ne, {
|
|
1777
|
+
component: "Switch"
|
|
1778
|
+
}, /* @__PURE__ */ d.createElement(Le, Object.assign({}, w, {
|
|
1779
|
+
checked: f,
|
|
1780
|
+
onChange: O,
|
|
1781
|
+
prefixCls: g,
|
|
1782
|
+
className: E,
|
|
1783
|
+
style: B,
|
|
1784
|
+
disabled: x,
|
|
1785
|
+
ref: n,
|
|
1786
|
+
loadingIcon: P
|
|
1787
|
+
}))));
|
|
1788
|
+
}), de = rt;
|
|
1789
|
+
de.__ANT_SWITCH = !0;
|
|
1790
|
+
var lt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z" } }] }, name: "chrome", theme: "outlined" }, ct = function(n, o) {
|
|
1791
|
+
return /* @__PURE__ */ d.createElement(Q, W({}, n, {
|
|
1792
|
+
ref: o,
|
|
1793
|
+
icon: lt
|
|
1794
|
+
}));
|
|
1795
|
+
}, st = /* @__PURE__ */ d.forwardRef(ct), dt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z" } }] }, name: "mail", theme: "outlined" }, ut = function(n, o) {
|
|
1796
|
+
return /* @__PURE__ */ d.createElement(Q, W({}, n, {
|
|
1797
|
+
ref: o,
|
|
1798
|
+
icon: dt
|
|
1799
|
+
}));
|
|
1800
|
+
}, $e = /* @__PURE__ */ d.forwardRef(ut), ht = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z" } }] }, name: "message", theme: "outlined" }, gt = function(n, o) {
|
|
1801
|
+
return /* @__PURE__ */ d.createElement(Q, W({}, n, {
|
|
1802
|
+
ref: o,
|
|
1803
|
+
icon: ht
|
|
1804
|
+
}));
|
|
1805
|
+
}, mt = /* @__PURE__ */ d.forwardRef(gt), ft = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M744 62H280c-35.3 0-64 28.7-64 64v768c0 35.3 28.7 64 64 64h464c35.3 0 64-28.7 64-64V126c0-35.3-28.7-64-64-64zm-8 824H288V134h448v752zM472 784a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "mobile", theme: "outlined" }, bt = function(n, o) {
|
|
1806
|
+
return /* @__PURE__ */ d.createElement(Q, W({}, n, {
|
|
1807
|
+
ref: o,
|
|
1808
|
+
icon: ft
|
|
1809
|
+
}));
|
|
1810
|
+
}, pt = /* @__PURE__ */ d.forwardRef(bt), vt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M877.1 238.7L770.6 132.3c-13-13-30.4-20.3-48.8-20.3s-35.8 7.2-48.8 20.3L558.3 246.8c-13 13-20.3 30.5-20.3 48.9 0 18.5 7.2 35.8 20.3 48.9l89.6 89.7a405.46 405.46 0 01-86.4 127.3c-36.7 36.9-79.6 66-127.2 86.6l-89.6-89.7c-13-13-30.4-20.3-48.8-20.3a68.2 68.2 0 00-48.8 20.3L132.3 673c-13 13-20.3 30.5-20.3 48.9 0 18.5 7.2 35.8 20.3 48.9l106.4 106.4c22.2 22.2 52.8 34.9 84.2 34.9 6.5 0 12.8-.5 19.2-1.6 132.4-21.8 263.8-92.3 369.9-198.3C818 606 888.4 474.6 910.4 342.1c6.3-37.6-6.3-76.3-33.3-103.4zm-37.6 91.5c-19.5 117.9-82.9 235.5-178.4 331s-213 158.9-330.9 178.4c-14.8 2.5-30-2.5-40.8-13.2L184.9 721.9 295.7 611l119.8 120 .9.9 21.6-8a481.29 481.29 0 00285.7-285.8l8-21.6-120.8-120.7 110.8-110.9 104.5 104.5c10.8 10.8 15.8 26 13.3 40.8z" } }] }, name: "phone", theme: "outlined" }, Ct = function(n, o) {
|
|
1811
|
+
return /* @__PURE__ */ d.createElement(Q, W({}, n, {
|
|
1812
|
+
ref: o,
|
|
1813
|
+
icon: vt
|
|
1814
|
+
}));
|
|
1815
|
+
}, $t = /* @__PURE__ */ d.forwardRef(Ct);
|
|
1816
|
+
const U = ze.Text, ye = (e) => ({
|
|
1817
|
+
off: "Off",
|
|
1818
|
+
instant: "Instant",
|
|
1819
|
+
hourly: "Hourly",
|
|
1820
|
+
daily: "Daily",
|
|
1821
|
+
weekly: "Weekly",
|
|
1822
|
+
monthly: "Monthly"
|
|
1823
|
+
})[e], yt = (e, n) => {
|
|
1824
|
+
const o = [
|
|
1825
|
+
H.EMAIL,
|
|
1826
|
+
H.INAPP_WEB,
|
|
1827
|
+
H.SMS,
|
|
1828
|
+
H.CALL,
|
|
1829
|
+
H.PUSH,
|
|
1830
|
+
H.WEB_PUSH
|
|
1831
|
+
];
|
|
1832
|
+
return o.indexOf(e) - o.indexOf(n);
|
|
1833
|
+
}, Se = (e, n) => {
|
|
1834
|
+
const o = [
|
|
1835
|
+
A.OFF,
|
|
1836
|
+
A.INSTANT,
|
|
1837
|
+
A.HOURLY,
|
|
1838
|
+
A.DAILY,
|
|
1839
|
+
A.WEEKLY,
|
|
1840
|
+
A.MONTHLY
|
|
1841
|
+
];
|
|
1842
|
+
return o.indexOf(e) - o.indexOf(n);
|
|
1843
|
+
}, xe = () => {
|
|
1844
|
+
const e = Oe(ke);
|
|
1845
|
+
if (!e || !e.preferences)
|
|
1846
|
+
return null;
|
|
1847
|
+
const n = e.preferences.preferences, t = e.preferences.notifications.map((i) => {
|
|
1848
|
+
const r = Array.from(
|
|
1849
|
+
new Set(
|
|
1850
|
+
n.filter(
|
|
1851
|
+
(c) => c.notificationId === i.notificationId && c.delivery !== A.OFF
|
|
1852
|
+
).map((c) => c.channel)
|
|
1853
|
+
)
|
|
1854
|
+
);
|
|
1855
|
+
return {
|
|
1856
|
+
label: i.notificationId,
|
|
1857
|
+
key: i.notificationId,
|
|
1858
|
+
extra: /* @__PURE__ */ R(U, { type: "secondary", children: r.map((c) => we(c)).join(", ") }),
|
|
1859
|
+
children: /* @__PURE__ */ R("div", { children: i.channels.sort(yt).map((c, a) => {
|
|
1860
|
+
const l = n.find(
|
|
1861
|
+
(s) => s.channel === c && s.notificationId === i.notificationId
|
|
1862
|
+
);
|
|
1863
|
+
if (l.notificationId === i.notificationId) {
|
|
1864
|
+
let s = we(c), m = St(c);
|
|
1865
|
+
const h = Object.keys(i.options[c]).filter(
|
|
1866
|
+
(u) => u !== "defaultDeliveryOption" && u !== "defaultDeliverOption"
|
|
1867
|
+
);
|
|
1868
|
+
let C;
|
|
1869
|
+
return h.length === 1 ? C = /* @__PURE__ */ R(U, { children: ye(l.delivery) }) : h.length === 2 && h.includes(A.OFF) ? C = /* @__PURE__ */ R(
|
|
1870
|
+
de,
|
|
1871
|
+
{
|
|
1872
|
+
checked: l.delivery !== A.OFF,
|
|
1873
|
+
onChange: (u) => {
|
|
1874
|
+
if (u) {
|
|
1875
|
+
const w = h.find(
|
|
1876
|
+
(f) => f !== A.OFF
|
|
1877
|
+
);
|
|
1878
|
+
e.updateDelivery(i.notificationId, c, w);
|
|
1879
|
+
} else
|
|
1880
|
+
e.updateDelivery(
|
|
1881
|
+
i.notificationId,
|
|
1882
|
+
c,
|
|
1883
|
+
A.OFF
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
) : C = /* @__PURE__ */ G(ee, { children: [
|
|
1888
|
+
/* @__PURE__ */ R(
|
|
1889
|
+
de,
|
|
1890
|
+
{
|
|
1891
|
+
checked: l.delivery !== A.OFF,
|
|
1892
|
+
onChange: (u) => {
|
|
1893
|
+
if (u) {
|
|
1894
|
+
const w = h.sort(Se).find((f) => f !== A.OFF);
|
|
1895
|
+
e.updateDelivery(i.notificationId, c, w);
|
|
1896
|
+
} else
|
|
1897
|
+
e.updateDelivery(
|
|
1898
|
+
i.notificationId,
|
|
1899
|
+
c,
|
|
1900
|
+
A.OFF
|
|
1901
|
+
);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
),
|
|
1905
|
+
/* @__PURE__ */ R(
|
|
1906
|
+
"div",
|
|
1907
|
+
{
|
|
1908
|
+
style: {
|
|
1909
|
+
width: "100%",
|
|
1910
|
+
marginTop: 8,
|
|
1911
|
+
maxHeight: l.delivery !== A.OFF ? 1e3 : 0,
|
|
1912
|
+
overflow: "hidden",
|
|
1913
|
+
transition: "max-height 0.3s ease"
|
|
1914
|
+
},
|
|
1915
|
+
children: /* @__PURE__ */ G("div", { children: [
|
|
1916
|
+
/* @__PURE__ */ R("div", { style: { marginTop: 20 }, children: /* @__PURE__ */ R(U, { strong: !0, children: "Choose frequency:" }) }),
|
|
1917
|
+
/* @__PURE__ */ R(
|
|
1918
|
+
Y.Group,
|
|
1919
|
+
{
|
|
1920
|
+
value: l.delivery,
|
|
1921
|
+
onChange: (u) => {
|
|
1922
|
+
e.updateDelivery(
|
|
1923
|
+
i.notificationId,
|
|
1924
|
+
c,
|
|
1925
|
+
u.target.value
|
|
1926
|
+
);
|
|
1927
|
+
},
|
|
1928
|
+
children: /* @__PURE__ */ R(
|
|
1929
|
+
_e,
|
|
1930
|
+
{
|
|
1931
|
+
direction: "vertical",
|
|
1932
|
+
style: { paddingTop: 10 },
|
|
1933
|
+
children: h.filter((u) => u !== A.OFF).sort(Se).map((u) => /* @__PURE__ */ R(Y, { value: u, children: /* @__PURE__ */ R(U, { children: ye(u) }) }, u))
|
|
1934
|
+
}
|
|
1935
|
+
)
|
|
1936
|
+
}
|
|
1937
|
+
)
|
|
1938
|
+
] })
|
|
1939
|
+
}
|
|
1940
|
+
)
|
|
1941
|
+
] }), /* @__PURE__ */ G(ee, { children: [
|
|
1942
|
+
/* @__PURE__ */ G(
|
|
1943
|
+
"div",
|
|
1944
|
+
{
|
|
1945
|
+
style: {
|
|
1946
|
+
display: "flex",
|
|
1947
|
+
justifyContent: "space-between",
|
|
1948
|
+
flexWrap: "wrap",
|
|
1949
|
+
marginTop: a === 0 ? 12 : 0,
|
|
1950
|
+
marginBottom: a === i.channels.length - 1 ? 12 : 0
|
|
1951
|
+
},
|
|
1952
|
+
children: [
|
|
1953
|
+
/* @__PURE__ */ G(U, { children: [
|
|
1954
|
+
m,
|
|
1955
|
+
" ",
|
|
1956
|
+
s
|
|
1957
|
+
] }),
|
|
1958
|
+
C
|
|
1959
|
+
]
|
|
1960
|
+
},
|
|
1961
|
+
c
|
|
1962
|
+
),
|
|
1963
|
+
a !== i.channels.length - 1 && /* @__PURE__ */ R(Vn, {})
|
|
1964
|
+
] });
|
|
1965
|
+
}
|
|
1966
|
+
}) }, i.notificationId)
|
|
1967
|
+
};
|
|
1968
|
+
});
|
|
1969
|
+
return /* @__PURE__ */ R(Ln, { items: t, defaultActiveKey: [] });
|
|
1970
|
+
}, Ie = ze.Text, we = (e) => ({
|
|
1971
|
+
EMAIL: "Email",
|
|
1972
|
+
INAPP_WEB: "In-App",
|
|
1973
|
+
SMS: "Text",
|
|
1974
|
+
CALL: "Automated Calling",
|
|
1975
|
+
PUSH: "Mobile",
|
|
1976
|
+
WEB_PUSH: "Browser"
|
|
1977
|
+
})[e], St = (e) => {
|
|
1978
|
+
switch (e) {
|
|
1979
|
+
case H.EMAIL:
|
|
1980
|
+
return /* @__PURE__ */ R($e, { style: { color: F.primary } });
|
|
1981
|
+
case H.SMS:
|
|
1982
|
+
return /* @__PURE__ */ R(mt, { style: { color: F.primary } });
|
|
1983
|
+
case H.PUSH:
|
|
1984
|
+
return /* @__PURE__ */ R(pt, { style: { color: F.primary } });
|
|
1985
|
+
case H.CALL:
|
|
1986
|
+
return /* @__PURE__ */ R($t, { style: { color: F.primary } });
|
|
1987
|
+
case H.INAPP_WEB:
|
|
1988
|
+
return /* @__PURE__ */ R(sn, { style: { color: F.primary } });
|
|
1989
|
+
case H.WEB_PUSH:
|
|
1990
|
+
return /* @__PURE__ */ R(st, { style: { color: F.primary } });
|
|
1991
|
+
default:
|
|
1992
|
+
return /* @__PURE__ */ R($e, { style: { color: F.primary } });
|
|
1993
|
+
}
|
|
1994
|
+
};
|
|
1995
|
+
function Et() {
|
|
1996
|
+
const e = Oe(ke);
|
|
1997
|
+
if (!e || !e.preferences)
|
|
1998
|
+
return null;
|
|
1999
|
+
const n = e.preferences.preferences;
|
|
2000
|
+
console.log(n);
|
|
2001
|
+
const o = e.preferences.subNotifications, t = [];
|
|
2002
|
+
return o.forEach((i) => {
|
|
2003
|
+
t.find(
|
|
2004
|
+
(r) => r.subNotificationId === i.subNotificationId
|
|
2005
|
+
) || t.push({
|
|
2006
|
+
subNotificationId: i.subNotificationId,
|
|
2007
|
+
title: i.title
|
|
2008
|
+
});
|
|
2009
|
+
}), /* @__PURE__ */ G(ee, { children: [
|
|
2010
|
+
/* @__PURE__ */ R(Ie, { strong: !0, children: "General Notifications" }),
|
|
2011
|
+
/* @__PURE__ */ R(
|
|
2012
|
+
xe,
|
|
2013
|
+
{
|
|
2014
|
+
title: "General Notifications",
|
|
2015
|
+
subNotificationId: void 0
|
|
2016
|
+
}
|
|
2017
|
+
),
|
|
2018
|
+
t.map((i) => /* @__PURE__ */ G(ee, { children: [
|
|
2019
|
+
/* @__PURE__ */ R(Ie, { strong: !0, children: i.title }),
|
|
2020
|
+
/* @__PURE__ */ R(
|
|
2021
|
+
xe,
|
|
2022
|
+
{
|
|
2023
|
+
title: i.title,
|
|
2024
|
+
subNotificationId: i.subNotificationId
|
|
2025
|
+
}
|
|
2026
|
+
)
|
|
2027
|
+
] }))
|
|
2028
|
+
] });
|
|
2029
|
+
}
|
|
2030
|
+
export {
|
|
2031
|
+
Et as P,
|
|
2032
|
+
xe as a,
|
|
2033
|
+
St as b,
|
|
2034
|
+
we as g
|
|
2035
|
+
};
|