@wikicasa-dev/components 2.2.9-alpha.11 → 2.2.9-alpha.12
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/Swiper/autoplay.js +1 -1
- package/dist/Swiper/controller.js +1 -1
- package/dist/Swiper/keyboard.js +1 -1
- package/dist/Swiper/thumbs.js +1 -1
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +62 -74
- package/package.json +1 -1
- /package/dist/assets/{swiper-controller.css → swiper-keyboard.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as W, mergeModels as V, useModel as C, useId as D, useTemplateRef as b, shallowRef as c, onBeforeMount as N, watch as y, nextTick as A, createBlock as $, openBlock as w, withCtx as h, createElementBlock as H, Fragment as P, renderList as X, renderSlot as p, createElementVNode as u, normalizeClass as f, withDirectives as F, unref as j, vModelText as q, toDisplayString as G, withModifiers as J, normalizeStyle as Q, createTextVNode as Y, vShow as Z } from "vue";
|
|
2
|
+
import _ from "../BaseDropDown.vue.js";
|
|
3
3
|
import '../../../../../assets/BaseDropDown.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import { debounce as
|
|
6
|
-
const
|
|
4
|
+
import ee from "../BaseSelect/SelectItem.vue.js";
|
|
5
|
+
import { debounce as te } from "@wikicasa-dev/utilities";
|
|
6
|
+
const le = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], de = /* @__PURE__ */ W({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ V({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
11
|
enableKeyboardController: { type: Boolean, default: !0 },
|
|
@@ -28,78 +28,68 @@ const oe = ["id", "data-cy", "placeholder"], ae = ["innerHTML"], pe = /* @__PURE
|
|
|
28
28
|
},
|
|
29
29
|
inputValueModifiers: {}
|
|
30
30
|
}),
|
|
31
|
-
emits: /* @__PURE__ */
|
|
31
|
+
emits: /* @__PURE__ */ V(["click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
|
|
32
32
|
setup(l, { expose: O, emit: R }) {
|
|
33
|
-
const s = C(l, "open"),
|
|
34
|
-
o.value = o.value ??
|
|
35
|
-
const v = R,
|
|
36
|
-
o.value = "",
|
|
37
|
-
},
|
|
33
|
+
const s = C(l, "open"), i = C(l, "modelValue"), o = C(l, "inputValue");
|
|
34
|
+
o.value = o.value ?? i.value?.label ?? "";
|
|
35
|
+
const v = R, x = D(), k = b("inputRef"), d = c(0), m = c(!1), g = c(null), a = c([]), S = b("dropdownRef"), T = b("hiddenSpan"), E = () => {
|
|
36
|
+
o.value = "", i.value = null;
|
|
37
|
+
}, U = async (t) => {
|
|
38
38
|
if (!t) {
|
|
39
|
-
|
|
39
|
+
a.value = [], s.value = !1;
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
l.disableCb || (
|
|
43
|
-
},
|
|
44
|
-
const e =
|
|
45
|
-
!e || e.id ===
|
|
46
|
-
},
|
|
47
|
-
|
|
42
|
+
l.disableCb || (a.value = await g.value?.(t) || [], m.value = !0, s.value = !!a.value.length);
|
|
43
|
+
}, B = (t = -1) => {
|
|
44
|
+
const e = a.value[t];
|
|
45
|
+
!e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, s.value = !1, i.value = e, a.value = []);
|
|
46
|
+
}, I = () => {
|
|
47
|
+
k.value?.select();
|
|
48
48
|
}, z = () => {
|
|
49
|
-
|
|
49
|
+
k.value?.focus();
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}),
|
|
54
|
-
[o, () =>
|
|
51
|
+
return N(() => {
|
|
52
|
+
g.value = te({ delay: 300 }, l.onInputChangeCb);
|
|
53
|
+
}), y(
|
|
54
|
+
[o, () => T.value],
|
|
55
55
|
([, t]) => {
|
|
56
|
-
t &&
|
|
56
|
+
t && A(() => {
|
|
57
57
|
if (!t) return;
|
|
58
58
|
const e = t.offsetWidth;
|
|
59
|
-
e !==
|
|
59
|
+
e !== d.value && (d.value = e);
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
{ immediate: !0 }
|
|
63
|
-
),
|
|
64
|
-
() =>
|
|
63
|
+
), y(
|
|
64
|
+
() => S.value?.selectedIdx,
|
|
65
65
|
(t) => {
|
|
66
66
|
const e = t ?? -1;
|
|
67
|
-
e !== -1 &&
|
|
67
|
+
e !== -1 && B(e);
|
|
68
68
|
}
|
|
69
|
-
),
|
|
70
|
-
|
|
69
|
+
), y(
|
|
70
|
+
i,
|
|
71
71
|
(t, e) => {
|
|
72
|
-
|
|
73
|
-
if (k.value) {
|
|
74
|
-
k.value = !1;
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
o.value = t?.label || "";
|
|
78
|
-
}
|
|
72
|
+
t === e || t?.label === o.value || (o.value = t?.label || "");
|
|
79
73
|
},
|
|
80
74
|
{ immediate: !0 }
|
|
81
75
|
), O({
|
|
82
|
-
getRootElement: () =>
|
|
83
|
-
select:
|
|
76
|
+
getRootElement: () => S.value?.getRootElement(),
|
|
77
|
+
select: I,
|
|
84
78
|
focus: z
|
|
85
|
-
})
|
|
86
|
-
const D = (t) => {
|
|
87
|
-
console.log("DEBUG:", t);
|
|
88
|
-
};
|
|
89
|
-
return (t, e) => (h(), F(te, {
|
|
79
|
+
}), (t, e) => (w(), $(_, {
|
|
90
80
|
ref: "dropdownRef",
|
|
91
81
|
class: "uikit-clearable-autocomplete",
|
|
92
82
|
"data-cy": l.dataCy,
|
|
93
83
|
"dropdown-element": "ul",
|
|
94
84
|
"dropdown-classes": ["uikit-z-30", l.dropdownClasses],
|
|
95
85
|
"open-dropdown": s.value,
|
|
96
|
-
"keep-state": !
|
|
86
|
+
"keep-state": !a.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
97
87
|
"activate-keyboard-controller": l.enableKeyboardController,
|
|
98
|
-
"reset-keyboard-controller":
|
|
99
|
-
"onUpdate:resetKeyboardController": e[4] || (e[4] = (n) =>
|
|
88
|
+
"reset-keyboard-controller": m.value,
|
|
89
|
+
"onUpdate:resetKeyboardController": e[4] || (e[4] = (n) => m.value = n),
|
|
100
90
|
"onUpdate:dropdownState": e[5] || (e[5] = (n) => s.value = n)
|
|
101
91
|
}, {
|
|
102
|
-
btn_slot:
|
|
92
|
+
btn_slot: h(() => [
|
|
103
93
|
u("div", {
|
|
104
94
|
class: f(["uikit-text-16", l.triggerWrapperClasses]),
|
|
105
95
|
onClick: e[3] || (e[3] = (n) => v("click", n))
|
|
@@ -108,13 +98,13 @@ const oe = ["id", "data-cy", "placeholder"], ae = ["innerHTML"], pe = /* @__PURE
|
|
|
108
98
|
u("div", {
|
|
109
99
|
class: f(["uikit-relative", l.inputWrapperClasses])
|
|
110
100
|
}, [
|
|
111
|
-
|
|
101
|
+
F(u("input", {
|
|
112
102
|
ref: "inputRef",
|
|
113
103
|
"onUpdate:modelValue": [
|
|
114
104
|
e[0] || (e[0] = (n) => o.value = n),
|
|
115
|
-
|
|
105
|
+
U
|
|
116
106
|
],
|
|
117
|
-
id:
|
|
107
|
+
id: j(x),
|
|
118
108
|
"data-cy": l.dataCy ? `ac_input_${l.dataCy}` : "",
|
|
119
109
|
type: "text",
|
|
120
110
|
autocomplete: "off",
|
|
@@ -124,59 +114,57 @@ const oe = ["id", "data-cy", "placeholder"], ae = ["innerHTML"], pe = /* @__PURE
|
|
|
124
114
|
fontSize: "inherit"
|
|
125
115
|
},
|
|
126
116
|
placeholder: l.placeholder,
|
|
127
|
-
onKeydown: e[1] || (e[1] = (n) =>
|
|
128
|
-
v("keydown", n), o.value && a.value?.label && (D("keydown"), k.value = !0, a.value = null);
|
|
129
|
-
}),
|
|
117
|
+
onKeydown: e[1] || (e[1] = (n) => v("keydown", n)),
|
|
130
118
|
onClick: e[2] || (e[2] = (n) => {
|
|
131
|
-
v("inputClick", n),
|
|
119
|
+
v("inputClick", n), k.value?.select();
|
|
132
120
|
})
|
|
133
|
-
}, null, 42,
|
|
134
|
-
[
|
|
121
|
+
}, null, 42, le), [
|
|
122
|
+
[q, o.value]
|
|
135
123
|
]),
|
|
136
124
|
u("span", {
|
|
137
125
|
ref_key: "hiddenSpan",
|
|
138
|
-
ref:
|
|
126
|
+
ref: T,
|
|
139
127
|
class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
|
|
140
128
|
style: {
|
|
141
129
|
font: "inherit",
|
|
142
130
|
fontSize: "inherit"
|
|
143
131
|
}
|
|
144
|
-
},
|
|
145
|
-
|
|
132
|
+
}, G(o.value), 513),
|
|
133
|
+
F(u("button", {
|
|
146
134
|
type: "button",
|
|
147
135
|
class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButton?.classes]),
|
|
148
136
|
"aria-label": "Clear input",
|
|
149
|
-
style:
|
|
150
|
-
left: `${
|
|
137
|
+
style: Q({
|
|
138
|
+
left: `${d.value + (l.clearButton?.offset || 10)}px`
|
|
151
139
|
}),
|
|
152
|
-
onClick:
|
|
140
|
+
onClick: J(E, ["stop"])
|
|
153
141
|
}, [
|
|
154
142
|
p(t.$slots, "clear-icon", {}, () => [
|
|
155
|
-
e[6] || (e[6] =
|
|
143
|
+
e[6] || (e[6] = Y("X", -1))
|
|
156
144
|
])
|
|
157
145
|
], 6), [
|
|
158
|
-
[
|
|
146
|
+
[Z, i.value?.label && d.value]
|
|
159
147
|
])
|
|
160
148
|
], 2),
|
|
161
149
|
p(t.$slots, "right-icon")
|
|
162
150
|
], 2)
|
|
163
151
|
]),
|
|
164
|
-
default:
|
|
165
|
-
(
|
|
152
|
+
default: h(({ activeIdx: n, setActiveIdx: K }) => [
|
|
153
|
+
(w(!0), H(P, null, X(a.value, (M, r) => (w(), $(ee, {
|
|
166
154
|
key: r,
|
|
167
155
|
active: n === r,
|
|
168
156
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
169
|
-
onClick: (L) =>
|
|
157
|
+
onClick: (L) => B(r),
|
|
170
158
|
onMouseover: (L) => K(r)
|
|
171
159
|
}, {
|
|
172
|
-
default:
|
|
160
|
+
default: h(() => [
|
|
173
161
|
p(t.$slots, "option-content", {
|
|
174
|
-
option:
|
|
162
|
+
option: M,
|
|
175
163
|
idx: r
|
|
176
164
|
}, () => [
|
|
177
165
|
u("span", {
|
|
178
|
-
innerHTML:
|
|
179
|
-
}, null, 8,
|
|
166
|
+
innerHTML: M.label
|
|
167
|
+
}, null, 8, ne)
|
|
180
168
|
])
|
|
181
169
|
]),
|
|
182
170
|
_: 2
|
|
@@ -187,5 +175,5 @@ const oe = ["id", "data-cy", "placeholder"], ae = ["innerHTML"], pe = /* @__PURE
|
|
|
187
175
|
}
|
|
188
176
|
});
|
|
189
177
|
export {
|
|
190
|
-
|
|
178
|
+
de as default
|
|
191
179
|
};
|
package/package.json
CHANGED
|
File without changes
|