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,258 +1,265 @@
1
- import {
2
- h,
3
- onBeforeUnmount,
4
- onMounted,
5
- toRef,
6
- } from "vue";
7
-
8
- import AButton from "../../AButton/AButton";
9
- import ACloak from "../../ACloak/ACloak";
10
- import AModal from "../../AModal/AModal";
11
- import AResizer from "../../AResizer/AResizer";
12
- import ATranslation from "../../ATranslation/ATranslation";
13
-
14
- import ArrowsAPI from "./compositionAPI/ArrowsAPI";
15
- import IdAPI from "./compositionAPI/IdAPI";
16
- import MouseEventsAPI from "./compositionAPI/MouseEventsAPI";
17
- import PreviewRightRewAPI from "../compositionAPI/PreviewRightRewAPI";
18
- import RowAPI from "./compositionAPI/RowAPI";
19
-
20
- import ArrowLeft from "aloha-svg/dist/js/bootstrap/ArrowLeft";
21
- import ArrowRight from "aloha-svg/dist/js/bootstrap/ArrowRight";
22
- import XLg from "aloha-svg/dist/js/bootstrap/XLg";
23
-
24
- export default {
25
- name: "ATablePreviewRight",
26
- props: {
27
- countAllRows: {
28
- type: Number,
29
- required: true,
30
- },
31
- disabledPreviewRowCallback: {
32
- type: Function,
33
- required: false,
34
- default: () => {},
35
- },
36
- isLoadingTable: {
37
- type: Boolean,
38
- required: false,
39
- },
40
- isMobile: {
41
- type: Boolean,
42
- required: false,
43
- },
44
- limitPagination: {
45
- type: Number,
46
- required: false,
47
- default: undefined,
48
- },
49
- offsetPagination: {
50
- type: Number,
51
- required: false,
52
- default: undefined,
53
- },
54
- previewStyles: {
55
- type: [String, Object],
56
- required: false,
57
- default: undefined,
58
- },
59
- rowIndex: {
60
- type: Number,
61
- required: true,
62
- },
63
- rows: {
64
- type: Array,
65
- required: true,
66
- },
67
- usePagination: {
68
- type: Boolean,
69
- required: false,
70
- },
71
- },
72
- emits: [
73
- "closePreview",
74
- "mousedownResizePreviewRight",
75
- "mousemoveResizePreviewRight",
76
- "mouseupResizePreviewRight",
77
- "togglePreviewResize",
78
- "togglePreview",
79
- "update:offset",
80
- ],
81
- inject: [
82
- "isLoadingOptions",
83
- ],
84
- setup(props, context) {
85
- const isMobile = toRef(props, "isMobile");
86
-
87
- const {
88
- previewRef,
89
- } = PreviewRightRewAPI();
90
-
91
- const {
92
- idLocal,
93
- } = IdAPI();
94
-
95
- const {
96
- mousedown,
97
- mousemove,
98
- mouseup,
99
- } = MouseEventsAPI(context, {
100
- previewRef,
101
- });
102
-
103
- const {
104
- countAllRowsFormatted,
105
- currentRow,
106
- nextAvailableRowIndex,
107
- previousAvailableRowIndex,
108
- rowNumber,
109
- rowNumberFormatted,
110
- } = RowAPI(props);
111
-
112
- const {
113
- disabledBtnArrowLeft,
114
- disabledBtnArrowRight,
115
- toNextRow,
116
- toPreviousRow,
117
- } = ArrowsAPI(props, context, {
118
- nextAvailableRowIndex,
119
- previousAvailableRowIndex,
120
- rowNumber,
121
- });
122
-
123
- onMounted(() => {
124
- if (!isMobile.value) {
125
- context.emit("togglePreviewResize", {
126
- isOpen: true,
127
- previewRef: previewRef.value,
128
- });
129
- }
130
- });
131
-
132
- onBeforeUnmount(() => {
133
- if (!isMobile.value) {
134
- context.emit("togglePreviewResize", {
135
- isOpen: false,
136
- previewRef: previewRef.value,
137
- });
138
- }
139
- });
140
-
141
- return {
142
- countAllRowsFormatted,
143
- currentRow,
144
- disabledBtnArrowLeft,
145
- disabledBtnArrowRight,
146
- idLocal,
147
- mousedown,
148
- mousemove,
149
- mouseup,
150
- previewRef,
151
- rowNumber,
152
- rowNumberFormatted,
153
- toNextRow,
154
- toPreviousRow,
155
- };
156
- },
157
- render() {
158
- const HEADER = [
159
- this.isLoadingTable ?
160
- h(ACloak) :
161
- h("div", {}, [
162
- h(ATranslation, {
163
- class: "a_table__preview_right__header__text",
164
- tag: "span",
165
- text: "_A_TABLE_PREVIEW_RIGHT_HEADER_{{rowNumber}}_{{rowNumberFormatted}}_{{countAllRows}}_{{countAllRowsFormatted}}_",
166
- extra: {
167
- rowNumber: this.rowNumber,
168
- rowNumberFormatted: this.rowNumberFormatted,
169
- countAllRows: this.countAllRows,
170
- countAllRowsFormatted: this.countAllRowsFormatted,
171
- },
172
- }),
173
- h("div", {
174
- class: "a_table__preview_right__header__icons",
175
- }, [
176
- h(AButton, {
177
- class: "a_btn a_btn_transparent_dark a_btn_small",
178
- disabled: this.disabledBtnArrowLeft,
179
- iconLeft: ArrowLeft,
180
- title: "_A_TABLE_PREVIEW_RIGHT_PREVIOUS_ROW_",
181
- textScreenReader: "_A_TABLE_PREVIEW_RIGHT_PREVIOUS_ROW_",
182
- onClick: this.toPreviousRow,
183
- }),
184
- h(AButton, {
185
- class: "a_btn a_btn_transparent_dark a_btn_small",
186
- disabled: this.disabledBtnArrowRight,
187
- iconLeft: ArrowRight,
188
- title: "_A_TABLE_PREVIEW_RIGHT_NEXT_ROW_",
189
- textScreenReader: "_A_TABLE_PREVIEW_RIGHT_NEXT_ROW_",
190
- onClick: this.toNextRow,
191
- }),
192
- ]),
193
- ]),
194
- !this.isMobile
195
- ? h(AButton, {
196
- class: "a_btn a_btn_transparent_dark a_table__preview_right__btn_close",
197
- iconLeft: XLg,
198
- iconClass: "a_table__preview_right__btn_close__icon",
199
- title: "_A_TABLE_PREVIEW_RIGHT_CLOSE_",
200
- textScreenReader: "_A_TABLE_PREVIEW_RIGHT_CLOSE_",
201
- onClick: () => this.$emit("closePreview"),
202
- })
203
- : "",
204
- ];
205
-
206
- const BODY = [
207
- this.isLoadingTable
208
- ? h(ACloak) :
209
- this.$slots.preview ?
210
- this.$slots.preview({
211
- row: this.currentRow,
212
- rowIndex: this.rowIndex,
213
- }) :
214
- h(ATranslation, {
215
- text: "_A_TABLE_PREVIEW_RIGHT_HAS_NOT_SLOT_",
216
- }),
217
- ];
218
-
219
- if (this.isMobile) {
220
- return h(AModal, {
221
- hideFooter: true,
222
- close: () => this.$emit("closePreview"),
223
- size: "xxl",
224
- }, {
225
- modalHeader: () => HEADER,
226
- modalBody: () => BODY,
227
- });
228
- }
229
-
230
- return h("div", {
231
- ref: "previewRef",
232
- id: this.idLocal,
233
- class: "a_table__preview_right",
234
- style: this.previewStyles,
235
- tabindex: -1,
236
- }, [
237
- h(AResizer, {
238
- class: "a_table__preview_right__resizer",
239
- direction: "x",
240
- disabled: this.isLoadingOptions,
241
- onMousedown: this.mousedown,
242
- onMousemove: this.mousemove,
243
- onMouseup: this.mouseup,
244
- onMouseoutDocument: this.mouseup,
245
- }),
246
- h(ATranslation, {
247
- class: "a_sr_only",
248
- text: "_A_TABLE_PREVIEW_RIGHT_ARIA_LABEL_",
249
- }),
250
- h("div", {
251
- class: "a_table__preview_right__header",
252
- }, HEADER),
253
- h("div", {
254
- class: "a_table__preview_right__body",
255
- }, BODY),
256
- ]);
257
- },
258
- };
1
+ import {
2
+ h,
3
+ onBeforeUnmount,
4
+ onMounted,
5
+ toRef,
6
+ } from "vue";
7
+
8
+ import AButton from "../../AButton/AButton";
9
+ import ACloak from "../../ACloak/ACloak";
10
+ import AModal from "../../AModal/AModal";
11
+ import AResizer from "../../AResizer/AResizer";
12
+ import ATranslation from "../../ATranslation/ATranslation";
13
+
14
+ import ArrowsAPI from "./compositionAPI/ArrowsAPI";
15
+ import IdAPI from "./compositionAPI/IdAPI";
16
+ import MouseEventsAPI from "./compositionAPI/MouseEventsAPI";
17
+ import PreviewRightRewAPI from "../compositionAPI/PreviewRightRewAPI";
18
+ import RowAPI from "./compositionAPI/RowAPI";
19
+
20
+ const ArrowLeft = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
21
+ <path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"/>
22
+ </svg>`;
23
+ const ArrowRight = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
24
+ <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/>
25
+ </svg>`;
26
+ 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">
27
+ <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"/>
28
+ </svg>`;
29
+
30
+
31
+ export default {
32
+ name: "ATablePreviewRight",
33
+ props: {
34
+ countAllRows: {
35
+ type: Number,
36
+ required: true,
37
+ },
38
+ disabledPreviewRowCallback: {
39
+ type: Function,
40
+ required: false,
41
+ default: () => {},
42
+ },
43
+ isLoadingTable: {
44
+ type: Boolean,
45
+ required: false,
46
+ },
47
+ isMobile: {
48
+ type: Boolean,
49
+ required: false,
50
+ },
51
+ limitPagination: {
52
+ type: Number,
53
+ required: false,
54
+ default: undefined,
55
+ },
56
+ offsetPagination: {
57
+ type: Number,
58
+ required: false,
59
+ default: undefined,
60
+ },
61
+ previewStyles: {
62
+ type: [String, Object],
63
+ required: false,
64
+ default: undefined,
65
+ },
66
+ rowIndex: {
67
+ type: Number,
68
+ required: true,
69
+ },
70
+ rows: {
71
+ type: Array,
72
+ required: true,
73
+ },
74
+ usePagination: {
75
+ type: Boolean,
76
+ required: false,
77
+ },
78
+ },
79
+ emits: [
80
+ "closePreview",
81
+ "mousedownResizePreviewRight",
82
+ "mousemoveResizePreviewRight",
83
+ "mouseupResizePreviewRight",
84
+ "togglePreviewResize",
85
+ "togglePreview",
86
+ "update:offset",
87
+ ],
88
+ inject: [
89
+ "isLoadingOptions",
90
+ ],
91
+ setup(props, context) {
92
+ const isMobile = toRef(props, "isMobile");
93
+
94
+ const {
95
+ previewRef,
96
+ } = PreviewRightRewAPI();
97
+
98
+ const {
99
+ idLocal,
100
+ } = IdAPI();
101
+
102
+ const {
103
+ mousedown,
104
+ mousemove,
105
+ mouseup,
106
+ } = MouseEventsAPI(context, {
107
+ previewRef,
108
+ });
109
+
110
+ const {
111
+ countAllRowsFormatted,
112
+ currentRow,
113
+ nextAvailableRowIndex,
114
+ previousAvailableRowIndex,
115
+ rowNumber,
116
+ rowNumberFormatted,
117
+ } = RowAPI(props);
118
+
119
+ const {
120
+ disabledBtnArrowLeft,
121
+ disabledBtnArrowRight,
122
+ toNextRow,
123
+ toPreviousRow,
124
+ } = ArrowsAPI(props, context, {
125
+ nextAvailableRowIndex,
126
+ previousAvailableRowIndex,
127
+ rowNumber,
128
+ });
129
+
130
+ onMounted(() => {
131
+ if (!isMobile.value) {
132
+ context.emit("togglePreviewResize", {
133
+ isOpen: true,
134
+ previewRef: previewRef.value,
135
+ });
136
+ }
137
+ });
138
+
139
+ onBeforeUnmount(() => {
140
+ if (!isMobile.value) {
141
+ context.emit("togglePreviewResize", {
142
+ isOpen: false,
143
+ previewRef: previewRef.value,
144
+ });
145
+ }
146
+ });
147
+
148
+ return {
149
+ countAllRowsFormatted,
150
+ currentRow,
151
+ disabledBtnArrowLeft,
152
+ disabledBtnArrowRight,
153
+ idLocal,
154
+ mousedown,
155
+ mousemove,
156
+ mouseup,
157
+ previewRef,
158
+ rowNumber,
159
+ rowNumberFormatted,
160
+ toNextRow,
161
+ toPreviousRow,
162
+ };
163
+ },
164
+ render() {
165
+ const HEADER = [
166
+ this.isLoadingTable ?
167
+ h(ACloak) :
168
+ h("div", {}, [
169
+ h(ATranslation, {
170
+ class: "a_table__preview_right__header__text",
171
+ tag: "span",
172
+ text: "_A_TABLE_PREVIEW_RIGHT_HEADER_{{rowNumber}}_{{rowNumberFormatted}}_{{countAllRows}}_{{countAllRowsFormatted}}_",
173
+ extra: {
174
+ rowNumber: this.rowNumber,
175
+ rowNumberFormatted: this.rowNumberFormatted,
176
+ countAllRows: this.countAllRows,
177
+ countAllRowsFormatted: this.countAllRowsFormatted,
178
+ },
179
+ }),
180
+ h("div", {
181
+ class: "a_table__preview_right__header__icons",
182
+ }, [
183
+ h(AButton, {
184
+ class: "a_btn a_btn_transparent_dark a_btn_small",
185
+ disabled: this.disabledBtnArrowLeft,
186
+ iconLeft: ArrowLeft,
187
+ title: "_A_TABLE_PREVIEW_RIGHT_PREVIOUS_ROW_",
188
+ textScreenReader: "_A_TABLE_PREVIEW_RIGHT_PREVIOUS_ROW_",
189
+ onClick: this.toPreviousRow,
190
+ }),
191
+ h(AButton, {
192
+ class: "a_btn a_btn_transparent_dark a_btn_small",
193
+ disabled: this.disabledBtnArrowRight,
194
+ iconLeft: ArrowRight,
195
+ title: "_A_TABLE_PREVIEW_RIGHT_NEXT_ROW_",
196
+ textScreenReader: "_A_TABLE_PREVIEW_RIGHT_NEXT_ROW_",
197
+ onClick: this.toNextRow,
198
+ }),
199
+ ]),
200
+ ]),
201
+ !this.isMobile
202
+ ? h(AButton, {
203
+ class: "a_btn a_btn_transparent_dark a_table__preview_right__btn_close",
204
+ iconLeft: XLg,
205
+ iconClass: "a_table__preview_right__btn_close__icon",
206
+ title: "_A_TABLE_PREVIEW_RIGHT_CLOSE_",
207
+ textScreenReader: "_A_TABLE_PREVIEW_RIGHT_CLOSE_",
208
+ onClick: () => this.$emit("closePreview"),
209
+ })
210
+ : "",
211
+ ];
212
+
213
+ const BODY = [
214
+ this.isLoadingTable
215
+ ? h(ACloak) :
216
+ this.$slots.preview ?
217
+ this.$slots.preview({
218
+ row: this.currentRow,
219
+ rowIndex: this.rowIndex,
220
+ }) :
221
+ h(ATranslation, {
222
+ text: "_A_TABLE_PREVIEW_RIGHT_HAS_NOT_SLOT_",
223
+ }),
224
+ ];
225
+
226
+ if (this.isMobile) {
227
+ return h(AModal, {
228
+ hideFooter: true,
229
+ close: () => this.$emit("closePreview"),
230
+ size: "xxl",
231
+ }, {
232
+ modalHeader: () => HEADER,
233
+ modalBody: () => BODY,
234
+ });
235
+ }
236
+
237
+ return h("div", {
238
+ ref: "previewRef",
239
+ id: this.idLocal,
240
+ class: "a_table__preview_right",
241
+ style: this.previewStyles,
242
+ tabindex: -1,
243
+ }, [
244
+ h(AResizer, {
245
+ class: "a_table__preview_right__resizer",
246
+ direction: "x",
247
+ disabled: this.isLoadingOptions,
248
+ onMousedown: this.mousedown,
249
+ onMousemove: this.mousemove,
250
+ onMouseup: this.mouseup,
251
+ onMouseoutDocument: this.mouseup,
252
+ }),
253
+ h(ATranslation, {
254
+ class: "a_sr_only",
255
+ text: "_A_TABLE_PREVIEW_RIGHT_ARIA_LABEL_",
256
+ }),
257
+ h("div", {
258
+ class: "a_table__preview_right__header",
259
+ }, HEADER),
260
+ h("div", {
261
+ class: "a_table__preview_right__body",
262
+ }, BODY),
263
+ ]);
264
+ },
265
+ };