@wikicasa-dev/components 2.2.2-alpha.0 → 2.2.3
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 +6 -1
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +46 -41
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/assets/{swiper-autoplay.css → swiper-controller.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Nullable
|
|
1
|
+
import { Nullable } from '@wikicasa-dev/types';
|
|
2
2
|
import { AccessibleSelectOptions } from './AccessibleSelect';
|
|
3
3
|
import { ClassTypeProp } from './types';
|
|
4
|
+
export type BaseAutocompleteThemes = "empty" | "bordered" | "all-bordered" | "all-bordered-thick" | "";
|
|
4
5
|
declare const _default: <T, LabelID extends string | number | undefined>(__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<{
|
|
5
6
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
7
|
readonly onClick?: (() => any) | undefined;
|
|
@@ -38,6 +39,10 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
|
|
|
38
39
|
righticon?(_: {
|
|
39
40
|
handleClean: () => void;
|
|
40
41
|
}): any;
|
|
42
|
+
'item-content'?(_: {
|
|
43
|
+
option: import('@vue/reactivity').UnwrapRefSimple<AccessibleSelectOptions<T, LabelID>>;
|
|
44
|
+
idx: number;
|
|
45
|
+
}): any;
|
|
41
46
|
};
|
|
42
47
|
emit: (((evt: "click") => void) & ((evt: "update:dropdownState", args_0: boolean) => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "keydownEnterPressed") => void) & ((evt: "changedValue", args_0: string) => void)) & ((evt: "update:modelValue", value: AccessibleSelectOptions<T, LabelID> | undefined) => void);
|
|
43
48
|
}>) => import('vue').VNode & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as P, mergeModels as
|
|
1
|
+
import { defineComponent as P, mergeModels as $, useModel as F, ref 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
2
|
import W from "../../../../UIKit/BaseInput.js";
|
|
3
3
|
import j from "./BaseDropDown.vue.js";
|
|
4
4
|
import { debounce as q } from "@wikicasa-dev/utilities";
|
|
@@ -6,7 +6,7 @@ import G from "./BaseSelect/SelectItem.vue.js";
|
|
|
6
6
|
import { useKeyboardController as J } from "@wikicasa-dev/vue-composables";
|
|
7
7
|
const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
8
8
|
__name: "BaseAutocomplete",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ $({
|
|
10
10
|
isValid: { type: [Boolean, null], default: null },
|
|
11
11
|
theme: { default: "" },
|
|
12
12
|
label: { default: "" },
|
|
@@ -28,12 +28,12 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
28
28
|
},
|
|
29
29
|
modelModifiers: {}
|
|
30
30
|
}),
|
|
31
|
-
emits: /* @__PURE__ */
|
|
31
|
+
emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
32
32
|
setup(t, { expose: S, emit: V }) {
|
|
33
33
|
const u = F(
|
|
34
34
|
t,
|
|
35
35
|
"modelValue"
|
|
36
|
-
), r = V, i = d(""),
|
|
36
|
+
), r = V, i = d(""), o = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), B = k(() => o.value.length);
|
|
37
37
|
L(() => {
|
|
38
38
|
v.value = q({ delay: 300 }, t.onInputChangeCb);
|
|
39
39
|
});
|
|
@@ -52,7 +52,7 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
52
52
|
default:
|
|
53
53
|
return "";
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
55
|
+
}), I = k(() => {
|
|
56
56
|
switch (t.theme) {
|
|
57
57
|
case "bordered":
|
|
58
58
|
return "";
|
|
@@ -63,7 +63,7 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
63
63
|
default:
|
|
64
64
|
return "";
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
66
|
+
}), M = k(() => {
|
|
67
67
|
const e = "uikit-rounded-b-xl uikit-shadow uikit-rounded-t-none uikit-mb-0 !uikit-mt-0 uikit-text-w-black !uikit-rounded-b-xl !uikit-rounded-t-none";
|
|
68
68
|
switch (t.theme) {
|
|
69
69
|
case "bordered":
|
|
@@ -75,18 +75,18 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
75
75
|
default:
|
|
76
76
|
return "";
|
|
77
77
|
}
|
|
78
|
-
}),
|
|
78
|
+
}), x = async (e) => {
|
|
79
79
|
if (i.value !== e && (r("changedValue", e), i.value = e, !!t.onInputChangeCb)) {
|
|
80
|
-
if (!e ||
|
|
81
|
-
|
|
80
|
+
if (!e || b.value) {
|
|
81
|
+
o.value = [], b.value = !1, h.value = -1, m.value = -1, u.value && (u.value.label = ""), n.value = !1, await v.value(null);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
t.disableCb || (
|
|
84
|
+
t.disableCb || (o.value = await v.value(e), n.value = !!o.value.length);
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (
|
|
86
|
+
}, y = (e, l) => {
|
|
87
|
+
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;
|
|
88
88
|
}, D = () => {
|
|
89
|
-
|
|
89
|
+
o.value.length && t.keepState !== "closed" && (n.value = !0);
|
|
90
90
|
};
|
|
91
91
|
return f(
|
|
92
92
|
u,
|
|
@@ -95,19 +95,19 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
95
95
|
},
|
|
96
96
|
{ immediate: !0 }
|
|
97
97
|
), f(h, (e) => {
|
|
98
|
-
if (e === -1 || !
|
|
99
|
-
const l =
|
|
100
|
-
|
|
98
|
+
if (e === -1 || !o.value.length) return;
|
|
99
|
+
const l = o.value[e];
|
|
100
|
+
b.value && l.label === u.value?.label || y(l, e);
|
|
101
101
|
}), f(
|
|
102
102
|
() => t.keepState,
|
|
103
103
|
(e) => {
|
|
104
|
-
e === "closed" ? (n.value = !1, t.cleanupOnClose && (
|
|
104
|
+
e === "closed" ? (n.value = !1, t.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (n.value = !0);
|
|
105
105
|
}
|
|
106
106
|
), f(n, (e) => {
|
|
107
107
|
r("update:dropdownState", e);
|
|
108
108
|
}), S({
|
|
109
109
|
select: () => {
|
|
110
|
-
|
|
110
|
+
C.value?.select();
|
|
111
111
|
}
|
|
112
112
|
}), (e, l) => (w(), g(j, {
|
|
113
113
|
class: H(e.$attrs["root-classes"]),
|
|
@@ -120,24 +120,24 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
120
120
|
{
|
|
121
121
|
"uikit-mt-10px !uikit-border !uikit-border-w-secondary !uikit-rounded-xs": !t.theme
|
|
122
122
|
},
|
|
123
|
-
|
|
123
|
+
M.value,
|
|
124
124
|
"!uikit-max-h-[210px] uikit-z-30",
|
|
125
125
|
t.dropdownClasses
|
|
126
126
|
],
|
|
127
127
|
"open-dropdown": n.value,
|
|
128
|
-
"keep-state": !
|
|
128
|
+
"keep-state": !o.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
129
129
|
"close-when-clicked-outside": t.closeDropdownOnBodyPressed,
|
|
130
130
|
"activate-keyboard-controller": !1,
|
|
131
|
-
"onUpdate:dropdownState": l[3] || (l[3] = (
|
|
132
|
-
onClick: l[4] || (l[4] = (
|
|
131
|
+
"onUpdate:dropdownState": l[3] || (l[3] = (a) => n.value = a),
|
|
132
|
+
onClick: l[4] || (l[4] = (a) => {
|
|
133
133
|
r("click"), D();
|
|
134
134
|
})
|
|
135
135
|
}, {
|
|
136
|
-
btn_slot:
|
|
136
|
+
btn_slot: c(() => [
|
|
137
137
|
A(W, {
|
|
138
138
|
id: e.$attrs.id ? `ac_input_${e.$attrs.id}` : "",
|
|
139
139
|
ref_key: "baseInput",
|
|
140
|
-
ref:
|
|
140
|
+
ref: C,
|
|
141
141
|
"data-cy": t.dataCy ? `ac_input_${t.dataCy}` : `ac_input_${e.$attrs.id}`,
|
|
142
142
|
"label-text": t.label,
|
|
143
143
|
"model-value": i.value,
|
|
@@ -151,32 +151,37 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
|
|
|
151
151
|
t.inputClasses,
|
|
152
152
|
"!uikit-ml-0 !uikit-w-full"
|
|
153
153
|
],
|
|
154
|
-
"fieldset-classes": [
|
|
155
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
156
|
-
onKeydown: l[1] || (l[1] = (
|
|
154
|
+
"fieldset-classes": [I.value, t.fieldsetClasses],
|
|
155
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => x(a === void 0 ? "" : `${a}`)),
|
|
156
|
+
onKeydown: l[1] || (l[1] = (a) => r("keydown", a)),
|
|
157
157
|
onKeydownEnterPressed: l[2] || (l[2] = () => r("keydownEnterPressed"))
|
|
158
158
|
}, {
|
|
159
|
-
leftIcon:
|
|
160
|
-
|
|
159
|
+
leftIcon: c(() => [
|
|
160
|
+
p(e.$slots, "lefticon")
|
|
161
161
|
]),
|
|
162
|
-
righticon:
|
|
163
|
-
|
|
162
|
+
righticon: c(({ handleClean: a }) => [
|
|
163
|
+
p(e.$slots, "righticon", { handleClean: a })
|
|
164
164
|
]),
|
|
165
165
|
_: 3
|
|
166
166
|
}, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
|
|
167
167
|
]),
|
|
168
|
-
default:
|
|
169
|
-
(w(!0), K(T, null, z(
|
|
170
|
-
key:
|
|
171
|
-
active: N(m) ===
|
|
168
|
+
default: c(() => [
|
|
169
|
+
(w(!0), K(T, null, z(o.value, (a, s) => (w(), g(G, {
|
|
170
|
+
key: s,
|
|
171
|
+
active: N(m) === s,
|
|
172
172
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
173
|
-
onClick: (E) =>
|
|
174
|
-
onMouseover: (E) => m.value =
|
|
173
|
+
onClick: (E) => y(a, s),
|
|
174
|
+
onMouseover: (E) => m.value = s
|
|
175
175
|
}, {
|
|
176
|
-
default:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
default: c(() => [
|
|
177
|
+
p(e.$slots, "item-content", {
|
|
178
|
+
option: a,
|
|
179
|
+
idx: s
|
|
180
|
+
}, () => [
|
|
181
|
+
U("span", {
|
|
182
|
+
innerHTML: a.label
|
|
183
|
+
}, null, 8, Q)
|
|
184
|
+
])
|
|
180
185
|
]),
|
|
181
186
|
_: 2
|
|
182
187
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export type { AccessibleSelectOptions } from '../UIKit/AccessibleSelect';
|
|
|
7
7
|
export type { BaseComplexToggleProps, ToggleType, } from '../UIKit/BaseComplexToggle';
|
|
8
8
|
export type { SnackbarProps } from '../UIKit/BaseSnackbar';
|
|
9
9
|
export type { ChartOptions, ChartData } from 'chart.js';
|
|
10
|
+
export type { BaseAutocompleteThemes } from '../UIKit/BaseAutocomplete';
|
package/package.json
CHANGED
|
File without changes
|