@wikicasa-dev/components 2.2.8-alpha.10 → 2.2.8-alpha.11
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/UIKit/Autocomplete/ClearableAutocomplete.d.ts +3 -1
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +48 -43
- package/package.json +1 -1
- /package/dist/assets/{swiper-autoplay.css → swiper-thumbs.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -22,7 +22,9 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
22
22
|
open?: boolean;
|
|
23
23
|
modelValue?: Nullable<AccessibleSelectOptions<TPayload, TID>>;
|
|
24
24
|
} & ClearableAutocompleteProps<TID, TPayload>) & Partial<{}>> & import('vue').PublicProps;
|
|
25
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
25
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
26
|
+
select: () => void;
|
|
27
|
+
}>): void;
|
|
26
28
|
attrs: any;
|
|
27
29
|
slots: {
|
|
28
30
|
'left-icon'?(_: {}): any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as N, mergeModels as g, useModel as M, useTemplateRef as m, shallowRef as r, onBeforeMount as O, watch as C, nextTick as U, createBlock as $, openBlock as p, withCtx as b, createElementBlock as V, Fragment as D, renderList as H, renderSlot as c, createElementVNode as d, normalizeClass as v, withDirectives as K, createCommentVNode as A, vModelText as P, toDisplayString as X, normalizeStyle as j, createTextVNode as q } from "vue";
|
|
2
|
+
import G from "../BaseDropDown.vue.js";
|
|
3
3
|
import '../../../../../assets/BaseDropDown.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import { debounce as
|
|
6
|
-
const
|
|
4
|
+
import J from "../BaseSelect/SelectItem.vue.js";
|
|
5
|
+
import { debounce as Q } from "@wikicasa-dev/utilities";
|
|
6
|
+
const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ N({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ g({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
11
|
triggerWrapperClasses: {},
|
|
@@ -22,39 +22,43 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
22
22
|
modelValue: { default: null },
|
|
23
23
|
modelModifiers: {}
|
|
24
24
|
}),
|
|
25
|
-
emits: /* @__PURE__ */
|
|
26
|
-
setup(l, {
|
|
27
|
-
const s =
|
|
25
|
+
emits: /* @__PURE__ */ g(["click"], ["update:open", "update:modelValue"]),
|
|
26
|
+
setup(l, { expose: B, emit: x }) {
|
|
27
|
+
const s = M(l, "open"), i = M(l, "modelValue"), R = x, T = m("inputRef"), n = r(""), y = r(0), f = r(!1), h = r(null), a = r([]), z = m("dropdownRef"), k = m("hiddenSpan"), W = () => {
|
|
28
28
|
n.value = "", i.value = null;
|
|
29
|
-
},
|
|
29
|
+
}, I = async (t) => {
|
|
30
30
|
if (!t) {
|
|
31
31
|
a.value = [], s.value = !1;
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
a.value = await
|
|
35
|
-
},
|
|
34
|
+
a.value = await h.value?.(t) || [], f.value = !0, s.value = !!a.value.length;
|
|
35
|
+
}, w = (t = -1) => {
|
|
36
36
|
const e = a.value[t];
|
|
37
37
|
!e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), n.value = e.label, s.value = !1, i.value = e, a.value = []);
|
|
38
|
+
}, E = () => {
|
|
39
|
+
T.value?.select();
|
|
38
40
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
|
|
43
|
-
k.value && (
|
|
41
|
+
return O(() => {
|
|
42
|
+
h.value = Q({ delay: 300 }, l.onInputChangeCb);
|
|
43
|
+
}), C(n, () => {
|
|
44
|
+
U(() => {
|
|
45
|
+
k.value && (y.value = k.value.offsetWidth);
|
|
44
46
|
});
|
|
45
|
-
}),
|
|
46
|
-
() =>
|
|
47
|
+
}), C(
|
|
48
|
+
() => z.value?.selectedIdx,
|
|
47
49
|
(t) => {
|
|
48
50
|
const e = t ?? -1;
|
|
49
|
-
e !== -1 &&
|
|
51
|
+
e !== -1 && w(e);
|
|
50
52
|
}
|
|
51
|
-
),
|
|
53
|
+
), C(
|
|
52
54
|
i,
|
|
53
55
|
(t, e) => {
|
|
54
56
|
t === e || t?.label === n.value || (n.value = t?.label || "");
|
|
55
57
|
},
|
|
56
58
|
{ immediate: !0 }
|
|
57
|
-
), (
|
|
59
|
+
), B({
|
|
60
|
+
select: E
|
|
61
|
+
}), (t, e) => (p(), $(G, {
|
|
58
62
|
ref: "dropdownRef",
|
|
59
63
|
class: "uikit-clearable-autocomplete",
|
|
60
64
|
"data-cy": l.dataCy,
|
|
@@ -65,9 +69,9 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
65
69
|
"reset-keyboard-controller": f.value,
|
|
66
70
|
"onUpdate:resetKeyboardController": e[1] || (e[1] = (o) => f.value = o),
|
|
67
71
|
"onUpdate:dropdownState": e[2] || (e[2] = (o) => s.value = o),
|
|
68
|
-
onClick: e[3] || (e[3] = (o) =>
|
|
72
|
+
onClick: e[3] || (e[3] = (o) => R("click"))
|
|
69
73
|
}, {
|
|
70
|
-
btn_slot:
|
|
74
|
+
btn_slot: b(() => [
|
|
71
75
|
d("div", {
|
|
72
76
|
class: v(["uikit-text-16", l.triggerWrapperClasses])
|
|
73
77
|
}, [
|
|
@@ -75,10 +79,11 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
75
79
|
d("div", {
|
|
76
80
|
class: v(["uikit-relative", l.inputWrapperClasses])
|
|
77
81
|
}, [
|
|
78
|
-
|
|
82
|
+
K(d("input", {
|
|
83
|
+
ref: "inputRef",
|
|
79
84
|
"onUpdate:modelValue": [
|
|
80
85
|
e[0] || (e[0] = (o) => n.value = o),
|
|
81
|
-
|
|
86
|
+
I
|
|
82
87
|
],
|
|
83
88
|
readonly: !!i.value?.label,
|
|
84
89
|
class: v(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", l.inputClasses]),
|
|
@@ -87,8 +92,8 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
87
92
|
fontSize: "inherit"
|
|
88
93
|
},
|
|
89
94
|
placeholder: l.placeholder
|
|
90
|
-
}, null, 10,
|
|
91
|
-
[
|
|
95
|
+
}, null, 10, Y), [
|
|
96
|
+
[P, n.value]
|
|
92
97
|
]),
|
|
93
98
|
d("span", {
|
|
94
99
|
ref_key: "hiddenSpan",
|
|
@@ -98,41 +103,41 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
98
103
|
font: "inherit",
|
|
99
104
|
fontSize: "inherit"
|
|
100
105
|
}
|
|
101
|
-
},
|
|
106
|
+
}, X(n.value), 513),
|
|
102
107
|
i.value?.label ? (p(), V("button", {
|
|
103
108
|
key: 0,
|
|
104
109
|
type: "button",
|
|
105
110
|
class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButtonClasses]),
|
|
106
111
|
"aria-label": "Clear input",
|
|
107
|
-
style:
|
|
108
|
-
left: `${
|
|
112
|
+
style: j({
|
|
113
|
+
left: `${y.value + 16}px`
|
|
109
114
|
}),
|
|
110
|
-
onClick:
|
|
115
|
+
onClick: W
|
|
111
116
|
}, [
|
|
112
117
|
c(t.$slots, "clear-icon", {}, () => [
|
|
113
|
-
e[4] || (e[4] =
|
|
118
|
+
e[4] || (e[4] = q("X", -1))
|
|
114
119
|
])
|
|
115
|
-
], 6)) :
|
|
120
|
+
], 6)) : A("", !0)
|
|
116
121
|
], 2),
|
|
117
122
|
c(t.$slots, "right-icon")
|
|
118
123
|
], 2)
|
|
119
124
|
]),
|
|
120
|
-
default:
|
|
121
|
-
(p(!0), V(
|
|
125
|
+
default: b(({ activeIdx: o, setActiveIdx: F }) => [
|
|
126
|
+
(p(!0), V(D, null, H(a.value, (S, u) => (p(), $(J, {
|
|
122
127
|
key: u,
|
|
123
128
|
active: o === u,
|
|
124
129
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
125
|
-
onClick: (
|
|
126
|
-
onMouseover: (
|
|
130
|
+
onClick: (L) => w(u),
|
|
131
|
+
onMouseover: (L) => F(u)
|
|
127
132
|
}, {
|
|
128
|
-
default:
|
|
133
|
+
default: b(() => [
|
|
129
134
|
c(t.$slots, "option-content", {
|
|
130
|
-
option:
|
|
135
|
+
option: S,
|
|
131
136
|
idx: u
|
|
132
137
|
}, () => [
|
|
133
138
|
d("span", {
|
|
134
|
-
innerHTML:
|
|
135
|
-
}, null, 8,
|
|
139
|
+
innerHTML: S.label
|
|
140
|
+
}, null, 8, Z)
|
|
136
141
|
])
|
|
137
142
|
]),
|
|
138
143
|
_: 2
|
|
@@ -143,5 +148,5 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
143
148
|
}
|
|
144
149
|
});
|
|
145
150
|
export {
|
|
146
|
-
|
|
151
|
+
oe as default
|
|
147
152
|
};
|
package/package.json
CHANGED
|
File without changes
|