@mozaic-ds/vue 0.21.0 → 0.21.1

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.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "Vue.js implementation of Mozaic Design System",
5
5
  "author": "Adeo - Mozaic Design System",
6
6
  "scripts": {
@@ -16,13 +16,13 @@
16
16
  aria-labelledby="listbox"
17
17
  >
18
18
  <ul
19
- v-for="(list, index) in listItems"
20
- :key="`${list}-${index}`"
19
+ v-for="(list, i) in listItems"
20
+ :key="`list${i}`"
21
21
  class="mc-listbox-options__list"
22
22
  >
23
23
  <li
24
- v-for="item in list"
25
- :key="item.id"
24
+ v-for="(item, j) in list"
25
+ :key="`item${j}`"
26
26
  class="mc-listbox-options__tile"
27
27
  :class="{ 'is-disabled': item.disabled }"
28
28
  >
@@ -36,10 +36,10 @@
36
36
  :is="item.href ? 'a' : 'button'"
37
37
  :href="item.href ? item.href : null"
38
38
  :type="item.href ? null : 'button'"
39
- :disabled="item.href ? null : true"
39
+ :disabled="item.disabled ? true : null"
40
40
  class="mc-listbox-options__item"
41
41
  :class="{ 'is-danger': item.danger, 'is-disabled': item.disabled }"
42
- @click.self="$emit('update:itemSelected', item)"
42
+ @click.self="onClickItem(item, i, j)"
43
43
  >
44
44
  {{ item.text }}
45
45
  </component>
@@ -118,6 +118,13 @@ export default {
118
118
  onClickOutside() {
119
119
  this.isOpen = false;
120
120
  },
121
+ onClickItem(item, listIndex, itemIndex) {
122
+ const valToEmit = Object.assign(
123
+ { listIndex: listIndex, itemIndex: itemIndex },
124
+ item
125
+ );
126
+ this.$emit('update:itemSelected', valToEmit);
127
+ },
121
128
  },
122
129
  };
123
130
  </script>