@mozaic-ds/vue 1.0.0-beta.3 → 1.0.0-beta.4
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/LICENSE +51 -0
- package/README.md +218 -84
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +920 -0
- package/dist/mozaic-vue.js +877 -0
- package/dist/mozaic-vue.js.map +1 -0
- package/dist/mozaic-vue.umd.cjs +2 -0
- package/dist/mozaic-vue.umd.cjs.map +1 -0
- package/env.d.ts +1 -0
- package/package.json +80 -50
- package/src/components/Contributing.mdx +118 -0
- package/src/components/GettingStarted.mdx +39 -0
- package/src/components/Introduction.mdx +54 -0
- package/src/components/Support.mdx +18 -0
- package/src/components/badge/MBadge.spec.ts +16 -0
- package/src/components/badge/MBadge.stories.ts +50 -0
- package/src/components/badge/MBadge.vue +36 -34
- package/src/components/button/MButton.spec.ts +191 -0
- package/src/components/button/MButton.stories.ts +66 -0
- package/src/components/button/MButton.vue +98 -154
- package/src/components/checkbox/MCheckbox.spec.ts +104 -0
- package/src/components/checkbox/MCheckbox.stories.ts +83 -0
- package/src/components/checkbox/MCheckbox.vue +60 -101
- package/src/components/checkboxgroup/MCheckboxGroup.spec.ts +78 -0
- package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +61 -0
- package/src/components/checkboxgroup/MCheckboxGroup.vue +97 -0
- package/src/components/field/MField.spec.ts +166 -0
- package/src/components/field/MField.stories.ts +376 -0
- package/src/components/field/MField.vue +78 -61
- package/src/components/fieldgroup/MFieldGroup.spec.ts +165 -0
- package/src/components/fieldgroup/MFieldGroup.stories.ts +274 -0
- package/src/components/fieldgroup/MFieldGroup.vue +79 -0
- package/src/components/iconbutton/MIconButton.spec.ts +108 -0
- package/src/components/iconbutton/MIconButton.stories.ts +66 -0
- package/src/components/iconbutton/MIconButton.vue +73 -0
- package/src/components/link/MLink.spec.ts +154 -0
- package/src/components/link/MLink.stories.ts +98 -0
- package/src/components/link/MLink.vue +86 -109
- package/src/components/loader/MLoader.spec.ts +104 -0
- package/src/components/loader/MLoader.stories.ts +45 -0
- package/src/components/loader/MLoader.vue +65 -55
- package/src/components/overlay/MOverlay.spec.ts +51 -0
- package/src/components/overlay/MOverlay.stories.ts +40 -0
- package/src/components/overlay/MOverlay.vue +27 -19
- package/src/components/quantityselector/MQuantitySelector.spec.ts +262 -0
- package/src/components/quantityselector/MQuantitySelector.stories.ts +89 -0
- package/src/components/quantityselector/MQuantitySelector.vue +160 -136
- package/src/components/radio/MRadio.spec.ts +104 -0
- package/src/components/radio/MRadio.stories.ts +68 -0
- package/src/components/radio/MRadio.vue +56 -39
- package/src/components/radiogroup/MRadioGroup.spec.ts +54 -0
- package/src/components/radiogroup/MRadioGroup.stories.ts +61 -0
- package/src/components/radiogroup/MRadioGroup.vue +79 -0
- package/src/components/select/MSelect.spec.ts +114 -0
- package/src/components/select/MSelect.stories.ts +101 -0
- package/src/components/select/MSelect.vue +77 -119
- package/src/components/statusbadge/MStatusBadge.stories.ts +45 -0
- package/src/components/statusbadge/MStatusBadge.vue +40 -0
- package/src/components/statusbadge/MStatusDot.vue +32 -0
- package/src/components/statusbadge/MstatusBadge.spec.ts +16 -0
- package/src/components/textarea/MTextArea.spec.ts +112 -0
- package/src/components/textarea/MTextArea.stories.ts +67 -0
- package/src/components/textarea/MTextArea.vue +81 -42
- package/src/components/textinput/MTextInput.spec.ts +121 -0
- package/src/components/textinput/MTextInput.stories.ts +114 -0
- package/src/components/textinput/MTextInput.vue +127 -47
- package/src/components/toggle/MToggle.spec.ts +99 -0
- package/src/components/toggle/MToggle.stories.ts +68 -0
- package/src/components/toggle/MToggle.vue +63 -103
- package/src/components/usingIcons.mdx +43 -0
- package/src/components/usingPresets.mdx +125 -0
- package/src/main.ts +39 -0
- package/dist/demo.html +0 -1
- package/dist/mozaic-vue.adeo.css +0 -45
- package/dist/mozaic-vue.adeo.umd.js +0 -41775
- package/dist/mozaic-vue.common.js +0 -41765
- package/dist/mozaic-vue.common.js.map +0 -1
- package/dist/mozaic-vue.umd.js +0 -41776
- package/dist/mozaic-vue.umd.js.map +0 -1
- package/dist/mozaic-vue.umd.min.js +0 -4
- package/dist/mozaic-vue.umd.min.js.map +0 -1
- package/postinstall.js +0 -3
- package/src/components/accordion/MAccordion.vue +0 -128
- package/src/components/accordion/index.js +0 -7
- package/src/components/autocomplete/MAutocomplete.vue +0 -198
- package/src/components/autocomplete/index.js +0 -7
- package/src/components/badge/index.js +0 -7
- package/src/components/breadcrumb/MBreadcrumb.vue +0 -73
- package/src/components/breadcrumb/index.js +0 -7
- package/src/components/button/index.js +0 -7
- package/src/components/card/MCard.vue +0 -78
- package/src/components/card/index.js +0 -7
- package/src/components/checkbox/MCheckboxGroup.vue +0 -155
- package/src/components/checkbox/index.js +0 -12
- package/src/components/container/MContainer.vue +0 -33
- package/src/components/container/index.js +0 -7
- package/src/components/datatable/MDataTable.vue +0 -651
- package/src/components/datatable/MDataTableHeader.vue +0 -55
- package/src/components/datatable/MDataTableTop.vue +0 -35
- package/src/components/datatable/helpers.js +0 -132
- package/src/components/datatable/index.js +0 -12
- package/src/components/field/index.js +0 -7
- package/src/components/fileuploader/MFileResult.vue +0 -149
- package/src/components/fileuploader/MFileUploader.vue +0 -142
- package/src/components/fileuploader/index.js +0 -7
- package/src/components/flag/MFlag.vue +0 -46
- package/src/components/flag/index.js +0 -7
- package/src/components/heading/MHeading.vue +0 -75
- package/src/components/heading/index.js +0 -7
- package/src/components/hero/MHero.vue +0 -93
- package/src/components/hero/index.js +0 -7
- package/src/components/icon/MIcon.vue +0 -120
- package/src/components/icon/index.js +0 -7
- package/src/components/index.js +0 -43
- package/src/components/layer/MLayer.vue +0 -208
- package/src/components/layer/index.js +0 -7
- package/src/components/link/index.js +0 -7
- package/src/components/listbox/MListBox.vue +0 -106
- package/src/components/listbox/index.js +0 -7
- package/src/components/loader/index.js +0 -7
- package/src/components/modal/MModal.vue +0 -179
- package/src/components/modal/index.js +0 -7
- package/src/components/notification/MNotification.vue +0 -110
- package/src/components/notification/index.js +0 -7
- package/src/components/optionbutton/MOptionButton.vue +0 -67
- package/src/components/optionbutton/index.js +0 -7
- package/src/components/optioncard/MOptionCard.vue +0 -132
- package/src/components/optioncard/index.js +0 -7
- package/src/components/optiongroup/MOptionGroup.vue +0 -18
- package/src/components/optiongroup/index.js +0 -7
- package/src/components/overlay/MOverlayLoader.vue +0 -43
- package/src/components/overlay/index.js +0 -12
- package/src/components/pagination/MPagination.vue +0 -162
- package/src/components/pagination/index.js +0 -7
- package/src/components/passwordinput/MPasswordInput.vue +0 -96
- package/src/components/passwordinput/index.js +0 -7
- package/src/components/phonenumber/MPhoneNumber.vue +0 -390
- package/src/components/phonenumber/index.js +0 -7
- package/src/components/progressbar/MProgress.vue +0 -102
- package/src/components/progressbar/index.js +0 -7
- package/src/components/quantityselector/index.js +0 -7
- package/src/components/radio/MRadioGroup.vue +0 -111
- package/src/components/radio/index.js +0 -12
- package/src/components/ratingstars/MStarsInput.vue +0 -118
- package/src/components/ratingstars/MStarsResult.vue +0 -89
- package/src/components/ratingstars/index.js +0 -12
- package/src/components/select/index.js +0 -7
- package/src/components/stepper/MStepper.vue +0 -70
- package/src/components/stepper/index.js +0 -7
- package/src/components/tabs/MTab.vue +0 -184
- package/src/components/tabs/index.js +0 -7
- package/src/components/tags/MTag.vue +0 -173
- package/src/components/tags/index.js +0 -7
- package/src/components/textarea/index.js +0 -7
- package/src/components/textinput/MTextInputField.vue +0 -105
- package/src/components/textinput/MTextInputIcon.vue +0 -42
- package/src/components/textinput/index.js +0 -7
- package/src/components/toggle/index.js +0 -7
- package/src/components/tooltip/MTooltip.vue +0 -42
- package/src/components/tooltip/index.js +0 -7
- package/src/index.js +0 -62
- package/src/shims-tsx.d.ts +0 -13
- package/src/shims.vue.d.ts +0 -4
- package/src/tokens/adeo/android/colors.xml +0 -391
- package/src/tokens/adeo/android/font_dimens.xml +0 -18
- package/src/tokens/adeo/css/_variables.scss +0 -385
- package/src/tokens/adeo/css/root.scss +0 -387
- package/src/tokens/adeo/ios/StyleDictionaryColor.h +0 -399
- package/src/tokens/adeo/ios/StyleDictionaryColor.m +0 -411
- package/src/tokens/adeo/ios/StyleDictionaryColor.swift +0 -394
- package/src/tokens/adeo/ios/StyleDictionarySize.h +0 -69
- package/src/tokens/adeo/ios/StyleDictionarySize.m +0 -70
- package/src/tokens/adeo/ios/StyleDictionarySize.swift +0 -71
- package/src/tokens/adeo/js/tokens.js +0 -483
- package/src/tokens/adeo/js/tokensObject.js +0 -10354
- package/src/tokens/adeo/scss/_tokens.scss +0 -1300
- package/src/utils/mozaicClasses.js +0 -16
- package/src/utils/theme.validator.js +0 -19
- package/types/index.d.ts +0 -100
package/postinstall.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="mc-accordion" :class="{ 'mc-accordion--s': size === 's' }">
|
|
3
|
-
<input
|
|
4
|
-
:id="id"
|
|
5
|
-
ref="checkbox"
|
|
6
|
-
type="checkbox"
|
|
7
|
-
class="mc-accordion__trigger"
|
|
8
|
-
:disabled="disabled"
|
|
9
|
-
:checked="open"
|
|
10
|
-
@change="$emit('update:open', $event.target.checked)"
|
|
11
|
-
/>
|
|
12
|
-
<div
|
|
13
|
-
:class="['mc-accordion__header', setHeaderClasses]"
|
|
14
|
-
:aria-expanded="open"
|
|
15
|
-
@click="$refs.checkbox.click()"
|
|
16
|
-
>
|
|
17
|
-
<slot name="beforeLabel" />
|
|
18
|
-
<label
|
|
19
|
-
:for="id"
|
|
20
|
-
:aria-expanded="open"
|
|
21
|
-
:class="['mc-accordion__header__label', setLabelClasses]"
|
|
22
|
-
@click.stop
|
|
23
|
-
>
|
|
24
|
-
<m-icon v-if="icon" :name="icon" class="mc-accordion__icon" />
|
|
25
|
-
{{ label }}
|
|
26
|
-
</label>
|
|
27
|
-
<slot name="afterLabel" />
|
|
28
|
-
</div>
|
|
29
|
-
<div class="mc-accordion__content">
|
|
30
|
-
<slot />
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
import MIcon from '../icon/MIcon.vue';
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: 'MAccordion',
|
|
40
|
-
|
|
41
|
-
components: {
|
|
42
|
-
MIcon,
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
model: {
|
|
46
|
-
prop: 'open',
|
|
47
|
-
event: 'change',
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
props: {
|
|
51
|
-
id: {
|
|
52
|
-
type: String,
|
|
53
|
-
required: true,
|
|
54
|
-
},
|
|
55
|
-
label: {
|
|
56
|
-
type: String,
|
|
57
|
-
required: true,
|
|
58
|
-
},
|
|
59
|
-
open: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: false,
|
|
62
|
-
},
|
|
63
|
-
size: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: null,
|
|
66
|
-
validator: (value) => ['s', 'm'].includes(value),
|
|
67
|
-
},
|
|
68
|
-
disabled: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: false,
|
|
71
|
-
},
|
|
72
|
-
padding: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: true,
|
|
75
|
-
},
|
|
76
|
-
icon: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: null,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
computed: {
|
|
83
|
-
setHeaderClasses() {
|
|
84
|
-
return {
|
|
85
|
-
'mc-accordion__label': true,
|
|
86
|
-
'mc-accordion__label--icon': this.icon,
|
|
87
|
-
'mc-accordion__label--no-padding': !this.padding,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
setLabelClasses() {
|
|
92
|
-
return {
|
|
93
|
-
'mc-accordion__header__label--with-before-slot':
|
|
94
|
-
this.$slots.beforeLabel,
|
|
95
|
-
'mc-accordion__header__label--with-after-slot': this.$slots.afterLabel,
|
|
96
|
-
};
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<style lang="scss">
|
|
103
|
-
@import 'settings-tools/_all-settings';
|
|
104
|
-
@import 'components/c.accordion';
|
|
105
|
-
|
|
106
|
-
.mc-accordion {
|
|
107
|
-
&__header {
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
|
|
111
|
-
&__label {
|
|
112
|
-
align-items: center;
|
|
113
|
-
display: flex;
|
|
114
|
-
cursor: pointer;
|
|
115
|
-
gap: $mu050;
|
|
116
|
-
white-space: nowrap;
|
|
117
|
-
|
|
118
|
-
&--with-before-slot {
|
|
119
|
-
padding-left: $mu100;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&--with-after-slot {
|
|
123
|
-
padding-right: $mu100;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
</style>
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="autocomplete"
|
|
4
|
-
class="mc-autocomplete"
|
|
5
|
-
:class="{ 'mc-autocomplete--multi': multiple }"
|
|
6
|
-
:style="tagStyle"
|
|
7
|
-
@keyup.esc="isOpen = true"
|
|
8
|
-
>
|
|
9
|
-
<m-tag
|
|
10
|
-
v-if="multiple && selectedItems().length > 0"
|
|
11
|
-
id="tag"
|
|
12
|
-
type="removable"
|
|
13
|
-
:label="selectedItems().length.toString() + ' ' + labelTag"
|
|
14
|
-
class="mc-autocomplete__tag"
|
|
15
|
-
size="s"
|
|
16
|
-
@remove-tag="removeElementsFromList()"
|
|
17
|
-
/>
|
|
18
|
-
<m-text-input
|
|
19
|
-
v-model="itemDisplayed"
|
|
20
|
-
:placeholder="placeholder"
|
|
21
|
-
text-input-field-class="mc-autocomplete__trigger"
|
|
22
|
-
icon-position="left"
|
|
23
|
-
icon="DisplaySearch48"
|
|
24
|
-
autocomplete="off"
|
|
25
|
-
:style="{ width: boxWidth + 'px' }"
|
|
26
|
-
@input="filerList"
|
|
27
|
-
@click="isOpen = true"
|
|
28
|
-
/>
|
|
29
|
-
<m-list-box
|
|
30
|
-
:open="isOpen"
|
|
31
|
-
:items="sort ? orderedItems() : itemListForDropdown"
|
|
32
|
-
:multiple="multiple"
|
|
33
|
-
:empty-search-label="emptySearchLabel"
|
|
34
|
-
:style="{ width: boxWidth + 'px' }"
|
|
35
|
-
@update:itemSelected="updateList"
|
|
36
|
-
@close-list-box="isOpen = false"
|
|
37
|
-
>
|
|
38
|
-
<template #item="{ item }">
|
|
39
|
-
<slot name="item" :item="item"> </slot>
|
|
40
|
-
</template>
|
|
41
|
-
</m-list-box>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script>
|
|
46
|
-
import MTextInput from '../textinput/MTextInput.vue';
|
|
47
|
-
import MTag from '../tags/MTag.vue';
|
|
48
|
-
import MListBox from '../listbox/MListBox.vue';
|
|
49
|
-
|
|
50
|
-
export default {
|
|
51
|
-
name: 'MAutocomplete',
|
|
52
|
-
|
|
53
|
-
components: { MListBox, MTag, MTextInput },
|
|
54
|
-
|
|
55
|
-
props: {
|
|
56
|
-
multiple: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
placeholder: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: '',
|
|
63
|
-
},
|
|
64
|
-
items: {
|
|
65
|
-
type: Array,
|
|
66
|
-
required: true,
|
|
67
|
-
default: () => [],
|
|
68
|
-
},
|
|
69
|
-
filter: {
|
|
70
|
-
type: Function,
|
|
71
|
-
default: null,
|
|
72
|
-
},
|
|
73
|
-
emptySearchLabel: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: 'No item matching your criteria found',
|
|
76
|
-
},
|
|
77
|
-
sort: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false,
|
|
80
|
-
},
|
|
81
|
-
labelTag: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: '',
|
|
84
|
-
},
|
|
85
|
-
open: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: false,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
data() {
|
|
91
|
-
return {
|
|
92
|
-
itemListForDropdown: this.$props.items,
|
|
93
|
-
selected: this.$props.items,
|
|
94
|
-
itemDisplayed: '',
|
|
95
|
-
isOpen: this.$props.open,
|
|
96
|
-
tagWidth: '0px',
|
|
97
|
-
boxWidth: '288px',
|
|
98
|
-
};
|
|
99
|
-
},
|
|
100
|
-
computed: {
|
|
101
|
-
tagStyle() {
|
|
102
|
-
return {
|
|
103
|
-
'--tag-width': this.tagWidth,
|
|
104
|
-
};
|
|
105
|
-
},
|
|
106
|
-
boxStyle() {
|
|
107
|
-
return {
|
|
108
|
-
'--box-width': this.boxWidth,
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
mounted() {
|
|
113
|
-
this.selectedItems();
|
|
114
|
-
this.tagWidthCalcul();
|
|
115
|
-
this.boxWidthCalcul();
|
|
116
|
-
},
|
|
117
|
-
methods: {
|
|
118
|
-
tagWidthCalcul() {
|
|
119
|
-
this.$nextTick(() => {
|
|
120
|
-
this.tagWidth =
|
|
121
|
-
document && document.querySelector('.mc-autocomplete__tag')
|
|
122
|
-
? document.querySelector('.mc-autocomplete__tag').clientWidth + 'px'
|
|
123
|
-
: '0px';
|
|
124
|
-
});
|
|
125
|
-
},
|
|
126
|
-
selectedItems() {
|
|
127
|
-
return this.selected.filter((item) => {
|
|
128
|
-
return item.selected;
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
orderedItems() {
|
|
132
|
-
this.itemListForDropdown.sort((a, b) => {
|
|
133
|
-
if (a.selected === b.selected) {
|
|
134
|
-
return a.id - b.id;
|
|
135
|
-
} else if (a.selected < b.selected) {
|
|
136
|
-
return 1;
|
|
137
|
-
} else {
|
|
138
|
-
return -1;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
updateList(list) {
|
|
143
|
-
if (!this.$props.multiple && list) {
|
|
144
|
-
this.itemDisplayed = list[0].text;
|
|
145
|
-
} else {
|
|
146
|
-
this.isOpen = true;
|
|
147
|
-
this.selectedItems();
|
|
148
|
-
}
|
|
149
|
-
this.itemListForDropdown.forEach((elem) => {
|
|
150
|
-
if (elem.id === list.id) {
|
|
151
|
-
elem.selected = false;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
this.tagWidthCalcul();
|
|
155
|
-
this.$emit(
|
|
156
|
-
'update:modelValue',
|
|
157
|
-
this.$props.multiple ? this.selectedItems().value : list
|
|
158
|
-
);
|
|
159
|
-
},
|
|
160
|
-
removeElementsFromList() {
|
|
161
|
-
this.itemListForDropdown.forEach((elem) => {
|
|
162
|
-
elem.selected = false;
|
|
163
|
-
});
|
|
164
|
-
this.selectedItems();
|
|
165
|
-
this.tagWidthCalcul();
|
|
166
|
-
this.$emit('list-removed');
|
|
167
|
-
},
|
|
168
|
-
filerList(value) {
|
|
169
|
-
if (value.length && this.$props.filter) {
|
|
170
|
-
this.$props.filter(value);
|
|
171
|
-
} else if (value.length) {
|
|
172
|
-
this.itemListForDropdown = this.itemListForDropdown.filter((item) =>
|
|
173
|
-
item.text.toUpperCase().includes(value.toUpperCase())
|
|
174
|
-
);
|
|
175
|
-
} else {
|
|
176
|
-
this.itemListForDropdown = this.$props.items;
|
|
177
|
-
}
|
|
178
|
-
this.$emit('list-filtered', this.itemListForDropdown);
|
|
179
|
-
},
|
|
180
|
-
boxWidthCalcul() {
|
|
181
|
-
this.$nextTick(() => {
|
|
182
|
-
this.boxWidth = document.querySelector('.mc-autocomplete').clientWidth;
|
|
183
|
-
console.log(this.boxWidth);
|
|
184
|
-
});
|
|
185
|
-
return;
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
</script>
|
|
190
|
-
|
|
191
|
-
<style lang="scss">
|
|
192
|
-
@import 'settings-tools/_all-settings';
|
|
193
|
-
@import 'components/_c.autocomplete';
|
|
194
|
-
|
|
195
|
-
.mc-autocomplete--multi .mc-autocomplete__trigger {
|
|
196
|
-
padding-left: calc(2.9375rem + var(--tag-width));
|
|
197
|
-
}
|
|
198
|
-
</style>
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<nav
|
|
3
|
-
class="mc-breadcrumb"
|
|
4
|
-
:class="{
|
|
5
|
-
'mc-breadcrumb--dark': dark,
|
|
6
|
-
'mc-breadcrumb--responsive': responsive,
|
|
7
|
-
}"
|
|
8
|
-
aria-label="Breadcrumb"
|
|
9
|
-
>
|
|
10
|
-
<ul class="mc-breadcrumb__container">
|
|
11
|
-
<li
|
|
12
|
-
v-for="(item, index) in items"
|
|
13
|
-
:key="`breadcrumb-${index}`"
|
|
14
|
-
class="mc-breadcrumb__item"
|
|
15
|
-
:class="{ 'is-active': item.isActive }"
|
|
16
|
-
>
|
|
17
|
-
<m-link
|
|
18
|
-
:href="item.href"
|
|
19
|
-
:class="[
|
|
20
|
-
setLinkClasses,
|
|
21
|
-
{ 'mc-breadcrumb__current': index === items.length - 1 },
|
|
22
|
-
]"
|
|
23
|
-
:aria-current="index != items.length - 1 ? null : 'page'"
|
|
24
|
-
size="s"
|
|
25
|
-
:router="item.router"
|
|
26
|
-
@click="$emit('link-clicked', item)"
|
|
27
|
-
>
|
|
28
|
-
{{ item.text }}
|
|
29
|
-
</m-link>
|
|
30
|
-
</li>
|
|
31
|
-
</ul>
|
|
32
|
-
</nav>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
import MLink from '../link/MLink.vue';
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: 'MBreadcrumb',
|
|
40
|
-
|
|
41
|
-
components: {
|
|
42
|
-
MLink,
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
props: {
|
|
46
|
-
items: {
|
|
47
|
-
type: Array,
|
|
48
|
-
required: true,
|
|
49
|
-
},
|
|
50
|
-
dark: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: false,
|
|
53
|
-
},
|
|
54
|
-
responsive: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
computed: {
|
|
61
|
-
setLinkClasses() {
|
|
62
|
-
return {
|
|
63
|
-
'mc-link--light': this.dark,
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<style lang="scss">
|
|
71
|
-
@import 'settings-tools/_all-settings';
|
|
72
|
-
@import 'components/_c.breadcrumb';
|
|
73
|
-
</style>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="mc-card" :class="{ 'mc-card--bordered': outlined }">
|
|
3
|
-
<figure
|
|
4
|
-
class="mc-card__visual"
|
|
5
|
-
:class="imageratio ? `mc-card__visual--${imageratio}` : ''"
|
|
6
|
-
>
|
|
7
|
-
<img :src="imgSrc" :loading="lazy ? 'lazy' : 'eager'" :alt="imgAlt" class="mc-card__img" />
|
|
8
|
-
<slot name="image" />
|
|
9
|
-
</figure>
|
|
10
|
-
<article class="mc-card__content">
|
|
11
|
-
<component :is="titleTag" class="mc-card__title">
|
|
12
|
-
{{ title }}
|
|
13
|
-
</component>
|
|
14
|
-
<component :is="subtitleTag" v-if="subtitle" class="mc-card__subtitle">
|
|
15
|
-
{{ subtitle }}
|
|
16
|
-
</component>
|
|
17
|
-
<div class="mc-card__body">
|
|
18
|
-
<slot />
|
|
19
|
-
</div>
|
|
20
|
-
<footer v-if="$slots.footer" class="mc-card__footer">
|
|
21
|
-
<slot name="footer" />
|
|
22
|
-
</footer>
|
|
23
|
-
</article>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
export default {
|
|
29
|
-
name: 'MCard',
|
|
30
|
-
|
|
31
|
-
props: {
|
|
32
|
-
title: {
|
|
33
|
-
type: String,
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
imgSrc: {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
},
|
|
40
|
-
lazy: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
outlined: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false,
|
|
47
|
-
},
|
|
48
|
-
titleTag: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: 'h1',
|
|
51
|
-
validator: (value) =>
|
|
52
|
-
['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(value),
|
|
53
|
-
},
|
|
54
|
-
imgAlt: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: '',
|
|
57
|
-
},
|
|
58
|
-
subtitle: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: null,
|
|
61
|
-
},
|
|
62
|
-
subtitleTag: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: 'h2',
|
|
65
|
-
},
|
|
66
|
-
imageratio: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: null,
|
|
69
|
-
validator: (value) => ['1x1', '4x3', '16x9'].includes(value),
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
</script>
|
|
74
|
-
|
|
75
|
-
<style lang="scss">
|
|
76
|
-
@import 'settings-tools/_all-settings';
|
|
77
|
-
@import 'components/_c.card';
|
|
78
|
-
</style>
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<fieldset class="mc-field mc-field--group">
|
|
3
|
-
<legend class="mc-field__legend">
|
|
4
|
-
{{ legend }}
|
|
5
|
-
<span
|
|
6
|
-
v-if="requirementText"
|
|
7
|
-
class="mc-field__requirement"
|
|
8
|
-
aria-hidden="true"
|
|
9
|
-
>
|
|
10
|
-
{{ requirementText }}
|
|
11
|
-
</span>
|
|
12
|
-
</legend>
|
|
13
|
-
<span v-if="helpId && helpText" :id="helpId" class="mc-field__help">
|
|
14
|
-
{{ helpText }}
|
|
15
|
-
</span>
|
|
16
|
-
<div
|
|
17
|
-
class="mc-field__container"
|
|
18
|
-
:class="{ 'mc-field__container--inline': inline }"
|
|
19
|
-
>
|
|
20
|
-
<m-checkbox
|
|
21
|
-
v-for="(option, index) in options"
|
|
22
|
-
v-bind="option"
|
|
23
|
-
:key="option.id ? option.id : option.value"
|
|
24
|
-
class="mc-field__item"
|
|
25
|
-
:checked="value ? value.includes(option.value) : undefined"
|
|
26
|
-
@change="(v) => onChange(v, option.value)"
|
|
27
|
-
>
|
|
28
|
-
<template #label>
|
|
29
|
-
<slot :name="`label${index + 1}`">
|
|
30
|
-
{{ option.label }}
|
|
31
|
-
</slot>
|
|
32
|
-
</template>
|
|
33
|
-
</m-checkbox>
|
|
34
|
-
</div>
|
|
35
|
-
<span
|
|
36
|
-
v-if="errorId && errorMessage"
|
|
37
|
-
:id="errorId"
|
|
38
|
-
class="mc-field__error-message"
|
|
39
|
-
>
|
|
40
|
-
{{ errorMessage }}
|
|
41
|
-
</span>
|
|
42
|
-
</fieldset>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script>
|
|
46
|
-
import MCheckbox from './MCheckbox.vue';
|
|
47
|
-
|
|
48
|
-
export default {
|
|
49
|
-
name: 'MCheckboxGroup',
|
|
50
|
-
|
|
51
|
-
components: {
|
|
52
|
-
MCheckbox,
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
model: {
|
|
56
|
-
event: 'change',
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
props: {
|
|
60
|
-
/**
|
|
61
|
-
* Label of the whole group of checkboxes
|
|
62
|
-
*/
|
|
63
|
-
legend: {
|
|
64
|
-
type: String,
|
|
65
|
-
required: true,
|
|
66
|
-
},
|
|
67
|
-
/**
|
|
68
|
-
* Property used to manage the values checked by v-model
|
|
69
|
-
* (Do not use directly)
|
|
70
|
-
* @ignore
|
|
71
|
-
*/
|
|
72
|
-
value: {
|
|
73
|
-
type: Array,
|
|
74
|
-
default: undefined,
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* An array of objects to provide all the values and attributes related to a checkbox
|
|
78
|
-
*/
|
|
79
|
-
options: {
|
|
80
|
-
type: Array,
|
|
81
|
-
default: undefined,
|
|
82
|
-
},
|
|
83
|
-
/**
|
|
84
|
-
* Text that indicate if one or more elements of the group are mandatory
|
|
85
|
-
*/
|
|
86
|
-
requirementText: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: undefined,
|
|
89
|
-
},
|
|
90
|
-
/**
|
|
91
|
-
* Text providing relevant or additional information to ensure that the user understands the purpose of the selection.
|
|
92
|
-
*/
|
|
93
|
-
helpText: {
|
|
94
|
-
type: String,
|
|
95
|
-
default: undefined,
|
|
96
|
-
},
|
|
97
|
-
/**
|
|
98
|
-
* For accessibility reasons a `helpId` must be defined when using a `helpText`
|
|
99
|
-
*/
|
|
100
|
-
// TODO: See if it is possible to automatically generate this id in the @next version
|
|
101
|
-
helpId: {
|
|
102
|
-
type: String,
|
|
103
|
-
default: undefined,
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* Text below the group of checkboxes explaining the reason for the error following the user selection.
|
|
107
|
-
*/
|
|
108
|
-
errorMessage: {
|
|
109
|
-
type: String,
|
|
110
|
-
default: undefined,
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* For accessibility reasons a `errorId` must be defined when using a `errorMessage`
|
|
114
|
-
*/
|
|
115
|
-
// TODO: See if it is possible to automatically generate this id in the @next version
|
|
116
|
-
errorId: {
|
|
117
|
-
type: String,
|
|
118
|
-
default: undefined,
|
|
119
|
-
},
|
|
120
|
-
/**
|
|
121
|
-
* Position the inputs horizontally
|
|
122
|
-
*/
|
|
123
|
-
inline: {
|
|
124
|
-
type: Boolean,
|
|
125
|
-
default: false,
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
data() {
|
|
130
|
-
return {
|
|
131
|
-
checkboxesValues: [],
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
methods: {
|
|
136
|
-
onChange(isChecked, value) {
|
|
137
|
-
let values = this.checkboxesValues;
|
|
138
|
-
|
|
139
|
-
if (isChecked && !values.includes(value)) {
|
|
140
|
-
values.push(value);
|
|
141
|
-
} else {
|
|
142
|
-
values = values.filter((key) => key !== value);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
this.$emit('change', values);
|
|
146
|
-
this.checkboxesValues = values;
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
</script>
|
|
151
|
-
|
|
152
|
-
<style lang="scss">
|
|
153
|
-
@import 'settings-tools/_all-settings';
|
|
154
|
-
@import 'components/_c.fields';
|
|
155
|
-
</style>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import MCheckbox from './MCheckbox.vue';
|
|
2
|
-
import MCheckboxGroup from './MCheckboxGroup.vue';
|
|
3
|
-
|
|
4
|
-
MCheckbox.install = function (Vue) {
|
|
5
|
-
Vue.component(MCheckbox.name, MCheckbox);
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
MCheckboxGroup.install = function (Vue) {
|
|
9
|
-
Vue.component(MCheckboxGroup.name, MCheckboxGroup);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { MCheckbox, MCheckboxGroup };
|