@wikicasa-dev/components 2.1.4-alpha.20 → 2.1.4-alpha.21
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.uikit-
|
|
1
|
+
.uikit-base-autocomplete.uikit-input-wrapper{--input-height: 40px}.uikit-base-autocomplete.uikit-input-wrapper .text-input-icon{--icon-top: 10px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, mergeModels as g, useModel as K, ref as r, computed as $, onBeforeMount as N, watch as C, createBlock as
|
|
1
|
+
import { defineComponent as H, mergeModels as g, useModel as K, ref as r, computed as $, onBeforeMount as N, watch as C, createBlock as b, openBlock as m, normalizeClass as U, withCtx as c, renderSlot as B, createElementBlock as A, Fragment as F, renderList as T, unref as S, createCommentVNode as j, createElementVNode as V, resolveDynamicComponent as W, createVNode as X, createSlots as q, withDirectives as G, vShow as J } from "vue";
|
|
2
2
|
import Q from "./BaseInput.vue.js";
|
|
3
3
|
import '../../../../assets/packages/components/lib/UIKit/BaseInput.css';/* empty css */
|
|
4
4
|
import R from "./BaseDropDown.vue.js";
|
|
@@ -32,21 +32,21 @@ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
|
|
|
32
32
|
}),
|
|
33
33
|
emits: /* @__PURE__ */ g(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
34
34
|
setup(o, { expose: D, emit: I }) {
|
|
35
|
-
const u = K(o, "modelValue"), s = I, i = r(""), a = r([]),
|
|
35
|
+
const u = K(o, "modelValue"), s = I, i = r(""), a = r([]), f = r(null), n = r(!1), w = r(null), O = $(() => a.value.length);
|
|
36
36
|
N(() => {
|
|
37
|
-
|
|
37
|
+
f.value = Y({ delay: 300 }, o.onInputChangeCb);
|
|
38
38
|
});
|
|
39
|
-
const { activeIdx:
|
|
39
|
+
const { activeIdx: v, selectedIdx: d } = x({
|
|
40
40
|
optionsLength: O,
|
|
41
41
|
isDropdownOpen: n,
|
|
42
42
|
disableSpaceHandler: !0
|
|
43
43
|
}), y = $(() => d.value !== -1), M = async (e) => {
|
|
44
44
|
if (i.value !== e && (s("changedValue", e), i.value = e, !!o.onInputChangeCb)) {
|
|
45
45
|
if (!e || y.value) {
|
|
46
|
-
a.value = [], d.value = -1,
|
|
46
|
+
a.value = [], d.value = -1, v.value = -1, u.value && (u.value.label = ""), n.value = !1, await f.value?.("");
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
o.disableCb || !
|
|
49
|
+
o.disableCb || !f.value || (a.value = await f.value(e), n.value = !!a.value.length);
|
|
50
50
|
}
|
|
51
51
|
}, h = (e, t) => {
|
|
52
52
|
o.onOptionSelectedCb && o.onOptionSelectedCb(e), o.cleanupOnClose && (a.value = []), i.value = e.label, u.value = e, n.value = !1, d.value = t;
|
|
@@ -71,13 +71,13 @@ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
|
|
|
71
71
|
{ immediate: !0 }
|
|
72
72
|
);
|
|
73
73
|
const P = () => {
|
|
74
|
-
|
|
74
|
+
w.value?.select();
|
|
75
75
|
}, L = () => {
|
|
76
76
|
s("click"), E(), a.value.length && (n.value = !0);
|
|
77
77
|
};
|
|
78
78
|
return D({
|
|
79
79
|
select: P
|
|
80
|
-
}), (e, t) => (
|
|
80
|
+
}), (e, t) => (m(), b(R, {
|
|
81
81
|
open: n.value,
|
|
82
82
|
"onUpdate:open": t[3] || (t[3] = (l) => n.value = l),
|
|
83
83
|
class: U(e.$attrs["root-classes"]),
|
|
@@ -89,11 +89,12 @@ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
|
|
|
89
89
|
"onUpdate:dropdownState": t[4] || (t[4] = (l) => n.value = l),
|
|
90
90
|
onClick: L
|
|
91
91
|
}, {
|
|
92
|
-
btn_slot:
|
|
92
|
+
btn_slot: c(() => [
|
|
93
93
|
X(Q, {
|
|
94
94
|
id: e.$attrs.id ? `ac_input_${e.$attrs.id}` : "",
|
|
95
95
|
ref_key: "baseInput",
|
|
96
|
-
ref:
|
|
96
|
+
ref: w,
|
|
97
|
+
class: "uikit-base-autocomplete",
|
|
97
98
|
"data-cy": e.dataCy ? `ac_input_${e.dataCy}` : `ac_input_${e.$attrs.id}`,
|
|
98
99
|
"model-value": i.value,
|
|
99
100
|
"is-valid": e.isValid,
|
|
@@ -108,14 +109,14 @@ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
|
|
|
108
109
|
}, q({ _: 2 }, [
|
|
109
110
|
e.$slots.leftIcon ? {
|
|
110
111
|
name: "leftIcon",
|
|
111
|
-
fn:
|
|
112
|
+
fn: c(() => [
|
|
112
113
|
B(e.$slots, "leftIcon")
|
|
113
114
|
]),
|
|
114
115
|
key: "0"
|
|
115
116
|
} : void 0,
|
|
116
117
|
e.withCleanBtn ? {
|
|
117
118
|
name: "rightIcon",
|
|
118
|
-
fn:
|
|
119
|
+
fn: c(({ handleClean: l }) => [
|
|
119
120
|
G(V("span", {
|
|
120
121
|
class: "text-input-icon right uikit-flex uikit-size-md uikit-cursor-pointer uikit-items-center uikit-justify-center uikit-rounded-full uikit-bg-w-lightgray uikit-text uikit-font-semibold uikit-text-white",
|
|
121
122
|
onClick: l
|
|
@@ -127,20 +128,20 @@ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
|
|
|
127
128
|
} : void 0
|
|
128
129
|
]), 1032, ["id", "data-cy", "model-value", "is-valid", "disabled", "placeholder", "input-class", "fieldset-classes", "with-border"])
|
|
129
130
|
]),
|
|
130
|
-
default:
|
|
131
|
+
default: c(({ toggleDropdown: l }) => [
|
|
131
132
|
B(e.$slots, "dropdown", {
|
|
132
133
|
options: a.value,
|
|
133
134
|
toggleDropdown: l
|
|
134
135
|
}, () => [
|
|
135
|
-
(
|
|
136
|
+
(m(!0), A(F, null, T(a.value, (p, k) => (m(), b(Z, {
|
|
136
137
|
key: k,
|
|
137
|
-
active: S(
|
|
138
|
+
active: S(v) === k,
|
|
138
139
|
class: "uikit-relative uikit-flex uikit-gap-x-xs uikit-rounded-[5px] uikit-p-md uikit-py-xs uikit-text after:uikit-absolute after:uikit-bottom-0 after:uikit-left-1/2 after:uikit-h-[1px] after:uikit-w-[95%] after:-uikit-translate-x-1/2 after:uikit-bg-w-lightgray after:uikit-content-[''] after:last:uikit-hidden hover:uikit-cursor-pointer",
|
|
139
140
|
onClick: (z) => h(p, k),
|
|
140
|
-
onMouseover: (z) =>
|
|
141
|
+
onMouseover: (z) => v.value = k
|
|
141
142
|
}, {
|
|
142
|
-
default:
|
|
143
|
-
p.icon ? (
|
|
143
|
+
default: c(() => [
|
|
144
|
+
p.icon ? (m(), b(W(p.icon), { key: 0 })) : j("", !0),
|
|
144
145
|
V("span", {
|
|
145
146
|
innerHTML: p.label
|
|
146
147
|
}, null, 8, ee)
|