1 | @select-prefix: ~'rc-select';
|
2 |
|
3 | * {
|
4 | box-sizing: border-box;
|
5 | }
|
6 |
|
7 | .search-input-without-border() {
|
8 | .@{select-prefix}-selection-search-input {
|
9 | border: none;
|
10 | outline: none;
|
11 | background: rgba(255, 0, 0, 0.2);
|
12 | width: 100%;
|
13 | }
|
14 | }
|
15 |
|
16 | .@{select-prefix} {
|
17 | display: inline-block;
|
18 | font-size: 12px;
|
19 | width: 100px;
|
20 | position: relative;
|
21 |
|
22 | &-disabled {
|
23 | &,
|
24 | & input {
|
25 | cursor: not-allowed;
|
26 | }
|
27 |
|
28 | .@{select-prefix}-selector {
|
29 | opacity: 0.3;
|
30 | }
|
31 | }
|
32 |
|
33 | &-show-arrow&-loading {
|
34 | .@{select-prefix}-arrow {
|
35 | &-icon::after {
|
36 | box-sizing: border-box;
|
37 | width: 12px;
|
38 | height: 12px;
|
39 | border-radius: 100%;
|
40 | border: 2px solid #999;
|
41 | border-top-color: transparent;
|
42 | border-bottom-color: transparent;
|
43 | transform: none;
|
44 | margin-top: 4px;
|
45 |
|
46 | animation: rcSelectLoadingIcon 0.5s infinite;
|
47 | }
|
48 | }
|
49 | }
|
50 |
|
51 |
|
52 | .@{select-prefix}-selection-placeholder {
|
53 | opacity: 0.4;
|
54 | pointer-events: none;
|
55 | }
|
56 |
|
57 |
|
58 | .@{select-prefix}-selection-search-input {
|
59 | appearance: none;
|
60 |
|
61 | &::-webkit-search-cancel-button {
|
62 | display: none;
|
63 | appearance: none;
|
64 | }
|
65 | }
|
66 |
|
67 |
|
68 | &-single {
|
69 | .@{select-prefix}-selector {
|
70 | display: flex;
|
71 | position: relative;
|
72 |
|
73 | .@{select-prefix}-selection-wrap {
|
74 | width: 100%;
|
75 | position: relative;
|
76 | }
|
77 |
|
78 | .@{select-prefix}-selection-search {
|
79 | width: 100%;
|
80 | position: relative;
|
81 |
|
82 | &-input {
|
83 | width: 100%;
|
84 | }
|
85 | }
|
86 |
|
87 | .@{select-prefix}-selection-item,
|
88 | .@{select-prefix}-selection-placeholder {
|
89 | position: absolute;
|
90 | top: 1px;
|
91 | left: 3px;
|
92 | pointer-events: none;
|
93 | font-weight: normal;
|
94 | }
|
95 | }
|
96 |
|
97 |
|
98 | &:not(.@{select-prefix}-customize-input) {
|
99 | .@{select-prefix}-selector {
|
100 | padding: 1px;
|
101 | border: 1px solid #000;
|
102 |
|
103 | .search-input-without-border();
|
104 | }
|
105 | }
|
106 | }
|
107 |
|
108 |
|
109 | &-multiple .@{select-prefix}-selector {
|
110 | display: flex;
|
111 | padding: 1px;
|
112 | border: 1px solid #000;
|
113 |
|
114 | .@{select-prefix}-selection-item {
|
115 | flex: none;
|
116 | background: #bbb;
|
117 | border-radius: 4px;
|
118 | margin-right: 2px;
|
119 | padding: 0 8px;
|
120 |
|
121 | &-disabled {
|
122 | cursor: not-allowed;
|
123 | opacity: 0.5;
|
124 | }
|
125 | }
|
126 |
|
127 | .@{select-prefix}-selection-overflow {
|
128 | display: flex;
|
129 | flex-wrap: wrap;
|
130 |
|
131 | &-item {
|
132 | flex: none;
|
133 | max-width: 100%;
|
134 | }
|
135 | }
|
136 |
|
137 | .@{select-prefix}-selection-search {
|
138 | position: relative;
|
139 | max-width: 100%;
|
140 |
|
141 | &-input,
|
142 | &-mirror {
|
143 | padding: 1px;
|
144 | font-family: system-ui;
|
145 | }
|
146 |
|
147 | &-mirror {
|
148 | position: absolute;
|
149 | z-index: 999;
|
150 | white-space: nowrap;
|
151 | position: none;
|
152 | left: 0;
|
153 | top: 0;
|
154 | visibility: hidden;
|
155 | }
|
156 | }
|
157 |
|
158 | .search-input-without-border();
|
159 | }
|
160 |
|
161 |
|
162 | &-allow-clear {
|
163 | &.@{select-prefix}-multiple .@{select-prefix}-selector {
|
164 | padding-right: 20px;
|
165 | }
|
166 |
|
167 | .@{select-prefix}-clear {
|
168 | position: absolute;
|
169 | right: 20px;
|
170 | top: 0;
|
171 | }
|
172 | }
|
173 |
|
174 | &-show-arrow {
|
175 | &.@{select-prefix}-multiple .@{select-prefix}-selector {
|
176 | padding-right: 20px;
|
177 | }
|
178 |
|
179 | .@{select-prefix}-arrow {
|
180 | pointer-events: none;
|
181 | position: absolute;
|
182 | right: 5px;
|
183 | top: 0;
|
184 |
|
185 | &-icon::after {
|
186 | content: '';
|
187 | border: 5px solid transparent;
|
188 | width: 0;
|
189 | height: 0;
|
190 | display: inline-block;
|
191 | border-top-color: #999;
|
192 | transform: translateY(5px);
|
193 | }
|
194 | }
|
195 | }
|
196 |
|
197 |
|
198 | &-focused {
|
199 | .@{select-prefix}-selector {
|
200 | border-color: blue !important;
|
201 | }
|
202 | }
|
203 |
|
204 |
|
205 | &-dropdown {
|
206 | border: 1px solid green;
|
207 | min-height: 100px;
|
208 | position: absolute;
|
209 | background: #fff;
|
210 |
|
211 | &-hidden {
|
212 | display: none;
|
213 | }
|
214 | }
|
215 |
|
216 |
|
217 | &-item {
|
218 | font-size: 16px;
|
219 | line-height: 1.5;
|
220 | padding: 4px 16px;
|
221 |
|
222 |
|
223 | &-group {
|
224 | color: #999;
|
225 | font-weight: bold;
|
226 | font-size: 80%;
|
227 | }
|
228 |
|
229 |
|
230 | &-option {
|
231 | position: relative;
|
232 |
|
233 | &-grouped {
|
234 | padding-left: 24px;
|
235 | }
|
236 |
|
237 | .@{select-prefix}-item-option-state {
|
238 | position: absolute;
|
239 | right: 0;
|
240 | top: 4px;
|
241 | pointer-events: none;
|
242 | }
|
243 |
|
244 |
|
245 | &-active {
|
246 | background: #ddd;
|
247 | }
|
248 |
|
249 |
|
250 | &-disabled {
|
251 | color: #999;
|
252 | }
|
253 | }
|
254 |
|
255 |
|
256 | &-empty {
|
257 | text-align: center;
|
258 | color: #999;
|
259 | }
|
260 | }
|
261 | }
|
262 |
|
263 | .@{select-prefix}-selection__choice-zoom {
|
264 | transition: all 0.3s;
|
265 | }
|
266 |
|
267 | .@{select-prefix}-selection__choice-zoom-appear {
|
268 | opacity: 0;
|
269 | transform: scale(0.5);
|
270 |
|
271 | &&-active {
|
272 | opacity: 1;
|
273 | transform: scale(1);
|
274 | }
|
275 | }
|
276 | .@{select-prefix}-selection__choice-zoom-leave {
|
277 | opacity: 1;
|
278 | transform: scale(1);
|
279 |
|
280 | &&-active {
|
281 | opacity: 0;
|
282 | transform: scale(0.5);
|
283 | }
|
284 | }
|
285 |
|
286 | .effect() {
|
287 | animation-duration: 0.3s;
|
288 | animation-fill-mode: both;
|
289 | transform-origin: 0 0;
|
290 | }
|
291 |
|
292 | .@{select-prefix}-dropdown {
|
293 | &-slide-up-enter,
|
294 | &-slide-up-appear {
|
295 | .effect();
|
296 | opacity: 0;
|
297 | animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
|
298 | animation-play-state: paused;
|
299 | }
|
300 |
|
301 | &-slide-up-leave {
|
302 | .effect();
|
303 | opacity: 1;
|
304 | animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
|
305 | animation-play-state: paused;
|
306 | }
|
307 |
|
308 | &-slide-up-enter&-slide-up-enter-active&-placement-bottomLeft,
|
309 | &-slide-up-appear&-slide-up-appear-active&-placement-bottomLeft,
|
310 | &-slide-up-enter&-slide-up-enter-active&-placement-bottomRight,
|
311 | &-slide-up-appear&-slide-up-appear-active&-placement-bottomRight {
|
312 | animation-name: rcSelectDropdownSlideUpIn;
|
313 | animation-play-state: running;
|
314 | }
|
315 |
|
316 | &-slide-up-leave&-slide-up-leave-active&-placement-bottomLeft,
|
317 | &-slide-up-leave&-slide-up-leave-active&-placement-bottomRight {
|
318 | animation-name: rcSelectDropdownSlideUpOut;
|
319 | animation-play-state: running;
|
320 | }
|
321 |
|
322 | &-slide-up-enter&-slide-up-enter-active&-placement-topLeft,
|
323 | &-slide-up-appear&-slide-up-appear-active&-placement-topLeft,
|
324 | &-slide-up-enter&-slide-up-enter-active&-placement-topRight,
|
325 | &-slide-up-appear&-slide-up-appear-active&-placement-topRight {
|
326 | animation-name: rcSelectDropdownSlideDownIn;
|
327 | animation-play-state: running;
|
328 | }
|
329 |
|
330 | &-slide-up-leave&-slide-up-leave-active&-placement-topLeft,
|
331 | &-slide-up-leave&-slide-up-leave-active&-placement-topRight {
|
332 | animation-name: rcSelectDropdownSlideDownOut;
|
333 | animation-play-state: running;
|
334 | }
|
335 | }
|
336 |
|
337 | @keyframes rcSelectDropdownSlideUpIn {
|
338 | 0% {
|
339 | opacity: 0;
|
340 | transform-origin: 0% 0%;
|
341 | transform: scaleY(0);
|
342 | }
|
343 | 100% {
|
344 | opacity: 1;
|
345 | transform-origin: 0% 0%;
|
346 | transform: scaleY(1);
|
347 | }
|
348 | }
|
349 | @keyframes rcSelectDropdownSlideUpOut {
|
350 | 0% {
|
351 | opacity: 1;
|
352 | transform-origin: 0% 0%;
|
353 | transform: scaleY(1);
|
354 | }
|
355 | 100% {
|
356 | opacity: 0;
|
357 | transform-origin: 0% 0%;
|
358 | transform: scaleY(0);
|
359 | }
|
360 | }
|
361 |
|
362 | @keyframes rcSelectDropdownSlideDownIn {
|
363 | 0% {
|
364 | transform: scaleY(0);
|
365 | transform-origin: 100% 100%;
|
366 | opacity: 0;
|
367 | }
|
368 |
|
369 | 100% {
|
370 | transform: scaleY(1);
|
371 | transform-origin: 100% 100%;
|
372 | opacity: 1;
|
373 | }
|
374 | }
|
375 |
|
376 | @keyframes rcSelectDropdownSlideDownOut {
|
377 | 0% {
|
378 | transform: scaleY(1);
|
379 | transform-origin: 100% 100%;
|
380 | opacity: 1;
|
381 | }
|
382 |
|
383 | 100% {
|
384 | transform: scaleY(0);
|
385 | transform-origin: 100% 100%;
|
386 | opacity: 0;
|
387 | }
|
388 | }
|
389 |
|
390 | @keyframes rcSelectLoadingIcon {
|
391 | 0% {
|
392 | transform: rotate(0);
|
393 | }
|
394 | 100% {
|
395 | transform: rotate(360deg);
|
396 | }
|
397 | }
|