@wikicasa-dev/components 2.0.44 → 2.0.45
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/BaseAutocomplete.js +1 -1
- package/dist/BaseDropDown.js +1 -1
- package/dist/UIKit/BaseDropDown.vue.d.ts +6 -3
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.DI5YPfeQ.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.CThPNixl.js} +1 -1
- package/dist/chunks/{BaseDropDown.vue_vue_type_script_setup_true_lang.BscSQ5bW.js → BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js} +46 -40
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/BaseAutocomplete.js
CHANGED
package/dist/BaseDropDown.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable } from '@wikicasa-dev/types';
|
|
2
|
+
import { ClassType } from './types';
|
|
2
3
|
declare function __VLS_template(): {
|
|
3
4
|
slots: {
|
|
4
5
|
btn_slot?(_: {
|
|
@@ -10,6 +11,8 @@ declare function __VLS_template(): {
|
|
|
10
11
|
toggleDropdown: () => void;
|
|
11
12
|
activeIdx: number;
|
|
12
13
|
selectedIdx: number;
|
|
14
|
+
setActiveIdx: (idx?: Nullable<number>) => void;
|
|
15
|
+
setSelectedIdx: (idx?: Nullable<number>) => void;
|
|
13
16
|
}): any;
|
|
14
17
|
};
|
|
15
18
|
refs: {
|
|
@@ -60,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
60
63
|
dataCy: string;
|
|
61
64
|
arrowWidth: number;
|
|
62
65
|
btnClasses: string;
|
|
63
|
-
labelClasses: ClassType;
|
|
64
|
-
dropdownClasses: ClassType;
|
|
66
|
+
labelClasses: string | Record<string, boolean> | ClassType[] | null;
|
|
67
|
+
dropdownClasses: string | Record<string, boolean> | ClassType[] | null;
|
|
65
68
|
withArrowIcon: boolean;
|
|
66
69
|
btnLabel: string;
|
|
67
70
|
direction: "up" | "down";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as T, mergeModels as $, useModel as L, ref as r, computed as k, onBeforeMount as F, watch as f, openBlock as C, createBlock as S, normalizeClass as H, withCtx as s, createVNode as z, renderSlot as V, createElementBlock as A, Fragment as K, renderList as N, unref as U, createElementVNode as W } from "vue";
|
|
2
2
|
import j from "../BaseInput.js";
|
|
3
|
-
import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.
|
|
3
|
+
import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
|
|
4
4
|
import "./types-B0dZ7OiV.D29wNgoj.js";
|
|
5
5
|
import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.GPFf7fjA.js";
|
|
6
6
|
import { A as J } from "./useKeyboardController.CutKeclN.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { a as
|
|
1
|
+
import { defineComponent as I, useId as L, ref as w, computed as A, useTemplateRef as E, watch as s, onBeforeMount as O, onMounted as W, onUnmounted as $, openBlock as u, createElementBlock as M, normalizeClass as i, withModifiers as v, renderSlot as b, createVNode as H, unref as a, withCtx as h, createElementVNode as N, createBlock as C, createCommentVNode as T, resolveDynamicComponent as V } from "vue";
|
|
2
|
+
import { _ as K } from "./BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
|
|
3
|
+
import { a as q } from "./ArrowIcon.CCFMdsq6.js";
|
|
4
4
|
import "./PharmacyIcon.56ql_DYl.js";
|
|
5
|
-
import { A as
|
|
6
|
-
const
|
|
5
|
+
import { A as z } from "./useKeyboardController.CutKeclN.js";
|
|
6
|
+
const R = ["innerHTML"], Q = /* @__PURE__ */ I({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "BaseDropDown",
|
|
9
9
|
props: {
|
|
@@ -24,13 +24,13 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
|
|
|
24
24
|
dataCy: { default: "" }
|
|
25
25
|
},
|
|
26
26
|
emits: ["click", "update:dropdownState"],
|
|
27
|
-
setup(
|
|
28
|
-
const o =
|
|
29
|
-
optionsLength:
|
|
27
|
+
setup(y, { emit: g }) {
|
|
28
|
+
const o = y, c = L(), p = g, t = w(!1), n = w([]), B = A(() => n.value.length), k = E("dropdown"), { activeIdx: f, selectedIdx: d } = z({
|
|
29
|
+
optionsLength: B,
|
|
30
30
|
isDropdownOpen: t,
|
|
31
31
|
activate: o.activateKeyboardController
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
s(
|
|
34
34
|
() => o.openDropdown,
|
|
35
35
|
(e) => {
|
|
36
36
|
t.value = e;
|
|
@@ -38,34 +38,38 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
|
|
|
38
38
|
{
|
|
39
39
|
immediate: !0
|
|
40
40
|
}
|
|
41
|
-
),
|
|
41
|
+
), s(t, (e) => {
|
|
42
42
|
p("update:dropdownState", e);
|
|
43
|
-
}),
|
|
43
|
+
}), s(d, (e) => {
|
|
44
44
|
e !== -1 && n.value[e].querySelector("a")?.click();
|
|
45
45
|
});
|
|
46
|
-
const
|
|
46
|
+
const m = () => {
|
|
47
47
|
t.value = !1;
|
|
48
|
-
},
|
|
48
|
+
}, r = () => {
|
|
49
49
|
o.keepState === "closed" && !t.value || o.keepState === "opened" && t.value || (t.value = !t.value);
|
|
50
|
+
}, S = (e) => {
|
|
51
|
+
e != null && (f.value = e);
|
|
52
|
+
}, D = (e) => {
|
|
53
|
+
e != null && (d.value = e);
|
|
50
54
|
};
|
|
51
|
-
return
|
|
52
|
-
o.closeWhenClickedOutside && document.body.addEventListener("click",
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
o.closeWhenClickedOutside && document.body.removeEventListener("click",
|
|
57
|
-
}), (e, l) => (
|
|
55
|
+
return O(() => {
|
|
56
|
+
o.closeWhenClickedOutside && document.body.addEventListener("click", m);
|
|
57
|
+
}), W(() => {
|
|
58
|
+
k.value && (n.value = k.value.children || []);
|
|
59
|
+
}), $(() => {
|
|
60
|
+
o.closeWhenClickedOutside && document.body.removeEventListener("click", m);
|
|
61
|
+
}), (e, l) => (u(), M("div", {
|
|
58
62
|
class: i(["uikit-relative uikit-block", e.$attrs.class]),
|
|
59
|
-
onClick: l[1] || (l[1] =
|
|
60
|
-
p("click"),
|
|
63
|
+
onClick: l[1] || (l[1] = v((U) => {
|
|
64
|
+
p("click"), r();
|
|
61
65
|
}, ["stop"]))
|
|
62
66
|
}, [
|
|
63
|
-
|
|
64
|
-
toggleDropdown:
|
|
67
|
+
b(e.$slots, "btn_slot", {
|
|
68
|
+
toggleDropdown: r,
|
|
65
69
|
isOpen: t.value
|
|
66
70
|
}, () => [
|
|
67
|
-
|
|
68
|
-
id: a(
|
|
71
|
+
H(K, {
|
|
72
|
+
id: a(c),
|
|
69
73
|
type: "button",
|
|
70
74
|
"data-cy": e.dataCy,
|
|
71
75
|
class: i([
|
|
@@ -75,24 +79,24 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
|
|
|
75
79
|
"aria-expanded": t.value,
|
|
76
80
|
"btn-class": "uikit-btn-single-selection"
|
|
77
81
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
82
|
+
default: h(() => [
|
|
83
|
+
N("span", {
|
|
80
84
|
class: i(["uikit-mr-5px", e.labelClasses]),
|
|
81
85
|
innerHTML: e.btnLabel
|
|
82
|
-
}, null, 10,
|
|
83
|
-
e.withArrowIcon ? (
|
|
86
|
+
}, null, 10, R),
|
|
87
|
+
e.withArrowIcon ? (u(), C(a(q), {
|
|
84
88
|
key: 0,
|
|
85
89
|
class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
|
|
86
90
|
width: e.arrowWidth,
|
|
87
91
|
height: e.arrowWidth,
|
|
88
92
|
"stroke-color": e.arrowStrokeColor
|
|
89
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])) :
|
|
93
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])) : T("", !0)
|
|
90
94
|
]),
|
|
91
95
|
_: 1
|
|
92
96
|
}, 8, ["id", "data-cy", "class", "aria-expanded"])
|
|
93
97
|
]),
|
|
94
|
-
(
|
|
95
|
-
id: "dropdown_" + a(
|
|
98
|
+
(u(), C(V(e.dropdownElement), {
|
|
99
|
+
id: "dropdown_" + a(c),
|
|
96
100
|
ref: "dropdown",
|
|
97
101
|
"data-cy": e.dataCy && `${e.dataCy}_dropdown`,
|
|
98
102
|
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", [
|
|
@@ -103,15 +107,17 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
|
|
|
103
107
|
{ "uikit-absolute": e.isAbsolute }
|
|
104
108
|
]]),
|
|
105
109
|
"aria-hidden": !t.value,
|
|
106
|
-
onClick: l[0] || (l[0] =
|
|
110
|
+
onClick: l[0] || (l[0] = v(() => {
|
|
107
111
|
}, ["stop"]))
|
|
108
112
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
|
|
113
|
+
default: h(() => [
|
|
114
|
+
b(e.$slots, "default", {
|
|
111
115
|
isOpen: t.value,
|
|
112
|
-
toggleDropdown:
|
|
113
|
-
activeIdx: a(
|
|
114
|
-
selectedIdx: a(
|
|
116
|
+
toggleDropdown: r,
|
|
117
|
+
activeIdx: a(f),
|
|
118
|
+
selectedIdx: a(d),
|
|
119
|
+
setActiveIdx: S,
|
|
120
|
+
setSelectedIdx: D
|
|
115
121
|
})
|
|
116
122
|
]),
|
|
117
123
|
_: 3
|
|
@@ -120,5 +126,5 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
|
|
|
120
126
|
}
|
|
121
127
|
});
|
|
122
128
|
export {
|
|
123
|
-
|
|
129
|
+
Q as _
|
|
124
130
|
};
|
package/dist/index.js
CHANGED
|
@@ -11,12 +11,12 @@ import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang
|
|
|
11
11
|
import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DdmSUyxZ.js";
|
|
12
12
|
import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.ClV6kObA.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.CThPNixl.js";
|
|
15
15
|
import { _ as v } 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.BWZPE2Gf.js";
|
|
17
17
|
import { default as O } from "./BaseCard.js";
|
|
18
18
|
import { default as R } from "./BaseComplexToggle.js";
|
|
19
|
-
import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.
|
|
19
|
+
import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
|
|
20
20
|
import { default as q } from "./BaseFloatingLabel.js";
|
|
21
21
|
import { default as z } from "./BaseIcon.js";
|
|
22
22
|
import { default as H } from "./BaseInput.js";
|