aloha-vue 2.74.0 → 2.75.1

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 (167) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +22 -21
  3. package/dist/aloha-vue.css +105 -105
  4. package/dist/aloha-vue.css.map +1 -1
  5. package/dist/aloha-vue.es.js +59267 -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/ADatepicker.js +6 -5
  100. package/src/ui/ADatepicker/compositionAPI/EventsAPI.js +297 -297
  101. package/src/ui/ADatepicker/utils/index.js +76 -76
  102. package/src/ui/ADatepickerAlt/ADatepicker.js +912 -912
  103. package/src/ui/ADatepickerAlt/utils/index.js +98 -98
  104. package/src/ui/AFieldset/__tests__/AFieldset.ClassColumn.test.js +113 -114
  105. package/src/ui/AFormElementBtnClear/AFormElementBtnClear.js +4 -1
  106. package/src/ui/AInputCurrency/AInputCurrency.js +20 -15
  107. package/src/ui/AInputCurrency/__tests__/AInputCurrency.ModelAPI.test.js +73 -73
  108. package/src/ui/AInputNumber/AInputNumber.js +17 -12
  109. package/src/ui/AJson/AJson.js +12 -3
  110. package/src/ui/AJson/compositionAPI/JsonAPI.js +116 -116
  111. package/src/ui/ALabel/__tests__/ALabel.IdAPI.test.js +42 -42
  112. package/src/ui/ALabel/__tests__/ALabel.LabelAPI.test.js +33 -33
  113. package/src/ui/ARadio/ARadio.js +80 -77
  114. package/src/ui/ASelect/ASelect.js +390 -383
  115. package/src/ui/ASelect/ASelectElement/ASelectElement.js +179 -176
  116. package/src/ui/ASelect/ASelectValueCloseable/ASelectValueCloseable.js +143 -141
  117. package/src/ui/ASelect/__tests__/SelectedFirstAPI.test.js +101 -101
  118. package/src/ui/ASelect/__tests__/SelectedVisibleAPI.test.js +98 -98
  119. package/src/ui/ASlider/compositionAPI/SliderAPI.js +23 -23
  120. package/src/ui/AValidatedJson/AValidatedJson.js +4 -1
  121. package/src/ui/AValidatedJson/AValidatedJsonItem/AValidatedJsonItem.js +308 -298
  122. package/src/ui/compositionApi/UiCollapseAPI.js +68 -63
  123. package/src/ui/compositionApi/UiInputAutofillAPI.js +41 -41
  124. package/src/ui/compositionApi/__tests__/UIDataGroupAPI.test.js +106 -106
  125. package/src/ui/compositionApi/__tests__/UIExcludeRenderAttributesAPI.test.js +39 -39
  126. package/src/ui/compositionApi/__tests__/UiDataWithKeyIdAndLabelAPI.test.js +128 -128
  127. package/src/ui/compositionApi/__tests__/UiSearchAPI.test.js +71 -71
  128. package/src/utils/EventBus.js +51 -8
  129. package/src/utils/__tests__/EventBus.test.js +138 -0
  130. package/src/utils/__tests__/utils.aOrderBy.test.js +1 -1
  131. package/src/utils/__tests__/utils.aSortBy.test.js +1 -1
  132. package/src/utils/__tests__/utils.getTotalNestedCount.test.js +56 -56
  133. package/src/utils/__tests__/utils.isArrayOfArrays.test.js +44 -44
  134. package/src/utils/__tests__/utils.isArrayOfStrings.test.js +36 -36
  135. package/src/utils/__tests__/utilsArray.aFirst.test.js +1 -1
  136. package/src/utils/__tests__/utilsArray.aLast.test.js +1 -1
  137. package/src/utils/__tests__/utilsLang.isArguments.test.js +1 -1
  138. package/src/utils/__tests__/utilsLang.isArray.test.js +1 -1
  139. package/src/utils/__tests__/utilsLang.isArrayBuffer.test.js +1 -1
  140. package/src/utils/__tests__/utilsLang.isBoolean.test.js +1 -1
  141. package/src/utils/__tests__/utilsLang.isBuffer.test.js +1 -1
  142. package/src/utils/__tests__/utilsLang.isDate.test.js +1 -1
  143. package/src/utils/__tests__/utilsLang.isElement.test.js +5 -3
  144. package/src/utils/__tests__/utilsLang.isError.test.js +1 -1
  145. package/src/utils/__tests__/utilsLang.isFinite.test.js +1 -1
  146. package/src/utils/__tests__/utilsLang.isFunction.test.js +1 -1
  147. package/src/utils/__tests__/utilsLang.isInteger.test.js +1 -1
  148. package/src/utils/__tests__/utilsLang.isMap.test.js +1 -1
  149. package/src/utils/__tests__/utilsLang.isNaN.test.js +1 -1
  150. package/src/utils/__tests__/utilsLang.isNil.test.js +1 -1
  151. package/src/utils/__tests__/utilsLang.isNull.test.js +1 -1
  152. package/src/utils/__tests__/utilsLang.isNumber.test.js +1 -1
  153. package/src/utils/__tests__/utilsLang.isObject.test.js +1 -1
  154. package/src/utils/__tests__/utilsLang.isObjectLike.test.js +5 -3
  155. package/src/utils/__tests__/utilsLang.isPlainObject.test.js +3 -2
  156. package/src/utils/__tests__/utilsLang.isPromise.test.js +5 -2
  157. package/src/utils/__tests__/utilsLang.isRegExp.test.js +1 -1
  158. package/src/utils/__tests__/utilsLang.isSet.test.js +1 -1
  159. package/src/utils/__tests__/utilsLang.isString.test.js +1 -1
  160. package/src/utils/__tests__/utilsLang.isSymbol.test.js +5 -3
  161. package/src/utils/__tests__/utilsLang.isUndefined.test.js +1 -1
  162. package/src/utils/__tests__/utilsLang.isWeakMap.test.js +1 -1
  163. package/src/utils/__tests__/utilsLang.isWeakSet.test.js +1 -1
  164. package/src/utils/__tests__/utilsMath.isEven.test.js +43 -43
  165. package/src/utils/__tests__/utilsMath.isOdd.test.js +43 -43
  166. package/src/utils/__tests__/utilsUi.isModelForFilterNotEmpty.test.js +65 -65
  167. package/src/utils/autosize.js +1 -1
