classcard-ui 0.2.320 → 0.2.323

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.320",
3
+ "version": "0.2.323",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="flex items-center">
4
- <label v-if="label" class="text-sm font-medium text-gray-900">{{ label }}</label>
4
+ <label v-if="label" class="text-sm font-medium text-gray-900">{{
5
+ label
6
+ }}</label>
5
7
  <!-- asterisk sign to render if field is required -->
6
8
  <p v-if="isRequired" class="ml-1 text-red-600">*</p>
7
9
  </div>
@@ -40,7 +42,9 @@
40
42
  </template>
41
43
  <!-- eslint-disable-next-line vue/no-unused-vars -->
42
44
  <template #no-options="{ search, searching, loading }">
43
- <span v-if="search.length < 1">Start typing to search for options...</span>
45
+ <span v-if="search.length < 1"
46
+ >Start typing to search for options...</span
47
+ >
44
48
  <span v-else>No options found, try searching something else.</span>
45
49
  </template>
46
50
  <template #spinner="{ loading }">
@@ -97,6 +101,7 @@
97
101
  <script>
98
102
  import vSelect from "vue-select";
99
103
  import CAvatar from "../CAvatar/CAvatar.vue";
104
+ import { debounce } from "lodash-es";
100
105
  // import Fuse from "fuse.js";
101
106
  import "vue-select/dist/vue-select.css";
102
107
  export default {
@@ -174,13 +179,21 @@ export default {
174
179
  data() {
175
180
  return {
176
181
  loaderSearching: true,
177
- value: this.optionsSelected && this.optionsSelected.length ? this.optionsSelected : [],
182
+ value:
183
+ this.optionsSelected && this.optionsSelected.length
184
+ ? this.optionsSelected
185
+ : [],
186
+ localSearch: "",
178
187
  };
179
188
  },
180
189
  methods: {
181
190
  fetchOptions(search, loaderSearching) {
182
191
  this.$emit("getOptions", search, loaderSearching);
192
+ this.emitSearch(search);
183
193
  },
194
+ emitSearch: debounce((search) => {
195
+ this.$emit("search", search);
196
+ }, 500),
184
197
  setSelectedOptions(params) {
185
198
  this.value = params;
186
199
  this.$emit("onSelectOptions", params);
@@ -198,7 +211,7 @@ export default {
198
211
  @apply cursor-pointer;
199
212
  }
200
213
  .vs__dropdown-toggle {
201
- @apply focus:outline-none w-full rounded-md border border-gray-300 bg-white py-2 pl-3 text-left shadow-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 sm:text-sm;
214
+ @apply w-full rounded-md border border-gray-300 bg-white py-2 pl-3 text-left shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 sm:text-sm;
202
215
  }
203
216
  .vs__selected-options {
204
217
  @apply flex-nowrap overflow-hidden;
@@ -221,7 +234,7 @@ export default {
221
234
  @apply pt-0 pr-3;
222
235
  }
223
236
  .vs__dropdown-menu {
224
- @apply focus:outline-none mt-2 max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-opacity-5 sm:text-sm;
237
+ @apply mt-2 max-h-60 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-opacity-5 focus:outline-none sm:text-sm;
225
238
  }
226
239
  .vs__dropdown-option {
227
240
  @apply py-2;