classcard-ui 0.2.319 → 0.2.322

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.319",
3
+ "version": "0.2.322",
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,22 @@ 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) {
191
+ this.localSearch = search;
182
192
  this.$emit("getOptions", search, loaderSearching);
193
+ this.emitSearch();
183
194
  },
195
+ emitSearch: debounce(() => {
196
+ this.$emit("search", this.localSearch);
197
+ }, 500),
184
198
  setSelectedOptions(params) {
185
199
  this.value = params;
186
200
  this.$emit("onSelectOptions", params);
@@ -198,7 +212,7 @@ export default {
198
212
  @apply cursor-pointer;
199
213
  }
200
214
  .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;
215
+ @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
216
  }
203
217
  .vs__selected-options {
204
218
  @apply flex-nowrap overflow-hidden;
@@ -221,7 +235,7 @@ export default {
221
235
  @apply pt-0 pr-3;
222
236
  }
223
237
  .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;
238
+ @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
239
  }
226
240
  .vs__dropdown-option {
227
241
  @apply py-2;
@@ -1,6 +1,14 @@
1
1
  <template>
2
2
  <div>
3
- <div v-if="type === 'filestack'" :class="filestackClasses" id="filestack-uploader"></div>
3
+ <button
4
+ type="button"
5
+ class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
6
+ @click="initFilestack()"
7
+ v-if="displayMode == 'overlay'"
8
+ >
9
+ Upload
10
+ </button>
11
+ <div :class="filestackClasses" id="filestack-uploader"></div>
4
12
  <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
5
13
  {{ errorMessage }}
6
14
  </p>
@@ -27,10 +35,6 @@ export default {
27
35
  errorMessage: {
28
36
  type: String,
29
37
  },
30
- type: {
31
- type: String,
32
- default: "default",
33
- },
34
38
  filestackApiKey: {
35
39
  type: String,
36
40
  default: "",
@@ -60,7 +64,6 @@ export default {
60
64
  },
61
65
  data() {
62
66
  return {
63
- uploader: null,
64
67
  };
65
68
  },
66
69
  methods: {
@@ -97,7 +100,7 @@ export default {
97
100
  },
98
101
  },
99
102
  mounted() {
100
- if (this.type === "filestack") {
103
+ if (this.displayMode == "inline") {
101
104
  this.initFilestack();
102
105
  }
103
106
  },