@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.
Files changed (179) hide show
  1. package/LICENSE +51 -0
  2. package/README.md +218 -84
  3. package/dist/mozaic-vue.css +1 -1
  4. package/dist/mozaic-vue.d.ts +920 -0
  5. package/dist/mozaic-vue.js +877 -0
  6. package/dist/mozaic-vue.js.map +1 -0
  7. package/dist/mozaic-vue.umd.cjs +2 -0
  8. package/dist/mozaic-vue.umd.cjs.map +1 -0
  9. package/env.d.ts +1 -0
  10. package/package.json +80 -50
  11. package/src/components/Contributing.mdx +118 -0
  12. package/src/components/GettingStarted.mdx +39 -0
  13. package/src/components/Introduction.mdx +54 -0
  14. package/src/components/Support.mdx +18 -0
  15. package/src/components/badge/MBadge.spec.ts +16 -0
  16. package/src/components/badge/MBadge.stories.ts +50 -0
  17. package/src/components/badge/MBadge.vue +36 -34
  18. package/src/components/button/MButton.spec.ts +191 -0
  19. package/src/components/button/MButton.stories.ts +66 -0
  20. package/src/components/button/MButton.vue +98 -154
  21. package/src/components/checkbox/MCheckbox.spec.ts +104 -0
  22. package/src/components/checkbox/MCheckbox.stories.ts +83 -0
  23. package/src/components/checkbox/MCheckbox.vue +60 -101
  24. package/src/components/checkboxgroup/MCheckboxGroup.spec.ts +78 -0
  25. package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +61 -0
  26. package/src/components/checkboxgroup/MCheckboxGroup.vue +97 -0
  27. package/src/components/field/MField.spec.ts +166 -0
  28. package/src/components/field/MField.stories.ts +376 -0
  29. package/src/components/field/MField.vue +78 -61
  30. package/src/components/fieldgroup/MFieldGroup.spec.ts +165 -0
  31. package/src/components/fieldgroup/MFieldGroup.stories.ts +274 -0
  32. package/src/components/fieldgroup/MFieldGroup.vue +79 -0
  33. package/src/components/iconbutton/MIconButton.spec.ts +108 -0
  34. package/src/components/iconbutton/MIconButton.stories.ts +66 -0
  35. package/src/components/iconbutton/MIconButton.vue +73 -0
  36. package/src/components/link/MLink.spec.ts +154 -0
  37. package/src/components/link/MLink.stories.ts +98 -0
  38. package/src/components/link/MLink.vue +86 -109
  39. package/src/components/loader/MLoader.spec.ts +104 -0
  40. package/src/components/loader/MLoader.stories.ts +45 -0
  41. package/src/components/loader/MLoader.vue +65 -55
  42. package/src/components/overlay/MOverlay.spec.ts +51 -0
  43. package/src/components/overlay/MOverlay.stories.ts +40 -0
  44. package/src/components/overlay/MOverlay.vue +27 -19
  45. package/src/components/quantityselector/MQuantitySelector.spec.ts +262 -0
  46. package/src/components/quantityselector/MQuantitySelector.stories.ts +89 -0
  47. package/src/components/quantityselector/MQuantitySelector.vue +160 -136
  48. package/src/components/radio/MRadio.spec.ts +104 -0
  49. package/src/components/radio/MRadio.stories.ts +68 -0
  50. package/src/components/radio/MRadio.vue +56 -39
  51. package/src/components/radiogroup/MRadioGroup.spec.ts +54 -0
  52. package/src/components/radiogroup/MRadioGroup.stories.ts +61 -0
  53. package/src/components/radiogroup/MRadioGroup.vue +79 -0
  54. package/src/components/select/MSelect.spec.ts +114 -0
  55. package/src/components/select/MSelect.stories.ts +101 -0
  56. package/src/components/select/MSelect.vue +77 -119
  57. package/src/components/statusbadge/MStatusBadge.stories.ts +45 -0
  58. package/src/components/statusbadge/MStatusBadge.vue +40 -0
  59. package/src/components/statusbadge/MStatusDot.vue +32 -0
  60. package/src/components/statusbadge/MstatusBadge.spec.ts +16 -0
  61. package/src/components/textarea/MTextArea.spec.ts +112 -0
  62. package/src/components/textarea/MTextArea.stories.ts +67 -0
  63. package/src/components/textarea/MTextArea.vue +81 -42
  64. package/src/components/textinput/MTextInput.spec.ts +121 -0
  65. package/src/components/textinput/MTextInput.stories.ts +114 -0
  66. package/src/components/textinput/MTextInput.vue +127 -47
  67. package/src/components/toggle/MToggle.spec.ts +99 -0
  68. package/src/components/toggle/MToggle.stories.ts +68 -0
  69. package/src/components/toggle/MToggle.vue +63 -103
  70. package/src/components/usingIcons.mdx +43 -0
  71. package/src/components/usingPresets.mdx +125 -0
  72. package/src/main.ts +39 -0
  73. package/dist/demo.html +0 -1
  74. package/dist/mozaic-vue.adeo.css +0 -45
  75. package/dist/mozaic-vue.adeo.umd.js +0 -41775
  76. package/dist/mozaic-vue.common.js +0 -41765
  77. package/dist/mozaic-vue.common.js.map +0 -1
  78. package/dist/mozaic-vue.umd.js +0 -41776
  79. package/dist/mozaic-vue.umd.js.map +0 -1
  80. package/dist/mozaic-vue.umd.min.js +0 -4
  81. package/dist/mozaic-vue.umd.min.js.map +0 -1
  82. package/postinstall.js +0 -3
  83. package/src/components/accordion/MAccordion.vue +0 -128
  84. package/src/components/accordion/index.js +0 -7
  85. package/src/components/autocomplete/MAutocomplete.vue +0 -198
  86. package/src/components/autocomplete/index.js +0 -7
  87. package/src/components/badge/index.js +0 -7
  88. package/src/components/breadcrumb/MBreadcrumb.vue +0 -73
  89. package/src/components/breadcrumb/index.js +0 -7
  90. package/src/components/button/index.js +0 -7
  91. package/src/components/card/MCard.vue +0 -78
  92. package/src/components/card/index.js +0 -7
  93. package/src/components/checkbox/MCheckboxGroup.vue +0 -155
  94. package/src/components/checkbox/index.js +0 -12
  95. package/src/components/container/MContainer.vue +0 -33
  96. package/src/components/container/index.js +0 -7
  97. package/src/components/datatable/MDataTable.vue +0 -651
  98. package/src/components/datatable/MDataTableHeader.vue +0 -55
  99. package/src/components/datatable/MDataTableTop.vue +0 -35
  100. package/src/components/datatable/helpers.js +0 -132
  101. package/src/components/datatable/index.js +0 -12
  102. package/src/components/field/index.js +0 -7
  103. package/src/components/fileuploader/MFileResult.vue +0 -149
  104. package/src/components/fileuploader/MFileUploader.vue +0 -142
  105. package/src/components/fileuploader/index.js +0 -7
  106. package/src/components/flag/MFlag.vue +0 -46
  107. package/src/components/flag/index.js +0 -7
  108. package/src/components/heading/MHeading.vue +0 -75
  109. package/src/components/heading/index.js +0 -7
  110. package/src/components/hero/MHero.vue +0 -93
  111. package/src/components/hero/index.js +0 -7
  112. package/src/components/icon/MIcon.vue +0 -120
  113. package/src/components/icon/index.js +0 -7
  114. package/src/components/index.js +0 -43
  115. package/src/components/layer/MLayer.vue +0 -208
  116. package/src/components/layer/index.js +0 -7
  117. package/src/components/link/index.js +0 -7
  118. package/src/components/listbox/MListBox.vue +0 -106
  119. package/src/components/listbox/index.js +0 -7
  120. package/src/components/loader/index.js +0 -7
  121. package/src/components/modal/MModal.vue +0 -179
  122. package/src/components/modal/index.js +0 -7
  123. package/src/components/notification/MNotification.vue +0 -110
  124. package/src/components/notification/index.js +0 -7
  125. package/src/components/optionbutton/MOptionButton.vue +0 -67
  126. package/src/components/optionbutton/index.js +0 -7
  127. package/src/components/optioncard/MOptionCard.vue +0 -132
  128. package/src/components/optioncard/index.js +0 -7
  129. package/src/components/optiongroup/MOptionGroup.vue +0 -18
  130. package/src/components/optiongroup/index.js +0 -7
  131. package/src/components/overlay/MOverlayLoader.vue +0 -43
  132. package/src/components/overlay/index.js +0 -12
  133. package/src/components/pagination/MPagination.vue +0 -162
  134. package/src/components/pagination/index.js +0 -7
  135. package/src/components/passwordinput/MPasswordInput.vue +0 -96
  136. package/src/components/passwordinput/index.js +0 -7
  137. package/src/components/phonenumber/MPhoneNumber.vue +0 -390
  138. package/src/components/phonenumber/index.js +0 -7
  139. package/src/components/progressbar/MProgress.vue +0 -102
  140. package/src/components/progressbar/index.js +0 -7
  141. package/src/components/quantityselector/index.js +0 -7
  142. package/src/components/radio/MRadioGroup.vue +0 -111
  143. package/src/components/radio/index.js +0 -12
  144. package/src/components/ratingstars/MStarsInput.vue +0 -118
  145. package/src/components/ratingstars/MStarsResult.vue +0 -89
  146. package/src/components/ratingstars/index.js +0 -12
  147. package/src/components/select/index.js +0 -7
  148. package/src/components/stepper/MStepper.vue +0 -70
  149. package/src/components/stepper/index.js +0 -7
  150. package/src/components/tabs/MTab.vue +0 -184
  151. package/src/components/tabs/index.js +0 -7
  152. package/src/components/tags/MTag.vue +0 -173
  153. package/src/components/tags/index.js +0 -7
  154. package/src/components/textarea/index.js +0 -7
  155. package/src/components/textinput/MTextInputField.vue +0 -105
  156. package/src/components/textinput/MTextInputIcon.vue +0 -42
  157. package/src/components/textinput/index.js +0 -7
  158. package/src/components/toggle/index.js +0 -7
  159. package/src/components/tooltip/MTooltip.vue +0 -42
  160. package/src/components/tooltip/index.js +0 -7
  161. package/src/index.js +0 -62
  162. package/src/shims-tsx.d.ts +0 -13
  163. package/src/shims.vue.d.ts +0 -4
  164. package/src/tokens/adeo/android/colors.xml +0 -391
  165. package/src/tokens/adeo/android/font_dimens.xml +0 -18
  166. package/src/tokens/adeo/css/_variables.scss +0 -385
  167. package/src/tokens/adeo/css/root.scss +0 -387
  168. package/src/tokens/adeo/ios/StyleDictionaryColor.h +0 -399
  169. package/src/tokens/adeo/ios/StyleDictionaryColor.m +0 -411
  170. package/src/tokens/adeo/ios/StyleDictionaryColor.swift +0 -394
  171. package/src/tokens/adeo/ios/StyleDictionarySize.h +0 -69
  172. package/src/tokens/adeo/ios/StyleDictionarySize.m +0 -70
  173. package/src/tokens/adeo/ios/StyleDictionarySize.swift +0 -71
  174. package/src/tokens/adeo/js/tokens.js +0 -483
  175. package/src/tokens/adeo/js/tokensObject.js +0 -10354
  176. package/src/tokens/adeo/scss/_tokens.scss +0 -1300
  177. package/src/utils/mozaicClasses.js +0 -16
  178. package/src/utils/theme.validator.js +0 -19
  179. package/types/index.d.ts +0 -100
