@mozaic-ds/vue 0.35.0-beta.5 → 0.35.1-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.35.0-beta.5",
3
+ "version": "0.35.1-beta.0",
4
4
  "description": "Vue.js implementation of Mozaic Design System",
5
5
  "author": "Adeo - Mozaic Design System",
6
6
  "scripts": {
@@ -25,8 +25,8 @@
25
25
  "dependencies": {
26
26
  "@linusborg/vue-simple-portal": "^0.1.5",
27
27
  "@mozaic-ds/css-dev-tools": "1.50.0",
28
- "@mozaic-ds/icons": "1.49.0",
29
- "@mozaic-ds/styles": "1.51.0",
28
+ "@mozaic-ds/icons": "1.52.0",
29
+ "@mozaic-ds/styles": "1.52.0",
30
30
  "@mozaic-ds/web-fonts": "1.22.0",
31
31
  "core-js": "^3.27.1",
32
32
  "libphonenumber-js": "^1.10.15",
@@ -34,7 +34,7 @@
34
34
  />
35
35
  <MLoader v-if="loading" class="mc-autocomplete__loader" size="s" />
36
36
  <button
37
- v-if="hasValues"
37
+ v-if="isClearable"
38
38
  type="button"
39
39
  class="mc-autocomplete__clear"
40
40
  @click="onClear"
@@ -193,6 +193,11 @@ export default {
193
193
  type: Boolean,
194
194
  default: true,
195
195
  },
196
+ // Clear Button
197
+ clearable: {
198
+ type: Boolean,
199
+ default: true,
200
+ },
196
201
  // Global
197
202
  maxWidth: {
198
203
  type: String,
@@ -218,7 +223,7 @@ export default {
218
223
  classObject() {
219
224
  return {
220
225
  'mc-autocomplete--multi': this.multiple,
221
- 'mc-autocomplete--clearable': this.hasValues,
226
+ 'mc-autocomplete--clearable': this.isClearable,
222
227
  };
223
228
  },
224
229
  setStyles() {
@@ -230,8 +235,8 @@ export default {
230
235
  setTagLabel() {
231
236
  return this.listboxValue.length.toString() + ' ' + this.tagLabel;
232
237
  },
233
- hasValues() {
234
- return this.inputValue?.length > 0;
238
+ isClearable() {
239
+ return this.clearable && this.inputValue?.length > 0 && !this.disabled;
235
240
  },
236
241
  isInvalid() {
237
242
  return this.invalid || this.isFiltered;
@@ -250,7 +255,6 @@ export default {
250
255
  },
251
256
  localItems: {
252
257
  handler: function (val) {
253
- // this.localItems = val;
254
258
  this.isFiltered = !val.length;
255
259
  this.$emit('list-filtered', val);
256
260
  },
@@ -327,22 +331,13 @@ export default {
327
331
  if (value.length && this.filter) {
328
332
  this.filter(value);
329
333
  } else {
330
- if (!this.filterOnType) {
331
- return;
332
- }
333
-
334
334
  if (value.length) {
335
335
  this.localItems = this.items.filter((item) =>
336
336
  item[this.dataTextExpr].toUpperCase().includes(value.toUpperCase())
337
337
  );
338
-
339
- // this.isFiltered = !this.localItems.length;
340
338
  } else {
341
339
  this.localItems = this.items;
342
- // this.isFiltered = !this.localItems.length;
343
340
  }
344
-
345
- // this.$emit('list-filtered', this.localItems);
346
341
  }
347
342
  },
348
343
  closeListBox() {
@@ -396,7 +391,10 @@ export default {
396
391
  this.$emit('clear-input');
397
392
  }
398
393
  this.$emit('update:input', value);
399
- this.filterList(value);
394
+
395
+ if (this.filterOnType) {
396
+ this.filterList(value);
397
+ }
400
398
  },
401
399
  },
402
400
  };
@@ -85,6 +85,10 @@ export default {
85
85
  },
86
86
  },
87
87
  props: {
88
+ items: {
89
+ type: Array,
90
+ default: () => [],
91
+ },
88
92
  open: {
89
93
  type: Boolean,
90
94
  default: false,
@@ -93,10 +97,6 @@ export default {
93
97
  type: String,
94
98
  default: 'left',
95
99
  },
96
- items: {
97
- type: Array,
98
- default: () => [],
99
- },
100
100
  triggerLabel: {
101
101
  type: String,
102
102
  default: 'Display options',
@@ -22,7 +22,10 @@
22
22
  :class="setActiveClass(tab)"
23
23
  active-class="mc-tabs__element--selected"
24
24
  >
25
- <span class="mc-tabs__text">{{ tab.text }}</span>
25
+ <span class="mc-tabs__text">
26
+ <MIcon v-if="tab.icon" :name="tab.icon" class="mc-tabs__icon" />
27
+ {{ tab.text }}
28
+ </span>
26
29
  </component>
27
30
  <component
28
31
  :is="tab.href ? (tab.disabled ? 'span' : 'a') : 'button'"
@@ -44,7 +47,10 @@
44
47
  )
45
48
  "
46
49
  >
47
- <span class="mc-tabs__text">{{ tab.text }}</span>
50
+ <span class="mc-tabs__text">
51
+ <MIcon v-if="tab.icon" :name="tab.icon" class="mc-tabs__icon" />
52
+ {{ tab.text }}
53
+ </span>
48
54
  </component>
49
55
  </li>
50
56
  </ul>
@@ -53,12 +59,14 @@
53
59
  </template>
54
60
 
55
61
  <script>
62
+ import MIcon from '../icon/MIcon.vue';
56
63
  import MSelect from '../select/MSelect.vue';
57
64
 
58
65
  export default {
59
66
  name: 'MTab',
60
67
 
61
68
  components: {
69
+ MIcon,
62
70
  MSelect,
63
71
  },
64
72