@wikicasa-dev/components 2.2.8-alpha.10 → 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 +7 -3
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +65 -59
- package/package.json +1 -1
- /package/dist/assets/{swiper-autoplay.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,12 +17,16 @@ 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;
|
|
25
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
27
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
28
|
+
select: () => void;
|
|
29
|
+
}>): void;
|
|
26
30
|
attrs: any;
|
|
27
31
|
slots: {
|
|
28
32
|
'left-icon'?(_: {}): any;
|
|
@@ -33,7 +37,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
33
37
|
idx: number;
|
|
34
38
|
}): any;
|
|
35
39
|
};
|
|
36
|
-
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));
|
|
37
41
|
}>) => import('vue').VNode & {
|
|
38
42
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
39
43
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
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
|
+
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__ */ L({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ M({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
11
|
triggerWrapperClasses: {},
|
|
@@ -22,52 +22,56 @@ 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, { emit:
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
if (!t) {
|
|
31
|
-
a.value = [],
|
|
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
|
+
}, I = async (t) => {
|
|
30
|
+
if (f("update:inputValue", t), !t) {
|
|
31
|
+
a.value = [], u.value = !1;
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
a.value = await
|
|
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
|
+
}, E = () => {
|
|
39
|
+
T.value?.select();
|
|
38
40
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
return N(() => {
|
|
42
|
+
h.value = Q({ delay: 300 }, l.onInputChangeCb);
|
|
43
|
+
}), b(o, () => {
|
|
44
|
+
O(() => {
|
|
45
|
+
m.value && (w.value = m.value.offsetWidth);
|
|
44
46
|
});
|
|
45
|
-
}),
|
|
46
|
-
() =>
|
|
47
|
+
}), b(
|
|
48
|
+
() => z.value?.selectedIdx,
|
|
47
49
|
(t) => {
|
|
48
50
|
const e = t ?? -1;
|
|
49
|
-
e !== -1 &&
|
|
51
|
+
e !== -1 && S(e);
|
|
50
52
|
}
|
|
51
|
-
),
|
|
53
|
+
), b(
|
|
52
54
|
i,
|
|
53
55
|
(t, e) => {
|
|
54
|
-
t === e || t?.label ===
|
|
56
|
+
t === e || t?.label === o.value || (o.value = t?.label || "");
|
|
55
57
|
},
|
|
56
58
|
{ immediate: !0 }
|
|
57
|
-
), (
|
|
59
|
+
), x({
|
|
60
|
+
select: E
|
|
61
|
+
}), (t, e) => (p(), $(G, {
|
|
58
62
|
ref: "dropdownRef",
|
|
59
63
|
class: "uikit-clearable-autocomplete",
|
|
60
64
|
"data-cy": l.dataCy,
|
|
61
65
|
"dropdown-element": "ul",
|
|
62
66
|
"dropdown-classes": ["uikit-z-30", l.dropdownClasses],
|
|
63
|
-
"open-dropdown":
|
|
67
|
+
"open-dropdown": u.value,
|
|
64
68
|
"keep-state": !a.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
65
|
-
"reset-keyboard-controller":
|
|
66
|
-
"onUpdate:resetKeyboardController": e[
|
|
67
|
-
"onUpdate:dropdownState": e[
|
|
68
|
-
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"))
|
|
69
73
|
}, {
|
|
70
|
-
btn_slot:
|
|
74
|
+
btn_slot: y(() => [
|
|
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
|
+
H(d("input", {
|
|
83
|
+
ref: "inputRef",
|
|
79
84
|
"onUpdate:modelValue": [
|
|
80
|
-
e[0] || (e[0] = (
|
|
81
|
-
|
|
85
|
+
e[0] || (e[0] = (n) => o.value = n),
|
|
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]),
|
|
@@ -86,53 +91,54 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
86
91
|
font: "inherit",
|
|
87
92
|
fontSize: "inherit"
|
|
88
93
|
},
|
|
89
|
-
placeholder: l.placeholder
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
placeholder: l.placeholder,
|
|
95
|
+
onKeydown: e[1] || (e[1] = (n) => f("keydown", n))
|
|
96
|
+
}, null, 42, Y), [
|
|
97
|
+
[P, o.value]
|
|
92
98
|
]),
|
|
93
99
|
d("span", {
|
|
94
100
|
ref_key: "hiddenSpan",
|
|
95
|
-
ref:
|
|
101
|
+
ref: m,
|
|
96
102
|
class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
|
|
97
103
|
style: {
|
|
98
104
|
font: "inherit",
|
|
99
105
|
fontSize: "inherit"
|
|
100
106
|
}
|
|
101
|
-
},
|
|
102
|
-
i.value?.label ? (p(),
|
|
107
|
+
}, X(o.value), 513),
|
|
108
|
+
i.value?.label ? (p(), B("button", {
|
|
103
109
|
key: 0,
|
|
104
110
|
type: "button",
|
|
105
111
|
class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButtonClasses]),
|
|
106
112
|
"aria-label": "Clear input",
|
|
107
|
-
style:
|
|
108
|
-
left: `${
|
|
113
|
+
style: j({
|
|
114
|
+
left: `${w.value + 16}px`
|
|
109
115
|
}),
|
|
110
|
-
onClick:
|
|
116
|
+
onClick: W
|
|
111
117
|
}, [
|
|
112
118
|
c(t.$slots, "clear-icon", {}, () => [
|
|
113
|
-
e[
|
|
119
|
+
e[5] || (e[5] = q("X", -1))
|
|
114
120
|
])
|
|
115
|
-
], 6)) :
|
|
121
|
+
], 6)) : A("", !0)
|
|
116
122
|
], 2),
|
|
117
123
|
c(t.$slots, "right-icon")
|
|
118
124
|
], 2)
|
|
119
125
|
]),
|
|
120
|
-
default:
|
|
121
|
-
(p(!0),
|
|
122
|
-
key:
|
|
123
|
-
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,
|
|
124
130
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
125
|
-
onClick: (
|
|
126
|
-
onMouseover: (
|
|
131
|
+
onClick: (K) => S(s),
|
|
132
|
+
onMouseover: (K) => F(s)
|
|
127
133
|
}, {
|
|
128
|
-
default:
|
|
134
|
+
default: y(() => [
|
|
129
135
|
c(t.$slots, "option-content", {
|
|
130
|
-
option:
|
|
131
|
-
idx:
|
|
136
|
+
option: g,
|
|
137
|
+
idx: s
|
|
132
138
|
}, () => [
|
|
133
139
|
d("span", {
|
|
134
|
-
innerHTML:
|
|
135
|
-
}, null, 8,
|
|
140
|
+
innerHTML: g.label
|
|
141
|
+
}, null, 8, Z)
|
|
136
142
|
])
|
|
137
143
|
]),
|
|
138
144
|
_: 2
|
|
@@ -143,5 +149,5 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
|
|
|
143
149
|
}
|
|
144
150
|
});
|
|
145
151
|
export {
|
|
146
|
-
|
|
152
|
+
oe as default
|
|
147
153
|
};
|
package/package.json
CHANGED
|
File without changes
|