@mozaic-ds/vue 0.43.0-beta.0 → 0.43.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/vue",
3
- "version": "0.43.0-beta.0",
3
+ "version": "0.43.1",
4
4
  "description": "Vue.js implementation of Mozaic Design System",
5
5
  "author": "Adeo - Mozaic Design System",
6
6
  "scripts": {
@@ -33,16 +33,20 @@
33
33
  @input="onInput"
34
34
  @click="openState = true"
35
35
  />
36
- <MLoader v-if="loading" class="mc-autocomplete__loader" size="s" />
37
- <button
38
- v-if="isClearable"
39
- type="button"
40
- class="mc-autocomplete__clear"
41
- @click="onClear"
42
- >
43
- <MIcon name="ControlTagCross24" class="mc-autocomplete__clear-icon" />
44
- <span class="mc-autocomplete__clear-text">{{ labelClearButton }}</span>
45
- </button>
36
+ <div class="mc-autocomplete__tools">
37
+ <MLoader v-if="loading" class="mc-autocomplete__loader" size="s" />
38
+ <button
39
+ v-if="isClearable"
40
+ type="button"
41
+ class="mc-autocomplete__clear"
42
+ @click="onClear"
43
+ >
44
+ <MIcon name="ControlTagCross24" class="mc-autocomplete__clear-icon" />
45
+ <span class="mc-autocomplete__clear-text">{{
46
+ labelClearButton
47
+ }}</span>
48
+ </button>
49
+ </div>
46
50
  </div>
47
51
  <MListBox
48
52
  v-if="!isFiltered"
@@ -68,6 +68,7 @@ export default {
68
68
  default: null,
69
69
  validator: (value) =>
70
70
  [
71
+ null,
71
72
  'solid',
72
73
  'bordered',
73
74
  'solid-neutral',
@@ -28,7 +28,7 @@
28
28
  >
29
29
  <template #label>
30
30
  <!-- @slot Use this slot if you want to customise the label display of each MCheckbox element -->
31
- <slot :name="`label${index + 1}`">
31
+ <slot :name="`label${index + 1}`" :option="option">
32
32
  {{ option.label }}
33
33
  </slot>
34
34
  </template>
@@ -139,12 +139,12 @@ export default {
139
139
  },
140
140
  data() {
141
141
  return {
142
- checkboxesValues: [],
142
+ localValue: this.value ?? [],
143
143
  };
144
144
  },
145
145
  methods: {
146
146
  onChange(isChecked, value) {
147
- let values = this.value;
147
+ let values = this.localValue;
148
148
 
149
149
  if (isChecked && !values.includes(value)) {
150
150
  values.push(value);
@@ -156,7 +156,7 @@ export default {
156
156
  * Triggered each time a checkbox is checked/unchecked. _(can be used with a v-model)_
157
157
  */
158
158
  this.$emit('change', values);
159
- this.checkboxesValues = values;
159
+ this.localValue = values;
160
160
  },
161
161
  },
162
162
  };
@@ -539,13 +539,9 @@ export default {
539
539
  },
540
540
  },
541
541
  paging: {
542
- deep: true,
543
542
  immediate: true,
544
543
  async handler(newValue, oldValue) {
545
- if (
546
- deepEqual(newValue, oldValue) &&
547
- !(this.source instanceof Function)
548
- ) {
544
+ if (deepEqual(newValue, oldValue)) {
549
545
  return;
550
546
  }
551
547
 
@@ -27,15 +27,17 @@
27
27
  >
28
28
  {{ getButtonLabel }}
29
29
  </button>
30
- <button
31
- v-if="isClearable"
32
- class="mc-dropdown__clear"
33
- type="button"
34
- @click="clearListbox"
35
- >
36
- <MIcon name="ControlTagCross24" class="mc-dropdown__clear-icon" />
37
- <span class="mc-dropdown__clear-text">{{ labelClearButton }}</span>
38
- </button>
30
+ <div class="mc-dropdown__tools">
31
+ <button
32
+ v-if="isClearable"
33
+ class="mc-dropdown__clear"
34
+ type="button"
35
+ @click="clearListbox"
36
+ >
37
+ <MIcon name="ControlTagCross24" class="mc-dropdown__clear-icon" />
38
+ <span class="mc-dropdown__clear-text">{{ labelClearButton }}</span>
39
+ </button>
40
+ </div>
39
41
  </div>
40
42
  <MListBox
41
43
  v-model="listboxValue"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <Portal :selector="appendTo">
3
3
  <div
4
4
  ref="modal"
5
5
  class="mc-modal"
@@ -54,18 +54,20 @@
54
54
  </div>
55
55
  </div>
56
56
  </div>
57
- <keep-alive>
57
+ <KeepAlive>
58
58
  <div
59
59
  class="mc-modal-overlay"
60
60
  :class="{ 'is-visible': open }"
61
61
  tabindex="-1"
62
62
  role="dialog"
63
63
  />
64
- </keep-alive>
65
- </div>
64
+ </KeepAlive>
65
+ </Portal>
66
66
  </template>
67
67
 
68
68
  <script>
69
+ import { Portal } from '@linusborg/vue-simple-portal';
70
+
69
71
  /**
70
72
  * > A modal is a dialog window allowing you to focus the user's attention on a specific task, a piece of information or a mandatory action. It must be used for single action only and must have a call to action button in the bottom.
71
73
  *
@@ -74,6 +76,9 @@
74
76
  */
75
77
  export default {
76
78
  name: 'MModal',
79
+ components: {
80
+ Portal,
81
+ },
77
82
  props: {
78
83
  /**
79
84
  * Allows to make the Modal visible or hide it. Can be used with `v-model`.
@@ -127,6 +132,13 @@ export default {
127
132
  type: Boolean,
128
133
  default: true,
129
134
  },
135
+ /**
136
+ * A query selector that defines the target element to which to append the content of the Portal
137
+ */
138
+ appendTo: {
139
+ type: String,
140
+ default: undefined,
141
+ },
130
142
  },
131
143
  watch: {
132
144
  open: {
@@ -35,7 +35,7 @@
35
35
  @change="(v) => (v ? $emit('input', option.value) : null)"
36
36
  >
37
37
  <template #label>
38
- <slot :name="`label${index + 1}`">
38
+ <slot :name="`label${index + 1}`" :option="option">
39
39
  {{ option.label }}
40
40
  </slot>
41
41
  </template>