@wikicasa-dev/components 2.0.24 → 2.0.26
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 +1 -0
- package/dist/chunks/{BaseAutocomplete.vue_vue_type_script_setup_true_lang.CCR6X0si.js → BaseAutocomplete.vue_vue_type_script_setup_true_lang.Dc3hSghV.js} +22 -21
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/BaseAutocomplete.js
CHANGED
|
@@ -26,6 +26,7 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
|
|
|
26
26
|
closeDropdownOnBodyPressed?: boolean;
|
|
27
27
|
inputClasses?: ClassTypeProp;
|
|
28
28
|
fieldsetClasses?: ClassTypeProp;
|
|
29
|
+
dataCy?: string;
|
|
29
30
|
})> & import('vue').PublicProps;
|
|
30
31
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
31
32
|
select: () => void;
|
|
@@ -8,10 +8,10 @@ function Q(t, p) {
|
|
|
8
8
|
return (...v) => new Promise((d, u) => {
|
|
9
9
|
t.id && clearTimeout(t.id), t.id = setTimeout(() => {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
d(
|
|
13
|
-
} catch (
|
|
14
|
-
u(
|
|
11
|
+
const i = p(...v);
|
|
12
|
+
d(i);
|
|
13
|
+
} catch (i) {
|
|
14
|
+
u(i);
|
|
15
15
|
}
|
|
16
16
|
}, t.delay);
|
|
17
17
|
});
|
|
@@ -30,7 +30,8 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
30
30
|
dropdownClasses: { default: "" },
|
|
31
31
|
closeDropdownOnBodyPressed: { type: Boolean, default: !0 },
|
|
32
32
|
inputClasses: {},
|
|
33
|
-
fieldsetClasses: {}
|
|
33
|
+
fieldsetClasses: {},
|
|
34
|
+
dataCy: { default: "" }
|
|
34
35
|
}, {
|
|
35
36
|
modelValue: {
|
|
36
37
|
default() {
|
|
@@ -44,7 +45,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
44
45
|
const d = L(
|
|
45
46
|
t,
|
|
46
47
|
"modelValue"
|
|
47
|
-
), u = v,
|
|
48
|
+
), u = v, i = r(""), n = r([]), m = r(null), c = r(!1), o = r(!1), y = r(null), B = k(() => n.value.length);
|
|
48
49
|
F(() => {
|
|
49
50
|
m.value = Q({ delay: 300 }, t.onInputChangeCb);
|
|
50
51
|
});
|
|
@@ -87,7 +88,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
87
88
|
return "";
|
|
88
89
|
}
|
|
89
90
|
}), P = async (e) => {
|
|
90
|
-
if (
|
|
91
|
+
if (i.value !== e && (u("changedValue", e), i.value = e, !!t.onInputChangeCb)) {
|
|
91
92
|
if (!e || c.value) {
|
|
92
93
|
n.value = [], c.value = !1, w.value = -1, h.value = -1, d.value && (d.value.label = ""), o.value = !1, await m.value(null);
|
|
93
94
|
return;
|
|
@@ -95,14 +96,14 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
95
96
|
t.disableCb || (n.value = await m.value(e), o.value = !!n.value.length);
|
|
96
97
|
}
|
|
97
98
|
}, g = (e, l) => {
|
|
98
|
-
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (n.value = []), c.value = !0,
|
|
99
|
+
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (n.value = []), c.value = !0, i.value = e.label, d.value = e, o.value = !1, w.value = l;
|
|
99
100
|
}, D = () => {
|
|
100
101
|
n.value.length && t.keepState !== "closed" && (o.value = !0);
|
|
101
102
|
};
|
|
102
103
|
return f(
|
|
103
104
|
d,
|
|
104
105
|
(e, l) => {
|
|
105
|
-
e === l || e?.label ===
|
|
106
|
+
e === l || e?.label === i.value || (i.value = e?.label || "");
|
|
106
107
|
},
|
|
107
108
|
{ immediate: !0 }
|
|
108
109
|
), f(w, (e) => {
|
|
@@ -122,7 +123,7 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
122
123
|
}
|
|
123
124
|
}), (e, l) => (C(), S(q, {
|
|
124
125
|
class: H(e.$attrs["root-classes"]),
|
|
125
|
-
"data-cy": `ac_${e.$attrs.id}`,
|
|
126
|
+
"data-cy": e.dataCy ? `ac_${e.dataCy}` : `ac_${e.$attrs.id}`,
|
|
126
127
|
"dropdown-element": "ul",
|
|
127
128
|
"dropdown-classes": [
|
|
128
129
|
{ "bordered-dropdown": e.theme === "bordered" },
|
|
@@ -139,8 +140,8 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
139
140
|
"keep-state": !n.value.length || e.keepState === "closed" ? "closed" : "opened",
|
|
140
141
|
"close-when-clicked-outside": e.closeDropdownOnBodyPressed,
|
|
141
142
|
"activate-keyboard-controller": !1,
|
|
142
|
-
"onUpdate:dropdownState": l[3] || (l[3] = (
|
|
143
|
-
onClick: l[4] || (l[4] = (
|
|
143
|
+
"onUpdate:dropdownState": l[3] || (l[3] = (a) => o.value = a),
|
|
144
|
+
onClick: l[4] || (l[4] = (a) => {
|
|
144
145
|
u("click"), D();
|
|
145
146
|
})
|
|
146
147
|
}, {
|
|
@@ -149,9 +150,9 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
149
150
|
id: `ac_input_${e.$attrs.id}`,
|
|
150
151
|
ref_key: "baseInput",
|
|
151
152
|
ref: y,
|
|
152
|
-
"data-cy": `ac_input_${e.$attrs.id}`,
|
|
153
|
+
"data-cy": e.dataCy ? `ac_input_${e.dataCy}` : `ac_input_${e.$attrs.id}`,
|
|
153
154
|
"label-text": e.label,
|
|
154
|
-
"model-value":
|
|
155
|
+
"model-value": i.value,
|
|
155
156
|
"is-valid": e.isValid,
|
|
156
157
|
disabled: e.$attrs.disabled,
|
|
157
158
|
placeholder: e.$attrs.placeholder,
|
|
@@ -163,30 +164,30 @@ const R = ["innerHTML"], le = /* @__PURE__ */ T({
|
|
|
163
164
|
"!uikit-ml-0 !uikit-w-full"
|
|
164
165
|
],
|
|
165
166
|
"fieldset-classes": [I.value, e.fieldsetClasses],
|
|
166
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
167
|
-
onKeydown: l[1] || (l[1] = (
|
|
167
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => P(a === void 0 ? "" : `${a}`)),
|
|
168
|
+
onKeydown: l[1] || (l[1] = (a) => u("keydown", a)),
|
|
168
169
|
onKeydownEnterPressed: l[2] || (l[2] = () => u("keydownEnterPressed"))
|
|
169
170
|
}, {
|
|
170
171
|
leftIcon: s(() => [
|
|
171
172
|
V(e.$slots, "lefticon")
|
|
172
173
|
]),
|
|
173
|
-
righticon: s(({ handleClean:
|
|
174
|
-
V(e.$slots, "righticon", { handleClean:
|
|
174
|
+
righticon: s(({ handleClean: a }) => [
|
|
175
|
+
V(e.$slots, "righticon", { handleClean: a })
|
|
175
176
|
]),
|
|
176
177
|
_: 3
|
|
177
178
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
|
|
178
179
|
]),
|
|
179
180
|
default: s(() => [
|
|
180
|
-
(C(!0), A(K, null, N(n.value, (
|
|
181
|
+
(C(!0), A(K, null, N(n.value, (a, b) => (C(), S(G, {
|
|
181
182
|
key: b,
|
|
182
183
|
active: U(h) === b,
|
|
183
184
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
184
|
-
onClick: (E) => g(
|
|
185
|
+
onClick: (E) => g(a, b),
|
|
185
186
|
onMouseover: (E) => h.value = b
|
|
186
187
|
}, {
|
|
187
188
|
default: s(() => [
|
|
188
189
|
W("span", {
|
|
189
|
-
innerHTML:
|
|
190
|
+
innerHTML: a.label
|
|
190
191
|
}, null, 8, R)
|
|
191
192
|
]),
|
|
192
193
|
_: 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.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.Dc3hSghV.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";
|