classcard-ui 0.2.139 → 0.2.140

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.139",
3
+ "version": "0.2.140",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -13,7 +13,7 @@
13
13
  aria-labelledby="listbox-label"
14
14
  :value="inputValue"
15
15
  :placeholder="placeholder"
16
- @focus="showDropDown = true"
16
+ @focus="openDropDown()"
17
17
  @blur="closeDropDown()"
18
18
  @input="onInput"
19
19
  />
@@ -52,13 +52,24 @@
52
52
  role="listbox"
53
53
  aria-labelledby="listbox-label"
54
54
  aria-activedescendant="listbox-option-3"
55
- v-if="showDropDown && options.length > 0"
55
+ v-if="(showDropDown && options.length > 0) || isSearching"
56
56
  >
57
+ <div
58
+ v-if="isSearching"
59
+ class="w-full h-8 relative block top-0 left-0 bg-white opacity-75 z-50"
60
+ >
61
+ <span
62
+ class="text-gray-500 opacity-75 top-1/4 my-0 mx-auto block relative w-0 h-0"
63
+ >
64
+ <c-icon name="loader" class="h-5 w-5"></c-icon>
65
+ </span>
66
+ </div>
57
67
  <!--
58
68
  Select option, manage highlight styles based on mouseenter/mouseleave and keyboard navigation.
59
69
 
60
70
  Highlighted: "text-white bg-indigo-600", Not Highlighted: "text-gray-900"
61
71
  -->
72
+
62
73
  <span v-for="option in options" :key="option.id">
63
74
  <li
64
75
  class="text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9"
@@ -122,14 +133,17 @@
122
133
 
123
134
  <script>
124
135
  import { debounce } from "lodash-es";
136
+ import CIcon from "../CIcon/CIcon.vue";
125
137
 
126
138
  export default {
127
139
  name: "CGroupedSelect",
140
+ components: { CIcon },
128
141
  props: {
129
142
  label: String,
130
143
  options: Array,
131
144
  value: Object,
132
145
  placeholder: String,
146
+ isSearching: Boolean,
133
147
  },
134
148
  data() {
135
149
  return {
@@ -153,6 +167,10 @@ export default {
153
167
  this.inputValue = this.value.label;
154
168
  this.showDropDown = false;
155
169
  },
170
+ openDropDown() {
171
+ this.showDropDown = true;
172
+ this.emitSearch("");
173
+ },
156
174
  },
157
175
  watch: {
158
176
  value(newValue) {