@@ -1,298 +1,308 @@
1
- import {
2
- h,
3
- } from "vue";
4
- import {
5
- AElement,
6
- AFieldset,
7
- } from "../../../index";
8
-
9
- import AValidatedJsonModalCreateOrUpdate from "../AValidatedJsonModalCreateOrUpdate/AValidatedJsonModalCreateOrUpdate";
10
-
11
- import DeleteAPI from "./compositionAPI/DeleteAPI";
12
- import DetailsAPI from "./compositionAPI/DetailsAPI";
13
- import IdAPI from "./compositionAPI/IdAPI";
14
- import LabelAPI from "./compositionAPI/LabelAPI";
15
- import MoveAPI from "./compositionAPI/MoveAPI";
16
- import UpdateAPI from "./compositionAPI/UpdateAPI";
17
-
18
- import ChevronDown from "aloha-svg/dist/js/bootstrap/ChevronDown";
19
- import ChevronUp from "aloha-svg/dist/js/bootstrap/ChevronUp";
20
- import PencilFill from "aloha-svg/dist/js/bootstrap/PencilFill";
21
- import Trash from "aloha-svg/dist/js/bootstrap/Trash";
22
-
23
- // @vue/component
24
- export default {
25
- name: "AValidatedJsonItem",
26
- props: {
27
- children: {
28
- type: Array,
29
- required: true,
30
- },
31
- deactivateOrdering: {
32
- type: Boolean,
33
- required: false,
34
- },
35
- deactivatePreview: {
36
- type: Boolean,
37
- required: false,
38
- },
39
- elementLabel: {
40
- type: String,
41
- required: true,
42
- },
43
- elementTemplate: {
44
- type: String,
45
- required: false,
46
- default: "{{ elementLabel }}",
47
- },
48
- errors: {
49
- type: [Array, Object],
50
- required: false,
51
- default: undefined,
52
- },
53
- hidePosition: {
54
- type: Boolean,
55
- required: false,
56
- },
57
- isLast: {
58
- type: Boolean,
59
- required: false,
60
- },
61
- keyId: {
62
- type: String,
63
- required: false,
64
- default: undefined,
65
- },
66
- mode: {
67
- type: String,
68
- required: true,
69
- validator: value => ["list", "json"].includes(value),
70
- },
71
- modelAll: {
72
- type: Array,
73
- required: true,
74
- },
75
- modelIndex: {
76
- type: Number,
77
- required: true,
78
- },
79
- modelItem: {
80
- type: Object,
81
- required: true,
82
- },
83
- parentHtmlId: {
84
- type: String,
85
- required: true,
86
- },
87
- parentId: {
88
- type: String,
89
- required: true,
90
- },
91
- readonly: {
92
- type: Boolean,
93
- required: false,
94
- default: undefined,
95
- },
96
- typedBaseId: {
97
- type: String,
98
- required: false,
99
- default: undefined,
100
- },
101
- typedChildren: {
102
- type: Object,
103
- required: false,
104
- default: () => ({}),
105
- },
106
- uniqueChildrenIds: {
107
- type: Array,
108
- required: false,
109
- default: () => [],
110
- },
111
- useFlatModel: {
112
- type: Boolean,
113
- required: false,
114
- default: false,
115
- },
116
- },
117
- emits: [
118
- "delete",
119
- "move",
120
- "update",
121
- ],
122
- setup(props, context) {
123
- const {
124
- idLocal,
125
- } = IdAPI(props);
126
-
127
- const {
128
- label,
129
- } = LabelAPI(props);
130
-
131
- const {
132
- btnMoveDownId,
133
- btnMoveUpId,
134
- canMove,
135
- disabledMoveDown,
136
- disabledMoveUp,
137
- moveDown,
138
- moveUp,
139
- } = MoveAPI(props, context);
140
-
141
- const {
142
- btnDeleteId,
143
- openDeleteConfirm,
144
- } = DeleteAPI(props, context);
145
-
146
- const {
147
- btnOpenModalUpdateId,
148
- closeModalUpdate,
149
- isModalUpdateVisible,
150
- openModalUpdate,
151
- } = UpdateAPI(props, context);
152
-
153
- const {
154
- btnToggleDetailsId,
155
- detailsId,
156
- iconBtnToggleDetails,
157
- isDetailsVisible,
158
- titleBtnToggleDetails,
159
- toggleDetails,
160
- } = DetailsAPI(props);
161
-
162
- return {
163
- btnDeleteId,
164
- btnMoveDownId,
165
- btnMoveUpId,
166
- btnOpenModalUpdateId,
167
- btnToggleDetailsId,
168
- canMove,
169
- closeModalUpdate,
170
- detailsId,
171
- disabledMoveDown,
172
- disabledMoveUp,
173
- iconBtnToggleDetails,
174
- idLocal,
175
- isDetailsVisible,
176
- isModalUpdateVisible,
177
- label,
178
- moveDown,
179
- moveUp,
180
- openDeleteConfirm,
181
- openModalUpdate,
182
- titleBtnToggleDetails,
183
- toggleDetails,
184
- };
185
- },
186
- render() {
187
- return h("li", {
188
- id: this.idLocal,
189
- class: "a_list_group__item",
190
- }, [
191
- h("div", {
192
- class: "a_d_flex a_justify_content_between a_align_items_center",
193
- }, [
194
- !this.deactivatePreview ?
195
- h(AElement, {
196
- id: this.btnToggleDetailsId,
197
- class: "a_btn a_btn_secondary a_mr_4 test_toggle_details",
198
- iconLeft: this.iconBtnToggleDetails,
199
- title: this.titleBtnToggleDetails,
200
- textScreenReader: this.titleBtnToggleDetails,
201
- type: "button",
202
- onClick: this.toggleDetails,
203
- }) :
204
- "",
205
- h("strong", {
206
- class: [
207
- "a_validated_json_list__item__label",
208
- {
209
- a_validated_json_list__item__label_error: this.errors,
210
- },
211
- ],
212
- }, this.label),
213
- !this.readonly ?
214
- h("div", {
215
- class: "a_btn_group a_ml_4",
216
- role: "group",
217
- }, [
218
- this.canMove ?
219
- h(AElement, {
220
- id: this.btnMoveUpId,
221
- ariaDisabled: this.disabledMoveUp,
222
- class: "a_btn a_btn_secondary test_move_up",
223
- iconLeft: ChevronUp,
224
- title: "_A_VALIDATED_JSON_MOVE_UP_",
225
- textScreenReader: "_A_VALIDATED_JSON_MOVE_UP_",
226
- type: "button",
227
- onClick: this.moveUp,
228
- }) :
229
- "",
230
- this.canMove ?
231
- h(AElement, {
232
- id: this.btnMoveDownId,
233
- ariaDisabled: this.disabledMoveDown,
234
- class: "a_btn a_btn_secondary test_move_down",
235
- iconLeft: ChevronDown,
236
- title: "_A_VALIDATED_JSON_MOVE_DOWN_",
237
- textScreenReader: "_A_VALIDATED_JSON_MOVE_DOWN_",
238
- type: "button",
239
- onClick: this.moveDown,
240
- }) :
241
- "",
242
- h(AElement, {
243
- id: this.btnOpenModalUpdateId,
244
- class: "a_btn a_btn_secondary test_edit",
245
- iconLeft: PencilFill,
246
- title: "_A_VALIDATED_JSON_ELEMENT_UPDATE_",
247
- textScreenReader: "_A_VALIDATED_JSON_ELEMENT_UPDATE_",
248
- type: "button",
249
- onClick: this.openModalUpdate,
250
- }),
251
- h(AElement, {
252
- id: this.btnDeleteId,
253
- class: "a_btn a_btn_danger test_remove",
254
- iconLeft: Trash,
255
- title: "_A_VALIDATED_JSON_ELEMENT_REMOVE_",
256
- textScreenReader: "_A_VALIDATED_JSON_ELEMENT_REMOVE_",
257
- type: "button",
258
- onClick: this.openDeleteConfirm,
259
- }),
260
- ]) :
261
- "",
262
- ]),
263
- this.isDetailsVisible ?
264
- h("div", {
265
- class: "a_ml_6 a_mt_2 a_px_4",
266
- }, [
267
- h(AFieldset, {
268
- children: this.children,
269
- idPrefix: this.parentHtmlId,
270
- modelValue: this.modelItem,
271
- readonly: true,
272
- skipOwnIdInModelPath: true,
273
- slotNamePrepend: "singlePrepend",
274
- useFlatModel: this.useFlatModel,
275
- }, this.$slots),
276
- ]) :
277
- "",
278
- this.isModalUpdateVisible ?
279
- h(AValidatedJsonModalCreateOrUpdate, {
280
- children: this.children,
281
- close: this.closeModalUpdate,
282
- currentIndex: this.modelIndex,
283
- currentModel: this.modelItem,
284
- elementLabelTranslated: this.elementLabel,
285
- errors: this.errors,
286
- isCreate: false,
287
- keyId: this.keyId,
288
- mode: this.mode,
289
- modelAll: this.modelAll,
290
- selectorCloseIds: this.btnOpenModalUpdateId,
291
- typedBaseId: this.typedBaseId,
292
- typedChildren: this.typedChildren,
293
- uniqueChildrenIds: this.uniqueChildrenIds,
294
- }) :
295
- "",
296
- ]);
297
- },
298
- };
1
+ import {
2
+ h,
3
+ } from "vue";
4
+ import {
5
+ AElement,
6
+ AFieldset,
7
+ } from "../../../index";
8
+
9
+ import AValidatedJsonModalCreateOrUpdate from "../AValidatedJsonModalCreateOrUpdate/AValidatedJsonModalCreateOrUpdate";
10
+
11
+ import DeleteAPI from "./compositionAPI/DeleteAPI";
12
+ import DetailsAPI from "./compositionAPI/DetailsAPI";
13
+ import IdAPI from "./compositionAPI/IdAPI";
14
+ import LabelAPI from "./compositionAPI/LabelAPI";
15
+ import MoveAPI from "./compositionAPI/MoveAPI";
16
+ import UpdateAPI from "./compositionAPI/UpdateAPI";
17
+
18
+ const ChevronDown = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
19
+ <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"/>
20
+ </svg>`;
21
+ const ChevronUp = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-up" viewBox="0 0 16 16">
22
+ <path fill-rule="evenodd" d="M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708z"/>
23
+ </svg>`;
24
+ const PencilFill = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-fill" viewBox="0 0 16 16">
25
+ <path d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.5.5 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11z"/>
26
+ </svg>`;
27
+ const Trash = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
28
+ <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/>
29
+ <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/>
30
+ </svg>`;
31
+
32
+
33
+ // @vue/component
34
+ export default {
35
+ name: "AValidatedJsonItem",
36
+ props: {
37
+ children: {
38
+ type: Array,
39
+ required: true,
40
+ },
41
+ deactivateOrdering: {
42
+ type: Boolean,
43
+ required: false,
44
+ },
45
+ deactivatePreview: {
46
+ type: Boolean,
47
+ required: false,
48
+ },
49
+ elementLabel: {
50
+ type: String,
51
+ required: true,
52
+ },
53
+ elementTemplate: {
54
+ type: String,
55
+ required: false,
56
+ default: "{{ elementLabel }}",
57
+ },
58
+ errors: {
59
+ type: [Array, Object],
60
+ required: false,
61
+ default: undefined,
62
+ },
63
+ hidePosition: {
64
+ type: Boolean,
65
+ required: false,
66
+ },
67
+ isLast: {
68
+ type: Boolean,
69
+ required: false,
70
+ },
71
+ keyId: {
72
+ type: String,
73
+ required: false,
74
+ default: undefined,
75
+ },
76
+ mode: {
77
+ type: String,
78
+ required: true,
79
+ validator: value => ["list", "json"].includes(value),
80
+ },
81
+ modelAll: {
82
+ type: Array,
83
+ required: true,
84
+ },
85
+ modelIndex: {
86
+ type: Number,
87
+ required: true,
88
+ },
89
+ modelItem: {
90
+ type: Object,
91
+ required: true,
92
+ },
93
+ parentHtmlId: {
94
+ type: String,
95
+ required: true,
96
+ },
97
+ parentId: {
98
+ type: String,
99
+ required: true,
100
+ },
101
+ readonly: {
102
+ type: Boolean,
103
+ required: false,
104
+ default: undefined,
105
+ },
106
+ typedBaseId: {
107
+ type: String,
108
+ required: false,
109
+ default: undefined,
110
+ },
111
+ typedChildren: {
112
+ type: Object,
113
+ required: false,
114
+ default: () => ({}),
115
+ },
116
+ uniqueChildrenIds: {
117
+ type: Array,
118
+ required: false,
119
+ default: () => [],
120
+ },
121
+ useFlatModel: {
122
+ type: Boolean,
123
+ required: false,
124
+ default: false,
125
+ },
126
+ },
127
+ emits: [
128
+ "delete",
129
+ "move",
130
+ "update",
131
+ ],
132
+ setup(props, context) {
133
+ const {
134
+ idLocal,
135
+ } = IdAPI(props);
136
+
137
+ const {
138
+ label,
139
+ } = LabelAPI(props);
140
+
141
+ const {
142
+ btnMoveDownId,
143
+ btnMoveUpId,
144
+ canMove,
145
+ disabledMoveDown,
146
+ disabledMoveUp,
147
+ moveDown,
148
+ moveUp,
149
+ } = MoveAPI(props, context);
150
+
151
+ const {
152
+ btnDeleteId,
153
+ openDeleteConfirm,
154
+ } = DeleteAPI(props, context);
155
+
156
+ const {
157
+ btnOpenModalUpdateId,
158
+ closeModalUpdate,
159
+ isModalUpdateVisible,
160
+ openModalUpdate,
161
+ } = UpdateAPI(props, context);
162
+
163
+ const {
164
+ btnToggleDetailsId,
165
+ detailsId,
166
+ iconBtnToggleDetails,
167
+ isDetailsVisible,
168
+ titleBtnToggleDetails,
169
+ toggleDetails,
170
+ } = DetailsAPI(props);
171
+
172
+ return {
173
+ btnDeleteId,
174
+ btnMoveDownId,
175
+ btnMoveUpId,
176
+ btnOpenModalUpdateId,
177
+ btnToggleDetailsId,
178
+ canMove,
179
+ closeModalUpdate,
180
+ detailsId,
181
+ disabledMoveDown,
182
+ disabledMoveUp,
183
+ iconBtnToggleDetails,
184
+ idLocal,
185
+ isDetailsVisible,
186
+ isModalUpdateVisible,
187
+ label,
188
+ moveDown,
189
+ moveUp,
190
+ openDeleteConfirm,
191
+ openModalUpdate,
192
+ titleBtnToggleDetails,
193
+ toggleDetails,
194
+ };
195
+ },
196
+ render() {
197
+ return h("li", {
198
+ id: this.idLocal,
199
+ class: "a_list_group__item",
200
+ }, [
201
+ h("div", {
202
+ class: "a_d_flex a_justify_content_between a_align_items_center",
203
+ }, [
204
+ !this.deactivatePreview ?
205
+ h(AElement, {
206
+ id: this.btnToggleDetailsId,
207
+ class: "a_btn a_btn_secondary a_mr_4 test_toggle_details",
208
+ iconLeft: this.iconBtnToggleDetails,
209
+ title: this.titleBtnToggleDetails,
210
+ textScreenReader: this.titleBtnToggleDetails,
211
+ type: "button",
212
+ onClick: this.toggleDetails,
213
+ }) :
214
+ "",
215
+ h("strong", {
216
+ class: [
217
+ "a_validated_json_list__item__label",
218
+ {
219
+ a_validated_json_list__item__label_error: this.errors,
220
+ },
221
+ ],
222
+ }, this.label),
223
+ !this.readonly ?
224
+ h("div", {
225
+ class: "a_btn_group a_ml_4",
226
+ role: "group",
227
+ }, [
228
+ this.canMove ?
229
+ h(AElement, {
230
+ id: this.btnMoveUpId,
231
+ ariaDisabled: this.disabledMoveUp,
232
+ class: "a_btn a_btn_secondary test_move_up",
233
+ iconLeft: ChevronUp,
234
+ title: "_A_VALIDATED_JSON_MOVE_UP_",
235
+ textScreenReader: "_A_VALIDATED_JSON_MOVE_UP_",
236
+ type: "button",
237
+ onClick: this.moveUp,
238
+ }) :
239
+ "",
240
+ this.canMove ?
241
+ h(AElement, {
242
+ id: this.btnMoveDownId,
243
+ ariaDisabled: this.disabledMoveDown,
244
+ class: "a_btn a_btn_secondary test_move_down",
245
+ iconLeft: ChevronDown,
246
+ title: "_A_VALIDATED_JSON_MOVE_DOWN_",
247
+ textScreenReader: "_A_VALIDATED_JSON_MOVE_DOWN_",
248
+ type: "button",
249
+ onClick: this.moveDown,
250
+ }) :
251
+ "",
252
+ h(AElement, {
253
+ id: this.btnOpenModalUpdateId,
254
+ class: "a_btn a_btn_secondary test_edit",
255
+ iconLeft: PencilFill,
256
+ title: "_A_VALIDATED_JSON_ELEMENT_UPDATE_",
257
+ textScreenReader: "_A_VALIDATED_JSON_ELEMENT_UPDATE_",
258
+ type: "button",
259
+ onClick: this.openModalUpdate,
260
+ }),
261
+ h(AElement, {
262
+ id: this.btnDeleteId,
263
+ class: "a_btn a_btn_danger test_remove",
264
+ iconLeft: Trash,
265
+ title: "_A_VALIDATED_JSON_ELEMENT_REMOVE_",
266
+ textScreenReader: "_A_VALIDATED_JSON_ELEMENT_REMOVE_",
267
+ type: "button",
268
+ onClick: this.openDeleteConfirm,
269
+ }),
270
+ ]) :
271
+ "",
272
+ ]),
273
+ this.isDetailsVisible ?
274
+ h("div", {
275
+ class: "a_ml_6 a_mt_2 a_px_4",
276
+ }, [
277
+ h(AFieldset, {
278
+ children: this.children,
279
+ idPrefix: this.parentHtmlId,
280
+ modelValue: this.modelItem,
281
+ readonly: true,
282
+ skipOwnIdInModelPath: true,
283
+ slotNamePrepend: "singlePrepend",
284
+ useFlatModel: this.useFlatModel,
285
+ }, this.$slots),
286
+ ]) :
287
+ "",
288
+ this.isModalUpdateVisible ?
289
+ h(AValidatedJsonModalCreateOrUpdate, {
290
+ children: this.children,
291
+ close: this.closeModalUpdate,
292
+ currentIndex: this.modelIndex,
293
+ currentModel: this.modelItem,
294
+ elementLabelTranslated: this.elementLabel,
295
+ errors: this.errors,
296
+ isCreate: false,
297
+ keyId: this.keyId,
298
+ mode: this.mode,
299
+ modelAll: this.modelAll,
300
+ selectorCloseIds: this.btnOpenModalUpdateId,
301
+ typedBaseId: this.typedBaseId,
302
+ typedChildren: this.typedChildren,
303
+ uniqueChildrenIds: this.uniqueChildrenIds,
304
+ }) :
305
+ "",
306
+ ]);
307
+ },
308
+ };