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