@mozaic-ds/vue 0.21.0 → 0.22.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/dist/mozaic-vue.adeo.css +23 -23
- package/dist/mozaic-vue.adeo.umd.js +4326 -2607
- package/dist/mozaic-vue.common.js +4326 -2607
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +4326 -2607
- package/dist/mozaic-vue.umd.js.map +1 -1
- package/dist/mozaic-vue.umd.min.js +2 -2
- package/dist/mozaic-vue.umd.min.js.map +1 -1
- package/package.json +4 -4
- package/src/components/autocomplete/MAutocomplete.vue +133 -92
- package/src/components/checkbox/MCheckboxGroup.vue +8 -0
- package/src/components/listbox/MListBox.vue +213 -41
- package/src/components/listbox/MListBoxActions.vue +13 -6
- package/src/components/quantityselector/MQuantitySelector.vue +7 -2
- package/src/components/tabs/MTab.vue +29 -19
- package/src/components/textinput/MTextInputField.vue +0 -1
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
aria-labelledby="listbox"
|
|
17
17
|
>
|
|
18
18
|
<ul
|
|
19
|
-
v-for="(list,
|
|
20
|
-
:key="
|
|
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
|
|
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.
|
|
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="
|
|
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>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
icon-position="left"
|
|
8
8
|
:aria-label="decrementAriaLabel"
|
|
9
9
|
:aria-controls="id"
|
|
10
|
-
:disabled="currentValue === valuemin"
|
|
10
|
+
:disabled="disabled ? disabled : currentValue === valuemin"
|
|
11
11
|
:size="small ? 's' : null"
|
|
12
12
|
tabindex="-1"
|
|
13
13
|
type="button"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
:aria-valuemax="valuemax"
|
|
27
27
|
:placeholder="placeholder"
|
|
28
28
|
:size="small ? 's' : null"
|
|
29
|
+
:disabled="disabled"
|
|
29
30
|
role="spinbutton"
|
|
30
31
|
@input="handle"
|
|
31
32
|
@keypress="integerOnly && formatValue($event)"
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
icon-position="right"
|
|
40
41
|
:aria-label="incrementAriaLabel"
|
|
41
42
|
:aria-controls="id"
|
|
42
|
-
:disabled="currentValue === valuemax"
|
|
43
|
+
:disabled="disabled ? disabled : currentValue === valuemax"
|
|
43
44
|
:size="small ? 's' : null"
|
|
44
45
|
tabindex="-1"
|
|
45
46
|
type="button"
|
|
@@ -105,6 +106,10 @@ export default {
|
|
|
105
106
|
type: Boolean,
|
|
106
107
|
default: false,
|
|
107
108
|
},
|
|
109
|
+
disabled: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false,
|
|
112
|
+
},
|
|
108
113
|
},
|
|
109
114
|
|
|
110
115
|
data() {
|
|
@@ -23,14 +23,8 @@
|
|
|
23
23
|
class="mc-tabs__link"
|
|
24
24
|
role="tab"
|
|
25
25
|
:aria-selected="tab.active ? 'true' : 'false'"
|
|
26
|
-
:class="
|
|
27
|
-
@click="
|
|
28
|
-
manageTabs(
|
|
29
|
-
$event.target,
|
|
30
|
-
$event,
|
|
31
|
-
Object.assign({ index: index }, tab)
|
|
32
|
-
)
|
|
33
|
-
"
|
|
26
|
+
:class="setLinkClass(tab)"
|
|
27
|
+
@click="onTabClicked($event, tab, index)"
|
|
34
28
|
>
|
|
35
29
|
{{ tab.text }}
|
|
36
30
|
</component>
|
|
@@ -111,7 +105,7 @@ export default {
|
|
|
111
105
|
activeIndex(newValue) {
|
|
112
106
|
const tab = this.getTabFromIndex(newValue);
|
|
113
107
|
if (tab && this.tabs[newValue]) {
|
|
114
|
-
this.
|
|
108
|
+
this.setTabState(tab);
|
|
115
109
|
}
|
|
116
110
|
}
|
|
117
111
|
},
|
|
@@ -124,7 +118,7 @@ export default {
|
|
|
124
118
|
if (this.activeIndex) {
|
|
125
119
|
const tab = this.getTabFromIndex(this.activeIndex);
|
|
126
120
|
if (tab) {
|
|
127
|
-
this.
|
|
121
|
+
this.setTabState(tab);
|
|
128
122
|
}
|
|
129
123
|
} else {
|
|
130
124
|
const isActive = this.tabs.some((tab) =>
|
|
@@ -132,7 +126,7 @@ export default {
|
|
|
132
126
|
);
|
|
133
127
|
if (!isActive) {
|
|
134
128
|
const firstTab = this.tablist.querySelector('.mc-tabs__link');
|
|
135
|
-
this.
|
|
129
|
+
this.setTabState(firstTab);
|
|
136
130
|
}
|
|
137
131
|
}
|
|
138
132
|
}
|
|
@@ -140,18 +134,25 @@ export default {
|
|
|
140
134
|
},
|
|
141
135
|
|
|
142
136
|
methods: {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
137
|
+
setLinkClass: function (tab) {
|
|
138
|
+
return {
|
|
139
|
+
'mc-tabs__link--selected': tab.active,
|
|
140
|
+
'mc-tabs__link--disabled': tab.disabled,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
onTabClicked(e, tab, index) {
|
|
144
|
+
if (tab && tab.disabled) {
|
|
145
|
+
return;
|
|
148
146
|
}
|
|
149
147
|
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
let selectedTab = this.getTabFromIndex(index);
|
|
149
|
+
|
|
150
|
+
if (this.activeIndex) {
|
|
151
|
+
selectedTab = this.getTabFromIndex(this.activeIndex);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
this.setTabState(selectedTab);
|
|
155
|
+
this.$emit('tab-clicked', e.target, Object.assign({ index: index }, tab));
|
|
155
156
|
},
|
|
156
157
|
manageTabs: function (el, e, tab) {
|
|
157
158
|
if (tab && tab.disabled) {
|
|
@@ -169,6 +170,15 @@ export default {
|
|
|
169
170
|
el.classList.add('mc-tabs__link--selected');
|
|
170
171
|
el.setAttribute('aria-selected', 'true');
|
|
171
172
|
},
|
|
173
|
+
setTabState(tab) {
|
|
174
|
+
this.tablist.querySelectorAll('.mc-tabs__link').forEach((el) => {
|
|
175
|
+
el.classList.remove('mc-tabs__link--selected');
|
|
176
|
+
el.setAttribute('aria-selected', 'false');
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
tab.classList.add('mc-tabs__link--selected');
|
|
180
|
+
tab.setAttribute('aria-selected', 'true');
|
|
181
|
+
},
|
|
172
182
|
getTabFromIndex: function (index) {
|
|
173
183
|
if (this.tablist && this.tablist.children[index] && this.tablist.children[index].children[0]) {
|
|
174
184
|
return this.tablist.children[index].children[0];
|