@mozaic-ds/vue 0.41.0 → 0.42.0-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/vue",
3
- "version": "0.41.0",
3
+ "version": "0.42.0-beta.0",
4
4
  "description": "Vue.js implementation of Mozaic Design System",
5
5
  "author": "Adeo - Mozaic Design System",
6
6
  "scripts": {
@@ -307,7 +307,7 @@ export default {
307
307
 
308
308
  /**
309
309
  * Get or set paging informations.
310
- * @type {{ enabled: boolean, text: string, index: number }}
310
+ * @type {{ enabled: boolean, text: string, index: number, totalPage?: number }}
311
311
  */
312
312
  paging: {
313
313
  type: Object,
@@ -428,7 +428,9 @@ export default {
428
428
  getPagingSize() {
429
429
  let size = 1;
430
430
 
431
- if (this.total) {
431
+ if(this.paging.totalPage) {
432
+ size = this.paging.totalPage;
433
+ } else if (this.total) {
432
434
  size = Math.ceil(this.total / this.pagerOptions.value);
433
435
  } else {
434
436
  size = parseInt(this.pagingOptions.index);
@@ -659,11 +661,12 @@ export default {
659
661
  },
660
662
 
661
663
  async onPageSizeChanged(value) {
662
- this.pagerOptions.value = +value;
664
+ const newPageSize = +value;
665
+ this.pagerOptions.value = newPageSize;
663
666
 
664
667
  await this.load();
665
668
 
666
- this.$emit('page-size-changed', value);
669
+ this.$emit('page-size-changed', newPageSize);
667
670
  },
668
671
 
669
672
  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">{{ label }}</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 }}