@mozaic-ds/vue 1.0.0-beta.3 → 1.0.0-beta.5
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 +224 -82
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +1202 -0
- package/dist/mozaic-vue.js +1220 -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 +81 -50
- package/src/components/Contributing.mdx +118 -0
- package/src/components/GettingStarted.mdx +50 -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/breadcrumb/MBreadcrumb.spec.ts +105 -0
- package/src/components/breadcrumb/MBreadcrumb.stories.ts +57 -0
- package/src/components/breadcrumb/MBreadcrumb.vue +52 -55
- 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 +423 -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/passwordinput/MPasswordInput.spec.ts +104 -0
- package/src/components/passwordinput/MPasswordInput.stories.ts +75 -0
- package/src/components/passwordinput/MPasswordInput.vue +129 -76
- 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/MstatusBadge.spec.ts +16 -0
- package/src/components/statusdot/MStatusDot.spec.ts +51 -0
- package/src/components/statusdot/MStatusDot.stories.ts +48 -0
- package/src/components/statusdot/MStatusDot.vue +36 -0
- package/src/components/statusnotification/MStatusNotification.spec.ts +99 -0
- package/src/components/statusnotification/MStatusNotification.stories.ts +96 -0
- package/src/components/statusnotification/MStatusNotification.vue +106 -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/togglegroup/MToggleGroup.spec.ts +78 -0
- package/src/components/togglegroup/MToggleGroup.stories.ts +61 -0
- package/src/components/togglegroup/MToggleGroup.vue +97 -0
- package/src/components/usingIcons.mdx +43 -0
- package/src/components/usingPresets.mdx +125 -0
- package/src/main.ts +47 -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/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/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
|
@@ -1,111 +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-radio
|
|
21
|
-
v-for="option in options"
|
|
22
|
-
:id="option.id ? option.id : option.value"
|
|
23
|
-
:key="option.id ? option.id : option.value"
|
|
24
|
-
:is-invalid="isInvalid"
|
|
25
|
-
:label="option.label"
|
|
26
|
-
:name="option.name"
|
|
27
|
-
root-class="mc-field__item"
|
|
28
|
-
:checked="value === option.value"
|
|
29
|
-
@change="(v) => (v ? $emit('input', option.value) : null)"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
<span v-if="isInvalid" :id="errorId" class="mc-field__error-message">
|
|
33
|
-
{{ errorMessage }}
|
|
34
|
-
</span>
|
|
35
|
-
</fieldset>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
import MRadio from './MRadio.vue';
|
|
40
|
-
|
|
41
|
-
export default {
|
|
42
|
-
name: 'MRadioGroup',
|
|
43
|
-
|
|
44
|
-
components: {
|
|
45
|
-
MRadio,
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
props: {
|
|
49
|
-
legend: {
|
|
50
|
-
type: String,
|
|
51
|
-
required: true,
|
|
52
|
-
},
|
|
53
|
-
requirementText: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: null,
|
|
56
|
-
},
|
|
57
|
-
helpId: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: null,
|
|
60
|
-
},
|
|
61
|
-
helpText: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: null,
|
|
64
|
-
},
|
|
65
|
-
errorId: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: null,
|
|
68
|
-
},
|
|
69
|
-
errorMessage: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: null,
|
|
72
|
-
},
|
|
73
|
-
isInvalid: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false,
|
|
76
|
-
},
|
|
77
|
-
inline: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false,
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
value: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: null,
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
options: {
|
|
88
|
-
type: Array,
|
|
89
|
-
default() {
|
|
90
|
-
return [];
|
|
91
|
-
},
|
|
92
|
-
validator(options) {
|
|
93
|
-
return options.every(
|
|
94
|
-
(o) =>
|
|
95
|
-
'id' in o &&
|
|
96
|
-
typeof o.id == 'string' &&
|
|
97
|
-
'label' in o &&
|
|
98
|
-
typeof o.label == 'string' &&
|
|
99
|
-
'value' in o &&
|
|
100
|
-
typeof o.value == 'string'
|
|
101
|
-
);
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<style lang="scss">
|
|
109
|
-
@import 'settings-tools/_all-settings';
|
|
110
|
-
@import 'components/_c.fields';
|
|
111
|
-
</style>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import MRadio from './MRadio.vue';
|
|
2
|
-
import MRadioGroup from './MRadioGroup.vue';
|
|
3
|
-
|
|
4
|
-
MRadio.install = function (Vue) {
|
|
5
|
-
Vue.component(MRadio.name, MRadio);
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
MRadioGroup.install = function (Vue) {
|
|
9
|
-
Vue.component(MRadioGroup.name, MRadioGroup);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { MRadio, MRadioGroup };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="['mc-stars-input', setClasses]">
|
|
3
|
-
<input
|
|
4
|
-
:id="name + '0'"
|
|
5
|
-
type="radio"
|
|
6
|
-
:name="required ? name + '-unselected' : name"
|
|
7
|
-
value="0"
|
|
8
|
-
class="mc-stars-input__radio"
|
|
9
|
-
checked
|
|
10
|
-
:aria-label="unselectedText"
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
<template v-for="(rateId, index) in ratingValue">
|
|
14
|
-
<input
|
|
15
|
-
:id="name + rateId"
|
|
16
|
-
:key="'ratingInput-' + rateId"
|
|
17
|
-
type="radio"
|
|
18
|
-
:name="name"
|
|
19
|
-
:value="rateId"
|
|
20
|
-
class="mc-stars-input__radio"
|
|
21
|
-
:required="required"
|
|
22
|
-
/>
|
|
23
|
-
|
|
24
|
-
<label
|
|
25
|
-
:key="'ratingLabel-' + rateId"
|
|
26
|
-
:for="name + rateId"
|
|
27
|
-
:title="ratingLabels[index]"
|
|
28
|
-
class="mc-stars-input__label"
|
|
29
|
-
>
|
|
30
|
-
<span class="mc-stars-input__text">
|
|
31
|
-
{{ ratingLabels[index] }}
|
|
32
|
-
</span>
|
|
33
|
-
</label>
|
|
34
|
-
</template>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
import {
|
|
40
|
-
responsiveModifiers,
|
|
41
|
-
responsiveModifierValidators,
|
|
42
|
-
} from '../../utils/mozaicClasses';
|
|
43
|
-
|
|
44
|
-
const RATINGVALUE = 5;
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
name: 'MStarsInput',
|
|
48
|
-
|
|
49
|
-
inheritAttrs: false,
|
|
50
|
-
|
|
51
|
-
props: {
|
|
52
|
-
unselectedText: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: 'No opinion given',
|
|
55
|
-
},
|
|
56
|
-
name: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: 'rating',
|
|
59
|
-
},
|
|
60
|
-
size: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: 'm',
|
|
63
|
-
validator: (value) =>
|
|
64
|
-
responsiveModifierValidators(value, ['s', 'm', 'l', 'xl']),
|
|
65
|
-
},
|
|
66
|
-
ratingLabels: {
|
|
67
|
-
type: Array,
|
|
68
|
-
default() {
|
|
69
|
-
return ['Very bad', 'Bad', 'Medium', 'Good', 'Excellent'];
|
|
70
|
-
},
|
|
71
|
-
validator: function (value) {
|
|
72
|
-
return (
|
|
73
|
-
value.length === RATINGVALUE &&
|
|
74
|
-
value.every((item) => typeof item === 'string')
|
|
75
|
-
);
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
required: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: false,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
data() {
|
|
85
|
-
return {
|
|
86
|
-
id: null,
|
|
87
|
-
ratingValue: RATINGVALUE,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
computed: {
|
|
92
|
-
setClasses() {
|
|
93
|
-
const classes = [];
|
|
94
|
-
|
|
95
|
-
if (this.size) {
|
|
96
|
-
responsiveModifiers('mc-stars-input', this.size, classes);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return classes;
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
created() {
|
|
104
|
-
this.id = this._uid;
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
methods: {
|
|
108
|
-
incIndex(index) {
|
|
109
|
-
return index++;
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
</script>
|
|
114
|
-
|
|
115
|
-
<style lang="scss">
|
|
116
|
-
@import 'settings-tools/_all-settings';
|
|
117
|
-
@import 'components/_c.stars-input';
|
|
118
|
-
</style>
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="['mc-stars-result', setClasses]">
|
|
3
|
-
<span class="mc-stars-result__visual" />
|
|
4
|
-
<span class="mc-stars-result__text">
|
|
5
|
-
{{ scoreLabel }}: {{ closestScore }}/{{ ratingValue }}
|
|
6
|
-
</span>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
import {
|
|
12
|
-
responsiveModifiers,
|
|
13
|
-
responsiveModifierValidators,
|
|
14
|
-
} from '../../utils/mozaicClasses';
|
|
15
|
-
|
|
16
|
-
const RATINGVALUE = 5;
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
name: 'MStarsResult',
|
|
20
|
-
|
|
21
|
-
props: {
|
|
22
|
-
score: {
|
|
23
|
-
type: Number,
|
|
24
|
-
default: 0,
|
|
25
|
-
validator: (value) => value > 0 && value <= 5,
|
|
26
|
-
},
|
|
27
|
-
scoreLabel: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: 'Global score',
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: 'm',
|
|
34
|
-
validator: (value) =>
|
|
35
|
-
responsiveModifierValidators(value, ['s', 'm', 'l', 'xl']),
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
data() {
|
|
40
|
-
return {
|
|
41
|
-
id: null,
|
|
42
|
-
ratingValue: RATINGVALUE,
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
computed: {
|
|
46
|
-
authorizedValues() {
|
|
47
|
-
const authorizedValue = [];
|
|
48
|
-
for (let i = 0; i <= RATINGVALUE; i += 0.5) {
|
|
49
|
-
authorizedValue.push(i);
|
|
50
|
-
}
|
|
51
|
-
return authorizedValue;
|
|
52
|
-
},
|
|
53
|
-
closestScore() {
|
|
54
|
-
if (this.score > 0 && this.score <= this.ratingValue) {
|
|
55
|
-
return this.authorizedValues.reduce((a, b) => {
|
|
56
|
-
return Math.abs(b - this.score) < Math.abs(a - this.score) ? b : a;
|
|
57
|
-
});
|
|
58
|
-
} else {
|
|
59
|
-
return 0;
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
setClasses() {
|
|
63
|
-
const classes = [];
|
|
64
|
-
|
|
65
|
-
if (this.size) {
|
|
66
|
-
responsiveModifiers('mc-stars-result', this.size, classes);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (this.closestScore) {
|
|
70
|
-
const classNote = `score-${
|
|
71
|
-
(this.closestScore * 100) / this.ratingValue
|
|
72
|
-
}`;
|
|
73
|
-
responsiveModifiers('mc-stars-result', classNote, classes);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return classes;
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
created() {
|
|
81
|
-
this.id = this._uid;
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<style lang="scss">
|
|
87
|
-
@import 'settings-tools/_all-settings';
|
|
88
|
-
@import 'components/_c.stars-result';
|
|
89
|
-
</style>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import MStarsInput from './MStarsInput.vue';
|
|
2
|
-
import MStarsResult from './MStarsResult.vue';
|
|
3
|
-
|
|
4
|
-
MStarsInput.install = function (Vue) {
|
|
5
|
-
Vue.component(MStarsInput.name, MStarsInput);
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
MStarsResult.install = function (Vue) {
|
|
9
|
-
Vue.component(MStarsResult.name, MStarsResult);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { MStarsInput, MStarsResult };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<nav class='mc-stepper' :class="{ 'mc-stepper--compact': compact, 'mc-stepper--shrinked': steps.length > 3}"
|
|
3
|
-
:aria-label='accessibilityLabels.stepperDescription'>
|
|
4
|
-
<ol class='mc-stepper__list'>
|
|
5
|
-
<li
|
|
6
|
-
v-for='(step, idx) in steps'
|
|
7
|
-
:key='`mc-stepper__item-${idx}`'
|
|
8
|
-
class='mc-stepper__item'
|
|
9
|
-
:class="{
|
|
10
|
-
'mc-stepper__item--validated': isStepValidated(idx),
|
|
11
|
-
'mc-stepper__item--current': step.isCurrent,
|
|
12
|
-
}"
|
|
13
|
-
:aria-current="step.isCurrent ? 'step' : false"
|
|
14
|
-
:aria-label='stepDescription(step,idx)'
|
|
15
|
-
:style='`--steps: ${ steps.length }; --current: ${ idx +1 };`'
|
|
16
|
-
@click="isStepValidated(idx) && $emit('step-changed', step)"
|
|
17
|
-
>
|
|
18
|
-
<div class='mc-stepper__indicator' aria-hidden='true'>
|
|
19
|
-
<m-icon v-if='isStepValidated(idx)' name='NotificationAvailable16' class='mc-stepper__icon' />
|
|
20
|
-
<span v-else-if='step.isCurrent'>{{ idx + 1 }}</span>
|
|
21
|
-
</div>
|
|
22
|
-
<div class='mc-stepper__detail'>
|
|
23
|
-
<span class='mc-stepper__title'>{{ idx + 1 }} / {{ steps.length }}</span>
|
|
24
|
-
<span class='mc-stepper__label'>{{ step.label }}</span>
|
|
25
|
-
</div>
|
|
26
|
-
</li>
|
|
27
|
-
</ol>
|
|
28
|
-
</nav>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
import MIcon from '../icon/MIcon.vue';
|
|
33
|
-
|
|
34
|
-
export default {
|
|
35
|
-
name: 'MStepper',
|
|
36
|
-
components: {
|
|
37
|
-
MIcon
|
|
38
|
-
},
|
|
39
|
-
props: {
|
|
40
|
-
steps: {
|
|
41
|
-
type: Array,
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
compact: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false
|
|
47
|
-
},
|
|
48
|
-
accessibilityLabels: {
|
|
49
|
-
type: Object,
|
|
50
|
-
required: true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
methods: {
|
|
54
|
-
isStepValidated(index) {
|
|
55
|
-
return index < this.steps.findIndex(step => step.isCurrent);
|
|
56
|
-
},
|
|
57
|
-
stepDescription(step, index) {
|
|
58
|
-
return '#' + (index + 1) + ' ' + step.label + ', ' + this.stepStateLabel(step,index);
|
|
59
|
-
},
|
|
60
|
-
stepStateLabel(step, index) {
|
|
61
|
-
return this.isStepValidated(index) ? this.accessibilityLabels.validatedLabel : step.isCurrent ? this.accessibilityLabels.currentLabel : this.accessibilityLabels.disabledLabel;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style lang='scss' scoped>
|
|
68
|
-
@import 'settings-tools/_all-settings';
|
|
69
|
-
@import 'components/_c.stepper';
|
|
70
|
-
</style>
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="['mc-tabs', setClasses]">
|
|
3
|
-
<ul
|
|
4
|
-
v-if="type !== 'dropdown'"
|
|
5
|
-
ref="tablist"
|
|
6
|
-
class="mc-tabs__nav"
|
|
7
|
-
role="tablist"
|
|
8
|
-
:aria-label="description"
|
|
9
|
-
>
|
|
10
|
-
<li
|
|
11
|
-
v-for="(tab, index) in tabs"
|
|
12
|
-
:key="`tab-${index}`"
|
|
13
|
-
class="mc-tabs__item"
|
|
14
|
-
role="presentation"
|
|
15
|
-
>
|
|
16
|
-
<component
|
|
17
|
-
:is="tab.href ? (tab.disabled ? 'span' : 'a') : 'button'"
|
|
18
|
-
:id="tab.id"
|
|
19
|
-
ref="tab"
|
|
20
|
-
:href="tab.href ? (!tab.disabled ? tab.href : null) : null"
|
|
21
|
-
:type="!tab.href ? 'button' : null"
|
|
22
|
-
:disabled="!tab.href && tab.disabled ? true : null"
|
|
23
|
-
class="mc-tabs__link"
|
|
24
|
-
role="tab"
|
|
25
|
-
:aria-selected="tab.active ? 'true' : 'false'"
|
|
26
|
-
:class="setActiveClass(tab)"
|
|
27
|
-
@click="
|
|
28
|
-
manageTabs(
|
|
29
|
-
$event.target,
|
|
30
|
-
$event,
|
|
31
|
-
Object.assign({ index: index }, tab)
|
|
32
|
-
)
|
|
33
|
-
"
|
|
34
|
-
>
|
|
35
|
-
{{ tab.text }}
|
|
36
|
-
</component>
|
|
37
|
-
</li>
|
|
38
|
-
</ul>
|
|
39
|
-
<m-select v-else v-bind="selectAttributes" :options="tabs" />
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script>
|
|
44
|
-
import MSelect from '../select/MSelect.vue';
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
name: 'MTab',
|
|
48
|
-
|
|
49
|
-
components: {
|
|
50
|
-
MSelect,
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
props: {
|
|
54
|
-
tabs: {
|
|
55
|
-
type: Array,
|
|
56
|
-
required: true,
|
|
57
|
-
default() {
|
|
58
|
-
return [];
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
type: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: 'tabs',
|
|
64
|
-
validator: (value) => ['tabs', 'dropdown'].includes(value),
|
|
65
|
-
},
|
|
66
|
-
description: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: 'Tabs',
|
|
69
|
-
},
|
|
70
|
-
align: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: 'auto',
|
|
73
|
-
validator: (value) => ['auto', 'full', 'centered'].includes(value),
|
|
74
|
-
},
|
|
75
|
-
shadow: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: true,
|
|
78
|
-
},
|
|
79
|
-
selectAttributes: {
|
|
80
|
-
type: Object,
|
|
81
|
-
default: null,
|
|
82
|
-
},
|
|
83
|
-
activeIndex: {
|
|
84
|
-
type: Number,
|
|
85
|
-
default: 0,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
data() {
|
|
90
|
-
return {
|
|
91
|
-
tablist: null,
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
computed: {
|
|
96
|
-
setClasses() {
|
|
97
|
-
const classes = [
|
|
98
|
-
{
|
|
99
|
-
'mc-tabs--full': this.align === 'full',
|
|
100
|
-
'mc-tabs--full-centered': this.align === 'centered',
|
|
101
|
-
'mc-tabs--dropdown': this.type === 'dropdown',
|
|
102
|
-
'mc-tabs--no-shadow': !this.shadow,
|
|
103
|
-
},
|
|
104
|
-
];
|
|
105
|
-
|
|
106
|
-
return classes;
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
watch: {
|
|
111
|
-
activeIndex(newValue) {
|
|
112
|
-
const tab = this.getTabFromIndex(newValue);
|
|
113
|
-
if (tab && this.tabs[newValue]) {
|
|
114
|
-
this.manageTabs(tab, null, Object.assign({index: newValue}, this.tabs[newValue]));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
mounted: function () {
|
|
120
|
-
this.$nextTick(() => {
|
|
121
|
-
if (this.type === 'tabs') {
|
|
122
|
-
this.tablist = this.$refs.tablist;
|
|
123
|
-
|
|
124
|
-
if (this.activeIndex) {
|
|
125
|
-
const tab = this.getTabFromIndex(this.activeIndex);
|
|
126
|
-
if (tab) {
|
|
127
|
-
this.manageTabs(tab);
|
|
128
|
-
}
|
|
129
|
-
} else {
|
|
130
|
-
const isActive = this.tabs.some((tab) =>
|
|
131
|
-
Object.prototype.hasOwnProperty.call(tab, 'active')
|
|
132
|
-
);
|
|
133
|
-
if (!isActive) {
|
|
134
|
-
const firstTab = this.tablist.querySelector('.mc-tabs__link');
|
|
135
|
-
this.manageTabs(firstTab);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
methods: {
|
|
143
|
-
setActiveClass: function (tab) {
|
|
144
|
-
const tabClasses = [];
|
|
145
|
-
|
|
146
|
-
if (tab.active) {
|
|
147
|
-
tabClasses.push('mc-tabs__link--selected');
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (tab.disabled) {
|
|
151
|
-
tabClasses.push('mc-tabs__link--disabled');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return tabClasses;
|
|
155
|
-
},
|
|
156
|
-
manageTabs: function (el, e, tab) {
|
|
157
|
-
if (tab && tab.disabled) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (e) {
|
|
161
|
-
this.$emit('tab-clicked', e.target, tab);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
this.tablist.querySelectorAll('.mc-tabs__link').forEach((el) => {
|
|
165
|
-
el.classList.remove('mc-tabs__link--selected');
|
|
166
|
-
el.setAttribute('aria-selected', 'false');
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
el.classList.add('mc-tabs__link--selected');
|
|
170
|
-
el.setAttribute('aria-selected', 'true');
|
|
171
|
-
},
|
|
172
|
-
getTabFromIndex: function (index) {
|
|
173
|
-
if (this.tablist && this.tablist.children[index] && this.tablist.children[index].children[0]) {
|
|
174
|
-
return this.tablist.children[index].children[0];
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
</script>
|
|
180
|
-
|
|
181
|
-
<style lang="scss">
|
|
182
|
-
@import 'settings-tools/_all-settings';
|
|
183
|
-
@import 'components/_c.tabs';
|
|
184
|
-
</style>
|