@notificationapi/react 0.0.34 → 0.0.36
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/README.md +1 -1
- package/dist/assets/AntdIcon.js +1 -1
- package/dist/assets/CloseOutlined.js +13 -0
- package/dist/assets/Notification.js +17 -16
- package/dist/assets/PreferenceInput.js +1470 -0
- package/dist/assets/PurePanel.js +32 -42
- package/dist/assets/WebPushOptInMessage.js +478 -0
- package/dist/assets/button.js +50 -50
- package/dist/assets/colors.js +25 -20840
- package/dist/assets/compact-item.js +860 -0
- package/dist/assets/index.js +11 -9
- package/dist/assets/index2.js +10 -9
- package/dist/assets/index3.js +2303 -3150
- package/dist/assets/presets.js +22 -22
- package/dist/assets/reactNode.js +20821 -0
- package/dist/components/Notifications/Inbox.js +81 -78
- package/dist/components/Notifications/NotificationFeed.js +59 -31
- package/dist/components/Notifications/NotificationLauncher.js +61 -41
- package/dist/components/Notifications/NotificationPopup.js +72 -65
- package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -1
- package/dist/components/Preferences/NotificationPreferencesInline.js +39 -5
- package/dist/components/Preferences/NotificationPreferencesPopup.d.ts +1 -1
- package/dist/components/Preferences/NotificationPreferencesPopup.js +463 -464
- package/dist/components/Preferences/PreferenceInput.js +5 -1466
- package/dist/components/Preferences/Preferences.js +24 -23
- package/dist/components/Provider/index.d.ts +9 -1
- package/dist/components/Provider/index.js +211 -156
- package/dist/components/WebPush/WebPushOptInMessage.d.ts +14 -0
- package/dist/components/WebPush/WebPushOptInMessage.js +8 -0
- package/package.json +2 -2
|
@@ -1,1468 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import Te, { forwardRef as He, useRef as le, useImperativeHandle as We } from "react";
|
|
6
|
-
import { d as fe, e as me, c as _, f as U, a as ve, _ as de } from "../../assets/presets.js";
|
|
7
|
-
import { g as ne, m as oe, r as A, u as E, h as Ce, a as W, j as qe, e as Se, D as $e, k as Ve, T as Le } from "../../assets/colors.js";
|
|
8
|
-
import { p as Ae } from "../../assets/pickAttrs.js";
|
|
9
|
-
const ye = /* @__PURE__ */ d.createContext(null), Ge = ye.Provider, xe = /* @__PURE__ */ d.createContext(null), Fe = xe.Provider;
|
|
10
|
-
var Xe = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"], Ke = /* @__PURE__ */ He(function(e, n) {
|
|
11
|
-
var i = e.prefixCls, t = i === void 0 ? "rc-checkbox" : i, o = e.className, s = e.style, a = e.checked, r = e.disabled, l = e.defaultChecked, c = l === void 0 ? !1 : l, g = e.type, u = g === void 0 ? "checkbox" : g, S = e.title, m = e.onChange, w = fe(e, Xe), y = le(null), b = le(null), k = Y(c, {
|
|
12
|
-
value: a
|
|
13
|
-
}), f = me(k, 2), v = f[0], x = f[1];
|
|
14
|
-
We(n, function() {
|
|
15
|
-
return {
|
|
16
|
-
focus: function(h) {
|
|
17
|
-
var $;
|
|
18
|
-
($ = y.current) === null || $ === void 0 || $.focus(h);
|
|
19
|
-
},
|
|
20
|
-
blur: function() {
|
|
21
|
-
var h;
|
|
22
|
-
(h = y.current) === null || h === void 0 || h.blur();
|
|
23
|
-
},
|
|
24
|
-
input: y.current,
|
|
25
|
-
nativeElement: b.current
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
var I = _(t, o, U(U({}, "".concat(t, "-checked"), v), "".concat(t, "-disabled"), r)), p = function(h) {
|
|
29
|
-
r || ("checked" in e || x(h.target.checked), m == null || m({
|
|
30
|
-
target: de(de({}, e), {}, {
|
|
31
|
-
type: u,
|
|
32
|
-
checked: h.target.checked
|
|
33
|
-
}),
|
|
34
|
-
stopPropagation: function() {
|
|
35
|
-
h.stopPropagation();
|
|
36
|
-
},
|
|
37
|
-
preventDefault: function() {
|
|
38
|
-
h.preventDefault();
|
|
39
|
-
},
|
|
40
|
-
nativeEvent: h.nativeEvent
|
|
41
|
-
}));
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ d.createElement("span", {
|
|
44
|
-
className: I,
|
|
45
|
-
title: S,
|
|
46
|
-
style: s,
|
|
47
|
-
ref: b
|
|
48
|
-
}, /* @__PURE__ */ d.createElement("input", ve({}, w, {
|
|
49
|
-
className: "".concat(t, "-input"),
|
|
50
|
-
ref: y,
|
|
51
|
-
onChange: p,
|
|
52
|
-
disabled: r,
|
|
53
|
-
checked: !!v,
|
|
54
|
-
type: u
|
|
55
|
-
})), /* @__PURE__ */ d.createElement("span", {
|
|
56
|
-
className: "".concat(t, "-inner")
|
|
57
|
-
}));
|
|
58
|
-
});
|
|
59
|
-
const Ue = (e) => {
|
|
60
|
-
const {
|
|
61
|
-
componentCls: n,
|
|
62
|
-
antCls: i
|
|
63
|
-
} = e, t = `${n}-group`;
|
|
64
|
-
return {
|
|
65
|
-
[t]: Object.assign(Object.assign({}, A(e)), {
|
|
66
|
-
display: "inline-block",
|
|
67
|
-
fontSize: 0,
|
|
68
|
-
// RTL
|
|
69
|
-
[`&${t}-rtl`]: {
|
|
70
|
-
direction: "rtl"
|
|
71
|
-
},
|
|
72
|
-
[`&${t}-block`]: {
|
|
73
|
-
display: "flex"
|
|
74
|
-
},
|
|
75
|
-
[`${i}-badge ${i}-badge-count`]: {
|
|
76
|
-
zIndex: 1
|
|
77
|
-
},
|
|
78
|
-
[`> ${i}-badge:not(:first-child) > ${i}-button-wrapper`]: {
|
|
79
|
-
borderInlineStart: "none"
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
};
|
|
83
|
-
}, Qe = (e) => {
|
|
84
|
-
const {
|
|
85
|
-
componentCls: n,
|
|
86
|
-
wrapperMarginInlineEnd: i,
|
|
87
|
-
colorPrimary: t,
|
|
88
|
-
radioSize: o,
|
|
89
|
-
motionDurationSlow: s,
|
|
90
|
-
motionDurationMid: a,
|
|
91
|
-
motionEaseInOutCirc: r,
|
|
92
|
-
colorBgContainer: l,
|
|
93
|
-
colorBorder: c,
|
|
94
|
-
lineWidth: g,
|
|
95
|
-
colorBgContainerDisabled: u,
|
|
96
|
-
colorTextDisabled: S,
|
|
97
|
-
paddingXS: m,
|
|
98
|
-
dotColorDisabled: w,
|
|
99
|
-
lineType: y,
|
|
100
|
-
radioColor: b,
|
|
101
|
-
radioBgColor: k,
|
|
102
|
-
calc: f
|
|
103
|
-
} = e, v = `${n}-inner`, I = f(o).sub(f(4).mul(2)), p = f(1).mul(o).equal({
|
|
104
|
-
unit: !0
|
|
105
|
-
});
|
|
106
|
-
return {
|
|
107
|
-
[`${n}-wrapper`]: Object.assign(Object.assign({}, A(e)), {
|
|
108
|
-
display: "inline-flex",
|
|
109
|
-
alignItems: "baseline",
|
|
110
|
-
marginInlineStart: 0,
|
|
111
|
-
marginInlineEnd: i,
|
|
112
|
-
cursor: "pointer",
|
|
113
|
-
// RTL
|
|
114
|
-
[`&${n}-wrapper-rtl`]: {
|
|
115
|
-
direction: "rtl"
|
|
116
|
-
},
|
|
117
|
-
"&-disabled": {
|
|
118
|
-
cursor: "not-allowed",
|
|
119
|
-
color: e.colorTextDisabled
|
|
120
|
-
},
|
|
121
|
-
"&::after": {
|
|
122
|
-
display: "inline-block",
|
|
123
|
-
width: 0,
|
|
124
|
-
overflow: "hidden",
|
|
125
|
-
content: '"\\a0"'
|
|
126
|
-
},
|
|
127
|
-
"&-block": {
|
|
128
|
-
flex: 1,
|
|
129
|
-
justifyContent: "center"
|
|
130
|
-
},
|
|
131
|
-
// hashId 在 wrapper 上,只能铺平
|
|
132
|
-
[`${n}-checked::after`]: {
|
|
133
|
-
position: "absolute",
|
|
134
|
-
insetBlockStart: 0,
|
|
135
|
-
insetInlineStart: 0,
|
|
136
|
-
width: "100%",
|
|
137
|
-
height: "100%",
|
|
138
|
-
border: `${E(g)} ${y} ${t}`,
|
|
139
|
-
borderRadius: "50%",
|
|
140
|
-
visibility: "hidden",
|
|
141
|
-
opacity: 0,
|
|
142
|
-
content: '""'
|
|
143
|
-
},
|
|
144
|
-
[n]: Object.assign(Object.assign({}, A(e)), {
|
|
145
|
-
position: "relative",
|
|
146
|
-
display: "inline-block",
|
|
147
|
-
outline: "none",
|
|
148
|
-
cursor: "pointer",
|
|
149
|
-
alignSelf: "center",
|
|
150
|
-
borderRadius: "50%"
|
|
151
|
-
}),
|
|
152
|
-
[`${n}-wrapper:hover &,
|
|
153
|
-
&:hover ${v}`]: {
|
|
154
|
-
borderColor: t
|
|
155
|
-
},
|
|
156
|
-
[`${n}-input:focus-visible + ${v}`]: Object.assign({}, Ce(e)),
|
|
157
|
-
[`${n}:hover::after, ${n}-wrapper:hover &::after`]: {
|
|
158
|
-
visibility: "visible"
|
|
159
|
-
},
|
|
160
|
-
[`${n}-inner`]: {
|
|
161
|
-
"&::after": {
|
|
162
|
-
boxSizing: "border-box",
|
|
163
|
-
position: "absolute",
|
|
164
|
-
insetBlockStart: "50%",
|
|
165
|
-
insetInlineStart: "50%",
|
|
166
|
-
display: "block",
|
|
167
|
-
width: p,
|
|
168
|
-
height: p,
|
|
169
|
-
marginBlockStart: f(1).mul(o).div(-2).equal({
|
|
170
|
-
unit: !0
|
|
171
|
-
}),
|
|
172
|
-
marginInlineStart: f(1).mul(o).div(-2).equal({
|
|
173
|
-
unit: !0
|
|
174
|
-
}),
|
|
175
|
-
backgroundColor: b,
|
|
176
|
-
borderBlockStart: 0,
|
|
177
|
-
borderInlineStart: 0,
|
|
178
|
-
borderRadius: p,
|
|
179
|
-
transform: "scale(0)",
|
|
180
|
-
opacity: 0,
|
|
181
|
-
transition: `all ${s} ${r}`,
|
|
182
|
-
content: '""'
|
|
183
|
-
},
|
|
184
|
-
boxSizing: "border-box",
|
|
185
|
-
position: "relative",
|
|
186
|
-
insetBlockStart: 0,
|
|
187
|
-
insetInlineStart: 0,
|
|
188
|
-
display: "block",
|
|
189
|
-
width: p,
|
|
190
|
-
height: p,
|
|
191
|
-
backgroundColor: l,
|
|
192
|
-
borderColor: c,
|
|
193
|
-
borderStyle: "solid",
|
|
194
|
-
borderWidth: g,
|
|
195
|
-
borderRadius: "50%",
|
|
196
|
-
transition: `all ${a}`
|
|
197
|
-
},
|
|
198
|
-
[`${n}-input`]: {
|
|
199
|
-
position: "absolute",
|
|
200
|
-
inset: 0,
|
|
201
|
-
zIndex: 1,
|
|
202
|
-
cursor: "pointer",
|
|
203
|
-
opacity: 0
|
|
204
|
-
},
|
|
205
|
-
// 选中状态
|
|
206
|
-
[`${n}-checked`]: {
|
|
207
|
-
[v]: {
|
|
208
|
-
borderColor: t,
|
|
209
|
-
backgroundColor: k,
|
|
210
|
-
"&::after": {
|
|
211
|
-
transform: `scale(${e.calc(e.dotSize).div(o).equal()})`,
|
|
212
|
-
opacity: 1,
|
|
213
|
-
transition: `all ${s} ${r}`
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
[`${n}-disabled`]: {
|
|
218
|
-
cursor: "not-allowed",
|
|
219
|
-
[v]: {
|
|
220
|
-
backgroundColor: u,
|
|
221
|
-
borderColor: c,
|
|
222
|
-
cursor: "not-allowed",
|
|
223
|
-
"&::after": {
|
|
224
|
-
backgroundColor: w
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
[`${n}-input`]: {
|
|
228
|
-
cursor: "not-allowed"
|
|
229
|
-
},
|
|
230
|
-
[`${n}-disabled + span`]: {
|
|
231
|
-
color: S,
|
|
232
|
-
cursor: "not-allowed"
|
|
233
|
-
},
|
|
234
|
-
[`&${n}-checked`]: {
|
|
235
|
-
[v]: {
|
|
236
|
-
"&::after": {
|
|
237
|
-
transform: `scale(${f(I).div(o).equal()})`
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
[`span${n} + *`]: {
|
|
243
|
-
paddingInlineStart: m,
|
|
244
|
-
paddingInlineEnd: m
|
|
245
|
-
}
|
|
246
|
-
})
|
|
247
|
-
};
|
|
248
|
-
}, Ye = (e) => {
|
|
249
|
-
const {
|
|
250
|
-
buttonColor: n,
|
|
251
|
-
controlHeight: i,
|
|
252
|
-
componentCls: t,
|
|
253
|
-
lineWidth: o,
|
|
254
|
-
lineType: s,
|
|
255
|
-
colorBorder: a,
|
|
256
|
-
motionDurationSlow: r,
|
|
257
|
-
motionDurationMid: l,
|
|
258
|
-
buttonPaddingInline: c,
|
|
259
|
-
fontSize: g,
|
|
260
|
-
buttonBg: u,
|
|
261
|
-
fontSizeLG: S,
|
|
262
|
-
controlHeightLG: m,
|
|
263
|
-
controlHeightSM: w,
|
|
264
|
-
paddingXS: y,
|
|
265
|
-
borderRadius: b,
|
|
266
|
-
borderRadiusSM: k,
|
|
267
|
-
borderRadiusLG: f,
|
|
268
|
-
buttonCheckedBg: v,
|
|
269
|
-
buttonSolidCheckedColor: x,
|
|
270
|
-
colorTextDisabled: I,
|
|
271
|
-
colorBgContainerDisabled: p,
|
|
272
|
-
buttonCheckedBgDisabled: P,
|
|
273
|
-
buttonCheckedColorDisabled: h,
|
|
274
|
-
colorPrimary: $,
|
|
275
|
-
colorPrimaryHover: z,
|
|
276
|
-
colorPrimaryActive: C,
|
|
277
|
-
buttonSolidCheckedBg: R,
|
|
278
|
-
buttonSolidCheckedHoverBg: N,
|
|
279
|
-
buttonSolidCheckedActiveBg: j,
|
|
280
|
-
calc: M
|
|
281
|
-
} = e;
|
|
282
|
-
return {
|
|
283
|
-
[`${t}-button-wrapper`]: {
|
|
284
|
-
position: "relative",
|
|
285
|
-
display: "inline-block",
|
|
286
|
-
height: i,
|
|
287
|
-
margin: 0,
|
|
288
|
-
paddingInline: c,
|
|
289
|
-
paddingBlock: 0,
|
|
290
|
-
color: n,
|
|
291
|
-
fontSize: g,
|
|
292
|
-
lineHeight: E(M(i).sub(M(o).mul(2)).equal()),
|
|
293
|
-
background: u,
|
|
294
|
-
border: `${E(o)} ${s} ${a}`,
|
|
295
|
-
// strange align fix for chrome but works
|
|
296
|
-
// https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
|
|
297
|
-
borderBlockStartWidth: M(o).add(0.02).equal(),
|
|
298
|
-
borderInlineStartWidth: 0,
|
|
299
|
-
borderInlineEndWidth: o,
|
|
300
|
-
cursor: "pointer",
|
|
301
|
-
transition: [`color ${l}`, `background ${l}`, `box-shadow ${l}`].join(","),
|
|
302
|
-
a: {
|
|
303
|
-
color: n
|
|
304
|
-
},
|
|
305
|
-
[`> ${t}-button`]: {
|
|
306
|
-
position: "absolute",
|
|
307
|
-
insetBlockStart: 0,
|
|
308
|
-
insetInlineStart: 0,
|
|
309
|
-
zIndex: -1,
|
|
310
|
-
width: "100%",
|
|
311
|
-
height: "100%"
|
|
312
|
-
},
|
|
313
|
-
"&:not(:first-child)": {
|
|
314
|
-
"&::before": {
|
|
315
|
-
position: "absolute",
|
|
316
|
-
insetBlockStart: M(o).mul(-1).equal(),
|
|
317
|
-
insetInlineStart: M(o).mul(-1).equal(),
|
|
318
|
-
display: "block",
|
|
319
|
-
boxSizing: "content-box",
|
|
320
|
-
width: 1,
|
|
321
|
-
height: "100%",
|
|
322
|
-
paddingBlock: o,
|
|
323
|
-
paddingInline: 0,
|
|
324
|
-
backgroundColor: a,
|
|
325
|
-
transition: `background-color ${r}`,
|
|
326
|
-
content: '""'
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
"&:first-child": {
|
|
330
|
-
borderInlineStart: `${E(o)} ${s} ${a}`,
|
|
331
|
-
borderStartStartRadius: b,
|
|
332
|
-
borderEndStartRadius: b
|
|
333
|
-
},
|
|
334
|
-
"&:last-child": {
|
|
335
|
-
borderStartEndRadius: b,
|
|
336
|
-
borderEndEndRadius: b
|
|
337
|
-
},
|
|
338
|
-
"&:first-child:last-child": {
|
|
339
|
-
borderRadius: b
|
|
340
|
-
},
|
|
341
|
-
[`${t}-group-large &`]: {
|
|
342
|
-
height: m,
|
|
343
|
-
fontSize: S,
|
|
344
|
-
lineHeight: E(M(m).sub(M(o).mul(2)).equal()),
|
|
345
|
-
"&:first-child": {
|
|
346
|
-
borderStartStartRadius: f,
|
|
347
|
-
borderEndStartRadius: f
|
|
348
|
-
},
|
|
349
|
-
"&:last-child": {
|
|
350
|
-
borderStartEndRadius: f,
|
|
351
|
-
borderEndEndRadius: f
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
[`${t}-group-small &`]: {
|
|
355
|
-
height: w,
|
|
356
|
-
paddingInline: M(y).sub(o).equal(),
|
|
357
|
-
paddingBlock: 0,
|
|
358
|
-
lineHeight: E(M(w).sub(M(o).mul(2)).equal()),
|
|
359
|
-
"&:first-child": {
|
|
360
|
-
borderStartStartRadius: k,
|
|
361
|
-
borderEndStartRadius: k
|
|
362
|
-
},
|
|
363
|
-
"&:last-child": {
|
|
364
|
-
borderStartEndRadius: k,
|
|
365
|
-
borderEndEndRadius: k
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
"&:hover": {
|
|
369
|
-
position: "relative",
|
|
370
|
-
color: $
|
|
371
|
-
},
|
|
372
|
-
"&:has(:focus-visible)": Object.assign({}, Ce(e)),
|
|
373
|
-
[`${t}-inner, input[type='checkbox'], input[type='radio']`]: {
|
|
374
|
-
width: 0,
|
|
375
|
-
height: 0,
|
|
376
|
-
opacity: 0,
|
|
377
|
-
pointerEvents: "none"
|
|
378
|
-
},
|
|
379
|
-
[`&-checked:not(${t}-button-wrapper-disabled)`]: {
|
|
380
|
-
zIndex: 1,
|
|
381
|
-
color: $,
|
|
382
|
-
background: v,
|
|
383
|
-
borderColor: $,
|
|
384
|
-
"&::before": {
|
|
385
|
-
backgroundColor: $
|
|
386
|
-
},
|
|
387
|
-
"&:first-child": {
|
|
388
|
-
borderColor: $
|
|
389
|
-
},
|
|
390
|
-
"&:hover": {
|
|
391
|
-
color: z,
|
|
392
|
-
borderColor: z,
|
|
393
|
-
"&::before": {
|
|
394
|
-
backgroundColor: z
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
"&:active": {
|
|
398
|
-
color: C,
|
|
399
|
-
borderColor: C,
|
|
400
|
-
"&::before": {
|
|
401
|
-
backgroundColor: C
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
[`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]: {
|
|
406
|
-
color: x,
|
|
407
|
-
background: R,
|
|
408
|
-
borderColor: R,
|
|
409
|
-
"&:hover": {
|
|
410
|
-
color: x,
|
|
411
|
-
background: N,
|
|
412
|
-
borderColor: N
|
|
413
|
-
},
|
|
414
|
-
"&:active": {
|
|
415
|
-
color: x,
|
|
416
|
-
background: j,
|
|
417
|
-
borderColor: j
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
"&-disabled": {
|
|
421
|
-
color: I,
|
|
422
|
-
backgroundColor: p,
|
|
423
|
-
borderColor: a,
|
|
424
|
-
cursor: "not-allowed",
|
|
425
|
-
"&:first-child, &:hover": {
|
|
426
|
-
color: I,
|
|
427
|
-
backgroundColor: p,
|
|
428
|
-
borderColor: a
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
[`&-disabled${t}-button-wrapper-checked`]: {
|
|
432
|
-
color: h,
|
|
433
|
-
backgroundColor: P,
|
|
434
|
-
borderColor: a,
|
|
435
|
-
boxShadow: "none"
|
|
436
|
-
},
|
|
437
|
-
"&-block": {
|
|
438
|
-
flex: 1,
|
|
439
|
-
textAlign: "center"
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
}, Je = (e) => {
|
|
444
|
-
const {
|
|
445
|
-
wireframe: n,
|
|
446
|
-
padding: i,
|
|
447
|
-
marginXS: t,
|
|
448
|
-
lineWidth: o,
|
|
449
|
-
fontSizeLG: s,
|
|
450
|
-
colorText: a,
|
|
451
|
-
colorBgContainer: r,
|
|
452
|
-
colorTextDisabled: l,
|
|
453
|
-
controlItemBgActiveDisabled: c,
|
|
454
|
-
colorTextLightSolid: g,
|
|
455
|
-
colorPrimary: u,
|
|
456
|
-
colorPrimaryHover: S,
|
|
457
|
-
colorPrimaryActive: m,
|
|
458
|
-
colorWhite: w
|
|
459
|
-
} = e, y = 4, b = s, k = n ? b - y * 2 : b - (y + o) * 2;
|
|
460
|
-
return {
|
|
461
|
-
// Radio
|
|
462
|
-
radioSize: b,
|
|
463
|
-
dotSize: k,
|
|
464
|
-
dotColorDisabled: l,
|
|
465
|
-
// Radio buttons
|
|
466
|
-
buttonSolidCheckedColor: g,
|
|
467
|
-
buttonSolidCheckedBg: u,
|
|
468
|
-
buttonSolidCheckedHoverBg: S,
|
|
469
|
-
buttonSolidCheckedActiveBg: m,
|
|
470
|
-
buttonBg: r,
|
|
471
|
-
buttonCheckedBg: r,
|
|
472
|
-
buttonColor: a,
|
|
473
|
-
buttonCheckedBgDisabled: c,
|
|
474
|
-
buttonCheckedColorDisabled: l,
|
|
475
|
-
buttonPaddingInline: i - o,
|
|
476
|
-
wrapperMarginInlineEnd: t,
|
|
477
|
-
// internal
|
|
478
|
-
radioColor: n ? u : w,
|
|
479
|
-
radioBgColor: n ? r : u
|
|
480
|
-
};
|
|
481
|
-
}, we = ne("Radio", (e) => {
|
|
482
|
-
const {
|
|
483
|
-
controlOutline: n,
|
|
484
|
-
controlOutlineWidth: i
|
|
485
|
-
} = e, t = `0 0 0 ${E(i)} ${n}`, s = oe(e, {
|
|
486
|
-
radioFocusShadow: t,
|
|
487
|
-
radioButtonFocusShadow: t
|
|
488
|
-
});
|
|
489
|
-
return [Ue(s), Qe(s), Ye(s)];
|
|
490
|
-
}, Je, {
|
|
491
|
-
unitless: {
|
|
492
|
-
radioSize: !0,
|
|
493
|
-
dotSize: !0
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
var Ze = function(e, n) {
|
|
497
|
-
var i = {};
|
|
498
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
|
|
499
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
500
|
-
n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
|
|
501
|
-
return i;
|
|
502
|
-
};
|
|
503
|
-
const et = (e, n) => {
|
|
504
|
-
var i, t;
|
|
505
|
-
const o = d.useContext(ye), s = d.useContext(xe), {
|
|
506
|
-
getPrefixCls: a,
|
|
507
|
-
direction: r,
|
|
508
|
-
radio: l
|
|
509
|
-
} = d.useContext(W), c = d.useRef(null), g = qe(n, c), {
|
|
510
|
-
isFormItemInput: u
|
|
511
|
-
} = d.useContext(Ne);
|
|
512
|
-
if (process.env.NODE_ENV !== "production") {
|
|
513
|
-
const j = Se("Radio");
|
|
514
|
-
process.env.NODE_ENV !== "production" && j(!("optionType" in e), "usage", "`optionType` is only support in Radio.Group.");
|
|
515
|
-
}
|
|
516
|
-
const S = (j) => {
|
|
517
|
-
var M, T;
|
|
518
|
-
(M = e.onChange) === null || M === void 0 || M.call(e, j), (T = o == null ? void 0 : o.onChange) === null || T === void 0 || T.call(o, j);
|
|
519
|
-
}, {
|
|
520
|
-
prefixCls: m,
|
|
521
|
-
className: w,
|
|
522
|
-
rootClassName: y,
|
|
523
|
-
children: b,
|
|
524
|
-
style: k,
|
|
525
|
-
title: f
|
|
526
|
-
} = e, v = Ze(e, ["prefixCls", "className", "rootClassName", "children", "style", "title"]), x = a("radio", m), I = ((o == null ? void 0 : o.optionType) || s) === "button", p = I ? `${x}-button` : x, P = ge(x), [h, $, z] = we(x, P), C = Object.assign({}, v), R = d.useContext($e);
|
|
527
|
-
o && (C.name = o.name, C.onChange = S, C.checked = e.value === o.value, C.disabled = (i = C.disabled) !== null && i !== void 0 ? i : o.disabled), C.disabled = (t = C.disabled) !== null && t !== void 0 ? t : R;
|
|
528
|
-
const N = _(`${p}-wrapper`, {
|
|
529
|
-
[`${p}-wrapper-checked`]: C.checked,
|
|
530
|
-
[`${p}-wrapper-disabled`]: C.disabled,
|
|
531
|
-
[`${p}-wrapper-rtl`]: r === "rtl",
|
|
532
|
-
[`${p}-wrapper-in-form-item`]: u,
|
|
533
|
-
[`${p}-wrapper-block`]: !!(o != null && o.block)
|
|
534
|
-
}, l == null ? void 0 : l.className, w, y, $, z, P);
|
|
535
|
-
return h(/* @__PURE__ */ d.createElement(be, {
|
|
536
|
-
component: "Radio",
|
|
537
|
-
disabled: C.disabled
|
|
538
|
-
}, /* @__PURE__ */ d.createElement("label", {
|
|
539
|
-
className: N,
|
|
540
|
-
style: Object.assign(Object.assign({}, l == null ? void 0 : l.style), k),
|
|
541
|
-
onMouseEnter: e.onMouseEnter,
|
|
542
|
-
onMouseLeave: e.onMouseLeave,
|
|
543
|
-
title: f
|
|
544
|
-
}, /* @__PURE__ */ d.createElement(Ke, Object.assign({}, C, {
|
|
545
|
-
className: _(C.className, {
|
|
546
|
-
[Me]: !I
|
|
547
|
-
}),
|
|
548
|
-
type: "radio",
|
|
549
|
-
prefixCls: p,
|
|
550
|
-
ref: g
|
|
551
|
-
})), b !== void 0 ? /* @__PURE__ */ d.createElement("span", null, b) : null)));
|
|
552
|
-
}, G = /* @__PURE__ */ d.forwardRef(et);
|
|
553
|
-
process.env.NODE_ENV !== "production" && (G.displayName = "Radio");
|
|
554
|
-
const tt = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
555
|
-
const {
|
|
556
|
-
getPrefixCls: i,
|
|
557
|
-
direction: t
|
|
558
|
-
} = d.useContext(W), {
|
|
559
|
-
prefixCls: o,
|
|
560
|
-
className: s,
|
|
561
|
-
rootClassName: a,
|
|
562
|
-
options: r,
|
|
563
|
-
buttonStyle: l = "outline",
|
|
564
|
-
disabled: c,
|
|
565
|
-
children: g,
|
|
566
|
-
size: u,
|
|
567
|
-
style: S,
|
|
568
|
-
id: m,
|
|
569
|
-
optionType: w,
|
|
570
|
-
name: y,
|
|
571
|
-
defaultValue: b,
|
|
572
|
-
value: k,
|
|
573
|
-
block: f = !1,
|
|
574
|
-
onChange: v,
|
|
575
|
-
onMouseEnter: x,
|
|
576
|
-
onMouseLeave: I,
|
|
577
|
-
onFocus: p,
|
|
578
|
-
onBlur: P
|
|
579
|
-
} = e, [h, $] = Y(b, {
|
|
580
|
-
value: k
|
|
581
|
-
}), z = d.useCallback((O) => {
|
|
582
|
-
const H = h, D = O.target.value;
|
|
583
|
-
"value" in e || $(D), D !== H && (v == null || v(O));
|
|
584
|
-
}, [h, $, v]), C = i("radio", o), R = `${C}-group`, N = ge(C), [j, M, T] = we(C, N);
|
|
585
|
-
let X = g;
|
|
586
|
-
r && r.length > 0 && (X = r.map((O) => typeof O == "string" || typeof O == "number" ? /* @__PURE__ */ d.createElement(G, {
|
|
587
|
-
key: O.toString(),
|
|
588
|
-
prefixCls: C,
|
|
589
|
-
disabled: c,
|
|
590
|
-
value: O,
|
|
591
|
-
checked: h === O
|
|
592
|
-
}, O) : /* @__PURE__ */ d.createElement(G, {
|
|
593
|
-
key: `radio-group-value-options-${O.value}`,
|
|
594
|
-
prefixCls: C,
|
|
595
|
-
disabled: O.disabled || c,
|
|
596
|
-
value: O.value,
|
|
597
|
-
checked: h === O.value,
|
|
598
|
-
title: O.title,
|
|
599
|
-
style: O.style,
|
|
600
|
-
id: O.id,
|
|
601
|
-
required: O.required
|
|
602
|
-
}, O.label)));
|
|
603
|
-
const q = pe(u), V = _(R, `${R}-${l}`, {
|
|
604
|
-
[`${R}-${q}`]: q,
|
|
605
|
-
[`${R}-rtl`]: t === "rtl",
|
|
606
|
-
[`${R}-block`]: f
|
|
607
|
-
}, s, a, M, T, N), J = d.useMemo(() => ({
|
|
608
|
-
onChange: z,
|
|
609
|
-
value: h,
|
|
610
|
-
disabled: c,
|
|
611
|
-
name: y,
|
|
612
|
-
optionType: w,
|
|
613
|
-
block: f
|
|
614
|
-
}), [z, h, c, y, w, f]);
|
|
615
|
-
return j(/* @__PURE__ */ d.createElement("div", Object.assign({}, Ae(e, {
|
|
616
|
-
aria: !0,
|
|
617
|
-
data: !0
|
|
618
|
-
}), {
|
|
619
|
-
className: V,
|
|
620
|
-
style: S,
|
|
621
|
-
onMouseEnter: x,
|
|
622
|
-
onMouseLeave: I,
|
|
623
|
-
onFocus: p,
|
|
624
|
-
onBlur: P,
|
|
625
|
-
id: m,
|
|
626
|
-
ref: n
|
|
627
|
-
}), /* @__PURE__ */ d.createElement(Ge, {
|
|
628
|
-
value: J
|
|
629
|
-
}, X)));
|
|
630
|
-
}), nt = /* @__PURE__ */ d.memo(tt);
|
|
631
|
-
var ot = function(e, n) {
|
|
632
|
-
var i = {};
|
|
633
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
|
|
634
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
635
|
-
n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
|
|
636
|
-
return i;
|
|
637
|
-
};
|
|
638
|
-
const it = (e, n) => {
|
|
639
|
-
const {
|
|
640
|
-
getPrefixCls: i
|
|
641
|
-
} = d.useContext(W), {
|
|
642
|
-
prefixCls: t
|
|
643
|
-
} = e, o = ot(e, ["prefixCls"]), s = i("radio", t);
|
|
644
|
-
return /* @__PURE__ */ d.createElement(Fe, {
|
|
645
|
-
value: "button"
|
|
646
|
-
}, /* @__PURE__ */ d.createElement(G, Object.assign({
|
|
647
|
-
prefixCls: s
|
|
648
|
-
}, o, {
|
|
649
|
-
type: "radio",
|
|
650
|
-
ref: n
|
|
651
|
-
})));
|
|
652
|
-
}, rt = /* @__PURE__ */ d.forwardRef(it), F = G;
|
|
653
|
-
F.Button = rt;
|
|
654
|
-
F.Group = nt;
|
|
655
|
-
F.__ANT_RADIO = !0;
|
|
656
|
-
const at = (e) => {
|
|
657
|
-
const {
|
|
658
|
-
componentCls: n,
|
|
659
|
-
sizePaddingEdgeHorizontal: i,
|
|
660
|
-
colorSplit: t,
|
|
661
|
-
lineWidth: o,
|
|
662
|
-
textPaddingInline: s,
|
|
663
|
-
orientationMargin: a,
|
|
664
|
-
verticalMarginInline: r
|
|
665
|
-
} = e;
|
|
666
|
-
return {
|
|
667
|
-
[n]: Object.assign(Object.assign({}, A(e)), {
|
|
668
|
-
borderBlockStart: `${E(o)} solid ${t}`,
|
|
669
|
-
// vertical
|
|
670
|
-
"&-vertical": {
|
|
671
|
-
position: "relative",
|
|
672
|
-
top: "-0.06em",
|
|
673
|
-
display: "inline-block",
|
|
674
|
-
height: "0.9em",
|
|
675
|
-
marginInline: r,
|
|
676
|
-
marginBlock: 0,
|
|
677
|
-
verticalAlign: "middle",
|
|
678
|
-
borderTop: 0,
|
|
679
|
-
borderInlineStart: `${E(o)} solid ${t}`
|
|
680
|
-
},
|
|
681
|
-
"&-horizontal": {
|
|
682
|
-
display: "flex",
|
|
683
|
-
clear: "both",
|
|
684
|
-
width: "100%",
|
|
685
|
-
minWidth: "100%",
|
|
686
|
-
// Fix https://github.com/ant-design/ant-design/issues/10914
|
|
687
|
-
margin: `${E(e.dividerHorizontalGutterMargin)} 0`
|
|
688
|
-
},
|
|
689
|
-
[`&-horizontal${n}-with-text`]: {
|
|
690
|
-
display: "flex",
|
|
691
|
-
alignItems: "center",
|
|
692
|
-
margin: `${E(e.dividerHorizontalWithTextGutterMargin)} 0`,
|
|
693
|
-
color: e.colorTextHeading,
|
|
694
|
-
fontWeight: 500,
|
|
695
|
-
fontSize: e.fontSizeLG,
|
|
696
|
-
whiteSpace: "nowrap",
|
|
697
|
-
textAlign: "center",
|
|
698
|
-
borderBlockStart: `0 ${t}`,
|
|
699
|
-
"&::before, &::after": {
|
|
700
|
-
position: "relative",
|
|
701
|
-
width: "50%",
|
|
702
|
-
borderBlockStart: `${E(o)} solid transparent`,
|
|
703
|
-
// Chrome not accept `inherit` in `border-top`
|
|
704
|
-
borderBlockStartColor: "inherit",
|
|
705
|
-
borderBlockEnd: 0,
|
|
706
|
-
transform: "translateY(50%)",
|
|
707
|
-
content: "''"
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
[`&-horizontal${n}-with-text-left`]: {
|
|
711
|
-
"&::before": {
|
|
712
|
-
width: `calc(${a} * 100%)`
|
|
713
|
-
},
|
|
714
|
-
"&::after": {
|
|
715
|
-
width: `calc(100% - ${a} * 100%)`
|
|
716
|
-
}
|
|
717
|
-
},
|
|
718
|
-
[`&-horizontal${n}-with-text-right`]: {
|
|
719
|
-
"&::before": {
|
|
720
|
-
width: `calc(100% - ${a} * 100%)`
|
|
721
|
-
},
|
|
722
|
-
"&::after": {
|
|
723
|
-
width: `calc(${a} * 100%)`
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
[`${n}-inner-text`]: {
|
|
727
|
-
display: "inline-block",
|
|
728
|
-
paddingBlock: 0,
|
|
729
|
-
paddingInline: s
|
|
730
|
-
},
|
|
731
|
-
"&-dashed": {
|
|
732
|
-
background: "none",
|
|
733
|
-
borderColor: t,
|
|
734
|
-
borderStyle: "dashed",
|
|
735
|
-
borderWidth: `${E(o)} 0 0`
|
|
736
|
-
},
|
|
737
|
-
[`&-horizontal${n}-with-text${n}-dashed`]: {
|
|
738
|
-
"&::before, &::after": {
|
|
739
|
-
borderStyle: "dashed none none"
|
|
740
|
-
}
|
|
741
|
-
},
|
|
742
|
-
[`&-vertical${n}-dashed`]: {
|
|
743
|
-
borderInlineStartWidth: o,
|
|
744
|
-
borderInlineEnd: 0,
|
|
745
|
-
borderBlockStart: 0,
|
|
746
|
-
borderBlockEnd: 0
|
|
747
|
-
},
|
|
748
|
-
"&-dotted": {
|
|
749
|
-
background: "none",
|
|
750
|
-
borderColor: t,
|
|
751
|
-
borderStyle: "dotted",
|
|
752
|
-
borderWidth: `${E(o)} 0 0`
|
|
753
|
-
},
|
|
754
|
-
[`&-horizontal${n}-with-text${n}-dotted`]: {
|
|
755
|
-
"&::before, &::after": {
|
|
756
|
-
borderStyle: "dotted none none"
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
[`&-vertical${n}-dotted`]: {
|
|
760
|
-
borderInlineStartWidth: o,
|
|
761
|
-
borderInlineEnd: 0,
|
|
762
|
-
borderBlockStart: 0,
|
|
763
|
-
borderBlockEnd: 0
|
|
764
|
-
},
|
|
765
|
-
[`&-plain${n}-with-text`]: {
|
|
766
|
-
color: e.colorText,
|
|
767
|
-
fontWeight: "normal",
|
|
768
|
-
fontSize: e.fontSize
|
|
769
|
-
},
|
|
770
|
-
[`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]: {
|
|
771
|
-
"&::before": {
|
|
772
|
-
width: 0
|
|
773
|
-
},
|
|
774
|
-
"&::after": {
|
|
775
|
-
width: "100%"
|
|
776
|
-
},
|
|
777
|
-
[`${n}-inner-text`]: {
|
|
778
|
-
paddingInlineStart: i
|
|
779
|
-
}
|
|
780
|
-
},
|
|
781
|
-
[`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]: {
|
|
782
|
-
"&::before": {
|
|
783
|
-
width: "100%"
|
|
784
|
-
},
|
|
785
|
-
"&::after": {
|
|
786
|
-
width: 0
|
|
787
|
-
},
|
|
788
|
-
[`${n}-inner-text`]: {
|
|
789
|
-
paddingInlineEnd: i
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
})
|
|
793
|
-
};
|
|
794
|
-
}, lt = (e) => ({
|
|
795
|
-
textPaddingInline: "1em",
|
|
796
|
-
orientationMargin: 0.05,
|
|
797
|
-
verticalMarginInline: e.marginXS
|
|
798
|
-
}), dt = ne("Divider", (e) => {
|
|
799
|
-
const n = oe(e, {
|
|
800
|
-
dividerHorizontalWithTextGutterMargin: e.margin,
|
|
801
|
-
dividerHorizontalGutterMargin: e.marginLG,
|
|
802
|
-
sizePaddingEdgeHorizontal: 0
|
|
803
|
-
});
|
|
804
|
-
return [at(n)];
|
|
805
|
-
}, lt, {
|
|
806
|
-
unitless: {
|
|
807
|
-
orientationMargin: !0
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
var st = function(e, n) {
|
|
811
|
-
var i = {};
|
|
812
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
|
|
813
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
814
|
-
n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
|
|
815
|
-
return i;
|
|
816
|
-
};
|
|
817
|
-
const ke = (e) => {
|
|
818
|
-
const {
|
|
819
|
-
getPrefixCls: n,
|
|
820
|
-
direction: i,
|
|
821
|
-
divider: t
|
|
822
|
-
} = d.useContext(W), {
|
|
823
|
-
prefixCls: o,
|
|
824
|
-
type: s = "horizontal",
|
|
825
|
-
orientation: a = "center",
|
|
826
|
-
orientationMargin: r,
|
|
827
|
-
className: l,
|
|
828
|
-
rootClassName: c,
|
|
829
|
-
children: g,
|
|
830
|
-
dashed: u,
|
|
831
|
-
variant: S = "solid",
|
|
832
|
-
plain: m,
|
|
833
|
-
style: w
|
|
834
|
-
} = e, y = st(e, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "variant", "plain", "style"]), b = n("divider", o), [k, f, v] = dt(b), x = !!g, I = a === "left" && r != null, p = a === "right" && r != null, P = _(b, t == null ? void 0 : t.className, f, v, `${b}-${s}`, {
|
|
835
|
-
[`${b}-with-text`]: x,
|
|
836
|
-
[`${b}-with-text-${a}`]: x,
|
|
837
|
-
[`${b}-dashed`]: !!u,
|
|
838
|
-
[`${b}-${S}`]: S !== "solid",
|
|
839
|
-
[`${b}-plain`]: !!m,
|
|
840
|
-
[`${b}-rtl`]: i === "rtl",
|
|
841
|
-
[`${b}-no-default-orientation-margin-left`]: I,
|
|
842
|
-
[`${b}-no-default-orientation-margin-right`]: p
|
|
843
|
-
}, l, c), h = d.useMemo(() => typeof r == "number" ? r : /^\d+$/.test(r) ? Number(r) : r, [r]), $ = Object.assign(Object.assign({}, I && {
|
|
844
|
-
marginLeft: h
|
|
845
|
-
}), p && {
|
|
846
|
-
marginRight: h
|
|
847
|
-
});
|
|
848
|
-
if (process.env.NODE_ENV !== "production") {
|
|
849
|
-
const z = Se("Divider");
|
|
850
|
-
process.env.NODE_ENV !== "production" && z(!g || s !== "vertical", "usage", "`children` not working in `vertical` mode.");
|
|
851
|
-
}
|
|
852
|
-
return k(/* @__PURE__ */ d.createElement("div", Object.assign({
|
|
853
|
-
className: P,
|
|
854
|
-
style: Object.assign(Object.assign({}, t == null ? void 0 : t.style), w)
|
|
855
|
-
}, y, {
|
|
856
|
-
role: "separator"
|
|
857
|
-
}), g && s !== "vertical" && /* @__PURE__ */ d.createElement("span", {
|
|
858
|
-
className: `${b}-inner-text`,
|
|
859
|
-
style: $
|
|
860
|
-
}, g)));
|
|
861
|
-
};
|
|
862
|
-
process.env.NODE_ENV !== "production" && (ke.displayName = "Divider");
|
|
863
|
-
function se(e) {
|
|
864
|
-
return ["small", "middle", "large"].includes(e);
|
|
865
|
-
}
|
|
866
|
-
function ce(e) {
|
|
867
|
-
return e ? typeof e == "number" && !Number.isNaN(e) : !1;
|
|
868
|
-
}
|
|
869
|
-
const Ie = /* @__PURE__ */ Te.createContext({
|
|
870
|
-
latestIndex: 0
|
|
871
|
-
}), ct = Ie.Provider, ut = (e) => {
|
|
872
|
-
let {
|
|
873
|
-
className: n,
|
|
874
|
-
index: i,
|
|
875
|
-
children: t,
|
|
876
|
-
split: o,
|
|
877
|
-
style: s
|
|
878
|
-
} = e;
|
|
879
|
-
const {
|
|
880
|
-
latestIndex: a
|
|
881
|
-
} = d.useContext(Ie);
|
|
882
|
-
return t == null ? null : /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", {
|
|
883
|
-
className: n,
|
|
884
|
-
style: s
|
|
885
|
-
}, t), i < a && o && /* @__PURE__ */ d.createElement("span", {
|
|
886
|
-
className: `${n}-split`
|
|
887
|
-
}, o));
|
|
888
|
-
};
|
|
889
|
-
var ht = function(e, n) {
|
|
890
|
-
var i = {};
|
|
891
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
|
|
892
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
893
|
-
n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
|
|
894
|
-
return i;
|
|
895
|
-
};
|
|
896
|
-
const gt = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
897
|
-
var i, t, o;
|
|
898
|
-
const {
|
|
899
|
-
getPrefixCls: s,
|
|
900
|
-
space: a,
|
|
901
|
-
direction: r
|
|
902
|
-
} = d.useContext(W), {
|
|
903
|
-
size: l = (i = a == null ? void 0 : a.size) !== null && i !== void 0 ? i : "small",
|
|
904
|
-
align: c,
|
|
905
|
-
className: g,
|
|
906
|
-
rootClassName: u,
|
|
907
|
-
children: S,
|
|
908
|
-
direction: m = "horizontal",
|
|
909
|
-
prefixCls: w,
|
|
910
|
-
split: y,
|
|
911
|
-
style: b,
|
|
912
|
-
wrap: k = !1,
|
|
913
|
-
classNames: f,
|
|
914
|
-
styles: v
|
|
915
|
-
} = e, x = ht(e, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]), [I, p] = Array.isArray(l) ? l : [l, l], P = se(p), h = se(I), $ = ce(p), z = ce(I), C = je(S, {
|
|
916
|
-
keepEmpty: !0
|
|
917
|
-
}), R = c === void 0 && m === "horizontal" ? "center" : c, N = s("space", w), [j, M, T] = Be(N), X = _(N, a == null ? void 0 : a.className, M, `${N}-${m}`, {
|
|
918
|
-
[`${N}-rtl`]: r === "rtl",
|
|
919
|
-
[`${N}-align-${R}`]: R,
|
|
920
|
-
[`${N}-gap-row-${p}`]: P,
|
|
921
|
-
[`${N}-gap-col-${I}`]: h
|
|
922
|
-
}, g, u, T), q = _(`${N}-item`, (t = f == null ? void 0 : f.item) !== null && t !== void 0 ? t : (o = a == null ? void 0 : a.classNames) === null || o === void 0 ? void 0 : o.item);
|
|
923
|
-
let V = 0;
|
|
924
|
-
const J = C.map((D, Z) => {
|
|
925
|
-
var ee, te;
|
|
926
|
-
D != null && (V = Z);
|
|
927
|
-
const Oe = (D == null ? void 0 : D.key) || `${q}-${Z}`;
|
|
928
|
-
return /* @__PURE__ */ d.createElement(ut, {
|
|
929
|
-
className: q,
|
|
930
|
-
key: Oe,
|
|
931
|
-
index: Z,
|
|
932
|
-
split: y,
|
|
933
|
-
style: (ee = v == null ? void 0 : v.item) !== null && ee !== void 0 ? ee : (te = a == null ? void 0 : a.styles) === null || te === void 0 ? void 0 : te.item
|
|
934
|
-
}, D);
|
|
935
|
-
}), O = d.useMemo(() => ({
|
|
936
|
-
latestIndex: V
|
|
937
|
-
}), [V]);
|
|
938
|
-
if (C.length === 0)
|
|
939
|
-
return null;
|
|
940
|
-
const H = {};
|
|
941
|
-
return k && (H.flexWrap = "wrap"), !h && z && (H.columnGap = I), !P && $ && (H.rowGap = p), j(/* @__PURE__ */ d.createElement("div", Object.assign({
|
|
942
|
-
ref: n,
|
|
943
|
-
className: X,
|
|
944
|
-
style: Object.assign(Object.assign(Object.assign({}, H), a == null ? void 0 : a.style), b)
|
|
945
|
-
}, x), /* @__PURE__ */ d.createElement(ct, {
|
|
946
|
-
value: O
|
|
947
|
-
}, J)));
|
|
948
|
-
}), ie = gt;
|
|
949
|
-
ie.Compact = Re;
|
|
950
|
-
process.env.NODE_ENV !== "production" && (ie.displayName = "Space");
|
|
951
|
-
var bt = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"], Ee = /* @__PURE__ */ d.forwardRef(function(e, n) {
|
|
952
|
-
var i, t = e.prefixCls, o = t === void 0 ? "rc-switch" : t, s = e.className, a = e.checked, r = e.defaultChecked, l = e.disabled, c = e.loadingIcon, g = e.checkedChildren, u = e.unCheckedChildren, S = e.onClick, m = e.onChange, w = e.onKeyDown, y = fe(e, bt), b = Y(!1, {
|
|
953
|
-
value: a,
|
|
954
|
-
defaultValue: r
|
|
955
|
-
}), k = me(b, 2), f = k[0], v = k[1];
|
|
956
|
-
function x(h, $) {
|
|
957
|
-
var z = f;
|
|
958
|
-
return l || (z = h, v(z), m == null || m(z, $)), z;
|
|
959
|
-
}
|
|
960
|
-
function I(h) {
|
|
961
|
-
h.which === ae.LEFT ? x(!1, h) : h.which === ae.RIGHT && x(!0, h), w == null || w(h);
|
|
962
|
-
}
|
|
963
|
-
function p(h) {
|
|
964
|
-
var $ = x(!f, h);
|
|
965
|
-
S == null || S($, h);
|
|
966
|
-
}
|
|
967
|
-
var P = _(o, s, (i = {}, U(i, "".concat(o, "-checked"), f), U(i, "".concat(o, "-disabled"), l), i));
|
|
968
|
-
return /* @__PURE__ */ d.createElement("button", ve({}, y, {
|
|
969
|
-
type: "button",
|
|
970
|
-
role: "switch",
|
|
971
|
-
"aria-checked": f,
|
|
972
|
-
disabled: l,
|
|
973
|
-
className: P,
|
|
974
|
-
ref: n,
|
|
975
|
-
onKeyDown: I,
|
|
976
|
-
onClick: p
|
|
977
|
-
}), c, /* @__PURE__ */ d.createElement("span", {
|
|
978
|
-
className: "".concat(o, "-inner")
|
|
979
|
-
}, /* @__PURE__ */ d.createElement("span", {
|
|
980
|
-
className: "".concat(o, "-inner-checked")
|
|
981
|
-
}, g), /* @__PURE__ */ d.createElement("span", {
|
|
982
|
-
className: "".concat(o, "-inner-unchecked")
|
|
983
|
-
}, u)));
|
|
984
|
-
});
|
|
985
|
-
Ee.displayName = "Switch";
|
|
986
|
-
const pt = (e) => {
|
|
987
|
-
const {
|
|
988
|
-
componentCls: n,
|
|
989
|
-
trackHeightSM: i,
|
|
990
|
-
trackPadding: t,
|
|
991
|
-
trackMinWidthSM: o,
|
|
992
|
-
innerMinMarginSM: s,
|
|
993
|
-
innerMaxMarginSM: a,
|
|
994
|
-
handleSizeSM: r,
|
|
995
|
-
calc: l
|
|
996
|
-
} = e, c = `${n}-inner`, g = E(l(r).add(l(t).mul(2)).equal()), u = E(l(a).mul(2).equal());
|
|
997
|
-
return {
|
|
998
|
-
[n]: {
|
|
999
|
-
[`&${n}-small`]: {
|
|
1000
|
-
minWidth: o,
|
|
1001
|
-
height: i,
|
|
1002
|
-
lineHeight: E(i),
|
|
1003
|
-
[`${n}-inner`]: {
|
|
1004
|
-
paddingInlineStart: a,
|
|
1005
|
-
paddingInlineEnd: s,
|
|
1006
|
-
[`${c}-checked, ${c}-unchecked`]: {
|
|
1007
|
-
minHeight: i
|
|
1008
|
-
},
|
|
1009
|
-
[`${c}-checked`]: {
|
|
1010
|
-
marginInlineStart: `calc(-100% + ${g} - ${u})`,
|
|
1011
|
-
marginInlineEnd: `calc(100% - ${g} + ${u})`
|
|
1012
|
-
},
|
|
1013
|
-
[`${c}-unchecked`]: {
|
|
1014
|
-
marginTop: l(i).mul(-1).equal(),
|
|
1015
|
-
marginInlineStart: 0,
|
|
1016
|
-
marginInlineEnd: 0
|
|
1017
|
-
}
|
|
1018
|
-
},
|
|
1019
|
-
[`${n}-handle`]: {
|
|
1020
|
-
width: r,
|
|
1021
|
-
height: r
|
|
1022
|
-
},
|
|
1023
|
-
[`${n}-loading-icon`]: {
|
|
1024
|
-
top: l(l(r).sub(e.switchLoadingIconSize)).div(2).equal(),
|
|
1025
|
-
fontSize: e.switchLoadingIconSize
|
|
1026
|
-
},
|
|
1027
|
-
[`&${n}-checked`]: {
|
|
1028
|
-
[`${n}-inner`]: {
|
|
1029
|
-
paddingInlineStart: s,
|
|
1030
|
-
paddingInlineEnd: a,
|
|
1031
|
-
[`${c}-checked`]: {
|
|
1032
|
-
marginInlineStart: 0,
|
|
1033
|
-
marginInlineEnd: 0
|
|
1034
|
-
},
|
|
1035
|
-
[`${c}-unchecked`]: {
|
|
1036
|
-
marginInlineStart: `calc(100% - ${g} + ${u})`,
|
|
1037
|
-
marginInlineEnd: `calc(-100% + ${g} - ${u})`
|
|
1038
|
-
}
|
|
1039
|
-
},
|
|
1040
|
-
[`${n}-handle`]: {
|
|
1041
|
-
insetInlineStart: `calc(100% - ${E(l(r).add(t).equal())})`
|
|
1042
|
-
}
|
|
1043
|
-
},
|
|
1044
|
-
[`&:not(${n}-disabled):active`]: {
|
|
1045
|
-
[`&:not(${n}-checked) ${c}`]: {
|
|
1046
|
-
[`${c}-unchecked`]: {
|
|
1047
|
-
marginInlineStart: l(e.marginXXS).div(2).equal(),
|
|
1048
|
-
marginInlineEnd: l(e.marginXXS).mul(-1).div(2).equal()
|
|
1049
|
-
}
|
|
1050
|
-
},
|
|
1051
|
-
[`&${n}-checked ${c}`]: {
|
|
1052
|
-
[`${c}-checked`]: {
|
|
1053
|
-
marginInlineStart: l(e.marginXXS).mul(-1).div(2).equal(),
|
|
1054
|
-
marginInlineEnd: l(e.marginXXS).div(2).equal()
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
};
|
|
1061
|
-
}, ft = (e) => {
|
|
1062
|
-
const {
|
|
1063
|
-
componentCls: n,
|
|
1064
|
-
handleSize: i,
|
|
1065
|
-
calc: t
|
|
1066
|
-
} = e;
|
|
1067
|
-
return {
|
|
1068
|
-
[n]: {
|
|
1069
|
-
[`${n}-loading-icon${e.iconCls}`]: {
|
|
1070
|
-
position: "relative",
|
|
1071
|
-
top: t(t(i).sub(e.fontSize)).div(2).equal(),
|
|
1072
|
-
color: e.switchLoadingIconColor,
|
|
1073
|
-
verticalAlign: "top"
|
|
1074
|
-
},
|
|
1075
|
-
[`&${n}-checked ${n}-loading-icon`]: {
|
|
1076
|
-
color: e.switchColor
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1080
|
-
}, mt = (e) => {
|
|
1081
|
-
const {
|
|
1082
|
-
componentCls: n,
|
|
1083
|
-
trackPadding: i,
|
|
1084
|
-
handleBg: t,
|
|
1085
|
-
handleShadow: o,
|
|
1086
|
-
handleSize: s,
|
|
1087
|
-
calc: a
|
|
1088
|
-
} = e, r = `${n}-handle`;
|
|
1089
|
-
return {
|
|
1090
|
-
[n]: {
|
|
1091
|
-
[r]: {
|
|
1092
|
-
position: "absolute",
|
|
1093
|
-
top: i,
|
|
1094
|
-
insetInlineStart: i,
|
|
1095
|
-
width: s,
|
|
1096
|
-
height: s,
|
|
1097
|
-
transition: `all ${e.switchDuration} ease-in-out`,
|
|
1098
|
-
"&::before": {
|
|
1099
|
-
position: "absolute",
|
|
1100
|
-
top: 0,
|
|
1101
|
-
insetInlineEnd: 0,
|
|
1102
|
-
bottom: 0,
|
|
1103
|
-
insetInlineStart: 0,
|
|
1104
|
-
backgroundColor: t,
|
|
1105
|
-
borderRadius: a(s).div(2).equal(),
|
|
1106
|
-
boxShadow: o,
|
|
1107
|
-
transition: `all ${e.switchDuration} ease-in-out`,
|
|
1108
|
-
content: '""'
|
|
1109
|
-
}
|
|
1110
|
-
},
|
|
1111
|
-
[`&${n}-checked ${r}`]: {
|
|
1112
|
-
insetInlineStart: `calc(100% - ${E(a(s).add(i).equal())})`
|
|
1113
|
-
},
|
|
1114
|
-
[`&:not(${n}-disabled):active`]: {
|
|
1115
|
-
[`${r}::before`]: {
|
|
1116
|
-
insetInlineEnd: e.switchHandleActiveInset,
|
|
1117
|
-
insetInlineStart: 0
|
|
1118
|
-
},
|
|
1119
|
-
[`&${n}-checked ${r}::before`]: {
|
|
1120
|
-
insetInlineEnd: 0,
|
|
1121
|
-
insetInlineStart: e.switchHandleActiveInset
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
};
|
|
1126
|
-
}, vt = (e) => {
|
|
1127
|
-
const {
|
|
1128
|
-
componentCls: n,
|
|
1129
|
-
trackHeight: i,
|
|
1130
|
-
trackPadding: t,
|
|
1131
|
-
innerMinMargin: o,
|
|
1132
|
-
innerMaxMargin: s,
|
|
1133
|
-
handleSize: a,
|
|
1134
|
-
calc: r
|
|
1135
|
-
} = e, l = `${n}-inner`, c = E(r(a).add(r(t).mul(2)).equal()), g = E(r(s).mul(2).equal());
|
|
1136
|
-
return {
|
|
1137
|
-
[n]: {
|
|
1138
|
-
[l]: {
|
|
1139
|
-
display: "block",
|
|
1140
|
-
overflow: "hidden",
|
|
1141
|
-
borderRadius: 100,
|
|
1142
|
-
height: "100%",
|
|
1143
|
-
paddingInlineStart: s,
|
|
1144
|
-
paddingInlineEnd: o,
|
|
1145
|
-
transition: `padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,
|
|
1146
|
-
[`${l}-checked, ${l}-unchecked`]: {
|
|
1147
|
-
display: "block",
|
|
1148
|
-
color: e.colorTextLightSolid,
|
|
1149
|
-
fontSize: e.fontSizeSM,
|
|
1150
|
-
transition: `margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,
|
|
1151
|
-
pointerEvents: "none",
|
|
1152
|
-
minHeight: i
|
|
1153
|
-
},
|
|
1154
|
-
[`${l}-checked`]: {
|
|
1155
|
-
marginInlineStart: `calc(-100% + ${c} - ${g})`,
|
|
1156
|
-
marginInlineEnd: `calc(100% - ${c} + ${g})`
|
|
1157
|
-
},
|
|
1158
|
-
[`${l}-unchecked`]: {
|
|
1159
|
-
marginTop: r(i).mul(-1).equal(),
|
|
1160
|
-
marginInlineStart: 0,
|
|
1161
|
-
marginInlineEnd: 0
|
|
1162
|
-
}
|
|
1163
|
-
},
|
|
1164
|
-
[`&${n}-checked ${l}`]: {
|
|
1165
|
-
paddingInlineStart: o,
|
|
1166
|
-
paddingInlineEnd: s,
|
|
1167
|
-
[`${l}-checked`]: {
|
|
1168
|
-
marginInlineStart: 0,
|
|
1169
|
-
marginInlineEnd: 0
|
|
1170
|
-
},
|
|
1171
|
-
[`${l}-unchecked`]: {
|
|
1172
|
-
marginInlineStart: `calc(100% - ${c} + ${g})`,
|
|
1173
|
-
marginInlineEnd: `calc(-100% + ${c} - ${g})`
|
|
1174
|
-
}
|
|
1175
|
-
},
|
|
1176
|
-
[`&:not(${n}-disabled):active`]: {
|
|
1177
|
-
[`&:not(${n}-checked) ${l}`]: {
|
|
1178
|
-
[`${l}-unchecked`]: {
|
|
1179
|
-
marginInlineStart: r(t).mul(2).equal(),
|
|
1180
|
-
marginInlineEnd: r(t).mul(-1).mul(2).equal()
|
|
1181
|
-
}
|
|
1182
|
-
},
|
|
1183
|
-
[`&${n}-checked ${l}`]: {
|
|
1184
|
-
[`${l}-checked`]: {
|
|
1185
|
-
marginInlineStart: r(t).mul(-1).mul(2).equal(),
|
|
1186
|
-
marginInlineEnd: r(t).mul(2).equal()
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
};
|
|
1192
|
-
}, Ct = (e) => {
|
|
1193
|
-
const {
|
|
1194
|
-
componentCls: n,
|
|
1195
|
-
trackHeight: i,
|
|
1196
|
-
trackMinWidth: t
|
|
1197
|
-
} = e;
|
|
1198
|
-
return {
|
|
1199
|
-
[n]: Object.assign(Object.assign(Object.assign(Object.assign({}, A(e)), {
|
|
1200
|
-
position: "relative",
|
|
1201
|
-
display: "inline-block",
|
|
1202
|
-
boxSizing: "border-box",
|
|
1203
|
-
minWidth: t,
|
|
1204
|
-
height: i,
|
|
1205
|
-
lineHeight: E(i),
|
|
1206
|
-
verticalAlign: "middle",
|
|
1207
|
-
background: e.colorTextQuaternary,
|
|
1208
|
-
border: "0",
|
|
1209
|
-
borderRadius: 100,
|
|
1210
|
-
cursor: "pointer",
|
|
1211
|
-
transition: `all ${e.motionDurationMid}`,
|
|
1212
|
-
userSelect: "none",
|
|
1213
|
-
[`&:hover:not(${n}-disabled)`]: {
|
|
1214
|
-
background: e.colorTextTertiary
|
|
1215
|
-
}
|
|
1216
|
-
}), Ve(e)), {
|
|
1217
|
-
[`&${n}-checked`]: {
|
|
1218
|
-
background: e.switchColor,
|
|
1219
|
-
[`&:hover:not(${n}-disabled)`]: {
|
|
1220
|
-
background: e.colorPrimaryHover
|
|
1221
|
-
}
|
|
1222
|
-
},
|
|
1223
|
-
[`&${n}-loading, &${n}-disabled`]: {
|
|
1224
|
-
cursor: "not-allowed",
|
|
1225
|
-
opacity: e.switchDisabledOpacity,
|
|
1226
|
-
"*": {
|
|
1227
|
-
boxShadow: "none",
|
|
1228
|
-
cursor: "not-allowed"
|
|
1229
|
-
}
|
|
1230
|
-
},
|
|
1231
|
-
// rtl style
|
|
1232
|
-
[`&${n}-rtl`]: {
|
|
1233
|
-
direction: "rtl"
|
|
1234
|
-
}
|
|
1235
|
-
})
|
|
1236
|
-
};
|
|
1237
|
-
}, St = (e) => {
|
|
1238
|
-
const {
|
|
1239
|
-
fontSize: n,
|
|
1240
|
-
lineHeight: i,
|
|
1241
|
-
controlHeight: t,
|
|
1242
|
-
colorWhite: o
|
|
1243
|
-
} = e, s = n * i, a = t / 2, r = 2, l = s - r * 2, c = a - r * 2;
|
|
1244
|
-
return {
|
|
1245
|
-
trackHeight: s,
|
|
1246
|
-
trackHeightSM: a,
|
|
1247
|
-
trackMinWidth: l * 2 + r * 4,
|
|
1248
|
-
trackMinWidthSM: c * 2 + r * 2,
|
|
1249
|
-
trackPadding: r,
|
|
1250
|
-
// Fixed value
|
|
1251
|
-
handleBg: o,
|
|
1252
|
-
handleSize: l,
|
|
1253
|
-
handleSizeSM: c,
|
|
1254
|
-
handleShadow: `0 2px 4px 0 ${new Le("#00230b").setAlpha(0.2).toRgbString()}`,
|
|
1255
|
-
innerMinMargin: l / 2,
|
|
1256
|
-
innerMaxMargin: l + r + r * 2,
|
|
1257
|
-
innerMinMarginSM: c / 2,
|
|
1258
|
-
innerMaxMarginSM: c + r + r * 2
|
|
1259
|
-
};
|
|
1260
|
-
}, $t = ne("Switch", (e) => {
|
|
1261
|
-
const n = oe(e, {
|
|
1262
|
-
switchDuration: e.motionDurationMid,
|
|
1263
|
-
switchColor: e.colorPrimary,
|
|
1264
|
-
switchDisabledOpacity: e.opacityLoading,
|
|
1265
|
-
switchLoadingIconSize: e.calc(e.fontSizeIcon).mul(0.75).equal(),
|
|
1266
|
-
switchLoadingIconColor: `rgba(0, 0, 0, ${e.opacityLoading})`,
|
|
1267
|
-
switchHandleActiveInset: "-30%"
|
|
1268
|
-
});
|
|
1269
|
-
return [
|
|
1270
|
-
Ct(n),
|
|
1271
|
-
// inner style
|
|
1272
|
-
vt(n),
|
|
1273
|
-
// handle style
|
|
1274
|
-
mt(n),
|
|
1275
|
-
// loading style
|
|
1276
|
-
ft(n),
|
|
1277
|
-
// small style
|
|
1278
|
-
pt(n)
|
|
1279
|
-
];
|
|
1280
|
-
}, St);
|
|
1281
|
-
var yt = function(e, n) {
|
|
1282
|
-
var i = {};
|
|
1283
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
|
|
1284
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
1285
|
-
n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
|
|
1286
|
-
return i;
|
|
1287
|
-
};
|
|
1288
|
-
const xt = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
1289
|
-
const {
|
|
1290
|
-
prefixCls: i,
|
|
1291
|
-
size: t,
|
|
1292
|
-
disabled: o,
|
|
1293
|
-
loading: s,
|
|
1294
|
-
className: a,
|
|
1295
|
-
rootClassName: r,
|
|
1296
|
-
style: l,
|
|
1297
|
-
checked: c,
|
|
1298
|
-
value: g,
|
|
1299
|
-
defaultChecked: u,
|
|
1300
|
-
defaultValue: S,
|
|
1301
|
-
onChange: m
|
|
1302
|
-
} = e, w = yt(e, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]), [y, b] = Y(!1, {
|
|
1303
|
-
value: c ?? g,
|
|
1304
|
-
defaultValue: u ?? S
|
|
1305
|
-
}), {
|
|
1306
|
-
getPrefixCls: k,
|
|
1307
|
-
direction: f,
|
|
1308
|
-
switch: v
|
|
1309
|
-
} = d.useContext(W), x = d.useContext($e), I = (o ?? x) || s, p = k("switch", i), P = /* @__PURE__ */ d.createElement("div", {
|
|
1310
|
-
className: `${p}-handle`
|
|
1311
|
-
}, s && /* @__PURE__ */ d.createElement(De, {
|
|
1312
|
-
className: `${p}-loading-icon`
|
|
1313
|
-
})), [h, $, z] = $t(p), C = pe(t), R = _(v == null ? void 0 : v.className, {
|
|
1314
|
-
[`${p}-small`]: C === "small",
|
|
1315
|
-
[`${p}-loading`]: s,
|
|
1316
|
-
[`${p}-rtl`]: f === "rtl"
|
|
1317
|
-
}, a, r, $, z), N = Object.assign(Object.assign({}, v == null ? void 0 : v.style), l), j = function() {
|
|
1318
|
-
b(arguments.length <= 0 ? void 0 : arguments[0]), m == null || m.apply(void 0, arguments);
|
|
1319
|
-
};
|
|
1320
|
-
return h(/* @__PURE__ */ d.createElement(be, {
|
|
1321
|
-
component: "Switch"
|
|
1322
|
-
}, /* @__PURE__ */ d.createElement(Ee, Object.assign({}, w, {
|
|
1323
|
-
checked: y,
|
|
1324
|
-
onChange: j,
|
|
1325
|
-
prefixCls: p,
|
|
1326
|
-
className: R,
|
|
1327
|
-
style: N,
|
|
1328
|
-
disabled: I,
|
|
1329
|
-
ref: n,
|
|
1330
|
-
loadingIcon: P
|
|
1331
|
-
}))));
|
|
1332
|
-
}), Q = xt;
|
|
1333
|
-
Q.__ANT_SWITCH = !0;
|
|
1334
|
-
process.env.NODE_ENV !== "production" && (Q.displayName = "Switch");
|
|
1335
|
-
const K = _e.Text, wt = (e, n) => {
|
|
1336
|
-
const i = ["EMAIL", "INAPP_WEB", "SMS", "CALL", "PUSH", "WEB_PUSH"];
|
|
1337
|
-
return i.indexOf(e) - i.indexOf(n);
|
|
1338
|
-
}, ue = (e, n) => {
|
|
1339
|
-
const i = ["off", "instant", "hourly", "daily", "weekly", "monthly"];
|
|
1340
|
-
return i.indexOf(e) - i.indexOf(n);
|
|
1341
|
-
}, he = (e) => ({
|
|
1342
|
-
off: "Off",
|
|
1343
|
-
instant: "Instant",
|
|
1344
|
-
hourly: "Hourly",
|
|
1345
|
-
daily: "Daily",
|
|
1346
|
-
weekly: "Weekly",
|
|
1347
|
-
monthly: "Monthly"
|
|
1348
|
-
})[e], Mt = ({
|
|
1349
|
-
notification: e,
|
|
1350
|
-
preferences: n,
|
|
1351
|
-
updateDelivery: i,
|
|
1352
|
-
subNotificationId: t
|
|
1353
|
-
}) => /* @__PURE__ */ B(re, { children: e.channels.sort(wt).map((o, s) => {
|
|
1354
|
-
const a = n.find(
|
|
1355
|
-
(u) => u.notificationId === e.notificationId && u.channel === o
|
|
1356
|
-
);
|
|
1357
|
-
if (!a)
|
|
1358
|
-
return null;
|
|
1359
|
-
const r = ze(o), l = Pe(o), c = Object.keys(
|
|
1360
|
-
e.options[o]
|
|
1361
|
-
).filter(
|
|
1362
|
-
(u) => u !== "defaultDeliveryOption" && u !== "defaultDeliverOption"
|
|
1363
|
-
);
|
|
1364
|
-
let g;
|
|
1365
|
-
return c.length === 1 ? g = /* @__PURE__ */ B(K, { children: he(a.delivery) }) : c.length === 2 && c.includes("off") ? g = /* @__PURE__ */ B(
|
|
1366
|
-
Q,
|
|
1367
|
-
{
|
|
1368
|
-
checked: a.delivery !== "off",
|
|
1369
|
-
onChange: (u) => {
|
|
1370
|
-
if (u) {
|
|
1371
|
-
const S = c.find((m) => m !== "off");
|
|
1372
|
-
i(
|
|
1373
|
-
e.notificationId,
|
|
1374
|
-
o,
|
|
1375
|
-
S,
|
|
1376
|
-
t
|
|
1377
|
-
);
|
|
1378
|
-
} else
|
|
1379
|
-
i(
|
|
1380
|
-
e.notificationId,
|
|
1381
|
-
o,
|
|
1382
|
-
"off",
|
|
1383
|
-
t
|
|
1384
|
-
);
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
) : g = /* @__PURE__ */ L(re, { children: [
|
|
1388
|
-
/* @__PURE__ */ B(
|
|
1389
|
-
Q,
|
|
1390
|
-
{
|
|
1391
|
-
checked: a.delivery !== "off",
|
|
1392
|
-
onChange: (u) => {
|
|
1393
|
-
if (u) {
|
|
1394
|
-
const S = c.sort(ue).find((m) => m !== "off");
|
|
1395
|
-
i(
|
|
1396
|
-
e.notificationId,
|
|
1397
|
-
o,
|
|
1398
|
-
S,
|
|
1399
|
-
t
|
|
1400
|
-
);
|
|
1401
|
-
} else
|
|
1402
|
-
i(
|
|
1403
|
-
e.notificationId,
|
|
1404
|
-
o,
|
|
1405
|
-
"off",
|
|
1406
|
-
t
|
|
1407
|
-
);
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
),
|
|
1411
|
-
/* @__PURE__ */ B(
|
|
1412
|
-
"div",
|
|
1413
|
-
{
|
|
1414
|
-
style: {
|
|
1415
|
-
width: "100%",
|
|
1416
|
-
marginTop: 8,
|
|
1417
|
-
maxHeight: a.delivery !== "off" ? 1e3 : 0,
|
|
1418
|
-
overflow: "hidden",
|
|
1419
|
-
transition: "max-height 0.3s ease"
|
|
1420
|
-
},
|
|
1421
|
-
children: /* @__PURE__ */ L("div", { children: [
|
|
1422
|
-
/* @__PURE__ */ B("div", { style: { marginTop: 20 }, children: /* @__PURE__ */ B(K, { strong: !0, children: "Choose frequency:" }) }),
|
|
1423
|
-
/* @__PURE__ */ B(
|
|
1424
|
-
F.Group,
|
|
1425
|
-
{
|
|
1426
|
-
value: a.delivery,
|
|
1427
|
-
onChange: (u) => {
|
|
1428
|
-
i(
|
|
1429
|
-
e.notificationId,
|
|
1430
|
-
o,
|
|
1431
|
-
u.target.value,
|
|
1432
|
-
t
|
|
1433
|
-
);
|
|
1434
|
-
},
|
|
1435
|
-
children: /* @__PURE__ */ B(ie, { direction: "vertical", style: { paddingTop: 10 }, children: c.filter((u) => u !== "off").sort(ue).map((u) => /* @__PURE__ */ B(F, { value: u, children: /* @__PURE__ */ B(K, { children: he(u) }) }, u)) })
|
|
1436
|
-
}
|
|
1437
|
-
)
|
|
1438
|
-
] })
|
|
1439
|
-
}
|
|
1440
|
-
)
|
|
1441
|
-
] }), /* @__PURE__ */ L("div", { children: [
|
|
1442
|
-
/* @__PURE__ */ L(
|
|
1443
|
-
"div",
|
|
1444
|
-
{
|
|
1445
|
-
style: {
|
|
1446
|
-
display: "flex",
|
|
1447
|
-
justifyContent: "space-between",
|
|
1448
|
-
flexWrap: "wrap",
|
|
1449
|
-
marginTop: s === 0 ? 12 : 0,
|
|
1450
|
-
marginBottom: s === e.channels.length - 1 ? 12 : 0
|
|
1451
|
-
},
|
|
1452
|
-
children: [
|
|
1453
|
-
/* @__PURE__ */ L(K, { children: [
|
|
1454
|
-
l,
|
|
1455
|
-
" ",
|
|
1456
|
-
r
|
|
1457
|
-
] }),
|
|
1458
|
-
g
|
|
1459
|
-
]
|
|
1460
|
-
},
|
|
1461
|
-
o
|
|
1462
|
-
),
|
|
1463
|
-
s !== e.channels.length - 1 && /* @__PURE__ */ B(ke, {})
|
|
1464
|
-
] }, o);
|
|
1465
|
-
}) });
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../assets/channelUtils.js";
|
|
3
|
+
import "../../assets/index3.js";
|
|
4
|
+
import { P as m } from "../../assets/PreferenceInput.js";
|
|
1466
5
|
export {
|
|
1467
|
-
|
|
6
|
+
m as PreferenceInput
|
|
1468
7
|
};
|