@wikicasa-dev/components 1.3.4 → 1.3.6
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/AccessibleSelect.js +1 -1
- package/dist/BaseAutocomplete.js +1 -1
- package/dist/UIKit/AccessibleSelect.vue.d.ts +11 -0
- package/dist/UIKit/BaseAutocomplete.vue.d.ts +9 -0
- package/dist/chunks/{AccessibleSelect.vue_vue_type_script_setup_true_lang.lyHlWiC5.js → AccessibleSelect.vue_vue_type_script_setup_true_lang.DB7G0w8N.js} +41 -40
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.CnyHYNUi.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.D5NYtmuS.js} +35 -33
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/AccessibleSelect.js
CHANGED
package/dist/BaseAutocomplete.js
CHANGED
|
@@ -10,6 +10,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
10
10
|
valid: string;
|
|
11
11
|
invalid: string;
|
|
12
12
|
}> | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* If true, we will close the dropdown when we touch the body of the document
|
|
15
|
+
*/
|
|
16
|
+
closeOnBodyPressed?: boolean | undefined;
|
|
13
17
|
}>, {
|
|
14
18
|
modelValue: () => {
|
|
15
19
|
id: string;
|
|
@@ -18,6 +22,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
18
22
|
label: string;
|
|
19
23
|
dropdownPosition: string;
|
|
20
24
|
isValid: null;
|
|
25
|
+
closeOnBodyPressed: boolean;
|
|
21
26
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
27
|
"update:modelValue": (args_0: AccessibleSelectOptions) => void;
|
|
23
28
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -31,6 +36,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
31
36
|
valid: string;
|
|
32
37
|
invalid: string;
|
|
33
38
|
}> | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* If true, we will close the dropdown when we touch the body of the document
|
|
41
|
+
*/
|
|
42
|
+
closeOnBodyPressed?: boolean | undefined;
|
|
34
43
|
}>, {
|
|
35
44
|
modelValue: () => {
|
|
36
45
|
id: string;
|
|
@@ -39,6 +48,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
39
48
|
label: string;
|
|
40
49
|
dropdownPosition: string;
|
|
41
50
|
isValid: null;
|
|
51
|
+
closeOnBodyPressed: boolean;
|
|
42
52
|
}>>> & {
|
|
43
53
|
"onUpdate:modelValue"?: ((args_0: AccessibleSelectOptions) => any) | undefined;
|
|
44
54
|
}, {
|
|
@@ -46,6 +56,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
46
56
|
isValid: boolean | null;
|
|
47
57
|
modelValue: AccessibleSelectOptions;
|
|
48
58
|
dropdownPosition: "top" | "bottom";
|
|
59
|
+
closeOnBodyPressed: boolean;
|
|
49
60
|
}, {}>, {
|
|
50
61
|
lefticon?(_: {}): any;
|
|
51
62
|
}>;
|
|
@@ -42,6 +42,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
42
42
|
type: import("vue").PropType<boolean>;
|
|
43
43
|
default: boolean;
|
|
44
44
|
};
|
|
45
|
+
closeDropdownOnBodyPressed: {
|
|
46
|
+
type: import("vue").PropType<boolean>;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
45
49
|
}, {
|
|
46
50
|
select: () => void;
|
|
47
51
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -91,6 +95,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
91
95
|
type: import("vue").PropType<boolean>;
|
|
92
96
|
default: boolean;
|
|
93
97
|
};
|
|
98
|
+
closeDropdownOnBodyPressed: {
|
|
99
|
+
type: import("vue").PropType<boolean>;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
94
102
|
}>> & {
|
|
95
103
|
onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
96
104
|
onClick?: (() => any) | undefined;
|
|
@@ -106,6 +114,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
106
114
|
disableCb: boolean;
|
|
107
115
|
onOptionSelectedCb: Nullable<(v: AccessibleSelectOptions) => void>;
|
|
108
116
|
cleanupOnClose: boolean;
|
|
117
|
+
closeDropdownOnBodyPressed: boolean;
|
|
109
118
|
}, {}>, {
|
|
110
119
|
lefticon?(_: {}): any;
|
|
111
120
|
righticon?(_: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h as V, ref as L, onMounted as E, onUnmounted as T, unref as v, defineComponent as
|
|
2
|
-
import { d as
|
|
3
|
-
import { o as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const { width: a, height: i } =
|
|
1
|
+
import { h as V, ref as L, onMounted as E, onUnmounted as T, unref as v, defineComponent as B, computed as C, watch as F, openBlock as u, createElementBlock as d, Fragment as H, createElementVNode as l, normalizeClass as o, createCommentVNode as m, renderSlot as P, withModifiers as w, createBlock as A, createVNode as D, renderList as O } from "vue";
|
|
2
|
+
import { d as q } from "./ArrowIcon.CklBXJPN.js";
|
|
3
|
+
import { o as z } from "./DefaultValues-k7iQWtC2.CPFgoBrE.js";
|
|
4
|
+
const N = (s, { attrs: n }) => {
|
|
5
|
+
s = { ...z(), ...s };
|
|
6
|
+
const { width: a, height: i } = s;
|
|
7
7
|
return V(
|
|
8
8
|
"svg",
|
|
9
9
|
{
|
|
@@ -11,10 +11,10 @@ const S = (o, { attrs: s }) => {
|
|
|
11
11
|
viewBox: "0 0 11.175 13.409",
|
|
12
12
|
width: `${a}`,
|
|
13
13
|
height: `${i}`,
|
|
14
|
-
class:
|
|
15
|
-
"aria-hidden":
|
|
14
|
+
class: s.class ?? "",
|
|
15
|
+
"aria-hidden": n["aria-hidden"] ?? "true",
|
|
16
16
|
fill: "none",
|
|
17
|
-
stroke:
|
|
17
|
+
stroke: n["stroke-color"] ?? "#FA4F64"
|
|
18
18
|
},
|
|
19
19
|
[
|
|
20
20
|
V("circle", {
|
|
@@ -30,15 +30,15 @@ const S = (o, { attrs: s }) => {
|
|
|
30
30
|
cx: 6,
|
|
31
31
|
cy: 8.2,
|
|
32
32
|
r: 0.6,
|
|
33
|
-
fill:
|
|
33
|
+
fill: n["stroke-color"] ?? "#FA4F64",
|
|
34
34
|
stroke: "none"
|
|
35
35
|
})
|
|
36
36
|
]
|
|
37
37
|
);
|
|
38
|
-
},
|
|
39
|
-
const { isDropdownOpen:
|
|
38
|
+
}, S = (s) => {
|
|
39
|
+
const { isDropdownOpen: n, disableSpaceHandler: a } = s, i = L(-1), f = L(-1), $ = (t) => {
|
|
40
40
|
const k = "ArrowUp", g = "ArrowDown", b = "Enter", h = "Escape", e = " ", p = "PageUp", r = "Home", c = "PageDown", y = "End";
|
|
41
|
-
if (!
|
|
41
|
+
if (!n.value || ![
|
|
42
42
|
k,
|
|
43
43
|
g,
|
|
44
44
|
b,
|
|
@@ -50,7 +50,7 @@ const S = (o, { attrs: s }) => {
|
|
|
50
50
|
y
|
|
51
51
|
].includes(t.key))
|
|
52
52
|
return;
|
|
53
|
-
const M = v(
|
|
53
|
+
const M = v(s.optionsLength);
|
|
54
54
|
if (t.key === k)
|
|
55
55
|
i.value = i.value === 0 ? M - 1 : i.value - 1;
|
|
56
56
|
else if (t.key === g)
|
|
@@ -58,9 +58,9 @@ const S = (o, { attrs: s }) => {
|
|
|
58
58
|
else if (t.key === b || t.key === e) {
|
|
59
59
|
if (t.key === e && a)
|
|
60
60
|
return;
|
|
61
|
-
f.value = i.value,
|
|
61
|
+
f.value = i.value, n.value = !1;
|
|
62
62
|
} else
|
|
63
|
-
t.key === h ? (i.value = f.value,
|
|
63
|
+
t.key === h ? (i.value = f.value, n.value = !1) : t.key === p || t.key === r ? i.value = 0 : (t.key === c || t.key === y) && (i.value = M - 1);
|
|
64
64
|
t.stopPropagation(), t.preventDefault();
|
|
65
65
|
};
|
|
66
66
|
return E(() => {
|
|
@@ -71,7 +71,7 @@ const S = (o, { attrs: s }) => {
|
|
|
71
71
|
activeIdx: i,
|
|
72
72
|
selectedIdx: f
|
|
73
73
|
};
|
|
74
|
-
},
|
|
74
|
+
}, U = ["id", "innerHTML"], j = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby"], I = ["innerHTML"], Y = { class: "uikit-inline-flex" }, G = ["innerHTML"], J = ["data-cy"], K = ["id", "aria-selected", "onClick", "onMouseover"], Q = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, R = ["name", "checked", "onInput"], W = ["innerHTML"], X = ["id", "arial-live", "innerHTML"], Z = ["id", "arial-live", "innerHTML"], ie = /* @__PURE__ */ B({
|
|
75
75
|
inheritAttrs: !1,
|
|
76
76
|
__name: "AccessibleSelect",
|
|
77
77
|
props: {
|
|
@@ -84,47 +84,48 @@ const S = (o, { attrs: s }) => {
|
|
|
84
84
|
label: ""
|
|
85
85
|
}) },
|
|
86
86
|
isValid: { type: [Boolean, null], default: null },
|
|
87
|
-
feedback: {}
|
|
87
|
+
feedback: {},
|
|
88
|
+
closeOnBodyPressed: { type: Boolean, default: !0 }
|
|
88
89
|
},
|
|
89
90
|
emits: ["update:modelValue"],
|
|
90
|
-
setup(
|
|
91
|
-
const a =
|
|
91
|
+
setup(s, { emit: n }) {
|
|
92
|
+
const a = s, i = L(!1), f = L(null), $ = C(() => !!a.modelValue.label), t = n, { activeIdx: k, selectedIdx: g } = S({
|
|
92
93
|
optionsLength: a.options.length,
|
|
93
94
|
isDropdownOpen: i
|
|
94
95
|
}), b = (e) => {
|
|
95
96
|
i.value = !1, t("update:modelValue", e);
|
|
96
97
|
};
|
|
97
|
-
|
|
98
|
+
F(g, (e) => {
|
|
98
99
|
b(a.options[e]), i.value = !1;
|
|
99
100
|
});
|
|
100
101
|
const h = () => {
|
|
101
102
|
i.value = !1;
|
|
102
103
|
};
|
|
103
104
|
return E(() => {
|
|
104
|
-
document && document.addEventListener("click", h);
|
|
105
|
+
a.closeOnBodyPressed && document && document.addEventListener("click", h);
|
|
105
106
|
}), T(() => {
|
|
106
|
-
document && document.removeEventListener("click", h);
|
|
107
|
+
a.closeOnBodyPressed && document && document.removeEventListener("click", h);
|
|
107
108
|
}), (e, p) => (u(), d(H, null, [
|
|
108
109
|
l("div", {
|
|
109
|
-
class:
|
|
110
|
+
class: o(["uikit-relative uikit-flex uikit-items-center", [e.label ? "uikit-h-[52px]" : "uikit-h-[42px]", e.$attrs.class]])
|
|
110
111
|
}, [
|
|
111
112
|
e.label ? (u(), d("label", {
|
|
112
113
|
key: 0,
|
|
113
114
|
id: `${e.namespace}_label`,
|
|
114
|
-
class:
|
|
115
|
+
class: o(["uikit-absolute uikit-text-sm uikit-font-medium uikit-transition-all uikit-ease-in-out", [
|
|
115
116
|
$.value ? "as-floating -uikit-top-1 uikit-left-[22px] uikit-text-w-black" : "as-inline uikit-left-4 uikit-top-4 uikit-text-w-gray",
|
|
116
117
|
e.$attrs["label-classes"]
|
|
117
118
|
]]),
|
|
118
119
|
innerHTML: e.label
|
|
119
|
-
}, null, 10,
|
|
120
|
-
|
|
120
|
+
}, null, 10, U)) : m("", !0),
|
|
121
|
+
P(e.$slots, "lefticon"),
|
|
121
122
|
l("button", {
|
|
122
123
|
id: `${e.namespace}_btn`,
|
|
123
124
|
ref_key: "btnEl",
|
|
124
125
|
ref: f,
|
|
125
126
|
type: "button",
|
|
126
127
|
"data-cy": e.$attrs["data-cy"],
|
|
127
|
-
class:
|
|
128
|
+
class: o(["uikit-peer uikit-flex uikit-h-full uikit-w-full uikit-items-center uikit-justify-between uikit-truncate uikit-border-0 uikit-bg-white uikit-px-4 uikit-text-left focus-visible:uikit-outline-0", e.$attrs["btn-classes"]]),
|
|
128
129
|
"aria-required": !!e.$attrs.required,
|
|
129
130
|
role: "combobox",
|
|
130
131
|
"aria-haspopup": "listbox",
|
|
@@ -137,27 +138,27 @@ const S = (o, { attrs: s }) => {
|
|
|
137
138
|
onClick: p[0] || (p[0] = w((r) => i.value = !i.value, ["stop"]))
|
|
138
139
|
}, [
|
|
139
140
|
l("span", {
|
|
140
|
-
class:
|
|
141
|
+
class: o(e.$attrs["btn-text-classes"]),
|
|
141
142
|
innerHTML: e.modelValue.visibleLabel || e.modelValue.label
|
|
142
|
-
}, null, 10,
|
|
143
|
+
}, null, 10, I),
|
|
143
144
|
l("span", Y, [
|
|
144
|
-
a.isValid == !1 ? (u(),
|
|
145
|
+
a.isValid == !1 ? (u(), A(v(N), {
|
|
145
146
|
key: 0,
|
|
146
147
|
class: "uikit-mr-1",
|
|
147
148
|
width: 20,
|
|
148
149
|
height: 20
|
|
149
150
|
})) : m("", !0),
|
|
150
|
-
|
|
151
|
-
class:
|
|
151
|
+
D(v(q), {
|
|
152
|
+
class: o(["uikit-transition-transform motion-reduce:uikit-transition-none", i.value && "uikit-rotate-180"]),
|
|
152
153
|
width: 18,
|
|
153
154
|
height: 18,
|
|
154
155
|
"stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : "#222"
|
|
155
156
|
}, null, 8, ["class", "stroke-color"])
|
|
156
157
|
])
|
|
157
|
-
], 10,
|
|
158
|
+
], 10, j),
|
|
158
159
|
l("fieldset", {
|
|
159
160
|
"aria-hidden": "true",
|
|
160
|
-
class:
|
|
161
|
+
class: o(["uikit-pointer-events-none uikit-absolute -uikit-top-[1px] uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-box-border uikit-cursor-pointer uikit-rounded-xs uikit-border uikit-border-solid uikit-px-2 peer-focus:uikit-border-2 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", [
|
|
161
162
|
e.label ? "uikit-h-12" : "uikit-h-[42px]",
|
|
162
163
|
e.$attrs["fieldset-classes"],
|
|
163
164
|
e.isValid ? "uikit-border-w-primary" : e.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary"
|
|
@@ -165,10 +166,10 @@ const S = (o, { attrs: s }) => {
|
|
|
165
166
|
}, [
|
|
166
167
|
e.label ? (u(), d("legend", {
|
|
167
168
|
key: 0,
|
|
168
|
-
class:
|
|
169
|
+
class: o([e.$attrs["legend-classes"], "uikit-ml-2 uikit-h-3 uikit-px-0"])
|
|
169
170
|
}, [
|
|
170
171
|
l("span", {
|
|
171
|
-
class:
|
|
172
|
+
class: o(["uikit-mx-5px", e.modelValue.label ? "uikit-invisible" : "uikit-hidden"]),
|
|
172
173
|
innerHTML: e.label
|
|
173
174
|
}, null, 10, G)
|
|
174
175
|
], 2)) : m("", !0)
|
|
@@ -178,7 +179,7 @@ const S = (o, { attrs: s }) => {
|
|
|
178
179
|
role: "listbox",
|
|
179
180
|
tabindex: -1,
|
|
180
181
|
"aria-multiselectable": !1,
|
|
181
|
-
class:
|
|
182
|
+
class: o(["uikit-absolute uikit-z-10 uikit-m-0 uikit-max-h-[225px] uikit-w-full uikit-min-w-full uikit-list-none uikit-overflow-y-auto uikit-p-0 uikit-no-scrollbar", [
|
|
182
183
|
{ "uikit-h-0 uikit-w-0 uikit-overflow-hidden": !i.value },
|
|
183
184
|
{
|
|
184
185
|
"uikit-rounded-xs uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white": i.value
|
|
@@ -190,12 +191,12 @@ const S = (o, { attrs: s }) => {
|
|
|
190
191
|
onClick: p[1] || (p[1] = w(() => {
|
|
191
192
|
}, ["stop"]))
|
|
192
193
|
}, [
|
|
193
|
-
(u(!0), d(H, null,
|
|
194
|
+
(u(!0), d(H, null, O(e.options, (r, c) => (u(), d("li", {
|
|
194
195
|
id: `${e.namespace}_element_${e.options[c].label}`,
|
|
195
196
|
key: `${r.label}_${c}`,
|
|
196
197
|
role: "option",
|
|
197
198
|
"aria-selected": v(k) === c,
|
|
198
|
-
class:
|
|
199
|
+
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.$attrs["dropdown-item-classes"]]),
|
|
199
200
|
onClick: w((y) => b(r), ["stop"]),
|
|
200
201
|
onMouseover: w((y) => k.value = c, ["stop"])
|
|
201
202
|
}, [
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as H, mergeModels as S, useModel as
|
|
1
|
+
import { defineComponent as H, mergeModels as S, useModel as P, ref as s, computed as f, onBeforeMount as z, watch as C, openBlock as g, createBlock as V, normalizeClass as E, withCtx as c, createVNode as J, renderSlot as B, createElementBlock as K, Fragment as U, renderList as A, unref as F, createElementVNode as W } from "vue";
|
|
2
2
|
import j from "../BaseInput.js";
|
|
3
3
|
import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.BTIpnAy4.js";
|
|
4
4
|
import "./js.cookie.BQua9eWh.js";
|
|
5
5
|
import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js";
|
|
6
6
|
import { useKeyboardController as Q } from "../useKeyboardController.js";
|
|
7
|
-
function R(
|
|
7
|
+
function R(d, k) {
|
|
8
8
|
return (...v) => new Promise((l, n) => {
|
|
9
|
-
|
|
9
|
+
d.id && clearTimeout(d.id), d.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
11
|
const i = k(...v);
|
|
12
12
|
l(i);
|
|
13
13
|
} catch (i) {
|
|
14
14
|
n(i);
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, d.delay);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
@@ -28,7 +28,8 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
28
28
|
onOptionSelectedCb: { default: null },
|
|
29
29
|
keepState: { default: null },
|
|
30
30
|
cleanupOnClose: { type: Boolean, default: !0 },
|
|
31
|
-
dropdownClasses: { default: "" }
|
|
31
|
+
dropdownClasses: { default: "" },
|
|
32
|
+
closeDropdownOnBodyPressed: { type: Boolean, default: !0 }
|
|
32
33
|
}, {
|
|
33
34
|
modelValue: {
|
|
34
35
|
default() {
|
|
@@ -38,13 +39,13 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
38
39
|
modelModifiers: {}
|
|
39
40
|
}),
|
|
40
41
|
emits: /* @__PURE__ */ S(["dropdownClosed", "changedValue", "click", "keydown"], ["update:modelValue"]),
|
|
41
|
-
setup(
|
|
42
|
-
const l =
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
setup(d, { expose: k, emit: v }) {
|
|
43
|
+
const l = d, n = P(d, "modelValue"), i = v, u = s(""), o = s([]), m = s(null), p = s(!1), t = s(!1), y = s(null), O = f(() => o.value.length);
|
|
44
|
+
z(() => {
|
|
45
|
+
u.value = n.value?.label || "", m.value = R({ delay: 300 }, l.onInputChangeCb);
|
|
45
46
|
});
|
|
46
47
|
const { activeIdx: h, selectedIdx: w } = Q({
|
|
47
|
-
optionsLength:
|
|
48
|
+
optionsLength: O,
|
|
48
49
|
isDropdownOpen: t,
|
|
49
50
|
disableSpaceHandler: !0
|
|
50
51
|
}), M = f(() => {
|
|
@@ -69,7 +70,7 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
69
70
|
default:
|
|
70
71
|
return "";
|
|
71
72
|
}
|
|
72
|
-
}),
|
|
73
|
+
}), D = f(() => {
|
|
73
74
|
const e = "uikit-rounded-b-xl uikit-shadow uikit-rounded-t-none uikit-mb-0 !uikit-mt-0 uikit-text-w-black !uikit-rounded-b-xl !uikit-rounded-t-none";
|
|
74
75
|
switch (l.theme) {
|
|
75
76
|
case "bordered":
|
|
@@ -81,21 +82,21 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
81
82
|
default:
|
|
82
83
|
return "";
|
|
83
84
|
}
|
|
84
|
-
}),
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
o.value = [], p.value = !1, w.value = -1, h.value = -1, await m.value(null);
|
|
85
|
+
}), T = async (e) => {
|
|
86
|
+
if (u.value !== e && (i("changedValue", e), u.value = e, !!l.onInputChangeCb)) {
|
|
87
|
+
if (!e || p.value) {
|
|
88
|
+
o.value = [], p.value = !1, w.value = -1, h.value = -1, n.value && (n.value.label = ""), t.value = !1, await m.value(null);
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
|
-
l.disableCb || (o.value = await m.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }),
|
|
91
|
+
l.disableCb || (o.value = await m.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }), t.value = !!o.value.length);
|
|
91
92
|
}
|
|
92
93
|
}, $ = (e, a) => {
|
|
93
|
-
l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (o.value = []), p.value = !0,
|
|
94
|
-
},
|
|
94
|
+
l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (o.value = []), p.value = !0, u.value = e.label, n.value = e, t.value = !1, w.value = a;
|
|
95
|
+
}, L = () => {
|
|
95
96
|
o.value.length && l.keepState !== "closed" && (t.value = !0);
|
|
96
97
|
};
|
|
97
98
|
return C(n, (e, a) => {
|
|
98
|
-
e !== a && (
|
|
99
|
+
e !== a && (u.value = e?.label || "");
|
|
99
100
|
}), C(w, (e) => {
|
|
100
101
|
if (e === -1 || !o.value.length)
|
|
101
102
|
return;
|
|
@@ -111,7 +112,7 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
111
112
|
y.value?.select();
|
|
112
113
|
}
|
|
113
114
|
}), (e, a) => (g(), V(q, {
|
|
114
|
-
class:
|
|
115
|
+
class: E(e.$attrs["root-classes"]),
|
|
115
116
|
"data-cy": `ac_${e.$attrs.id}`,
|
|
116
117
|
"dropdown-element": "ul",
|
|
117
118
|
"dropdown-classes": [
|
|
@@ -121,7 +122,7 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
121
122
|
{
|
|
122
123
|
"uikit-mt-10px !uikit-border !uikit-border-w-secondary !uikit-rounded-xs": !e.theme
|
|
123
124
|
},
|
|
124
|
-
|
|
125
|
+
D.value,
|
|
125
126
|
"!uikit-max-h-[210px] uikit-z-10",
|
|
126
127
|
e.dropdownClasses
|
|
127
128
|
],
|
|
@@ -129,11 +130,12 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
129
130
|
"keep-state": !o.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
130
131
|
"onUpdate:dropdownState": a[1] || (a[1] = (r) => t.value = r),
|
|
131
132
|
onClick: a[2] || (a[2] = (r) => {
|
|
132
|
-
i("click"),
|
|
133
|
-
})
|
|
133
|
+
i("click"), L();
|
|
134
|
+
}),
|
|
135
|
+
"close-when-clicked-outside": e.closeDropdownOnBodyPressed
|
|
134
136
|
}, {
|
|
135
137
|
btn_slot: c(() => [
|
|
136
|
-
|
|
138
|
+
J(j, {
|
|
137
139
|
id: `ac_input_${e.$attrs.id}`,
|
|
138
140
|
ref_key: "baseInput",
|
|
139
141
|
ref: y,
|
|
@@ -149,26 +151,26 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
149
151
|
radius: !e.theme || e.theme === "bordered",
|
|
150
152
|
"input-class": [M.value, e.$attrs["input-classes"]],
|
|
151
153
|
"fieldset-classes": [I.value, e.$attrs["fieldset-classes"]],
|
|
152
|
-
"keep-floating-label": !!
|
|
153
|
-
"onUpdate:modelValue":
|
|
154
|
+
"keep-floating-label": !!u.value,
|
|
155
|
+
"onUpdate:modelValue": T,
|
|
154
156
|
onKeydown: a[0] || (a[0] = (r) => i("keydown", r))
|
|
155
157
|
}, {
|
|
156
158
|
leftIcon: c(() => [
|
|
157
|
-
|
|
159
|
+
B(e.$slots, "lefticon")
|
|
158
160
|
]),
|
|
159
161
|
righticon: c(({ handleClean: r }) => [
|
|
160
|
-
|
|
162
|
+
B(e.$slots, "righticon", { handleClean: r })
|
|
161
163
|
]),
|
|
162
164
|
_: 3
|
|
163
165
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "border", "radius", "input-class", "fieldset-classes", "keep-floating-label"])
|
|
164
166
|
]),
|
|
165
167
|
default: c(() => [
|
|
166
|
-
(g(!0), U
|
|
168
|
+
(g(!0), K(U, null, A(o.value, (r, b) => (g(), V(G, {
|
|
167
169
|
key: b,
|
|
168
|
-
active:
|
|
170
|
+
active: F(h) === b,
|
|
169
171
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
170
|
-
onClick: (
|
|
171
|
-
onMouseover: (
|
|
172
|
+
onClick: (N) => $(r, b),
|
|
173
|
+
onMouseover: (N) => h.value = b
|
|
172
174
|
}, {
|
|
173
175
|
default: c(() => [
|
|
174
176
|
W("span", {
|
|
@@ -179,7 +181,7 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
179
181
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
180
182
|
]),
|
|
181
183
|
_: 3
|
|
182
|
-
}, 8, ["class", "data-cy", "dropdown-classes", "open-dropdown", "keep-state"]));
|
|
184
|
+
}, 8, ["class", "data-cy", "dropdown-classes", "open-dropdown", "keep-state", "close-when-clicked-outside"]));
|
|
183
185
|
}
|
|
184
186
|
});
|
|
185
187
|
export {
|
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@ import { default as B } from "./CheckboxBtn.js";
|
|
|
8
8
|
import { _ as n } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.DDtN9_Bg.js";
|
|
9
9
|
import { _ as c } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.DR6a7QAi.js";
|
|
10
10
|
import { _ as b } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.C-jm5z4e.js";
|
|
11
|
-
import { _ as A } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.
|
|
11
|
+
import { _ as A } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.DB7G0w8N.js";
|
|
12
12
|
import { _ as C } from "./chunks/BaseAlert.vue_vue_type_script_setup_true_lang.HqYdk4yE.js";
|
|
13
|
-
import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.
|
|
13
|
+
import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.D5NYtmuS.js";
|
|
14
14
|
import { _ as w } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
|
|
15
15
|
import { _ as k } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.BrJbAMJ8.js";
|
|
16
16
|
import { _ as F } from "./chunks/BaseCard.vue_vue_type_style_index_0_lang.w5aEohzG.js";
|