aloha-vue 2.87.0 → 2.87.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.
- package/CHANGELOG.md +4 -0
- package/dist/aloha-vue.css +13827 -13827
- package/dist/aloha-vue.es.js +60256 -60235
- package/dist/aloha-vue.umd.js +319 -319
- package/package.json +1 -1
- package/scss/components/ui/ACheckbox.scss +17 -17
- package/scss/components/ui/AInputFile.scss +15 -15
- package/scss/utils/border_radius.scss +61 -61
- package/src/AAlert/compositionAPI/IconAPI.js +28 -28
- package/src/ACloak/ACloak.js +135 -135
- package/src/ALoading/ALoading.js +146 -146
- package/src/AMenu/compositionAPI/ResizeAPI.js +1 -1
- package/src/AMenu/compositionAPI/__tests__/ResizeAPI.test.js +33 -0
- package/src/ASpinner/ASpinner.js +71 -71
- package/src/filters/i18n/ar.json +11 -11
- package/src/filters/i18n/de.json +11 -11
- package/src/filters/i18n/en.json +11 -11
- package/src/filters/i18n/es.json +11 -11
- package/src/filters/i18n/fr.json +11 -11
- package/src/filters/i18n/hr.json +10 -10
- package/src/filters/i18n/it.json +11 -11
- package/src/filters/i18n/nl.json +11 -11
- package/src/filters/i18n/pl.json +11 -11
- package/src/filters/i18n/ru.json +10 -10
- package/src/plugins/ACloakPlugin.js +26 -26
- package/src/plugins/AFormPlugin.js +18 -18
- package/src/plugins/AGroupButtonDropdownPlugin.js +26 -26
- package/src/plugins/AInputNumberPlugin.js +29 -29
- package/src/plugins/ALoadingPlugin.js +26 -26
- package/src/plugins/AModalPlugin.js +41 -41
- package/src/plugins/ARouterLinkConfigPlugin.js +88 -88
- package/src/plugins/ASpinnerPlugin.js +26 -26
- package/src/plugins/ATablePlugin.js +28 -28
- package/src/ui/ACheckbox/i18n/ar.json +5 -5
- package/src/ui/ACheckbox/i18n/de.json +5 -5
- package/src/ui/ACheckbox/i18n/en.json +5 -5
- package/src/ui/ACheckbox/i18n/es.json +5 -5
- package/src/ui/ACheckbox/i18n/fr.json +5 -5
- package/src/ui/ACheckbox/i18n/hr.json +5 -5
- package/src/ui/ACheckbox/i18n/it.json +5 -5
- package/src/ui/ACheckbox/i18n/nl.json +4 -4
- package/src/ui/ACheckbox/i18n/pl.json +4 -4
- package/src/ui/ACheckbox/i18n/ru.json +5 -5
- package/src/ui/AColorPicker/AColorPicker.js +15 -11
- package/src/ui/AColorPicker/__tests__/AColorPicker.test.js +41 -0
- package/src/ui/AColorPicker/compositionAPI/ClearAPI.js +23 -0
- package/src/ui/AColorPicker/compositionAPI/IdAPI.js +15 -0
- package/src/ui/ADatepicker/compositionAPI/PlaceholderAPI.js +32 -32
- package/src/ui/AMultiselectOrdered/compositionAPI/TextsAPI.js +55 -55
- package/src/ui/ASlider/__tests__/ASlider.Form.test.js +38 -0
- package/src/ui/AUiComponents.js +2 -0
- package/src/ui/__tests__/ReadonlyValueParentClass.test.js +217 -217
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "ادخالات غير صالحة",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[لا توجد عناصر متاحة للاختيار]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "بحث"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "ادخالات غير صالحة",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[لا توجد عناصر متاحة للاختيار]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "بحث"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Invalide Einträge",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Keine Elemente zur Auswahl verfügbar]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Suche"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Invalide Einträge",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Keine Elemente zur Auswahl verfügbar]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Suche"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Invalid entries",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[No items available for selection]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Search"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Invalid entries",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[No items available for selection]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Search"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Entradas no válidas",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[No hay elementos disponibles para seleccionar]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Buscar"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Entradas no válidas",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[No hay elementos disponibles para seleccionar]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Buscar"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Entrées invalides",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Aucun élément disponible pour la sélection]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Recherche"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Entrées invalides",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Aucun élément disponible pour la sélection]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Recherche"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Neispravni unosi",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Nema dostupnih elemenata za odabir]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Pretraživanje"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Neispravni unosi",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Nema dostupnih elemenata za odabir]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Pretraživanje"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Voci non valide",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Nessun elemento disponibile per la selezione]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Cerca"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Voci non valide",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Nessun elemento disponibile per la selezione]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Cerca"
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Ongeldige invoer",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Geen items beschikbaar voor selectie]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Zoeken"
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Ongeldige invoer",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Geen items beschikbaar voor selectie]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Zoeken"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Nieprawidłowe wpisy",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Brak elementów do wyboru]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Szukaj"
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Nieprawidłowe wpisy",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Brak elementów do wyboru]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Szukaj"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Недопустимые записи",
|
|
3
|
-
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Нет элементов для выбора]",
|
|
4
|
-
"_A_CHECKBOX_SEARCH_": "Поиск"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_A_CHECKBOX_GROUP_INVALID_ENTRIES_": "Недопустимые записи",
|
|
3
|
+
"_A_CHECKBOX_HAS_NOT_ELEMENTS_WITH_SEARCH_": "[Нет элементов для выбора]",
|
|
4
|
+
"_A_CHECKBOX_SEARCH_": "Поиск"
|
|
5
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
computed,
|
|
3
2
|
h,
|
|
4
3
|
Teleport,
|
|
5
4
|
} from "vue";
|
|
@@ -24,9 +23,11 @@ import {
|
|
|
24
23
|
import AColorPickerSaturation from "./AColorPickerSaturation/AColorPickerSaturation";
|
|
25
24
|
import AColorPickerSlider from "./AColorPickerSlider/AColorPickerSlider";
|
|
26
25
|
|
|
26
|
+
import ClearAPI from "./compositionAPI/ClearAPI";
|
|
27
27
|
import ColorStateAPI from "./compositionAPI/ColorStateAPI";
|
|
28
28
|
import ConfirmAPI from "./compositionAPI/ConfirmAPI";
|
|
29
29
|
import FormatAPI from "./compositionAPI/FormatAPI";
|
|
30
|
+
import IdAPI from "./compositionAPI/IdAPI";
|
|
30
31
|
import InputAPI from "./compositionAPI/InputAPI";
|
|
31
32
|
import PopoverAPI from "./compositionAPI/PopoverAPI";
|
|
32
33
|
import PredefineAPI from "./compositionAPI/PredefineAPI";
|
|
@@ -168,7 +169,7 @@ export default {
|
|
|
168
169
|
modelUndefined: {
|
|
169
170
|
type: [String, Number, Object, Array, Boolean],
|
|
170
171
|
required: false,
|
|
171
|
-
default:
|
|
172
|
+
default: undefined,
|
|
172
173
|
},
|
|
173
174
|
modelValue: {
|
|
174
175
|
type: String,
|
|
@@ -342,16 +343,19 @@ export default {
|
|
|
342
343
|
isErrors,
|
|
343
344
|
});
|
|
344
345
|
|
|
345
|
-
const
|
|
346
|
-
|
|
346
|
+
const {
|
|
347
|
+
labelId,
|
|
348
|
+
valueId,
|
|
349
|
+
} = IdAPI({
|
|
350
|
+
htmlIdLocal,
|
|
351
|
+
});
|
|
347
352
|
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
};
|
|
353
|
+
const {
|
|
354
|
+
clearModelFromToggle,
|
|
355
|
+
} = ClearAPI(props, {
|
|
356
|
+
changeModel,
|
|
357
|
+
toggleRef,
|
|
358
|
+
});
|
|
355
359
|
|
|
356
360
|
return {
|
|
357
361
|
alphaBackground,
|
|
@@ -50,6 +50,47 @@ describe("AColorPicker", () => {
|
|
|
50
50
|
wrapper.unmount();
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
+
it("updates the label and value IDs when htmlId changes", async() => {
|
|
54
|
+
const wrapper = mountPicker({ htmlId: "color", modelValue: "#ff0000" });
|
|
55
|
+
const toggle = wrapper.get("button.a_color_picker__toggle");
|
|
56
|
+
|
|
57
|
+
expect(toggle.attributes("aria-labelledby")).toBe("color_label color_value");
|
|
58
|
+
await wrapper.setProps({ htmlId: "updated_color" });
|
|
59
|
+
expect(toggle.attributes("aria-labelledby")).toBe("updated_color_label updated_color_value");
|
|
60
|
+
expect(wrapper.get(".a_color_picker__toggle__value").attributes("id")).toBe("updated_color_value");
|
|
61
|
+
wrapper.unmount();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it.each(["toggle", "panel"])("clears from the %s to undefined by default and restores focus", async source => {
|
|
65
|
+
const change = vi.fn();
|
|
66
|
+
const wrapper = mountPicker({ modelValue: "#ff0000", change });
|
|
67
|
+
const toggle = wrapper.get("button.a_color_picker__toggle");
|
|
68
|
+
|
|
69
|
+
if (source === "panel") {
|
|
70
|
+
await toggle.trigger("click");
|
|
71
|
+
await flush();
|
|
72
|
+
[...getPopup().querySelectorAll("button")].find(button => button.textContent.includes("_A_COLOR_PICKER_CLEAR_")).click();
|
|
73
|
+
} else {
|
|
74
|
+
await wrapper.get(".a_form_control__actions__btn").trigger("click");
|
|
75
|
+
}
|
|
76
|
+
await flush();
|
|
77
|
+
|
|
78
|
+
expect(wrapper.emitted("update:modelValue").at(-1)).toEqual([undefined]);
|
|
79
|
+
expect(change).toHaveBeenCalledWith(expect.objectContaining({ model: undefined, triggerDetails: "clear" }));
|
|
80
|
+
expect(getPopup()).toBeNull();
|
|
81
|
+
expect(document.activeElement).toBe(toggle.element);
|
|
82
|
+
wrapper.unmount();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("uses the updated modelUndefined when clearing from the toggle", async() => {
|
|
86
|
+
const wrapper = mountPicker({ modelValue: "#ff0000", modelUndefined: "" });
|
|
87
|
+
await wrapper.setProps({ modelUndefined: null });
|
|
88
|
+
await wrapper.get(".a_form_control__actions__btn").trigger("click");
|
|
89
|
+
|
|
90
|
+
expect(wrapper.emitted("update:modelValue").at(-1)).toEqual([null]);
|
|
91
|
+
wrapper.unmount();
|
|
92
|
+
});
|
|
93
|
+
|
|
53
94
|
it("opens a dialog, changes the hue with the keyboard and confirms", async() => {
|
|
54
95
|
const change = vi.fn();
|
|
55
96
|
const wrapper = mountPicker({ modelValue: "#ff0000", change });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
export default function ClearAPI(props, {
|
|
7
|
+
changeModel = () => {},
|
|
8
|
+
toggleRef = ref(undefined),
|
|
9
|
+
}) {
|
|
10
|
+
const modelUndefined = toRef(props, "modelUndefined");
|
|
11
|
+
|
|
12
|
+
const clearModelFromToggle = () => {
|
|
13
|
+
changeModel({
|
|
14
|
+
model: modelUndefined.value,
|
|
15
|
+
triggerDetails: "clear",
|
|
16
|
+
});
|
|
17
|
+
toggleRef.value?.focus();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
clearModelFromToggle,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
export default function IdAPI({
|
|
6
|
+
htmlIdLocal = computed(() => ""),
|
|
7
|
+
}) {
|
|
8
|
+
const labelId = computed(() => `${ htmlIdLocal.value }_label`);
|
|
9
|
+
const valueId = computed(() => `${ htmlIdLocal.value }_value`);
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
labelId,
|
|
13
|
+
valueId,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
ref,
|
|
4
|
-
toRef,
|
|
5
|
-
} from "vue";
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
ref,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
getTranslatedText,
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
isString,
|
|
13
13
|
} from "lodash-es";
|
|
14
14
|
|
|
15
|
-
export default function PlaceholderAPI(props, {
|
|
16
|
-
isInputFocused = ref(false),
|
|
17
|
-
text = computed(() => ""),
|
|
18
|
-
} = {}) {
|
|
19
|
-
const extra = toRef(props, "extra");
|
|
20
|
-
const isLabelFloat = toRef(props, "isLabelFloat");
|
|
21
|
-
const placeholder = toRef(props, "placeholder");
|
|
22
|
-
const placeholdersDefault = toRef(props, "placeholdersDefault");
|
|
23
|
-
const range = toRef(props, "range");
|
|
15
|
+
export default function PlaceholderAPI(props, {
|
|
16
|
+
isInputFocused = ref(false),
|
|
17
|
+
text = computed(() => ""),
|
|
18
|
+
} = {}) {
|
|
19
|
+
const extra = toRef(props, "extra");
|
|
20
|
+
const isLabelFloat = toRef(props, "isLabelFloat");
|
|
21
|
+
const placeholder = toRef(props, "placeholder");
|
|
22
|
+
const placeholdersDefault = toRef(props, "placeholdersDefault");
|
|
23
|
+
const range = toRef(props, "range");
|
|
24
24
|
const timePrecision = toRef(props, "timePrecision");
|
|
25
25
|
const type = toRef(props, "type");
|
|
26
26
|
|
|
@@ -56,24 +56,24 @@ export default function PlaceholderAPI(props, {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
return "date";
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const isShowPlaceholder = computed(() => {
|
|
62
|
-
if (!isLabelFloat.value) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return isInputFocused.value || !!text.value;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const innerPlaceholder = computed(() => {
|
|
70
|
-
if (!isShowPlaceholder.value) {
|
|
71
|
-
return "";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (isString(placeholder.value)) {
|
|
75
|
-
return getTranslatedText({ placeholder: placeholder.value, extra: extra.value }) || "";
|
|
76
|
-
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const isShowPlaceholder = computed(() => {
|
|
62
|
+
if (!isLabelFloat.value) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return isInputFocused.value || !!text.value;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const innerPlaceholder = computed(() => {
|
|
70
|
+
if (!isShowPlaceholder.value) {
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (isString(placeholder.value)) {
|
|
75
|
+
return getTranslatedText({ placeholder: placeholder.value, extra: extra.value }) || "";
|
|
76
|
+
}
|
|
77
77
|
|
|
78
78
|
const PLACEHOLDER = placeholdersDefault.value[placeholderScenario.value];
|
|
79
79
|
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
AMultiselectOrderedPluginTexts,
|
|
8
|
-
} from "../../../plugins/AMultiselectOrderedPlugin";
|
|
9
|
-
|
|
10
|
-
export default function TextsAPI(props) {
|
|
11
|
-
const texts = toRef(props, "texts");
|
|
12
|
-
|
|
13
|
-
const textBtnDeleteTitle = computed(() => {
|
|
14
|
-
return texts.value.btnDeleteTitle || AMultiselectOrderedPluginTexts.btnDeleteTitle;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const textBtnDownTitle = computed(() => {
|
|
18
|
-
return texts.value.btnDownTitle || AMultiselectOrderedPluginTexts.btnDownTitle;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const textBtnGroupAriaLabel = computed(() => {
|
|
22
|
-
return texts.value.btnGroupAriaLabel || AMultiselectOrderedPluginTexts.btnGroupAriaLabel;
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const textBtnUpTitle = computed(() => {
|
|
26
|
-
return texts.value.btnUpTitle || AMultiselectOrderedPluginTexts.btnUpTitle;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const textDeselectAll = computed(() => {
|
|
30
|
-
return texts.value.deselectAll || AMultiselectOrderedPluginTexts.deselectAll;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const textModelEmpty = computed(() => {
|
|
34
|
-
return texts.value.modelEmpty || AMultiselectOrderedPluginTexts.modelEmpty;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const textSelectAll = computed(() => {
|
|
38
|
-
return texts.value.selectAll || AMultiselectOrderedPluginTexts.selectAll;
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const textGroupAllAriaLabel = computed(() => {
|
|
42
|
-
return texts.value.groupAllAriaLabel || AMultiselectOrderedPluginTexts.groupAllAriaLabel;
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
textBtnDeleteTitle,
|
|
47
|
-
textBtnDownTitle,
|
|
48
|
-
textBtnGroupAriaLabel,
|
|
49
|
-
textBtnUpTitle,
|
|
50
|
-
textDeselectAll,
|
|
51
|
-
textGroupAllAriaLabel,
|
|
52
|
-
textModelEmpty,
|
|
53
|
-
textSelectAll,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
AMultiselectOrderedPluginTexts,
|
|
8
|
+
} from "../../../plugins/AMultiselectOrderedPlugin";
|
|
9
|
+
|
|
10
|
+
export default function TextsAPI(props) {
|
|
11
|
+
const texts = toRef(props, "texts");
|
|
12
|
+
|
|
13
|
+
const textBtnDeleteTitle = computed(() => {
|
|
14
|
+
return texts.value.btnDeleteTitle || AMultiselectOrderedPluginTexts.btnDeleteTitle;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const textBtnDownTitle = computed(() => {
|
|
18
|
+
return texts.value.btnDownTitle || AMultiselectOrderedPluginTexts.btnDownTitle;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const textBtnGroupAriaLabel = computed(() => {
|
|
22
|
+
return texts.value.btnGroupAriaLabel || AMultiselectOrderedPluginTexts.btnGroupAriaLabel;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const textBtnUpTitle = computed(() => {
|
|
26
|
+
return texts.value.btnUpTitle || AMultiselectOrderedPluginTexts.btnUpTitle;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const textDeselectAll = computed(() => {
|
|
30
|
+
return texts.value.deselectAll || AMultiselectOrderedPluginTexts.deselectAll;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const textModelEmpty = computed(() => {
|
|
34
|
+
return texts.value.modelEmpty || AMultiselectOrderedPluginTexts.modelEmpty;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const textSelectAll = computed(() => {
|
|
38
|
+
return texts.value.selectAll || AMultiselectOrderedPluginTexts.selectAll;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const textGroupAllAriaLabel = computed(() => {
|
|
42
|
+
return texts.value.groupAllAriaLabel || AMultiselectOrderedPluginTexts.groupAllAriaLabel;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
textBtnDeleteTitle,
|
|
47
|
+
textBtnDownTitle,
|
|
48
|
+
textBtnGroupAriaLabel,
|
|
49
|
+
textBtnUpTitle,
|
|
50
|
+
textDeselectAll,
|
|
51
|
+
textGroupAllAriaLabel,
|
|
52
|
+
textModelEmpty,
|
|
53
|
+
textSelectAll,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
describe,
|
|
3
|
+
expect,
|
|
4
|
+
it,
|
|
5
|
+
} from "vitest";
|
|
6
|
+
import {
|
|
7
|
+
mount,
|
|
8
|
+
} from "@vue/test-utils";
|
|
9
|
+
|
|
10
|
+
import AForm from "../../AForm/AForm";
|
|
11
|
+
|
|
12
|
+
import ASlider from "../ASlider";
|
|
13
|
+
import AUiComponents from "../../AUiComponents";
|
|
14
|
+
|
|
15
|
+
describe("ASlider in forms", () => {
|
|
16
|
+
it("is registered as the form type slider", () => {
|
|
17
|
+
expect(AUiComponents.slider).toBe(ASlider);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("is rendered by AForm with type slider", () => {
|
|
21
|
+
const wrapper = mount(AForm, {
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: { volume: 40 },
|
|
24
|
+
data: [
|
|
25
|
+
{
|
|
26
|
+
id: "volume",
|
|
27
|
+
type: "slider",
|
|
28
|
+
label: "Volume",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const SLIDER = wrapper.findComponent(ASlider);
|
|
34
|
+
expect(SLIDER.exists()).toBe(true);
|
|
35
|
+
expect(SLIDER.props("modelValue")).toBe(40);
|
|
36
|
+
expect(wrapper.text()).toContain("Volume");
|
|
37
|
+
});
|
|
38
|
+
});
|
package/src/ui/AUiComponents.js
CHANGED
|
@@ -15,6 +15,7 @@ import ARouterLinkConfig from "./ARouterLinkConfig/ARouterLinkConfig";
|
|
|
15
15
|
import ASelect from "./ASelect/ASelect";
|
|
16
16
|
import ASelectIcon from "./ASelectIcon/ASelectIcon";
|
|
17
17
|
import ASelectStyle from "./ASelectStyle/ASelectStyle";
|
|
18
|
+
import ASlider from "./ASlider/ASlider";
|
|
18
19
|
import ASwitch from "./ASwitch/ASwitch";
|
|
19
20
|
import ATemplate from "./ATemplate/ATemplate";
|
|
20
21
|
import ATextarea from "./ATextarea/ATextarea";
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
53
54
|
selectIcon: ASelectIcon,
|
|
54
55
|
selectStyle: ASelectStyle,
|
|
55
56
|
selectRoute: ARouterLinkConfig,
|
|
57
|
+
slider: ASlider,
|
|
56
58
|
switch: ASwitch,
|
|
57
59
|
template: ATemplate,
|
|
58
60
|
text: AInput,
|