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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.140",
3
+ "version": "0.2.144",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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="(showDropDown && options.length > 0) || isSearching"
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 truncate',
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
- this.$emit("search", value);
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;