@pocketprep/ui-kit 3.2.3 → 3.2.4
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/@pocketprep/ui-kit.js +279 -270
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +8 -8
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Controls/ToggleSwitch.vue +11 -4
- package/lib/components/Forms/Select.vue +27 -23
- package/package.json +1 -1
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
class="uikit-toggle-switch"
|
|
5
5
|
:class="{
|
|
6
6
|
'uikit-toggle-switch--enabled': modelValue,
|
|
7
|
+
'uikit-toggle-switch--disabled': disabled,
|
|
7
8
|
[`uikit-toggle-switch--${size}`]: true
|
|
8
9
|
}"
|
|
9
10
|
tabindex="0"
|
|
10
11
|
role="checkbox"
|
|
11
12
|
:aria-checked="modelValue"
|
|
12
|
-
@keydown.enter="toggleOption"
|
|
13
|
-
@keydown.prevent.space="toggleOption"
|
|
13
|
+
@keydown.enter="!disabled && toggleOption()"
|
|
14
|
+
@keydown.prevent.space="!disabled && toggleOption()"
|
|
14
15
|
@mousedown.prevent
|
|
15
|
-
@click="toggleOption"
|
|
16
|
+
@click="!disabled && toggleOption()"
|
|
16
17
|
>
|
|
17
18
|
<div
|
|
18
19
|
v-dark="isDarkMode"
|
|
@@ -38,6 +39,7 @@ import { dark } from '../../directives'
|
|
|
38
39
|
export default class ToggleSwitch extends Vue {
|
|
39
40
|
@Prop({ default: false }) modelValue!: boolean
|
|
40
41
|
@Prop({ default: false }) isDarkMode!: boolean
|
|
42
|
+
@Prop({ default: false }) disabled!: boolean
|
|
41
43
|
@Prop({ default: 'small' }) size!: 'small' | 'large'
|
|
42
44
|
|
|
43
45
|
@Emit('update:modelValue')
|
|
@@ -118,6 +120,11 @@ export default class ToggleSwitch extends Vue {
|
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
&--disabled {
|
|
124
|
+
opacity: 0.5;
|
|
125
|
+
cursor: default;
|
|
126
|
+
}
|
|
127
|
+
|
|
121
128
|
&__handle {
|
|
122
129
|
background-color: $white;
|
|
123
130
|
border: 0.5px solid rgba(0, 0, 0, 0.04);
|
|
@@ -157,4 +164,4 @@ export default class ToggleSwitch extends Vue {
|
|
|
157
164
|
}
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
|
-
</style>
|
|
167
|
+
</style>
|
|
@@ -96,31 +96,35 @@
|
|
|
96
96
|
'uikit-select__list--subtext': subtext,
|
|
97
97
|
}"
|
|
98
98
|
>
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class="uikit-select__item"
|
|
105
|
-
:class="{
|
|
106
|
-
'uikit-select__item--link': item.type === 'link',
|
|
107
|
-
'uikit-select__item--subtext': item.subtext
|
|
108
|
-
}"
|
|
109
|
-
:data-value="item.value || undefined"
|
|
110
|
-
tabindex="0"
|
|
111
|
-
@click="selectItem(item)"
|
|
112
|
-
@keydown="keyPressedItem"
|
|
113
|
-
@mousedown.prevent
|
|
114
|
-
>
|
|
115
|
-
{{ item.label }}
|
|
116
|
-
<div
|
|
117
|
-
v-if="item.subtext"
|
|
99
|
+
<slot name="dropdownList">
|
|
100
|
+
<li
|
|
101
|
+
v-for="item in filteredData"
|
|
102
|
+
:key="JSON.stringify(item)"
|
|
103
|
+
ref="uikit-select__items"
|
|
118
104
|
v-dark="isDarkMode"
|
|
119
|
-
class="uikit-select__item
|
|
105
|
+
class="uikit-select__item"
|
|
106
|
+
:class="{
|
|
107
|
+
'uikit-select__item--link': item.type === 'link',
|
|
108
|
+
'uikit-select__item--subtext': item.subtext
|
|
109
|
+
}"
|
|
110
|
+
:data-value="item.value || undefined"
|
|
111
|
+
tabindex="0"
|
|
112
|
+
@click="selectItem(item)"
|
|
113
|
+
@keydown="keyPressedItem"
|
|
114
|
+
@mousedown.prevent
|
|
120
115
|
>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
<slot name="dropdownListItem">
|
|
117
|
+
{{ item.label }}
|
|
118
|
+
<div
|
|
119
|
+
v-if="item.subtext"
|
|
120
|
+
v-dark="isDarkMode"
|
|
121
|
+
class="uikit-select__item-subtext"
|
|
122
|
+
>
|
|
123
|
+
{{ item.subtext }}
|
|
124
|
+
</div>
|
|
125
|
+
</slot>
|
|
126
|
+
</li>
|
|
127
|
+
</slot>
|
|
124
128
|
</ul>
|
|
125
129
|
</div>
|
|
126
130
|
</div>
|