@pocketprep/ui-kit 3.4.47 → 3.4.48
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.
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
v-if="checkboxId"
|
|
4
4
|
v-dark="isDarkMode"
|
|
5
5
|
class="uikit-checkbox-option"
|
|
6
|
-
:class="{
|
|
7
|
-
|
|
6
|
+
:class="{
|
|
7
|
+
'uikit-checkbox-option--selected': modelValue,
|
|
8
|
+
'uikit-checkbox-option--disabled': disabled,
|
|
9
|
+
}"
|
|
10
|
+
:tabindex="disabled ? -1 : 0"
|
|
8
11
|
:aria-labelledby="checkboxId"
|
|
9
12
|
role="checkbox"
|
|
10
13
|
:aria-checked="modelValue === true ? true : modelValue === null ? 'mixed' : false"
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
<Checkbox
|
|
16
19
|
:modelValue="modelValue"
|
|
17
20
|
tabindex="-1"
|
|
18
|
-
:disabled="
|
|
21
|
+
:disabled="disabled"
|
|
19
22
|
class="uikit-checkbox-option__checkbox"
|
|
20
23
|
:is-dark-mode="isDarkMode"
|
|
21
24
|
:has-label="true"
|
|
@@ -43,6 +46,7 @@ export default class CheckboxOption extends Vue {
|
|
|
43
46
|
@Prop({ default: false }) modelValue!: boolean | null
|
|
44
47
|
@Prop({ default: false }) isDarkMode!: boolean
|
|
45
48
|
@Prop() label!: string
|
|
49
|
+
@Prop({ default: false }) disabled!: boolean
|
|
46
50
|
|
|
47
51
|
checkboxId: null | string = null
|
|
48
52
|
|
|
@@ -52,7 +56,11 @@ export default class CheckboxOption extends Vue {
|
|
|
52
56
|
|
|
53
57
|
@Emit('update:modelValue')
|
|
54
58
|
emitUpdateModelValue (val: boolean) {
|
|
55
|
-
|
|
59
|
+
if (this.disabled) {
|
|
60
|
+
return this.modelValue
|
|
61
|
+
} else {
|
|
62
|
+
return val
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
66
|
</script>
|
|
@@ -75,7 +83,7 @@ export default class CheckboxOption extends Vue {
|
|
|
75
83
|
position: relative;
|
|
76
84
|
z-index: 1;
|
|
77
85
|
|
|
78
|
-
&:hover {
|
|
86
|
+
&:not(&--disabled):hover {
|
|
79
87
|
label {
|
|
80
88
|
color: $slate-03;
|
|
81
89
|
}
|
|
@@ -98,7 +106,7 @@ export default class CheckboxOption extends Vue {
|
|
|
98
106
|
&--dark {
|
|
99
107
|
color: rgba($white, 0.72);
|
|
100
108
|
|
|
101
|
-
&:hover {
|
|
109
|
+
&:not(&--disabled):hover {
|
|
102
110
|
label {
|
|
103
111
|
color: rgba($white, 0.72);
|
|
104
112
|
}
|
|
@@ -160,6 +168,18 @@ export default class CheckboxOption extends Vue {
|
|
|
160
168
|
}
|
|
161
169
|
}
|
|
162
170
|
|
|
171
|
+
&--disabled {
|
|
172
|
+
color: $slate;
|
|
173
|
+
|
|
174
|
+
&--dark {
|
|
175
|
+
color: rgba($white, 0.7);
|
|
176
|
+
|
|
177
|
+
label {
|
|
178
|
+
color: rgba($white, 0.7) !important;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
163
183
|
&__label {
|
|
164
184
|
margin-left: 12px;
|
|
165
185
|
width: calc(100% - 27px);
|