@mozaic-ds/vue 0.34.0 → 0.34.2-beta.0

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": "@mozaic-ds/vue",
3
- "version": "0.34.0",
3
+ "version": "0.34.2-beta.0",
4
4
  "description": "Vue.js implementation of Mozaic Design System",
5
5
  "author": "Adeo - Mozaic Design System",
6
6
  "scripts": {
@@ -202,9 +202,11 @@ export default {
202
202
  openState: this.open,
203
203
  tagWidth: '0px',
204
204
  tagValue: null,
205
+ inputValue: null,
205
206
  localItems: null,
206
207
  sortedListItems: null,
207
208
  isFiltered: null,
209
+ listboxValue: null,
208
210
  };
209
211
  },
210
212
 
@@ -221,22 +223,6 @@ export default {
221
223
  hasValues() {
222
224
  return this.inputValue?.length > 0;
223
225
  },
224
- inputValue: {
225
- get: function () {
226
- return this.input;
227
- },
228
- set: function (newValue) {
229
- return this.$emit('update:input', newValue);
230
- },
231
- },
232
- listboxValue: {
233
- get: function () {
234
- return !this.value && this.multiple ? [] : this.value;
235
- },
236
- set: function (newValue) {
237
- return this.$emit('change', newValue);
238
- },
239
- },
240
226
  },
241
227
 
242
228
  watch: {
@@ -246,6 +232,22 @@ export default {
246
232
  },
247
233
  immediate: true,
248
234
  },
235
+ input: {
236
+ handler: function (val) {
237
+ this.inputValue = val;
238
+ },
239
+ immediate: true,
240
+ },
241
+ value: {
242
+ handler: function (val) {
243
+ if (!val && this.multiple) {
244
+ this.listboxValue = [];
245
+ } else {
246
+ this.listboxValue = val;
247
+ }
248
+ },
249
+ immediate: true,
250
+ },
249
251
  listboxValue: function (val) {
250
252
  if (!this.multiple) {
251
253
  const selectedItems = this.getSelectedItems(val);
@@ -254,6 +256,7 @@ export default {
254
256
  );
255
257
 
256
258
  this.inputValue = seletedLabels.join(', ');
259
+ this.$emit('update:input', this.inputValue);
257
260
  } else {
258
261
  this.tagValue = val;
259
262
  }
@@ -319,7 +322,9 @@ export default {
319
322
  this.localItems = this.items;
320
323
  }
321
324
  },
322
- onChangeListbox() {
325
+ onChangeListbox(value) {
326
+ this.$emit('change', value);
327
+
323
328
  if (!this.multiple) {
324
329
  this.closeListBox();
325
330
  }
@@ -358,6 +363,7 @@ export default {
358
363
  if (value.length === 0) {
359
364
  this.$emit('clear-input');
360
365
  }
366
+ this.$emit('update:input', value);
361
367
  this.filterList(value);
362
368
  },
363
369
  },