@wikicasa-dev/components 2.2.9-alpha.38 → 2.2.9-alpha.40
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/BaseAutocomplete.d.ts +2 -2
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +33 -33
- package/package.json +1 -1
- /package/dist/assets/{swiper-thumbs.css → swiper-autoplay.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -17,7 +17,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
17
17
|
theme?: BaseAutocompleteThemes;
|
|
18
18
|
label?: string;
|
|
19
19
|
disableCb?: boolean;
|
|
20
|
-
onInputChangeCb: (v: string) => Promise<AccessibleSelectOptions<TPayload, TID>[]>;
|
|
20
|
+
onInputChangeCb: (v: string | null) => Promise<AccessibleSelectOptions<TPayload, TID>[]>;
|
|
21
21
|
onOptionSelectedCb?: Nullable<(v: AccessibleSelectOptions<TPayload, TID>) => void>;
|
|
22
22
|
keepState?: Nullable<"closed" | "open">;
|
|
23
23
|
cleanupOnClose?: boolean;
|
|
@@ -40,7 +40,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
40
40
|
handleClean: () => void;
|
|
41
41
|
}): any;
|
|
42
42
|
'option-content'?(_: {
|
|
43
|
-
option:
|
|
43
|
+
option: AccessibleSelectOptions<TPayload, TID>;
|
|
44
44
|
idx: number;
|
|
45
45
|
}): any;
|
|
46
46
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as x, mergeModels as $, useModel as F,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as x, mergeModels as $, useModel as F, shallowRef as d, computed as k, onBeforeMount as L, watch as f, createBlock as g, openBlock as w, normalizeClass as H, withCtx as c, createElementBlock as K, Fragment as T, renderList as z, unref as N, renderSlot as p, createElementVNode as U, createVNode as A } from "vue";
|
|
2
|
+
import R from "../../../../UIKit/BaseInput.js";
|
|
3
|
+
import W from "./BaseDropDown.vue.js";
|
|
4
4
|
import '../../../../assets/BaseDropDown.css';/* empty css */
|
|
5
|
-
import { debounce as
|
|
6
|
-
import
|
|
7
|
-
import { useKeyboardController as
|
|
8
|
-
const
|
|
5
|
+
import { debounce as j } from "@wikicasa-dev/utilities";
|
|
6
|
+
import q from "./BaseSelect/SelectItem.vue.js";
|
|
7
|
+
import { useKeyboardController as G } from "@wikicasa-dev/vue-composables";
|
|
8
|
+
const J = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
9
9
|
__name: "BaseAutocomplete",
|
|
10
10
|
props: /* @__PURE__ */ $({
|
|
11
11
|
isValid: { type: [Boolean, null], default: null },
|
|
@@ -31,11 +31,11 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
31
31
|
}),
|
|
32
32
|
emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
33
33
|
setup(t, { expose: V, emit: B }) {
|
|
34
|
-
const u = F(t, "modelValue"), r = B, i = d(""),
|
|
34
|
+
const u = F(t, "modelValue"), r = B, i = d(""), o = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), S = k(() => o.value.length);
|
|
35
35
|
L(() => {
|
|
36
|
-
v.value =
|
|
36
|
+
v.value = j({ delay: 300 }, t.onInputChangeCb);
|
|
37
37
|
});
|
|
38
|
-
const { activeIdx: m, selectedIdx: h } =
|
|
38
|
+
const { activeIdx: m, selectedIdx: h } = G({
|
|
39
39
|
optionsLength: S,
|
|
40
40
|
isDropdownOpen: n,
|
|
41
41
|
disableSpaceHandler: !0
|
|
@@ -76,15 +76,15 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
76
76
|
}), D = async (e) => {
|
|
77
77
|
if (i.value !== e && (r("changedValue", e), i.value = e, !!t.onInputChangeCb)) {
|
|
78
78
|
if (!e || b.value) {
|
|
79
|
-
|
|
79
|
+
o.value = [], b.value = !1, h.value = -1, m.value = -1, u.value && (u.value.label = ""), n.value = !1, await v.value?.(null);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
t.disableCb || (
|
|
82
|
+
t.disableCb || (o.value = await v.value?.(e) || [], n.value = !!o.value.length);
|
|
83
83
|
}
|
|
84
84
|
}, y = (e, l) => {
|
|
85
|
-
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (
|
|
85
|
+
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (o.value = []), b.value = !0, i.value = e.label, u.value = e, n.value = !1, h.value = l;
|
|
86
86
|
}, E = () => {
|
|
87
|
-
|
|
87
|
+
o.value.length && t.keepState !== "closed" && (n.value = !0);
|
|
88
88
|
};
|
|
89
89
|
return f(
|
|
90
90
|
u,
|
|
@@ -93,13 +93,13 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
93
93
|
},
|
|
94
94
|
{ immediate: !0 }
|
|
95
95
|
), f(h, (e) => {
|
|
96
|
-
if (e === -1 || !
|
|
97
|
-
const l =
|
|
96
|
+
if (e === -1 || !o.value.length) return;
|
|
97
|
+
const l = o.value[e];
|
|
98
98
|
b.value && l.label === u.value?.label || y(l, e);
|
|
99
99
|
}), f(
|
|
100
100
|
() => t.keepState,
|
|
101
101
|
(e) => {
|
|
102
|
-
e === "closed" ? (n.value = !1, t.cleanupOnClose && (
|
|
102
|
+
e === "closed" ? (n.value = !1, t.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (n.value = !0);
|
|
103
103
|
}
|
|
104
104
|
), f(n, (e) => {
|
|
105
105
|
r("update:dropdownState", e);
|
|
@@ -107,7 +107,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
107
107
|
select: () => {
|
|
108
108
|
C.value?.select();
|
|
109
109
|
}
|
|
110
|
-
}), (e, l) => (w(), g(
|
|
110
|
+
}), (e, l) => (w(), g(W, {
|
|
111
111
|
class: H(["uikit-autocomplete", e.$attrs["root-classes"]]),
|
|
112
112
|
"data-cy": t.dataCy ? t.dataCy : `ac_${e.$attrs.id}`,
|
|
113
113
|
"dropdown-element": "ul",
|
|
@@ -122,17 +122,17 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
122
122
|
"uikit-z-30",
|
|
123
123
|
t.dropdownClasses
|
|
124
124
|
],
|
|
125
|
-
|
|
126
|
-
"keep-state": !
|
|
125
|
+
open: n.value,
|
|
126
|
+
"keep-state": !o.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
127
127
|
"close-when-clicked-outside": t.closeDropdownOnBodyPressed,
|
|
128
128
|
"activate-keyboard-controller": !1,
|
|
129
|
-
"onUpdate:open": l[3] || (l[3] = (
|
|
130
|
-
onClick: l[4] || (l[4] = (
|
|
129
|
+
"onUpdate:open": l[3] || (l[3] = (a) => n.value = a),
|
|
130
|
+
onClick: l[4] || (l[4] = (a) => {
|
|
131
131
|
r("click"), E();
|
|
132
132
|
})
|
|
133
133
|
}, {
|
|
134
134
|
btn_slot: c(() => [
|
|
135
|
-
A(
|
|
135
|
+
A(R, {
|
|
136
136
|
id: e.$attrs.id ? `ac_input_${e.$attrs.id}` : "",
|
|
137
137
|
ref_key: "baseInput",
|
|
138
138
|
ref: C,
|
|
@@ -150,42 +150,42 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
150
150
|
"!uikit-ml-0 !uikit-w-full"
|
|
151
151
|
],
|
|
152
152
|
"fieldset-classes": [I.value, t.fieldsetClasses],
|
|
153
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
154
|
-
onKeydown: l[1] || (l[1] = (
|
|
153
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => D(a === void 0 ? "" : `${a}`)),
|
|
154
|
+
onKeydown: l[1] || (l[1] = (a) => r("keydown", a)),
|
|
155
155
|
onKeydownEnterPressed: l[2] || (l[2] = () => r("keydownEnterPressed"))
|
|
156
156
|
}, {
|
|
157
157
|
leftIcon: c(() => [
|
|
158
158
|
p(e.$slots, "lefticon")
|
|
159
159
|
]),
|
|
160
|
-
righticon: c(({ handleClean:
|
|
161
|
-
p(e.$slots, "righticon", { handleClean:
|
|
160
|
+
righticon: c(({ handleClean: a }) => [
|
|
161
|
+
p(e.$slots, "righticon", { handleClean: a })
|
|
162
162
|
]),
|
|
163
163
|
_: 3
|
|
164
164
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
|
|
165
165
|
]),
|
|
166
166
|
default: c(() => [
|
|
167
|
-
(w(!0), K(T, null, z(
|
|
167
|
+
(w(!0), K(T, null, z(o.value, (a, s) => (w(), g(q, {
|
|
168
168
|
key: s,
|
|
169
169
|
active: N(m) === s,
|
|
170
170
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
171
|
-
onClick: (P) => y(
|
|
171
|
+
onClick: (P) => y(a, s),
|
|
172
172
|
onMouseover: (P) => m.value = s
|
|
173
173
|
}, {
|
|
174
174
|
default: c(() => [
|
|
175
175
|
p(e.$slots, "option-content", {
|
|
176
|
-
option:
|
|
176
|
+
option: a,
|
|
177
177
|
idx: s
|
|
178
178
|
}, () => [
|
|
179
179
|
U("span", {
|
|
180
|
-
innerHTML:
|
|
181
|
-
}, null, 8,
|
|
180
|
+
innerHTML: a.label
|
|
181
|
+
}, null, 8, J)
|
|
182
182
|
])
|
|
183
183
|
]),
|
|
184
184
|
_: 2
|
|
185
185
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
186
186
|
]),
|
|
187
187
|
_: 3
|
|
188
|
-
}, 8, ["class", "data-cy", "dropdown-classes", "open
|
|
188
|
+
}, 8, ["class", "data-cy", "dropdown-classes", "open", "keep-state", "close-when-clicked-outside"]));
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
export {
|
package/package.json
CHANGED
|
File without changes
|