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