@wikicasa-dev/components 1.9.0 → 1.9.1
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
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as L, mergeModels as
|
|
1
|
+
import { defineComponent as L, mergeModels as B, useModel as H, ref as s, computed as k, onBeforeMount as K, watch as f, openBlock as y, createBlock as S, normalizeClass as z, withCtx as c, createVNode as A, renderSlot as V, createElementBlock as N, Fragment as U, renderList as F, unref as W, createElementVNode as j } from "vue";
|
|
2
2
|
import q from "../BaseInput.js";
|
|
3
3
|
import { _ as G } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.CLzTJaGp.js";
|
|
4
4
|
import "./js.cookie.CkZE2oaL.js";
|
|
5
5
|
import { _ as J } from "./SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js";
|
|
6
6
|
import { useKeyboardController as Q } from "../useKeyboardController.js";
|
|
7
|
-
function R(
|
|
8
|
-
return (...
|
|
9
|
-
|
|
7
|
+
function R(r, m) {
|
|
8
|
+
return (...v) => new Promise((l, d) => {
|
|
9
|
+
r.id && clearTimeout(r.id), r.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
|
-
const i =
|
|
11
|
+
const i = m(...v);
|
|
12
12
|
l(i);
|
|
13
13
|
} catch (i) {
|
|
14
14
|
d(i);
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, r.delay);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
20
20
|
__name: "BaseAutocomplete",
|
|
21
|
-
props: /* @__PURE__ */
|
|
21
|
+
props: /* @__PURE__ */ B({
|
|
22
22
|
border: { type: Boolean, default: !0 },
|
|
23
23
|
isValid: { default: null },
|
|
24
24
|
theme: { default: "" },
|
|
@@ -38,9 +38,9 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
38
38
|
},
|
|
39
39
|
modelModifiers: {}
|
|
40
40
|
}),
|
|
41
|
-
emits: /* @__PURE__ */
|
|
42
|
-
setup(
|
|
43
|
-
const l =
|
|
41
|
+
emits: /* @__PURE__ */ B(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
42
|
+
setup(r, { expose: m, emit: v }) {
|
|
43
|
+
const l = r, d = H(r, "modelValue"), i = v, u = s(""), n = s([]), h = s(null), p = s(!1), o = s(!1), g = s(null), O = k(() => n.value.length);
|
|
44
44
|
K(() => {
|
|
45
45
|
h.value = R({ delay: 300 }, l.onInputChangeCb);
|
|
46
46
|
});
|
|
@@ -83,7 +83,7 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
83
83
|
return "";
|
|
84
84
|
}
|
|
85
85
|
}), D = async (e) => {
|
|
86
|
-
if (
|
|
86
|
+
if (console.log("BaseAutocomplete", { v: e }), 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;
|
|
@@ -91,14 +91,14 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
91
91
|
l.disableCb || (n.value = await h.value(e), o.value = !!n.value.length);
|
|
92
92
|
}
|
|
93
93
|
}, $ = (e, t) => {
|
|
94
|
-
l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (n.value = []), p.value = !0,
|
|
94
|
+
l.onOptionSelectedCb && l.onOptionSelectedCb(e), l.cleanupOnClose && (n.value = []), p.value = !0, u.value = e.label, d.value = e, o.value = !1, C.value = t;
|
|
95
95
|
}, E = () => {
|
|
96
96
|
n.value.length && l.keepState !== "closed" && (o.value = !0);
|
|
97
97
|
};
|
|
98
98
|
return f(
|
|
99
99
|
d,
|
|
100
100
|
(e, t) => {
|
|
101
|
-
e
|
|
101
|
+
e === t || e?.label === u.value || (u.value = e?.label || "");
|
|
102
102
|
},
|
|
103
103
|
{ immediate: !0 }
|
|
104
104
|
), f(C, (e) => {
|
|
@@ -112,11 +112,11 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
112
112
|
}
|
|
113
113
|
), f(o, (e) => {
|
|
114
114
|
i("update:dropdownState", e);
|
|
115
|
-
}),
|
|
115
|
+
}), m({
|
|
116
116
|
select: () => {
|
|
117
117
|
g.value?.select();
|
|
118
118
|
}
|
|
119
|
-
}), (e, t) => (y(),
|
|
119
|
+
}), (e, t) => (y(), S(G, {
|
|
120
120
|
class: z(e.$attrs["root-classes"]),
|
|
121
121
|
"data-cy": `ac_${e.$attrs.id}`,
|
|
122
122
|
"dropdown-element": "ul",
|
|
@@ -133,20 +133,20 @@ const X = ["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] = (
|
|
136
|
+
"onUpdate:dropdownState": t[3] || (t[3] = (a) => o.value = a),
|
|
137
|
+
onClick: t[4] || (t[4] = (a) => {
|
|
138
138
|
i("click"), E();
|
|
139
139
|
}),
|
|
140
140
|
"close-when-clicked-outside": e.closeDropdownOnBodyPressed
|
|
141
141
|
}, {
|
|
142
142
|
btn_slot: c(() => [
|
|
143
|
-
|
|
143
|
+
A(q, {
|
|
144
144
|
id: `ac_input_${e.$attrs.id}`,
|
|
145
145
|
ref_key: "baseInput",
|
|
146
146
|
ref: g,
|
|
147
147
|
"data-cy": `ac_input_${e.$attrs.id}`,
|
|
148
148
|
"label-text": e.label,
|
|
149
|
-
"model-value":
|
|
149
|
+
"model-value": u.value,
|
|
150
150
|
"is-valid": e.isValid,
|
|
151
151
|
disabled: e.$attrs.disabled,
|
|
152
152
|
placeholder: e.$attrs.placeholder,
|
|
@@ -158,30 +158,30 @@ const X = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
|
158
158
|
"!uikit-ml-0 !uikit-w-full"
|
|
159
159
|
],
|
|
160
160
|
"fieldset-classes": [I.value, e.$attrs["fieldset-classes"]],
|
|
161
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
162
|
-
onKeydown: t[1] || (t[1] = (
|
|
161
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => D(a === void 0 ? "" : `${a}`)),
|
|
162
|
+
onKeydown: t[1] || (t[1] = (a) => i("keydown", a)),
|
|
163
163
|
onKeydownEnterPressed: t[2] || (t[2] = () => i("keydownEnterPressed"))
|
|
164
164
|
}, {
|
|
165
165
|
leftIcon: c(() => [
|
|
166
|
-
|
|
166
|
+
V(e.$slots, "lefticon")
|
|
167
167
|
]),
|
|
168
|
-
righticon: c(({ handleClean:
|
|
169
|
-
|
|
168
|
+
righticon: c(({ handleClean: a }) => [
|
|
169
|
+
V(e.$slots, "righticon", { handleClean: a })
|
|
170
170
|
]),
|
|
171
171
|
_: 3
|
|
172
172
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
|
|
173
173
|
]),
|
|
174
174
|
default: c(() => [
|
|
175
|
-
(y(!0), U
|
|
175
|
+
(y(!0), N(U, null, F(n.value, (a, b) => (y(), S(J, {
|
|
176
176
|
key: b,
|
|
177
177
|
active: W(w) === b,
|
|
178
178
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
179
|
-
onClick: (T) => $(
|
|
179
|
+
onClick: (T) => $(a, b),
|
|
180
180
|
onMouseover: (T) => w.value = b
|
|
181
181
|
}, {
|
|
182
182
|
default: c(() => [
|
|
183
183
|
j("span", {
|
|
184
|
-
innerHTML:
|
|
184
|
+
innerHTML: a.label
|
|
185
185
|
}, null, 8, X)
|
|
186
186
|
]),
|
|
187
187
|
_: 2
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ 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.BYlMCUWP.js";
|
|
12
12
|
import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.CM86-jVN.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.CMkn7bj5.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";
|