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