@mozaic-ds/vue 0.28.2 → 0.29.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 +4 -4
- package/dist/mozaic-vue.adeo.umd.js +233 -127
- package/dist/mozaic-vue.common.js +233 -127
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +233 -127
- 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 +5 -5
- package/src/components/passwordinput/MPasswordInput.vue +1 -0
- package/src/components/phonenumber/MPhoneNumber.vue +1 -0
- package/src/components/tabs/MTab.vue +60 -50
- package/src/components/textarea/MTextArea.vue +1 -0
- package/src/components/textinput/MTextInputField.vue +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozaic-ds/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.1-beta.0",
|
|
4
4
|
"description": "Vue.js implementation of Mozaic Design System",
|
|
5
5
|
"author": "Adeo - Mozaic Design System",
|
|
6
6
|
"scripts": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"postinstall.js"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@mozaic-ds/css-dev-tools": "
|
|
27
|
-
"@mozaic-ds/icons": "
|
|
28
|
-
"@mozaic-ds/styles": "
|
|
29
|
-
"@mozaic-ds/web-fonts": "
|
|
26
|
+
"@mozaic-ds/css-dev-tools": "1.44.0",
|
|
27
|
+
"@mozaic-ds/icons": "1.45.0",
|
|
28
|
+
"@mozaic-ds/styles": "1.45.1",
|
|
29
|
+
"@mozaic-ds/web-fonts": "1.22.0",
|
|
30
30
|
"core-js": "^3.25.5",
|
|
31
31
|
"libphonenumber-js": "^1.10.14",
|
|
32
32
|
"vue": "^2.6.14",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
v-bind="tab.attrs"
|
|
20
20
|
:to="tab.to"
|
|
21
21
|
class="mc-tabs__element"
|
|
22
|
-
:class="
|
|
22
|
+
:class="setActiveClass(tab)"
|
|
23
23
|
active-class="mc-tabs__element--selected"
|
|
24
24
|
>
|
|
25
25
|
<span class="mc-tabs__text">{{ tab.text }}</span>
|
|
@@ -35,9 +35,14 @@
|
|
|
35
35
|
class="mc-tabs__element"
|
|
36
36
|
role="tab"
|
|
37
37
|
:aria-selected="tab.active ? 'true' : 'false'"
|
|
38
|
-
:class="
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
:class="setActiveClass(tab)"
|
|
39
|
+
@click="
|
|
40
|
+
manageTabs(
|
|
41
|
+
$event.target,
|
|
42
|
+
$event,
|
|
43
|
+
Object.assign({ index: index }, tab)
|
|
44
|
+
)
|
|
45
|
+
"
|
|
41
46
|
>
|
|
42
47
|
<span class="mc-tabs__text">{{ tab.text }}</span>
|
|
43
48
|
</component>
|
|
@@ -89,40 +94,41 @@ export default {
|
|
|
89
94
|
},
|
|
90
95
|
activeIndex: {
|
|
91
96
|
type: Number,
|
|
92
|
-
default:
|
|
97
|
+
default: 0,
|
|
93
98
|
},
|
|
94
99
|
},
|
|
95
100
|
|
|
96
101
|
data() {
|
|
97
102
|
return {
|
|
98
103
|
tablist: null,
|
|
99
|
-
localActiveIndex: null,
|
|
100
104
|
};
|
|
101
105
|
},
|
|
102
106
|
|
|
103
107
|
computed: {
|
|
104
108
|
setClasses() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
const classes = [
|
|
110
|
+
{
|
|
111
|
+
'mc-tabs--full': this.align === 'full',
|
|
112
|
+
'mc-tabs--full-centered': this.align === 'centered',
|
|
113
|
+
'mc-tabs--dropdown': this.type === 'dropdown',
|
|
114
|
+
'mc-tabs--no-shadow': !this.shadow,
|
|
115
|
+
},
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
return classes;
|
|
111
119
|
},
|
|
112
120
|
},
|
|
113
121
|
|
|
114
122
|
watch: {
|
|
115
123
|
activeIndex(newValue) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
immediate: true,
|
|
124
|
+
const tab = this.getTabFromIndex(newValue);
|
|
125
|
+
if (tab && this.tabs[newValue]) {
|
|
126
|
+
this.manageTabs(
|
|
127
|
+
tab,
|
|
128
|
+
null,
|
|
129
|
+
Object.assign({ index: newValue }, this.tabs[newValue])
|
|
130
|
+
);
|
|
131
|
+
}
|
|
126
132
|
},
|
|
127
133
|
},
|
|
128
134
|
|
|
@@ -132,16 +138,17 @@ export default {
|
|
|
132
138
|
this.tablist = this.$refs.tablist;
|
|
133
139
|
|
|
134
140
|
if (this.activeIndex) {
|
|
135
|
-
|
|
141
|
+
const tab = this.getTabFromIndex(this.activeIndex);
|
|
142
|
+
if (tab) {
|
|
143
|
+
this.manageTabs(tab);
|
|
144
|
+
}
|
|
136
145
|
} else {
|
|
137
|
-
const isActive = this.tabs.some(
|
|
138
|
-
(tab)
|
|
139
|
-
Object.prototype.hasOwnProperty.call(tab, 'active') &&
|
|
140
|
-
tab.active === true
|
|
146
|
+
const isActive = this.tabs.some((tab) =>
|
|
147
|
+
Object.prototype.hasOwnProperty.call(tab, 'active')
|
|
141
148
|
);
|
|
142
|
-
|
|
143
149
|
if (!isActive) {
|
|
144
|
-
|
|
150
|
+
const firstTab = this.tablist.querySelector('.mc-tabs__element');
|
|
151
|
+
this.manageTabs(firstTab);
|
|
145
152
|
}
|
|
146
153
|
}
|
|
147
154
|
}
|
|
@@ -149,20 +156,34 @@ export default {
|
|
|
149
156
|
},
|
|
150
157
|
|
|
151
158
|
methods: {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
159
|
+
setActiveClass: function (tab) {
|
|
160
|
+
const tabClasses = [];
|
|
161
|
+
|
|
162
|
+
if (tab.active) {
|
|
163
|
+
tabClasses.push('mc-tabs__element--selected');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (tab.disabled) {
|
|
167
|
+
tabClasses.push('mc-tabs__element--disabled');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return tabClasses;
|
|
157
171
|
},
|
|
158
|
-
|
|
172
|
+
manageTabs: function (el, e, tab) {
|
|
173
|
+
if (tab && tab.disabled) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (e) {
|
|
177
|
+
this.$emit('tab-clicked', e.currentTarget, tab);
|
|
178
|
+
}
|
|
179
|
+
|
|
159
180
|
this.tablist.querySelectorAll('.mc-tabs__element').forEach((el) => {
|
|
160
181
|
el.classList.remove('mc-tabs__element--selected');
|
|
161
182
|
el.setAttribute('aria-selected', 'false');
|
|
162
183
|
});
|
|
163
184
|
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
el.classList.add('mc-tabs__element--selected');
|
|
186
|
+
el.setAttribute('aria-selected', 'true');
|
|
166
187
|
},
|
|
167
188
|
getTabFromIndex: function (index) {
|
|
168
189
|
if (
|
|
@@ -173,22 +194,11 @@ export default {
|
|
|
173
194
|
return this.tablist.children[index].children[0];
|
|
174
195
|
}
|
|
175
196
|
},
|
|
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
197
|
},
|
|
188
198
|
};
|
|
189
199
|
</script>
|
|
190
200
|
|
|
191
201
|
<style lang="scss">
|
|
192
|
-
@import 'settings-tools/
|
|
193
|
-
@import 'components/
|
|
202
|
+
@import 'settings-tools/all-settings';
|
|
203
|
+
@import 'components/c.tabs';
|
|
194
204
|
</style>
|