@para-ui/core 1.1.31 → 2.0.3
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/AutoBox/index.d.ts +1 -0
- package/AutoBox/index.js +3 -3
- package/AutoTips/index.d.ts +1 -0
- package/AutoTips/index.js +3 -3
- package/Breadcrumbs/index.d.ts +1 -0
- package/Breadcrumbs/index.js +2 -2
- package/Button/SplitButton.d.ts +42 -0
- package/Button/index.d.ts +28 -7
- package/Button/index.js +3 -3
- package/ButtonGroup/index.d.ts +13 -18
- package/ButtonGroup/index.js +3 -3
- package/Cascader/index.d.ts +52 -0
- package/Cascader/index.js +16 -0
- package/Checkbox/index.d.ts +21 -5
- package/Checkbox/index.js +3 -3
- package/CheckboxGroup/index.d.ts +5 -2
- package/CheckboxGroup/index.js +3 -3
- package/ColorPicker/index.js +1 -1
- package/ComboSelect/WithTabsCombo/index.d.ts +3 -2
- package/ComboSelect/WithTabsCombo/interface.d.ts +6 -1
- package/ComboSelect/index.d.ts +8 -7
- package/ComboSelect/index.js +5 -3
- package/ComboSelect/interface.d.ts +21 -15
- package/ComboSelect/utils.d.ts +5 -0
- package/Container/index.js +4 -3
- package/DatePicker/index.js +3 -3
- package/Desktop/index.js +5 -3
- package/Drawer/index.d.ts +10 -4
- package/Drawer/index.js +16 -1
- package/Drawer/interface.d.ts +63 -0
- package/Form/index.js +3 -3
- package/FormItem/compoments/formFile/index.d.ts +1 -0
- package/FormItem/index.d.ts +46 -45
- package/FormItem/index.js +3 -3
- package/FunctionModal/index.js +5 -3
- package/Help/index.js +2 -2
- package/IconList/index.js +4 -3
- package/InputLang/index.d.ts +3 -0
- package/InputLang/index.js +3 -3
- package/InputNumber/index.d.ts +8 -32
- package/InputNumber/index.js +3 -3
- package/Menu/footerExpansion.d.ts +4 -4
- package/Menu/index.d.ts +5 -4
- package/Menu/index.js +3 -3
- package/Menu/interface.d.ts +12 -125
- package/Menu/logo.d.ts +4 -4
- package/Menu/verticalMenuList.d.ts +4 -4
- package/Message/index.d.ts +8 -0
- package/Message/index.js +4 -3
- package/Modal/Confirm/index.d.ts +3 -4
- package/Modal/index.d.ts +9 -11
- package/Modal/index.js +3 -3
- package/MultiBox/index.d.ts +3 -0
- package/MultiBox/index.js +3 -3
- package/{Menu/horizontalMeunList.d.ts → PageHeader/horizontalMeun.d.ts} +2 -2
- package/{Menu → PageHeader}/horizontalMeunRight.d.ts +4 -4
- package/PageHeader/index.d.ts +10 -0
- package/PageHeader/index.js +16 -0
- package/PageHeader/interface.d.ts +165 -0
- package/Pagination/index.d.ts +6 -0
- package/Pagination/index.js +3 -3
- package/ParauiProvider/index.d.ts +1 -0
- package/ParauiProvider/index.js +3 -3
- package/PopConfirm/index.d.ts +8 -5
- package/PopConfirm/index.js +3 -3
- package/Popover/index.js +3 -3
- package/Radio/index.d.ts +22 -8
- package/Radio/index.js +3 -3
- package/RadioGroup/index.d.ts +8 -4
- package/RadioGroup/index.js +3 -3
- package/Search/index.d.ts +3 -0
- package/Search/index.js +3 -3
- package/Select/index.d.ts +5 -4
- package/Select/index.js +3 -3
- package/SingleBox/index.d.ts +6 -1
- package/SingleBox/index.js +3 -3
- package/Slider/index.d.ts +13 -2
- package/Slider/index.js +16 -1
- package/Slider/interface.d.ts +100 -0
- package/Split/index.js +4 -3
- package/Stepper/index.d.ts +1 -0
- package/Stepper/index.js +3 -3
- package/Styles/index.scss +7 -6
- package/Styles/normalize.scss +348 -0
- package/Styles/theme.scss +53 -0
- package/Switch/index.d.ts +52 -10
- package/Switch/index.js +3 -3
- package/Table/index.d.ts +1 -0
- package/Table/index.js +3 -3
- package/Table/tableBodyInterface.d.ts +1 -1
- package/Tabs/index.d.ts +9 -9
- package/Tabs/index.js +3 -3
- package/TextField/index.d.ts +4 -5
- package/TextField/index.js +3 -3
- package/TimePicker/index.js +3 -3
- package/Timeline/index.d.ts +8 -7
- package/Timeline/index.js +3 -3
- package/ToggleButton/ToggleButtonGroup.d.ts +44 -0
- package/ToggleButton/index.d.ts +44 -0
- package/ToggleButton/index.js +16 -0
- package/{ToolTip → Tooltip}/index.d.ts +4 -3
- package/Tooltip/index.js +16 -0
- package/Transfer/index.d.ts +17 -0
- package/Transfer/index.js +16 -0
- package/Tree/OperateBar/index.d.ts +11 -2
- package/Tree/index.d.ts +1 -0
- package/Tree/index.js +5 -3
- package/Tree/interface.d.ts +14 -10
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Tree/utils/tools.d.ts +2 -1
- package/Upload/Dragger/index.d.ts +10 -0
- package/Upload/ErroTip/index.d.ts +13 -0
- package/Upload/ImageUpload/index.d.ts +3 -5
- package/Upload/UploadList/index.d.ts +1 -0
- package/Upload/index.d.ts +11 -9
- package/Upload/index.js +3 -3
- package/Upload/interface.d.ts +22 -14
- package/index.d.ts +5 -1
- package/index.js +3 -3
- package/package.json +8 -2
- package/style.css +100 -0
- package/Breadcrumbs/theme.d.ts +0 -42
- package/Button/theme.d.ts +0 -216
- package/ButtonGroup/SplitButton.d.ts +0 -17
- package/Checkbox/iconMapping.d.ts +0 -2
- package/ComboSelect/styles.d.ts +0 -6
- package/Menu/horizontalMenu.d.ts +0 -9
- package/Menu/verticalFooter.d.ts +0 -9
- package/Menu/verticalMenu.d.ts +0 -9
- package/ParauiProvider/theme/paraTheme.d.ts +0 -3
- package/ParauiProvider/theme/styleConfig.d.ts +0 -74
- package/Radio/iconMapping.d.ts +0 -2
- package/Stepper/theme.d.ts +0 -56
- package/Tabs/theme.d.ts +0 -53
- package/ToolTip/index.js +0 -16
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
2
|
+
|
|
3
|
+
/* Document
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 1. Correct the line height in all browsers.
|
|
8
|
+
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
html {
|
|
12
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Sections
|
|
16
|
+
========================================================================== */
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Remove the margin in all browsers.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
body {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Render the `main` element consistently in IE.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
main {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Correct the font size and margin on `h1` elements within `section` and
|
|
36
|
+
* `article` contexts in Chrome, Firefox, and Safari.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
h1 {
|
|
40
|
+
font-size: 2em;
|
|
41
|
+
margin: 0.67em 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Grouping content
|
|
45
|
+
========================================================================== */
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 1. Add the correct box sizing in Firefox.
|
|
49
|
+
* 2. Show the overflow in Edge and IE.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
hr {
|
|
53
|
+
box-sizing: content-box; /* 1 */
|
|
54
|
+
height: 0; /* 1 */
|
|
55
|
+
overflow: visible; /* 2 */
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
60
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
pre {
|
|
64
|
+
font-family: monospace, monospace; /* 1 */
|
|
65
|
+
font-size: 1em; /* 2 */
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Text-level semantics
|
|
69
|
+
========================================================================== */
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Remove the gray background on active links in IE 10.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
a {
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 1. Remove the bottom border in Chrome 57-
|
|
81
|
+
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
abbr[title] {
|
|
85
|
+
border-bottom: none; /* 1 */
|
|
86
|
+
text-decoration: underline; /* 2 */
|
|
87
|
+
text-decoration: underline dotted; /* 2 */
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
b,
|
|
95
|
+
strong {
|
|
96
|
+
font-weight: bolder;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
101
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
code,
|
|
105
|
+
kbd,
|
|
106
|
+
samp {
|
|
107
|
+
font-family: monospace, monospace; /* 1 */
|
|
108
|
+
font-size: 1em; /* 2 */
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Add the correct font size in all browsers.
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
small {
|
|
116
|
+
font-size: 80%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Prevent `sub` and `sup` elements from affecting the line height in
|
|
121
|
+
* all browsers.
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
sub,
|
|
125
|
+
sup {
|
|
126
|
+
font-size: 75%;
|
|
127
|
+
line-height: 0;
|
|
128
|
+
position: relative;
|
|
129
|
+
vertical-align: baseline;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
sub {
|
|
133
|
+
bottom: -0.25em;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
sup {
|
|
137
|
+
top: -0.5em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Embedded content
|
|
141
|
+
========================================================================== */
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Remove the border on images inside links in IE 10.
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
img {
|
|
148
|
+
border-style: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Forms
|
|
152
|
+
========================================================================== */
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 1. Change the font styles in all browsers.
|
|
156
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
button,
|
|
160
|
+
input,
|
|
161
|
+
optgroup,
|
|
162
|
+
select,
|
|
163
|
+
textarea {
|
|
164
|
+
font-family: inherit; /* 1 */
|
|
165
|
+
font-size: 100%; /* 1 */
|
|
166
|
+
line-height: 1.15; /* 1 */
|
|
167
|
+
margin: 0; /* 2 */
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Show the overflow in IE.
|
|
172
|
+
* 1. Show the overflow in Edge.
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
button,
|
|
176
|
+
input { /* 1 */
|
|
177
|
+
overflow: visible;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
182
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
button,
|
|
186
|
+
select { /* 1 */
|
|
187
|
+
text-transform: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
button,
|
|
195
|
+
[type="button"],
|
|
196
|
+
[type="reset"],
|
|
197
|
+
[type="submit"] {
|
|
198
|
+
-webkit-appearance: button;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Remove the inner border and padding in Firefox.
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
button::-moz-focus-inner,
|
|
206
|
+
[type="button"]::-moz-focus-inner,
|
|
207
|
+
[type="reset"]::-moz-focus-inner,
|
|
208
|
+
[type="submit"]::-moz-focus-inner {
|
|
209
|
+
border-style: none;
|
|
210
|
+
padding: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Restore the focus styles unset by the previous rule.
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
button:-moz-focusring,
|
|
218
|
+
[type="button"]:-moz-focusring,
|
|
219
|
+
[type="reset"]:-moz-focusring,
|
|
220
|
+
[type="submit"]:-moz-focusring {
|
|
221
|
+
outline: 1px dotted ButtonText;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Correct the padding in Firefox.
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
fieldset {
|
|
229
|
+
padding: 0.35em 0.75em 0.625em;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
234
|
+
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
235
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
236
|
+
* `fieldset` elements in all browsers.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
legend {
|
|
240
|
+
box-sizing: border-box; /* 1 */
|
|
241
|
+
color: inherit; /* 2 */
|
|
242
|
+
display: table; /* 1 */
|
|
243
|
+
max-width: 100%; /* 1 */
|
|
244
|
+
padding: 0; /* 3 */
|
|
245
|
+
white-space: normal; /* 1 */
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
progress {
|
|
253
|
+
vertical-align: baseline;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Remove the default vertical scrollbar in IE 10+.
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
textarea {
|
|
261
|
+
overflow: auto;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 1. Add the correct box sizing in IE 10.
|
|
266
|
+
* 2. Remove the padding in IE 10.
|
|
267
|
+
*/
|
|
268
|
+
|
|
269
|
+
[type="checkbox"],
|
|
270
|
+
[type="radio"] {
|
|
271
|
+
box-sizing: border-box; /* 1 */
|
|
272
|
+
padding: 0; /* 2 */
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
[type="number"]::-webkit-inner-spin-button,
|
|
280
|
+
[type="number"]::-webkit-outer-spin-button {
|
|
281
|
+
height: auto;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
286
|
+
* 2. Correct the outline style in Safari.
|
|
287
|
+
*/
|
|
288
|
+
|
|
289
|
+
[type="search"] {
|
|
290
|
+
-webkit-appearance: textfield; /* 1 */
|
|
291
|
+
outline-offset: -2px; /* 2 */
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
[type="search"]::-webkit-search-decoration {
|
|
299
|
+
-webkit-appearance: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
304
|
+
* 2. Change font properties to `inherit` in Safari.
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
::-webkit-file-upload-button {
|
|
308
|
+
-webkit-appearance: button; /* 1 */
|
|
309
|
+
font: inherit; /* 2 */
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Interactive
|
|
313
|
+
========================================================================== */
|
|
314
|
+
|
|
315
|
+
/*
|
|
316
|
+
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
317
|
+
*/
|
|
318
|
+
|
|
319
|
+
details {
|
|
320
|
+
display: block;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/*
|
|
324
|
+
* Add the correct display in all browsers.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
summary {
|
|
328
|
+
display: list-item;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Misc
|
|
332
|
+
========================================================================== */
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Add the correct display in IE 10+.
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
template {
|
|
339
|
+
display: none;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Add the correct display in IE 10.
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
[hidden] {
|
|
347
|
+
display: none;
|
|
348
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Hanz
|
|
3
|
+
* @date 2021/10/20 下午2:08
|
|
4
|
+
* @description color
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
//导航&主题色
|
|
8
|
+
$A1: #1C293CFF;
|
|
9
|
+
$A2: #223E67FF;
|
|
10
|
+
$A3: linear-gradient(180deg, #F1F1F4FF, #F3F3F3FF);
|
|
11
|
+
$A4: #FFFFFF99;
|
|
12
|
+
$A5: #3666D6FF;
|
|
13
|
+
//辅助色
|
|
14
|
+
$B1: linear-gradient(90deg, #3D66F8FF, #7793F9FF 74%, #D8DFFAFF);
|
|
15
|
+
$B2: #3666D6CC;
|
|
16
|
+
$B3: #3666D666;
|
|
17
|
+
$B4: #3666D633;
|
|
18
|
+
$B5: #3666D60D;
|
|
19
|
+
$B6: #ABB0B966;
|
|
20
|
+
$B7: #ABB0B933;
|
|
21
|
+
$B8: #ABB0B91F;
|
|
22
|
+
$B9: #F8F9FBCC;
|
|
23
|
+
$B10: #FFFFFFFF;
|
|
24
|
+
//状态色
|
|
25
|
+
$C1: #EB6054FF;
|
|
26
|
+
$C2: #EB60540D;
|
|
27
|
+
$C3: #53C31BFF;
|
|
28
|
+
$C4: #53C31B0D;
|
|
29
|
+
$C5: #FFA150FF;
|
|
30
|
+
$C6: #FFA1500D;
|
|
31
|
+
$C7: #EB6054CC;
|
|
32
|
+
//文字色
|
|
33
|
+
$D1: #2E3743FF;
|
|
34
|
+
$D2: #2E3743B3;
|
|
35
|
+
$D3: #2E374366;
|
|
36
|
+
//字体
|
|
37
|
+
$font-family: Source Han Sans CN, Source Han Sans CN-Regular;
|
|
38
|
+
$large: 18px;
|
|
39
|
+
$medium: 16px;
|
|
40
|
+
$small: 14px;
|
|
41
|
+
$smallest: 12px;
|
|
42
|
+
$normal: 400;
|
|
43
|
+
$bold: 700;
|
|
44
|
+
$light: 300;
|
|
45
|
+
// 实色
|
|
46
|
+
$Z1: #F8F9FB;
|
|
47
|
+
$Z2: #EDF1F9;
|
|
48
|
+
$Z3: #E3EAF7;
|
|
49
|
+
|
|
50
|
+
//阴影
|
|
51
|
+
$boxShadow: 0px 2px 8px 0px rgba(171, 176, 185, 0.40);
|
|
52
|
+
$radius: 8px;
|
|
53
|
+
|
package/Switch/index.d.ts
CHANGED
|
@@ -1,19 +1,61 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Hanz
|
|
3
|
-
* @date 2021/8/5
|
|
3
|
+
* @date 2021/8/5
|
|
4
4
|
* @description switch 开关
|
|
5
5
|
*/
|
|
6
|
-
import { FunctionComponent } from
|
|
7
|
-
import
|
|
8
|
-
|
|
6
|
+
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import "./index.scss";
|
|
8
|
+
declare type SwitchChangeEventHandler = (checked: boolean, event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
9
|
+
declare type SwitchClickEventHandler = SwitchChangeEventHandler;
|
|
10
|
+
export interface SwitchProps {
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
12
|
+
* 开关大小
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
size?: 'small' | 'default';
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* 类名
|
|
15
17
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 是否选中
|
|
21
|
+
*/
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 默认是否选中
|
|
25
|
+
*/
|
|
26
|
+
defaultChecked?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 变化时回调函数
|
|
29
|
+
*/
|
|
30
|
+
onChange?: SwitchChangeEventHandler;
|
|
31
|
+
/**
|
|
32
|
+
* 点击时回调函数
|
|
33
|
+
*/
|
|
34
|
+
onClick?: SwitchClickEventHandler;
|
|
35
|
+
/**
|
|
36
|
+
* 选中的是内容
|
|
37
|
+
*/
|
|
38
|
+
checkedChildren?: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* 非选中时内容
|
|
41
|
+
*/
|
|
42
|
+
unCheckedChildren?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* 是否禁用
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 是否显示loading
|
|
49
|
+
*/
|
|
50
|
+
loading?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 自动获得焦点
|
|
53
|
+
*/
|
|
54
|
+
autoFocus?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 紧凑型开关
|
|
57
|
+
*/
|
|
58
|
+
compact?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare const Switch: FunctionComponent<SwitchProps>;
|
|
19
61
|
export default Switch;
|
package/Switch/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(r,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@para-ui/icons/LoadingF"),require("rc-switch"),require("react")):"function"==typeof define&&define.amd?define(["@para-ui/icons/LoadingF","rc-switch","react"],e):"object"==typeof exports?exports.ParaUI=e(require("@para-ui/icons/LoadingF"),require("rc-switch"),require("react")):r.ParaUI=e(r["@para-ui/icons/LoadingF"],r["rc-switch"],r.react)}(self,(function(r,e,t){return function(){"use strict";var n,o={4927:function(r,e,t){function n(r){var e,t,o="";if("string"==typeof r||"number"==typeof r)o+=r;else if("object"==typeof r)if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(t=n(r[e]))&&(o&&(o+=" "),o+=t);else for(e in r)r[e]&&(o&&(o+=" "),o+=e);return o}function o(){for(var r,e,t=0,o="";t<arguments.length;)(r=arguments[t++])&&(e=n(r))&&(o&&(o+=" "),o+=e);return o}t.d(e,{Z:function(){return o}})},4126:function(r){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
7
|
+
var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}r.exports=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(r){return e[r]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(r){n[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}()?Object.assign:function(r,i){for(var a,c,u=o(r),f=1;f<arguments.length;f++){for(var s in a=Object(arguments[f]))t.call(a,s)&&(u[s]=a[s]);if(e){c=e(a);for(var l=0;l<c.length;l++)n.call(a,c[l])&&(u[c[l]]=a[c[l]])}}return u}},9524:function(r,e,t){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,o=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
t(4126);var n=t(9297),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function f(r,e,t){var n,i={},f=null,s=null;for(n in void 0!==t&&(f=""+t),void 0!==e.key&&(f=""+e.key),void 0!==e.ref&&(s=e.ref),e)c.call(e,n)&&!u.hasOwnProperty(n)&&(i[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps)void 0===i[n]&&(i[n]=e[n]);return{$$typeof:o,type:r,key:f,ref:s,props:i,_owner:a.current}}e.jsx=f},7712:function(r,e,t){r.exports=t(9524)},5962:function(r,e,t){t.r(e),t.d(e,{Switch:function(){return l}});var n=t(7712),o=t(4555),i=t.n(o),a=t(4927),c=t(1102),u=t.n(c),f=function(){return f=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},f.apply(this,arguments)},s=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t},l=function(r){r.compact,r.size;var e=r.loading,t=r.disabled,o=r.className,c=s(r,["compact","size","loading","disabled","className"]),l=(0,a.Z)("paraui-switch",{"paraui-switch-loading":e},o),p=(0,n.jsx)("div",f({className:"paraui-switch-handle"},{children:e&&(0,n.jsx)(u(),{className:"paraui-switch-loading-icon"},void 0)}),void 0);return(0,n.jsx)(i(),f({},c,{prefixCls:"paraui-switch",className:l,disabled:t||e,loadingIcon:p}),void 0)};e.default=l},1102:function(e){e.exports=r},4555:function(r){r.exports=e},9297:function(r){r.exports=t}},i={};function a(r){var e=i[r];if(void 0!==e)return e.exports;var t=i[r]={exports:{}};return o[r](t,t.exports,a),t.exports}a.m=o,n=[],a.O=function(r,e,t,o){if(!e){var i=1/0;for(f=0;f<n.length;f++){e=n[f][0],t=n[f][1],o=n[f][2];for(var c=!0,u=0;u<e.length;u++)(!1&o||i>=o)&&Object.keys(a.O).every((function(r){return a.O[r](e[u])}))?e.splice(u--,1):(c=!1,o<i&&(i=o));c&&(n.splice(f--,1),r=t())}return r}o=o||0;for(var f=n.length;f>0&&n[f-1][2]>o;f--)n[f]=n[f-1];n[f]=[e,t,o]},a.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(e,{a:e}),e},a.d=function(r,e){for(var t in e)a.o(e,t)&&!a.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},a.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},a.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},function(){var r={6195:0,9296:0};a.O.j=function(e){return 0===r[e]};var e=function(e,t){var n,o,i=t[0],c=t[1],u=t[2],f=0;for(n in c)a.o(c,n)&&(a.m[n]=c[n]);if(u)var s=u(a);for(e&&e(t);f<i.length;f++)o=i[f],a.o(r,o)&&r[o]&&r[o][0](),r[i[f]]=0;return a.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))}();var c=a.O(void 0,[9296],(function(){return a(5962)}));return c=a.O(c)}()}));
|