@mozaic-ds/vue 0.41.0 → 0.42.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.umd.js +57 -484
- package/dist/mozaic-vue.adeo.umd.js.map +1 -1
- package/dist/mozaic-vue.common.js +57 -484
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.umd.js +57 -484
- 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 +1 -1
- package/src/components/datatable/MDataTable.vue +9 -5
- package/src/components/radio/MRadio.vue +5 -1
- package/src/components/radio/MRadioGroup.vue +8 -3
package/package.json
CHANGED
|
@@ -203,6 +203,7 @@ function autoGenerateHeaders(data, headers) {
|
|
|
203
203
|
/** Build options to manage request. */
|
|
204
204
|
function buildOptions(
|
|
205
205
|
pagingEnabled,
|
|
206
|
+
pagingTotalPage,
|
|
206
207
|
pagerValue,
|
|
207
208
|
pagingIndex,
|
|
208
209
|
pagingSize,
|
|
@@ -220,7 +221,7 @@ function buildOptions(
|
|
|
220
221
|
|
|
221
222
|
return {
|
|
222
223
|
sort: columnSorters,
|
|
223
|
-
skip: pagingEnabled ? pagerValue * (index - 1) : null,
|
|
224
|
+
skip: (pagingEnabled || pagingTotalPage) ? pagerValue * (index - 1) : null,
|
|
224
225
|
take: pagingEnabled ? pagerValue : null,
|
|
225
226
|
};
|
|
226
227
|
}
|
|
@@ -307,7 +308,7 @@ export default {
|
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
310
|
* Get or set paging informations.
|
|
310
|
-
* @type {{ enabled: boolean, text: string, index: number }}
|
|
311
|
+
* @type {{ enabled: boolean, text: string, index: number, totalPage?: number }}
|
|
311
312
|
*/
|
|
312
313
|
paging: {
|
|
313
314
|
type: Object,
|
|
@@ -428,7 +429,9 @@ export default {
|
|
|
428
429
|
getPagingSize() {
|
|
429
430
|
let size = 1;
|
|
430
431
|
|
|
431
|
-
if
|
|
432
|
+
if(this.paging.totalPage) {
|
|
433
|
+
size = this.paging.totalPage;
|
|
434
|
+
} else if (this.total) {
|
|
432
435
|
size = Math.ceil(this.total / this.pagerOptions.value);
|
|
433
436
|
} else {
|
|
434
437
|
size = parseInt(this.pagingOptions.index);
|
|
@@ -659,11 +662,12 @@ export default {
|
|
|
659
662
|
},
|
|
660
663
|
|
|
661
664
|
async onPageSizeChanged(value) {
|
|
662
|
-
|
|
665
|
+
const newPageSize = +value;
|
|
666
|
+
this.pagerOptions.value = newPageSize;
|
|
663
667
|
|
|
664
668
|
await this.load();
|
|
665
669
|
|
|
666
|
-
this.$emit('page-size-changed',
|
|
670
|
+
this.$emit('page-size-changed', newPageSize);
|
|
667
671
|
},
|
|
668
672
|
|
|
669
673
|
onRowClick(e) {
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
:checked="checked"
|
|
10
10
|
@change="$emit('change', $event.target.checked)"
|
|
11
11
|
/>
|
|
12
|
-
<label :for="id" class="mc-radio__label">
|
|
12
|
+
<label :for="id" class="mc-radio__label">
|
|
13
|
+
<slot name="label">
|
|
14
|
+
{{ label }}
|
|
15
|
+
</slot>
|
|
16
|
+
</label>
|
|
13
17
|
</div>
|
|
14
18
|
</template>
|
|
15
19
|
|
|
@@ -18,16 +18,21 @@
|
|
|
18
18
|
:class="{ 'mc-field__container--inline': inline }"
|
|
19
19
|
>
|
|
20
20
|
<m-radio
|
|
21
|
-
v-for="option in options"
|
|
21
|
+
v-for="(option, index) in options"
|
|
22
22
|
:id="option.id ? option.id : option.value"
|
|
23
23
|
:key="option.id ? option.id : option.value"
|
|
24
24
|
:is-invalid="isInvalid"
|
|
25
|
-
:label="option.label"
|
|
26
25
|
:name="option.name"
|
|
27
26
|
root-class="mc-field__item"
|
|
28
27
|
:checked="value === option.value"
|
|
29
28
|
@change="(v) => (v ? $emit('input', option.value) : null)"
|
|
30
|
-
|
|
29
|
+
>
|
|
30
|
+
<template #label>
|
|
31
|
+
<slot :name="`label${index + 1}`">
|
|
32
|
+
{{ option.label }}
|
|
33
|
+
</slot>
|
|
34
|
+
</template>
|
|
35
|
+
</m-radio>
|
|
31
36
|
</div>
|
|
32
37
|
<span v-if="isInvalid" :id="errorId" class="mc-field__error-message">
|
|
33
38
|
{{ errorMessage }}
|