classcard-ui 0.2.251 → 0.2.252

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.251",
3
+ "version": "0.2.252",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -43,9 +43,9 @@
43
43
  :type="icon.type"
44
44
  >
45
45
  </c-icon>
46
- <span :class="showImage ? 'ml-3' : ''" class="block truncate">
47
- {{ selectedValue ? selectedValue :
48
- selectSearch && selectSearch.length > 0 ? null : placeholder
46
+ <span :class="showImage ? 'ml-3' : ''" class="block truncate text-sm">
47
+ {{ selectedValue ? selectedValue :
48
+ !selectSearch || selectSearch == '' ? placeholder : null
49
49
  }}
50
50
  </span>
51
51
  </span>
@@ -136,6 +136,7 @@
136
136
  <script>
137
137
  import CIcon from "../CIcon/CIcon.vue";
138
138
  import CAvatar from "../CAvatar/CAvatar.vue";
139
+ import { isNumber } from 'lodash';
139
140
  export default {
140
141
  name: "CSelect",
141
142
  components: { CIcon, CAvatar },
@@ -216,6 +217,7 @@ export default {
216
217
  },
217
218
  methods: {
218
219
  handleSelect(event, option) {
220
+ this.selectSearch = null;
219
221
  this.selectedValue = option[this.renderOptionName];
220
222
  this.$emit("onChangeValue", option);
221
223
  this.toggleDropdown = false;
@@ -224,18 +226,21 @@ export default {
224
226
  this.$emit("listAction", event);
225
227
  },
226
228
  close() {
229
+ this.selectSearch = null;
227
230
  this.toggleDropdown = false;
228
231
  this.type === "tertiary" ? (this.showFocus = false) : "";
229
232
  },
230
233
  search() {
234
+ this.selectedValue = null;
231
235
  if(!this.selectSearch && this.selectSearch == '') {
232
236
  this.renderOptions = this.options;
237
+ return;
233
238
  }
234
239
  let options = [...this.options];
235
240
  this.renderOptions = options.filter((option) => {
241
+ isNumber(option[this.renderOptionName]) ? option[this.renderOptionName] = option[this.renderOptionName].toString() : "";
236
242
  return option[this.renderOptionName].toLowerCase().includes(this.selectSearch.toLowerCase());
237
243
  });
238
- console.log(this.renderOptions);
239
244
  }
240
245
  },
241
246
  watch: {