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,65 +1,65 @@
1
- import {
2
- computed,
3
- ref,
4
- toRef,
5
- } from "vue";
6
-
7
- import ANotificationAPI from "../../../compositionAPI/ANotificationAPI";
8
-
9
- export default function SaveAPI(props, { emit }, {
10
- isUpdate = computed(() => false),
11
- model = ref({}),
12
- }) {
13
- const changeModelFiltersSaved = toRef(props, "changeModelFiltersSaved");
14
- const updateFiltersSaved = toRef(props, "updateFiltersSaved");
15
-
16
- const loading = ref(undefined);
17
-
18
- const {
19
- addNotification,
20
- } = ANotificationAPI();
21
-
22
- const disabledBtnSave = computed(() => {
23
- return !model.value.name;
24
- });
25
-
26
- const close = () => {
27
- emit("close");
28
- };
29
-
30
- const save = async() => {
31
- loading.value = true;
32
- const isUpdateLocal = isUpdate.value;
33
- try {
34
- await updateFiltersSaved.value({
35
- action: isUpdateLocal ? "update" : "create",
36
- label: model.value.name,
37
- });
38
- } catch (e) {
39
- addNotification({
40
- text: "_A_FILTERS_SAVE_MSG_ERROR_",
41
- type: "danger",
42
- });
43
- loading.value = false;
44
- return;
45
- }
46
- addNotification({
47
- text: isUpdateLocal ?
48
- "_A_FILTERS_SAVE_MSG_SUCCESS_UPDATE_{{name}}_" :
49
- "_A_FILTERS_SAVE_MSG_SUCCESS_CREATE_{{name}}_",
50
- extra: {
51
- name: model.value.name,
52
- },
53
- });
54
- changeModelFiltersSaved.value({ model: model.value.name, isCreateOrEdit: true });
55
- close();
56
- loading.value = false;
57
- };
58
-
59
- return {
60
- close,
61
- disabledBtnSave,
62
- loading,
63
- save,
64
- };
65
- }
1
+ import {
2
+ computed,
3
+ ref,
4
+ toRef,
5
+ } from "vue";
6
+
7
+ import ANotificationAPI from "../../../compositionAPI/ANotificationAPI";
8
+
9
+ export default function SaveAPI(props, { emit }, {
10
+ isUpdate = computed(() => false),
11
+ model = ref({}),
12
+ }) {
13
+ const changeModelFiltersSaved = toRef(props, "changeModelFiltersSaved");
14
+ const updateFiltersSaved = toRef(props, "updateFiltersSaved");
15
+
16
+ const loading = ref(undefined);
17
+
18
+ const {
19
+ addNotification,
20
+ } = ANotificationAPI();
21
+
22
+ const disabledBtnSave = computed(() => {
23
+ return !model.value.name;
24
+ });
25
+
26
+ const close = () => {
27
+ emit("close");
28
+ };
29
+
30
+ const save = async() => {
31
+ loading.value = true;
32
+ const isUpdateLocal = isUpdate.value;
33
+ try {
34
+ await updateFiltersSaved.value({
35
+ action: isUpdateLocal ? "update" : "create",
36
+ label: model.value.name,
37
+ });
38
+ } catch(e) {
39
+ addNotification({
40
+ text: "_A_FILTERS_SAVE_MSG_ERROR_",
41
+ type: "danger",
42
+ });
43
+ loading.value = false;
44
+ return;
45
+ }
46
+ addNotification({
47
+ text: isUpdateLocal ?
48
+ "_A_FILTERS_SAVE_MSG_SUCCESS_UPDATE_{{name}}_" :
49
+ "_A_FILTERS_SAVE_MSG_SUCCESS_CREATE_{{name}}_",
50
+ extra: {
51
+ name: model.value.name,
52
+ },
53
+ });
54
+ changeModelFiltersSaved.value({ model: model.value.name, isCreateOrEdit: true });
55
+ close();
56
+ loading.value = false;
57
+ };
58
+
59
+ return {
60
+ close,
61
+ disabledBtnSave,
62
+ loading,
63
+ save,
64
+ };
65
+ }
@@ -1,95 +1,98 @@
1
- import {
2
- h,
3
- } from "vue";
4
-
5
- import AButton from "../AButton/AButton";
6
- import ALink from "../ALink/ALink";
7
-
8
- import CopyAPI from "./compositionAPI/CopyAPI";
9
-
10
- import Copy from "aloha-svg/dist/js/bootstrap/Copy";
11
-
12
- export default {
13
- name: "ALinkCopy",
14
- props: {
15
- alwaysTranslate: {
16
- type: Boolean,
17
- required: false,
18
- },
19
- buttonOptions: {
20
- type: Object,
21
- required: false,
22
- default: () => ({}),
23
- },
24
- buttonPosition: {
25
- type: String,
26
- required: false,
27
- default: "right",
28
- validator: value => ["right", "left"].indexOf(value) !== -1,
29
- },
30
- class: {
31
- type: [String, Object],
32
- required: false,
33
- default: undefined,
34
- },
35
- classDefault: {
36
- type: String,
37
- required: false,
38
- default: "a_btn_group",
39
- },
40
- disabled: {
41
- type: Boolean,
42
- required: false,
43
- },
44
- linkOptions: {
45
- type: Object,
46
- required: false,
47
- default: () => ({}),
48
- },
49
- textCopy: {
50
- type: String,
51
- required: false,
52
- default: undefined,
53
- },
54
- },
55
- setup() {
56
- const {
57
- copyText,
58
- linkRef,
59
- } = CopyAPI();
60
-
61
- return {
62
- copyText,
63
- linkRef,
64
- };
65
- },
66
- render() {
67
- const BUTTON = h(AButton, {
68
- alwaysTranslate: this.alwaysTranslate,
69
- class: "a_btn a_btn_secondary",
70
- disabled: this.disabled,
71
- iconLeft: Copy,
72
- textScreenReader: "_A_LINK_COPY_BTN_TITLE_",
73
- title: "_A_LINK_COPY_BTN_TITLE_",
74
- onClick: this.copyText,
75
- ...this.buttonOptions,
76
- }, this.$slots?.button);
77
-
78
- return h("div", {
79
- class: [
80
- this.classDefault,
81
- this.class,
82
- ],
83
- role: "group",
84
- }, [
85
- this.buttonPosition === "left" && BUTTON,
86
- h(ALink, {
87
- ref: "linkRef",
88
- alwaysTranslate: this.alwaysTranslate,
89
- disabled: this.disabled,
90
- ...this.linkOptions,
91
- }, this.$slots?.link),
92
- this.buttonPosition === "right" && BUTTON,
93
- ]);
94
- },
95
- };
1
+ import {
2
+ h,
3
+ } from "vue";
4
+
5
+ import AButton from "../AButton/AButton";
6
+ import ALink from "../ALink/ALink";
7
+
8
+ import CopyAPI from "./compositionAPI/CopyAPI";
9
+
10
+ const Copy = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">
11
+ <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z"/>
12
+ </svg>`;
13
+
14
+
15
+ export default {
16
+ name: "ALinkCopy",
17
+ props: {
18
+ alwaysTranslate: {
19
+ type: Boolean,
20
+ required: false,
21
+ },
22
+ buttonOptions: {
23
+ type: Object,
24
+ required: false,
25
+ default: () => ({}),
26
+ },
27
+ buttonPosition: {
28
+ type: String,
29
+ required: false,
30
+ default: "right",
31
+ validator: value => ["right", "left"].indexOf(value) !== -1,
32
+ },
33
+ class: {
34
+ type: [String, Object],
35
+ required: false,
36
+ default: undefined,
37
+ },
38
+ classDefault: {
39
+ type: String,
40
+ required: false,
41
+ default: "a_btn_group",
42
+ },
43
+ disabled: {
44
+ type: Boolean,
45
+ required: false,
46
+ },
47
+ linkOptions: {
48
+ type: Object,
49
+ required: false,
50
+ default: () => ({}),
51
+ },
52
+ textCopy: {
53
+ type: String,
54
+ required: false,
55
+ default: undefined,
56
+ },
57
+ },
58
+ setup() {
59
+ const {
60
+ copyText,
61
+ linkRef,
62
+ } = CopyAPI();
63
+
64
+ return {
65
+ copyText,
66
+ linkRef,
67
+ };
68
+ },
69
+ render() {
70
+ const BUTTON = h(AButton, {
71
+ alwaysTranslate: this.alwaysTranslate,
72
+ class: "a_btn a_btn_secondary",
73
+ disabled: this.disabled,
74
+ iconLeft: Copy,
75
+ textScreenReader: "_A_LINK_COPY_BTN_TITLE_",
76
+ title: "_A_LINK_COPY_BTN_TITLE_",
77
+ onClick: this.copyText,
78
+ ...this.buttonOptions,
79
+ }, this.$slots?.button);
80
+
81
+ return h("div", {
82
+ class: [
83
+ this.classDefault,
84
+ this.class,
85
+ ],
86
+ role: "group",
87
+ }, [
88
+ this.buttonPosition === "left" && BUTTON,
89
+ h(ALink, {
90
+ ref: "linkRef",
91
+ alwaysTranslate: this.alwaysTranslate,
92
+ disabled: this.disabled,
93
+ ...this.linkOptions,
94
+ }, this.$slots?.link),
95
+ this.buttonPosition === "right" && BUTTON,
96
+ ]);
97
+ },
98
+ };
@@ -1,48 +1,48 @@
1
- import {
2
- ref,
3
- toRef,
4
- } from "vue";
5
-
6
- import ANotificationAPI from "../../compositionAPI/ANotificationAPI";
7
-
8
- import {
9
- forEach,
10
- } from "lodash-es";
11
-
12
- export default function CopyAPI(props) {
13
- const textCopy = toRef(props, "textCopy");
14
-
15
- const linkRef = ref(undefined);
16
-
17
- const {
18
- addNotification,
19
- } = ANotificationAPI();
20
-
21
- const copyText = async() => {
22
- let text = "";
23
- if (textCopy.value) {
24
- text = textCopy.value;
25
- } else if (linkRef.value?.$el) {
26
- forEach(linkRef.value.$el.children, child => {
27
- if (!child.classList.contains("a_sr_only")) { // check visible
28
- text += child.textContent;
29
- }
30
- });
31
- }
32
- if (text) {
33
- try {
34
- await navigator.clipboard.writeText(text);
35
- addNotification({
36
- text: "_A_LINK_COPY_COPIED_TO_CLIPBOARD_",
37
- });
38
- } catch (error) {
39
- console.error(error);
40
- }
41
- }
42
- };
43
-
44
- return {
45
- copyText,
46
- linkRef,
47
- };
48
- }
1
+ import {
2
+ ref,
3
+ toRef,
4
+ } from "vue";
5
+
6
+ import ANotificationAPI from "../../compositionAPI/ANotificationAPI";
7
+
8
+ import {
9
+ forEach,
10
+ } from "lodash-es";
11
+
12
+ export default function CopyAPI(props) {
13
+ const textCopy = toRef(props, "textCopy");
14
+
15
+ const linkRef = ref(undefined);
16
+
17
+ const {
18
+ addNotification,
19
+ } = ANotificationAPI();
20
+
21
+ const copyText = async() => {
22
+ let text = "";
23
+ if (textCopy.value) {
24
+ text = textCopy.value;
25
+ } else if (linkRef.value?.$el) {
26
+ forEach(linkRef.value.$el.children, child => {
27
+ if (!child.classList.contains("a_sr_only")) { // check visible
28
+ text += child.textContent;
29
+ }
30
+ });
31
+ }
32
+ if (text) {
33
+ try {
34
+ await navigator.clipboard.writeText(text);
35
+ addNotification({
36
+ text: "_A_LINK_COPY_COPIED_TO_CLIPBOARD_",
37
+ });
38
+ } catch(error) {
39
+ console.error(error);
40
+ }
41
+ }
42
+ };
43
+
44
+ return {
45
+ copyText,
46
+ linkRef,
47
+ };
48
+ }
@@ -1,33 +1,33 @@
1
- import {
2
- describe,
3
- expect,
4
- it,
5
- } from "@jest/globals";
6
- import {
7
- mount,
8
- } from "@vue/test-utils";
9
-
10
- import AList from "../AList";
11
-
12
- describe("AList", () => {
13
- it("keyLabel", () => {
14
- const ITEMS = [
15
- { label: "label 1" },
16
- { label: "label 2" },
17
- { label: "label 3" },
18
- { label: "label 4" },
19
- ];
20
-
21
- const wrapper = mount(AList, {
22
- props: {
23
- data: ITEMS,
24
- keyLabel: "label",
25
- },
26
- });
27
-
28
- expect(wrapper.findAll("li")).toHaveLength(4);
29
- expect(wrapper.text()).toContain("label 1label 2label 3label 4");
30
- expect(wrapper.html({ raw: true })).toBe("<ul><li><span>label 1</span></li><li><span>label 2</span></li><li><span>label 3</span></li><li><span>label 4</span></li></ul>");
31
- });
32
- });
33
-
1
+ import {
2
+ describe,
3
+ expect,
4
+ it,
5
+ } from "vitest";
6
+ import {
7
+ mount,
8
+ } from "@vue/test-utils";
9
+
10
+ import AList from "../AList";
11
+
12
+ describe("AList", () => {
13
+ it("keyLabel", () => {
14
+ const ITEMS = [
15
+ { label: "label 1" },
16
+ { label: "label 2" },
17
+ { label: "label 3" },
18
+ { label: "label 4" },
19
+ ];
20
+
21
+ const wrapper = mount(AList, {
22
+ props: {
23
+ data: ITEMS,
24
+ keyLabel: "label",
25
+ },
26
+ });
27
+
28
+ expect(wrapper.findAll("li")).toHaveLength(4);
29
+ expect(wrapper.text()).toContain("label 1label 2label 3label 4");
30
+ expect(wrapper.html({ raw: true })).toBe("<ul><li><span>label 1</span></li><li><span>label 2</span></li><li><span>label 3</span></li><li><span>label 4</span></li></ul>");
31
+ });
32
+ });
33
+
@@ -1,43 +1,43 @@
1
- import {
2
- beforeEach,
3
- describe,
4
- expect,
5
- it,
6
- } from "@jest/globals";
7
-
8
- import TagAPI from "../TagAPI";
9
-
10
- describe("TagAPI", () => {
11
- let props;
12
-
13
- beforeEach(() => {
14
- props = {
15
- tag: "ul",
16
- isHtml: false,
17
- };
18
- });
19
-
20
- it("returns tagLocal as span if isHtml is false and tag is 'ul' or 'ol'", () => {
21
- const { tagLocal } = TagAPI(props);
22
- expect(tagLocal.value).toBe("span");
23
- });
24
-
25
- it("returns tagLocal equal to tag 'ul' if isHtml is true", () => {
26
- props.isHtml = true;
27
- const { tagLocal } = TagAPI(props);
28
- expect(tagLocal.value).toBe("ul");
29
- });
30
-
31
- it("returns tagLocal equal to tag 'ol' if isHtml is true", () => {
32
- props.isHtml = true;
33
- props.tag = "ol";
34
- const { tagLocal } = TagAPI(props);
35
- expect(tagLocal.value).toBe("ol");
36
- });
37
-
38
- it("returns tagLocal equal to tag if tag is not 'ul' or 'ol'", () => {
39
- props.tag = "div";
40
- const { tagLocal } = TagAPI(props);
41
- expect(tagLocal.value).toBe("div");
42
- });
43
- });
1
+ import {
2
+ beforeEach,
3
+ describe,
4
+ expect,
5
+ it,
6
+ } from "vitest";
7
+
8
+ import TagAPI from "../TagAPI";
9
+
10
+ describe("TagAPI", () => {
11
+ let props;
12
+
13
+ beforeEach(() => {
14
+ props = {
15
+ tag: "ul",
16
+ isHtml: false,
17
+ };
18
+ });
19
+
20
+ it("returns tagLocal as span if isHtml is false and tag is 'ul' or 'ol'", () => {
21
+ const { tagLocal } = TagAPI(props);
22
+ expect(tagLocal.value).toBe("span");
23
+ });
24
+
25
+ it("returns tagLocal equal to tag 'ul' if isHtml is true", () => {
26
+ props.isHtml = true;
27
+ const { tagLocal } = TagAPI(props);
28
+ expect(tagLocal.value).toBe("ul");
29
+ });
30
+
31
+ it("returns tagLocal equal to tag 'ol' if isHtml is true", () => {
32
+ props.isHtml = true;
33
+ props.tag = "ol";
34
+ const { tagLocal } = TagAPI(props);
35
+ expect(tagLocal.value).toBe("ol");
36
+ });
37
+
38
+ it("returns tagLocal equal to tag if tag is not 'ul' or 'ol'", () => {
39
+ props.tag = "div";
40
+ const { tagLocal } = TagAPI(props);
41
+ expect(tagLocal.value).toBe("div");
42
+ });
43
+ });
@@ -33,11 +33,14 @@ import SearchAPI from "./compositionAPI/SearchAPI";
33
33
  import SearchBtnAPI from "./compositionAPI/SearchBtnAPI";
34
34
  import ToggleAPI from "./AMenuButtonToggle/compositionAPI/ToggleAPI";
35
35
 
36
- import Search from "aloha-svg/dist/js/bootstrap/Search";
37
36
  import {
38
37
  uniqueId,
39
38
  } from "lodash-es";
40
39
 
40
+ 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">
41
+ <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"/>
42
+ </svg>`;
43
+
41
44
  const DROPDOWN_BUTTON_WIDTH = 34;
42
45
  const BREADCRUMBS_PADDINGS = 20;
43
46