@wikicasa-dev/components 2.2.9-alpha.13 → 2.2.9-alpha.14
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 +6 -8
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +66 -63
- package/package.json +1 -1
- /package/dist/assets/{swiper-keyboard.css → swiper-thumbs.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -15,25 +15,23 @@ export interface ClearableAutocompleteProps<TID extends string | number | undefi
|
|
|
15
15
|
offset?: number;
|
|
16
16
|
};
|
|
17
17
|
keepState?: Nullable<"closed" | "open">;
|
|
18
|
-
|
|
19
|
-
* If true, `onInputChangeCb` and `update:input-value` event will be disabled.
|
|
20
|
-
* The input value will still be updated internally and synced with the model value
|
|
21
|
-
*/
|
|
22
|
-
disableAutocomplete?: boolean;
|
|
18
|
+
disableCb?: boolean;
|
|
23
19
|
onInputChangeCb: (v: string) => Promise<AccessibleSelectOptions<TPayload, TID>[]>;
|
|
24
20
|
onOptionSelectedCb?: Nullable<(v: AccessibleSelectOptions<TPayload, TID>) => void>;
|
|
25
21
|
}
|
|
26
22
|
declare const _default: <TID extends string | number | undefined, TPayload>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
27
23
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
28
24
|
readonly "onUpdate:modelValue"?: ((value: Nullable<AccessibleSelectOptions<TPayload, TID>>) => any) | undefined;
|
|
25
|
+
readonly onInput?: ((args_0: InputEvent) => any) | undefined;
|
|
29
26
|
readonly onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
30
27
|
readonly onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
31
28
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
29
|
+
readonly "onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
|
32
30
|
readonly onInputClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
33
|
-
|
|
34
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onKeydown" | "onUpdate:open" | "onInputClick" | "onUpdate:input-value"> & ({
|
|
31
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onInput" | "onKeydown" | "onUpdate:open" | "onUpdate:inputValue" | "onInputClick"> & ({
|
|
35
32
|
open?: boolean;
|
|
36
33
|
modelValue?: Nullable<AccessibleSelectOptions<TPayload, TID>>;
|
|
34
|
+
inputValue?: string;
|
|
37
35
|
} & ClearableAutocompleteProps<TID, TPayload>) & Partial<{}>> & import('vue').PublicProps;
|
|
38
36
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
39
37
|
getRootElement: () => HTMLDivElement | null | undefined;
|
|
@@ -50,7 +48,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
50
48
|
idx: number;
|
|
51
49
|
}): any;
|
|
52
50
|
};
|
|
53
|
-
emit: (((evt: "
|
|
51
|
+
emit: (((evt: "input", args_0: InputEvent) => void) & ((evt: "click", args_0: MouseEvent) => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "inputClick", args_0: MouseEvent) => void)) & (((evt: "update:modelValue", value: Nullable<AccessibleSelectOptions<TPayload, TID>>) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:inputValue", value: string) => void));
|
|
54
52
|
}>) => import('vue').VNode & {
|
|
55
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
56
54
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as W, mergeModels 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 f, createElementVNode as u, normalizeClass as v, 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 },
|
|
@@ -15,64 +15,68 @@ const oe = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], pe = /* @__PURE
|
|
|
15
15
|
dropdownClasses: {},
|
|
16
16
|
clearButton: {},
|
|
17
17
|
keepState: {},
|
|
18
|
-
|
|
18
|
+
disableCb: { type: Boolean, default: !1 },
|
|
19
19
|
onInputChangeCb: { type: Function },
|
|
20
20
|
onOptionSelectedCb: { type: [Function, null] }
|
|
21
21
|
}, {
|
|
22
22
|
open: { type: Boolean, default: !1 },
|
|
23
23
|
openModifiers: {},
|
|
24
24
|
modelValue: { default: null },
|
|
25
|
-
modelModifiers: {}
|
|
25
|
+
modelModifiers: {},
|
|
26
|
+
inputValue: {
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
inputValueModifiers: {}
|
|
26
30
|
}),
|
|
27
|
-
emits: /* @__PURE__ */
|
|
28
|
-
setup(l, { expose:
|
|
29
|
-
const s =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
31
|
+
emits: /* @__PURE__ */ V(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
|
|
32
|
+
setup(l, { expose: O, emit: R }) {
|
|
33
|
+
const s = C(l, "open"), i = C(l, "modelValue"), o = C(l, "inputValue");
|
|
34
|
+
o.value = o.value ?? i.value?.label ?? "";
|
|
35
|
+
const d = R, x = D(), k = b("inputRef"), p = c(0), m = c(!1), g = c(null), a = c([]), S = b("dropdownRef"), T = b("hiddenSpan"), E = () => {
|
|
36
|
+
o.value = "", i.value = null;
|
|
37
|
+
}, I = async (t) => {
|
|
34
38
|
if (!t) {
|
|
35
39
|
a.value = [], s.value = !1;
|
|
36
40
|
return;
|
|
37
41
|
}
|
|
38
|
-
l.
|
|
42
|
+
l.disableCb || (a.value = await g.value?.(t) || [], m.value = !0, s.value = !!a.value.length);
|
|
39
43
|
}, B = (t = -1) => {
|
|
40
44
|
const e = a.value[t];
|
|
41
|
-
!e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e),
|
|
42
|
-
},
|
|
45
|
+
!e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, s.value = !1, i.value = e, a.value = []);
|
|
46
|
+
}, U = () => {
|
|
43
47
|
k.value?.select();
|
|
44
48
|
}, z = () => {
|
|
45
49
|
k.value?.focus();
|
|
46
50
|
};
|
|
47
51
|
return N(() => {
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
[
|
|
52
|
+
g.value = te({ delay: 300 }, l.onInputChangeCb);
|
|
53
|
+
}), y(
|
|
54
|
+
[o, () => T.value],
|
|
51
55
|
([, t]) => {
|
|
52
|
-
t &&
|
|
56
|
+
t && A(() => {
|
|
53
57
|
if (!t) return;
|
|
54
58
|
const e = t.offsetWidth;
|
|
55
|
-
e !==
|
|
59
|
+
e !== p.value && (p.value = e);
|
|
56
60
|
});
|
|
57
61
|
},
|
|
58
62
|
{ immediate: !0 }
|
|
59
|
-
),
|
|
60
|
-
() =>
|
|
63
|
+
), y(
|
|
64
|
+
() => S.value?.selectedIdx,
|
|
61
65
|
(t) => {
|
|
62
66
|
const e = t ?? -1;
|
|
63
67
|
e !== -1 && B(e);
|
|
64
68
|
}
|
|
65
|
-
),
|
|
69
|
+
), y(
|
|
66
70
|
i,
|
|
67
71
|
(t, e) => {
|
|
68
|
-
t === e || t?.label ===
|
|
72
|
+
t === e || t?.label === o.value || (o.value = t?.label || "");
|
|
69
73
|
},
|
|
70
74
|
{ immediate: !0 }
|
|
71
|
-
),
|
|
72
|
-
getRootElement: () =>
|
|
73
|
-
select:
|
|
75
|
+
), O({
|
|
76
|
+
getRootElement: () => S.value?.getRootElement(),
|
|
77
|
+
select: U,
|
|
74
78
|
focus: z
|
|
75
|
-
}), (t, e) => (
|
|
79
|
+
}), (t, e) => (w(), $(_, {
|
|
76
80
|
ref: "dropdownRef",
|
|
77
81
|
class: "uikit-clearable-autocomplete",
|
|
78
82
|
"data-cy": l.dataCy,
|
|
@@ -82,27 +86,25 @@ const oe = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], pe = /* @__PURE
|
|
|
82
86
|
"keep-state": !a.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
83
87
|
"activate-keyboard-controller": l.enableKeyboardController,
|
|
84
88
|
"reset-keyboard-controller": m.value,
|
|
85
|
-
"onUpdate:resetKeyboardController": e[5] || (e[5] = (
|
|
86
|
-
"onUpdate:dropdownState": e[6] || (e[6] = (
|
|
89
|
+
"onUpdate:resetKeyboardController": e[5] || (e[5] = (n) => m.value = n),
|
|
90
|
+
"onUpdate:dropdownState": e[6] || (e[6] = (n) => s.value = n)
|
|
87
91
|
}, {
|
|
88
|
-
btn_slot:
|
|
92
|
+
btn_slot: h(() => [
|
|
89
93
|
u("div", {
|
|
90
94
|
class: v(["uikit-text-16", l.triggerWrapperClasses]),
|
|
91
|
-
onClick: e[4] || (e[4] = (
|
|
95
|
+
onClick: e[4] || (e[4] = (n) => d("click", n))
|
|
92
96
|
}, [
|
|
93
97
|
f(t.$slots, "left-icon"),
|
|
94
98
|
u("div", {
|
|
95
99
|
class: v(["uikit-relative", l.inputWrapperClasses])
|
|
96
100
|
}, [
|
|
97
|
-
|
|
101
|
+
F(u("input", {
|
|
98
102
|
ref: "inputRef",
|
|
99
103
|
"onUpdate:modelValue": [
|
|
100
|
-
e[0] || (e[0] = (
|
|
101
|
-
|
|
102
|
-
T(o), U(o);
|
|
103
|
-
})
|
|
104
|
+
e[0] || (e[0] = (n) => o.value = n),
|
|
105
|
+
I
|
|
104
106
|
],
|
|
105
|
-
id:
|
|
107
|
+
id: j(x),
|
|
106
108
|
"data-cy": l.dataCy ? `ac_input_${l.dataCy}` : "",
|
|
107
109
|
type: "text",
|
|
108
110
|
autocomplete: "off",
|
|
@@ -112,53 +114,54 @@ const oe = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], pe = /* @__PURE
|
|
|
112
114
|
fontSize: "inherit"
|
|
113
115
|
},
|
|
114
116
|
placeholder: l.placeholder,
|
|
115
|
-
onKeydown: e[
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
onKeydown: e[1] || (e[1] = (n) => d("keydown", n)),
|
|
118
|
+
onInput: e[2] || (e[2] = (n) => d("input", n)),
|
|
119
|
+
onClick: e[3] || (e[3] = (n) => {
|
|
120
|
+
d("inputClick", n), k.value?.select();
|
|
118
121
|
})
|
|
119
|
-
}, null, 42,
|
|
120
|
-
[
|
|
122
|
+
}, null, 42, le), [
|
|
123
|
+
[q, o.value]
|
|
121
124
|
]),
|
|
122
125
|
u("span", {
|
|
123
126
|
ref_key: "hiddenSpan",
|
|
124
|
-
ref:
|
|
127
|
+
ref: T,
|
|
125
128
|
class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
|
|
126
129
|
style: {
|
|
127
130
|
font: "inherit",
|
|
128
131
|
fontSize: "inherit"
|
|
129
132
|
}
|
|
130
|
-
},
|
|
131
|
-
|
|
133
|
+
}, G(o.value), 513),
|
|
134
|
+
F(u("button", {
|
|
132
135
|
type: "button",
|
|
133
136
|
class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButton?.classes]),
|
|
134
137
|
"aria-label": "Clear input",
|
|
135
|
-
style:
|
|
136
|
-
left: `${
|
|
138
|
+
style: Q({
|
|
139
|
+
left: `${p.value + (l.clearButton?.offset || 10)}px`
|
|
137
140
|
}),
|
|
138
|
-
onClick:
|
|
141
|
+
onClick: J(E, ["stop"])
|
|
139
142
|
}, [
|
|
140
143
|
f(t.$slots, "clear-icon", {}, () => [
|
|
141
|
-
e[7] || (e[7] =
|
|
144
|
+
e[7] || (e[7] = Y("X", -1))
|
|
142
145
|
])
|
|
143
146
|
], 6), [
|
|
144
|
-
[
|
|
147
|
+
[Z, i.value?.label && p.value]
|
|
145
148
|
])
|
|
146
149
|
], 2),
|
|
147
150
|
f(t.$slots, "right-icon")
|
|
148
151
|
], 2)
|
|
149
152
|
]),
|
|
150
|
-
default:
|
|
151
|
-
(
|
|
152
|
-
key:
|
|
153
|
-
active:
|
|
153
|
+
default: h(({ activeIdx: n, setActiveIdx: K }) => [
|
|
154
|
+
(w(!0), H(P, null, X(a.value, (M, r) => (w(), $(ee, {
|
|
155
|
+
key: r,
|
|
156
|
+
active: n === r,
|
|
154
157
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
155
|
-
onClick: (L) => B(
|
|
156
|
-
onMouseover: (L) => K(
|
|
158
|
+
onClick: (L) => B(r),
|
|
159
|
+
onMouseover: (L) => K(r)
|
|
157
160
|
}, {
|
|
158
|
-
default:
|
|
161
|
+
default: h(() => [
|
|
159
162
|
f(t.$slots, "option-content", {
|
|
160
163
|
option: M,
|
|
161
|
-
idx:
|
|
164
|
+
idx: r
|
|
162
165
|
}, () => [
|
|
163
166
|
u("span", {
|
|
164
167
|
innerHTML: M.label
|
|
@@ -173,5 +176,5 @@ const oe = ["id", "data-cy", "placeholder"], ne = ["innerHTML"], pe = /* @__PURE
|
|
|
173
176
|
}
|
|
174
177
|
});
|
|
175
178
|
export {
|
|
176
|
-
|
|
179
|
+
de as default
|
|
177
180
|
};
|
package/package.json
CHANGED
|
File without changes
|