@wikicasa-dev/components 2.2.9-alpha.26 → 2.2.9-alpha.28
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 +5 -3
- package/dist/UIKit/AccessibleSelect.js +3 -2
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +1 -1
- package/dist/UIKit/BaseDropDown.d.ts +7 -2
- package/dist/assets/AccessibleSelect.css +1 -0
- package/dist/assets/BaseDropDown.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/index.js +84 -83
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +146 -153
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +81 -74
- package/dist/packages/components/lib/UIKit/BaseModal.vue.js +51 -48
- package/package.json +1 -1
- /package/dist/assets/{swiper-thumbs.css → swiper-autoplay.css} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as D, mergeModels as y, useModel as p, useId as F, useTemplateRef as z, computed as C, watch as I, createElementBlock as a, openBlock as l, createVNode as $, createCommentVNode as r, normalizeClass as o, withCtx as x, Fragment as M, renderList as N, withModifiers as f, createElementVNode as n, renderSlot as A, createBlock as E, unref as V } from "vue";
|
|
2
|
+
import { WarningIconRounded as P, ArrowIcon as R } from "@wikicasa-dev/svg-icons";
|
|
3
|
+
import q from "./BaseDropDown.vue.js";
|
|
4
|
+
import '../../../../assets/BaseDropDown.css';/* empty css */
|
|
5
|
+
const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" }, U = ["id", "innerHTML"], j = ["onClick"], G = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "onClick"], W = ["innerHTML"], J = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, K = ["innerHTML"], O = ["id", "aria-selected", "onClick", "onMouseover"], Q = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, X = ["name", "checked", "onInput"], Y = ["innerHTML"], Z = ["id", "arial-live", "innerHTML"], _ = ["id", "arial-live", "innerHTML"], ae = /* @__PURE__ */ D({
|
|
6
6
|
__name: "AccessibleSelect",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ y({
|
|
8
8
|
label: { default: "" },
|
|
9
9
|
dropdownPosition: { default: "bottom" },
|
|
10
10
|
namespace: {},
|
|
@@ -28,181 +28,174 @@ const j = ["id", "innerHTML"], K = ["id", "data-cy", "aria-required", "aria-cont
|
|
|
28
28
|
default: () => ({ id: "", label: "" })
|
|
29
29
|
},
|
|
30
30
|
modelModifiers: {},
|
|
31
|
+
open: { type: Boolean, default: !1 },
|
|
32
|
+
openModifiers: {},
|
|
31
33
|
toggleDropdown: { type: Boolean, default: void 0 },
|
|
32
34
|
toggleDropdownModifiers: {}
|
|
33
35
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
35
|
-
setup(e, { emit:
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
isDropdownOpen: t
|
|
39
|
-
}), w = (i) => {
|
|
40
|
-
t.value = !1, k.value = i;
|
|
36
|
+
emits: /* @__PURE__ */ y(["click", "update:dropdownState"], ["update:modelValue", "update:open", "update:toggleDropdown"]),
|
|
37
|
+
setup(e, { emit: T }) {
|
|
38
|
+
const L = T, k = p(e, "modelValue"), m = p(e, "open"), g = p(e, "toggleDropdown"), B = F(), H = z("dropdownRef"), t = C(() => e.namespace || B), v = C(() => !!k.value.label), w = (i) => {
|
|
39
|
+
m.value = !1, k.value = i, console.log("DEBUG:handleChange", i);
|
|
41
40
|
};
|
|
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), {
|
|
41
|
+
return I(
|
|
42
|
+
() => H.value?.selectedIdx,
|
|
43
|
+
(i) => {
|
|
44
|
+
i === void 0 || i === -1 || (w(e.options[i]), m.value = !1);
|
|
45
|
+
}
|
|
46
|
+
), (i, c) => (l(), a("div", null, [
|
|
47
|
+
$(q, {
|
|
48
|
+
ref: "dropdownRef",
|
|
49
|
+
open: m.value,
|
|
50
|
+
"onUpdate:open": c[1] || (c[1] = (s) => m.value = s),
|
|
51
|
+
"toggle-dropdown": g.value,
|
|
52
|
+
"onUpdate:toggleDropdown": c[2] || (c[2] = (s) => g.value = s),
|
|
53
|
+
class: o([e.wrapperClasses]),
|
|
54
|
+
"close-when-clicked-outside": e.closeOnBodyPressed,
|
|
55
|
+
direction: e.dropdownPosition === "top" ? "up" : "down",
|
|
56
|
+
"dropdown-element": "ul",
|
|
57
|
+
"dropdown-classes": [
|
|
58
|
+
"uikit-select-dropdown uikit-z-30 uikit-mt-[7px] uikit-mb-0",
|
|
59
|
+
e.dropdownClasses
|
|
60
|
+
],
|
|
61
|
+
"dropdown-attrs": {
|
|
62
|
+
role: "listbox",
|
|
63
|
+
tabindex: -1,
|
|
64
|
+
"aria-multiselectable": !1
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
btn_slot: x(({ toggleDropdown: s, isOpen: b, activeIdx: u }) => [
|
|
68
|
+
n("div", S, [
|
|
69
|
+
e.label ? (l(), a("label", {
|
|
105
70
|
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
|
|
71
|
+
id: `${t.value}_label`,
|
|
72
|
+
class: o(["uikit-pointer-events-none uikit-absolute uikit-z-10 uikit-text-sm uikit-font-medium uikit-transition-all uikit-ease-in-out", [
|
|
73
|
+
v.value ? "as-floating -uikit-top-1 uikit-left-[22px] uikit-text-w-black" : "as-inline uikit-top-4 uikit-text-w-gray",
|
|
74
|
+
e.labelClasses,
|
|
75
|
+
{ "uikit-left-9": i.$slots.lefticon && !v.value },
|
|
76
|
+
{ "uikit-left-4": !i.$slots.lefticon && !v.value }
|
|
115
77
|
]]),
|
|
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
78
|
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
|
-
|
|
79
|
+
}, null, 10, U)) : r("", !0),
|
|
80
|
+
i.$slots.lefticon ? (l(), a("span", {
|
|
81
|
+
key: 1,
|
|
82
|
+
class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
|
|
83
|
+
onClick: f((d) => s(), ["stop"])
|
|
84
|
+
}, [
|
|
85
|
+
A(i.$slots, "lefticon")
|
|
86
|
+
], 8, j)) : r("", !0),
|
|
87
|
+
n("button", {
|
|
88
|
+
id: `${t.value}_btn`,
|
|
89
|
+
ref: "btnEl",
|
|
90
|
+
type: "button",
|
|
91
|
+
"data-cy": e.dataCy,
|
|
92
|
+
class: o(["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]]),
|
|
93
|
+
"aria-required": !!i.$attrs.required,
|
|
94
|
+
role: "combobox",
|
|
95
|
+
"aria-haspopup": "listbox",
|
|
96
|
+
"aria-controls": `${t.value}_dropdown`,
|
|
97
|
+
"aria-labelledby": `${t.value}_label ${t.value}_btn`,
|
|
98
|
+
"aria-expanded": b,
|
|
99
|
+
"aria-activedescendant": u >= 0 && b ? `${t.value}_element_${e.options[u].label}` : "",
|
|
100
|
+
"aria-invalid": e.isValid === !1,
|
|
101
|
+
"aria-describedby": e.isValid === !1 ? `${t.value}_invalid_msg` : void 0,
|
|
102
|
+
onClick: (d) => {
|
|
103
|
+
s(), L("click", d);
|
|
104
|
+
}
|
|
105
|
+
}, [
|
|
106
|
+
n("span", {
|
|
107
|
+
class: o(["uikit-pointer-events-none uikit-mt-1", e.btnTextClasses]),
|
|
108
|
+
innerHTML: k.value?.visibleLabel || k.value?.label
|
|
109
|
+
}, null, 10, W),
|
|
110
|
+
n("span", J, [
|
|
111
|
+
e.isValid == !1 ? (l(), E(V(P), {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "uikit-mr-1",
|
|
114
|
+
width: 20,
|
|
115
|
+
height: 20,
|
|
116
|
+
"stroke-color": "#FA4F64"
|
|
117
|
+
})) : r("", !0),
|
|
118
|
+
$(V(R), {
|
|
119
|
+
class: o(["uikit-transition-transform motion-reduce:uikit-transition-none", [b ? "uikit-rotate-180" : "", e.arrowIcon?.classes]]),
|
|
120
|
+
width: e.arrowIcon?.width ?? 18,
|
|
121
|
+
height: e.arrowIcon?.height ?? 18,
|
|
122
|
+
"stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : e.arrowIcon?.strokeColor ?? "#222"
|
|
123
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])
|
|
124
|
+
])
|
|
125
|
+
], 10, G),
|
|
126
|
+
n("fieldset", {
|
|
127
|
+
"aria-hidden": "true",
|
|
128
|
+
class: o(["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", [
|
|
129
|
+
e.fieldsetClasses,
|
|
130
|
+
e.isValid ? "uikit-border-w-primary" : e.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
|
|
131
|
+
{
|
|
132
|
+
"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
|
|
133
|
+
},
|
|
134
|
+
{ "uikit-border-0 peer-focus:uikit-border-0": !e.border }
|
|
135
|
+
]])
|
|
136
|
+
}, [
|
|
137
|
+
n("legend", {
|
|
138
|
+
class: o([[e.legendClasses, { "uikit-m-0 uikit-w-0": !e.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
|
|
139
|
+
}, [
|
|
140
|
+
e.label ? (l(), a("span", {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: o(["uikit-mx-5px", [
|
|
143
|
+
k.value.label ? "uikit-invisible" : "uikit-hidden"
|
|
144
|
+
]]),
|
|
145
|
+
innerHTML: e.label
|
|
146
|
+
}, null, 10, K)) : r("", !0)
|
|
147
|
+
], 2)
|
|
148
|
+
], 2)
|
|
149
|
+
])
|
|
150
|
+
]),
|
|
151
|
+
default: x(({ activeIdx: s, setActiveIdx: b }) => [
|
|
152
|
+
(l(!0), a(M, null, N(e.options, (u, d) => (l(), a("li", {
|
|
153
|
+
id: `${t.value}_element_${e.options[d].label}`,
|
|
154
|
+
key: `${u.label}_${d}`,
|
|
163
155
|
role: "option",
|
|
164
|
-
"aria-selected":
|
|
165
|
-
class:
|
|
166
|
-
onClick:
|
|
167
|
-
onMouseover:
|
|
168
|
-
onBlur:
|
|
156
|
+
"aria-selected": s === d,
|
|
157
|
+
class: o(["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]),
|
|
158
|
+
onClick: f((h) => w(u), ["stop"]),
|
|
159
|
+
onMouseover: f((h) => b(d), ["stop"]),
|
|
160
|
+
onBlur: c[0] || (c[0] = f(() => {
|
|
169
161
|
}, ["stop"]))
|
|
170
162
|
}, [
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
n("label", Q, [
|
|
164
|
+
n("input", {
|
|
173
165
|
tabindex: "-1",
|
|
174
166
|
class: "uikit-m-0 uikit-appearance-none",
|
|
175
|
-
name: `${
|
|
167
|
+
name: `${t.value}_radio`,
|
|
176
168
|
type: "radio",
|
|
177
|
-
checked:
|
|
178
|
-
onInput:
|
|
169
|
+
checked: u.label === k.value.label,
|
|
170
|
+
onInput: f((h) => w(u), ["stop"])
|
|
179
171
|
}, null, 40, X),
|
|
180
|
-
|
|
181
|
-
innerHTML:
|
|
172
|
+
n("span", {
|
|
173
|
+
innerHTML: u.label
|
|
182
174
|
}, null, 8, Y)
|
|
183
175
|
])
|
|
184
|
-
], 42,
|
|
185
|
-
],
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
176
|
+
], 42, O))), 128))
|
|
177
|
+
]),
|
|
178
|
+
_: 3
|
|
179
|
+
}, 8, ["open", "toggle-dropdown", "class", "close-when-clicked-outside", "direction", "dropdown-classes"]),
|
|
180
|
+
e.feedback ? (l(), a(M, { key: 0 }, [
|
|
181
|
+
e.feedback.valid ? (l(), a("span", {
|
|
189
182
|
key: 0,
|
|
190
|
-
id: `${
|
|
183
|
+
id: `${t.value}_valid_msg`,
|
|
191
184
|
"arial-live": i.$attrs["aria-live"],
|
|
192
185
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12",
|
|
193
186
|
innerHTML: e.isValid ? e.feedback.valid : ""
|
|
194
187
|
}, null, 8, Z)) : r("", !0),
|
|
195
|
-
e.feedback.invalid ? (
|
|
188
|
+
e.feedback.invalid ? (l(), a("span", {
|
|
196
189
|
key: 1,
|
|
197
|
-
id: `${
|
|
190
|
+
id: `${t.value}_invalid_msg`,
|
|
198
191
|
"arial-live": i.$attrs["aria-live"],
|
|
199
192
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12 uikit-text-w-danger",
|
|
200
193
|
innerHTML: e.isValid === !1 ? e.feedback.invalid : ""
|
|
201
194
|
}, null, 8, _)) : r("", !0)
|
|
202
195
|
], 64)) : r("", !0)
|
|
203
|
-
]
|
|
196
|
+
]));
|
|
204
197
|
}
|
|
205
198
|
});
|
|
206
199
|
export {
|
|
207
|
-
|
|
200
|
+
ae as default
|
|
208
201
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ArrowIcon as
|
|
4
|
-
import { useKeyboardController as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as T, mergeModels as B, useId as N, useModel as v, shallowRef as R, computed as U, useTemplateRef as I, onMounted as V, onUnmounted as z, watch as l, nextTick as F, createElementBlock as G, openBlock as k, normalizeClass as s, renderSlot as K, createBlock as x, unref as a, createVNode as q, withCtx as A, createElementVNode as P, createCommentVNode as j, resolveDynamicComponent as J, mergeProps as Q } from "vue";
|
|
2
|
+
import X from "./BaseButton.vue.js";
|
|
3
|
+
import { ArrowIcon as Y } from "@wikicasa-dev/svg-icons";
|
|
4
|
+
import { useKeyboardController as Z } from "@wikicasa-dev/vue-composables";
|
|
5
|
+
const _ = ["innerHTML"], ae = /* @__PURE__ */ T({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "BaseDropDown",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ B({
|
|
9
|
+
dropdownAttrs: {},
|
|
9
10
|
dropdownClasses: { default: "" },
|
|
10
11
|
btnClasses: { default: "" },
|
|
11
12
|
withArrowIcon: { type: Boolean, default: !1 },
|
|
@@ -26,44 +27,49 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
|
|
|
26
27
|
toggleDropdown: { type: Boolean, default: void 0 },
|
|
27
28
|
toggleDropdownModifiers: {},
|
|
28
29
|
resetKeyboardController: { type: Boolean, default: !1 },
|
|
29
|
-
resetKeyboardControllerModifiers: {}
|
|
30
|
+
resetKeyboardControllerModifiers: {},
|
|
31
|
+
open: { type: Boolean, default: !1 },
|
|
32
|
+
openModifiers: {}
|
|
30
33
|
}),
|
|
31
|
-
emits: /* @__PURE__ */
|
|
32
|
-
setup(t, { expose:
|
|
33
|
-
const n = t,
|
|
34
|
+
emits: /* @__PURE__ */ B(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController", "update:open"]),
|
|
35
|
+
setup(t, { expose: L, emit: S }) {
|
|
36
|
+
const n = t, m = N(), w = S, p = v(t, "toggleDropdown"), y = v(
|
|
34
37
|
t,
|
|
35
38
|
"resetKeyboardController"
|
|
36
|
-
);
|
|
37
|
-
let
|
|
38
|
-
const
|
|
39
|
-
optionsLength:
|
|
39
|
+
), o = v(t, "open");
|
|
40
|
+
let g = !1;
|
|
41
|
+
const u = R([]), M = U(() => u.value.length), d = I("container"), c = I("dropdown"), { activeIdx: i, selectedIdx: r, onKeyDownHandler: O } = Z({
|
|
42
|
+
optionsLength: M,
|
|
40
43
|
isDropdownOpen: o,
|
|
41
44
|
global: !1,
|
|
42
45
|
closeKeys: n.closeKeys ? n.closeKeys : []
|
|
43
|
-
}),
|
|
44
|
-
o.value = !1
|
|
46
|
+
}), h = () => {
|
|
47
|
+
o.value = !1;
|
|
45
48
|
}, C = ({ target: e }) => {
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
d.value?.contains(e) || h();
|
|
50
|
+
}, b = (e) => {
|
|
51
|
+
console.log("DEBUG:handleDocumentFocusIn", {
|
|
52
|
+
container: d.value,
|
|
53
|
+
target: e.target
|
|
54
|
+
}), o.value && (d.value?.contains(e.target) || h());
|
|
55
|
+
}, W = (e) => {
|
|
56
|
+
n.activateKeyboardController && O(e);
|
|
51
57
|
}, f = () => {
|
|
52
58
|
n.keepState === "closed" && !o.value || n.keepState === "opened" && o.value || (o.value = !o.value);
|
|
59
|
+
}, $ = (e) => {
|
|
60
|
+
e != null && (i.value = e);
|
|
53
61
|
}, H = (e) => {
|
|
54
|
-
e != null && (
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
}, g = () => {
|
|
58
|
-
c.value && (s.value = Array.from(c.value.children));
|
|
62
|
+
e != null && (r.value = e);
|
|
63
|
+
}, D = () => {
|
|
64
|
+
c.value && (u.value = Array.from(c.value.children));
|
|
59
65
|
};
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
}),
|
|
63
|
-
n.closeWhenClickedOutside && (document.removeEventListener("click", C), document.removeEventListener("focusin",
|
|
64
|
-
}), l(
|
|
65
|
-
e && (
|
|
66
|
-
|
|
66
|
+
return V(() => {
|
|
67
|
+
D();
|
|
68
|
+
}), z(() => {
|
|
69
|
+
n.closeWhenClickedOutside && (document.removeEventListener("click", C), document.removeEventListener("focusin", b));
|
|
70
|
+
}), l(y, (e) => {
|
|
71
|
+
e && (i.value = -1, r.value = -1, F(() => {
|
|
72
|
+
D(), y.value = !1;
|
|
67
73
|
}));
|
|
68
74
|
}), l(
|
|
69
75
|
() => n.openDropdown,
|
|
@@ -76,83 +82,84 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
|
|
|
76
82
|
), l(o, (e) => {
|
|
77
83
|
w("update:dropdownState", e);
|
|
78
84
|
}), l(o, (e) => {
|
|
79
|
-
!e ||
|
|
80
|
-
}), l(
|
|
81
|
-
e && (o.value = !o.value,
|
|
82
|
-
}), l(
|
|
83
|
-
e !== -1 &&
|
|
84
|
-
}),
|
|
85
|
-
activeIdx:
|
|
86
|
-
selectedIdx:
|
|
87
|
-
getRootElement: () =>
|
|
85
|
+
!e || g || !n.closeWhenClickedOutside || (console.log("DEBUG: registering global events"), document.addEventListener("click", C), document.addEventListener("focusin", b), g = !0);
|
|
86
|
+
}), l(p, (e) => {
|
|
87
|
+
e && (o.value = !o.value, p.value = !1);
|
|
88
|
+
}), l(r, (e) => {
|
|
89
|
+
e !== -1 && u.value[e]?.querySelector("a")?.click();
|
|
90
|
+
}), L({
|
|
91
|
+
activeIdx: i,
|
|
92
|
+
selectedIdx: r,
|
|
93
|
+
getRootElement: () => d.value,
|
|
88
94
|
getContentElement: () => c.value
|
|
89
|
-
}), (e,
|
|
95
|
+
}), (e, E) => (k(), G("div", {
|
|
90
96
|
ref: "container",
|
|
91
|
-
class:
|
|
92
|
-
onKeydown:
|
|
97
|
+
class: s(["uikit-relative uikit-block", e.$attrs.class]),
|
|
98
|
+
onKeydown: W
|
|
93
99
|
}, [
|
|
94
|
-
|
|
100
|
+
K(e.$slots, "btn_slot", {
|
|
95
101
|
toggleDropdown: f,
|
|
96
|
-
isOpen: o.value
|
|
102
|
+
isOpen: o.value,
|
|
103
|
+
activeIdx: a(i)
|
|
97
104
|
}, () => [
|
|
98
|
-
|
|
99
|
-
id:
|
|
105
|
+
q(X, {
|
|
106
|
+
id: a(m),
|
|
100
107
|
type: "button",
|
|
101
108
|
"data-cy": t.dataCy,
|
|
102
|
-
class:
|
|
109
|
+
class: s([
|
|
103
110
|
"!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
|
|
104
111
|
t.btnClasses
|
|
105
112
|
]),
|
|
106
113
|
"aria-expanded": o.value,
|
|
107
114
|
"btn-class": "uikit-btn-single-selection",
|
|
108
|
-
onClick:
|
|
115
|
+
onClick: E[0] || (E[0] = (ee) => {
|
|
109
116
|
w("click"), f();
|
|
110
117
|
})
|
|
111
118
|
}, {
|
|
112
|
-
default:
|
|
113
|
-
|
|
114
|
-
class:
|
|
119
|
+
default: A(() => [
|
|
120
|
+
P("span", {
|
|
121
|
+
class: s(["uikit-mr-5px", t.labelClasses]),
|
|
115
122
|
innerHTML: t.btnLabel
|
|
116
|
-
}, null, 10,
|
|
117
|
-
t.withArrowIcon ? (k(),
|
|
123
|
+
}, null, 10, _),
|
|
124
|
+
t.withArrowIcon ? (k(), x(a(Y), {
|
|
118
125
|
key: 0,
|
|
119
|
-
class:
|
|
126
|
+
class: s(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", o.value ? "uikit-rotate-180" : ""]),
|
|
120
127
|
width: t.arrowWidth,
|
|
121
128
|
height: t.arrowWidth,
|
|
122
129
|
"stroke-color": t.arrowStrokeColor
|
|
123
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])) :
|
|
130
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])) : j("", !0)
|
|
124
131
|
]),
|
|
125
132
|
_: 1
|
|
126
133
|
}, 8, ["id", "data-cy", "class", "aria-expanded"])
|
|
127
134
|
]),
|
|
128
|
-
(k(),
|
|
129
|
-
id: "dropdown_" +
|
|
135
|
+
(k(), x(J(t.dropdownElement), Q({
|
|
136
|
+
id: "dropdown_" + a(m),
|
|
130
137
|
ref: "dropdown",
|
|
131
138
|
"data-cy": t.dataCy && `${t.dataCy}_dropdown`,
|
|
132
|
-
class:
|
|
139
|
+
class: ["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
|
|
133
140
|
t.dropdownClasses,
|
|
134
141
|
o.value ? "uikit-flex" : "uikit-hidden",
|
|
135
|
-
{ "uikit-bottom-[55px]
|
|
136
|
-
{ "uikit-rounded-b uikit-border-t-0": t.direction === "down" },
|
|
142
|
+
{ "uikit-bottom-[55px]": t.direction === "up" },
|
|
137
143
|
{ "uikit-absolute": t.isAbsolute }
|
|
138
|
-
]]
|
|
139
|
-
"aria-hidden": !o.value
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
]],
|
|
145
|
+
"aria-hidden": !o.value,
|
|
146
|
+
"data-side": t.direction
|
|
147
|
+
}, t.dropdownAttrs), {
|
|
148
|
+
default: A(() => [
|
|
149
|
+
K(e.$slots, "default", {
|
|
143
150
|
isOpen: o.value,
|
|
144
151
|
toggleDropdown: f,
|
|
145
|
-
activeIdx:
|
|
146
|
-
selectedIdx: r
|
|
147
|
-
setActiveIdx:
|
|
148
|
-
setSelectedIdx:
|
|
152
|
+
activeIdx: a(i),
|
|
153
|
+
selectedIdx: a(r),
|
|
154
|
+
setActiveIdx: $,
|
|
155
|
+
setSelectedIdx: H
|
|
149
156
|
})
|
|
150
157
|
]),
|
|
151
158
|
_: 3
|
|
152
|
-
},
|
|
159
|
+
}, 16, ["id", "data-cy", "class", "aria-hidden", "data-side"]))
|
|
153
160
|
], 34));
|
|
154
161
|
}
|
|
155
162
|
});
|
|
156
163
|
export {
|
|
157
|
-
|
|
164
|
+
ae as default
|
|
158
165
|
};
|