@mozaic-ds/vue 0.23.0-beta.1 → 1.0.0-beta.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/dist/mozaic-vue.adeo.css +26 -26
- package/dist/mozaic-vue.adeo.umd.js +2547 -4365
- package/dist/mozaic-vue.common.js +2547 -4365
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +2547 -4365
- 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 +92 -133
- 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/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 +0 -1
- 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 +54 -71
- package/src/components/textinput/MTextInputField.vue +1 -0
- package/src/index.js +1 -1
- package/types/index.d.ts +0 -2
- package/src/components/listbox/MListBoxActions.vue +0 -251
|
@@ -7,48 +7,35 @@
|
|
|
7
7
|
aria-labelledby="listbox"
|
|
8
8
|
:class="{ 'is-open': open, 'mc-listbox--multi': multiple }"
|
|
9
9
|
>
|
|
10
|
-
<li
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
v-model="localValue"
|
|
27
|
-
class="mc-checkbox__input mc-listbox__input"
|
|
28
|
-
type="checkbox"
|
|
29
|
-
:value="item[dataValueExpr]"
|
|
30
|
-
@change="onChange"
|
|
10
|
+
<li
|
|
11
|
+
v-for="item in selectableItems"
|
|
12
|
+
:key="item.id"
|
|
13
|
+
class="mc-listbox__item"
|
|
14
|
+
@change="$emit('update:itemSelected', item)"
|
|
15
|
+
@click.self="updateList(item.id, item.text, !item.selected, true)"
|
|
16
|
+
>
|
|
17
|
+
<slot name="item" :item="item">
|
|
18
|
+
<span class="mc-listbox__text">{{ item.text }} </span>
|
|
19
|
+
</slot>
|
|
20
|
+
<m-checkbox
|
|
21
|
+
v-if="multiple"
|
|
22
|
+
:id="`checkbox-dropdown-${item.id}`"
|
|
23
|
+
v-model="selectableItems.find((elem) => elem.id === item.id).selected"
|
|
24
|
+
class="mc-listbox__input"
|
|
25
|
+
@change="updateList(item.id, item.text, !item.selected, $e)"
|
|
31
26
|
/>
|
|
32
27
|
</li>
|
|
33
28
|
</ul>
|
|
34
|
-
<div v-else class="mc-
|
|
29
|
+
<div v-else class="mc-list-box__empty">
|
|
35
30
|
{{ emptySearchLabel }}
|
|
36
31
|
</div>
|
|
37
32
|
</template>
|
|
38
|
-
|
|
39
33
|
<script>
|
|
40
|
-
import
|
|
41
|
-
|
|
34
|
+
import MCheckbox from '../checkbox/MCheckbox.vue';
|
|
42
35
|
export default {
|
|
43
36
|
name: 'MListbox',
|
|
44
37
|
|
|
45
|
-
components: {
|
|
46
|
-
MIcon,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
model: {
|
|
50
|
-
event: 'change',
|
|
51
|
-
},
|
|
38
|
+
components: { MCheckbox },
|
|
52
39
|
|
|
53
40
|
props: {
|
|
54
41
|
open: {
|
|
@@ -71,208 +58,49 @@ export default {
|
|
|
71
58
|
type: Boolean,
|
|
72
59
|
default: false,
|
|
73
60
|
},
|
|
74
|
-
dataKeyExpr: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: 'id',
|
|
77
|
-
},
|
|
78
|
-
dataTextExpr: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: 'text',
|
|
81
|
-
},
|
|
82
|
-
dataValueExpr: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: 'text',
|
|
85
|
-
},
|
|
86
|
-
value: {
|
|
87
|
-
type: [Array, String],
|
|
88
|
-
default: undefined,
|
|
89
|
-
},
|
|
90
61
|
},
|
|
91
|
-
|
|
92
62
|
data() {
|
|
93
63
|
return {
|
|
94
|
-
|
|
95
|
-
localValue: [],
|
|
64
|
+
selectableItems: null,
|
|
96
65
|
selected: [],
|
|
97
|
-
uuid: null,
|
|
98
|
-
inputBaseId: 'listboxInput',
|
|
99
66
|
};
|
|
100
67
|
},
|
|
101
|
-
|
|
102
68
|
watch: {
|
|
103
69
|
items: {
|
|
104
70
|
handler: function (val) {
|
|
105
|
-
this.
|
|
106
|
-
},
|
|
107
|
-
immediate: true,
|
|
108
|
-
},
|
|
109
|
-
value: {
|
|
110
|
-
handler: function (value) {
|
|
111
|
-
this.localValue = value;
|
|
112
|
-
},
|
|
113
|
-
immediate: true,
|
|
114
|
-
},
|
|
115
|
-
localValue: {
|
|
116
|
-
handler: function (localValue) {
|
|
117
|
-
const inputs = this.$refs.input;
|
|
118
|
-
if (!this.multiple && inputs) {
|
|
119
|
-
const selectedValue = Array.from(localValue);
|
|
120
|
-
|
|
121
|
-
inputs.forEach(function (input) {
|
|
122
|
-
const listItem = input.closest('.mc-listbox__item');
|
|
123
|
-
|
|
124
|
-
if (input.value == selectedValue[0]) {
|
|
125
|
-
listItem.classList.add('is-checked');
|
|
126
|
-
} else {
|
|
127
|
-
listItem.classList.remove('is-checked');
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
71
|
+
this.selectableItems = val;
|
|
131
72
|
},
|
|
132
73
|
immediate: true,
|
|
133
74
|
},
|
|
134
75
|
},
|
|
135
|
-
|
|
136
|
-
mounted() {
|
|
137
|
-
this.uuid = Math.random();
|
|
138
|
-
},
|
|
139
|
-
|
|
140
76
|
methods: {
|
|
141
|
-
|
|
77
|
+
updateList(id, text, value, isCheckboxUpdate) {
|
|
142
78
|
if (!this.multiple) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this
|
|
79
|
+
this.$emit('update:itemSelected', [{ id, selected: value, text }]);
|
|
80
|
+
|
|
81
|
+
this.$emit('close-list-box');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (
|
|
86
|
+
isCheckboxUpdate &&
|
|
87
|
+
this.selectableItems.find((item) => item.id === id)
|
|
88
|
+
) {
|
|
89
|
+
this.selectableItems.find((item) => item.id === id).selected = value;
|
|
146
90
|
}
|
|
147
91
|
|
|
148
|
-
|
|
92
|
+
if (value) {
|
|
93
|
+
this.selected = [...this.selected, { id, selected: value, text }];
|
|
94
|
+
} else {
|
|
95
|
+
this.selected = this.selected.filter((item) => item.id !== id);
|
|
96
|
+
}
|
|
97
|
+
this.$emit('update:itemSelected', this.selectableItems);
|
|
149
98
|
},
|
|
150
99
|
},
|
|
151
100
|
};
|
|
152
101
|
</script>
|
|
153
102
|
|
|
154
103
|
<style lang="scss">
|
|
155
|
-
@import 'settings-tools/
|
|
156
|
-
|
|
157
|
-
.mc-listbox {
|
|
158
|
-
$parent: get-parent-selector(&);
|
|
159
|
-
|
|
160
|
-
@include unstyle-list();
|
|
161
|
-
|
|
162
|
-
background-color: $color-grey-000;
|
|
163
|
-
border: 1px solid $color-grey-600;
|
|
164
|
-
border-radius: 3px;
|
|
165
|
-
position: absolute;
|
|
166
|
-
overflow-y: auto;
|
|
167
|
-
margin-top: 5px;
|
|
168
|
-
margin-bottom: 0;
|
|
169
|
-
max-height: 13.8125rem; // =221px
|
|
170
|
-
min-width: 17.875rem; // =286px
|
|
171
|
-
opacity: 0;
|
|
172
|
-
visibility: hidden;
|
|
173
|
-
width: 100%;
|
|
174
|
-
|
|
175
|
-
&.is-open {
|
|
176
|
-
opacity: 1;
|
|
177
|
-
visibility: visible;
|
|
178
|
-
z-index: 11;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&::-webkit-scrollbar {
|
|
182
|
-
background-color: $color-grey-100;
|
|
183
|
-
width: $mu025;
|
|
184
|
-
|
|
185
|
-
&-thumb {
|
|
186
|
-
background: $color-grey-600;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
&__item {
|
|
191
|
-
align-items: center;
|
|
192
|
-
display: flex;
|
|
193
|
-
gap: $mu050;
|
|
194
|
-
min-height: $mu300;
|
|
195
|
-
padding-left: $mu075;
|
|
196
|
-
padding-right: $mu075;
|
|
197
|
-
position: relative;
|
|
198
|
-
justify-content: space-between;
|
|
199
|
-
|
|
200
|
-
&:not(:last-child) {
|
|
201
|
-
border-bottom: 1px solid $color-grey-300;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
&:hover {
|
|
205
|
-
background-color: $color-grey-100;
|
|
206
|
-
box-shadow: inset 9px 0 0 -7px $color-grey-900;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
&__flag,
|
|
211
|
-
&__icon {
|
|
212
|
-
width: $mu200;
|
|
213
|
-
height: $mu200;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
&__flag {
|
|
217
|
-
@include set-font-scale('07', 'm');
|
|
218
|
-
|
|
219
|
-
text-align: center;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
&__empty {
|
|
223
|
-
@include set-font-scale('04', 'm');
|
|
224
|
-
|
|
225
|
-
color: $color-fields-error;
|
|
226
|
-
display: inline-block;
|
|
227
|
-
margin-top: $mu025;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
&__label {
|
|
231
|
-
cursor: pointer;
|
|
232
|
-
margin-right: auto;
|
|
233
|
-
|
|
234
|
-
&::after {
|
|
235
|
-
content: '';
|
|
236
|
-
position: absolute;
|
|
237
|
-
inset: 0;
|
|
238
|
-
z-index: 2;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.is-focus {
|
|
243
|
-
background-color: $color-grey-100;
|
|
244
|
-
box-shadow: inset 9px 0 0 -7px $color-grey-900;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.is-disabled {
|
|
248
|
-
cursor: not-allowed;
|
|
249
|
-
box-shadow: none;
|
|
250
|
-
background-color: $color-grey-200;
|
|
251
|
-
color: $color-grey-600;
|
|
252
|
-
pointer-events: none;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
&--left {
|
|
256
|
-
right: 0;
|
|
257
|
-
transform: translateX(-100%);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
&:not(.mc-listbox--multi) {
|
|
261
|
-
.is-checked {
|
|
262
|
-
background-size: $mu150;
|
|
263
|
-
background-image: url(inline-icons(
|
|
264
|
-
'notification-available-24',
|
|
265
|
-
$color-grey-900
|
|
266
|
-
));
|
|
267
|
-
background-repeat: no-repeat;
|
|
268
|
-
background-position: right $mu075 center;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
#{$parent} {
|
|
272
|
-
&__input {
|
|
273
|
-
@include visually-hidden();
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
104
|
+
@import 'settings-tools/_all-settings';
|
|
105
|
+
@import 'components/_c.listbox';
|
|
278
106
|
</style>
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import MListBox from './MListBox.vue';
|
|
2
|
-
import MListBoxActions from './MListBoxActions.vue';
|
|
3
2
|
|
|
4
3
|
MListBox.install = function (Vue) {
|
|
5
4
|
Vue.component(MListBox.name, MListBox);
|
|
6
5
|
};
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
Vue.component(MListBoxActions.name, MListBoxActions);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { MListBox, MListBoxActions };
|
|
7
|
+
export { MListBox };
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
icon-position="left"
|
|
8
8
|
:aria-label="decrementAriaLabel"
|
|
9
9
|
:aria-controls="id"
|
|
10
|
-
:disabled="
|
|
10
|
+
:disabled="currentValue === valuemin"
|
|
11
11
|
:size="small ? 's' : null"
|
|
12
12
|
tabindex="-1"
|
|
13
|
-
type="button"
|
|
14
13
|
@click="decrement()"
|
|
15
14
|
/>
|
|
16
15
|
|
|
@@ -26,11 +25,9 @@
|
|
|
26
25
|
:aria-valuemax="valuemax"
|
|
27
26
|
:placeholder="placeholder"
|
|
28
27
|
:size="small ? 's' : null"
|
|
29
|
-
:disabled="disabled"
|
|
30
28
|
role="spinbutton"
|
|
31
29
|
@input="handle"
|
|
32
30
|
@keypress="integerOnly && formatValue($event)"
|
|
33
|
-
v-on="$listeners"
|
|
34
31
|
/>
|
|
35
32
|
|
|
36
33
|
<m-button
|
|
@@ -40,10 +37,9 @@
|
|
|
40
37
|
icon-position="right"
|
|
41
38
|
:aria-label="incrementAriaLabel"
|
|
42
39
|
:aria-controls="id"
|
|
43
|
-
:disabled="
|
|
40
|
+
:disabled="currentValue === valuemax"
|
|
44
41
|
:size="small ? 's' : null"
|
|
45
42
|
tabindex="-1"
|
|
46
|
-
type="button"
|
|
47
43
|
@click="increment()"
|
|
48
44
|
/>
|
|
49
45
|
</div>
|
|
@@ -106,10 +102,6 @@ export default {
|
|
|
106
102
|
type: Boolean,
|
|
107
103
|
default: false,
|
|
108
104
|
},
|
|
109
|
-
disabled: {
|
|
110
|
-
type: Boolean,
|
|
111
|
-
default: false,
|
|
112
|
-
},
|
|
113
105
|
},
|
|
114
106
|
|
|
115
107
|
data() {
|
|
@@ -1,58 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<nav
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
'mc-stepper--compact': compact,
|
|
6
|
-
'mc-stepper--shrinked': steps.length > 3,
|
|
7
|
-
}"
|
|
8
|
-
:aria-label="accessibilityLabels.stepperDescription"
|
|
9
|
-
>
|
|
10
|
-
<ol class="mc-stepper__list">
|
|
2
|
+
<nav class='mc-stepper' :class="{ 'mc-stepper--compact': compact, 'mc-stepper--shrinked': steps.length > 3}"
|
|
3
|
+
:aria-label='accessibilityLabels.stepperDescription'>
|
|
4
|
+
<ol class='mc-stepper__list'>
|
|
11
5
|
<li
|
|
12
|
-
v-for=
|
|
13
|
-
:key=
|
|
14
|
-
class=
|
|
6
|
+
v-for='(step, idx) in steps'
|
|
7
|
+
:key='`mc-stepper__item-${idx}`'
|
|
8
|
+
class='mc-stepper__item'
|
|
15
9
|
:class="{
|
|
16
10
|
'mc-stepper__item--validated': isStepValidated(idx),
|
|
17
11
|
'mc-stepper__item--current': step.isCurrent,
|
|
18
12
|
}"
|
|
19
13
|
:aria-current="step.isCurrent ? 'step' : false"
|
|
20
|
-
:aria-label=
|
|
21
|
-
:style=
|
|
14
|
+
:aria-label='stepDescription(step,idx)'
|
|
15
|
+
:style='`--steps: ${ steps.length }; --current: ${ idx +1 };`'
|
|
22
16
|
@click="isStepValidated(idx) && $emit('step-changed', step)"
|
|
23
17
|
>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
33
|
-
<div class="mc-stepper__detail">
|
|
34
|
-
<span class="mc-stepper__title"
|
|
35
|
-
>{{ idx + 1 }} / {{ steps.length }}</span
|
|
36
|
-
>
|
|
37
|
-
<span class="mc-stepper__label">{{ step.label }}</span>
|
|
38
|
-
</div>
|
|
39
|
-
</a>
|
|
40
|
-
<template v-else>
|
|
41
|
-
<div class="mc-stepper__indicator" aria-hidden="true">
|
|
42
|
-
<m-icon
|
|
43
|
-
v-if="isStepValidated(idx)"
|
|
44
|
-
name="NotificationAvailable16"
|
|
45
|
-
class="mc-stepper__icon"
|
|
46
|
-
/>
|
|
47
|
-
<span v-else-if="step.isCurrent">{{ idx + 1 }}</span>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="mc-stepper__detail">
|
|
50
|
-
<span class="mc-stepper__title"
|
|
51
|
-
>{{ idx + 1 }} / {{ steps.length }}</span
|
|
52
|
-
>
|
|
53
|
-
<span class="mc-stepper__label">{{ step.label }}</span>
|
|
54
|
-
</div>
|
|
55
|
-
</template>
|
|
18
|
+
<div class='mc-stepper__indicator' aria-hidden='true'>
|
|
19
|
+
<m-icon v-if='isStepValidated(idx)' name='NotificationAvailable16' class='mc-stepper__icon' />
|
|
20
|
+
<span v-else-if='step.isCurrent'>{{ idx + 1 }}</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class='mc-stepper__detail'>
|
|
23
|
+
<span class='mc-stepper__title'>{{ idx + 1 }} / {{ steps.length }}</span>
|
|
24
|
+
<span class='mc-stepper__label'>{{ step.label }}</span>
|
|
25
|
+
</div>
|
|
56
26
|
</li>
|
|
57
27
|
</ol>
|
|
58
28
|
</nav>
|
|
@@ -64,48 +34,37 @@ import MIcon from '../icon/MIcon.vue';
|
|
|
64
34
|
export default {
|
|
65
35
|
name: 'MStepper',
|
|
66
36
|
components: {
|
|
67
|
-
MIcon
|
|
37
|
+
MIcon
|
|
68
38
|
},
|
|
69
39
|
props: {
|
|
70
40
|
steps: {
|
|
71
41
|
type: Array,
|
|
72
|
-
required: true
|
|
42
|
+
required: true
|
|
73
43
|
},
|
|
74
44
|
compact: {
|
|
75
45
|
type: Boolean,
|
|
76
|
-
default: false
|
|
46
|
+
default: false
|
|
77
47
|
},
|
|
78
48
|
accessibilityLabels: {
|
|
79
49
|
type: Object,
|
|
80
|
-
required: true
|
|
81
|
-
}
|
|
50
|
+
required: true
|
|
51
|
+
}
|
|
82
52
|
},
|
|
83
53
|
methods: {
|
|
84
54
|
isStepValidated(index) {
|
|
85
|
-
return index < this.steps.findIndex(
|
|
55
|
+
return index < this.steps.findIndex(step => step.isCurrent);
|
|
86
56
|
},
|
|
87
57
|
stepDescription(step, index) {
|
|
88
|
-
return (
|
|
89
|
-
'#' +
|
|
90
|
-
(index + 1) +
|
|
91
|
-
' ' +
|
|
92
|
-
step.label +
|
|
93
|
-
', ' +
|
|
94
|
-
this.stepStateLabel(step, index)
|
|
95
|
-
);
|
|
58
|
+
return '#' + (index + 1) + ' ' + step.label + ', ' + this.stepStateLabel(step,index);
|
|
96
59
|
},
|
|
97
60
|
stepStateLabel(step, index) {
|
|
98
|
-
return this.isStepValidated(index)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
? this.accessibilityLabels.currentLabel
|
|
102
|
-
: this.accessibilityLabels.disabledLabel;
|
|
103
|
-
},
|
|
104
|
-
},
|
|
61
|
+
return this.isStepValidated(index) ? this.accessibilityLabels.validatedLabel : step.isCurrent ? this.accessibilityLabels.currentLabel : this.accessibilityLabels.disabledLabel;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
105
64
|
};
|
|
106
65
|
</script>
|
|
107
66
|
|
|
108
|
-
<style lang=
|
|
67
|
+
<style lang='scss' scoped>
|
|
109
68
|
@import 'settings-tools/_all-settings';
|
|
110
69
|
@import 'components/_c.stepper';
|
|
111
70
|
</style>
|