aloha-vue 2.74.0 → 2.75.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +22 -21
  3. package/dist/aloha-vue.css +13594 -13594
  4. package/dist/aloha-vue.css.map +1 -1
  5. package/dist/aloha-vue.es.js +59266 -64918
  6. package/dist/aloha-vue.umd.js +338 -211
  7. package/package.json +27 -34
  8. package/scss/components/ATable.scss +2 -2
  9. package/scss/utils/button.scss +362 -362
  10. package/scss/utils/funktions.scss +162 -162
  11. package/src/AAccordion/AAccordionItem/AAccordionItem.js +235 -230
  12. package/src/ACarousel/ACarousel.js +7 -2
  13. package/src/ADropdown/ADropdown.js +4 -1
  14. package/src/AFilters/AFilterCenter/AFilterCenter.js +5 -1
  15. package/src/AFilters/AFilterCenter/AFilterCenterItem/AFilterCenterItem.js +7 -2
  16. package/src/AFilters/AFiltersHorizontal/AFiltersHorizontal.js +412 -396
  17. package/src/AFilters/AFiltersHorizontal/AFiltersHorizontalFilter/AFiltersHorizontalFilter.js +102 -99
  18. package/src/AFilters/AFiltersHorizontal/compositionAPI/FiltersSavedDeleteAPI.js +108 -108
  19. package/src/AFilters/AFiltersMain/AFiltersMain.js +114 -111
  20. package/src/AFilters/AFiltersSaveModal/compositionAPI/SaveAPI.js +65 -65
  21. package/src/ALinkCopy/ALinkCopy.js +98 -95
  22. package/src/ALinkCopy/compositionAPI/CopyAPI.js +48 -48
  23. package/src/AList/__tests__/AList.test.js +33 -33
  24. package/src/AList/compositionAPI/__tests__/TagAPI.test.js +43 -43
  25. package/src/AMenu/AMenu.js +4 -1
  26. package/src/AMenu/AMenuBreadcrumbs/AMenuBreadcrumbs.js +240 -237
  27. package/src/AMenu/AMenuPanelLink/AMenuPanelLink.js +4 -1
  28. package/src/AMenu/AMenuSearchPanelBreadcrumbs/AMenuSearchPanelBreadcrumbs.js +122 -119
  29. package/src/AModalWizard/AModalWizard.js +58 -53
  30. package/src/AModalWizard/compositionAPI/__tests__/ScrollAPI.test.js +46 -46
  31. package/src/APagination/APaginationPages/APaginationPages.js +15 -4
  32. package/src/ARate/ARate.js +254 -249
  33. package/src/ARate/ARateIcon/ADecimalIcon/ADecimalIcon.js +53 -50
  34. package/src/ARate/ARateIcon/ARateIcon.js +109 -104
  35. package/src/AResizer/AResizer.js +167 -162
  36. package/src/ATable/ATableHeaderTh/compositionAPI/SortAPI.js +172 -167
  37. package/src/ATable/ATableHeaderThAction/ATableHeaderThAction.js +14 -4
  38. package/src/ATable/ATableHeaderThAction/ATableHeaderThActionItem/ATableHeaderThActionItem.js +191 -184
  39. package/src/ATable/ATablePreviewDown/ATablePreviewDown.js +72 -69
  40. package/src/ATable/ATablePreviewRight/ATablePreviewRight.js +265 -258
  41. package/src/ATable/ATableSortingAdditional/ATableSortingAdditional.js +224 -219
  42. package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.AttributesAPI.test.js +39 -39
  43. package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.ColumnsAPI.test.js +68 -68
  44. package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.DropdownAPI.test.js +45 -45
  45. package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.FormAPI.test.js +95 -95
  46. package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.ModelAPI.test.js +1 -1
  47. package/src/ATable/ATableTd/ATableTd.js +4 -1
  48. package/src/ATable/ATableTdAction/ATableTdAction.js +19 -12
  49. package/src/ATable/ATableTopPanel/ATableTopPanel.js +11 -3
  50. package/src/ATable/ATableTr/ATableTr.js +408 -405
  51. package/src/ATable/__tests__/ATable.HeaderSlot.test.js +102 -97
  52. package/src/ATable/__tests__/ATable.RowIdsAPI.test.js +66 -66
  53. package/src/ATableForm/ATableForm.js +88 -85
  54. package/src/ATableForm/ATableFormCellAction/ATableFormCellAction.js +14 -4
  55. package/src/ATableForm/ATableFormCellDnd/ATableFormCellDnd.js +196 -187
  56. package/src/ATableForm/ATableFormRow/compositionAPI/EditAPI.js +104 -104
  57. package/src/ATableForm/__tests__/ATableForm.DragAndDropAPI.test.js +200 -212
  58. package/src/ATableForm/__tests__/ATableForm.ListView.test.js +134 -174
  59. package/src/ATableForm/compositionAPI/IconsAPI.js +24 -21
  60. package/src/AVerticalScroll/AVerticalScroll.js +182 -177
  61. package/src/AWizard/AWizard.js +26 -21
  62. package/src/AWizard/AWizardStep/AWizardStep.js +275 -270
  63. package/src/AWizard/compositionAPI/__tests__/ChangeStepAPI.test.js +32 -32
  64. package/src/AWizard/compositionAPI/__tests__/LocalAPI.test.js +55 -55
  65. package/src/PuxDatepicker/PuxDatepickerCalendarPanel/PuxDatepickerCalendarPanel.js +646 -648
  66. package/src/PuxDatepicker/panel/PanelDate/PanelDate.js +300 -301
  67. package/src/PuxDatepicker/panel/PanelMonth/PanelMonth.js +148 -149
  68. package/src/PuxDatepicker/panel/PanelTime/PanelTime.js +256 -257
  69. package/src/PuxDatepicker/panel/PanelYear/PanelYear.js +136 -137
  70. package/src/PuxDatepicker/utils/index.js +100 -100
  71. package/src/compositionAPI/AHttpAPI.js +593 -593
  72. package/src/compositionAPI/__tests__/AHttpAPI.test.js +42 -42
  73. package/src/filters/__tests__/filterBoolean.test.js +38 -38
  74. package/src/filters/__tests__/filterCapitalize.test.js +38 -38
  75. package/src/filters/__tests__/filterCurrency.test.js +21 -21
  76. package/src/filters/__tests__/filterDate.test.js +42 -42
  77. package/src/filters/__tests__/filterDefaultForEmpty.test.js +24 -24
  78. package/src/filters/__tests__/filterEmail.test.js +42 -42
  79. package/src/filters/__tests__/filterEscapeHtml.test.js +45 -45
  80. package/src/filters/__tests__/filterFileSize.test.js +45 -45
  81. package/src/filters/__tests__/filterFloat.test.js +74 -74
  82. package/src/filters/__tests__/filterJson.test.js +74 -74
  83. package/src/filters/__tests__/filterKeyValue.test.js +50 -50
  84. package/src/filters/__tests__/filterLimitTo.test.js +39 -39
  85. package/src/filters/__tests__/filterLink.test.js +41 -41
  86. package/src/filters/__tests__/filterList.test.js +149 -149
  87. package/src/filters/__tests__/filterLowerCase.test.js +38 -38
  88. package/src/filters/__tests__/filterMask.test.js +80 -80
  89. package/src/filters/__tests__/filterPropertyByValue.test.js +27 -27
  90. package/src/filters/__tests__/filterSearchHighlight.test.js +129 -129
  91. package/src/filters/__tests__/filterUpperCase.test.js +38 -38
  92. package/src/filters/__tests__/filterValueByCondition.test.js +3 -3
  93. package/src/filters/filterJson.js +39 -39
  94. package/src/filters/filterValueByCondition.js +2 -2
  95. package/src/plugins/AAlertPlugin.js +16 -5
  96. package/src/plugins/AMultiselectOrderedPlugin.js +88 -81
  97. package/src/plugins/ASelectPlugin.js +12 -10
  98. package/src/ui/ACheckbox/ACheckbox.js +82 -79
  99. package/src/ui/ADatepicker/compositionAPI/EventsAPI.js +297 -297
  100. package/src/ui/ADatepicker/utils/index.js +76 -76
  101. package/src/ui/ADatepickerAlt/ADatepicker.js +912 -912
  102. package/src/ui/ADatepickerAlt/utils/index.js +98 -98
  103. package/src/ui/AFieldset/__tests__/AFieldset.ClassColumn.test.js +113 -114
  104. package/src/ui/AFormElementBtnClear/AFormElementBtnClear.js +4 -1
  105. package/src/ui/AInputCurrency/AInputCurrency.js +20 -15
  106. package/src/ui/AInputCurrency/__tests__/AInputCurrency.ModelAPI.test.js +73 -73
  107. package/src/ui/AInputNumber/AInputNumber.js +17 -12
  108. package/src/ui/AJson/AJson.js +12 -3
  109. package/src/ui/AJson/compositionAPI/JsonAPI.js +116 -116
  110. package/src/ui/ALabel/__tests__/ALabel.IdAPI.test.js +42 -42
  111. package/src/ui/ALabel/__tests__/ALabel.LabelAPI.test.js +33 -33
  112. package/src/ui/ARadio/ARadio.js +80 -77
  113. package/src/ui/ASelect/ASelect.js +390 -383
  114. package/src/ui/ASelect/ASelectElement/ASelectElement.js +179 -176
  115. package/src/ui/ASelect/ASelectValueCloseable/ASelectValueCloseable.js +143 -141
  116. package/src/ui/ASelect/__tests__/SelectedFirstAPI.test.js +101 -101
  117. package/src/ui/ASelect/__tests__/SelectedVisibleAPI.test.js +98 -98
  118. package/src/ui/ASlider/compositionAPI/SliderAPI.js +23 -23
  119. package/src/ui/AValidatedJson/AValidatedJson.js +4 -1
  120. package/src/ui/AValidatedJson/AValidatedJsonItem/AValidatedJsonItem.js +308 -298
  121. package/src/ui/compositionApi/UiCollapseAPI.js +68 -63
  122. package/src/ui/compositionApi/UiInputAutofillAPI.js +41 -41
  123. package/src/ui/compositionApi/__tests__/UIDataGroupAPI.test.js +106 -106
  124. package/src/ui/compositionApi/__tests__/UIExcludeRenderAttributesAPI.test.js +39 -39
  125. package/src/ui/compositionApi/__tests__/UiDataWithKeyIdAndLabelAPI.test.js +128 -128
  126. package/src/ui/compositionApi/__tests__/UiSearchAPI.test.js +71 -71
  127. package/src/utils/EventBus.js +51 -8
  128. package/src/utils/__tests__/EventBus.test.js +138 -0
  129. package/src/utils/__tests__/utils.aOrderBy.test.js +1 -1
  130. package/src/utils/__tests__/utils.aSortBy.test.js +1 -1
  131. package/src/utils/__tests__/utils.getTotalNestedCount.test.js +56 -56
  132. package/src/utils/__tests__/utils.isArrayOfArrays.test.js +44 -44
  133. package/src/utils/__tests__/utils.isArrayOfStrings.test.js +36 -36
  134. package/src/utils/__tests__/utilsArray.aFirst.test.js +1 -1
  135. package/src/utils/__tests__/utilsArray.aLast.test.js +1 -1
  136. package/src/utils/__tests__/utilsLang.isArguments.test.js +1 -1
  137. package/src/utils/__tests__/utilsLang.isArray.test.js +1 -1
  138. package/src/utils/__tests__/utilsLang.isArrayBuffer.test.js +1 -1
  139. package/src/utils/__tests__/utilsLang.isBoolean.test.js +1 -1
  140. package/src/utils/__tests__/utilsLang.isBuffer.test.js +1 -1
  141. package/src/utils/__tests__/utilsLang.isDate.test.js +1 -1
  142. package/src/utils/__tests__/utilsLang.isElement.test.js +5 -3
  143. package/src/utils/__tests__/utilsLang.isError.test.js +1 -1
  144. package/src/utils/__tests__/utilsLang.isFinite.test.js +1 -1
  145. package/src/utils/__tests__/utilsLang.isFunction.test.js +1 -1
  146. package/src/utils/__tests__/utilsLang.isInteger.test.js +1 -1
  147. package/src/utils/__tests__/utilsLang.isMap.test.js +1 -1
  148. package/src/utils/__tests__/utilsLang.isNaN.test.js +1 -1
  149. package/src/utils/__tests__/utilsLang.isNil.test.js +1 -1
  150. package/src/utils/__tests__/utilsLang.isNull.test.js +1 -1
  151. package/src/utils/__tests__/utilsLang.isNumber.test.js +1 -1
  152. package/src/utils/__tests__/utilsLang.isObject.test.js +1 -1
  153. package/src/utils/__tests__/utilsLang.isObjectLike.test.js +5 -3
  154. package/src/utils/__tests__/utilsLang.isPlainObject.test.js +3 -2
  155. package/src/utils/__tests__/utilsLang.isPromise.test.js +5 -2
  156. package/src/utils/__tests__/utilsLang.isRegExp.test.js +1 -1
  157. package/src/utils/__tests__/utilsLang.isSet.test.js +1 -1
  158. package/src/utils/__tests__/utilsLang.isString.test.js +1 -1
  159. package/src/utils/__tests__/utilsLang.isSymbol.test.js +5 -3
  160. package/src/utils/__tests__/utilsLang.isUndefined.test.js +1 -1
  161. package/src/utils/__tests__/utilsLang.isWeakMap.test.js +1 -1
  162. package/src/utils/__tests__/utilsLang.isWeakSet.test.js +1 -1
  163. package/src/utils/__tests__/utilsMath.isEven.test.js +43 -43
  164. package/src/utils/__tests__/utilsMath.isOdd.test.js +43 -43
  165. package/src/utils/__tests__/utilsUi.isModelForFilterNotEmpty.test.js +65 -65
  166. package/src/utils/autosize.js +1 -1
