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