@wikicasa-dev/components 2.2.9-alpha.5 → 2.2.9-alpha.50
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/dist/Swiper/autoplay.js +1 -1
- package/dist/Swiper/controller.js +1 -1
- package/dist/Swiper/keyboard.js +1 -1
- package/dist/Swiper/thumbs.js +1 -1
- package/dist/UIKit/AccessibleSelect.d.ts +4 -4
- package/dist/UIKit/AccessibleSelect.js +3 -2
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +9 -3
- package/dist/UIKit/BaseAutocomplete.d.ts +4 -4
- package/dist/UIKit/BaseButton.d.ts +14 -8
- package/dist/UIKit/BaseCard.js +1 -3
- package/dist/UIKit/BaseDropDown.d.ts +17 -11
- package/dist/UIKit/BaseFloatingLabel.js +4 -4
- package/dist/UIKit/BaseInput.d.ts +3 -2
- package/dist/UIKit/BaseInput.js +1 -1
- package/dist/UIKit/BaseTextarea.d.ts +2 -2
- package/dist/assets/AccessibleSelect.css +1 -0
- package/dist/assets/BaseCard.css +1 -1
- package/dist/assets/BaseDropDown.css +1 -1
- package/dist/assets/BaseFloatingLabel.css +1 -1
- package/dist/assets/BaseInput.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/composables/mock.d.ts +25 -0
- package/dist/composables/mock.js +49 -0
- package/dist/index.js +85 -83
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +151 -157
- package/dist/packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js +4 -6
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +120 -99
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +36 -36
- package/dist/packages/components/lib/UIKit/BaseButton.vue.js +28 -24
- package/dist/packages/components/lib/UIKit/BaseCard.vue.js +13 -13
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +102 -105
- package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +8 -8
- package/dist/packages/components/lib/UIKit/BaseInput.vue.js +74 -73
- package/dist/packages/components/lib/UIKit/BaseModal.vue.js +42 -36
- package/dist/packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js +18 -17
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +22 -24
- package/package.json +6 -5
- /package/dist/assets/{swiper-controller.css → swiper-autoplay.css} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
interface KeyboardControllerProps {
|
|
3
|
+
optionsLength: Ref<number> | number;
|
|
4
|
+
isDropdownOpen?: Ref<boolean>;
|
|
5
|
+
disableSpaceHandler?: boolean;
|
|
6
|
+
activate?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* If true, the listener will be initialized on the document element
|
|
9
|
+
*/
|
|
10
|
+
global?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* List of keys that will close the dropdown.
|
|
13
|
+
* For the full list of keys, see
|
|
14
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
15
|
+
* @default "Escape" and "Enter"
|
|
16
|
+
*/
|
|
17
|
+
closeKeys?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare const useKeyboardController: (props: KeyboardControllerProps) => {
|
|
20
|
+
activeIdx: Ref<number, number>;
|
|
21
|
+
selectedIdx: Ref<number, number>;
|
|
22
|
+
$reset: () => void;
|
|
23
|
+
onKeyDownHandler: (e: KeyboardEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ref as _, onMounted as A, onUnmounted as D, unref as p } from "vue";
|
|
2
|
+
const u = "ArrowUp", a = "ArrowDown", c = "Enter", i = "Escape", v = " ", d = "PageUp", K = "Home", E = "PageDown", m = "End", O = (l) => {
|
|
3
|
+
const {
|
|
4
|
+
isDropdownOpen: t,
|
|
5
|
+
disableSpaceHandler: P,
|
|
6
|
+
global: f = !0,
|
|
7
|
+
closeKeys: Y = [i, c]
|
|
8
|
+
} = l, n = _(-1), o = _(-1), w = l.activate === void 0 ? !0 : l.activate, y = () => {
|
|
9
|
+
n.value = -1, o.value = -1, t && (t.value = !1);
|
|
10
|
+
}, k = (e) => {
|
|
11
|
+
t && Y.includes(e) && (t.value = !1);
|
|
12
|
+
}, r = (e) => {
|
|
13
|
+
if (!t?.value || ![
|
|
14
|
+
u,
|
|
15
|
+
a,
|
|
16
|
+
c,
|
|
17
|
+
i,
|
|
18
|
+
v,
|
|
19
|
+
d,
|
|
20
|
+
K,
|
|
21
|
+
E,
|
|
22
|
+
m
|
|
23
|
+
].includes(e.key))
|
|
24
|
+
return;
|
|
25
|
+
const s = p(l.optionsLength);
|
|
26
|
+
if ([u, a, d, E].includes(e.key) && e.preventDefault(), e.key === u)
|
|
27
|
+
n.value = n.value === 0 ? s - 1 : n.value - 1;
|
|
28
|
+
else if (e.key === a)
|
|
29
|
+
n.value = (n.value + 1) % s;
|
|
30
|
+
else if (e.key === c || e.key === v) {
|
|
31
|
+
if (e.key === v && P) return;
|
|
32
|
+
o.value = n.value, k(e.key);
|
|
33
|
+
} else e.key === i ? (n.value = o.value, k(e.key)) : e.key === d || e.key === K ? n.value = 0 : (e.key === E || e.key === m) && (n.value = s - 1);
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
};
|
|
36
|
+
return w ? (A(() => {
|
|
37
|
+
!document || !f || document.addEventListener("keydown", r);
|
|
38
|
+
}), D(() => {
|
|
39
|
+
!document || !f || document.removeEventListener("keydown", r);
|
|
40
|
+
}), {
|
|
41
|
+
activeIdx: n,
|
|
42
|
+
selectedIdx: o,
|
|
43
|
+
onKeyDownHandler: r,
|
|
44
|
+
$reset: y
|
|
45
|
+
}) : { activeIdx: n, selectedIdx: o, $reset: y, onKeyDownHandler: r };
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
O as useKeyboardController
|
|
49
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,93 +1,95 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
1
|
+
import { default as i } from "./packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js";
|
|
2
|
+
import { default as n } from "./packages/components/lib/UIKit/Accordion/BaseAccordionBtn.vue.js";
|
|
3
|
+
import { default as S } from "./packages/components/lib/UIKit/Accordion/BaseAccordionContent.vue.js";
|
|
4
|
+
import { default as C } from "./packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js";
|
|
5
|
+
import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseCard.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/AccessibleSelect.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
|
|
6
|
+
import { default as A } from "./packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js";
|
|
7
|
+
import { default as T } from "./packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
|
|
9
|
+
import { default as w } from "./packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js";
|
|
10
|
+
import { default as k } from "./packages/components/lib/UIKit/Tab/BaseTabView.vue.js";
|
|
11
|
+
import { default as v } from "./packages/components/lib/UIKit/Tab/BaseTab.vue.js";
|
|
12
|
+
import { default as G } from "./packages/components/lib/UIKit/Radio/RadioButton.vue.js";
|
|
13
|
+
import { default as O } from "./packages/components/lib/UIKit/Radio/RadioGroup.vue.js";
|
|
14
|
+
import { default as P } from "./packages/components/lib/UIKit/AccessibleSelect.vue.js";
|
|
15
|
+
/* empty css */
|
|
16
|
+
import { default as V } from "./packages/components/lib/UIKit/BaseAlert.vue.js";
|
|
16
17
|
/* empty css */
|
|
17
|
-
import { default as
|
|
18
|
+
import { default as q } from "./packages/components/lib/UIKit/BaseAutocomplete.vue.js";
|
|
18
19
|
/* empty css */
|
|
19
|
-
import { default as
|
|
20
|
+
import { default as z } from "./packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js";
|
|
20
21
|
/* empty css */
|
|
21
|
-
import { default as
|
|
22
|
+
import { default as H } from "./packages/components/lib/UIKit/BaseBadge.vue.js";
|
|
22
23
|
/* empty css */
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
|
|
26
|
-
import { default as X } from "./
|
|
24
|
+
import { default as K } from "./packages/components/lib/UIKit/BaseButton.vue.js";
|
|
25
|
+
import { default as Q } from "./packages/components/lib/UIKit/BaseCard.vue.js";
|
|
26
|
+
/* empty css */
|
|
27
|
+
import { default as X } from "./UIKit/BaseComplexToggle.js";
|
|
28
|
+
import { default as Z } from "./packages/components/lib/UIKit/BaseDropDown.vue.js";
|
|
27
29
|
/* empty css */
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
30
|
+
import { default as $ } from "./UIKit/BaseFloatingLabel.js";
|
|
31
|
+
import { default as ae } from "./UIKit/BaseInput.js";
|
|
32
|
+
import { default as te } from "./packages/components/lib/UIKit/BasePagination.vue.js";
|
|
33
|
+
import { default as fe } from "./UIKit/BaseSlider.js";
|
|
34
|
+
import { default as le } from "./UIKit/BaseTextarea.js";
|
|
35
|
+
import { default as me } from "./UIKit/BaseToggle.js";
|
|
36
|
+
import { default as ue } from "./UIKit/BaseTooltip.js";
|
|
37
|
+
import { default as ie } from "./packages/components/lib/UIKit/BaseUploadFile.vue.js";
|
|
38
|
+
import { default as ne } from "./packages/components/lib/UIKit/BaseModal.vue.js";
|
|
37
39
|
/* empty css */
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
40
|
+
import { default as Se } from "./UIKit/StaticSpinner.js";
|
|
41
|
+
import { default as Ce } from "./UIKit/ShimmerLoader/BaseShimmerLoader.js";
|
|
42
|
+
import { default as Ae } from "./packages/components/lib/UIKit/ShimmerLoader/ShimmerMultiLine.vue.js";
|
|
43
|
+
import { default as Te } from "./packages/components/lib/chart/DoughnutChart.vue.js";
|
|
44
|
+
import { default as we } from "./packages/components/lib/chart/LineChart.vue.js";
|
|
45
|
+
import { default as ke } from "./UIKit/Slider/SimpleSlider.js";
|
|
46
|
+
import { default as ve } from "./packages/components/lib/UIKit/BaseSnackbar.vue.js";
|
|
45
47
|
/* empty css */
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
48
|
+
import { default as Ge } from "./packages/components/lib/components/IntersectionObserver/IntersectionObservable.vue.js";
|
|
49
|
+
import { default as Oe } from "./packages/components/lib/components/IntersectionObserver/IntersectionObserver.vue.js";
|
|
50
|
+
import { default as Pe } from "./components/carousel/SwiperCarousel.js";
|
|
51
|
+
import { default as Ve } from "./components/carousel/SwiperSlide.js";
|
|
52
|
+
import { default as qe } from "./packages/components/lib/UIKit/BaseBreadcrumb.vue.js";
|
|
51
53
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
54
|
+
P as AccessibleSelect,
|
|
55
|
+
i as BaseAccordion,
|
|
56
|
+
n as BaseAccordionBtn,
|
|
57
|
+
S as BaseAccordionContent,
|
|
58
|
+
C as BaseAccordionItem,
|
|
59
|
+
V as BaseAlert,
|
|
60
|
+
q as BaseAutocomplete,
|
|
61
|
+
H as BaseBadge,
|
|
62
|
+
qe as BaseBreadcrumb,
|
|
63
|
+
K as BaseButton,
|
|
64
|
+
Q as BaseCard,
|
|
65
|
+
X as BaseComplexToggle,
|
|
66
|
+
Z as BaseDropDown,
|
|
67
|
+
$ as BaseFloatingLabel,
|
|
68
|
+
ae as BaseInput,
|
|
69
|
+
ne as BaseModal,
|
|
70
|
+
te as BasePagination,
|
|
71
|
+
Ce as BaseShimmerLoader,
|
|
72
|
+
fe as BaseSlider,
|
|
73
|
+
ve as BaseSnackbar,
|
|
74
|
+
v as BaseTab,
|
|
75
|
+
k as BaseTabView,
|
|
76
|
+
le as BaseTextarea,
|
|
77
|
+
me as BaseToggle,
|
|
78
|
+
ue as BaseTooltip,
|
|
79
|
+
ie as BaseUploadFile,
|
|
80
|
+
T as CheckboxBtn,
|
|
81
|
+
w as CheckboxGroup,
|
|
82
|
+
z as ClearableAutocomplete,
|
|
83
|
+
Te as DoughnutChart,
|
|
84
|
+
Ge as IntersectionObservable,
|
|
85
|
+
Oe as IntersectionObserver,
|
|
86
|
+
we as LineChart,
|
|
87
|
+
G as RadioButton,
|
|
88
|
+
O as RadioGroup,
|
|
89
|
+
A as SelectItem,
|
|
90
|
+
Ae as ShimmerMultiLine,
|
|
91
|
+
ke as SimpleSlider,
|
|
92
|
+
Se as StaticSpinner,
|
|
93
|
+
Pe as SwiperCarousel,
|
|
94
|
+
Ve as SwiperSlide
|
|
93
95
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as B, mergeModels as y, useModel as p, useId as F, useTemplateRef as z, computed as C, watch as I, createElementBlock as o, openBlock as l, createVNode as $, createCommentVNode as r, normalizeClass as s, withCtx as x, Fragment as g, renderList as N, withModifiers as f, createElementVNode as u, renderSlot as P, createBlock as A, unref as M } from "vue";
|
|
2
|
+
import { WarningIconRounded as E, ArrowIcon as R } from "@wikicasa-dev/svg-icons";
|
|
3
|
+
import S from "./BaseDropDown.vue.js";
|
|
4
|
+
import '../../../../assets/BaseDropDown.css';/* empty css */
|
|
5
|
+
const q = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" }, K = ["id", "innerHTML"], j = ["onClick"], U = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "onClick", "onKeydown"], W = ["innerHTML"], D = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, G = ["innerHTML"], J = ["id", "aria-selected", "onClick", "onMouseover"], O = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, Q = ["name", "checked", "onInput"], X = ["innerHTML"], Y = ["id", "arial-live", "innerHTML"], Z = ["id", "arial-live", "innerHTML"], le = /* @__PURE__ */ B({
|
|
6
6
|
__name: "AccessibleSelect",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ y({
|
|
8
8
|
label: { default: "" },
|
|
9
9
|
dropdownPosition: { default: "bottom" },
|
|
10
10
|
namespace: {},
|
|
@@ -28,179 +28,173 @@ const j = ["id", "innerHTML"], K = ["id", "data-cy", "aria-required", "aria-cont
|
|
|
28
28
|
default: () => ({ id: "", label: "" })
|
|
29
29
|
},
|
|
30
30
|
modelModifiers: {},
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
open: { type: Boolean, default: !1 },
|
|
32
|
+
openModifiers: {}
|
|
33
33
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
35
|
-
setup(e, { emit:
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
isDropdownOpen: t
|
|
39
|
-
}), w = (i) => {
|
|
40
|
-
t.value = !1, k.value = i;
|
|
34
|
+
emits: /* @__PURE__ */ y(["click", "update:dropdownState"], ["update:modelValue", "update:open"]),
|
|
35
|
+
setup(e, { emit: V }) {
|
|
36
|
+
const T = V, k = p(e, "modelValue"), m = p(e, "open"), L = F(), H = z("dropdownRef"), t = C(() => e.namespace || L), w = C(() => !!k.value.label), h = (i) => {
|
|
37
|
+
m.value = !1, k.value = i;
|
|
41
38
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
innerHTML: e.label
|
|
72
|
-
}, null, 10, j)) : r("", !0),
|
|
73
|
-
i.$slots.lefticon ? (n(), u("span", {
|
|
74
|
-
key: 1,
|
|
75
|
-
class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
|
|
76
|
-
onClick: s[0] || (s[0] = c((d) => t.value = !t.value, ["stop"]))
|
|
77
|
-
}, [
|
|
78
|
-
z(i.$slots, "lefticon")
|
|
79
|
-
])) : r("", !0),
|
|
80
|
-
o("button", {
|
|
81
|
-
id: `${l.value}_btn`,
|
|
82
|
-
ref: "btnEl",
|
|
83
|
-
type: "button",
|
|
84
|
-
"data-cy": e.dataCy,
|
|
85
|
-
class: a(["uikit-peer uikit-relative uikit-z-10 uikit-flex uikit-h-full uikit-w-full uikit-items-center uikit-justify-between uikit-truncate uikit-border-0 uikit-bg-transparent uikit-pr-4 uikit-text-left focus-visible:uikit-outline-0", [i.$slots.lefticon ? "uikit-pl-2" : "uikit-pl-4", e.btnClasses]]),
|
|
86
|
-
"aria-required": !!i.$attrs.required,
|
|
87
|
-
role: "combobox",
|
|
88
|
-
"aria-haspopup": "listbox",
|
|
89
|
-
"aria-controls": `${l.value}_dropdown`,
|
|
90
|
-
"aria-labelledby": `${l.value}_label ${l.value}_btn`,
|
|
91
|
-
"aria-expanded": t.value,
|
|
92
|
-
"aria-activedescendant": b(v) >= 0 && t.value ? `${l.value}_element_${e.options[b(v)].label}` : "",
|
|
93
|
-
"aria-invalid": e.isValid === !1,
|
|
94
|
-
"aria-describedby": e.isValid === !1 ? `${l.value}_invalid_msg` : void 0,
|
|
95
|
-
onClick: s[1] || (s[1] = (d) => {
|
|
96
|
-
t.value = !t.value, y("click", d);
|
|
97
|
-
})
|
|
98
|
-
}, [
|
|
99
|
-
o("span", {
|
|
100
|
-
class: a(["uikit-pointer-events-none uikit-mt-1", e.btnTextClasses]),
|
|
101
|
-
innerHTML: k.value.visibleLabel || k.value.label
|
|
102
|
-
}, null, 10, R),
|
|
103
|
-
o("span", U, [
|
|
104
|
-
e.isValid == !1 ? (n(), A(b(S), {
|
|
39
|
+
return I(
|
|
40
|
+
() => H.value?.selectedIdx,
|
|
41
|
+
(i) => {
|
|
42
|
+
i === void 0 || i === -1 || (h(e.options[i]), m.value = !1);
|
|
43
|
+
}
|
|
44
|
+
), (i, v) => (l(), o("div", null, [
|
|
45
|
+
$(S, {
|
|
46
|
+
ref: "dropdownRef",
|
|
47
|
+
open: m.value,
|
|
48
|
+
"onUpdate:open": v[1] || (v[1] = (d) => m.value = d),
|
|
49
|
+
class: s([e.wrapperClasses]),
|
|
50
|
+
"data-cy": e.dataCy,
|
|
51
|
+
"activate-keyboard-controller": "",
|
|
52
|
+
"close-when-clicked-outside": e.closeOnBodyPressed,
|
|
53
|
+
direction: e.dropdownPosition === "top" ? "up" : "down",
|
|
54
|
+
"dropdown-element": "ul",
|
|
55
|
+
"dropdown-classes": [
|
|
56
|
+
"uikit-select-dropdown uikit-z-30 uikit-mb-0",
|
|
57
|
+
e.dropdownClasses
|
|
58
|
+
],
|
|
59
|
+
"dropdown-attrs": {
|
|
60
|
+
role: "listbox",
|
|
61
|
+
tabindex: -1,
|
|
62
|
+
"aria-multiselectable": !1
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
btn_slot: x(({ toggleDropdown: d, isOpen: b, activeIdx: a, setSelectedIdx: c }) => [
|
|
66
|
+
u("div", q, [
|
|
67
|
+
e.label ? (l(), o("label", {
|
|
105
68
|
key: 0,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
class: a(["uikit-transition-transform motion-reduce:uikit-transition-none", [
|
|
113
|
-
t.value ? "uikit-rotate-180" : "",
|
|
114
|
-
e.arrowIcon?.classes
|
|
69
|
+
id: `${t.value}_label`,
|
|
70
|
+
class: s(["uikit-pointer-events-none uikit-absolute uikit-z-10 uikit-text-sm uikit-font-medium uikit-transition-all uikit-ease-in-out", [
|
|
71
|
+
w.value ? "as-floating -uikit-top-1 uikit-left-[22px] uikit-text-w-black" : "as-inline uikit-top-4 uikit-text-w-gray",
|
|
72
|
+
e.labelClasses,
|
|
73
|
+
{ "uikit-left-9": i.$slots.lefticon && !w.value },
|
|
74
|
+
{ "uikit-left-4": !i.$slots.lefticon && !w.value }
|
|
115
75
|
]]),
|
|
116
|
-
width: e.arrowIcon?.width ?? 18,
|
|
117
|
-
height: e.arrowIcon?.height ?? 18,
|
|
118
|
-
"stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : e.arrowIcon?.strokeColor ?? "#222"
|
|
119
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])
|
|
120
|
-
])
|
|
121
|
-
], 10, K),
|
|
122
|
-
o("fieldset", {
|
|
123
|
-
"aria-hidden": "true",
|
|
124
|
-
class: a(["uikit-pointer-events-none uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-m-0 uikit-box-border uikit-h-12 uikit-cursor-pointer uikit-rounded-xs uikit-bg-white uikit-px-2 uikit-py-0 peer-focus:uikit-border-2", [
|
|
125
|
-
e.fieldsetClasses,
|
|
126
|
-
e.isValid ? "uikit-border-w-primary" : e.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
|
|
127
|
-
{
|
|
128
|
-
"uikit-border uikit-border-solid peer-focus:uikit-border-w-primary peer-focus-visible:uikit-border-2 peer-focus-visible:uikit-border-w-primary peer-aria-invalid:uikit-border-w-danger": e.border
|
|
129
|
-
},
|
|
130
|
-
{ "uikit-border-0 peer-focus:uikit-border-0": !e.border }
|
|
131
|
-
]])
|
|
132
|
-
}, [
|
|
133
|
-
o("legend", {
|
|
134
|
-
class: a([[e.legendClasses, { "uikit-m-0 uikit-w-0": !e.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
|
|
135
|
-
}, [
|
|
136
|
-
e.label ? (n(), u("span", {
|
|
137
|
-
key: 0,
|
|
138
|
-
class: a(["uikit-mx-5px", [k.value.label ? "uikit-invisible" : "uikit-hidden"]]),
|
|
139
76
|
innerHTML: e.label
|
|
140
|
-
}, null, 10,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
77
|
+
}, null, 10, K)) : r("", !0),
|
|
78
|
+
i.$slots.lefticon ? (l(), o("span", {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
|
|
81
|
+
onClick: f((n) => d(), ["stop"])
|
|
82
|
+
}, [
|
|
83
|
+
P(i.$slots, "lefticon")
|
|
84
|
+
], 8, j)) : r("", !0),
|
|
85
|
+
u("button", {
|
|
86
|
+
id: `${t.value}_btn`,
|
|
87
|
+
ref: "btnEl",
|
|
88
|
+
type: "button",
|
|
89
|
+
"data-cy": e.dataCy,
|
|
90
|
+
class: s(["uikit-peer uikit-relative uikit-z-10 uikit-flex uikit-h-full uikit-w-full uikit-items-center uikit-justify-between uikit-truncate uikit-border-0 uikit-bg-transparent uikit-pr-4 uikit-text-left focus-visible:uikit-outline-0", [i.$slots.lefticon ? "uikit-pl-2" : "uikit-pl-4", e.btnClasses]]),
|
|
91
|
+
"aria-required": !!i.$attrs.required,
|
|
92
|
+
role: "combobox",
|
|
93
|
+
"aria-haspopup": "listbox",
|
|
94
|
+
"aria-controls": `${t.value}_dropdown`,
|
|
95
|
+
"aria-labelledby": `${t.value}_label ${t.value}_btn`,
|
|
96
|
+
"aria-expanded": b,
|
|
97
|
+
"aria-activedescendant": a >= 0 && b ? `${t.value}_element_${e.options[a].label}` : "",
|
|
98
|
+
"aria-invalid": e.isValid === !1,
|
|
99
|
+
"aria-describedby": e.isValid === !1 ? `${t.value}_invalid_msg` : void 0,
|
|
100
|
+
onClick: (n) => {
|
|
101
|
+
d(), T("click", n);
|
|
102
|
+
},
|
|
103
|
+
onKeydown: (n) => {
|
|
104
|
+
["Enter", "Space"].includes(n.key) && (n.preventDefault(), n.stopPropagation(), c(a), d());
|
|
105
|
+
}
|
|
106
|
+
}, [
|
|
107
|
+
u("span", {
|
|
108
|
+
class: s(["uikit-pointer-events-none uikit-mt-1", e.btnTextClasses]),
|
|
109
|
+
innerHTML: k.value?.visibleLabel || k.value?.label
|
|
110
|
+
}, null, 10, W),
|
|
111
|
+
u("span", D, [
|
|
112
|
+
e.isValid == !1 ? (l(), A(M(E), {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: "uikit-mr-1",
|
|
115
|
+
width: 20,
|
|
116
|
+
height: 20,
|
|
117
|
+
"stroke-color": "#FA4F64"
|
|
118
|
+
})) : r("", !0),
|
|
119
|
+
$(M(R), {
|
|
120
|
+
class: s(["uikit-transition-transform motion-reduce:uikit-transition-none", [b ? "uikit-rotate-180" : "", e.arrowIcon?.classes]]),
|
|
121
|
+
width: e.arrowIcon?.width ?? 18,
|
|
122
|
+
height: e.arrowIcon?.height ?? 18,
|
|
123
|
+
"stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : e.arrowIcon?.strokeColor ?? "#222"
|
|
124
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])
|
|
125
|
+
])
|
|
126
|
+
], 42, U),
|
|
127
|
+
u("fieldset", {
|
|
128
|
+
"aria-hidden": "true",
|
|
129
|
+
class: s(["uikit-pointer-events-none uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-m-0 uikit-box-border uikit-h-12 uikit-cursor-pointer uikit-rounded-xs uikit-bg-white uikit-px-2 uikit-py-0 peer-focus:uikit-border-2", [
|
|
130
|
+
e.fieldsetClasses,
|
|
131
|
+
e.isValid ? "uikit-border-w-primary" : e.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
|
|
132
|
+
{
|
|
133
|
+
"uikit-border uikit-border-solid peer-focus:uikit-border-w-primary peer-focus-visible:uikit-border-2 peer-focus-visible:uikit-border-w-primary peer-aria-invalid:uikit-border-w-danger": e.border
|
|
134
|
+
},
|
|
135
|
+
{ "uikit-border-0 peer-focus:uikit-border-0": !e.border }
|
|
136
|
+
]])
|
|
137
|
+
}, [
|
|
138
|
+
u("legend", {
|
|
139
|
+
class: s([[e.legendClasses, { "uikit-m-0 uikit-w-0": !e.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
|
|
140
|
+
}, [
|
|
141
|
+
e.label ? (l(), o("span", {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: s(["uikit-mx-5px", [
|
|
144
|
+
k.value.label ? "uikit-invisible" : "uikit-hidden"
|
|
145
|
+
]]),
|
|
146
|
+
innerHTML: e.label
|
|
147
|
+
}, null, 10, G)) : r("", !0)
|
|
148
|
+
], 2)
|
|
149
|
+
], 2)
|
|
150
|
+
])
|
|
151
|
+
]),
|
|
152
|
+
default: x(({ activeIdx: d, setActiveIdx: b }) => [
|
|
153
|
+
(l(!0), o(g, null, N(e.options, (a, c) => (l(), o("li", {
|
|
154
|
+
id: `${t.value}_element_${e.options[c].label}`,
|
|
155
|
+
key: `${a.label}_${c}`,
|
|
163
156
|
role: "option",
|
|
164
|
-
"aria-selected":
|
|
165
|
-
class:
|
|
166
|
-
onClick:
|
|
167
|
-
onMouseover:
|
|
168
|
-
onBlur:
|
|
157
|
+
"aria-selected": d === c,
|
|
158
|
+
class: s(["uikit-m-1 uikit-cursor-pointer uikit-px-20px uikit-py-10px uikit-text aria-selected:uikit-rounded-xs aria-selected:uikit-bg-w-cultured", e.dropdownItemClasses]),
|
|
159
|
+
onClick: f((n) => h(a), ["stop"]),
|
|
160
|
+
onMouseover: f((n) => b(c), ["stop"]),
|
|
161
|
+
onBlur: v[0] || (v[0] = f(() => {
|
|
169
162
|
}, ["stop"]))
|
|
170
163
|
}, [
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
u("label", O, [
|
|
165
|
+
u("input", {
|
|
173
166
|
tabindex: "-1",
|
|
174
167
|
class: "uikit-m-0 uikit-appearance-none",
|
|
175
|
-
name: `${
|
|
168
|
+
name: `${t.value}_radio`,
|
|
176
169
|
type: "radio",
|
|
177
|
-
checked:
|
|
178
|
-
onInput:
|
|
179
|
-
}, null, 40,
|
|
180
|
-
|
|
181
|
-
innerHTML:
|
|
182
|
-
}, null, 8,
|
|
170
|
+
checked: a.label === k.value.label,
|
|
171
|
+
onInput: f((n) => h(a), ["stop"])
|
|
172
|
+
}, null, 40, Q),
|
|
173
|
+
u("span", {
|
|
174
|
+
innerHTML: a.label
|
|
175
|
+
}, null, 8, X)
|
|
183
176
|
])
|
|
184
177
|
], 42, J))), 128))
|
|
185
|
-
],
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
178
|
+
]),
|
|
179
|
+
_: 3
|
|
180
|
+
}, 8, ["open", "class", "data-cy", "close-when-clicked-outside", "direction", "dropdown-classes"]),
|
|
181
|
+
e.feedback ? (l(), o(g, { key: 0 }, [
|
|
182
|
+
e.feedback.valid ? (l(), o("span", {
|
|
189
183
|
key: 0,
|
|
190
|
-
id: `${
|
|
184
|
+
id: `${t.value}_valid_msg`,
|
|
191
185
|
"arial-live": i.$attrs["aria-live"],
|
|
192
186
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12",
|
|
193
187
|
innerHTML: e.isValid ? e.feedback.valid : ""
|
|
194
|
-
}, null, 8,
|
|
195
|
-
e.feedback.invalid ? (
|
|
188
|
+
}, null, 8, Y)) : r("", !0),
|
|
189
|
+
e.feedback.invalid ? (l(), o("span", {
|
|
196
190
|
key: 1,
|
|
197
|
-
id: `${
|
|
191
|
+
id: `${t.value}_invalid_msg`,
|
|
198
192
|
"arial-live": i.$attrs["aria-live"],
|
|
199
193
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12 uikit-text-w-danger",
|
|
200
194
|
innerHTML: e.isValid === !1 ? e.feedback.invalid : ""
|
|
201
|
-
}, null, 8,
|
|
195
|
+
}, null, 8, Z)) : r("", !0)
|
|
202
196
|
], 64)) : r("", !0)
|
|
203
|
-
]
|
|
197
|
+
]));
|
|
204
198
|
}
|
|
205
199
|
});
|
|
206
200
|
export {
|