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,405 +1,408 @@
1
- import {
2
- h,
3
- resolveComponent,
4
- } from "vue";
5
-
6
- import AElement from "../../AElement/AElement";
7
- import AGet from "../../AGet/AGet";
8
- import AOneCheckbox from "../../ui/AOneCheckbox/AOneCheckbox";
9
- import ATablePreviewDown from "../ATablePreviewDown/ATablePreviewDown";
10
- import ATableTd from "../ATableTd/ATableTd";
11
- import ATableTdAction from "../ATableTdAction/ATableTdAction";
12
-
13
- import AttributesAPI from "./compositionAPI/AttributesAPI";
14
- import CheckboxAPI from "./compositionAPI/CheckboxAPI";
15
- import ChildrenAPI from "./compositionAPI/ChildrenAPI";
16
- import ChildrenToggleAPI from "./compositionAPI/ChildrenToggleAPI";
17
- import MobileAPI from "./compositionAPI/MobileAPI";
18
- import PreviewAPI from "./compositionAPI/PreviewAPI";
19
-
20
- import CaretRightFill from "aloha-svg/dist/js/bootstrap/CaretRightFill";
21
- import {
22
- forEach,
23
- } from "lodash-es";
24
-
25
- export default {
26
- name: "ATableTr",
27
- props: {
28
- allVisibleMobileColumns: {
29
- type: Array,
30
- required: true,
31
- },
32
- areAllRowsSelected: {
33
- type: Boolean,
34
- required: true,
35
- },
36
- columnActionsBtnGroupMaxWidthStyle: {
37
- type: String,
38
- required: false,
39
- default: undefined,
40
- },
41
- columnActionsView: {
42
- type: String,
43
- required: true,
44
- },
45
- countVisibleMobileColumns: {
46
- type: Number,
47
- required: true,
48
- },
49
- disabledPreview: {
50
- type: Boolean,
51
- required: false,
52
- },
53
- disabledPreviewRowCallback: {
54
- type: Function,
55
- required: false,
56
- },
57
- disabledRowActions: {
58
- type: Boolean,
59
- required: false,
60
- },
61
- isFooter: {
62
- type: Boolean,
63
- required: false,
64
- },
65
- isOneOfParentsClose: {
66
- type: Boolean,
67
- required: false,
68
- },
69
- isPreviewDownOpen: {
70
- type: Boolean,
71
- required: false,
72
- },
73
- isRowActionsStickyLocal: {
74
- type: Boolean,
75
- required: true,
76
- },
77
- isTree: {
78
- type: Boolean,
79
- required: false,
80
- },
81
- isTreeCollapsible: {
82
- type: Boolean,
83
- required: false,
84
- default: true,
85
- },
86
- isTreeOpened: {
87
- type: Boolean,
88
- required: false,
89
- },
90
- keyChildren: {
91
- type: String,
92
- required: false,
93
- default: undefined,
94
- },
95
- keyId: {
96
- type: String,
97
- required: false,
98
- default: "id",
99
- },
100
- level: {
101
- type: Number,
102
- required: true,
103
- },
104
- row: {
105
- type: Object,
106
- required: true,
107
- },
108
- rowActionsClass: {
109
- type: [String, Object],
110
- required: false,
111
- default: undefined,
112
- },
113
- rowClass: {
114
- type: [String, Object, Function],
115
- required: false,
116
- default: undefined,
117
- },
118
- rowIndex: {
119
- type: Number,
120
- required: true,
121
- },
122
- rowIndexPath: {
123
- type: String,
124
- required: false,
125
- default: undefined,
126
- },
127
- rowsLength: {
128
- type: Number,
129
- required: true,
130
- },
131
- selectedRowsIndexes: {
132
- type: Object,
133
- required: true,
134
- },
135
- },
136
- emits: [
137
- "setSelectedRowsIndexes",
138
- ],
139
- setup(props, context) {
140
- const {
141
- ariaTreeAttributes,
142
- children,
143
- hasChildren,
144
- levelForChildren,
145
- rowClassLevelChildren,
146
- } = ChildrenAPI(props);
147
-
148
- const {
149
- ariaExpanded,
150
- initIsChildrenOpen,
151
- isOneOfParentsCloseForChildren,
152
- rowClassChildren,
153
- toggleChildren,
154
- } = ChildrenToggleAPI(props, {
155
- hasChildren,
156
- });
157
-
158
- const {
159
- hasPreviewLocal,
160
- previewAttributes,
161
- rowClassPreview,
162
- } = PreviewAPI(props, {
163
- hasChildren,
164
- });
165
-
166
- const {
167
- disabledPreviewRow,
168
- eventsLocal,
169
- roleLocal,
170
- rowClassComputed,
171
- rowHtmlId,
172
- } = AttributesAPI(props, {
173
- hasChildren,
174
- hasPreviewLocal,
175
- rowClassChildren,
176
- rowClassLevelChildren,
177
- rowClassPreview,
178
- toggleChildren,
179
- });
180
-
181
- const {
182
- countInvisibleMobileColumns,
183
- isAllColumnsVisibleMobile,
184
- isBtnToggleAllColumnsVisible,
185
- textBtnToggleAllColumns,
186
- toggleAllColumnsVisibleMobile,
187
- } = MobileAPI(props);
188
-
189
- const {
190
- isCheckboxDisabled,
191
- isRowSelected,
192
- labelCheckbox,
193
- toggleCheckbox,
194
- } = CheckboxAPI(props, context);
195
-
196
- initIsChildrenOpen();
197
-
198
- return {
199
- ariaExpanded,
200
- ariaTreeAttributes,
201
- children,
202
- countInvisibleMobileColumns,
203
- disabledPreviewRow,
204
- eventsLocal,
205
- hasChildren,
206
- isAllColumnsVisibleMobile,
207
- isBtnToggleAllColumnsVisible,
208
- isCheckboxDisabled,
209
- isOneOfParentsCloseForChildren,
210
- isRowSelected,
211
- labelCheckbox,
212
- levelForChildren,
213
- previewAttributes,
214
- roleLocal,
215
- rowClassComputed,
216
- rowHtmlId,
217
- textBtnToggleAllColumns,
218
- toggleAllColumnsVisibleMobile,
219
- toggleCheckbox,
220
- toggleChildren,
221
- };
222
- },
223
- inject: [
224
- "columnsFilteredForRender",
225
- "isActionColumnVisible",
226
- "isMultipleActionsActive",
227
- "isMobile",
228
- ],
229
- render() {
230
- const ROW_INDEX_PATH = this.rowIndexPath || `${ this.rowIndex }`;
231
- let tds = [];
232
- if (this.isMobile && !this.isAllColumnsVisibleMobile) {
233
- forEach(this.allVisibleMobileColumns, (column, columnIndex) => {
234
- if (columnIndex + 1 > this.countVisibleMobileColumns) {
235
- return false;
236
- }
237
- tds.push(
238
- h(ATableTd, {
239
- key: column.id,
240
- column,
241
- columnIndex,
242
- disabledPreview: this.disabledPreviewRow,
243
- level: this.level,
244
- row: this.row,
245
- rowIndex: this.rowIndex,
246
- isFooter: this.isFooter,
247
- }, this.$slots),
248
- );
249
- });
250
- } else {
251
- tds = this.columnsFilteredForRender.map((column, columnIndex) => {
252
- return h(ATableTd, {
253
- key: column.id,
254
- column,
255
- columnIndex,
256
- disabledPreview: this.disabledPreviewRow,
257
- level: this.level,
258
- row: this.row,
259
- rowIndex: this.rowIndex,
260
- isFooter: this.isFooter,
261
- showIconChildren: !!(this.isTreeCollapsible && this.hasChildren && columnIndex === 0),
262
- }, this.$slots);
263
- });
264
- }
265
-
266
- const ACTIONS = this.isActionColumnVisible &&
267
- h(ATableTdAction, {
268
- columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
269
- columnActionsView: this.columnActionsView,
270
- disabledRowActions: this.disabledRowActions,
271
- row: this.row,
272
- rowIndex: this.rowIndex,
273
- rowIndexPath: ROW_INDEX_PATH,
274
- isFooter: this.isFooter,
275
- rowActionsClass: this.rowActionsClass,
276
- isRowActionsStickyLocal: this.isRowActionsStickyLocal,
277
- }, this.$slots);
278
-
279
- const CHILDREN = this.isMobile ?
280
- h("div", {
281
- class: "a_table_mobile__dl__wrapper",
282
- }, [
283
- this.$slots.rowMobilePrepend ?
284
- this.$slots.rowMobilePrepend({
285
- row: this.row,
286
- rowIndex: this.rowIndex,
287
- isFooter: this.isFooter,
288
- }) :
289
- "",
290
- (this.isTreeCollapsible && this.hasChildren) ?
291
- h(AElement, {
292
- "aria-hidden": true,
293
- class: "a_table__row_level__icon",
294
- classDefault: "",
295
- iconLeft: CaretRightFill,
296
- type: "text",
297
- }) :
298
- "",
299
- h("dl", {
300
- class: "a_table_mobile__dl",
301
- }, tds),
302
- this.$slots.rowMobileAppend ?
303
- this.$slots.rowMobileAppend({
304
- row: this.row,
305
- rowIndex: this.rowIndex,
306
- isFooter: this.isFooter,
307
- }) :
308
- "",
309
- ]) :
310
- tds;
311
-
312
- return [
313
- h("div", {
314
- id: this.rowHtmlId,
315
- role: this.roleLocal,
316
- class: this.rowClassComputed,
317
- "aria-expanded": this.ariaExpanded,
318
- ...this.previewAttributes,
319
- ...this.ariaTreeAttributes,
320
- ...this.eventsLocal,
321
- }, [
322
- this.isMultipleActionsActive && h("div", {
323
- class: "a_table__td a_table__cell a_table__cell_checkbox",
324
- style: `width: 50px; min-width: 50px; max-width: 50px;`,
325
- }, [
326
- !this.isFooter && h(AOneCheckbox, {
327
- isWidthAuto: true,
328
- modelValue: this.isRowSelected,
329
- disabled: this.isCheckboxDisabled,
330
- label: this.labelCheckbox,
331
- labelClass: "a_sr_only",
332
- isLabelTitle: true,
333
- "onUpdate:modelValue": this.toggleCheckbox,
334
- }),
335
- ]),
336
- CHILDREN,
337
- this.isMobile ?
338
- h("div", {
339
- class: "a_table_mobile__actions_parent",
340
- }, [
341
- this.isBtnToggleAllColumnsVisible && h(AElement, {
342
- class: "a_btn a_btn_link a_table_mobile__columns_btn_toggle",
343
- extra: {
344
- count: this.countInvisibleMobileColumns,
345
- },
346
- text: this.textBtnToggleAllColumns,
347
- type: "button",
348
- onClick: this.toggleAllColumnsVisibleMobile,
349
- }),
350
- ACTIONS,
351
- ]) :
352
- ACTIONS,
353
- ]),
354
- this.isPreviewDownOpen && h(ATablePreviewDown, {
355
- row: this.row,
356
- rowIndex: this.rowIndex,
357
- }, {
358
- preview: arg => this.$slots.preview ? this.$slots.preview(arg) : undefined,
359
- }),
360
- this.hasChildren ?
361
- this.children.map((row, rowIndex) => {
362
- return h(resolveComponent("ATableTr"), {
363
- key: row[this.keyId] || rowIndex,
364
- allVisibleMobileColumns: this.allVisibleMobileColumns,
365
- areAllRowsSelected: this.areAllRowsSelected,
366
- columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
367
- columnActionsView: this.columnActionsView,
368
- countVisibleMobileColumns: this.countVisibleMobileColumns,
369
- disabledPreview: this.disabledPreviewRow,
370
- disabledRowActions: this.disabledRowActions,
371
- isFooter: this.isFooter,
372
- isOneOfParentsClose: this.isOneOfParentsCloseForChildren,
373
- isPreviewDownOpen: false,
374
- isRowActionsStickyLocal: this.isRowActionsStickyLocal,
375
- isTree: this.isTree,
376
- isTreeCollapsible: this.isTreeCollapsible,
377
- isTreeOpened: this.isTreeOpened,
378
- keyChildren: this.keyChildren,
379
- keyId: this.keyId,
380
- level: this.levelForChildren,
381
- row,
382
- rowActionsClass: this.rowActionsClass,
383
- rowClass: this.rowClass,
384
- rowIndex,
385
- rowIndexPath: `${ ROW_INDEX_PATH }_${ rowIndex }`,
386
- rowsLength: this.children.length,
387
- selectedRowsIndexes: this.selectedRowsIndexes,
388
- }, {
389
- get: vm => [
390
- h(AGet, {
391
- data: vm.row,
392
- keyLabel: vm.column.keyLabel,
393
- filter: vm.column.filter,
394
- filterParameters: vm.column.filterParameters,
395
- defaultValue: vm.column.defaultValue,
396
- tag: vm.column.filterTag || "div",
397
- }),
398
- ],
399
- ...this.$slots,
400
- });
401
- }) :
402
- "",
403
- ];
404
- },
405
- };
1
+ import {
2
+ h,
3
+ resolveComponent,
4
+ } from "vue";
5
+
6
+ import AElement from "../../AElement/AElement";
7
+ import AGet from "../../AGet/AGet";
8
+ import AOneCheckbox from "../../ui/AOneCheckbox/AOneCheckbox";
9
+ import ATablePreviewDown from "../ATablePreviewDown/ATablePreviewDown";
10
+ import ATableTd from "../ATableTd/ATableTd";
11
+ import ATableTdAction from "../ATableTdAction/ATableTdAction";
12
+
13
+ import AttributesAPI from "./compositionAPI/AttributesAPI";
14
+ import CheckboxAPI from "./compositionAPI/CheckboxAPI";
15
+ import ChildrenAPI from "./compositionAPI/ChildrenAPI";
16
+ import ChildrenToggleAPI from "./compositionAPI/ChildrenToggleAPI";
17
+ import MobileAPI from "./compositionAPI/MobileAPI";
18
+ import PreviewAPI from "./compositionAPI/PreviewAPI";
19
+
20
+ import {
21
+ forEach,
22
+ } from "lodash-es";
23
+
24
+ const CaretRightFill = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-right-fill" viewBox="0 0 16 16">
25
+ <path d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z"/>
26
+ </svg>`;
27
+
28
+ export default {
29
+ name: "ATableTr",
30
+ props: {
31
+ allVisibleMobileColumns: {
32
+ type: Array,
33
+ required: true,
34
+ },
35
+ areAllRowsSelected: {
36
+ type: Boolean,
37
+ required: true,
38
+ },
39
+ columnActionsBtnGroupMaxWidthStyle: {
40
+ type: String,
41
+ required: false,
42
+ default: undefined,
43
+ },
44
+ columnActionsView: {
45
+ type: String,
46
+ required: true,
47
+ },
48
+ countVisibleMobileColumns: {
49
+ type: Number,
50
+ required: true,
51
+ },
52
+ disabledPreview: {
53
+ type: Boolean,
54
+ required: false,
55
+ },
56
+ disabledPreviewRowCallback: {
57
+ type: Function,
58
+ required: false,
59
+ },
60
+ disabledRowActions: {
61
+ type: Boolean,
62
+ required: false,
63
+ },
64
+ isFooter: {
65
+ type: Boolean,
66
+ required: false,
67
+ },
68
+ isOneOfParentsClose: {
69
+ type: Boolean,
70
+ required: false,
71
+ },
72
+ isPreviewDownOpen: {
73
+ type: Boolean,
74
+ required: false,
75
+ },
76
+ isRowActionsStickyLocal: {
77
+ type: Boolean,
78
+ required: true,
79
+ },
80
+ isTree: {
81
+ type: Boolean,
82
+ required: false,
83
+ },
84
+ isTreeCollapsible: {
85
+ type: Boolean,
86
+ required: false,
87
+ default: true,
88
+ },
89
+ isTreeOpened: {
90
+ type: Boolean,
91
+ required: false,
92
+ },
93
+ keyChildren: {
94
+ type: String,
95
+ required: false,
96
+ default: undefined,
97
+ },
98
+ keyId: {
99
+ type: String,
100
+ required: false,
101
+ default: "id",
102
+ },
103
+ level: {
104
+ type: Number,
105
+ required: true,
106
+ },
107
+ row: {
108
+ type: Object,
109
+ required: true,
110
+ },
111
+ rowActionsClass: {
112
+ type: [String, Object],
113
+ required: false,
114
+ default: undefined,
115
+ },
116
+ rowClass: {
117
+ type: [String, Object, Function],
118
+ required: false,
119
+ default: undefined,
120
+ },
121
+ rowIndex: {
122
+ type: Number,
123
+ required: true,
124
+ },
125
+ rowIndexPath: {
126
+ type: String,
127
+ required: false,
128
+ default: undefined,
129
+ },
130
+ rowsLength: {
131
+ type: Number,
132
+ required: true,
133
+ },
134
+ selectedRowsIndexes: {
135
+ type: Object,
136
+ required: true,
137
+ },
138
+ },
139
+ emits: [
140
+ "setSelectedRowsIndexes",
141
+ ],
142
+ setup(props, context) {
143
+ const {
144
+ ariaTreeAttributes,
145
+ children,
146
+ hasChildren,
147
+ levelForChildren,
148
+ rowClassLevelChildren,
149
+ } = ChildrenAPI(props);
150
+
151
+ const {
152
+ ariaExpanded,
153
+ initIsChildrenOpen,
154
+ isOneOfParentsCloseForChildren,
155
+ rowClassChildren,
156
+ toggleChildren,
157
+ } = ChildrenToggleAPI(props, {
158
+ hasChildren,
159
+ });
160
+
161
+ const {
162
+ hasPreviewLocal,
163
+ previewAttributes,
164
+ rowClassPreview,
165
+ } = PreviewAPI(props, {
166
+ hasChildren,
167
+ });
168
+
169
+ const {
170
+ disabledPreviewRow,
171
+ eventsLocal,
172
+ roleLocal,
173
+ rowClassComputed,
174
+ rowHtmlId,
175
+ } = AttributesAPI(props, {
176
+ hasChildren,
177
+ hasPreviewLocal,
178
+ rowClassChildren,
179
+ rowClassLevelChildren,
180
+ rowClassPreview,
181
+ toggleChildren,
182
+ });
183
+
184
+ const {
185
+ countInvisibleMobileColumns,
186
+ isAllColumnsVisibleMobile,
187
+ isBtnToggleAllColumnsVisible,
188
+ textBtnToggleAllColumns,
189
+ toggleAllColumnsVisibleMobile,
190
+ } = MobileAPI(props);
191
+
192
+ const {
193
+ isCheckboxDisabled,
194
+ isRowSelected,
195
+ labelCheckbox,
196
+ toggleCheckbox,
197
+ } = CheckboxAPI(props, context);
198
+
199
+ initIsChildrenOpen();
200
+
201
+ return {
202
+ ariaExpanded,
203
+ ariaTreeAttributes,
204
+ children,
205
+ countInvisibleMobileColumns,
206
+ disabledPreviewRow,
207
+ eventsLocal,
208
+ hasChildren,
209
+ isAllColumnsVisibleMobile,
210
+ isBtnToggleAllColumnsVisible,
211
+ isCheckboxDisabled,
212
+ isOneOfParentsCloseForChildren,
213
+ isRowSelected,
214
+ labelCheckbox,
215
+ levelForChildren,
216
+ previewAttributes,
217
+ roleLocal,
218
+ rowClassComputed,
219
+ rowHtmlId,
220
+ textBtnToggleAllColumns,
221
+ toggleAllColumnsVisibleMobile,
222
+ toggleCheckbox,
223
+ toggleChildren,
224
+ };
225
+ },
226
+ inject: [
227
+ "columnsFilteredForRender",
228
+ "isActionColumnVisible",
229
+ "isMultipleActionsActive",
230
+ "isMobile",
231
+ ],
232
+ render() {
233
+ const ROW_INDEX_PATH = this.rowIndexPath || `${ this.rowIndex }`;
234
+ let tds = [];
235
+ if (this.isMobile && !this.isAllColumnsVisibleMobile) {
236
+ forEach(this.allVisibleMobileColumns, (column, columnIndex) => {
237
+ if (columnIndex + 1 > this.countVisibleMobileColumns) {
238
+ return false;
239
+ }
240
+ tds.push(
241
+ h(ATableTd, {
242
+ key: column.id,
243
+ column,
244
+ columnIndex,
245
+ disabledPreview: this.disabledPreviewRow,
246
+ level: this.level,
247
+ row: this.row,
248
+ rowIndex: this.rowIndex,
249
+ isFooter: this.isFooter,
250
+ }, this.$slots),
251
+ );
252
+ });
253
+ } else {
254
+ tds = this.columnsFilteredForRender.map((column, columnIndex) => {
255
+ return h(ATableTd, {
256
+ key: column.id,
257
+ column,
258
+ columnIndex,
259
+ disabledPreview: this.disabledPreviewRow,
260
+ level: this.level,
261
+ row: this.row,
262
+ rowIndex: this.rowIndex,
263
+ isFooter: this.isFooter,
264
+ showIconChildren: !!(this.isTreeCollapsible && this.hasChildren && columnIndex === 0),
265
+ }, this.$slots);
266
+ });
267
+ }
268
+
269
+ const ACTIONS = this.isActionColumnVisible &&
270
+ h(ATableTdAction, {
271
+ columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
272
+ columnActionsView: this.columnActionsView,
273
+ disabledRowActions: this.disabledRowActions,
274
+ row: this.row,
275
+ rowIndex: this.rowIndex,
276
+ rowIndexPath: ROW_INDEX_PATH,
277
+ isFooter: this.isFooter,
278
+ rowActionsClass: this.rowActionsClass,
279
+ isRowActionsStickyLocal: this.isRowActionsStickyLocal,
280
+ }, this.$slots);
281
+
282
+ const CHILDREN = this.isMobile ?
283
+ h("div", {
284
+ class: "a_table_mobile__dl__wrapper",
285
+ }, [
286
+ this.$slots.rowMobilePrepend ?
287
+ this.$slots.rowMobilePrepend({
288
+ row: this.row,
289
+ rowIndex: this.rowIndex,
290
+ isFooter: this.isFooter,
291
+ }) :
292
+ "",
293
+ (this.isTreeCollapsible && this.hasChildren) ?
294
+ h(AElement, {
295
+ "aria-hidden": true,
296
+ class: "a_table__row_level__icon",
297
+ classDefault: "",
298
+ iconLeft: CaretRightFill,
299
+ type: "text",
300
+ }) :
301
+ "",
302
+ h("dl", {
303
+ class: "a_table_mobile__dl",
304
+ }, tds),
305
+ this.$slots.rowMobileAppend ?
306
+ this.$slots.rowMobileAppend({
307
+ row: this.row,
308
+ rowIndex: this.rowIndex,
309
+ isFooter: this.isFooter,
310
+ }) :
311
+ "",
312
+ ]) :
313
+ tds;
314
+
315
+ return [
316
+ h("div", {
317
+ id: this.rowHtmlId,
318
+ role: this.roleLocal,
319
+ class: this.rowClassComputed,
320
+ "aria-expanded": this.ariaExpanded,
321
+ ...this.previewAttributes,
322
+ ...this.ariaTreeAttributes,
323
+ ...this.eventsLocal,
324
+ }, [
325
+ this.isMultipleActionsActive && h("div", {
326
+ class: "a_table__td a_table__cell a_table__cell_checkbox",
327
+ style: `width: 50px; min-width: 50px; max-width: 50px;`,
328
+ }, [
329
+ !this.isFooter && h(AOneCheckbox, {
330
+ isWidthAuto: true,
331
+ modelValue: this.isRowSelected,
332
+ disabled: this.isCheckboxDisabled,
333
+ label: this.labelCheckbox,
334
+ labelClass: "a_sr_only",
335
+ isLabelTitle: true,
336
+ "onUpdate:modelValue": this.toggleCheckbox,
337
+ }),
338
+ ]),
339
+ CHILDREN,
340
+ this.isMobile ?
341
+ h("div", {
342
+ class: "a_table_mobile__actions_parent",
343
+ }, [
344
+ this.isBtnToggleAllColumnsVisible && h(AElement, {
345
+ class: "a_btn a_btn_link a_table_mobile__columns_btn_toggle",
346
+ extra: {
347
+ count: this.countInvisibleMobileColumns,
348
+ },
349
+ text: this.textBtnToggleAllColumns,
350
+ type: "button",
351
+ onClick: this.toggleAllColumnsVisibleMobile,
352
+ }),
353
+ ACTIONS,
354
+ ]) :
355
+ ACTIONS,
356
+ ]),
357
+ this.isPreviewDownOpen && h(ATablePreviewDown, {
358
+ row: this.row,
359
+ rowIndex: this.rowIndex,
360
+ }, {
361
+ preview: arg => this.$slots.preview ? this.$slots.preview(arg) : undefined,
362
+ }),
363
+ this.hasChildren ?
364
+ this.children.map((row, rowIndex) => {
365
+ return h(resolveComponent("ATableTr"), {
366
+ key: row[this.keyId] || rowIndex,
367
+ allVisibleMobileColumns: this.allVisibleMobileColumns,
368
+ areAllRowsSelected: this.areAllRowsSelected,
369
+ columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
370
+ columnActionsView: this.columnActionsView,
371
+ countVisibleMobileColumns: this.countVisibleMobileColumns,
372
+ disabledPreview: this.disabledPreviewRow,
373
+ disabledRowActions: this.disabledRowActions,
374
+ isFooter: this.isFooter,
375
+ isOneOfParentsClose: this.isOneOfParentsCloseForChildren,
376
+ isPreviewDownOpen: false,
377
+ isRowActionsStickyLocal: this.isRowActionsStickyLocal,
378
+ isTree: this.isTree,
379
+ isTreeCollapsible: this.isTreeCollapsible,
380
+ isTreeOpened: this.isTreeOpened,
381
+ keyChildren: this.keyChildren,
382
+ keyId: this.keyId,
383
+ level: this.levelForChildren,
384
+ row,
385
+ rowActionsClass: this.rowActionsClass,
386
+ rowClass: this.rowClass,
387
+ rowIndex,
388
+ rowIndexPath: `${ ROW_INDEX_PATH }_${ rowIndex }`,
389
+ rowsLength: this.children.length,
390
+ selectedRowsIndexes: this.selectedRowsIndexes,
391
+ }, {
392
+ get: vm => [
393
+ h(AGet, {
394
+ data: vm.row,
395
+ keyLabel: vm.column.keyLabel,
396
+ filter: vm.column.filter,
397
+ filterParameters: vm.column.filterParameters,
398
+ defaultValue: vm.column.defaultValue,
399
+ tag: vm.column.filterTag || "div",
400
+ }),
401
+ ],
402
+ ...this.$slots,
403
+ });
404
+ }) :
405
+ "",
406
+ ];
407
+ },
408
+ };