@wikicasa-dev/components 1.9.16 → 1.9.17
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/BaseBreadcrumb.js +1 -1
- package/dist/BaseDropDown.js +1 -1
- package/dist/SelectItem.js +1 -1
- package/dist/UIKit/BaseBreadcrumb.vue.d.ts +4 -1
- package/dist/UIKit/BaseDropDown.vue.d.ts +15 -26
- package/dist/chunks/{AccessibleSelect.vue_vue_type_script_setup_true_lang.B43ikA_r.js → AccessibleSelect.vue_vue_type_script_setup_true_lang.BZJiuA9q.js} +15 -15
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.jggoW8dE.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.Cvm5m3ps.js} +39 -38
- package/dist/chunks/{BaseBreadcrumb.vue_vue_type_script_setup_true_lang.X16QIoKI.js → BaseBreadcrumb.vue_vue_type_script_setup_true_lang.CYvEsNdp.js} +12 -11
- package/dist/chunks/{BaseDropDown.vue_vue_type_script_setup_true_lang.ByKK5PjE.js → BaseDropDown.vue_vue_type_script_setup_true_lang.CZLqPgDd.js} +53 -45
- package/dist/chunks/{SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js → SelectItem.vue_vue_type_script_setup_true_lang.C2Kcvwa7.js} +10 -10
- package/dist/chunks/useKeyboardController.CXrrg8Zt.js +44 -0
- package/dist/index.js +5 -5
- package/package.json +3 -3
- package/dist/chunks/useKeyboardController.lxE4H7Vf.js +0 -41
package/dist/AccessibleSelect.js
CHANGED
package/dist/BaseAutocomplete.js
CHANGED
package/dist/BaseBreadcrumb.js
CHANGED
package/dist/BaseDropDown.js
CHANGED
package/dist/SelectItem.js
CHANGED
|
@@ -3,9 +3,12 @@ type BreadcrumbItemsType = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
active?: boolean;
|
|
5
5
|
};
|
|
6
|
+
type BreadcrumbItemsTypeWithIdx = BreadcrumbItemsType & {
|
|
7
|
+
idx: number;
|
|
8
|
+
};
|
|
6
9
|
declare function __VLS_template(): {
|
|
7
10
|
item?(_: {
|
|
8
|
-
item:
|
|
11
|
+
item: BreadcrumbItemsTypeWithIdx;
|
|
9
12
|
}): any;
|
|
10
13
|
separator?(_: {}): any;
|
|
11
14
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ClassType } from '@wikicasa-dev/types';
|
|
2
|
+
|
|
1
3
|
declare function __VLS_template(): {
|
|
2
4
|
btn_slot?(_: {
|
|
3
5
|
toggleDropdown: () => void;
|
|
@@ -6,18 +8,16 @@ declare function __VLS_template(): {
|
|
|
6
8
|
default?(_: {
|
|
7
9
|
isOpen: boolean;
|
|
8
10
|
toggleDropdown: () => void;
|
|
11
|
+
activeIdx: number;
|
|
12
|
+
selectedIdx: number;
|
|
9
13
|
}): any;
|
|
10
14
|
};
|
|
11
15
|
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
-
|
|
13
|
-
dropdownClasses?: string | string[] | (Record<string, boolean> | string)[];
|
|
14
|
-
containerDropdownClasses?: string;
|
|
15
|
-
iconName?: string;
|
|
16
|
-
iconClasses?: string;
|
|
16
|
+
dropdownClasses?: ClassType;
|
|
17
17
|
btnClasses?: string;
|
|
18
18
|
withArrowIcon?: boolean;
|
|
19
19
|
btnLabel?: string;
|
|
20
|
-
labelClasses?:
|
|
20
|
+
labelClasses?: ClassType;
|
|
21
21
|
direction?: "up" | "down";
|
|
22
22
|
arrowWidth?: number;
|
|
23
23
|
isAbsolute?: boolean;
|
|
@@ -25,12 +25,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
25
25
|
closeWhenClickedOutside?: boolean;
|
|
26
26
|
dropdownElement?: "div" | "ul" | "ol";
|
|
27
27
|
keepState?: "opened" | "closed" | "";
|
|
28
|
+
activateKeyboardController?: boolean;
|
|
28
29
|
}>, {
|
|
29
|
-
id: string;
|
|
30
|
-
containerDropdownClasses: string;
|
|
31
30
|
dropdownClasses: string;
|
|
32
|
-
iconClasses: string;
|
|
33
|
-
iconName: string;
|
|
34
31
|
btnClasses: string;
|
|
35
32
|
btnLabel: string;
|
|
36
33
|
labelClasses: string;
|
|
@@ -42,19 +39,16 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
42
39
|
closeWhenClickedOutside: boolean;
|
|
43
40
|
dropdownElement: string;
|
|
44
41
|
keepState: string;
|
|
42
|
+
activateKeyboardController: boolean;
|
|
45
43
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
46
44
|
click: () => void;
|
|
47
45
|
"update:dropdownState": (args_0: boolean) => void;
|
|
48
46
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
49
|
-
|
|
50
|
-
dropdownClasses?: string | string[] | (Record<string, boolean> | string)[];
|
|
51
|
-
containerDropdownClasses?: string;
|
|
52
|
-
iconName?: string;
|
|
53
|
-
iconClasses?: string;
|
|
47
|
+
dropdownClasses?: ClassType;
|
|
54
48
|
btnClasses?: string;
|
|
55
49
|
withArrowIcon?: boolean;
|
|
56
50
|
btnLabel?: string;
|
|
57
|
-
labelClasses?:
|
|
51
|
+
labelClasses?: ClassType;
|
|
58
52
|
direction?: "up" | "down";
|
|
59
53
|
arrowWidth?: number;
|
|
60
54
|
isAbsolute?: boolean;
|
|
@@ -62,12 +56,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
62
56
|
closeWhenClickedOutside?: boolean;
|
|
63
57
|
dropdownElement?: "div" | "ul" | "ol";
|
|
64
58
|
keepState?: "opened" | "closed" | "";
|
|
59
|
+
activateKeyboardController?: boolean;
|
|
65
60
|
}>, {
|
|
66
|
-
id: string;
|
|
67
|
-
containerDropdownClasses: string;
|
|
68
61
|
dropdownClasses: string;
|
|
69
|
-
iconClasses: string;
|
|
70
|
-
iconName: string;
|
|
71
62
|
btnClasses: string;
|
|
72
63
|
btnLabel: string;
|
|
73
64
|
labelClasses: string;
|
|
@@ -79,17 +70,14 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
79
70
|
closeWhenClickedOutside: boolean;
|
|
80
71
|
dropdownElement: string;
|
|
81
72
|
keepState: string;
|
|
73
|
+
activateKeyboardController: boolean;
|
|
82
74
|
}>>> & Readonly<{
|
|
83
75
|
onClick?: (() => any) | undefined;
|
|
84
76
|
"onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
85
77
|
}>, {
|
|
86
|
-
id: string;
|
|
87
78
|
direction: "up" | "down";
|
|
88
|
-
labelClasses:
|
|
89
|
-
|
|
90
|
-
dropdownClasses: string | string[] | (Record<string, boolean> | string)[];
|
|
91
|
-
containerDropdownClasses: string;
|
|
92
|
-
iconClasses: string;
|
|
79
|
+
labelClasses: ClassType;
|
|
80
|
+
dropdownClasses: ClassType;
|
|
93
81
|
btnClasses: string;
|
|
94
82
|
withArrowIcon: boolean;
|
|
95
83
|
btnLabel: string;
|
|
@@ -99,6 +87,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
99
87
|
closeWhenClickedOutside: boolean;
|
|
100
88
|
dropdownElement: "div" | "ul" | "ol";
|
|
101
89
|
keepState: "opened" | "closed" | "";
|
|
90
|
+
activateKeyboardController: boolean;
|
|
102
91
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
103
92
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
104
93
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as f, defineComponent as B, ref as w, computed as H, watch as T, onMounted as C, onUnmounted as F, openBlock as a, createElementBlock as s, normalizeClass as l, createElementVNode as o, createCommentVNode as u, withModifiers as k, renderSlot as z, unref as b, createBlock as
|
|
2
|
-
import {
|
|
1
|
+
import { h as f, defineComponent as B, ref as w, computed as H, watch as T, onMounted as C, onUnmounted as F, openBlock as a, createElementBlock as s, normalizeClass as l, createElementVNode as o, createCommentVNode as u, withModifiers as k, renderSlot as z, unref as b, createBlock as A, createVNode as E, Fragment as g, renderList as P } from "vue";
|
|
2
|
+
import { A as O } from "./useKeyboardController.CXrrg8Zt.js";
|
|
3
3
|
import { d as q } from "./ArrowIcon.B7Oqov4Y.js";
|
|
4
4
|
import { o as N } from "./PharmacyIcon.qIkuSERu.js";
|
|
5
5
|
const j = (d, { attrs: p }) => {
|
|
@@ -36,7 +36,7 @@ const j = (d, { attrs: p }) => {
|
|
|
36
36
|
})
|
|
37
37
|
]
|
|
38
38
|
);
|
|
39
|
-
}, D = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" }, S = ["id", "innerHTML"], U = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby"],
|
|
39
|
+
}, D = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" }, S = ["id", "innerHTML"], U = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby"], G = ["innerHTML"], I = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, J = ["innerHTML"], K = ["data-cy"], Q = ["id", "aria-selected", "onClick", "onMouseover"], R = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, W = ["name", "checked", "onInput"], X = ["innerHTML"], Y = ["id", "arial-live", "innerHTML"], Z = ["id", "arial-live", "innerHTML"], ti = /* @__PURE__ */ B({
|
|
40
40
|
inheritAttrs: !1,
|
|
41
41
|
__name: "AccessibleSelect",
|
|
42
42
|
props: {
|
|
@@ -117,15 +117,15 @@ const j = (d, { attrs: p }) => {
|
|
|
117
117
|
o("span", {
|
|
118
118
|
class: l(["uikit-pointer-events-none uikit-mt-1", i.$attrs["btn-text-classes"]]),
|
|
119
119
|
innerHTML: i.modelValue.visibleLabel || i.modelValue.label
|
|
120
|
-
}, null, 10,
|
|
121
|
-
o("span",
|
|
122
|
-
t.isValid == !1 ? (a(),
|
|
120
|
+
}, null, 10, G),
|
|
121
|
+
o("span", I, [
|
|
122
|
+
t.isValid == !1 ? (a(), A(b(j), {
|
|
123
123
|
key: 0,
|
|
124
124
|
class: "uikit-mr-1",
|
|
125
125
|
width: 20,
|
|
126
126
|
height: 20
|
|
127
127
|
})) : u("", !0),
|
|
128
|
-
|
|
128
|
+
E(b(q), {
|
|
129
129
|
class: l(["uikit-transition-transform motion-reduce:uikit-transition-none", e.value ? "uikit-rotate-180" : ""]),
|
|
130
130
|
width: 18,
|
|
131
131
|
height: 18,
|
|
@@ -151,7 +151,7 @@ const j = (d, { attrs: p }) => {
|
|
|
151
151
|
key: 0,
|
|
152
152
|
class: l(["uikit-mx-5px", [i.modelValue.label ? "uikit-invisible" : "uikit-hidden"]]),
|
|
153
153
|
innerHTML: i.label
|
|
154
|
-
}, null, 10,
|
|
154
|
+
}, null, 10, J)) : u("", !0)
|
|
155
155
|
], 2)
|
|
156
156
|
], 2),
|
|
157
157
|
o("ul", {
|
|
@@ -171,7 +171,7 @@ const j = (d, { attrs: p }) => {
|
|
|
171
171
|
onClick: n[3] || (n[3] = k(() => {
|
|
172
172
|
}, ["stop"]))
|
|
173
173
|
}, [
|
|
174
|
-
(a(!0), s(g, null,
|
|
174
|
+
(a(!0), s(g, null, P(i.options, (r, m) => (a(), s("li", {
|
|
175
175
|
id: `${i.namespace}_element_${i.options[m].label}`,
|
|
176
176
|
key: `${r.label}_${m}`,
|
|
177
177
|
role: "option",
|
|
@@ -182,7 +182,7 @@ const j = (d, { attrs: p }) => {
|
|
|
182
182
|
onBlur: n[2] || (n[2] = k(() => {
|
|
183
183
|
}, ["stop"]))
|
|
184
184
|
}, [
|
|
185
|
-
o("label",
|
|
185
|
+
o("label", R, [
|
|
186
186
|
o("input", {
|
|
187
187
|
tabindex: "-1",
|
|
188
188
|
class: "uikit-m-0 uikit-appearance-none",
|
|
@@ -190,13 +190,13 @@ const j = (d, { attrs: p }) => {
|
|
|
190
190
|
type: "radio",
|
|
191
191
|
checked: r.label === i.modelValue.label,
|
|
192
192
|
onInput: k((y) => h(r), ["stop"])
|
|
193
|
-
}, null, 40,
|
|
193
|
+
}, null, 40, W),
|
|
194
194
|
o("span", {
|
|
195
195
|
innerHTML: r.label
|
|
196
|
-
}, null, 8,
|
|
196
|
+
}, null, 8, X)
|
|
197
197
|
])
|
|
198
|
-
], 42,
|
|
199
|
-
], 10,
|
|
198
|
+
], 42, Q))), 128))
|
|
199
|
+
], 10, K)
|
|
200
200
|
]),
|
|
201
201
|
i.feedback ? (a(), s(g, { key: 0 }, [
|
|
202
202
|
i.feedback.valid ? (a(), s("span", {
|
|
@@ -205,7 +205,7 @@ const j = (d, { attrs: p }) => {
|
|
|
205
205
|
"arial-live": i.$attrs["aria-live"],
|
|
206
206
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12",
|
|
207
207
|
innerHTML: i.isValid ? i.feedback.valid : ""
|
|
208
|
-
}, null, 8,
|
|
208
|
+
}, null, 8, Y)) : u("", !0),
|
|
209
209
|
i.feedback.invalid ? (a(), s("span", {
|
|
210
210
|
key: 1,
|
|
211
211
|
id: `${i.namespace}_invalid_msg`,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as L, mergeModels as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
1
|
+
import { defineComponent as L, mergeModels as S, useModel as H, ref as s, computed as k, onBeforeMount as z, watch as f, openBlock as y, createBlock as V, normalizeClass as A, withCtx as c, createVNode as K, renderSlot as B, createElementBlock as N, Fragment as U, renderList as F, unref as W, createElementVNode as j } from "vue";
|
|
2
|
+
import q from "../BaseInput.js";
|
|
3
|
+
import { _ as G } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.CZLqPgDd.js";
|
|
4
4
|
import "./types-B0dZ7OiV.D29wNgoj.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
return (...
|
|
5
|
+
import { _ as J } from "./SelectItem.vue_vue_type_script_setup_true_lang.C2Kcvwa7.js";
|
|
6
|
+
import { A as Q } from "./useKeyboardController.CXrrg8Zt.js";
|
|
7
|
+
function R(r, v) {
|
|
8
|
+
return (...m) => new Promise((l, d) => {
|
|
9
9
|
r.id && clearTimeout(r.id), r.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
l(
|
|
13
|
-
} catch (
|
|
14
|
-
d(
|
|
11
|
+
const i = v(...m);
|
|
12
|
+
l(i);
|
|
13
|
+
} catch (i) {
|
|
14
|
+
d(i);
|
|
15
15
|
}
|
|
16
16
|
}, r.delay);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
20
20
|
__name: "BaseAutocomplete",
|
|
21
|
-
props: /* @__PURE__ */
|
|
21
|
+
props: /* @__PURE__ */ S({
|
|
22
22
|
border: { type: Boolean, default: !0 },
|
|
23
23
|
isValid: { default: null },
|
|
24
24
|
theme: { default: "" },
|
|
@@ -38,13 +38,13 @@ const R = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
38
38
|
},
|
|
39
39
|
modelModifiers: {}
|
|
40
40
|
}),
|
|
41
|
-
emits: /* @__PURE__ */
|
|
42
|
-
setup(r, { expose:
|
|
43
|
-
const l = r, d = H(r, "modelValue"),
|
|
41
|
+
emits: /* @__PURE__ */ S(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
42
|
+
setup(r, { expose: v, emit: m }) {
|
|
43
|
+
const l = r, d = H(r, "modelValue"), i = m, u = s(""), n = s([]), h = s(null), p = s(!1), o = s(!1), g = s(null), O = k(() => n.value.length);
|
|
44
44
|
z(() => {
|
|
45
|
-
h.value =
|
|
45
|
+
h.value = R({ delay: 300 }, l.onInputChangeCb);
|
|
46
46
|
});
|
|
47
|
-
const { activeIdx: w, selectedIdx: C } =
|
|
47
|
+
const { activeIdx: w, selectedIdx: C } = Q({
|
|
48
48
|
optionsLength: O,
|
|
49
49
|
isDropdownOpen: o,
|
|
50
50
|
disableSpaceHandler: !0
|
|
@@ -83,7 +83,7 @@ const R = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
83
83
|
return "";
|
|
84
84
|
}
|
|
85
85
|
}), D = async (e) => {
|
|
86
|
-
if (
|
|
86
|
+
if (u.value !== e && (i("changedValue", e), u.value = e, !!l.onInputChangeCb)) {
|
|
87
87
|
if (!e || p.value) {
|
|
88
88
|
n.value = [], p.value = !1, C.value = -1, w.value = -1, d.value && (d.value.label = ""), o.value = !1, await h.value(null);
|
|
89
89
|
return;
|
|
@@ -111,12 +111,12 @@ const R = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
111
111
|
e === "closed" ? (o.value = !1, l.cleanupOnClose && (n.value = [])) : e === "open" && n.value.length && (o.value = !0);
|
|
112
112
|
}
|
|
113
113
|
), f(o, (e) => {
|
|
114
|
-
|
|
115
|
-
}),
|
|
114
|
+
i("update:dropdownState", e);
|
|
115
|
+
}), v({
|
|
116
116
|
select: () => {
|
|
117
117
|
g.value?.select();
|
|
118
118
|
}
|
|
119
|
-
}), (e, t) => (y(),
|
|
119
|
+
}), (e, t) => (y(), V(G, {
|
|
120
120
|
class: A(e.$attrs["root-classes"]),
|
|
121
121
|
"data-cy": `ac_${e.$attrs.id}`,
|
|
122
122
|
"dropdown-element": "ul",
|
|
@@ -133,14 +133,15 @@ const R = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
133
133
|
],
|
|
134
134
|
"open-dropdown": o.value,
|
|
135
135
|
"keep-state": !n.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
136
|
-
"onUpdate:dropdownState": t[3] || (t[3] = (
|
|
137
|
-
onClick: t[4] || (t[4] = (
|
|
138
|
-
|
|
136
|
+
"onUpdate:dropdownState": t[3] || (t[3] = (a) => o.value = a),
|
|
137
|
+
onClick: t[4] || (t[4] = (a) => {
|
|
138
|
+
i("click"), E();
|
|
139
139
|
}),
|
|
140
|
-
"close-when-clicked-outside": e.closeDropdownOnBodyPressed
|
|
140
|
+
"close-when-clicked-outside": e.closeDropdownOnBodyPressed,
|
|
141
|
+
"activate-keyboard-controller": !1
|
|
141
142
|
}, {
|
|
142
143
|
btn_slot: c(() => [
|
|
143
|
-
K(
|
|
144
|
+
K(q, {
|
|
144
145
|
id: `ac_input_${e.$attrs.id}`,
|
|
145
146
|
ref_key: "baseInput",
|
|
146
147
|
ref: g,
|
|
@@ -158,31 +159,31 @@ const R = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
158
159
|
"!uikit-ml-0 !uikit-w-full"
|
|
159
160
|
],
|
|
160
161
|
"fieldset-classes": [I.value, e.$attrs["fieldset-classes"]],
|
|
161
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
162
|
-
onKeydown: t[1] || (t[1] = (
|
|
163
|
-
onKeydownEnterPressed: t[2] || (t[2] = () =>
|
|
162
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => D(a === void 0 ? "" : `${a}`)),
|
|
163
|
+
onKeydown: t[1] || (t[1] = (a) => i("keydown", a)),
|
|
164
|
+
onKeydownEnterPressed: t[2] || (t[2] = () => i("keydownEnterPressed"))
|
|
164
165
|
}, {
|
|
165
166
|
leftIcon: c(() => [
|
|
166
|
-
|
|
167
|
+
B(e.$slots, "lefticon")
|
|
167
168
|
]),
|
|
168
|
-
righticon: c(({ handleClean:
|
|
169
|
-
|
|
169
|
+
righticon: c(({ handleClean: a }) => [
|
|
170
|
+
B(e.$slots, "righticon", { handleClean: a })
|
|
170
171
|
]),
|
|
171
172
|
_: 3
|
|
172
173
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
|
|
173
174
|
]),
|
|
174
175
|
default: c(() => [
|
|
175
|
-
(y(!0), N(U, null, F(n.value, (
|
|
176
|
+
(y(!0), N(U, null, F(n.value, (a, b) => (y(), V(J, {
|
|
176
177
|
key: b,
|
|
177
178
|
active: W(w) === b,
|
|
178
179
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
179
|
-
onClick: (T) => $(
|
|
180
|
+
onClick: (T) => $(a, b),
|
|
180
181
|
onMouseover: (T) => w.value = b
|
|
181
182
|
}, {
|
|
182
183
|
default: c(() => [
|
|
183
|
-
|
|
184
|
-
innerHTML:
|
|
185
|
-
}, null, 8,
|
|
184
|
+
j("span", {
|
|
185
|
+
innerHTML: a.label
|
|
186
|
+
}, null, 8, X)
|
|
186
187
|
]),
|
|
187
188
|
_: 2
|
|
188
189
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as u, computed as
|
|
1
|
+
import { defineComponent as u, computed as d, openBlock as i, createElementBlock as r, createElementVNode as o, Fragment as l, renderList as m, renderSlot as a, normalizeClass as h, toDisplayString as k, createVNode as p, unref as _ } from "vue";
|
|
2
2
|
import { d as f } from "./ArrowIcon.B7Oqov4Y.js";
|
|
3
3
|
import "./PharmacyIcon.qIkuSERu.js";
|
|
4
4
|
const b = { "aria-label": "Breadcrumb" }, g = { class: "uikit-flex uikit-items-center uikit-gap-10px uikit-p-0" }, w = {
|
|
@@ -6,31 +6,32 @@ const b = { "aria-label": "Breadcrumb" }, g = { class: "uikit-flex uikit-items-c
|
|
|
6
6
|
class: "uikit-list-none"
|
|
7
7
|
}, x = ["href"], B = {
|
|
8
8
|
key: 1,
|
|
9
|
-
class: "uikit-list-none"
|
|
9
|
+
class: "uikit-list-none",
|
|
10
|
+
"aria-hidden": "true"
|
|
10
11
|
}, E = /* @__PURE__ */ u({
|
|
11
12
|
__name: "BaseBreadcrumb",
|
|
12
13
|
props: {
|
|
13
14
|
items: {}
|
|
14
15
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const c =
|
|
16
|
+
setup(n) {
|
|
17
|
+
const c = d(() => {
|
|
17
18
|
let e = 0;
|
|
18
19
|
const s = [];
|
|
19
|
-
for (; e <
|
|
20
|
-
s.push(
|
|
20
|
+
for (; e < n.items.length; )
|
|
21
|
+
s.push({ ...n.items[e], idx: e }), e < n.items.length - 1 && s.push({ arrowIcon: !0 }), e++;
|
|
21
22
|
return s;
|
|
22
23
|
});
|
|
23
24
|
return (e, s) => (i(), r("nav", b, [
|
|
24
|
-
|
|
25
|
-
(i(!0), r(l, null,
|
|
25
|
+
o("ol", g, [
|
|
26
|
+
(i(!0), r(l, null, m(c.value, (t) => (i(), r(l, null, [
|
|
26
27
|
t?.label ? (i(), r("li", w, [
|
|
27
28
|
a(e.$slots, "item", {
|
|
28
29
|
item: t
|
|
29
30
|
}, () => [
|
|
30
|
-
|
|
31
|
-
class:
|
|
31
|
+
o("a", {
|
|
32
|
+
class: h(["uikit-text-w-black uikit-no-underline", { "uikit-text-w-primary": t.active }]),
|
|
32
33
|
href: t.link
|
|
33
|
-
},
|
|
34
|
+
}, k(t.label), 11, x)
|
|
34
35
|
])
|
|
35
36
|
])) : (i(), r("li", B, [
|
|
36
37
|
a(e.$slots, "separator", {}, () => [
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { d as
|
|
1
|
+
import { defineComponent as $, useId as D, ref as m, computed as L, useTemplateRef as I, watch as s, onBeforeMount as S, onMounted as A, onUnmounted as E, openBlock as u, createElementBlock as O, normalizeClass as i, withModifiers as w, renderSlot as v, createVNode as W, unref as a, withCtx as b, createElementVNode as M, createBlock as h, createCommentVNode as H, resolveDynamicComponent as N } from "vue";
|
|
2
|
+
import { _ as T } from "./BaseButton.vue_vue_type_script_setup_true_lang.dlLTK59i.js";
|
|
3
|
+
import { d as V } from "./ArrowIcon.B7Oqov4Y.js";
|
|
4
4
|
import "./PharmacyIcon.qIkuSERu.js";
|
|
5
|
-
|
|
5
|
+
import { A as K } from "./useKeyboardController.CXrrg8Zt.js";
|
|
6
|
+
const q = ["innerHTML"], G = /* @__PURE__ */ $({
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "BaseDropDown",
|
|
8
9
|
props: {
|
|
9
|
-
id: { default: "" },
|
|
10
10
|
dropdownClasses: { default: "" },
|
|
11
|
-
containerDropdownClasses: { default: "" },
|
|
12
|
-
iconName: { default: "" },
|
|
13
|
-
iconClasses: { default: "" },
|
|
14
11
|
btnClasses: { default: "" },
|
|
15
12
|
withArrowIcon: { type: Boolean, default: !1 },
|
|
16
13
|
btnLabel: { default: "" },
|
|
@@ -21,12 +18,17 @@ const S = ["innerHTML"], H = /* @__PURE__ */ w({
|
|
|
21
18
|
openDropdown: { type: Boolean, default: !1 },
|
|
22
19
|
closeWhenClickedOutside: { type: Boolean, default: !0 },
|
|
23
20
|
dropdownElement: { default: "div" },
|
|
24
|
-
keepState: { default: "" }
|
|
21
|
+
keepState: { default: "" },
|
|
22
|
+
activateKeyboardController: { type: Boolean, default: !0 }
|
|
25
23
|
},
|
|
26
24
|
emits: ["click", "update:dropdownState"],
|
|
27
|
-
setup(
|
|
28
|
-
const o =
|
|
29
|
-
|
|
25
|
+
setup(y, { emit: C }) {
|
|
26
|
+
const o = y, c = D(), p = C, t = m(!1), l = m([]), g = L(() => l.value.length), d = I("dropdown"), { activeIdx: B, selectedIdx: k } = K({
|
|
27
|
+
optionsLength: g,
|
|
28
|
+
isDropdownOpen: t,
|
|
29
|
+
activate: o.activateKeyboardController
|
|
30
|
+
});
|
|
31
|
+
s(
|
|
30
32
|
() => o.openDropdown,
|
|
31
33
|
(e) => {
|
|
32
34
|
t.value = e;
|
|
@@ -34,30 +36,34 @@ const S = ["innerHTML"], H = /* @__PURE__ */ w({
|
|
|
34
36
|
{
|
|
35
37
|
immediate: !0
|
|
36
38
|
}
|
|
37
|
-
),
|
|
38
|
-
|
|
39
|
+
), s(t, (e) => {
|
|
40
|
+
p("update:dropdownState", e);
|
|
41
|
+
}), s(k, (e) => {
|
|
42
|
+
e !== -1 && l.value[e].querySelector("a")?.click();
|
|
39
43
|
});
|
|
40
|
-
const
|
|
44
|
+
const f = () => {
|
|
41
45
|
t.value = !1;
|
|
42
|
-
},
|
|
46
|
+
}, r = () => {
|
|
43
47
|
o.keepState === "closed" && !t.value || o.keepState === "opened" && t.value || (t.value = !t.value);
|
|
44
48
|
};
|
|
45
|
-
return
|
|
46
|
-
o.closeWhenClickedOutside && document && document.body.addEventListener("click",
|
|
47
|
-
}),
|
|
48
|
-
|
|
49
|
-
}), (
|
|
49
|
+
return S(() => {
|
|
50
|
+
o.closeWhenClickedOutside && document && document.body.addEventListener("click", f);
|
|
51
|
+
}), A(() => {
|
|
52
|
+
d.value && (l.value = d.value.children || []);
|
|
53
|
+
}), E(() => {
|
|
54
|
+
o.closeWhenClickedOutside && document && document.body.removeEventListener("click", f);
|
|
55
|
+
}), (e, n) => (u(), O("div", {
|
|
50
56
|
class: i(["uikit-relative uikit-block", e.$attrs.class]),
|
|
51
|
-
onClick:
|
|
52
|
-
|
|
57
|
+
onClick: n[1] || (n[1] = w((z) => {
|
|
58
|
+
p("click"), r();
|
|
53
59
|
}, ["stop"]))
|
|
54
60
|
}, [
|
|
55
|
-
|
|
56
|
-
toggleDropdown:
|
|
61
|
+
v(e.$slots, "btn_slot", {
|
|
62
|
+
toggleDropdown: r,
|
|
57
63
|
isOpen: t.value
|
|
58
64
|
}, () => [
|
|
59
|
-
|
|
60
|
-
id:
|
|
65
|
+
W(T, {
|
|
66
|
+
id: a(c),
|
|
61
67
|
type: "button",
|
|
62
68
|
"data-cy": e.$attrs["data-cy"],
|
|
63
69
|
class: i([
|
|
@@ -65,29 +71,28 @@ const S = ["innerHTML"], H = /* @__PURE__ */ w({
|
|
|
65
71
|
e.btnClasses
|
|
66
72
|
]),
|
|
67
73
|
"aria-expanded": t.value,
|
|
68
|
-
"btn-class": "uikit-btn-single-selection"
|
|
69
|
-
"icon-class": e.iconClasses,
|
|
70
|
-
"icon-name": e.iconName
|
|
74
|
+
"btn-class": "uikit-btn-single-selection"
|
|
71
75
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
76
|
+
default: b(() => [
|
|
77
|
+
M("span", {
|
|
74
78
|
class: i(["uikit-mr-5px", e.labelClasses]),
|
|
75
79
|
innerHTML: e.btnLabel
|
|
76
|
-
}, null, 10,
|
|
77
|
-
e.withArrowIcon ? (
|
|
80
|
+
}, null, 10, q),
|
|
81
|
+
e.withArrowIcon ? (u(), h(a(V), {
|
|
78
82
|
key: 0,
|
|
79
83
|
class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
|
|
80
84
|
width: e.arrowWidth,
|
|
81
85
|
height: e.arrowWidth,
|
|
82
86
|
"stroke-color": e.$attrs["arrow-stroke-color"]
|
|
83
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])) :
|
|
87
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])) : H("", !0)
|
|
84
88
|
]),
|
|
85
89
|
_: 1
|
|
86
|
-
}, 8, ["id", "data-cy", "class", "aria-expanded"
|
|
90
|
+
}, 8, ["id", "data-cy", "class", "aria-expanded"])
|
|
87
91
|
]),
|
|
88
|
-
(
|
|
89
|
-
id: "dropdown_" +
|
|
90
|
-
|
|
92
|
+
(u(), h(N(e.dropdownElement), {
|
|
93
|
+
id: "dropdown_" + a(c),
|
|
94
|
+
ref_key: "dropdown",
|
|
95
|
+
ref: d,
|
|
91
96
|
"data-cy": e.$attrs["data-cy"] && `${e.$attrs["data-cy"]}_dropdown`,
|
|
92
97
|
class: i(["uikit-max-h-[220px] uikit-w-full uikit-min-w-[90px] uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-border-w-lavender uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
|
|
93
98
|
e.dropdownClasses,
|
|
@@ -96,20 +101,23 @@ const S = ["innerHTML"], H = /* @__PURE__ */ w({
|
|
|
96
101
|
{ "uikit-rounded-b uikit-border-t-0": e.direction === "down" },
|
|
97
102
|
{ "uikit-absolute": e.isAbsolute }
|
|
98
103
|
]]),
|
|
99
|
-
|
|
104
|
+
"aria-hidden": !t.value,
|
|
105
|
+
onClick: n[0] || (n[0] = w(() => {
|
|
100
106
|
}, ["stop"]))
|
|
101
107
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
|
|
108
|
+
default: b(() => [
|
|
109
|
+
v(e.$slots, "default", {
|
|
104
110
|
isOpen: t.value,
|
|
105
|
-
toggleDropdown:
|
|
111
|
+
toggleDropdown: r,
|
|
112
|
+
activeIdx: a(B),
|
|
113
|
+
selectedIdx: a(k)
|
|
106
114
|
})
|
|
107
115
|
]),
|
|
108
116
|
_: 3
|
|
109
|
-
}, 8, ["id", "data-cy", "class"]))
|
|
117
|
+
}, 8, ["id", "data-cy", "class", "aria-hidden"]))
|
|
110
118
|
], 2));
|
|
111
119
|
}
|
|
112
120
|
});
|
|
113
121
|
export {
|
|
114
|
-
|
|
122
|
+
G as _
|
|
115
123
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as r,
|
|
2
|
-
const b = ["tabindex"], x = ["innerHTML"],
|
|
1
|
+
import { defineComponent as r, useTemplateRef as u, watch as m, nextTick as d, openBlock as c, createElementBlock as f, normalizeClass as k, renderSlot as p, createElementVNode as v } from "vue";
|
|
2
|
+
const b = ["tabindex"], x = ["innerHTML"], $ = /* @__PURE__ */ r({
|
|
3
3
|
__name: "SelectItem",
|
|
4
4
|
props: {
|
|
5
5
|
label: { default: "" },
|
|
@@ -8,26 +8,26 @@ const b = ["tabindex"], x = ["innerHTML"], I = /* @__PURE__ */ r({
|
|
|
8
8
|
},
|
|
9
9
|
emits: ["click", "mouseover"],
|
|
10
10
|
setup(o, { emit: s }) {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const l = s, t = o, n = u("liItem");
|
|
12
|
+
return m(
|
|
13
13
|
() => t.active,
|
|
14
14
|
(e) => {
|
|
15
|
-
e &&
|
|
16
|
-
|
|
15
|
+
e && d(() => {
|
|
16
|
+
n.value && n.value.focus();
|
|
17
17
|
});
|
|
18
18
|
},
|
|
19
19
|
{ immediate: !0 }
|
|
20
20
|
), (e, i) => (c(), f("li", {
|
|
21
21
|
ref_key: "liItem",
|
|
22
|
-
ref:
|
|
22
|
+
ref: n,
|
|
23
23
|
class: k(["uikit-list-none uikit-text-w-black", [
|
|
24
24
|
{ "active uikit-bg-w-cultured": e.active },
|
|
25
25
|
"uikit-outline-none",
|
|
26
26
|
e.$attrs.class
|
|
27
27
|
]]),
|
|
28
28
|
tabindex: e.$attrs.tabindex ?? -1,
|
|
29
|
-
onClick: i[0] || (i[0] = (a) =>
|
|
30
|
-
onMouseover: i[1] || (i[1] = (a) =>
|
|
29
|
+
onClick: i[0] || (i[0] = (a) => l("click", t.idx)),
|
|
30
|
+
onMouseover: i[1] || (i[1] = (a) => l("mouseover", t.idx))
|
|
31
31
|
}, [
|
|
32
32
|
p(e.$slots, "default", { itemIdx: e.idx }, () => [
|
|
33
33
|
v("span", {
|
|
@@ -38,5 +38,5 @@ const b = ["tabindex"], x = ["innerHTML"], I = /* @__PURE__ */ r({
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
$ as _
|
|
42
42
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ref as f, onMounted as w, onUnmounted as E, unref as x } from "vue";
|
|
2
|
+
const D = (o) => {
|
|
3
|
+
const { isDropdownOpen: a, disableSpaceHandler: m } = o, n = f(-1), t = f(-1);
|
|
4
|
+
if (!(o.activate === void 0 || o.activate))
|
|
5
|
+
return { activeIdx: n, selectedIdx: t };
|
|
6
|
+
const l = (e) => {
|
|
7
|
+
const v = "ArrowUp", d = "ArrowDown", i = "Enter", c = "Escape", u = " ", s = "PageUp", y = "Home", k = "PageDown", p = "End";
|
|
8
|
+
if (!a.value || ![
|
|
9
|
+
v,
|
|
10
|
+
d,
|
|
11
|
+
i,
|
|
12
|
+
c,
|
|
13
|
+
u,
|
|
14
|
+
s,
|
|
15
|
+
y,
|
|
16
|
+
k,
|
|
17
|
+
p
|
|
18
|
+
].includes(e.key))
|
|
19
|
+
return;
|
|
20
|
+
const r = x(o.optionsLength);
|
|
21
|
+
if (e.key === v)
|
|
22
|
+
n.value = n.value === 0 ? r - 1 : n.value - 1;
|
|
23
|
+
else if (e.key === d)
|
|
24
|
+
n.value = (n.value + 1) % r;
|
|
25
|
+
else if (e.key === i || e.key === u) {
|
|
26
|
+
if (e.key === u && m)
|
|
27
|
+
return;
|
|
28
|
+
t.value = n.value, a.value = !1;
|
|
29
|
+
} else
|
|
30
|
+
e.key === c ? (n.value = t.value, a.value = !1) : e.key === s || e.key === y ? n.value = 0 : (e.key === k || e.key === p) && (n.value = r - 1);
|
|
31
|
+
e.stopPropagation(), e.preventDefault();
|
|
32
|
+
};
|
|
33
|
+
return w(() => {
|
|
34
|
+
document && document.addEventListener("keydown", l);
|
|
35
|
+
}), E(() => {
|
|
36
|
+
document && document.removeEventListener("keydown", l);
|
|
37
|
+
}), {
|
|
38
|
+
activeIdx: n,
|
|
39
|
+
selectedIdx: t
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
D as A
|
|
44
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -2,21 +2,21 @@ import { _ as r } from "./chunks/BaseAccordion.vue_vue_type_script_setup_true_la
|
|
|
2
2
|
import { _ as t } from "./chunks/BaseAccordionBtn.vue_vue_type_script_setup_true_lang.2iAIiz6F.js";
|
|
3
3
|
import { _ as f } from "./chunks/BaseAccordionContent.vue_vue_type_script_setup_true_lang.8ErZghvk.js";
|
|
4
4
|
import { _ as m } from "./chunks/BaseAccordionItem.vue_vue_type_script_setup_true_lang.CR-nWss7.js";
|
|
5
|
-
import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.
|
|
5
|
+
import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.C2Kcvwa7.js";
|
|
6
6
|
import { default as d } from "./CheckboxBtn.js";
|
|
7
7
|
import { _ as i } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.hSeL05pn.js";
|
|
8
8
|
import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K.js";
|
|
9
9
|
import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.DSlvTOkB.js";
|
|
10
10
|
import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.DR6a7QAi.js";
|
|
11
11
|
import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.BYlMCUWP.js";
|
|
12
|
-
import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.
|
|
12
|
+
import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.BZJiuA9q.js";
|
|
13
13
|
import { _ as w } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
|
|
14
|
-
import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.
|
|
14
|
+
import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.Cvm5m3ps.js";
|
|
15
15
|
import { _ as D } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
|
|
16
16
|
import { _ as G } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.dlLTK59i.js";
|
|
17
17
|
import { default as O } from "./BaseCard.js";
|
|
18
18
|
import { default as R } from "./BaseComplexToggle.js";
|
|
19
|
-
import { _ as N } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.
|
|
19
|
+
import { _ as N } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CZLqPgDd.js";
|
|
20
20
|
import { default as j } from "./BaseFloatingLabel.js";
|
|
21
21
|
import { default as y } from "./BaseIcon.js";
|
|
22
22
|
import { default as E } from "./BaseInput.js";
|
|
@@ -40,7 +40,7 @@ import { _ as Ie } from "./chunks/IntersectionObserver.vue_vue_type_script_setup
|
|
|
40
40
|
import { S as we } from "./chunks/SwiperCarousel.BV6QiwmC.js";
|
|
41
41
|
import { default as ke } from "./SwiperSlide.js";
|
|
42
42
|
import { useValidator as De } from "./useValidator.js";
|
|
43
|
-
import { _ as Ge } from "./chunks/BaseBreadcrumb.vue_vue_type_script_setup_true_lang.
|
|
43
|
+
import { _ as Ge } from "./chunks/BaseBreadcrumb.vue_vue_type_script_setup_true_lang.CYvEsNdp.js";
|
|
44
44
|
import './assets/index.css';export {
|
|
45
45
|
I as AccessibleSelect,
|
|
46
46
|
r as BaseAccordion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/components",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.17",
|
|
4
4
|
"description": "Wikicasa frontend components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"chartjs-adapter-date-fns": "^3.0.0",
|
|
34
34
|
"date-fns": "^3.6.0",
|
|
35
35
|
"swiper": "^11.1.14",
|
|
36
|
-
"vue": "
|
|
36
|
+
"vue": "3.5.12",
|
|
37
37
|
"vue-chartjs": "^5.3.1",
|
|
38
38
|
"vue-router": "^4.4.5"
|
|
39
39
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@wikicasa-dev/tailwind-plugins": "^0.0.2",
|
|
47
47
|
"@wikicasa-dev/types": "^1.5.52",
|
|
48
48
|
"@wikicasa-dev/utilities": "^1.0.22",
|
|
49
|
-
"@wikicasa-dev/vue-composables": "
|
|
49
|
+
"@wikicasa-dev/vue-composables": "0.0.10",
|
|
50
50
|
"autoprefixer": "^10.4.20",
|
|
51
51
|
"chromatic": "^11.12.5",
|
|
52
52
|
"eslint": "^8.57.1",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ref as f, onMounted as w, onUnmounted as E, unref as g } from "vue";
|
|
2
|
-
const x = (r) => {
|
|
3
|
-
const { isDropdownOpen: o, disableSpaceHandler: m } = r, n = f(-1), t = f(-1), l = (e) => {
|
|
4
|
-
const v = "ArrowUp", d = "ArrowDown", s = "Enter", i = "Escape", u = " ", c = "PageUp", y = "Home", k = "PageDown", p = "End";
|
|
5
|
-
if (!o.value || ![
|
|
6
|
-
v,
|
|
7
|
-
d,
|
|
8
|
-
s,
|
|
9
|
-
i,
|
|
10
|
-
u,
|
|
11
|
-
c,
|
|
12
|
-
y,
|
|
13
|
-
k,
|
|
14
|
-
p
|
|
15
|
-
].includes(e.key))
|
|
16
|
-
return;
|
|
17
|
-
const a = g(r.optionsLength);
|
|
18
|
-
if (e.key === v)
|
|
19
|
-
n.value = n.value === 0 ? a - 1 : n.value - 1;
|
|
20
|
-
else if (e.key === d)
|
|
21
|
-
n.value = (n.value + 1) % a;
|
|
22
|
-
else if (e.key === s || e.key === u) {
|
|
23
|
-
if (e.key === u && m)
|
|
24
|
-
return;
|
|
25
|
-
t.value = n.value, o.value = !1;
|
|
26
|
-
} else
|
|
27
|
-
e.key === i ? (n.value = t.value, o.value = !1) : e.key === c || e.key === y ? n.value = 0 : (e.key === k || e.key === p) && (n.value = a - 1);
|
|
28
|
-
e.stopPropagation(), e.preventDefault();
|
|
29
|
-
};
|
|
30
|
-
return w(() => {
|
|
31
|
-
document && document.addEventListener("keydown", l);
|
|
32
|
-
}), E(() => {
|
|
33
|
-
document && document.removeEventListener("keydown", l);
|
|
34
|
-
}), {
|
|
35
|
-
activeIdx: n,
|
|
36
|
-
selectedIdx: t
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
x as Y
|
|
41
|
-
};
|