@@ -1,270 +1,275 @@
1
- import {
2
- h,
3
- } from "vue";
4
-
5
- import AElement from "../../AElement/AElement";
6
- import AIcon from "../../AIcon/AIcon";
7
- import ATranslation from "../../ATranslation/ATranslation";
8
-
9
- import ActiveAPI from "./compositionAPI/ActiveAPI";
10
- import AttributesAPI from "./compositionAPI/AttributesAPI";
11
- import ContentIdAPI from "../AWizardTab/compositionAPI/ContentIdAPI";
12
- import DisabledAPI from "./compositionAPI/DisabledAPI";
13
- import ErrorWarningAPI from "./compositionAPI/ErrorWarningAPI";
14
- import EventsAPI from "./compositionAPI/EventsAPI";
15
- import LinkClassAPI from "./compositionAPI/LinkClassAPI";
16
- import NumberAPI from "./compositionAPI/NumberAPI";
17
- import StatusTextAPI from "./compositionAPI/StatusTextAPI";
18
-
19
- import ExclamationCircleFill from "aloha-svg/dist/js/bootstrap/ExclamationCircleFill";
20
- import XCircleFill from "aloha-svg/dist/js/bootstrap/XCircleFill";
21
-
22
- export default {
23
- name: "AWizardStep",
24
- props: {
25
- extra: {
26
- type: Object,
27
- required: true,
28
- },
29
- id: {
30
- type: String,
31
- required: true,
32
- },
33
- isBackButtonDisabled: {
34
- type: Boolean,
35
- required: true,
36
- },
37
- isBackStepButtonDisabled: {
38
- type: Boolean,
39
- required: true,
40
- },
41
- isForwardButtonDisabled: {
42
- type: Boolean,
43
- required: true,
44
- },
45
- isForwardStepButtonDisabled: {
46
- type: Boolean,
47
- required: true,
48
- },
49
- isMobile: {
50
- type: Boolean,
51
- required: true,
52
- },
53
- isStepNumberVisible: {
54
- type: Boolean,
55
- required: true,
56
- },
57
- showOnlyActiveStepMobile: {
58
- type: Boolean,
59
- required: false,
60
- default: true,
61
- },
62
- step: {
63
- type: Object,
64
- required: true,
65
- },
66
- stepActiveComputed: {
67
- type: Number,
68
- required: false,
69
- default: 0,
70
- },
71
- stepIconError: {
72
- type: String,
73
- required: false,
74
- default: XCircleFill,
75
- },
76
- stepIconErrorText: {
77
- type: String,
78
- required: false,
79
- default: "_A_WIZARD_STEP_ERROR_",
80
- },
81
- stepIconWarning: {
82
- type: String,
83
- required: false,
84
- default: ExclamationCircleFill,
85
- },
86
- stepIconWarningText: {
87
- type: String,
88
- required: false,
89
- default: "_A_WIZARD_STEP_WARNING_",
90
- },
91
- stepIndex: {
92
- type: Number,
93
- required: true,
94
- },
95
- stepsCount: {
96
- type: Number,
97
- required: true,
98
- },
99
- },
100
- emits: [
101
- "onStepClick",
102
- ],
103
- setup(props, context) {
104
- const {
105
- isStepActive,
106
- isStepBeforeActive,
107
- } = ActiveAPI(props);
108
-
109
- const {
110
- stepNumber,
111
- stepNumberText,
112
- } = NumberAPI(props, {
113
- isStepActive,
114
- });
115
-
116
- const {
117
- isStepDisabled,
118
- } = DisabledAPI(props);
119
-
120
- const {
121
- linkClass,
122
- } = LinkClassAPI(props, {
123
- isStepActive,
124
- isStepBeforeActive,
125
- isStepDisabled,
126
- });
127
-
128
- const {
129
- onClick,
130
- onKeydown,
131
- } = EventsAPI(props, context, {
132
- isStepDisabled,
133
- });
134
-
135
- const {
136
- ariaCurrentAttributes,
137
- stepTextId,
138
- stepStatusTextId,
139
- tabindex,
140
- } = AttributesAPI(props, {
141
- isStepDisabled,
142
- isStepActive,
143
- });
144
-
145
- const {
146
- contentId,
147
- } = ContentIdAPI(props);
148
-
149
- const {
150
- statusText,
151
- } = StatusTextAPI(props, {
152
- isStepActive,
153
- isStepBeforeActive,
154
- });
155
-
156
- const {
157
- iconErrorWarning,
158
- titleIconErrorWarning,
159
- } = ErrorWarningAPI(props);
160
-
161
- return {
162
- ariaCurrentAttributes,
163
- contentId,
164
- iconErrorWarning,
165
- isStepActive,
166
- isStepDisabled,
167
- linkClass,
168
- onClick,
169
- onKeydown,
170
- statusText,
171
- stepNumber,
172
- stepNumberText,
173
- stepStatusTextId,
174
- stepTextId,
175
- tabindex,
176
- titleIconErrorWarning,
177
- };
178
- },
179
- render() {
180
- return h(
181
- "li",
182
- {
183
- class: [
184
- "a_wizard__step",
185
- {
186
- a_wizard__step_active: this.isStepActive,
187
- },
188
- ],
189
- },
190
- [
191
- h(AElement, {
192
- "aria-controls": this.contentId,
193
- "aria-describedby": this.stepStatusTextId,
194
- ariaDisabled: this.isStepDisabled,
195
- class: this.linkClass,
196
- classDefault: "",
197
- classDisabled: "disabled",
198
- role: "button",
199
- tabindex: this.tabindex,
200
- title: this.step.title,
201
- type: "link",
202
- onClick: this.onClick,
203
- onKeydown: this.onKeydown,
204
- ...this.ariaCurrentAttributes,
205
- }, () => this.step.slotLabel && this.$slots[this.step.slotLabel] ?
206
- this.$slots[this.step.slotLabel]({
207
- isStepActive: this.isStepActive,
208
- isStepDisabled: this.isStepDisabled,
209
- step: this.step,
210
- stepIndex: this.stepIndex,
211
- stepNumber: this.stepNumber,
212
- stepTextId: this.stepTextId,
213
- })
214
- : [
215
- this.isStepNumberVisible ?
216
- h("span", {
217
- class: "a_wizard__step__number",
218
- }, [
219
- this.step.icon ?
220
- h(AIcon, {
221
- class: "a_wizard__step__number__icon",
222
- icon: this.step.icon,
223
- }) :
224
- h(ATranslation, {
225
- class: "a_wizard__step__number__text",
226
- tag: "span",
227
- text: this.stepNumberText,
228
- extra: {
229
- stepActive: this.stepNumber,
230
- stepsCount: this.stepsCount,
231
- },
232
- }),
233
- ]) :
234
- "",
235
- h("span", {
236
- class: "a_wizard__step__text",
237
- }, [
238
- h(ATranslation, {
239
- id: this.stepTextId,
240
- class: "a_wizard__step__text__child",
241
- extra: this.extra,
242
- html: this.step.label,
243
- tag: "span",
244
- }),
245
- (this.iconErrorWarning) ?
246
- h(AElement, {
247
- iconClass: "a_wizard__step__text__icon",
248
- iconLeft: this.iconErrorWarning,
249
- tag: "span",
250
- textScreenReader: this.titleIconErrorWarning,
251
- title: this.titleIconErrorWarning,
252
- type: "text",
253
- })
254
- : "",
255
- ]),
256
- ]),
257
- h(ATranslation, {
258
- id: this.stepStatusTextId,
259
- class: "a_sr_only",
260
- tag: "span",
261
- text: this.statusText,
262
- }),
263
- h("span", {
264
- class: "a_wizard__step__divider",
265
- ariaHidden: true,
266
- }),
267
- ],
268
- );
269
- },
270
- };
1
+ import {
2
+ h,
3
+ } from "vue";
4
+
5
+ import AElement from "../../AElement/AElement";
6
+ import AIcon from "../../AIcon/AIcon";
7
+ import ATranslation from "../../ATranslation/ATranslation";
8
+
9
+ import ActiveAPI from "./compositionAPI/ActiveAPI";
10
+ import AttributesAPI from "./compositionAPI/AttributesAPI";
11
+ import ContentIdAPI from "../AWizardTab/compositionAPI/ContentIdAPI";
12
+ import DisabledAPI from "./compositionAPI/DisabledAPI";
13
+ import ErrorWarningAPI from "./compositionAPI/ErrorWarningAPI";
14
+ import EventsAPI from "./compositionAPI/EventsAPI";
15
+ import LinkClassAPI from "./compositionAPI/LinkClassAPI";
16
+ import NumberAPI from "./compositionAPI/NumberAPI";
17
+ import StatusTextAPI from "./compositionAPI/StatusTextAPI";
18
+
19
+ const ExclamationCircleFill = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-circle-fill" viewBox="0 0 16 16">
20
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4m.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/>
21
+ </svg>`;
22
+ const XCircleFill = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">
23
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z"/>
24
+ </svg>`;
25
+
26
+
27
+ export default {
28
+ name: "AWizardStep",
29
+ props: {
30
+ extra: {
31
+ type: Object,
32
+ required: true,
33
+ },
34
+ id: {
35
+ type: String,
36
+ required: true,
37
+ },
38
+ isBackButtonDisabled: {
39
+ type: Boolean,
40
+ required: true,
41
+ },
42
+ isBackStepButtonDisabled: {
43
+ type: Boolean,
44
+ required: true,
45
+ },
46
+ isForwardButtonDisabled: {
47
+ type: Boolean,
48
+ required: true,
49
+ },
50
+ isForwardStepButtonDisabled: {
51
+ type: Boolean,
52
+ required: true,
53
+ },
54
+ isMobile: {
55
+ type: Boolean,
56
+ required: true,
57
+ },
58
+ isStepNumberVisible: {
59
+ type: Boolean,
60
+ required: true,
61
+ },
62
+ showOnlyActiveStepMobile: {
63
+ type: Boolean,
64
+ required: false,
65
+ default: true,
66
+ },
67
+ step: {
68
+ type: Object,
69
+ required: true,
70
+ },
71
+ stepActiveComputed: {
72
+ type: Number,
73
+ required: false,
74
+ default: 0,
75
+ },
76
+ stepIconError: {
77
+ type: String,
78
+ required: false,
79
+ default: XCircleFill,
80
+ },
81
+ stepIconErrorText: {
82
+ type: String,
83
+ required: false,
84
+ default: "_A_WIZARD_STEP_ERROR_",
85
+ },
86
+ stepIconWarning: {
87
+ type: String,
88
+ required: false,
89
+ default: ExclamationCircleFill,
90
+ },
91
+ stepIconWarningText: {
92
+ type: String,
93
+ required: false,
94
+ default: "_A_WIZARD_STEP_WARNING_",
95
+ },
96
+ stepIndex: {
97
+ type: Number,
98
+ required: true,
99
+ },
100
+ stepsCount: {
101
+ type: Number,
102
+ required: true,
103
+ },
104
+ },
105
+ emits: [
106
+ "onStepClick",
107
+ ],
108
+ setup(props, context) {
109
+ const {
110
+ isStepActive,
111
+ isStepBeforeActive,
112
+ } = ActiveAPI(props);
113
+
114
+ const {
115
+ stepNumber,
116
+ stepNumberText,
117
+ } = NumberAPI(props, {
118
+ isStepActive,
119
+ });
120
+
121
+ const {
122
+ isStepDisabled,
123
+ } = DisabledAPI(props);
124
+
125
+ const {
126
+ linkClass,
127
+ } = LinkClassAPI(props, {
128
+ isStepActive,
129
+ isStepBeforeActive,
130
+ isStepDisabled,
131
+ });
132
+
133
+ const {
134
+ onClick,
135
+ onKeydown,
136
+ } = EventsAPI(props, context, {
137
+ isStepDisabled,
138
+ });
139
+
140
+ const {
141
+ ariaCurrentAttributes,
142
+ stepTextId,
143
+ stepStatusTextId,
144
+ tabindex,
145
+ } = AttributesAPI(props, {
146
+ isStepDisabled,
147
+ isStepActive,
148
+ });
149
+
150
+ const {
151
+ contentId,
152
+ } = ContentIdAPI(props);
153
+
154
+ const {
155
+ statusText,
156
+ } = StatusTextAPI(props, {
157
+ isStepActive,
158
+ isStepBeforeActive,
159
+ });
160
+
161
+ const {
162
+ iconErrorWarning,
163
+ titleIconErrorWarning,
164
+ } = ErrorWarningAPI(props);
165
+
166
+ return {
167
+ ariaCurrentAttributes,
168
+ contentId,
169
+ iconErrorWarning,
170
+ isStepActive,
171
+ isStepDisabled,
172
+ linkClass,
173
+ onClick,
174
+ onKeydown,
175
+ statusText,
176
+ stepNumber,
177
+ stepNumberText,
178
+ stepStatusTextId,
179
+ stepTextId,
180
+ tabindex,
181
+ titleIconErrorWarning,
182
+ };
183
+ },
184
+ render() {
185
+ return h(
186
+ "li",
187
+ {
188
+ class: [
189
+ "a_wizard__step",
190
+ {
191
+ a_wizard__step_active: this.isStepActive,
192
+ },
193
+ ],
194
+ },
195
+ [
196
+ h(AElement, {
197
+ "aria-controls": this.contentId,
198
+ "aria-describedby": this.stepStatusTextId,
199
+ ariaDisabled: this.isStepDisabled,
200
+ class: this.linkClass,
201
+ classDefault: "",
202
+ classDisabled: "disabled",
203
+ role: "button",
204
+ tabindex: this.tabindex,
205
+ title: this.step.title,
206
+ type: "link",
207
+ onClick: this.onClick,
208
+ onKeydown: this.onKeydown,
209
+ ...this.ariaCurrentAttributes,
210
+ }, () => this.step.slotLabel && this.$slots[this.step.slotLabel] ?
211
+ this.$slots[this.step.slotLabel]({
212
+ isStepActive: this.isStepActive,
213
+ isStepDisabled: this.isStepDisabled,
214
+ step: this.step,
215
+ stepIndex: this.stepIndex,
216
+ stepNumber: this.stepNumber,
217
+ stepTextId: this.stepTextId,
218
+ })
219
+ : [
220
+ this.isStepNumberVisible ?
221
+ h("span", {
222
+ class: "a_wizard__step__number",
223
+ }, [
224
+ this.step.icon ?
225
+ h(AIcon, {
226
+ class: "a_wizard__step__number__icon",
227
+ icon: this.step.icon,
228
+ }) :
229
+ h(ATranslation, {
230
+ class: "a_wizard__step__number__text",
231
+ tag: "span",
232
+ text: this.stepNumberText,
233
+ extra: {
234
+ stepActive: this.stepNumber,
235
+ stepsCount: this.stepsCount,
236
+ },
237
+ }),
238
+ ]) :
239
+ "",
240
+ h("span", {
241
+ class: "a_wizard__step__text",
242
+ }, [
243
+ h(ATranslation, {
244
+ id: this.stepTextId,
245
+ class: "a_wizard__step__text__child",
246
+ extra: this.extra,
247
+ html: this.step.label,
248
+ tag: "span",
249
+ }),
250
+ (this.iconErrorWarning) ?
251
+ h(AElement, {
252
+ iconClass: "a_wizard__step__text__icon",
253
+ iconLeft: this.iconErrorWarning,
254
+ tag: "span",
255
+ textScreenReader: this.titleIconErrorWarning,
256
+ title: this.titleIconErrorWarning,
257
+ type: "text",
258
+ })
259
+ : "",
260
+ ]),
261
+ ]),
262
+ h(ATranslation, {
263
+ id: this.stepStatusTextId,
264
+ class: "a_sr_only",
265
+ tag: "span",
266
+ text: this.statusText,
267
+ }),
268
+ h("span", {
269
+ class: "a_wizard__step__divider",
270
+ ariaHidden: true,
271
+ }),
272
+ ],
273
+ );
274
+ },
275
+ };
@@ -1,32 +1,32 @@
1
- import {
2
- describe,
3
- expect,
4
- it,
5
- jest,
6
- } from "@jest/globals";
7
-
8
- import ChangeStepAPI from "../ChangeStepAPI";
9
-
10
- describe("AWizard ChangeStepAPI", () => {
11
- it("emits details about the changed step", () => {
12
- const emit = jest.fn();
13
- const steps = [
14
- { label: "Step 1" },
15
- { label: "Step 2" },
16
- ];
17
- const {
18
- changeStep,
19
- } = ChangeStepAPI({ steps }, { emit });
20
-
21
- changeStep({
22
- stepIndex: 1,
23
- previousStepIndex: 0,
24
- });
25
-
26
- expect(emit).toHaveBeenCalledWith("changeStep", {
27
- step: steps[1],
28
- stepIndex: 1,
29
- previousStepIndex: 0,
30
- });
31
- });
32
- });
1
+ import {
2
+ describe,
3
+ expect,
4
+ it,
5
+ vi,
6
+ } from "vitest";
7
+
8
+ import ChangeStepAPI from "../ChangeStepAPI";
9
+
10
+ describe("AWizard ChangeStepAPI", () => {
11
+ it("emits details about the changed step", () => {
12
+ const emit = vi.fn();
13
+ const steps = [
14
+ { label: "Step 1" },
15
+ { label: "Step 2" },
16
+ ];
17
+ const {
18
+ changeStep,
19
+ } = ChangeStepAPI({ steps }, { emit });
20
+
21
+ changeStep({
22
+ stepIndex: 1,
23
+ previousStepIndex: 0,
24
+ });
25
+
26
+ expect(emit).toHaveBeenCalledWith("changeStep", {
27
+ step: steps[1],
28
+ stepIndex: 1,
29
+ previousStepIndex: 0,
30
+ });
31
+ });
32
+ });