This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +62
-9
lines changed Expand file tree Collapse file tree 4 files changed +62
-9
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ const data = () => ({
120
120
type: ' checkbox' ,
121
121
label: ' Disabled' ,
122
122
name: ' disabled' ,
123
- inline : false ,
123
+ value : true ,
124
124
disabled: true ,
125
125
customClass: ' col-12' ,
126
126
}),
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" input-checkbox" >
3
3
<input
4
- class =" input-checkbox__toggle "
4
+ class =" input-checkbox__input "
5
5
type =" checkbox"
6
6
:id =" formControl.name"
7
7
v-model =" formControl.value"
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" input-radio" >
2
+ <div
3
+ class =" input-radio"
4
+ :class =" { 'input-radio--inline': formControl.inline }"
5
+ >
3
6
<div
4
- class =" form-check"
5
- :class =" { 'form-check--inline': formControl.inline }"
7
+ class =" input-radio__base"
6
8
v-for =" opt in formControl.options"
7
9
:key =" opt.name"
8
10
>
9
11
<input
10
- class =" form-check__input "
12
+ class =" input-radio__input "
11
13
type =" radio"
12
14
:id =" opt.value"
13
15
v-model =" formControl.value"
14
16
:value =" opt.value"
15
17
:disabled =" opt.disabled"
16
18
/>
17
- <label class =" form-check__label " :for =" opt.value" >
19
+ <label class =" input-radio__label " :for =" opt.value" >
18
20
{{ opt.text }}
19
21
</label >
20
22
</div >
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ select.form-control ~ .form-label,
158
158
line-height : 1.5 ;
159
159
160
160
& :hover {
161
- #{$checkbox } __ toggle {
161
+ #{$checkbox } __ input {
162
162
opacity : 0.04 ;
163
163
164
164
& :hover {
@@ -167,7 +167,7 @@ select.form-control ~ .form-label,
167
167
}
168
168
}
169
169
170
- & __toggle {
170
+ & __input {
171
171
appearance : none ;
172
172
-moz-appearance : none ;
173
173
-webkit-appearance : none ;
@@ -284,3 +284,54 @@ select.form-control ~ .form-label,
284
284
}
285
285
}
286
286
}
287
+
288
+ .input-radio {
289
+ & --inline {
290
+ display : inline-block ;
291
+ }
292
+
293
+ input [type = ' radio' ] {
294
+ display : none ;
295
+
296
+ & :checked + label :before {
297
+ border-color : $theme-color ;
298
+ animation : ripple 0.2s linear forwards ;
299
+ }
300
+ & :checked + label :after {
301
+ transform : scale (1 );
302
+ }
303
+ }
304
+
305
+ label {
306
+ display : inline-block ;
307
+ min-height : 20px ;
308
+ position : relative ;
309
+ padding : 0 (20px + 10px );
310
+ margin-bottom : 0 ;
311
+ cursor : pointer ;
312
+ vertical-align : bottom ;
313
+ & :before ,
314
+ & :after {
315
+ position : absolute ;
316
+ content : ' ' ;
317
+ border-radius : 50% ;
318
+ transition : all 0.3s ease ;
319
+ transition-property : transform , border-color ;
320
+ }
321
+ & :before {
322
+ left : 0 ;
323
+ top : 0 ;
324
+ width : 20px ;
325
+ height : 20px ;
326
+ border : 2px solid $base-color ;
327
+ }
328
+ & :after {
329
+ top : 20px / 2 - 10px / 2 ;
330
+ left : 20px / 2 - 10px / 2 ;
331
+ width : 10px ;
332
+ height : 10px ;
333
+ transform : scale (0 );
334
+ background : $theme-color ;
335
+ }
336
+ }
337
+ }
You can’t perform that action at this time.
0 commit comments