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,219 +1,224 @@
1
- import {
2
- h,
3
- onBeforeUnmount,
4
- ref,
5
- } from "vue";
6
-
7
- import ADropdown from "../../ADropdown/ADropdown";
8
- import AElement from "../../AElement/AElement";
9
- import AForm from "../../ui/AForm/AForm";
10
- import ATranslation from "../../ATranslation/ATranslation";
11
-
12
- import AttributesAPI from "./compositionAPI/AttributesAPI";
13
- import ColumnsAPI from "./compositionAPI/ColumnsAPI";
14
- import DropdownAPI from "./compositionAPI/DropdownAPI";
15
- import FormAPI from "./compositionAPI/FormAPI";
16
- import ModelAPI from "./compositionAPI/ModelAPI";
17
-
18
- import ArrowDownUp from "aloha-svg/dist/js/bootstrap/ArrowDownUp";
19
- import XLg from "aloha-svg/dist/js/bootstrap/XLg";
20
-
21
- export default {
22
- name: "ATableSortingAdditional",
23
- props: {
24
- additionalSortingColumns: {
25
- type: Array,
26
- required: false,
27
- default: () => [],
28
- },
29
- disabledSort: {
30
- type: Boolean,
31
- required: false,
32
- },
33
- isSortingMultiColumn: {
34
- type: Boolean,
35
- required: false,
36
- default: false,
37
- },
38
- modelSort: {
39
- type: Array,
40
- required: false,
41
- },
42
- },
43
- setup(props) {
44
- const unappliedModelSort = ref([]);
45
-
46
- const {
47
- columnsAll,
48
- columnsAllKeyBySortId,
49
- countColumnsAll,
50
- } = ColumnsAPI(props);
51
-
52
- const {
53
- dataForForm,
54
- initDataForForm,
55
- } = FormAPI(props, {
56
- columnsAll,
57
- columnsAllKeyBySortId,
58
- unappliedModelSort,
59
- });
60
-
61
- const {
62
- closeDropdown,
63
- dropdownRef,
64
- isDropdownVisible,
65
- wasOpenDropdown,
66
- } = DropdownAPI(props, {
67
- columnsAll,
68
- });
69
-
70
- const {
71
- changeModelSortInTable,
72
- countModelSort,
73
- destroyEventBus,
74
- initEventBus,
75
- initUnappliedModelSort,
76
- removeUnappliedModelSort,
77
- textCountModelSort,
78
- updateUnappliedModelSort,
79
- } = ModelAPI(props, {
80
- closeDropdown,
81
- countColumnsAll,
82
- initDataForForm,
83
- unappliedModelSort,
84
- wasOpenDropdown,
85
- });
86
-
87
- const {
88
- excludeRenderAttributes,
89
- idPrefix,
90
- } = AttributesAPI();
91
-
92
- initEventBus();
93
-
94
- onBeforeUnmount(() => {
95
- destroyEventBus();
96
- });
97
-
98
- return {
99
- changeModelSortInTable,
100
- closeDropdown,
101
- countModelSort,
102
- dataForForm,
103
- dropdownRef,
104
- excludeRenderAttributes,
105
- idPrefix,
106
- initUnappliedModelSort,
107
- isDropdownVisible,
108
- removeUnappliedModelSort,
109
- textCountModelSort,
110
- unappliedModelSort,
111
- updateUnappliedModelSort,
112
- wasOpenDropdown,
113
- };
114
- },
115
- render() {
116
- if (!this.isDropdownVisible) {
117
- return null;
118
- }
119
-
120
- return h(ADropdown, {
121
- ref: "dropdownRef",
122
- buttonClass: "a_btn a_btn_secondary a_table__action",
123
- buttonIconLeft: ArrowDownUp,
124
- buttonText: this.textCountModelSort,
125
- buttonTextAriaHidden: true,
126
- buttonTitle: "_A_TABLE_SORT_ADDITIONAL_DROPDOWN_TITLE_{{count}}_",
127
- buttonTextScreenReader: "_A_TABLE_SORT_ADDITIONAL_DROPDOWN_TITLE_{{count}}_",
128
- buttonTextClass: "a_badge a_bg_primary",
129
- disabled: this.disabledSort,
130
- dropdownClass: "a_filter_horizontal__wrapper",
131
- dropdownRenderDefault: false,
132
- dropdownTag: "div",
133
- hasCaret: false,
134
- inBody: true,
135
- extra: {
136
- count: this.countModelSort,
137
- },
138
- isCloseByClickInside: false,
139
- lockArrowsNavigation: false,
140
- lockTabNavigation: false,
141
- onOpen: this.initUnappliedModelSort,
142
- }, {
143
- dropdown: () => {
144
- return h("div", {
145
- class: "a_filter_horizontal",
146
- }, [
147
- h("div", {
148
- class: "a_filter_horizontal__header__wrapper",
149
- }, [
150
- h("div", {
151
- class: "a_filter_horizontal__header",
152
- }, [
153
- h("div", {
154
- class: "a_filter_horizontal__header__texts",
155
- }, [
156
- h(ATranslation, {
157
- class: "a_filter_horizontal__header__texts__filter",
158
- tag: "span",
159
- text: "_A_TABLE_SORT_ADDITIONAL_HEADER_",
160
- }),
161
- ]),
162
- ]),
163
- ]),
164
- h("div", {
165
- class: "a_filter_horizontal__body__wrapper",
166
- }, [
167
- h("div", {
168
- class: "a_filter_horizontal__body",
169
- }, [
170
- h(AForm, {
171
- idPrefix: this.idPrefix,
172
- class: "a_filter_horizontal__body__form",
173
- classColumnDefault: "",
174
- classColumns: "",
175
- data: this.dataForForm,
176
- excludeRenderAttributes: this.excludeRenderAttributes,
177
- modelValue: this.unappliedModelSort,
178
- showErrors: false,
179
- onChange: this.updateUnappliedModelSort,
180
- }, {
181
- slotAppend: ({ item }) => h(AElement, {
182
- type: "button",
183
- class: "a_btn a_btn_primary a_ml_2",
184
- title: "_A_TABLE_SORT_ADDITIONAL_BTN_DELETE_",
185
- textScreenReader: "_A_TABLE_SORT_ADDITIONAL_BTN_DELETE_",
186
- disabled: !this.unappliedModelSort?.[item.additionalProps.index]?.sortId,
187
- iconLeft: XLg,
188
- onClick: () => this.removeUnappliedModelSort({ item }),
189
- }),
190
- }),
191
- ]),
192
- h("div", {
193
- class: "a_filter_horizontal__footer",
194
- }, [
195
- h("div", {
196
- class: "a_filter_horizontal__footer__actions",
197
- }, [
198
- h(AElement, {
199
- type: "button",
200
- class: "a_btn a_btn_primary a_text_nowrap a_filter_horizontal__footer__actions__btn_search",
201
- iconLeft: ArrowDownUp,
202
- text: "_A_TABLE_SORT_ADDITIONAL_START_",
203
- disabled: this.disabledSort,
204
- onClick: this.changeModelSortInTable,
205
- }),
206
- h(AElement, {
207
- type: "button",
208
- class: "a_btn a_btn_secondary a_text_nowrap a_filter_horizontal__footer__actions__btn_close",
209
- text: "_A_TABLE_SORT_ADDITIONAL_CLOSE_DROPDOWN_",
210
- onClick: this.closeDropdown,
211
- }),
212
- ]),
213
- ]),
214
- ]),
215
- ]);
216
- },
217
- });
218
- },
219
- };
1
+ import {
2
+ h,
3
+ onBeforeUnmount,
4
+ ref,
5
+ } from "vue";
6
+
7
+ import ADropdown from "../../ADropdown/ADropdown";
8
+ import AElement from "../../AElement/AElement";
9
+ import AForm from "../../ui/AForm/AForm";
10
+ import ATranslation from "../../ATranslation/ATranslation";
11
+
12
+ import AttributesAPI from "./compositionAPI/AttributesAPI";
13
+ import ColumnsAPI from "./compositionAPI/ColumnsAPI";
14
+ import DropdownAPI from "./compositionAPI/DropdownAPI";
15
+ import FormAPI from "./compositionAPI/FormAPI";
16
+ import ModelAPI from "./compositionAPI/ModelAPI";
17
+
18
+ const ArrowDownUp = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-down-up" viewBox="0 0 16 16">
19
+ <path fill-rule="evenodd" d="M11.5 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L11 2.707V14.5a.5.5 0 0 0 .5.5m-7-14a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L4 13.293V1.5a.5.5 0 0 1 .5-.5"/>
20
+ </svg>`;
21
+ const XLg = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">
22
+ <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/>
23
+ </svg>`;
24
+
25
+
26
+ export default {
27
+ name: "ATableSortingAdditional",
28
+ props: {
29
+ additionalSortingColumns: {
30
+ type: Array,
31
+ required: false,
32
+ default: () => [],
33
+ },
34
+ disabledSort: {
35
+ type: Boolean,
36
+ required: false,
37
+ },
38
+ isSortingMultiColumn: {
39
+ type: Boolean,
40
+ required: false,
41
+ default: false,
42
+ },
43
+ modelSort: {
44
+ type: Array,
45
+ required: false,
46
+ },
47
+ },
48
+ setup(props) {
49
+ const unappliedModelSort = ref([]);
50
+
51
+ const {
52
+ columnsAll,
53
+ columnsAllKeyBySortId,
54
+ countColumnsAll,
55
+ } = ColumnsAPI(props);
56
+
57
+ const {
58
+ dataForForm,
59
+ initDataForForm,
60
+ } = FormAPI(props, {
61
+ columnsAll,
62
+ columnsAllKeyBySortId,
63
+ unappliedModelSort,
64
+ });
65
+
66
+ const {
67
+ closeDropdown,
68
+ dropdownRef,
69
+ isDropdownVisible,
70
+ wasOpenDropdown,
71
+ } = DropdownAPI(props, {
72
+ columnsAll,
73
+ });
74
+
75
+ const {
76
+ changeModelSortInTable,
77
+ countModelSort,
78
+ destroyEventBus,
79
+ initEventBus,
80
+ initUnappliedModelSort,
81
+ removeUnappliedModelSort,
82
+ textCountModelSort,
83
+ updateUnappliedModelSort,
84
+ } = ModelAPI(props, {
85
+ closeDropdown,
86
+ countColumnsAll,
87
+ initDataForForm,
88
+ unappliedModelSort,
89
+ wasOpenDropdown,
90
+ });
91
+
92
+ const {
93
+ excludeRenderAttributes,
94
+ idPrefix,
95
+ } = AttributesAPI();
96
+
97
+ initEventBus();
98
+
99
+ onBeforeUnmount(() => {
100
+ destroyEventBus();
101
+ });
102
+
103
+ return {
104
+ changeModelSortInTable,
105
+ closeDropdown,
106
+ countModelSort,
107
+ dataForForm,
108
+ dropdownRef,
109
+ excludeRenderAttributes,
110
+ idPrefix,
111
+ initUnappliedModelSort,
112
+ isDropdownVisible,
113
+ removeUnappliedModelSort,
114
+ textCountModelSort,
115
+ unappliedModelSort,
116
+ updateUnappliedModelSort,
117
+ wasOpenDropdown,
118
+ };
119
+ },
120
+ render() {
121
+ if (!this.isDropdownVisible) {
122
+ return null;
123
+ }
124
+
125
+ return h(ADropdown, {
126
+ ref: "dropdownRef",
127
+ buttonClass: "a_btn a_btn_secondary a_table__action",
128
+ buttonIconLeft: ArrowDownUp,
129
+ buttonText: this.textCountModelSort,
130
+ buttonTextAriaHidden: true,
131
+ buttonTitle: "_A_TABLE_SORT_ADDITIONAL_DROPDOWN_TITLE_{{count}}_",
132
+ buttonTextScreenReader: "_A_TABLE_SORT_ADDITIONAL_DROPDOWN_TITLE_{{count}}_",
133
+ buttonTextClass: "a_badge a_bg_primary",
134
+ disabled: this.disabledSort,
135
+ dropdownClass: "a_filter_horizontal__wrapper",
136
+ dropdownRenderDefault: false,
137
+ dropdownTag: "div",
138
+ hasCaret: false,
139
+ inBody: true,
140
+ extra: {
141
+ count: this.countModelSort,
142
+ },
143
+ isCloseByClickInside: false,
144
+ lockArrowsNavigation: false,
145
+ lockTabNavigation: false,
146
+ onOpen: this.initUnappliedModelSort,
147
+ }, {
148
+ dropdown: () => {
149
+ return h("div", {
150
+ class: "a_filter_horizontal",
151
+ }, [
152
+ h("div", {
153
+ class: "a_filter_horizontal__header__wrapper",
154
+ }, [
155
+ h("div", {
156
+ class: "a_filter_horizontal__header",
157
+ }, [
158
+ h("div", {
159
+ class: "a_filter_horizontal__header__texts",
160
+ }, [
161
+ h(ATranslation, {
162
+ class: "a_filter_horizontal__header__texts__filter",
163
+ tag: "span",
164
+ text: "_A_TABLE_SORT_ADDITIONAL_HEADER_",
165
+ }),
166
+ ]),
167
+ ]),
168
+ ]),
169
+ h("div", {
170
+ class: "a_filter_horizontal__body__wrapper",
171
+ }, [
172
+ h("div", {
173
+ class: "a_filter_horizontal__body",
174
+ }, [
175
+ h(AForm, {
176
+ idPrefix: this.idPrefix,
177
+ class: "a_filter_horizontal__body__form",
178
+ classColumnDefault: "",
179
+ classColumns: "",
180
+ data: this.dataForForm,
181
+ excludeRenderAttributes: this.excludeRenderAttributes,
182
+ modelValue: this.unappliedModelSort,
183
+ showErrors: false,
184
+ onChange: this.updateUnappliedModelSort,
185
+ }, {
186
+ slotAppend: ({ item }) => h(AElement, {
187
+ type: "button",
188
+ class: "a_btn a_btn_primary a_ml_2",
189
+ title: "_A_TABLE_SORT_ADDITIONAL_BTN_DELETE_",
190
+ textScreenReader: "_A_TABLE_SORT_ADDITIONAL_BTN_DELETE_",
191
+ disabled: !this.unappliedModelSort?.[item.additionalProps.index]?.sortId,
192
+ iconLeft: XLg,
193
+ onClick: () => this.removeUnappliedModelSort({ item }),
194
+ }),
195
+ }),
196
+ ]),
197
+ h("div", {
198
+ class: "a_filter_horizontal__footer",
199
+ }, [
200
+ h("div", {
201
+ class: "a_filter_horizontal__footer__actions",
202
+ }, [
203
+ h(AElement, {
204
+ type: "button",
205
+ class: "a_btn a_btn_primary a_text_nowrap a_filter_horizontal__footer__actions__btn_search",
206
+ iconLeft: ArrowDownUp,
207
+ text: "_A_TABLE_SORT_ADDITIONAL_START_",
208
+ disabled: this.disabledSort,
209
+ onClick: this.changeModelSortInTable,
210
+ }),
211
+ h(AElement, {
212
+ type: "button",
213
+ class: "a_btn a_btn_secondary a_text_nowrap a_filter_horizontal__footer__actions__btn_close",
214
+ text: "_A_TABLE_SORT_ADDITIONAL_CLOSE_DROPDOWN_",
215
+ onClick: this.closeDropdown,
216
+ }),
217
+ ]),
218
+ ]),
219
+ ]),
220
+ ]);
221
+ },
222
+ });
223
+ },
224
+ };
@@ -1,39 +1,39 @@
1
- import {
2
- beforeAll,
3
- describe,
4
- expect,
5
- it,
6
- } from "@jest/globals";
7
-
8
- import {
9
- mockVueInject,
10
- } from "../../../../utilsTests/utilsTests";
11
-
12
- describe("ATableSortingAdditional AttributesAPI", () => {
13
- let AttributesAPI;
14
-
15
- beforeAll(async() => {
16
- mockVueInject({
17
- tableId: "aloha",
18
- });
19
-
20
- // Dynamically import CompositionAPI after mocks are set up
21
- AttributesAPI = (await import("../compositionAPI/AttributesAPI")).default;
22
- });
23
-
24
- it("idPrefix correctly", () => {
25
- const {
26
- idPrefix,
27
- } = AttributesAPI();
28
-
29
- expect(idPrefix.value).toBe("aloha_");
30
- });
31
-
32
- it("excludeRenderAttributes correctly", () => {
33
- const {
34
- excludeRenderAttributes,
35
- } = AttributesAPI();
36
-
37
- expect(excludeRenderAttributes).toStrictEqual(["additionalProps"]);
38
- });
39
- });
1
+ import {
2
+ beforeAll,
3
+ describe,
4
+ expect,
5
+ it,
6
+ } from "vitest";
7
+
8
+ import {
9
+ mockVueInject,
10
+ } from "../../../../utilsTests/utilsTests";
11
+
12
+ describe("ATableSortingAdditional AttributesAPI", () => {
13
+ let AttributesAPI;
14
+
15
+ beforeAll(async() => {
16
+ mockVueInject({
17
+ tableId: "aloha",
18
+ });
19
+
20
+ // Dynamically import CompositionAPI after mocks are set up
21
+ AttributesAPI = (await import("../compositionAPI/AttributesAPI")).default;
22
+ });
23
+
24
+ it("idPrefix correctly", () => {
25
+ const {
26
+ idPrefix,
27
+ } = AttributesAPI();
28
+
29
+ expect(idPrefix.value).toBe("aloha_");
30
+ });
31
+
32
+ it("excludeRenderAttributes correctly", () => {
33
+ const {
34
+ excludeRenderAttributes,
35
+ } = AttributesAPI();
36
+
37
+ expect(excludeRenderAttributes).toStrictEqual(["additionalProps"]);
38
+ });
39
+ });
@@ -1,68 +1,68 @@
1
- import {
2
- beforeAll,
3
- beforeEach,
4
- describe,
5
- expect,
6
- it,
7
- } from "@jest/globals";
8
-
9
- import {
10
- mockVueInject,
11
- } from "../../../../utilsTests/utilsTests";
12
-
13
- describe("ATableSortingAdditional ColumnsAPI", () => {
14
- let props;
15
- let ColumnsAPI;
16
-
17
- beforeAll(async() => {
18
- mockVueInject({
19
- columnsOrdered: [
20
- { label: "Mocked Ordered 1", sortId: "3" },
21
- { label: "Mocked Ordered 2", sortId: "4" },
22
- { label: "Mocked Ordered without sort" },
23
- ],
24
- });
25
-
26
- // Dynamically import CompositionAPI after mocks are set up
27
- ColumnsAPI = (await import("../compositionAPI/ColumnsAPI")).default;
28
- });
29
-
30
- beforeEach(() => {
31
- props = {
32
- additionalSortingColumns: [
33
- { label: "additional 1", sortId: "1" },
34
- { label: "additional 2", sortId: "2" },
35
- ],
36
- };
37
- });
38
-
39
- it("counts all columns correctly", () => {
40
- const {
41
- countColumnsAll,
42
- } = ColumnsAPI(props);
43
-
44
- expect(countColumnsAll.value).toBe(4);
45
- });
46
-
47
- it("keys columns by sortId", () => {
48
- const {
49
- columnsAllKeyBySortId,
50
- } = ColumnsAPI(props);
51
-
52
- const keys = Object.keys(columnsAllKeyBySortId.value);
53
- expect(keys.sort()).toEqual(["1", "2", "3", "4"]);
54
- });
55
-
56
- it("contains correct data in columnsAll", () => {
57
- const {
58
- columnsAll,
59
- } = ColumnsAPI(props);
60
-
61
- expect(columnsAll.value).toEqual(expect.arrayContaining([
62
- expect.objectContaining({ label: "Mocked Ordered 1", sortId: "3" }),
63
- expect.objectContaining({ label: "Mocked Ordered 2", sortId: "4" }),
64
- expect.objectContaining({ label: "additional 1", sortId: "1" }),
65
- expect.objectContaining({ label: "additional 2", sortId: "2" }),
66
- ]));
67
- });
68
- });
1
+ import {
2
+ beforeAll,
3
+ beforeEach,
4
+ describe,
5
+ expect,
6
+ it,
7
+ } from "vitest";
8
+
9
+ import {
10
+ mockVueInject,
11
+ } from "../../../../utilsTests/utilsTests";
12
+
13
+ describe("ATableSortingAdditional ColumnsAPI", () => {
14
+ let props;
15
+ let ColumnsAPI;
16
+
17
+ beforeAll(async() => {
18
+ mockVueInject({
19
+ columnsOrdered: [
20
+ { label: "Mocked Ordered 1", sortId: "3" },
21
+ { label: "Mocked Ordered 2", sortId: "4" },
22
+ { label: "Mocked Ordered without sort" },
23
+ ],
24
+ });
25
+
26
+ // Dynamically import CompositionAPI after mocks are set up
27
+ ColumnsAPI = (await import("../compositionAPI/ColumnsAPI")).default;
28
+ });
29
+
30
+ beforeEach(() => {
31
+ props = {
32
+ additionalSortingColumns: [
33
+ { label: "additional 1", sortId: "1" },
34
+ { label: "additional 2", sortId: "2" },
35
+ ],
36
+ };
37
+ });
38
+
39
+ it("counts all columns correctly", () => {
40
+ const {
41
+ countColumnsAll,
42
+ } = ColumnsAPI(props);
43
+
44
+ expect(countColumnsAll.value).toBe(4);
45
+ });
46
+
47
+ it("keys columns by sortId", () => {
48
+ const {
49
+ columnsAllKeyBySortId,
50
+ } = ColumnsAPI(props);
51
+
52
+ const keys = Object.keys(columnsAllKeyBySortId.value);
53
+ expect(keys.sort()).toEqual(["1", "2", "3", "4"]);
54
+ });
55
+
56
+ it("contains correct data in columnsAll", () => {
57
+ const {
58
+ columnsAll,
59
+ } = ColumnsAPI(props);
60
+
61
+ expect(columnsAll.value).toEqual(expect.arrayContaining([
62
+ expect.objectContaining({ label: "Mocked Ordered 1", sortId: "3" }),
63
+ expect.objectContaining({ label: "Mocked Ordered 2", sortId: "4" }),
64
+ expect.objectContaining({ label: "additional 1", sortId: "1" }),
65
+ expect.objectContaining({ label: "additional 2", sortId: "2" }),
66
+ ]));
67
+ });
68
+ });