@mozaic-ds/vue 0.8.2-beta.0 → 0.11.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/CHANGELOG.md +62 -0
- package/README.md +2 -3
- package/dist/mozaic-vue.adeo.css +1 -1
- package/dist/mozaic-vue.adeo.umd.js +404 -240
- package/dist/mozaic-vue.common.js +404 -240
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +404 -240
- package/dist/mozaic-vue.umd.js.map +1 -1
- package/dist/mozaic-vue.umd.min.js +1 -1
- package/dist/mozaic-vue.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/components/button/MButton.vue +6 -1
- package/src/components/datatable/MDataTable.vue +34 -10
- package/src/components/fileuploader/MFileResult.vue +5 -0
- package/src/components/fileuploader/MFileUploader.vue +20 -2
- package/src/components/pagination/MPagination.vue +8 -1
- package/src/components/quantityselector/MQuantitySelector.vue +32 -4
- package/src/components/radio/MRadio.vue +5 -1
- package/src/components/radio/MRadioGroup.vue +1 -1
- package/src/components/select/MSelect.vue +3 -1
- package/src/components/textinput/MTextInput.vue +2 -10
- package/dist/img/flags.1147a273.png +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozaic-ds/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"serve": "vue-cli-service serve",
|
|
6
6
|
"build": "vue-cli-service build ./src/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@mozaic-ds/css-dev-tools": "^1.20.0",
|
|
17
17
|
"@mozaic-ds/icons": "^1.20.0",
|
|
18
|
-
"@mozaic-ds/styles": "^1.
|
|
19
|
-
"@mozaic-ds/web-fonts": "^1.
|
|
18
|
+
"@mozaic-ds/styles": "^1.23.0",
|
|
19
|
+
"@mozaic-ds/web-fonts": "^1.22.0",
|
|
20
20
|
"core-js": "^3.18.3",
|
|
21
21
|
"libphonenumber-js": "^1.9.37",
|
|
22
22
|
"postcss-scss": "^4.0.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a v-if="href" :href="href" class="mc-button" :class="setClasses">
|
|
2
|
+
<a v-if="href" :href="href" class="mc-button" :class="setClasses" :aria-label="ariaLabel">
|
|
3
3
|
<m-icon
|
|
4
4
|
v-if="icon && iconPosition === 'left'"
|
|
5
5
|
:id="`mc-button__${iconPosition}-icon-${id}`"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
class="mc-button"
|
|
22
22
|
:disabled="disabled"
|
|
23
23
|
:class="setClasses"
|
|
24
|
+
:aria-label="ariaLabel"
|
|
24
25
|
@click="$emit('click', $event)"
|
|
25
26
|
>
|
|
26
27
|
<m-icon
|
|
@@ -120,6 +121,10 @@ export default {
|
|
|
120
121
|
default: 'left',
|
|
121
122
|
validator: (value) => ['left', 'right'].includes(value),
|
|
122
123
|
},
|
|
124
|
+
ariaLabel: {
|
|
125
|
+
type: String,
|
|
126
|
+
default: null,
|
|
127
|
+
},
|
|
123
128
|
},
|
|
124
129
|
|
|
125
130
|
data() {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</thead>
|
|
36
36
|
<tbody>
|
|
37
37
|
<tr
|
|
38
|
-
v-for="item in getSource"
|
|
38
|
+
v-for="(item, rowIndex) in getSource"
|
|
39
39
|
:key="item[dataKeyExpr]"
|
|
40
40
|
:class="rowClasses(item)"
|
|
41
41
|
>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
allowRowClick && onRowClick({ event: $event, item: item })
|
|
50
50
|
"
|
|
51
51
|
>
|
|
52
|
-
<slot :name="`item.${header.dataFieldExpr}`" :item="item">
|
|
52
|
+
<slot :name="`item.${header.dataFieldExpr}`" :item="item" :index="rowIndex">
|
|
53
53
|
{{ getItemValue(item, header.dataFieldExpr) }}
|
|
54
54
|
</slot>
|
|
55
55
|
</td>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</tbody>
|
|
63
63
|
</table>
|
|
64
64
|
</div>
|
|
65
|
-
<div v-if="pagingOptions.enabled" class="mc-data-table__footer">
|
|
65
|
+
<div v-if="pagingOptions.enabled && total != null" class="mc-data-table__footer">
|
|
66
66
|
<div class="mc-data-table__footer__item-per-page">
|
|
67
67
|
<m-select
|
|
68
68
|
:id="'itemPerPage'"
|
|
@@ -70,7 +70,13 @@
|
|
|
70
70
|
:options="getPageSizes"
|
|
71
71
|
:value="getPageValue"
|
|
72
72
|
@change="onPageSizeChanged"
|
|
73
|
-
|
|
73
|
+
>
|
|
74
|
+
<template #text="{ option }">
|
|
75
|
+
<slot name="pager.text" :pager="option">
|
|
76
|
+
{{ option.text }}
|
|
77
|
+
</slot>
|
|
78
|
+
</template>
|
|
79
|
+
</m-select>
|
|
74
80
|
</div>
|
|
75
81
|
<div
|
|
76
82
|
v-if="pagingOptions.displayTotal"
|
|
@@ -86,7 +92,13 @@
|
|
|
86
92
|
:page-label="pagingOptions.pageLabel"
|
|
87
93
|
:value="pagingOptions.index"
|
|
88
94
|
@on-update-page="onUpdatePage"
|
|
89
|
-
|
|
95
|
+
>
|
|
96
|
+
<template #text="{ option }">
|
|
97
|
+
<slot name="paging.text" :paging="option">
|
|
98
|
+
{{ option.text }}
|
|
99
|
+
</slot>
|
|
100
|
+
</template>
|
|
101
|
+
</m-pagination>
|
|
90
102
|
</div>
|
|
91
103
|
</div>
|
|
92
104
|
</div>
|
|
@@ -165,7 +177,7 @@ const Pager = {
|
|
|
165
177
|
const Paging = {
|
|
166
178
|
defaultOptions: {
|
|
167
179
|
enabled: false,
|
|
168
|
-
|
|
180
|
+
text: 'sur',
|
|
169
181
|
index: 1,
|
|
170
182
|
},
|
|
171
183
|
};
|
|
@@ -200,7 +212,10 @@ export default {
|
|
|
200
212
|
default: 'id',
|
|
201
213
|
},
|
|
202
214
|
|
|
203
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* Get or set the headers informations.
|
|
217
|
+
* @type {{ caption: string, dataFieldExpr: string, sortFieldExpr: string, allowSorting: boolean, sortOrder: 'asc' | 'desc' | null }[] }
|
|
218
|
+
*/
|
|
204
219
|
headers: {
|
|
205
220
|
type: Array,
|
|
206
221
|
default: () => [],
|
|
@@ -221,13 +236,19 @@ export default {
|
|
|
221
236
|
default: () => [],
|
|
222
237
|
},
|
|
223
238
|
|
|
224
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* Get or set pager informations.
|
|
241
|
+
* @type {{ sizes: number[], text: string, value: number }}
|
|
242
|
+
*/
|
|
225
243
|
pager: {
|
|
226
244
|
type: Object,
|
|
227
245
|
default: () => ({}),
|
|
228
246
|
},
|
|
229
247
|
|
|
230
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* Get or set paging informations.
|
|
250
|
+
* @type {{ enabled: boolean, text: string, index: number }}
|
|
251
|
+
*/
|
|
231
252
|
paging: {
|
|
232
253
|
type: Object,
|
|
233
254
|
default: () => ({}),
|
|
@@ -245,7 +266,10 @@ export default {
|
|
|
245
266
|
default: false,
|
|
246
267
|
},
|
|
247
268
|
|
|
248
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* Get or set the sorting informations.
|
|
271
|
+
* @type {{ mode:'none' | 'single' | 'multiple'}}
|
|
272
|
+
*/
|
|
249
273
|
sorting: {
|
|
250
274
|
type: Object,
|
|
251
275
|
default: () => ({}),
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<button
|
|
16
16
|
type="button"
|
|
17
17
|
class="mc-fileuploader__delete"
|
|
18
|
+
:aria-label="removeLabel"
|
|
18
19
|
@click="deleteFile(file)"
|
|
19
20
|
></button>
|
|
20
21
|
<div
|
|
@@ -48,6 +49,10 @@ export default {
|
|
|
48
49
|
type: Number,
|
|
49
50
|
default: null,
|
|
50
51
|
},
|
|
52
|
+
removeLabel: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: '',
|
|
55
|
+
},
|
|
51
56
|
},
|
|
52
57
|
watch: {
|
|
53
58
|
files: {
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
<div class="mc-fileuploader">
|
|
3
3
|
<input
|
|
4
4
|
:id="id"
|
|
5
|
+
ref="fileUpload"
|
|
5
6
|
type="file"
|
|
6
7
|
class="mc-fileuploader__input"
|
|
7
8
|
:accept="accept"
|
|
8
9
|
:multiple="multiple"
|
|
10
|
+
:disabled="disabled"
|
|
9
11
|
@change="onChange"
|
|
10
12
|
/>
|
|
11
13
|
<label :for="id" class="mc-fileuploader__label">
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
:files="files"
|
|
19
21
|
:allowed-extensions="allowedExtensions"
|
|
20
22
|
:max-size="maxSize"
|
|
23
|
+
:remove-label="removeLabel"
|
|
21
24
|
@file-removed="deleteFile"
|
|
22
25
|
@has-invalid-files="hasInvalidFiles"
|
|
23
26
|
>
|
|
@@ -29,6 +32,7 @@
|
|
|
29
32
|
v-if="uploadedFiles.length > 0"
|
|
30
33
|
:files="uploadedFiles"
|
|
31
34
|
:allowed-extensions="allowedExtensions"
|
|
35
|
+
:remove-label="removeLabel"
|
|
32
36
|
@file-removed="deleteRemoteFile"
|
|
33
37
|
/>
|
|
34
38
|
</div>
|
|
@@ -79,6 +83,14 @@ export default {
|
|
|
79
83
|
return [];
|
|
80
84
|
},
|
|
81
85
|
},
|
|
86
|
+
disabled: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false,
|
|
89
|
+
},
|
|
90
|
+
removeLabel: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: 'Remove',
|
|
93
|
+
},
|
|
82
94
|
},
|
|
83
95
|
data() {
|
|
84
96
|
return {
|
|
@@ -87,8 +99,9 @@ export default {
|
|
|
87
99
|
},
|
|
88
100
|
methods: {
|
|
89
101
|
onChange(e) {
|
|
90
|
-
this.files = e.target.files;
|
|
91
|
-
this.$emit('file-added',
|
|
102
|
+
this.files = [...e.target.files];
|
|
103
|
+
this.$emit('file-added', this.files);
|
|
104
|
+
e.target.value = '';
|
|
92
105
|
},
|
|
93
106
|
removeFromArray(fileList, value) {
|
|
94
107
|
const array = Array.from(fileList);
|
|
@@ -108,6 +121,11 @@ export default {
|
|
|
108
121
|
hasInvalidFiles(payload) {
|
|
109
122
|
this.$emit('has-invalid-files', payload);
|
|
110
123
|
},
|
|
124
|
+
reset() {
|
|
125
|
+
this.$emit('file-removed', [...this.files]);
|
|
126
|
+
this.files = [];
|
|
127
|
+
this.$refs.fileUpload.value = '';
|
|
128
|
+
},
|
|
111
129
|
},
|
|
112
130
|
};
|
|
113
131
|
</script>
|
|
@@ -21,7 +21,13 @@
|
|
|
21
21
|
:disabled="disabled"
|
|
22
22
|
class="mc-pagination__select"
|
|
23
23
|
@change="changePage(Number($event))"
|
|
24
|
-
|
|
24
|
+
>
|
|
25
|
+
<template #text="{ option }">
|
|
26
|
+
<slot name="text" :option="{ ...option, length }">
|
|
27
|
+
{{ option.text }}
|
|
28
|
+
</slot>
|
|
29
|
+
</template>
|
|
30
|
+
</m-select>
|
|
25
31
|
</div>
|
|
26
32
|
|
|
27
33
|
<component
|
|
@@ -130,6 +136,7 @@ export default {
|
|
|
130
136
|
},
|
|
131
137
|
changePage(newPage) {
|
|
132
138
|
this.$emit('on-update-page', newPage);
|
|
139
|
+
this.$emit('update:value',newPage);
|
|
133
140
|
},
|
|
134
141
|
previousPage(newPage) {
|
|
135
142
|
if (this.hasPreviousPageListener()) {
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
theme="bordered"
|
|
6
6
|
icon="ControlLess32"
|
|
7
7
|
icon-position="left"
|
|
8
|
-
aria-label="
|
|
8
|
+
:aria-label="decrementAriaLabel"
|
|
9
9
|
:aria-controls="id"
|
|
10
10
|
:disabled="currentValue === valuemin"
|
|
11
11
|
:size="small ? 's' : null"
|
|
12
|
+
tabindex="-1"
|
|
13
|
+
aria-hidden="true"
|
|
12
14
|
@click="decrement()"
|
|
13
15
|
/>
|
|
14
16
|
|
|
@@ -18,13 +20,15 @@
|
|
|
18
20
|
type="number"
|
|
19
21
|
class="mc-quantity-selector__input"
|
|
20
22
|
name="quantity-selector-input"
|
|
21
|
-
aria-label="
|
|
22
|
-
aria-valuenow="
|
|
23
|
+
:aria-label="inputAriaLabel"
|
|
24
|
+
:aria-valuenow="currentValue"
|
|
23
25
|
:aria-valuemin="valuemin"
|
|
24
26
|
:aria-valuemax="valuemax"
|
|
25
27
|
:placeholder="placeholder"
|
|
26
28
|
:size="small ? 's' : null"
|
|
29
|
+
role="spinbutton"
|
|
27
30
|
@input="handle"
|
|
31
|
+
@keypress="integerOnly && formatValue($event)"
|
|
28
32
|
/>
|
|
29
33
|
|
|
30
34
|
<m-button
|
|
@@ -32,10 +36,12 @@
|
|
|
32
36
|
theme="bordered"
|
|
33
37
|
icon="ControlMore32"
|
|
34
38
|
icon-position="right"
|
|
35
|
-
aria-label="
|
|
39
|
+
:aria-label="incrementAriaLabel"
|
|
36
40
|
:aria-controls="id"
|
|
37
41
|
:disabled="currentValue === valuemax"
|
|
38
42
|
:size="small ? 's' : null"
|
|
43
|
+
tabindex="-1"
|
|
44
|
+
aria-hidden="true"
|
|
39
45
|
@click="increment()"
|
|
40
46
|
/>
|
|
41
47
|
</div>
|
|
@@ -62,6 +68,18 @@ export default {
|
|
|
62
68
|
type: Number,
|
|
63
69
|
default: 0,
|
|
64
70
|
},
|
|
71
|
+
inputAriaLabel: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'Quantity Selector',
|
|
74
|
+
},
|
|
75
|
+
decrementAriaLabel: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: 'Decrement',
|
|
78
|
+
},
|
|
79
|
+
incrementAriaLabel: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: 'Increment',
|
|
82
|
+
},
|
|
65
83
|
valuemin: {
|
|
66
84
|
type: Number,
|
|
67
85
|
default: 1,
|
|
@@ -78,6 +96,10 @@ export default {
|
|
|
78
96
|
type: Boolean,
|
|
79
97
|
default: false,
|
|
80
98
|
},
|
|
99
|
+
integerOnly: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: false,
|
|
102
|
+
},
|
|
81
103
|
},
|
|
82
104
|
|
|
83
105
|
data() {
|
|
@@ -113,6 +135,12 @@ export default {
|
|
|
113
135
|
this.$emit('decrement', this.currentValue);
|
|
114
136
|
}
|
|
115
137
|
},
|
|
138
|
+
formatValue(e) {
|
|
139
|
+
const INTEGER_ONLY_REGEX = /[0-9/]+/;
|
|
140
|
+
if (!INTEGER_ONLY_REGEX.test(e.key)) {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
}
|
|
143
|
+
},
|
|
116
144
|
},
|
|
117
145
|
};
|
|
118
146
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="mc-radio">
|
|
2
|
+
<div class="mc-radio" :class="rootClass">
|
|
3
3
|
<input
|
|
4
4
|
:id="id"
|
|
5
5
|
type="radio"
|
|
@@ -41,6 +41,10 @@ export default {
|
|
|
41
41
|
type: Boolean,
|
|
42
42
|
default: false,
|
|
43
43
|
},
|
|
44
|
+
rootClass: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: '',
|
|
47
|
+
},
|
|
44
48
|
},
|
|
45
49
|
};
|
|
46
50
|
</script>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
:key="option.id ? option.id : option.value"
|
|
24
24
|
:is-invalid="isInvalid"
|
|
25
25
|
:label="option.label"
|
|
26
|
-
class="mc-field__item"
|
|
26
|
+
root-class="mc-field__item"
|
|
27
27
|
:checked="value === option.value"
|
|
28
28
|
@change="(v) => (v ? $emit('input', option.value) : null)"
|
|
29
29
|
/>
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<m-text-input-icon :icon="icon" />
|
|
2
|
+
<div key="icon-input" :class="{ 'mc-left-icon-input': icon }">
|
|
3
|
+
<m-text-input-icon v-if="icon" :icon="icon" />
|
|
4
4
|
<m-text-input-field
|
|
5
5
|
ref="mField"
|
|
6
6
|
v-bind="[$attrs, $props]"
|
|
7
7
|
v-on="$listeners"
|
|
8
8
|
/>
|
|
9
9
|
</div>
|
|
10
|
-
|
|
11
|
-
<m-text-input-field
|
|
12
|
-
v-else
|
|
13
|
-
key="input-only"
|
|
14
|
-
ref="mField"
|
|
15
|
-
v-bind="[$attrs, $props]"
|
|
16
|
-
v-on="$listeners"
|
|
17
|
-
/>
|
|
18
10
|
</template>
|
|
19
11
|
|
|
20
12
|
<script>
|
|
Binary file
|