@@ -1,102 +0,0 @@
1
- <template>
2
- <div class="mc-progressbar" :class="setClasses">
3
- <div
4
- ref="indicator"
5
- class="mc-progressbar__indicator"
6
- role="progressbar"
7
- :style="`width: ${setProgressValue()}%;`"
8
- :aria-valuenow="value"
9
- :aria-valuemin="valueMin"
10
- :aria-valuemax="valueMax"
11
- >
12
- &nbsp;
13
- </div>
14
- <div v-if="percent" class="mc-progressbar__percentage">
15
- {{ setProgressValue() }}%
16
- </div>
17
- </div>
18
- </template>
19
-
20
- <script>
21
- export default {
22
- name: 'MProgress',
23
-
24
- props: {
25
- value: {
26
- type: Number,
27
- default: 0,
28
- },
29
- size: {
30
- type: String,
31
- default: 'm',
32
- validator: (value) => ['xs', 's', 'm'].includes(value),
33
- },
34
- valueMin: {
35
- type: Number,
36
- default: 0,
37
- },
38
- valueMax: {
39
- type: Number,
40
- default: 100,
41
- },
42
- branded: {
43
- type: Boolean,
44
- default: false,
45
- },
46
- percent: {
47
- type: Boolean,
48
- default: false,
49
- },
50
- },
51
-
52
- data() {
53
- return {
54
- currentValue: this.value,
55
- };
56
- },
57
-
58
- computed: {
59
- setClasses() {
60
- const classes = [
61
- {
62
- 'mc-progressbar--branded': this.branded,
63
- 'mc-progressbar--percent': this.percent,
64
- 'mc-progressbar--half':
65
- this.percent && this.currentValue >= this.valueMax / 2,
66
- },
67
- ];
68
-
69
- if (this.size) {
70
- classes.push(`mc-progressbar--${this.size}`);
71
- }
72
-
73
- return classes;
74
- },
75
- },
76
-
77
- methods: {
78
- setProgressValue() {
79
- const initValue = this.value;
80
-
81
- if (initValue > this.valueMax) {
82
- /* eslint-disable no-console */
83
- console.error(
84
- // eslint-disable-next-line quotes
85
- "You can't provide a value that is greater than the valueMax property"
86
- );
87
- /* eslint-enable no-console */
88
- return this.currentValue;
89
- }
90
-
91
- this.currentValue = Math.round(initValue);
92
-
93
- return this.currentValue;
94
- },
95
- },
96
- };
97
- </script>
98
-
99
- <style lang="scss">
100
- @import 'settings-tools/_all-settings';
101
- @import 'components/_c.progressbar';
102
- </style>
@@ -1,7 +0,0 @@
1
- import MProgress from './MProgress.vue';
2
-
3
- MProgress.install = function (Vue) {
4
- Vue.component(MProgress.name, MProgress);
5
- };
6
-
7
- export { MProgress };
@@ -1,7 +0,0 @@
1
- import MQuantitySelector from './MQuantitySelector.vue';
2
-
3
- MQuantitySelector.install = function (Vue) {
4
- Vue.component(MQuantitySelector.name, MQuantitySelector);
5
- };
6
-
7
- export { MQuantitySelector };
@@ -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,7 +0,0 @@
1
- import MSelect from './MSelect.vue';
2
-
3
- MSelect.install = function (Vue) {
4
- Vue.component(MSelect.name, MSelect);
5
- };
6
-
7
- export { MSelect };
@@ -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,7 +0,0 @@
1
- import MStepper from './MStepper.vue';
2
-
3
- MStepper.install = function (Vue) {
4
- Vue.component(MStepper.name, MStepper);
5
- };
6
-
7
- export { MStepper };