@wikicasa-dev/components 1.3.6 → 1.4.0
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/UIKit/BaseAutocomplete.vue.d.ts +2 -2
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.D5NYtmuS.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.DbIX6YbP.js} +36 -34
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/BaseAutocomplete.js
CHANGED
|
@@ -51,7 +51,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
51
51
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
52
52
|
click: () => void;
|
|
53
53
|
keydown: (args_0: KeyboardEvent) => void;
|
|
54
|
-
|
|
54
|
+
"update:dropdownState": (args_0: boolean) => void;
|
|
55
55
|
changedValue: (args_0: string) => void;
|
|
56
56
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
57
|
modelValue: import("vue").PropType<ModelValueType<unknown> | undefined>;
|
|
@@ -102,7 +102,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
102
102
|
}>> & {
|
|
103
103
|
onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
104
104
|
onClick?: (() => any) | undefined;
|
|
105
|
-
|
|
105
|
+
"onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
106
106
|
onChangedValue?: ((args_0: string) => any) | undefined;
|
|
107
107
|
}, {
|
|
108
108
|
label: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as H, mergeModels as S, useModel as P, ref as s, computed as f, onBeforeMount as z, watch as
|
|
1
|
+
import { defineComponent as H, mergeModels as S, useModel as P, ref as s, computed as f, onBeforeMount as z, watch as k, 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(d,
|
|
8
|
-
return (...
|
|
7
|
+
function R(d, v) {
|
|
8
|
+
return (...m) => new Promise((t, n) => {
|
|
9
9
|
d.id && clearTimeout(d.id), d.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
|
-
const i =
|
|
12
|
-
|
|
11
|
+
const i = v(...m);
|
|
12
|
+
t(i);
|
|
13
13
|
} catch (i) {
|
|
14
14
|
n(i);
|
|
15
15
|
}
|
|
@@ -38,41 +38,41 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
38
38
|
},
|
|
39
39
|
modelModifiers: {}
|
|
40
40
|
}),
|
|
41
|
-
emits: /* @__PURE__ */ S(["
|
|
42
|
-
setup(d, { expose:
|
|
43
|
-
const
|
|
41
|
+
emits: /* @__PURE__ */ S(["update:dropdownState", "changedValue", "click", "keydown"], ["update:modelValue"]),
|
|
42
|
+
setup(d, { expose: v, emit: m }) {
|
|
43
|
+
const t = d, n = P(d, "modelValue"), i = m, u = s(""), o = s([]), h = s(null), p = s(!1), l = s(!1), y = s(null), O = f(() => o.value.length);
|
|
44
44
|
z(() => {
|
|
45
|
-
u.value = n.value?.label || "",
|
|
45
|
+
u.value = n.value?.label || "", h.value = R({ delay: 300 }, t.onInputChangeCb);
|
|
46
46
|
});
|
|
47
|
-
const { activeIdx:
|
|
47
|
+
const { activeIdx: w, selectedIdx: C } = Q({
|
|
48
48
|
optionsLength: O,
|
|
49
|
-
isDropdownOpen:
|
|
49
|
+
isDropdownOpen: l,
|
|
50
50
|
disableSpaceHandler: !0
|
|
51
51
|
}), M = f(() => {
|
|
52
|
-
switch (
|
|
52
|
+
switch (t.theme) {
|
|
53
53
|
case "bordered":
|
|
54
54
|
return "";
|
|
55
55
|
case "all-bordered":
|
|
56
|
-
return "uikit-rounded " + (
|
|
56
|
+
return "uikit-rounded " + (l.value && "uikit-rounded-b-none");
|
|
57
57
|
case "all-bordered-thick":
|
|
58
|
-
return "uikit-rounded-xl !uikit-h-[60px] " + (
|
|
58
|
+
return "uikit-rounded-xl !uikit-h-[60px] " + (l.value && "uikit-rounded-b-none");
|
|
59
59
|
default:
|
|
60
60
|
return "";
|
|
61
61
|
}
|
|
62
62
|
}), I = f(() => {
|
|
63
|
-
switch (
|
|
63
|
+
switch (t.theme) {
|
|
64
64
|
case "bordered":
|
|
65
65
|
return "";
|
|
66
66
|
case "all-bordered":
|
|
67
|
-
return "uikit-border uikit-border-w-lavender uikit-border-solid uikit-rounded " + (
|
|
67
|
+
return "uikit-border uikit-border-w-lavender uikit-border-solid uikit-rounded " + (l.value ? "uikit-border-b-0 uikit-rounded-b-none" : "");
|
|
68
68
|
case "all-bordered-thick":
|
|
69
|
-
return "uikit-rounded-xl !uikit-h-[60px]" + (
|
|
69
|
+
return "uikit-rounded-xl !uikit-h-[60px]" + (l.value && "uikit-rounded-b-none");
|
|
70
70
|
default:
|
|
71
71
|
return "";
|
|
72
72
|
}
|
|
73
73
|
}), D = f(() => {
|
|
74
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";
|
|
75
|
-
switch (
|
|
75
|
+
switch (t.theme) {
|
|
76
76
|
case "bordered":
|
|
77
77
|
return "before:uikit-content-[''] before:uikit-absolute before:uikit-w-1/2 before:uikit-border-b before:uikit-border-b-w-lavender before:[border-bottom-style:solid] before:uikit-right-1/4 uikit-rounded-b-xl uikit-shadow uikit-rounded-t-none uikit-mt-5px uikit-mb-0";
|
|
78
78
|
case "all-bordered":
|
|
@@ -83,31 +83,33 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
83
83
|
return "";
|
|
84
84
|
}
|
|
85
85
|
}), T = async (e) => {
|
|
86
|
-
if (u.value !== e && (i("changedValue", e), u.value = e, !!
|
|
86
|
+
if (u.value !== e && (i("changedValue", e), u.value = e, !!t.onInputChangeCb)) {
|
|
87
87
|
if (!e || p.value) {
|
|
88
|
-
o.value = [], p.value = !1,
|
|
88
|
+
o.value = [], p.value = !1, C.value = -1, w.value = -1, n.value && (n.value.label = ""), l.value = !1, await h.value(null);
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
t.disableCb || (o.value = await h.value(e), console.log({ options: JSON.parse(JSON.stringify(o.value)) }), l.value = !!o.value.length);
|
|
92
92
|
}
|
|
93
93
|
}, $ = (e, a) => {
|
|
94
|
-
|
|
94
|
+
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (o.value = []), p.value = !0, u.value = e.label, n.value = e, l.value = !1, C.value = a;
|
|
95
95
|
}, L = () => {
|
|
96
|
-
o.value.length &&
|
|
96
|
+
o.value.length && t.keepState !== "closed" && (l.value = !0);
|
|
97
97
|
};
|
|
98
|
-
return
|
|
98
|
+
return k(n, (e, a) => {
|
|
99
99
|
e !== a && (u.value = e?.label || "");
|
|
100
|
-
}), C
|
|
100
|
+
}), k(C, (e) => {
|
|
101
101
|
if (e === -1 || !o.value.length)
|
|
102
102
|
return;
|
|
103
103
|
const a = o.value[e];
|
|
104
104
|
p.value && a.label === n.value?.label || $(a, e);
|
|
105
|
-
}),
|
|
106
|
-
() =>
|
|
105
|
+
}), k(
|
|
106
|
+
() => t.keepState,
|
|
107
107
|
(e) => {
|
|
108
|
-
e === "closed" ? (
|
|
108
|
+
e === "closed" ? (l.value = !1, t.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (l.value = !0);
|
|
109
109
|
}
|
|
110
|
-
), k({
|
|
110
|
+
), k(l, (e) => {
|
|
111
|
+
i("update:dropdownState", e);
|
|
112
|
+
}), v({
|
|
111
113
|
select: () => {
|
|
112
114
|
y.value?.select();
|
|
113
115
|
}
|
|
@@ -126,9 +128,9 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
126
128
|
"!uikit-max-h-[210px] uikit-z-10",
|
|
127
129
|
e.dropdownClasses
|
|
128
130
|
],
|
|
129
|
-
"open-dropdown":
|
|
130
|
-
"keep-state": !o.value.length ||
|
|
131
|
-
"onUpdate:dropdownState": a[1] || (a[1] = (r) =>
|
|
131
|
+
"open-dropdown": l.value,
|
|
132
|
+
"keep-state": !o.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
133
|
+
"onUpdate:dropdownState": a[1] || (a[1] = (r) => l.value = r),
|
|
132
134
|
onClick: a[2] || (a[2] = (r) => {
|
|
133
135
|
i("click"), L();
|
|
134
136
|
}),
|
|
@@ -167,10 +169,10 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ H({
|
|
|
167
169
|
default: c(() => [
|
|
168
170
|
(g(!0), K(U, null, A(o.value, (r, b) => (g(), V(G, {
|
|
169
171
|
key: b,
|
|
170
|
-
active: F(
|
|
172
|
+
active: F(w) === b,
|
|
171
173
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
172
174
|
onClick: (N) => $(r, b),
|
|
173
|
-
onMouseover: (N) =>
|
|
175
|
+
onMouseover: (N) => w.value = b
|
|
174
176
|
}, {
|
|
175
177
|
default: c(() => [
|
|
176
178
|
W("span", {
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { _ as c } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang
|
|
|
10
10
|
import { _ as b } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.C-jm5z4e.js";
|
|
11
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.DbIX6YbP.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";
|