aloha-vue 2.86.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 +11 -0
- package/dist/aloha-vue.css +13827 -13806
- package/dist/aloha-vue.css.map +1 -1
- package/dist/aloha-vue.es.js +60256 -60168
- 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/AColorPicker.scss +20 -0
- 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 +85 -35
- package/src/ui/AColorPicker/__tests__/AColorPicker.test.js +107 -1
- package/src/ui/AColorPicker/__tests__/colorUtils.test.js +12 -0
- package/src/ui/AColorPicker/compositionAPI/ClearAPI.js +23 -0
- package/src/ui/AColorPicker/compositionAPI/ColorStateAPI.js +28 -3
- package/src/ui/AColorPicker/compositionAPI/FormatAPI.js +59 -0
- package/src/ui/AColorPicker/compositionAPI/IdAPI.js +15 -0
- package/src/ui/AColorPicker/compositionAPI/PopoverAPI.js +20 -3
- package/src/ui/AColorPicker/i18n/ar.json +2 -1
- package/src/ui/AColorPicker/i18n/de.json +2 -1
- package/src/ui/AColorPicker/i18n/en.json +2 -1
- package/src/ui/AColorPicker/i18n/es.json +2 -1
- package/src/ui/AColorPicker/i18n/fr.json +2 -1
- package/src/ui/AColorPicker/i18n/hr.json +2 -1
- package/src/ui/AColorPicker/i18n/it.json +2 -1
- package/src/ui/AColorPicker/i18n/nl.json +2 -1
- package/src/ui/AColorPicker/i18n/pl.json +2 -1
- package/src/ui/AColorPicker/i18n/ru.json +2 -1
- package/src/ui/AColorPicker/i18n/uk.json +2 -1
- package/src/ui/AColorPicker/utils/colorUtils.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
|
@@ -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
|
+
}
|
|
@@ -32,6 +32,12 @@ export default function PopoverAPI(props, { emit }, {
|
|
|
32
32
|
|
|
33
33
|
const cleanupPopper = ref(undefined);
|
|
34
34
|
const isOpen = ref(false);
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* The popup is hidden until floating-ui has positioned it. Otherwise it stays
|
|
38
|
+
* at the top of the page for a moment and focusing it scrolls the page up.
|
|
39
|
+
*/
|
|
40
|
+
const isPositioned = ref(false);
|
|
35
41
|
const popupRef = ref(undefined);
|
|
36
42
|
const toggleRef = ref(undefined);
|
|
37
43
|
|
|
@@ -39,7 +45,7 @@ export default function PopoverAPI(props, { emit }, {
|
|
|
39
45
|
|
|
40
46
|
const elementsForClickOutside = computed(() => [toggleRef.value, popupRef.value]);
|
|
41
47
|
|
|
42
|
-
const startPosition = () => {
|
|
48
|
+
const startPosition = ({ onPositioned = () => {} } = {}) => {
|
|
43
49
|
if (cleanupPopper.value || !toggleRef.value || !popupRef.value) {
|
|
44
50
|
return;
|
|
45
51
|
}
|
|
@@ -62,6 +68,10 @@ export default function PopoverAPI(props, { emit }, {
|
|
|
62
68
|
left: `${ x }px`,
|
|
63
69
|
top: `${ y }px`,
|
|
64
70
|
});
|
|
71
|
+
if (!isPositioned.value) {
|
|
72
|
+
isPositioned.value = true;
|
|
73
|
+
nextTick(onPositioned);
|
|
74
|
+
}
|
|
65
75
|
});
|
|
66
76
|
});
|
|
67
77
|
};
|
|
@@ -94,6 +104,7 @@ export default function PopoverAPI(props, { emit }, {
|
|
|
94
104
|
return;
|
|
95
105
|
}
|
|
96
106
|
isOpen.value = false;
|
|
107
|
+
isPositioned.value = false;
|
|
97
108
|
stopPosition();
|
|
98
109
|
destroyEventClickOutside();
|
|
99
110
|
closePopup({ id: popupId.value });
|
|
@@ -112,8 +123,13 @@ export default function PopoverAPI(props, { emit }, {
|
|
|
112
123
|
openPopup({ id: popupId.value });
|
|
113
124
|
emit("open");
|
|
114
125
|
nextTick(() => {
|
|
115
|
-
startPosition(
|
|
116
|
-
|
|
126
|
+
startPosition({
|
|
127
|
+
onPositioned: () => {
|
|
128
|
+
// only as much scrolling as needed to show the whole popup
|
|
129
|
+
popupRef.value?.scrollIntoView?.({ block: "nearest" });
|
|
130
|
+
getFocusableElements()[0]?.focus({ preventScroll: true });
|
|
131
|
+
},
|
|
132
|
+
});
|
|
117
133
|
setTimeout(setEventClickOutside, 100);
|
|
118
134
|
});
|
|
119
135
|
};
|
|
@@ -169,6 +185,7 @@ export default function PopoverAPI(props, { emit }, {
|
|
|
169
185
|
return {
|
|
170
186
|
closePopover,
|
|
171
187
|
isOpen,
|
|
188
|
+
isPositioned,
|
|
172
189
|
onPopupKeydown,
|
|
173
190
|
onToggleKeydown,
|
|
174
191
|
popupId,
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "موافق",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "اختيار اللون",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "لم يتم اختيار لون",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "تنسيق اللون {{format}}، التبديل إلى {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "درجة اللون",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "قيمة اللون",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "قيمة اللون ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "قيمة لون غير صالحة. المسموح: #rrggbb و rgb() و hsl() و hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "ألوان محددة مسبقًا",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "التشبع والسطوع",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Farbe wählen",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Keine Farbe ausgewählt",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Farbformat {{format}}, wechseln zu {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Farbton",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Farbwert",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Farbwert ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Ungültiger Farbwert. Erlaubt: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Vordefinierte Farben",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Sättigung und Helligkeit",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Choose color",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "No color selected",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Color format {{format}}, switch to {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Hue",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Color value",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Color value ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Invalid color value. Allowed: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Predefined colors",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Saturation and brightness",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "Aceptar",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Elegir color",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Ningún color seleccionado",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Formato de color {{format}}, cambiar a {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Tono",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Valor del color",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Valor del color ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Valor de color no válido. Permitido: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Colores predefinidos",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Saturación y brillo",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Choisir une couleur",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Aucune couleur sélectionnée",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Format de couleur {{format}}, passer à {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Teinte",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Valeur de couleur",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Valeur de couleur ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Valeur de couleur invalide. Autorisé : #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Couleurs prédéfinies",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Saturation et luminosité",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "U redu",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Odaberi boju",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Nije odabrana boja",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Format boje {{format}}, prebaci na {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Nijansa",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Vrijednost boje",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Vrijednost boje ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Nevaljana vrijednost boje. Dopušteno: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Unaprijed definirane boje",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Zasićenost i svjetlina",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Scegli colore",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Nessun colore selezionato",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Formato colore {{format}}, passa a {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Tonalità",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Valore del colore",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Valore del colore ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Valore del colore non valido. Consentito: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Colori predefiniti",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Saturazione e luminosità",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Kleur kiezen",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Geen kleur geselecteerd",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Kleurformaat {{format}}, wisselen naar {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Tint",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Kleurwaarde",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Kleurwaarde ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Ongeldige kleurwaarde. Toegestaan: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Vooraf gedefinieerde kleuren",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Verzadiging en helderheid",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Wybierz kolor",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Nie wybrano koloru",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Format koloru {{format}}, przełącz na {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Odcień",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Wartość koloru",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Wartość koloru ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Nieprawidłowa wartość koloru. Dozwolone: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Kolory predefiniowane",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Nasycenie i jasność",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Выбор цвета",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Цвет не выбран",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Формат цвета {{format}}, переключить на {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Оттенок",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Значение цвета",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Значение цвета ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Недопустимое значение цвета. Допустимо: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Предустановленные цвета",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Насыщенность и яркость",
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"_A_COLOR_PICKER_CONFIRM_": "OK",
|
|
5
5
|
"_A_COLOR_PICKER_DIALOG_": "Вибір кольору",
|
|
6
6
|
"_A_COLOR_PICKER_EMPTY_": "Колір не вибрано",
|
|
7
|
+
"_A_COLOR_PICKER_FORMAT_SWITCH_{{format}}_{{next}}_": "Формат кольору {{format}}, перемкнути на {{next}}",
|
|
7
8
|
"_A_COLOR_PICKER_HUE_": "Відтінок",
|
|
8
|
-
"_A_COLOR_PICKER_INPUT_": "Значення кольору",
|
|
9
|
+
"_A_COLOR_PICKER_INPUT_{{format}}_": "Значення кольору ({{format}})",
|
|
9
10
|
"_A_COLOR_PICKER_INVALID_": "Неприпустиме значення кольору. Дозволено: #rrggbb, rgb(), hsl(), hsv().",
|
|
10
11
|
"_A_COLOR_PICKER_PREDEFINE_": "Попередньо визначені кольори",
|
|
11
12
|
"_A_COLOR_PICKER_SATURATION_": "Насиченість і яскравість",
|
|
@@ -188,6 +188,21 @@ function parseFunction(text) {
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Format of a color value: "hex", "rgb", "hsl", "hsv" or undefined.
|
|
193
|
+
*/
|
|
194
|
+
export function detectColorFormat(value) {
|
|
195
|
+
if (!isString(value)) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
const TEXT = value.trim().toLowerCase();
|
|
199
|
+
const MATCH = /^(rgb|hsl|hsv)a?\(/.exec(TEXT);
|
|
200
|
+
if (MATCH) {
|
|
201
|
+
return MATCH[1];
|
|
202
|
+
}
|
|
203
|
+
return parseHex(TEXT) ? "hex" : undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
191
206
|
/**
|
|
192
207
|
* Parses hex (#rgb, #rgba, #rrggbb, #rrggbbaa), rgb(a), hsl(a) and hsv(a).
|
|
193
208
|
* Returns { r, g, b, a } or undefined for an invalid value.
|
|
@@ -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,
|