classcard-ui 0.2.140 → 0.2.144
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/classcard-ui.common.js +19 -9
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +19 -9
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CGroupedSelect/CGroupedSelect.vue +15 -5
package/package.json
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<div
|
|
4
|
+
v-if="showDropDown && options.length > 0"
|
|
5
|
+
class="fixed inset-0"
|
|
6
|
+
@click="closeDropDown()"
|
|
7
|
+
aria-hidden="true"
|
|
8
|
+
></div>
|
|
3
9
|
<label v-if="label" class="block text-sm font-medium text-gray-700">
|
|
4
10
|
{{ label }}
|
|
5
11
|
</label>
|
|
@@ -14,7 +20,6 @@
|
|
|
14
20
|
:value="inputValue"
|
|
15
21
|
:placeholder="placeholder"
|
|
16
22
|
@focus="openDropDown()"
|
|
17
|
-
@blur="closeDropDown()"
|
|
18
23
|
@input="onInput"
|
|
19
24
|
/>
|
|
20
25
|
<span
|
|
@@ -52,7 +57,7 @@
|
|
|
52
57
|
role="listbox"
|
|
53
58
|
aria-labelledby="listbox-label"
|
|
54
59
|
aria-activedescendant="listbox-option-3"
|
|
55
|
-
v-if="
|
|
60
|
+
v-if="showDropDown && options.length > 0"
|
|
56
61
|
>
|
|
57
62
|
<div
|
|
58
63
|
v-if="isSearching"
|
|
@@ -92,7 +97,7 @@
|
|
|
92
97
|
subOption.label === value.label
|
|
93
98
|
? 'font-semibold'
|
|
94
99
|
: 'font-normal',
|
|
95
|
-
' block
|
|
100
|
+
' block break-words',
|
|
96
101
|
]"
|
|
97
102
|
>
|
|
98
103
|
{{ subOption.label }}
|
|
@@ -157,11 +162,16 @@ export default {
|
|
|
157
162
|
this.emitSearch(e.target.value);
|
|
158
163
|
},
|
|
159
164
|
emitSearch: debounce(function (value) {
|
|
160
|
-
|
|
165
|
+
if (value !== this.value.label) {
|
|
166
|
+
this.$emit("search", value);
|
|
167
|
+
} else {
|
|
168
|
+
this.$emit("search", "");
|
|
169
|
+
}
|
|
161
170
|
}, 500),
|
|
162
171
|
handleOptionClick(option) {
|
|
163
|
-
this.$emit("input", option);
|
|
164
172
|
this.inputValue = option.label;
|
|
173
|
+
this.closeDropDown();
|
|
174
|
+
this.$emit("input", option);
|
|
165
175
|
},
|
|
166
176
|
closeDropDown() {
|
|
167
177
|
this.inputValue = this.value.label;
|