@mozaic-ds/vue 0.25.0 → 0.27.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,14 +1,14 @@
1
1
  {
2
2
  "name": "@mozaic-ds/vue",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Vue.js implementation of Mozaic Design System",
5
5
  "author": "Adeo - Mozaic Design System",
6
6
  "scripts": {
7
7
  "serve": "vue-cli-service serve",
8
8
  "build": "vue-cli-service build ./src/index.js",
9
9
  "lint": "vue-cli-service lint",
10
- "build:bundle": "vue-cli-service build --target lib --name mozaic-vue ./src/index.js",
11
- "build:bundleAdeo": "vue-cli-service build --target lib --formats umd --mode adeo --filename mozaic-vue.adeo ./src/index.js --no-clean",
10
+ "build:bundle": "MOZAIC_PRESET=lm vue-cli-service build --target lib --name mozaic-vue ./src/index.js",
11
+ "build:bundleAdeo": "MOZAIC_PRESET=adeo vue-cli-service build --target lib --formats umd --mode adeo --filename mozaic-vue.adeo ./src/index.js --no-clean",
12
12
  "postinstall": "node postinstall.js",
13
13
  "prepublishOnly": "npm run-script build:bundle && npm run-script build:bundleAdeo",
14
14
  "publish:beta": "npm publish --access public --tag alpha",
@@ -41,6 +41,7 @@
41
41
  :data-text-expr="dataTextExpr"
42
42
  :data-value-expr="dataValueExpr"
43
43
  :is-filtered="isFiltered"
44
+ :max-width="maxWidth"
44
45
  @change="onChange"
45
46
  >
46
47
  <template #item="{ item }">
@@ -169,7 +170,7 @@ export default {
169
170
  // Global
170
171
  maxWidth: {
171
172
  type: String,
172
- default: '17.875rem',
173
+ default: '100%', // 17.875rem
173
174
  },
174
175
  },
175
176
 
@@ -220,8 +221,7 @@ export default {
220
221
  },
221
222
 
222
223
  listboxValue: function (val) {
223
- const value = Array.isArray(val) ? val : val.toString();
224
- const selectedItems = this.getSelectedItems(value);
224
+ const selectedItems = this.getSelectedItems(val);
225
225
 
226
226
  const seletedLabels = selectedItems.map(
227
227
  (item) => item[this.dataTextExpr]
@@ -306,9 +306,11 @@ export default {
306
306
  getSelectedItems(val) {
307
307
  const value = val ? val : this.listboxValue;
308
308
 
309
- const selectedItems = this.items.filter((item) =>
310
- value.includes(item[this.dataValueExpr])
311
- );
309
+ const selectedItems = this.items.filter((item) => {
310
+ return this.multiple
311
+ ? value.includes(item[this.dataValueExpr])
312
+ : value === item[this.dataValueExpr];
313
+ });
312
314
 
313
315
  return selectedItems;
314
316
  },
@@ -364,6 +366,10 @@ export default {
364
366
  top: $mu075;
365
367
  z-index: 10;
366
368
  }
369
+
370
+ &__trigger {
371
+ width: 100%;
372
+ }
367
373
  }
368
374
 
369
375
  .mc-autocomplete--multi .mc-autocomplete__trigger {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <component :is="htmlTag" class="mc-flag" :class="setClasses">
3
- {{ label }}
3
+ <span class="mc-flag__label">{{ label }}</span>
4
4
  </component>
5
5
  </template>
6
6
 
@@ -4,6 +4,7 @@
4
4
  class="mc-listbox"
5
5
  aria-labelledby="listbox"
6
6
  :class="{ 'is-open': open, 'mc-listbox--multi': multiple }"
7
+ :style="{ '--listbox-width': maxWidth }"
7
8
  >
8
9
  <template v-if="!isFiltered">
9
10
  <li
@@ -91,6 +92,10 @@ export default {
91
92
  type: [Array, String, Number],
92
93
  default: undefined,
93
94
  },
95
+ maxWidth: {
96
+ type: String,
97
+ default: '17.875rem',
98
+ },
94
99
  },
95
100
 
96
101
  data() {