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,99 +1,102 @@
1
- import {
2
- h,
3
- } from "vue";
4
- import {
5
- AButton,
6
- } from "../../../index";
7
-
8
- import AFiltersHorizontalFilterUi from "../AFiltersHorizontalFilterUi/AFiltersHorizontalFilterUi";
9
-
10
- import IdAPI from "./compositionAPI/IdAPI";
11
- import IsFilterAPI from "./compositionAPI/IsFilterAPI";
12
- import LabelAPI from "./compositionAPI/LabelAPI";
13
-
14
- import XLg from "aloha-svg/dist/js/bootstrap/XLg";
15
-
16
- export default {
17
- name: "AFiltersHorizontalFilter",
18
- props: {
19
- closable: {
20
- type: Boolean,
21
- required: false,
22
- },
23
- filter: {
24
- type: Object,
25
- required: false,
26
- default: undefined,
27
- },
28
- id: {
29
- type: String,
30
- required: true,
31
- },
32
- isFilterMain: {
33
- type: Boolean,
34
- required: false,
35
- },
36
- onUpdateModelFilters: {
37
- type: Function,
38
- required: true,
39
- },
40
- unappliedModel: {
41
- type: Object,
42
- required: true,
43
- },
44
- updateDataKeyByIdFromFilter: {
45
- type: Function,
46
- required: true,
47
- },
48
- },
49
- emits: [
50
- "deleteFiltersVisible",
51
- ],
52
- setup(props) {
53
- const {
54
- isFilter,
55
- } = IsFilterAPI(props);
56
-
57
- const {
58
- isLabelInComponentVisible,
59
- labelClass,
60
- } = LabelAPI(props);
61
-
62
- const {
63
- htmlIdLocal,
64
- } = IdAPI(props);
65
-
66
- return {
67
- htmlIdLocal,
68
- isLabelInComponentVisible,
69
- isFilter,
70
- labelClass,
71
- };
72
- },
73
- render() {
74
- return this.isFilter && h("div", {
75
- class: "a_filters_top__filter_ui_group",
76
- }, [
77
- h("div", {
78
- class: "a_filters_top__filter_ui_subgroup",
79
- }, [
80
- h(AFiltersHorizontalFilterUi, {
81
- class: "a_filters_top__filter_ui",
82
- filter: this.filter,
83
- isLabelVisible: true,
84
- unappliedModel: this.unappliedModel,
85
- updateDataKeyByIdFromFilter: this.updateDataKeyByIdFromFilter,
86
- onUpdateModelFilters: this.onUpdateModelFilters,
87
- id: this.id,
88
- }, this.$slots),
89
- this.isFilterMain && this.$slots.btnSearchStart(),
90
- this.closable && h(AButton, {
91
- class: "a_btn a_btn_transparent_secondary a_filters_top__filter_ui_delete",
92
- title: "_A_FILTERS_TOP_CLOSE_",
93
- iconLeft: XLg,
94
- onClick: () => this.$emit("deleteFiltersVisible", { filter: this.filter }),
95
- }),
96
- ]),
97
- ]);
98
- },
99
- };
1
+ import {
2
+ h,
3
+ } from "vue";
4
+ import {
5
+ AButton,
6
+ } from "../../../index";
7
+
8
+ import AFiltersHorizontalFilterUi from "../AFiltersHorizontalFilterUi/AFiltersHorizontalFilterUi";
9
+
10
+ import IdAPI from "./compositionAPI/IdAPI";
11
+ import IsFilterAPI from "./compositionAPI/IsFilterAPI";
12
+ import LabelAPI from "./compositionAPI/LabelAPI";
13
+
14
+ 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">
15
+ <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"/>
16
+ </svg>`;
17
+
18
+
19
+ export default {
20
+ name: "AFiltersHorizontalFilter",
21
+ props: {
22
+ closable: {
23
+ type: Boolean,
24
+ required: false,
25
+ },
26
+ filter: {
27
+ type: Object,
28
+ required: false,
29
+ default: undefined,
30
+ },
31
+ id: {
32
+ type: String,
33
+ required: true,
34
+ },
35
+ isFilterMain: {
36
+ type: Boolean,
37
+ required: false,
38
+ },
39
+ onUpdateModelFilters: {
40
+ type: Function,
41
+ required: true,
42
+ },
43
+ unappliedModel: {
44
+ type: Object,
45
+ required: true,
46
+ },
47
+ updateDataKeyByIdFromFilter: {
48
+ type: Function,
49
+ required: true,
50
+ },
51
+ },
52
+ emits: [
53
+ "deleteFiltersVisible",
54
+ ],
55
+ setup(props) {
56
+ const {
57
+ isFilter,
58
+ } = IsFilterAPI(props);
59
+
60
+ const {
61
+ isLabelInComponentVisible,
62
+ labelClass,
63
+ } = LabelAPI(props);
64
+
65
+ const {
66
+ htmlIdLocal,
67
+ } = IdAPI(props);
68
+
69
+ return {
70
+ htmlIdLocal,
71
+ isLabelInComponentVisible,
72
+ isFilter,
73
+ labelClass,
74
+ };
75
+ },
76
+ render() {
77
+ return this.isFilter && h("div", {
78
+ class: "a_filters_top__filter_ui_group",
79
+ }, [
80
+ h("div", {
81
+ class: "a_filters_top__filter_ui_subgroup",
82
+ }, [
83
+ h(AFiltersHorizontalFilterUi, {
84
+ class: "a_filters_top__filter_ui",
85
+ filter: this.filter,
86
+ isLabelVisible: true,
87
+ unappliedModel: this.unappliedModel,
88
+ updateDataKeyByIdFromFilter: this.updateDataKeyByIdFromFilter,
89
+ onUpdateModelFilters: this.onUpdateModelFilters,
90
+ id: this.id,
91
+ }, this.$slots),
92
+ this.isFilterMain && this.$slots.btnSearchStart(),
93
+ this.closable && h(AButton, {
94
+ class: "a_btn a_btn_transparent_secondary a_filters_top__filter_ui_delete",
95
+ title: "_A_FILTERS_TOP_CLOSE_",
96
+ iconLeft: XLg,
97
+ onClick: () => this.$emit("deleteFiltersVisible", { filter: this.filter }),
98
+ }),
99
+ ]),
100
+ ]);
101
+ },
102
+ };
@@ -1,108 +1,108 @@
1
- import {
2
- computed,
3
- ref,
4
- toRef,
5
- } from "vue";
6
-
7
- import AConfirmAPI from "../../../compositionAPI/AConfirmAPI";
8
- import ANotificationAPI from "../../../compositionAPI/ANotificationAPI";
9
-
10
- export default function FiltersSavedDeleteAPI(props, {
11
- changeModelFiltersSaved = () => {},
12
- idFilterTop = computed(() => ""),
13
- isModelFilterSavedNew = computed(() => false),
14
- modelFiltersSaved = ref(undefined),
15
- }) {
16
- const id = toRef(props, "id");
17
- const updateFiltersSaved = toRef(props, "updateFiltersSaved");
18
-
19
- const {
20
- changeConfirmOptions,
21
- closeConfirm,
22
- isModalHidden: isConfirmHidden,
23
- openConfirm,
24
- } = AConfirmAPI();
25
-
26
- const {
27
- addNotification,
28
- } = ANotificationAPI();
29
-
30
- const buttonDeleteId = computed(() => {
31
- return `${ id.value }btn_save`;
32
- });
33
-
34
- const titleButtonDeleteFiltersSaved = computed(() => {
35
- if (isModelFilterSavedNew.value) {
36
- return "_A_FILTERS_DELETE_FILTER_SAVED_BTN_DISABLED_";
37
- }
38
- return {
39
- mobile: "_A_FILTERS_DELETE_FILTER_SAVED_BTN_",
40
- };
41
- });
42
-
43
- const textScreenreaderButtonDeleteFiltersSaved = computed(() => {
44
- if (isModelFilterSavedNew.value) {
45
- return "_A_FILTERS_DELETE_FILTER_SAVED_BTN_DISABLED_";
46
- }
47
- return "_A_FILTERS_DELETE_FILTER_SAVED_BTN_";
48
- });
49
-
50
- const deleteFiltersSaved = async() => {
51
- changeConfirmOptions({
52
- loading: true,
53
- });
54
- try {
55
- await updateFiltersSaved.value({
56
- action: "delete",
57
- label: modelFiltersSaved.value,
58
- });
59
- } catch (e) {
60
- addNotification({
61
- text: "_A_FILTERS_DELETE_FILTER_MSG_ERROR_{{name}}_",
62
- type: "danger",
63
- extra: {
64
- name: modelFiltersSaved.value,
65
- },
66
- });
67
- changeConfirmOptions({
68
- loading: false,
69
- });
70
- return;
71
- }
72
- addNotification({
73
- text: "_A_FILTERS_DELETE_FILTER_MSG_SUCCESS_{{name}}_",
74
- extra: {
75
- name: modelFiltersSaved.value,
76
- },
77
- });
78
- changeConfirmOptions({
79
- loading: false,
80
- });
81
- closeConfirm();
82
- changeModelFiltersSaved({ model: undefined, isDelete: true });
83
- };
84
-
85
- const openDeleteConfirm = () => {
86
- openConfirm({
87
- headerText: "_A_FILTERS_DELETE_FILTER_HEADER_{{name}}_",
88
- bodyHtml: "_A_FILTERS_DELETE_FILTER_BODY_{{name}}_",
89
- extra: {
90
- name: modelFiltersSaved.value,
91
- },
92
- save: deleteFiltersSaved,
93
- selectorCloseIds: [buttonDeleteId.value, idFilterTop.value],
94
- saveButtonText: "_A_FILTERS_DELETE_FILTER_BTN_DELETE_",
95
- stop: true,
96
- zIndex: 1901,
97
- backdropZIndex: 1900,
98
- });
99
- };
100
-
101
- return {
102
- buttonDeleteId,
103
- isConfirmHidden,
104
- openDeleteConfirm,
105
- textScreenreaderButtonDeleteFiltersSaved,
106
- titleButtonDeleteFiltersSaved,
107
- };
108
- }
1
+ import {
2
+ computed,
3
+ ref,
4
+ toRef,
5
+ } from "vue";
6
+
7
+ import AConfirmAPI from "../../../compositionAPI/AConfirmAPI";
8
+ import ANotificationAPI from "../../../compositionAPI/ANotificationAPI";
9
+
10
+ export default function FiltersSavedDeleteAPI(props, {
11
+ changeModelFiltersSaved = () => {},
12
+ idFilterTop = computed(() => ""),
13
+ isModelFilterSavedNew = computed(() => false),
14
+ modelFiltersSaved = ref(undefined),
15
+ }) {
16
+ const id = toRef(props, "id");
17
+ const updateFiltersSaved = toRef(props, "updateFiltersSaved");
18
+
19
+ const {
20
+ changeConfirmOptions,
21
+ closeConfirm,
22
+ isModalHidden: isConfirmHidden,
23
+ openConfirm,
24
+ } = AConfirmAPI();
25
+
26
+ const {
27
+ addNotification,
28
+ } = ANotificationAPI();
29
+
30
+ const buttonDeleteId = computed(() => {
31
+ return `${ id.value }btn_save`;
32
+ });
33
+
34
+ const titleButtonDeleteFiltersSaved = computed(() => {
35
+ if (isModelFilterSavedNew.value) {
36
+ return "_A_FILTERS_DELETE_FILTER_SAVED_BTN_DISABLED_";
37
+ }
38
+ return {
39
+ mobile: "_A_FILTERS_DELETE_FILTER_SAVED_BTN_",
40
+ };
41
+ });
42
+
43
+ const textScreenreaderButtonDeleteFiltersSaved = computed(() => {
44
+ if (isModelFilterSavedNew.value) {
45
+ return "_A_FILTERS_DELETE_FILTER_SAVED_BTN_DISABLED_";
46
+ }
47
+ return "_A_FILTERS_DELETE_FILTER_SAVED_BTN_";
48
+ });
49
+
50
+ const deleteFiltersSaved = async() => {
51
+ changeConfirmOptions({
52
+ loading: true,
53
+ });
54
+ try {
55
+ await updateFiltersSaved.value({
56
+ action: "delete",
57
+ label: modelFiltersSaved.value,
58
+ });
59
+ } catch(e) {
60
+ addNotification({
61
+ text: "_A_FILTERS_DELETE_FILTER_MSG_ERROR_{{name}}_",
62
+ type: "danger",
63
+ extra: {
64
+ name: modelFiltersSaved.value,
65
+ },
66
+ });
67
+ changeConfirmOptions({
68
+ loading: false,
69
+ });
70
+ return;
71
+ }
72
+ addNotification({
73
+ text: "_A_FILTERS_DELETE_FILTER_MSG_SUCCESS_{{name}}_",
74
+ extra: {
75
+ name: modelFiltersSaved.value,
76
+ },
77
+ });
78
+ changeConfirmOptions({
79
+ loading: false,
80
+ });
81
+ closeConfirm();
82
+ changeModelFiltersSaved({ model: undefined, isDelete: true });
83
+ };
84
+
85
+ const openDeleteConfirm = () => {
86
+ openConfirm({
87
+ headerText: "_A_FILTERS_DELETE_FILTER_HEADER_{{name}}_",
88
+ bodyHtml: "_A_FILTERS_DELETE_FILTER_BODY_{{name}}_",
89
+ extra: {
90
+ name: modelFiltersSaved.value,
91
+ },
92
+ save: deleteFiltersSaved,
93
+ selectorCloseIds: [buttonDeleteId.value, idFilterTop.value],
94
+ saveButtonText: "_A_FILTERS_DELETE_FILTER_BTN_DELETE_",
95
+ stop: true,
96
+ zIndex: 1901,
97
+ backdropZIndex: 1900,
98
+ });
99
+ };
100
+
101
+ return {
102
+ buttonDeleteId,
103
+ isConfirmHidden,
104
+ openDeleteConfirm,
105
+ textScreenreaderButtonDeleteFiltersSaved,
106
+ titleButtonDeleteFiltersSaved,
107
+ };
108
+ }
@@ -1,111 +1,114 @@
1
- import {
2
- h,
3
- } from "vue";
4
- import {
5
- AButton,
6
- AForm,
7
- } from "../../index";
8
-
9
- import IdAPI from "./compositionAPI/IdAPI";
10
- import MainFilterAPI from "./compositionAPI/MainFilterAPI";
11
- import SearchAPI from "./compositionAPI/SearchAPI";
12
-
13
- import Search from "aloha-svg/dist/js/bootstrap/Search";
14
-
15
- export default {
16
- name: "AFiltersMain",
17
- props: {
18
- disabled: {
19
- type: Boolean,
20
- required: false,
21
- },
22
- excludeRenderAttributes: {
23
- type: Array,
24
- required: false,
25
- default: () => [],
26
- },
27
- filterMain: {
28
- type: Object,
29
- required: false,
30
- },
31
- id: {
32
- type: String,
33
- required: true,
34
- },
35
- mainModel: {
36
- type: Object,
37
- required: false,
38
- },
39
- updateDataKeyByIdFromFilter: {
40
- type: Function,
41
- required: true,
42
- },
43
- updateMainModel: {
44
- type: Function,
45
- required: true,
46
- },
47
- },
48
- emits: [
49
- "startSearch",
50
- ],
51
- setup(props, context) {
52
- const {
53
- hasFilterMain,
54
- dataMainFilter,
55
- } = MainFilterAPI(props);
56
-
57
- const {
58
- idFilterTop,
59
- } = IdAPI(props);
60
-
61
- const {
62
- onSearch,
63
- } = SearchAPI(props, context);
64
-
65
-
66
- return {
67
- hasFilterMain,
68
- dataMainFilter,
69
- idFilterTop,
70
- onSearch,
71
- };
72
- },
73
- render() {
74
- if (!this.hasFilterMain) {
75
- return null;
76
- }
77
-
78
- return h("div", {
79
- id: this.idFilterTop,
80
- class: "a_filters_top",
81
- }, [
82
- h(AForm, {
83
- idPrefix: this.idFilterTop,
84
- class: "a_filters_top__form",
85
- classColumns: "a_filters_top__main_wrapper",
86
- classColumnDefault: "a_filters_top__main",
87
- data: this.dataMainFilter,
88
- excludeRenderAttributes: this.excludeRenderAttributes,
89
- modelValue: this.mainModel,
90
- showErrors: false,
91
- onChange: this.updateMainModel,
92
- }, {
93
- formDataAppend: () => h(AButton, {
94
- class: "a_btn a_btn_primary a_text_nowrap a_filters_top__search",
95
- iconLeft: Search,
96
- type: "submit",
97
- text: {
98
- desktop: "_A_FILTERS_START_SEARCH_",
99
- },
100
- textScreenReader: {
101
- mobile: "_A_FILTERS_START_SEARCH_",
102
- },
103
- prevent: true,
104
- stop: true,
105
- disabled: this.disabled,
106
- onClick: this.onSearch,
107
- }),
108
- }),
109
- ]);
110
- },
111
- };
1
+ import {
2
+ h,
3
+ } from "vue";
4
+ import {
5
+ AButton,
6
+ AForm,
7
+ } from "../../index";
8
+
9
+ import IdAPI from "./compositionAPI/IdAPI";
10
+ import MainFilterAPI from "./compositionAPI/MainFilterAPI";
11
+ import SearchAPI from "./compositionAPI/SearchAPI";
12
+
13
+ const Search = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
14
+ <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>
15
+ </svg>`;
16
+
17
+
18
+ export default {
19
+ name: "AFiltersMain",
20
+ props: {
21
+ disabled: {
22
+ type: Boolean,
23
+ required: false,
24
+ },
25
+ excludeRenderAttributes: {
26
+ type: Array,
27
+ required: false,
28
+ default: () => [],
29
+ },
30
+ filterMain: {
31
+ type: Object,
32
+ required: false,
33
+ },
34
+ id: {
35
+ type: String,
36
+ required: true,
37
+ },
38
+ mainModel: {
39
+ type: Object,
40
+ required: false,
41
+ },
42
+ updateDataKeyByIdFromFilter: {
43
+ type: Function,
44
+ required: true,
45
+ },
46
+ updateMainModel: {
47
+ type: Function,
48
+ required: true,
49
+ },
50
+ },
51
+ emits: [
52
+ "startSearch",
53
+ ],
54
+ setup(props, context) {
55
+ const {
56
+ hasFilterMain,
57
+ dataMainFilter,
58
+ } = MainFilterAPI(props);
59
+
60
+ const {
61
+ idFilterTop,
62
+ } = IdAPI(props);
63
+
64
+ const {
65
+ onSearch,
66
+ } = SearchAPI(props, context);
67
+
68
+
69
+ return {
70
+ hasFilterMain,
71
+ dataMainFilter,
72
+ idFilterTop,
73
+ onSearch,
74
+ };
75
+ },
76
+ render() {
77
+ if (!this.hasFilterMain) {
78
+ return null;
79
+ }
80
+
81
+ return h("div", {
82
+ id: this.idFilterTop,
83
+ class: "a_filters_top",
84
+ }, [
85
+ h(AForm, {
86
+ idPrefix: this.idFilterTop,
87
+ class: "a_filters_top__form",
88
+ classColumns: "a_filters_top__main_wrapper",
89
+ classColumnDefault: "a_filters_top__main",
90
+ data: this.dataMainFilter,
91
+ excludeRenderAttributes: this.excludeRenderAttributes,
92
+ modelValue: this.mainModel,
93
+ showErrors: false,
94
+ onChange: this.updateMainModel,
95
+ }, {
96
+ formDataAppend: () => h(AButton, {
97
+ class: "a_btn a_btn_primary a_text_nowrap a_filters_top__search",
98
+ iconLeft: Search,
99
+ type: "submit",
100
+ text: {
101
+ desktop: "_A_FILTERS_START_SEARCH_",
102
+ },
103
+ textScreenReader: {
104
+ mobile: "_A_FILTERS_START_SEARCH_",
105
+ },
106
+ prevent: true,
107
+ stop: true,
108
+ disabled: this.disabled,
109
+ onClick: this.onSearch,
110
+ }),
111
+ }),
112
+ ]);
113
+ },
114
+ };