aloha-vue 1.2.174 → 1.2.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "Vue.js"
15
15
  ],
16
16
  "homepage": "https://github.com/ilia-brykin/aloha/#README.md",
17
- "version": "1.2.174",
17
+ "version": "1.2.175",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -1,136 +1,141 @@
1
- import {
2
- h,
3
- resolveComponent,
4
- } from "vue";
5
-
6
- import AElement from "../../AElement/AElement";
7
- import ATranslation from "../../ATranslation/ATranslation";
8
-
9
- import AttributesAPI from "./compositionAPI/AttributesAPI";
10
- import LinkAPI from "./compositionAPI/LinkAPI";
11
- import SlotAPI from "./compositionAPI/SlotAPI";
12
- import TextAPI from "./compositionAPI/TextAPI";
13
-
14
- export default {
15
- name: "ATableTd",
16
- props: {
17
- column: {
18
- type: Object,
19
- required: true,
20
- },
21
- columnIndex: {
22
- type: Number,
23
- required: true,
24
- },
25
- disabledPreview: {
26
- type: Boolean,
27
- required: false,
28
- },
29
- isFooter: {
30
- type: Boolean,
31
- required: false,
32
- },
33
- row: {
34
- type: Object,
35
- required: true,
36
- },
37
- rowIndex: {
38
- type: Number,
39
- required: true,
40
- },
41
- showIconChildren: {
42
- type: Boolean,
43
- required: false,
44
- },
45
- },
46
- inject: [
47
- "isMobile",
48
- "rowsLocalAll",
49
- ],
50
- setup(props) {
51
- const {
52
- attributesForTd,
53
- } = AttributesAPI(props);
54
-
55
- const {
56
- classForLink,
57
- isLink,
58
- toLocal,
59
- } = LinkAPI(props);
60
-
61
- const {
62
- hasSlot,
63
- slotName,
64
- } = SlotAPI(props);
65
-
66
- const {
67
- textOrHtmlRender,
68
- } = TextAPI(props);
69
-
70
- return {
71
- attributesForTd,
72
- classForLink,
73
- hasSlot,
74
- isLink,
75
- slotName,
76
- textOrHtmlRender,
77
- toLocal,
78
- };
79
- },
80
- render() {
81
- const TD = h(
82
- "div",
83
- this.attributesForTd,
84
- [
85
- h("div", {
86
- class: [
87
- "a_table__cell__child",
88
- this.column.class,
89
- this.column.classRow,
90
- ],
91
- }, [
92
- this.showIconChildren ? h(AElement, {
93
- "aria-hidden": true,
94
- class: "a_table__row_level__icon",
95
- classDefault: "",
96
- iconLeft: "CaretRightFill",
97
- type: "text",
98
- }) : "",
99
- (this.hasSlot && this.$slots[this.slotName]) ?
100
- this.$slots[this.slotName]({
101
- column: this.column,
102
- columnIndex: this.columnIndex,
103
- row: this.row,
104
- rowIndex: this.rowIndex,
105
- rows: this.rowsLocalAll,
106
- }) :
107
- (this.isLink && this.toLocal) ?
108
- h(resolveComponent("RouterLink"), {
109
- class: [
110
- this.column.class,
111
- this.classForLink,
112
- this.column.classRow,
113
- ],
114
- to: this.toLocal,
115
- }, () => [
116
- this.textOrHtmlRender,
117
- ]) :
118
- this.textOrHtmlRender,
119
- ]),
120
- ]
121
- );
122
-
123
- if (!this.isMobile) {
124
- return TD;
125
- }
126
- return [
127
- h(ATranslation, {
128
- text: this.column.label,
129
- tag: "dt",
130
- }),
131
- h("dd", {}, [
132
- TD,
133
- ]),
134
- ];
135
- },
136
- };
1
+ import {
2
+ h,
3
+ resolveComponent,
4
+ } from "vue";
5
+
6
+ import AElement from "../../AElement/AElement";
7
+ import ATranslation from "../../ATranslation/ATranslation";
8
+
9
+ import AttributesAPI from "./compositionAPI/AttributesAPI";
10
+ import LinkAPI from "./compositionAPI/LinkAPI";
11
+ import SlotAPI from "./compositionAPI/SlotAPI";
12
+ import TextAPI from "./compositionAPI/TextAPI";
13
+
14
+ export default {
15
+ name: "ATableTd",
16
+ props: {
17
+ column: {
18
+ type: Object,
19
+ required: true,
20
+ },
21
+ columnIndex: {
22
+ type: Number,
23
+ required: true,
24
+ },
25
+ disabledPreview: {
26
+ type: Boolean,
27
+ required: false,
28
+ },
29
+ isFooter: {
30
+ type: Boolean,
31
+ required: false,
32
+ },
33
+ level: {
34
+ type: Number,
35
+ required: true,
36
+ },
37
+ row: {
38
+ type: Object,
39
+ required: true,
40
+ },
41
+ rowIndex: {
42
+ type: Number,
43
+ required: true,
44
+ },
45
+ showIconChildren: {
46
+ type: Boolean,
47
+ required: false,
48
+ },
49
+ },
50
+ inject: [
51
+ "isMobile",
52
+ "rowsLocalAll",
53
+ ],
54
+ setup(props) {
55
+ const {
56
+ attributesForTd,
57
+ } = AttributesAPI(props);
58
+
59
+ const {
60
+ classForLink,
61
+ isLink,
62
+ toLocal,
63
+ } = LinkAPI(props);
64
+
65
+ const {
66
+ hasSlot,
67
+ slotName,
68
+ } = SlotAPI(props);
69
+
70
+ const {
71
+ textOrHtmlRender,
72
+ } = TextAPI(props);
73
+
74
+ return {
75
+ attributesForTd,
76
+ classForLink,
77
+ hasSlot,
78
+ isLink,
79
+ slotName,
80
+ textOrHtmlRender,
81
+ toLocal,
82
+ };
83
+ },
84
+ render() {
85
+ const TD = h(
86
+ "div",
87
+ this.attributesForTd,
88
+ [
89
+ h("div", {
90
+ class: [
91
+ "a_table__cell__child",
92
+ this.column.class,
93
+ this.column.classRow,
94
+ ],
95
+ }, [
96
+ this.showIconChildren ? h(AElement, {
97
+ "aria-hidden": true,
98
+ class: "a_table__row_level__icon",
99
+ classDefault: "",
100
+ iconLeft: "CaretRightFill",
101
+ type: "text",
102
+ }) : "",
103
+ (this.hasSlot && this.$slots[this.slotName]) ?
104
+ this.$slots[this.slotName]({
105
+ column: this.column,
106
+ columnIndex: this.columnIndex,
107
+ level: this.level,
108
+ row: this.row,
109
+ rowIndex: this.rowIndex,
110
+ rows: this.rowsLocalAll,
111
+ }) :
112
+ (this.isLink && this.toLocal) ?
113
+ h(resolveComponent("RouterLink"), {
114
+ class: [
115
+ this.column.class,
116
+ this.classForLink,
117
+ this.column.classRow,
118
+ ],
119
+ to: this.toLocal,
120
+ }, () => [
121
+ this.textOrHtmlRender,
122
+ ]) :
123
+ this.textOrHtmlRender,
124
+ ]),
125
+ ]
126
+ );
127
+
128
+ if (!this.isMobile) {
129
+ return TD;
130
+ }
131
+ return [
132
+ h(ATranslation, {
133
+ text: this.column.label,
134
+ tag: "dt",
135
+ }),
136
+ h("dd", {}, [
137
+ TD,
138
+ ]),
139
+ ];
140
+ },
141
+ };
@@ -1,337 +1,352 @@
1
- import {
2
- h, resolveComponent,
3
- } from "vue";
4
-
5
- import AButton from "../../AButton/AButton";
6
- import AOneCheckbox from "../../ui/AOneCheckbox/AOneCheckbox";
7
- import ATablePreviewDown from "../ATablePreviewDown/ATablePreviewDown";
8
- import ATableTd from "../ATableTd/ATableTd";
9
- import ATableTdAction from "../ATableTdAction/ATableTdAction";
10
-
11
- import AttributesAPI from "./compositionAPI/AttributesAPI";
12
- import CheckboxAPI from "./compositionAPI/CheckboxAPI";
13
- import ChildrenAPI from "./compositionAPI/ChildrenAPI";
14
- import ChildrenToggleAPI from "./compositionAPI/ChildrenToggleAPI";
15
- import MobileAPI from "./compositionAPI/MobileAPI";
16
- import PreviewAPI from "./compositionAPI/PreviewAPI";
17
-
18
- import {
19
- forEach,
20
- } from "lodash-es";
21
-
22
- export default {
23
- name: "ATableTr",
24
- props: {
25
- allVisibleMobileColumns: {
26
- type: Array,
27
- required: true,
28
- },
29
- areAllRowsSelected: {
30
- type: Boolean,
31
- required: true,
32
- },
33
- columnActionsBtnGroupMaxWidthStyle: {
34
- type: String,
35
- required: false,
36
- default: undefined,
37
- },
38
- columnActionsView: {
39
- type: String,
40
- required: true,
41
- },
42
- countVisibleMobileColumns: {
43
- type: Number,
44
- required: true,
45
- },
46
- disabledPreview: {
47
- type: Boolean,
48
- required: false,
49
- },
50
- disabledPreviewRowCallback: {
51
- type: Function,
52
- required: false,
53
- },
54
- disabledRowActions: {
55
- type: Boolean,
56
- required: false,
57
- },
58
- isFooter: {
59
- type: Boolean,
60
- required: false,
61
- },
62
- isOneOfParentsClose: {
63
- type: Boolean,
64
- required: false,
65
- },
66
- isPreviewDownOpen: {
67
- type: Boolean,
68
- required: false,
69
- },
70
- isRowActionsStickyLocal: {
71
- type: Boolean,
72
- required: true,
73
- },
74
- isTree: {
75
- type: Boolean,
76
- required: false,
77
- },
78
- keyChildren: {
79
- type: String,
80
- required: false,
81
- default: undefined,
82
- },
83
- keyId: {
84
- type: String,
85
- required: false,
86
- default: "id",
87
- },
88
- level: {
89
- type: Number,
90
- required: true,
91
- },
92
- row: {
93
- type: Object,
94
- required: true,
95
- },
96
- rowActionsClass: {
97
- type: [String, Object],
98
- required: false,
99
- default: undefined,
100
- },
101
- rowClass: {
102
- type: [String, Object, Function],
103
- required: false,
104
- default: undefined,
105
- },
106
- rowIndex: {
107
- type: Number,
108
- required: true,
109
- },
110
- rowsLength: {
111
- type: Number,
112
- required: true,
113
- },
114
- selectedRowsIndexes: {
115
- type: Object,
116
- required: true,
117
- },
118
- },
119
- emits: [
120
- "setSelectedRowsIndexes",
121
- ],
122
- setup(props, context) {
123
- const {
124
- ariaTreeAttributes,
125
- children,
126
- hasChildren,
127
- levelForChildren,
128
- rowClassLevelChildren,
129
- } = ChildrenAPI(props);
130
-
131
- const {
132
- ariaExpanded,
133
- isOneOfParentsCloseForChildren,
134
- rowClassChildren,
135
- toggleChildren,
136
- } = ChildrenToggleAPI(props, {
137
- hasChildren,
138
- });
139
-
140
- const {
141
- hasPreviewLocal,
142
- previewAttributes,
143
- rowClassPreview,
144
- } = PreviewAPI(props, {
145
- hasChildren,
146
- });
147
-
148
- const {
149
- disabledPreviewRow,
150
- eventsLocal,
151
- roleLocal,
152
- rowClassComputed,
153
- rowHtmlId,
154
- } = AttributesAPI(props, {
155
- hasChildren,
156
- hasPreviewLocal,
157
- rowClassChildren,
158
- rowClassLevelChildren,
159
- rowClassPreview,
160
- toggleChildren,
161
- });
162
-
163
- const {
164
- countInvisibleMobileColumns,
165
- isAllColumnsVisibleMobile,
166
- isBtnToggleAllColumnsVisible,
167
- textBtnToggleAllColumns,
168
- toggleAllColumnsVisibleMobile,
169
- } = MobileAPI(props);
170
-
171
- const {
172
- isCheckboxDisabled,
173
- isRowSelected,
174
- labelCheckbox,
175
- toggleCheckbox,
176
- } = CheckboxAPI(props, context);
177
-
178
- return {
179
- ariaExpanded,
180
- ariaTreeAttributes,
181
- children,
182
- countInvisibleMobileColumns,
183
- disabledPreviewRow,
184
- eventsLocal,
185
- hasChildren,
186
- isAllColumnsVisibleMobile,
187
- isBtnToggleAllColumnsVisible,
188
- isCheckboxDisabled,
189
- isOneOfParentsCloseForChildren,
190
- isRowSelected,
191
- labelCheckbox,
192
- levelForChildren,
193
- previewAttributes,
194
- roleLocal,
195
- rowClassComputed,
196
- rowHtmlId,
197
- textBtnToggleAllColumns,
198
- toggleAllColumnsVisibleMobile,
199
- toggleCheckbox,
200
- };
201
- },
202
- inject: [
203
- "columnsFilteredForRender",
204
- "isActionColumnVisible",
205
- "isMultipleActionsActive",
206
- "isMobile",
207
- ],
208
- render() {
209
- let tds = [];
210
- if (this.isMobile && !this.isAllColumnsVisibleMobile) {
211
- forEach(this.allVisibleMobileColumns, (column, columnIndex) => {
212
- if (columnIndex + 1 > this.countVisibleMobileColumns) {
213
- return false;
214
- }
215
- tds.push(
216
- h(ATableTd, {
217
- key: column.id,
218
- column,
219
- columnIndex,
220
- disabledPreview: this.disabledPreviewRow,
221
- row: this.row,
222
- rowIndex: this.rowIndex,
223
- isFooter: this.isFooter,
224
- }, this.$slots)
225
- );
226
- });
227
- } else {
228
- tds = this.columnsFilteredForRender.map((column, columnIndex) => {
229
- return h(ATableTd, {
230
- key: column.id,
231
- column,
232
- columnIndex,
233
- disabledPreview: this.disabledPreviewRow,
234
- row: this.row,
235
- rowIndex: this.rowIndex,
236
- isFooter: this.isFooter,
237
- showIconChildren: !!(this.hasChildren && columnIndex === 0),
238
- }, this.$slots);
239
- });
240
- }
241
-
242
- const ACTIONS = this.isActionColumnVisible &&
243
- h(ATableTdAction, {
244
- columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
245
- columnActionsView: this.columnActionsView,
246
- disabledRowActions: this.disabledRowActions,
247
- row: this.row,
248
- rowIndex: this.rowIndex,
249
- isFooter: this.isFooter,
250
- rowActionsClass: this.rowActionsClass,
251
- isRowActionsStickyLocal: this.isRowActionsStickyLocal,
252
- }, this.$slots);
253
-
254
- const CHILDREN = this.isMobile ?
255
- h("dl", {
256
- class: "a_table_mobile__dl",
257
- }, tds) :
258
- tds;
259
-
260
- return [
261
- h("div", {
262
- id: this.rowHtmlId,
263
- role: this.roleLocal,
264
- class: this.rowClassComputed,
265
- "aria-expanded": this.ariaExpanded,
266
- ...this.previewAttributes,
267
- ...this.ariaTreeAttributes,
268
- ...this.eventsLocal,
269
- }, [
270
- this.isMultipleActionsActive && h("div", {
271
- class: "a_table__td a_table__cell a_table__cell_checkbox",
272
- style: `width: 50px; min-width: 50px; max-width: 50px;`,
273
- }, [
274
- !this.isFooter && h(AOneCheckbox, {
275
- isWidthAuto: true,
276
- modelValue: this.isRowSelected,
277
- disabled: this.isCheckboxDisabled,
278
- label: this.labelCheckbox,
279
- labelClass: "a_sr_only",
280
- isLabelTitle: true,
281
- "onUpdate:modelValue": this.toggleCheckbox,
282
- }),
283
- ]),
284
- CHILDREN,
285
- this.isMobile ?
286
- h("div", {
287
- class: "a_table_mobile__actions_parent",
288
- }, [
289
- this.isBtnToggleAllColumnsVisible && h(AButton, {
290
- class: "a_btn a_btn_link a_table_mobile__columns_btn_toggle",
291
- extra: {
292
- count: this.countInvisibleMobileColumns,
293
- },
294
- text: this.textBtnToggleAllColumns,
295
- onClick: this.toggleAllColumnsVisibleMobile,
296
- }),
297
- ACTIONS,
298
- ]) :
299
- ACTIONS,
300
- ]),
301
- this.isPreviewDownOpen && h(ATablePreviewDown, {
302
- row: this.row,
303
- rowIndex: this.rowIndex,
304
- }, {
305
- preview: arg => this.$slots.preview ? this.$slots.preview(arg) : undefined,
306
- }),
307
- this.hasChildren ?
308
- this.children.map((row, rowIndex) => {
309
- return h(resolveComponent("ATableTr"), {
310
- key: row[this.keyId] || rowIndex,
311
- allVisibleMobileColumns: this.allVisibleMobileColumns,
312
- areAllRowsSelected: this.areAllRowsSelected,
313
- columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
314
- columnActionsView: this.columnActionsView,
315
- countVisibleMobileColumns: this.countVisibleMobileColumns,
316
- disabledPreview: this.disabledPreviewRow,
317
- disabledRowActions: this.disabledRowActions,
318
- isFooter: this.isFooter,
319
- isOneOfParentsClose: this.isOneOfParentsCloseForChildren,
320
- isPreviewDownOpen: false,
321
- isRowActionsStickyLocal: this.isRowActionsStickyLocal,
322
- isTree: this.isTree,
323
- keyChildren: this.keyChildren,
324
- keyId: this.keyId,
325
- level: this.levelForChildren,
326
- row,
327
- rowActionsClass: this.rowActionsClass,
328
- rowClass: this.rowClass,
329
- rowIndex,
330
- rowsLength: this.children.length,
331
- selectedRowsIndexes: this.selectedRowsIndexes,
332
- });
333
- }) :
334
- "",
335
- ];
336
- },
337
- };
1
+ import {
2
+ h, resolveComponent,
3
+ } from "vue";
4
+
5
+ import AButton from "../../AButton/AButton";
6
+ import AGet from "../../AGet/AGet";
7
+ import AOneCheckbox from "../../ui/AOneCheckbox/AOneCheckbox";
8
+ import ATablePreviewDown from "../ATablePreviewDown/ATablePreviewDown";
9
+ import ATableTd from "../ATableTd/ATableTd";
10
+ import ATableTdAction from "../ATableTdAction/ATableTdAction";
11
+
12
+ import AttributesAPI from "./compositionAPI/AttributesAPI";
13
+ import CheckboxAPI from "./compositionAPI/CheckboxAPI";
14
+ import ChildrenAPI from "./compositionAPI/ChildrenAPI";
15
+ import ChildrenToggleAPI from "./compositionAPI/ChildrenToggleAPI";
16
+ import MobileAPI from "./compositionAPI/MobileAPI";
17
+ import PreviewAPI from "./compositionAPI/PreviewAPI";
18
+
19
+ import {
20
+ forEach,
21
+ } from "lodash-es";
22
+
23
+ export default {
24
+ name: "ATableTr",
25
+ props: {
26
+ allVisibleMobileColumns: {
27
+ type: Array,
28
+ required: true,
29
+ },
30
+ areAllRowsSelected: {
31
+ type: Boolean,
32
+ required: true,
33
+ },
34
+ columnActionsBtnGroupMaxWidthStyle: {
35
+ type: String,
36
+ required: false,
37
+ default: undefined,
38
+ },
39
+ columnActionsView: {
40
+ type: String,
41
+ required: true,
42
+ },
43
+ countVisibleMobileColumns: {
44
+ type: Number,
45
+ required: true,
46
+ },
47
+ disabledPreview: {
48
+ type: Boolean,
49
+ required: false,
50
+ },
51
+ disabledPreviewRowCallback: {
52
+ type: Function,
53
+ required: false,
54
+ },
55
+ disabledRowActions: {
56
+ type: Boolean,
57
+ required: false,
58
+ },
59
+ isFooter: {
60
+ type: Boolean,
61
+ required: false,
62
+ },
63
+ isOneOfParentsClose: {
64
+ type: Boolean,
65
+ required: false,
66
+ },
67
+ isPreviewDownOpen: {
68
+ type: Boolean,
69
+ required: false,
70
+ },
71
+ isRowActionsStickyLocal: {
72
+ type: Boolean,
73
+ required: true,
74
+ },
75
+ isTree: {
76
+ type: Boolean,
77
+ required: false,
78
+ },
79
+ keyChildren: {
80
+ type: String,
81
+ required: false,
82
+ default: undefined,
83
+ },
84
+ keyId: {
85
+ type: String,
86
+ required: false,
87
+ default: "id",
88
+ },
89
+ level: {
90
+ type: Number,
91
+ required: true,
92
+ },
93
+ row: {
94
+ type: Object,
95
+ required: true,
96
+ },
97
+ rowActionsClass: {
98
+ type: [String, Object],
99
+ required: false,
100
+ default: undefined,
101
+ },
102
+ rowClass: {
103
+ type: [String, Object, Function],
104
+ required: false,
105
+ default: undefined,
106
+ },
107
+ rowIndex: {
108
+ type: Number,
109
+ required: true,
110
+ },
111
+ rowsLength: {
112
+ type: Number,
113
+ required: true,
114
+ },
115
+ selectedRowsIndexes: {
116
+ type: Object,
117
+ required: true,
118
+ },
119
+ },
120
+ emits: [
121
+ "setSelectedRowsIndexes",
122
+ ],
123
+ setup(props, context) {
124
+ const {
125
+ ariaTreeAttributes,
126
+ children,
127
+ hasChildren,
128
+ levelForChildren,
129
+ rowClassLevelChildren,
130
+ } = ChildrenAPI(props);
131
+
132
+ const {
133
+ ariaExpanded,
134
+ isOneOfParentsCloseForChildren,
135
+ rowClassChildren,
136
+ toggleChildren,
137
+ } = ChildrenToggleAPI(props, {
138
+ hasChildren,
139
+ });
140
+
141
+ const {
142
+ hasPreviewLocal,
143
+ previewAttributes,
144
+ rowClassPreview,
145
+ } = PreviewAPI(props, {
146
+ hasChildren,
147
+ });
148
+
149
+ const {
150
+ disabledPreviewRow,
151
+ eventsLocal,
152
+ roleLocal,
153
+ rowClassComputed,
154
+ rowHtmlId,
155
+ } = AttributesAPI(props, {
156
+ hasChildren,
157
+ hasPreviewLocal,
158
+ rowClassChildren,
159
+ rowClassLevelChildren,
160
+ rowClassPreview,
161
+ toggleChildren,
162
+ });
163
+
164
+ const {
165
+ countInvisibleMobileColumns,
166
+ isAllColumnsVisibleMobile,
167
+ isBtnToggleAllColumnsVisible,
168
+ textBtnToggleAllColumns,
169
+ toggleAllColumnsVisibleMobile,
170
+ } = MobileAPI(props);
171
+
172
+ const {
173
+ isCheckboxDisabled,
174
+ isRowSelected,
175
+ labelCheckbox,
176
+ toggleCheckbox,
177
+ } = CheckboxAPI(props, context);
178
+
179
+ return {
180
+ ariaExpanded,
181
+ ariaTreeAttributes,
182
+ children,
183
+ countInvisibleMobileColumns,
184
+ disabledPreviewRow,
185
+ eventsLocal,
186
+ hasChildren,
187
+ isAllColumnsVisibleMobile,
188
+ isBtnToggleAllColumnsVisible,
189
+ isCheckboxDisabled,
190
+ isOneOfParentsCloseForChildren,
191
+ isRowSelected,
192
+ labelCheckbox,
193
+ levelForChildren,
194
+ previewAttributes,
195
+ roleLocal,
196
+ rowClassComputed,
197
+ rowHtmlId,
198
+ textBtnToggleAllColumns,
199
+ toggleAllColumnsVisibleMobile,
200
+ toggleCheckbox,
201
+ };
202
+ },
203
+ inject: [
204
+ "columnsFilteredForRender",
205
+ "isActionColumnVisible",
206
+ "isMultipleActionsActive",
207
+ "isMobile",
208
+ ],
209
+ render() {
210
+ let tds = [];
211
+ if (this.isMobile && !this.isAllColumnsVisibleMobile) {
212
+ forEach(this.allVisibleMobileColumns, (column, columnIndex) => {
213
+ if (columnIndex + 1 > this.countVisibleMobileColumns) {
214
+ return false;
215
+ }
216
+ tds.push(
217
+ h(ATableTd, {
218
+ key: column.id,
219
+ column,
220
+ columnIndex,
221
+ disabledPreview: this.disabledPreviewRow,
222
+ level: this.level,
223
+ row: this.row,
224
+ rowIndex: this.rowIndex,
225
+ isFooter: this.isFooter,
226
+ }, this.$slots)
227
+ );
228
+ });
229
+ } else {
230
+ tds = this.columnsFilteredForRender.map((column, columnIndex) => {
231
+ return h(ATableTd, {
232
+ key: column.id,
233
+ column,
234
+ columnIndex,
235
+ disabledPreview: this.disabledPreviewRow,
236
+ level: this.level,
237
+ row: this.row,
238
+ rowIndex: this.rowIndex,
239
+ isFooter: this.isFooter,
240
+ showIconChildren: !!(this.hasChildren && columnIndex === 0),
241
+ }, this.$slots);
242
+ });
243
+ }
244
+
245
+ const ACTIONS = this.isActionColumnVisible &&
246
+ h(ATableTdAction, {
247
+ columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
248
+ columnActionsView: this.columnActionsView,
249
+ disabledRowActions: this.disabledRowActions,
250
+ row: this.row,
251
+ rowIndex: this.rowIndex,
252
+ isFooter: this.isFooter,
253
+ rowActionsClass: this.rowActionsClass,
254
+ isRowActionsStickyLocal: this.isRowActionsStickyLocal,
255
+ }, this.$slots);
256
+
257
+ const CHILDREN = this.isMobile ?
258
+ h("dl", {
259
+ class: "a_table_mobile__dl",
260
+ }, tds) :
261
+ tds;
262
+
263
+ return [
264
+ h("div", {
265
+ id: this.rowHtmlId,
266
+ role: this.roleLocal,
267
+ class: this.rowClassComputed,
268
+ "aria-expanded": this.ariaExpanded,
269
+ ...this.previewAttributes,
270
+ ...this.ariaTreeAttributes,
271
+ ...this.eventsLocal,
272
+ }, [
273
+ this.isMultipleActionsActive && h("div", {
274
+ class: "a_table__td a_table__cell a_table__cell_checkbox",
275
+ style: `width: 50px; min-width: 50px; max-width: 50px;`,
276
+ }, [
277
+ !this.isFooter && h(AOneCheckbox, {
278
+ isWidthAuto: true,
279
+ modelValue: this.isRowSelected,
280
+ disabled: this.isCheckboxDisabled,
281
+ label: this.labelCheckbox,
282
+ labelClass: "a_sr_only",
283
+ isLabelTitle: true,
284
+ "onUpdate:modelValue": this.toggleCheckbox,
285
+ }),
286
+ ]),
287
+ CHILDREN,
288
+ this.isMobile ?
289
+ h("div", {
290
+ class: "a_table_mobile__actions_parent",
291
+ }, [
292
+ this.isBtnToggleAllColumnsVisible && h(AButton, {
293
+ class: "a_btn a_btn_link a_table_mobile__columns_btn_toggle",
294
+ extra: {
295
+ count: this.countInvisibleMobileColumns,
296
+ },
297
+ text: this.textBtnToggleAllColumns,
298
+ onClick: this.toggleAllColumnsVisibleMobile,
299
+ }),
300
+ ACTIONS,
301
+ ]) :
302
+ ACTIONS,
303
+ ]),
304
+ this.isPreviewDownOpen && h(ATablePreviewDown, {
305
+ row: this.row,
306
+ rowIndex: this.rowIndex,
307
+ }, {
308
+ preview: arg => this.$slots.preview ? this.$slots.preview(arg) : undefined,
309
+ }),
310
+ this.hasChildren ?
311
+ this.children.map((row, rowIndex) => {
312
+ return h(resolveComponent("ATableTr"), {
313
+ key: row[this.keyId] || rowIndex,
314
+ allVisibleMobileColumns: this.allVisibleMobileColumns,
315
+ areAllRowsSelected: this.areAllRowsSelected,
316
+ columnActionsBtnGroupMaxWidthStyle: this.columnActionsBtnGroupMaxWidthStyle,
317
+ columnActionsView: this.columnActionsView,
318
+ countVisibleMobileColumns: this.countVisibleMobileColumns,
319
+ disabledPreview: this.disabledPreviewRow,
320
+ disabledRowActions: this.disabledRowActions,
321
+ isFooter: this.isFooter,
322
+ isOneOfParentsClose: this.isOneOfParentsCloseForChildren,
323
+ isPreviewDownOpen: false,
324
+ isRowActionsStickyLocal: this.isRowActionsStickyLocal,
325
+ isTree: this.isTree,
326
+ keyChildren: this.keyChildren,
327
+ keyId: this.keyId,
328
+ level: this.levelForChildren,
329
+ row,
330
+ rowActionsClass: this.rowActionsClass,
331
+ rowClass: this.rowClass,
332
+ rowIndex,
333
+ rowsLength: this.children.length,
334
+ selectedRowsIndexes: this.selectedRowsIndexes,
335
+ }, {
336
+ get: vm => [
337
+ h(AGet, {
338
+ data: vm.row,
339
+ keyLabel: vm.column.keyLabel,
340
+ filter: vm.column.filter,
341
+ filterParameters: vm.column.filterParameters,
342
+ defaultValue: vm.column.defaultValue,
343
+ tag: vm.column.filterTag || "div",
344
+ }),
345
+ ],
346
+ ...this.$slots,
347
+ });
348
+ }) :
349
+ "",
350
+ ];
351
+ },
352
+ };