@mozaic-ds/vue 0.23.0 → 1.0.0-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 +43 -43
- package/dist/mozaic-vue.adeo.umd.js +1319 -3718
- package/dist/mozaic-vue.common.js +1319 -3718
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +1321 -3720
- 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 +93 -151
- package/src/components/checkbox/MCheckboxGroup.vue +0 -8
- package/src/components/datatable/MDataTable.vue +162 -290
- package/src/components/datatable/MDataTableTop.vue +35 -0
- package/src/components/icon/MIcon.vue +2 -18
- package/src/components/index.js +1 -1
- package/src/components/listbox/MListBox.vue +41 -213
- package/src/components/listbox/index.js +1 -6
- package/src/components/phonenumber/MPhoneNumber.vue +2 -5
- package/src/components/quantityselector/MQuantitySelector.vue +2 -10
- package/src/components/ratingstars/MStarsInput.vue +0 -1
- package/src/components/stepper/MStepper.vue +27 -68
- package/src/components/tabs/MTab.vue +55 -65
- package/src/components/textinput/MTextInputField.vue +1 -0
- package/src/index.js +1 -1
- package/src/tokens/adeo/android/colors.xml +166 -209
- package/src/tokens/adeo/css/_variables.scss +166 -209
- package/src/tokens/adeo/css/root.scss +46 -89
- package/src/tokens/adeo/ios/StyleDictionaryColor.h +5 -48
- package/src/tokens/adeo/ios/StyleDictionaryColor.m +171 -214
- package/src/tokens/adeo/ios/StyleDictionaryColor.swift +166 -209
- package/src/tokens/adeo/js/tokens.js +166 -209
- package/src/tokens/adeo/js/tokensObject.js +310 -1285
- package/src/tokens/adeo/scss/_tokens.scss +174 -344
- package/types/index.d.ts +0 -2
- package/src/components/listbox/MListBoxActions.vue +0 -251
|
@@ -13,20 +13,8 @@
|
|
|
13
13
|
class="mc-tabs__item"
|
|
14
14
|
role="presentation"
|
|
15
15
|
>
|
|
16
|
-
<component
|
|
17
|
-
:is="`${tab.router}`"
|
|
18
|
-
v-if="tab.router"
|
|
19
|
-
v-bind="tab.attrs"
|
|
20
|
-
:to="tab.to"
|
|
21
|
-
class="mc-tabs__link"
|
|
22
|
-
:class="setLinkClass(tab)"
|
|
23
|
-
active-class="mc-tabs__link--selected"
|
|
24
|
-
>
|
|
25
|
-
{{ tab.text }}
|
|
26
|
-
</component>
|
|
27
16
|
<component
|
|
28
17
|
:is="tab.href ? (tab.disabled ? 'span' : 'a') : 'button'"
|
|
29
|
-
v-else
|
|
30
18
|
:id="tab.id"
|
|
31
19
|
ref="tab"
|
|
32
20
|
:href="tab.href ? (!tab.disabled ? tab.href : null) : null"
|
|
@@ -35,9 +23,14 @@
|
|
|
35
23
|
class="mc-tabs__link"
|
|
36
24
|
role="tab"
|
|
37
25
|
:aria-selected="tab.active ? 'true' : 'false'"
|
|
38
|
-
:class="
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
:class="setActiveClass(tab)"
|
|
27
|
+
@click="
|
|
28
|
+
manageTabs(
|
|
29
|
+
$event.target,
|
|
30
|
+
$event,
|
|
31
|
+
Object.assign({ index: index }, tab)
|
|
32
|
+
)
|
|
33
|
+
"
|
|
41
34
|
>
|
|
42
35
|
{{ tab.text }}
|
|
43
36
|
</component>
|
|
@@ -89,41 +82,38 @@ export default {
|
|
|
89
82
|
},
|
|
90
83
|
activeIndex: {
|
|
91
84
|
type: Number,
|
|
92
|
-
default:
|
|
85
|
+
default: 0,
|
|
93
86
|
},
|
|
94
87
|
},
|
|
95
88
|
|
|
96
89
|
data() {
|
|
97
90
|
return {
|
|
98
91
|
tablist: null,
|
|
99
|
-
localActiveIndex: null,
|
|
100
92
|
};
|
|
101
93
|
},
|
|
102
94
|
|
|
103
95
|
computed: {
|
|
104
96
|
setClasses() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
const classes = [
|
|
98
|
+
{
|
|
99
|
+
'mc-tabs--full': this.align === 'full',
|
|
100
|
+
'mc-tabs--full-centered': this.align === 'centered',
|
|
101
|
+
'mc-tabs--dropdown': this.type === 'dropdown',
|
|
102
|
+
'mc-tabs--no-shadow': !this.shadow,
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
return classes;
|
|
111
107
|
},
|
|
112
108
|
},
|
|
113
109
|
|
|
114
110
|
watch: {
|
|
115
111
|
activeIndex(newValue) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (selectedTab) {
|
|
122
|
-
this.setTabState(selectedTab);
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
immediate: true,
|
|
126
|
-
},
|
|
112
|
+
const tab = this.getTabFromIndex(newValue);
|
|
113
|
+
if (tab && this.tabs[newValue]) {
|
|
114
|
+
this.manageTabs(tab, null, Object.assign({index: newValue}, this.tabs[newValue]));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
127
117
|
},
|
|
128
118
|
|
|
129
119
|
mounted: function () {
|
|
@@ -132,16 +122,17 @@ export default {
|
|
|
132
122
|
this.tablist = this.$refs.tablist;
|
|
133
123
|
|
|
134
124
|
if (this.activeIndex) {
|
|
135
|
-
|
|
125
|
+
const tab = this.getTabFromIndex(this.activeIndex);
|
|
126
|
+
if (tab) {
|
|
127
|
+
this.manageTabs(tab);
|
|
128
|
+
}
|
|
136
129
|
} else {
|
|
137
|
-
const isActive = this.tabs.some(
|
|
138
|
-
|
|
139
|
-
Object.prototype.hasOwnProperty.call(tab, 'active') &&
|
|
140
|
-
tab.active === true
|
|
130
|
+
const isActive = this.tabs.some((tab) =>
|
|
131
|
+
Object.prototype.hasOwnProperty.call(tab, 'active')
|
|
141
132
|
);
|
|
142
|
-
|
|
143
133
|
if (!isActive) {
|
|
144
|
-
|
|
134
|
+
const firstTab = this.tablist.querySelector('.mc-tabs__link');
|
|
135
|
+
this.manageTabs(firstTab);
|
|
145
136
|
}
|
|
146
137
|
}
|
|
147
138
|
}
|
|
@@ -149,41 +140,40 @@ export default {
|
|
|
149
140
|
},
|
|
150
141
|
|
|
151
142
|
methods: {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
143
|
+
setActiveClass: function (tab) {
|
|
144
|
+
const tabClasses = [];
|
|
145
|
+
|
|
146
|
+
if (tab.active) {
|
|
147
|
+
tabClasses.push('mc-tabs__link--selected');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (tab.disabled) {
|
|
151
|
+
tabClasses.push('mc-tabs__link--disabled');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return tabClasses;
|
|
157
155
|
},
|
|
158
|
-
|
|
156
|
+
manageTabs: function (el, e, tab) {
|
|
157
|
+
if (tab && tab.disabled) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (e) {
|
|
161
|
+
this.$emit('tab-clicked', e.target, tab);
|
|
162
|
+
}
|
|
163
|
+
|
|
159
164
|
this.tablist.querySelectorAll('.mc-tabs__link').forEach((el) => {
|
|
160
165
|
el.classList.remove('mc-tabs__link--selected');
|
|
161
166
|
el.setAttribute('aria-selected', 'false');
|
|
162
167
|
});
|
|
163
168
|
|
|
164
|
-
|
|
165
|
-
|
|
169
|
+
el.classList.add('mc-tabs__link--selected');
|
|
170
|
+
el.setAttribute('aria-selected', 'true');
|
|
166
171
|
},
|
|
167
172
|
getTabFromIndex: function (index) {
|
|
168
|
-
if (
|
|
169
|
-
this.tablist &&
|
|
170
|
-
this.tablist.children[index] &&
|
|
171
|
-
this.tablist.children[index].children[0]
|
|
172
|
-
) {
|
|
173
|
+
if (this.tablist && this.tablist.children[index] && this.tablist.children[index].children[0]) {
|
|
173
174
|
return this.tablist.children[index].children[0];
|
|
174
175
|
}
|
|
175
176
|
},
|
|
176
|
-
onTabClicked(e, tab, index) {
|
|
177
|
-
if (tab && tab.disabled) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (typeof this.activeIndex !== 'number') {
|
|
182
|
-
this.localActiveIndex = index;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
this.$emit('tab-clicked', e.target, Object.assign({ index: index }, tab));
|
|
186
|
-
},
|
|
187
177
|
},
|
|
188
178
|
};
|
|
189
179
|
</script>
|
package/src/index.js
CHANGED
|
@@ -37,7 +37,7 @@ export { MHero } from './components/hero';
|
|
|
37
37
|
export { MIcon } from './components/icon';
|
|
38
38
|
export { MLayer } from './components/layer';
|
|
39
39
|
export { MLink } from './components/link';
|
|
40
|
-
export { MListBox
|
|
40
|
+
export { MListBox } from './components/listbox';
|
|
41
41
|
export { MLoader } from './components/loader';
|
|
42
42
|
export { MModal } from './components/modal';
|
|
43
43
|
export { MNotification } from './components/notification';
|