ep-craft 0.1.2 → 0.1.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/dist/components/button/EpButton.vue.d.ts +4 -4
- package/dist/components/button/EpButton.vue.js +19 -19
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/button/index.js +4 -3
- package/dist/index.css +2 -2
- package/dist/resolver.js +9 -12
- package/package.json +4 -2
- package/theme-chalk/src/affix.scss +7 -0
- package/theme-chalk/src/alert.scss +115 -0
- package/theme-chalk/src/anchor-link.scss +45 -0
- package/theme-chalk/src/anchor.scss +93 -0
- package/theme-chalk/src/aside.scss +8 -0
- package/theme-chalk/src/autocomplete.scss +95 -0
- package/theme-chalk/src/avatar-group.scss +25 -0
- package/theme-chalk/src/avatar.scss +55 -0
- package/theme-chalk/src/backtop.scss +29 -0
- package/theme-chalk/src/badge.scss +58 -0
- package/theme-chalk/src/base.scss +3 -0
- package/theme-chalk/src/breadcrumb-item.scss +58 -0
- package/theme-chalk/src/breadcrumb.scss +9 -0
- package/theme-chalk/src/button-group.scss +133 -0
- package/theme-chalk/src/button.scss +325 -0
- package/theme-chalk/src/calendar.scss +94 -0
- package/theme-chalk/src/card.scss +49 -0
- package/theme-chalk/src/carousel-item.scss +58 -0
- package/theme-chalk/src/carousel.scss +195 -0
- package/theme-chalk/src/cascader-panel.scss +150 -0
- package/theme-chalk/src/cascader.scss +289 -0
- package/theme-chalk/src/check-tag.scss +60 -0
- package/theme-chalk/src/checkbox-button.scss +142 -0
- package/theme-chalk/src/checkbox-group.scss +7 -0
- package/theme-chalk/src/checkbox.scss +300 -0
- package/theme-chalk/src/col.scss +56 -0
- package/theme-chalk/src/collapse-item.scss +72 -0
- package/theme-chalk/src/collapse-transition.scss +1 -0
- package/theme-chalk/src/collapse.scss +29 -0
- package/theme-chalk/src/color/index.scss +20 -0
- package/theme-chalk/src/color-picker-panel.scss +294 -0
- package/theme-chalk/src/color-picker.scss +165 -0
- package/theme-chalk/src/common/popup.scss +47 -0
- package/theme-chalk/src/common/transition.scss +125 -0
- package/theme-chalk/src/common/var.scss +1730 -0
- package/theme-chalk/src/config-provider.scss +0 -0
- package/theme-chalk/src/container.scss +14 -0
- package/theme-chalk/src/dark/css-vars.scss +45 -0
- package/theme-chalk/src/dark/var.scss +224 -0
- package/theme-chalk/src/date-picker/date-picker.scss +121 -0
- package/theme-chalk/src/date-picker/date-range-picker.scss +165 -0
- package/theme-chalk/src/date-picker/date-table.scss +164 -0
- package/theme-chalk/src/date-picker/month-table.scss +112 -0
- package/theme-chalk/src/date-picker/picker-panel.scss +152 -0
- package/theme-chalk/src/date-picker/picker.scss +217 -0
- package/theme-chalk/src/date-picker/time-picker.scss +90 -0
- package/theme-chalk/src/date-picker/time-range-picker.scss +33 -0
- package/theme-chalk/src/date-picker/time-spinner.scss +115 -0
- package/theme-chalk/src/date-picker/utils.scss +14 -0
- package/theme-chalk/src/date-picker/year-table.scss +108 -0
- package/theme-chalk/src/date-picker-panel.scss +34 -0
- package/theme-chalk/src/date-picker.scss +0 -0
- package/theme-chalk/src/descriptions-item.scss +77 -0
- package/theme-chalk/src/descriptions.scss +151 -0
- package/theme-chalk/src/dialog.scss +207 -0
- package/theme-chalk/src/display.scss +12 -0
- package/theme-chalk/src/divider.scss +48 -0
- package/theme-chalk/src/drawer.scss +251 -0
- package/theme-chalk/src/dropdown-item.scss +0 -0
- package/theme-chalk/src/dropdown-menu.scss +0 -0
- package/theme-chalk/src/dropdown.scss +208 -0
- package/theme-chalk/src/empty.scss +49 -0
- package/theme-chalk/src/footer.scss +12 -0
- package/theme-chalk/src/form-item.scss +246 -0
- package/theme-chalk/src/form.scss +28 -0
- package/theme-chalk/src/header.scss +12 -0
- package/theme-chalk/src/icon.scss +41 -0
- package/theme-chalk/src/image-viewer.scss +161 -0
- package/theme-chalk/src/image.scss +49 -0
- package/theme-chalk/src/index.scss +116 -0
- package/theme-chalk/src/infinite-scroll.scss +0 -0
- package/theme-chalk/src/input-number.scss +192 -0
- package/theme-chalk/src/input-otp.scss +191 -0
- package/theme-chalk/src/input-tag.scss +249 -0
- package/theme-chalk/src/input.scss +541 -0
- package/theme-chalk/src/link.scss +90 -0
- package/theme-chalk/src/loading.scss +104 -0
- package/theme-chalk/src/main.scss +14 -0
- package/theme-chalk/src/mention.scss +88 -0
- package/theme-chalk/src/menu-item-group.scss +0 -0
- package/theme-chalk/src/menu-item.scss +0 -0
- package/theme-chalk/src/menu.scss +376 -0
- package/theme-chalk/src/message-box.scss +220 -0
- package/theme-chalk/src/message.scss +123 -0
- package/theme-chalk/src/mixins/_button.scss +240 -0
- package/theme-chalk/src/mixins/_col.scss +41 -0
- package/theme-chalk/src/mixins/_var.scss +67 -0
- package/theme-chalk/src/mixins/config.scss +5 -0
- package/theme-chalk/src/mixins/function.scss +99 -0
- package/theme-chalk/src/mixins/mixins.scss +257 -0
- package/theme-chalk/src/mixins/utils.scss +39 -0
- package/theme-chalk/src/notification.scss +109 -0
- package/theme-chalk/src/option-group.scss +33 -0
- package/theme-chalk/src/option.scss +71 -0
- package/theme-chalk/src/overlay.scss +17 -0
- package/theme-chalk/src/page-header.scss +60 -0
- package/theme-chalk/src/pagination.scss +235 -0
- package/theme-chalk/src/popconfirm.scss +17 -0
- package/theme-chalk/src/popover.scss +61 -0
- package/theme-chalk/src/popper.scss +117 -0
- package/theme-chalk/src/progress.scss +179 -0
- package/theme-chalk/src/radio-button.scss +165 -0
- package/theme-chalk/src/radio-group.scss +9 -0
- package/theme-chalk/src/radio.scss +220 -0
- package/theme-chalk/src/rate.scss +121 -0
- package/theme-chalk/src/reset.scss +99 -0
- package/theme-chalk/src/result.scss +57 -0
- package/theme-chalk/src/row.scss +34 -0
- package/theme-chalk/src/scrollbar.scss +97 -0
- package/theme-chalk/src/segmented.scss +186 -0
- package/theme-chalk/src/select-dropdown-v2.scss +1 -0
- package/theme-chalk/src/select-dropdown.scss +57 -0
- package/theme-chalk/src/select-v2.scss +4 -0
- package/theme-chalk/src/select.scss +269 -0
- package/theme-chalk/src/skeleton-item.scss +83 -0
- package/theme-chalk/src/skeleton.scss +44 -0
- package/theme-chalk/src/slider.scss +212 -0
- package/theme-chalk/src/space.scss +20 -0
- package/theme-chalk/src/spinner.scss +43 -0
- package/theme-chalk/src/splitter-panel.scss +8 -0
- package/theme-chalk/src/splitter.scss +148 -0
- package/theme-chalk/src/statistic.scss +35 -0
- package/theme-chalk/src/step.scss +320 -0
- package/theme-chalk/src/steps.scss +22 -0
- package/theme-chalk/src/sub-menu.scss +0 -0
- package/theme-chalk/src/switch.scss +294 -0
- package/theme-chalk/src/tab-pane.scss +0 -0
- package/theme-chalk/src/table-column.scss +100 -0
- package/theme-chalk/src/table-v2.scss +239 -0
- package/theme-chalk/src/table.scss +698 -0
- package/theme-chalk/src/tabs.scss +699 -0
- package/theme-chalk/src/tag.scss +195 -0
- package/theme-chalk/src/text.scss +51 -0
- package/theme-chalk/src/time-picker.scss +5 -0
- package/theme-chalk/src/time-select.scss +37 -0
- package/theme-chalk/src/timeline-item.scss +135 -0
- package/theme-chalk/src/timeline.scss +101 -0
- package/theme-chalk/src/tooltip.scss +0 -0
- package/theme-chalk/src/tour.scss +187 -0
- package/theme-chalk/src/transfer.scss +201 -0
- package/theme-chalk/src/tree-select.scss +41 -0
- package/theme-chalk/src/tree.scss +134 -0
- package/theme-chalk/src/upload.scss +660 -0
- package/theme-chalk/src/var.scss +87 -0
- package/theme-chalk/src/virtual-list.scss +40 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
@use 'mixins/mixins' as *;
|
|
2
|
+
@use 'common/var' as *;
|
|
3
|
+
|
|
4
|
+
@include b(step) {
|
|
5
|
+
position: relative;
|
|
6
|
+
flex-shrink: 1;
|
|
7
|
+
|
|
8
|
+
@include pseudo(last-of-type) {
|
|
9
|
+
@include e(line) {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 只有未设置 space 的情况下才自适应宽度
|
|
14
|
+
@include when(flex) {
|
|
15
|
+
flex-basis: auto !important;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
flex-grow: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include e((main, description)) {
|
|
21
|
+
padding-right: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@include e(head) {
|
|
26
|
+
position: relative;
|
|
27
|
+
width: 100%;
|
|
28
|
+
|
|
29
|
+
@include when(process) {
|
|
30
|
+
color: getCssVar('text-color', 'primary');
|
|
31
|
+
border-color: getCssVar('text-color', 'primary');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include when(wait) {
|
|
35
|
+
color: getCssVar('text-color', 'placeholder');
|
|
36
|
+
border-color: getCssVar('text-color', 'placeholder');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@include when(success) {
|
|
40
|
+
color: getCssVar('color-success');
|
|
41
|
+
border-color: getCssVar('color-success');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@include when(error) {
|
|
45
|
+
color: getCssVar('color-danger');
|
|
46
|
+
border-color: getCssVar('color-danger');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@include when(finish) {
|
|
50
|
+
color: getCssVar('color-primary');
|
|
51
|
+
border-color: getCssVar('color-primary');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include e(icon) {
|
|
56
|
+
position: relative;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
width: 24px;
|
|
62
|
+
height: 24px;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
background: getCssVar('bg-color');
|
|
66
|
+
transition: 0.15s ease-out;
|
|
67
|
+
|
|
68
|
+
@include when(text) {
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
border: 2px solid;
|
|
71
|
+
border-color: currentColor;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@include when(icon) {
|
|
75
|
+
width: 40px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@include e(icon-inner) {
|
|
80
|
+
display: inline-block;
|
|
81
|
+
user-select: none;
|
|
82
|
+
text-align: center;
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
line-height: 1;
|
|
85
|
+
color: inherit;
|
|
86
|
+
|
|
87
|
+
&[class*='#{$namespace}-icon']:not(.is-status) {
|
|
88
|
+
font-size: 25px;
|
|
89
|
+
font-weight: normal;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 组件自身表示状态的图标
|
|
93
|
+
@include when(status) {
|
|
94
|
+
transform: translateY(1px);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@include e(line) {
|
|
99
|
+
position: absolute;
|
|
100
|
+
border-color: currentColor;
|
|
101
|
+
background-color: getCssVar('text-color', 'placeholder');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@include e(line-inner) {
|
|
105
|
+
display: block;
|
|
106
|
+
border-width: 1px;
|
|
107
|
+
border-style: solid;
|
|
108
|
+
border-color: currentColor;
|
|
109
|
+
transition: 0.15s ease-out;
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
width: 0;
|
|
112
|
+
height: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@include e(main) {
|
|
116
|
+
white-space: normal;
|
|
117
|
+
text-align: left;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@include e(title) {
|
|
121
|
+
font-size: 16px;
|
|
122
|
+
line-height: 38px;
|
|
123
|
+
|
|
124
|
+
@include when(process) {
|
|
125
|
+
font-weight: bold;
|
|
126
|
+
color: getCssVar('text-color', 'primary');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@include when(wait) {
|
|
130
|
+
color: getCssVar('text-color', 'placeholder');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@include when(success) {
|
|
134
|
+
color: getCssVar('color-success');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@include when(error) {
|
|
138
|
+
color: getCssVar('color-danger');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@include when(finish) {
|
|
142
|
+
color: getCssVar('color-primary');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@include e(description) {
|
|
147
|
+
padding-right: 10%;
|
|
148
|
+
margin-top: -5px;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
line-height: 20px;
|
|
151
|
+
font-weight: normal;
|
|
152
|
+
|
|
153
|
+
@include when(process) {
|
|
154
|
+
color: getCssVar('text-color', 'primary');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@include when(wait) {
|
|
158
|
+
color: getCssVar('text-color', 'placeholder');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@include when(success) {
|
|
162
|
+
color: getCssVar('color-success');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@include when(error) {
|
|
166
|
+
color: getCssVar('color-danger');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@include when(finish) {
|
|
170
|
+
color: getCssVar('color-primary');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@include when(horizontal) {
|
|
175
|
+
display: inline-block;
|
|
176
|
+
|
|
177
|
+
@include e(line) {
|
|
178
|
+
height: 2px;
|
|
179
|
+
top: 11px;
|
|
180
|
+
left: 0;
|
|
181
|
+
right: 0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@include when(vertical) {
|
|
186
|
+
display: flex;
|
|
187
|
+
|
|
188
|
+
@include e(head) {
|
|
189
|
+
flex-grow: 0;
|
|
190
|
+
width: 24px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@include e(main) {
|
|
194
|
+
padding-left: 10px;
|
|
195
|
+
flex-grow: 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@include e(title) {
|
|
199
|
+
line-height: 24px;
|
|
200
|
+
padding-bottom: 8px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@include e(line) {
|
|
204
|
+
width: 2px;
|
|
205
|
+
top: 0;
|
|
206
|
+
bottom: 0;
|
|
207
|
+
left: 11px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@include e(icon) {
|
|
211
|
+
@include when(icon) {
|
|
212
|
+
width: 24px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@include e(description) {
|
|
217
|
+
padding-right: 0;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@include when(center) {
|
|
222
|
+
@include e(head) {
|
|
223
|
+
text-align: center;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@include e(main) {
|
|
227
|
+
text-align: center;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@include e(description) {
|
|
231
|
+
padding-left: 20%;
|
|
232
|
+
padding-right: 20%;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@include e(line) {
|
|
236
|
+
left: 50%;
|
|
237
|
+
right: -50%;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@include when(simple) {
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
|
|
245
|
+
@include e(head) {
|
|
246
|
+
width: auto;
|
|
247
|
+
font-size: 0;
|
|
248
|
+
padding-right: 10px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@include e(icon) {
|
|
252
|
+
background: transparent;
|
|
253
|
+
width: 16px;
|
|
254
|
+
height: 16px;
|
|
255
|
+
font-size: 12px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@include e(icon-inner) {
|
|
259
|
+
&[class*='#{$namespace}-icon']:not(.is-status) {
|
|
260
|
+
font-size: 18px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&.is-status {
|
|
264
|
+
transform: scale(0.8) translateY(1px);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@include e(main) {
|
|
269
|
+
position: relative;
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: stretch;
|
|
272
|
+
flex-grow: 1;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@include e(title) {
|
|
276
|
+
font-size: 16px;
|
|
277
|
+
line-height: 20px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@include pseudo('not(:last-of-type)') {
|
|
281
|
+
@include e(title) {
|
|
282
|
+
max-width: 50%;
|
|
283
|
+
overflow-wrap: break-word;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@include e(arrow) {
|
|
288
|
+
flex-grow: 1;
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
justify-content: center;
|
|
292
|
+
|
|
293
|
+
&::before,
|
|
294
|
+
&::after {
|
|
295
|
+
content: '';
|
|
296
|
+
display: inline-block;
|
|
297
|
+
position: absolute;
|
|
298
|
+
height: 15px;
|
|
299
|
+
width: 1px;
|
|
300
|
+
background: getCssVar('text-color', 'placeholder');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&::before {
|
|
304
|
+
transform: rotate(-45deg) translateY(-4px);
|
|
305
|
+
transform-origin: 0 0;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
&::after {
|
|
309
|
+
transform: rotate(45deg) translateY(4px);
|
|
310
|
+
transform-origin: 100% 100%;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@include pseudo(last-of-type) {
|
|
315
|
+
@include e(arrow) {
|
|
316
|
+
display: none;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use 'mixins/mixins' as *;
|
|
2
|
+
@use 'common/var' as *;
|
|
3
|
+
|
|
4
|
+
@include b(steps) {
|
|
5
|
+
display: flex;
|
|
6
|
+
line-height: normal;
|
|
7
|
+
|
|
8
|
+
@include m(simple) {
|
|
9
|
+
padding: 13px 8%;
|
|
10
|
+
border-radius: 4px;
|
|
11
|
+
background: getCssVar('fill-color', 'light');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@include m(horizontal) {
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@include m(vertical) {
|
|
19
|
+
height: 100%;
|
|
20
|
+
flex-flow: column;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
@use 'mixins/mixins' as *;
|
|
4
|
+
@use 'mixins/utils' as *;
|
|
5
|
+
@use 'mixins/var' as *;
|
|
6
|
+
@use 'common/var' as *;
|
|
7
|
+
|
|
8
|
+
$switch-height: () !default;
|
|
9
|
+
$switch-height: map.merge(
|
|
10
|
+
(
|
|
11
|
+
'large': 40px,
|
|
12
|
+
'default': 32px,
|
|
13
|
+
'small': 24px,
|
|
14
|
+
),
|
|
15
|
+
$switch-height
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
$switch-font-size: () !default;
|
|
19
|
+
$switch-font-size: map.merge(
|
|
20
|
+
(
|
|
21
|
+
'large': 14px,
|
|
22
|
+
'default': 14px,
|
|
23
|
+
'small': 12px,
|
|
24
|
+
),
|
|
25
|
+
$switch-font-size
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
$switch-core-border-radius: () !default;
|
|
29
|
+
$switch-core-border-radius: map.merge(
|
|
30
|
+
(
|
|
31
|
+
'large': 12px,
|
|
32
|
+
'default': 10px,
|
|
33
|
+
'small': 8px,
|
|
34
|
+
),
|
|
35
|
+
$switch-core-border-radius
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
$switch-core-width: () !default;
|
|
39
|
+
$switch-core-width: map.merge(
|
|
40
|
+
(
|
|
41
|
+
'large': 50px,
|
|
42
|
+
'default': 40px,
|
|
43
|
+
'small': 30px,
|
|
44
|
+
),
|
|
45
|
+
$switch-core-width
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
$switch-core-height: () !default;
|
|
49
|
+
$switch-core-height: map.merge(
|
|
50
|
+
(
|
|
51
|
+
'large': 24px,
|
|
52
|
+
'default': 20px,
|
|
53
|
+
'small': 16px,
|
|
54
|
+
),
|
|
55
|
+
$switch-core-height
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
$switch-button-size: () !default;
|
|
59
|
+
$switch-button-size: map.merge(
|
|
60
|
+
(
|
|
61
|
+
'large': 20px,
|
|
62
|
+
'default': 16px,
|
|
63
|
+
'small': 12px,
|
|
64
|
+
),
|
|
65
|
+
$switch-button-size
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
$switch-content-padding: () !default;
|
|
69
|
+
$switch-content-padding: map.merge(
|
|
70
|
+
(
|
|
71
|
+
'large': 6px,
|
|
72
|
+
'default': 4px,
|
|
73
|
+
'small': 2px,
|
|
74
|
+
),
|
|
75
|
+
$switch-content-padding
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
@include b(switch) {
|
|
79
|
+
@include set-component-css-var('switch', $switch);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@include b(switch) {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
position: relative;
|
|
86
|
+
font-size: map.get($switch-font-size, 'default');
|
|
87
|
+
line-height: map.get($switch-core-height, 'default');
|
|
88
|
+
height: map.get($switch-height, 'default');
|
|
89
|
+
vertical-align: middle;
|
|
90
|
+
|
|
91
|
+
@include when(disabled) {
|
|
92
|
+
& .#{$namespace}-switch__core,
|
|
93
|
+
& .#{$namespace}-switch__label {
|
|
94
|
+
cursor: not-allowed;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@include e(label) {
|
|
99
|
+
transition: getCssVar('transition-duration-fast');
|
|
100
|
+
height: map.get($switch-core-height, 'default');
|
|
101
|
+
display: inline-block;
|
|
102
|
+
font-size: map.get($switch-font-size, 'default');
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
vertical-align: middle;
|
|
106
|
+
color: getCssVar('text-color', 'primary');
|
|
107
|
+
|
|
108
|
+
@include when(active) {
|
|
109
|
+
color: getCssVar('color-primary');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@include m(left) {
|
|
113
|
+
margin-right: 10px;
|
|
114
|
+
}
|
|
115
|
+
@include m(right) {
|
|
116
|
+
margin-left: 10px;
|
|
117
|
+
}
|
|
118
|
+
& * {
|
|
119
|
+
line-height: 1;
|
|
120
|
+
font-size: map.get($switch-font-size, 'default');
|
|
121
|
+
display: inline-block;
|
|
122
|
+
}
|
|
123
|
+
.#{$namespace}-icon {
|
|
124
|
+
height: inherit;
|
|
125
|
+
|
|
126
|
+
svg {
|
|
127
|
+
vertical-align: middle;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@include e(input) {
|
|
133
|
+
position: absolute;
|
|
134
|
+
width: 0;
|
|
135
|
+
height: 0;
|
|
136
|
+
opacity: 0;
|
|
137
|
+
margin: 0;
|
|
138
|
+
|
|
139
|
+
&:focus-visible {
|
|
140
|
+
& ~ .#{$namespace}-switch__core {
|
|
141
|
+
outline: 2px solid getCssVar('switch-on-color');
|
|
142
|
+
outline-offset: 1px;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@include e(core) {
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
position: relative;
|
|
150
|
+
align-items: center;
|
|
151
|
+
min-width: map.get($switch-core-width, 'default');
|
|
152
|
+
height: map.get($switch-core-height, 'default');
|
|
153
|
+
border: 1px solid
|
|
154
|
+
var(
|
|
155
|
+
#{getCssVarName('switch-border-color')},
|
|
156
|
+
#{getCssVar('switch-off-color')}
|
|
157
|
+
);
|
|
158
|
+
outline: none;
|
|
159
|
+
border-radius: map.get($switch-core-border-radius, 'default');
|
|
160
|
+
box-sizing: border-box;
|
|
161
|
+
background: getCssVar('switch-off-color');
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
transition:
|
|
164
|
+
border-color getCssVar('transition-duration'),
|
|
165
|
+
background-color getCssVar('transition-duration');
|
|
166
|
+
|
|
167
|
+
.#{$namespace}-switch__inner {
|
|
168
|
+
width: 100%;
|
|
169
|
+
transition: all getCssVar('transition-duration');
|
|
170
|
+
height: map.get($switch-button-size, 'default');
|
|
171
|
+
display: flex;
|
|
172
|
+
justify-content: center;
|
|
173
|
+
align-items: center;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
padding: 0 #{map.get($switch-content-padding, 'default')} 0
|
|
176
|
+
calc(#{map.get($switch-button-size, 'default')} + 2px);
|
|
177
|
+
|
|
178
|
+
&-wrapper {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
color: getCssVar('color-white');
|
|
183
|
+
user-select: none;
|
|
184
|
+
@include utils-ellipsis;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.#{$namespace}-switch__action {
|
|
189
|
+
position: absolute;
|
|
190
|
+
left: 1px;
|
|
191
|
+
border-radius: getCssVar('border-radius-circle');
|
|
192
|
+
transition: all getCssVar('transition-duration');
|
|
193
|
+
width: map.get($switch-button-size, 'default');
|
|
194
|
+
height: map.get($switch-button-size, 'default');
|
|
195
|
+
background-color: getCssVar('color-white');
|
|
196
|
+
display: flex;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
align-items: center;
|
|
199
|
+
color: getCssVar('switch-off-color');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@include when(checked) {
|
|
204
|
+
.#{$namespace}-switch__core {
|
|
205
|
+
border-color: var(
|
|
206
|
+
#{getCssVarName('switch-border-color')},
|
|
207
|
+
#{getCssVar('switch-on-color')}
|
|
208
|
+
);
|
|
209
|
+
background-color: getCssVar('switch-on-color');
|
|
210
|
+
|
|
211
|
+
.#{$namespace}-switch__action {
|
|
212
|
+
left: calc(100% - #{map.get($switch-button-size, 'default') + 1px});
|
|
213
|
+
color: getCssVar('switch-on-color');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.#{$namespace}-switch__inner {
|
|
217
|
+
padding: 0 calc(#{map.get($switch-button-size, 'default')} + 2px) 0
|
|
218
|
+
#{map.get($switch-content-padding, 'default')};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@include when(disabled) {
|
|
224
|
+
opacity: 0.6;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@include m(wide) {
|
|
228
|
+
.#{$namespace}-switch__label {
|
|
229
|
+
&.#{$namespace}-switch__label--left {
|
|
230
|
+
span {
|
|
231
|
+
left: 10px;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&.#{$namespace}-switch__label--right {
|
|
236
|
+
span {
|
|
237
|
+
right: 10px;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
& .label-fade-enter-from,
|
|
244
|
+
& .label-fade-leave-active {
|
|
245
|
+
opacity: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@each $size in (large, small) {
|
|
249
|
+
@include m($size) {
|
|
250
|
+
font-size: map.get($switch-font-size, $size);
|
|
251
|
+
line-height: map.get($switch-core-height, $size);
|
|
252
|
+
height: map.get($switch-height, $size);
|
|
253
|
+
|
|
254
|
+
@include e(label) {
|
|
255
|
+
height: map.get($switch-core-height, $size);
|
|
256
|
+
font-size: map.get($switch-font-size, $size);
|
|
257
|
+
|
|
258
|
+
& * {
|
|
259
|
+
font-size: map.get($switch-font-size, $size);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@include e(core) {
|
|
264
|
+
min-width: map.get($switch-core-width, $size);
|
|
265
|
+
height: map.get($switch-core-height, $size);
|
|
266
|
+
border-radius: map.get($switch-core-border-radius, $size);
|
|
267
|
+
|
|
268
|
+
.#{$namespace}-switch__inner {
|
|
269
|
+
height: map.get($switch-button-size, $size);
|
|
270
|
+
padding: 0 #{map.get($switch-content-padding, $size)} 0
|
|
271
|
+
calc(#{map.get($switch-button-size, $size)} + 2px);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.#{$namespace}-switch__action {
|
|
275
|
+
width: map.get($switch-button-size, $size);
|
|
276
|
+
height: map.get($switch-button-size, $size);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@include when(checked) {
|
|
281
|
+
.#{$namespace}-switch__core {
|
|
282
|
+
.#{$namespace}-switch__action {
|
|
283
|
+
left: calc(100% - #{map.get($switch-button-size, $size) + 1px});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.#{$namespace}-switch__inner {
|
|
287
|
+
padding: 0 calc(#{map.get($switch-button-size, $size)} + 2px) 0
|
|
288
|
+
#{map.get($switch-content-padding, $size)};
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
File without changes
|