@wikicasa-dev/components 2.2.9-alpha.48 → 2.2.9-alpha.49
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/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +89 -93
- package/package.json +1 -1
- /package/dist/assets/{swiper-autoplay.css → swiper-thumbs.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as j, mergeModels as U, useModel as S, useId as q, useTemplateRef as d, shallowRef as c, onBeforeMount as G, onMounted as J, onUnmounted as Q, watch as E, nextTick as Y, createBlock as z, openBlock as M, withCtx as W, createElementBlock as Z, Fragment as _, renderList as ee, renderSlot as m, createElementVNode as s, normalizeClass as f, withDirectives as I, unref as te, vModelText as le, toDisplayString as ne, withModifiers as oe, normalizeStyle as ae, createTextVNode as ie, vShow as ue } from "vue";
|
|
2
|
+
import se from "../BaseDropDown.vue.js";
|
|
3
3
|
import '../../../../../assets/BaseDropDown.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import { debounce as
|
|
6
|
-
const
|
|
4
|
+
import re from "../BaseSelect/SelectItem.vue.js";
|
|
5
|
+
import { debounce as de } from "@wikicasa-dev/utilities";
|
|
6
|
+
const ce = ["id", "data-cy", "placeholder"], fe = ["innerHTML"], ye = /* @__PURE__ */ j({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ U({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
11
|
enableKeyboardController: { type: Boolean, default: !0 },
|
|
@@ -29,159 +29,155 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
29
29
|
},
|
|
30
30
|
inputValueModifiers: {}
|
|
31
31
|
}),
|
|
32
|
-
emits: /* @__PURE__ */
|
|
33
|
-
setup(t, { expose:
|
|
34
|
-
const r =
|
|
32
|
+
emits: /* @__PURE__ */ U(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
|
|
33
|
+
setup(t, { expose: L, emit: D }) {
|
|
34
|
+
const r = S(t, "open"), u = S(t, "modelValue"), o = S(t, "inputValue");
|
|
35
35
|
o.value = o.value ?? u.value?.label ?? "";
|
|
36
|
-
const
|
|
37
|
-
o.value = "", u.value = null,
|
|
38
|
-
},
|
|
36
|
+
const p = D, K = q(), C = d("inputRef"), v = c(0), y = c(!1), k = c(!!u.value?.label), x = c(null), a = c([]), O = d("dropdownRef"), h = d("hiddenSpan"), w = d("inputWrapperRef"), R = d("clearButtonRef"), N = () => {
|
|
37
|
+
o.value = "", u.value = null, k.value = !1;
|
|
38
|
+
}, A = async (l) => {
|
|
39
39
|
if (!l) {
|
|
40
|
-
|
|
40
|
+
a.value = [], r.value = !1;
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
t.disableCb || (
|
|
44
|
-
},
|
|
45
|
-
const e =
|
|
46
|
-
!e || e.id === u.value?.id || (t.onOptionSelectedCb?.(e), o.value = e.label, r.value = !1, u.value = e,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
43
|
+
t.disableCb || (a.value = await x.value?.(l) || [], y.value = !0, r.value = !!a.value.length);
|
|
44
|
+
}, F = (l = -1) => {
|
|
45
|
+
const e = a.value[l];
|
|
46
|
+
!e || e.id === u.value?.id || (t.onOptionSelectedCb?.(e), o.value = e.label, r.value = !1, u.value = e, k.value = !0, a.value = []);
|
|
47
|
+
}, P = () => {
|
|
48
|
+
C.value?.select();
|
|
49
|
+
}, H = () => {
|
|
50
|
+
C.value?.focus();
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
{ immediate: !0 }
|
|
73
|
-
), T(
|
|
74
|
-
() => M.value?.selectedIdx,
|
|
52
|
+
let B = null;
|
|
53
|
+
const $ = () => {
|
|
54
|
+
const l = h.value, e = w.value, n = R.value;
|
|
55
|
+
if (!l || !e) return;
|
|
56
|
+
const T = l.offsetWidth, b = e.offsetWidth, i = t.clearButton?.offset || 0, g = t.clearButton?.width || n?.offsetWidth || 0, X = b - i - g, V = Math.min(T, X);
|
|
57
|
+
V !== v.value && (v.value = V);
|
|
58
|
+
};
|
|
59
|
+
return G(() => {
|
|
60
|
+
x.value = de({ delay: 300 }, t.onInputChangeCb);
|
|
61
|
+
}), J(() => {
|
|
62
|
+
w.value && (B = new ResizeObserver(() => {
|
|
63
|
+
$();
|
|
64
|
+
}), B.observe(w.value));
|
|
65
|
+
}), Q(() => {
|
|
66
|
+
B?.disconnect();
|
|
67
|
+
}), E([o, h, R], () => {
|
|
68
|
+
Y($);
|
|
69
|
+
}), E(
|
|
70
|
+
() => O.value?.selectedIdx,
|
|
75
71
|
(l) => {
|
|
76
72
|
const e = l ?? -1;
|
|
77
|
-
e !== -1 &&
|
|
73
|
+
e !== -1 && F(e);
|
|
78
74
|
}
|
|
79
|
-
),
|
|
75
|
+
), E(
|
|
80
76
|
u,
|
|
81
77
|
(l, e) => {
|
|
82
78
|
l === e || l?.label === o.value || (o.value = l?.label || "");
|
|
83
79
|
},
|
|
84
80
|
{ immediate: !0 }
|
|
85
|
-
),
|
|
86
|
-
getRootElement: () =>
|
|
87
|
-
select:
|
|
88
|
-
focus:
|
|
89
|
-
}), (l, e) => (
|
|
81
|
+
), L({
|
|
82
|
+
getRootElement: () => O.value?.getRootElement(),
|
|
83
|
+
select: P,
|
|
84
|
+
focus: H
|
|
85
|
+
}), (l, e) => (M(), z(se, {
|
|
90
86
|
ref: "dropdownRef",
|
|
91
87
|
class: "uikit-clearable-autocomplete",
|
|
92
88
|
"data-cy": t.dataCy,
|
|
93
89
|
"dropdown-element": "ul",
|
|
94
90
|
"dropdown-classes": ["uikit-z-30", t.dropdownClasses],
|
|
95
|
-
"keep-state": !
|
|
91
|
+
"keep-state": !a.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
96
92
|
"activate-keyboard-controller": t.enableKeyboardController,
|
|
97
|
-
"reset-keyboard-controller":
|
|
98
|
-
"onUpdate:resetKeyboardController": e[5] || (e[5] = (n) =>
|
|
93
|
+
"reset-keyboard-controller": y.value,
|
|
94
|
+
"onUpdate:resetKeyboardController": e[5] || (e[5] = (n) => y.value = n),
|
|
99
95
|
open: r.value,
|
|
100
96
|
"onUpdate:open": e[6] || (e[6] = (n) => r.value = n)
|
|
101
97
|
}, {
|
|
102
|
-
btn_slot:
|
|
98
|
+
btn_slot: W(() => [
|
|
103
99
|
s("div", {
|
|
104
|
-
class:
|
|
105
|
-
onClick: e[4] || (e[4] = (n) =>
|
|
100
|
+
class: f(["uikit-text-16", t.triggerWrapperClasses]),
|
|
101
|
+
onClick: e[4] || (e[4] = (n) => p("click", n))
|
|
106
102
|
}, [
|
|
107
|
-
|
|
103
|
+
m(l.$slots, "left-icon"),
|
|
108
104
|
s("div", {
|
|
109
105
|
ref: "inputWrapperRef",
|
|
110
|
-
class:
|
|
106
|
+
class: f(["uikit-relative", t.inputWrapperClasses])
|
|
111
107
|
}, [
|
|
112
|
-
|
|
108
|
+
I(s("input", {
|
|
113
109
|
ref: "inputRef",
|
|
114
110
|
"onUpdate:modelValue": [
|
|
115
111
|
e[0] || (e[0] = (n) => o.value = n),
|
|
116
|
-
|
|
112
|
+
A
|
|
117
113
|
],
|
|
118
|
-
id:
|
|
114
|
+
id: te(K),
|
|
119
115
|
"data-cy": t.dataCy ? `ac_input_${t.dataCy}` : "",
|
|
120
116
|
type: "text",
|
|
121
117
|
autocomplete: "off",
|
|
122
|
-
class:
|
|
118
|
+
class: f(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", t.inputClasses]),
|
|
123
119
|
style: {
|
|
124
120
|
font: "inherit",
|
|
125
121
|
fontSize: "inherit"
|
|
126
122
|
},
|
|
127
123
|
placeholder: t.placeholder,
|
|
128
|
-
onKeydown: e[1] || (e[1] = (n) =>
|
|
124
|
+
onKeydown: e[1] || (e[1] = (n) => p("keydown", n)),
|
|
129
125
|
onInput: e[2] || (e[2] = (n) => {
|
|
130
|
-
|
|
126
|
+
p("input", n), k.value = !1;
|
|
131
127
|
}),
|
|
132
128
|
onClick: e[3] || (e[3] = (n) => {
|
|
133
|
-
|
|
129
|
+
p("inputClick", n), C.value?.select();
|
|
134
130
|
})
|
|
135
|
-
}, null, 42,
|
|
136
|
-
[
|
|
131
|
+
}, null, 42, ce), [
|
|
132
|
+
[le, o.value]
|
|
137
133
|
]),
|
|
138
134
|
s("span", {
|
|
139
135
|
ref_key: "hiddenSpan",
|
|
140
|
-
ref:
|
|
141
|
-
class:
|
|
136
|
+
ref: h,
|
|
137
|
+
class: f(["uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre", t.hiddenTextClasses]),
|
|
142
138
|
style: {
|
|
143
139
|
font: "inherit",
|
|
144
140
|
fontSize: "inherit"
|
|
145
141
|
}
|
|
146
|
-
},
|
|
147
|
-
|
|
142
|
+
}, ne(o.value), 3),
|
|
143
|
+
I(s("button", {
|
|
148
144
|
ref: "clearButtonRef",
|
|
149
145
|
type: "button",
|
|
150
|
-
class:
|
|
146
|
+
class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", t.clearButton?.classes]),
|
|
151
147
|
"aria-label": "Clear input",
|
|
152
|
-
style:
|
|
153
|
-
left: `${
|
|
148
|
+
style: ae({
|
|
149
|
+
left: `${v.value + (t.clearButton?.offset || 0)}px`,
|
|
154
150
|
width: t.clearButton?.width ? `${t.clearButton.width}px` : "auto",
|
|
155
151
|
height: t.clearButton?.height ? `${t.clearButton.height}px` : "auto"
|
|
156
152
|
}),
|
|
157
|
-
onClick:
|
|
153
|
+
onClick: oe(N, ["stop"])
|
|
158
154
|
}, [
|
|
159
|
-
|
|
160
|
-
e[7] || (e[7] =
|
|
155
|
+
m(l.$slots, "clear-icon", {}, () => [
|
|
156
|
+
e[7] || (e[7] = ie("X", -1))
|
|
161
157
|
])
|
|
162
158
|
], 6), [
|
|
163
|
-
[
|
|
159
|
+
[ue, k.value && v.value]
|
|
164
160
|
])
|
|
165
161
|
], 2),
|
|
166
|
-
|
|
162
|
+
m(l.$slots, "right-icon")
|
|
167
163
|
], 2)
|
|
168
164
|
]),
|
|
169
|
-
default:
|
|
170
|
-
(
|
|
171
|
-
key:
|
|
172
|
-
active: n ===
|
|
165
|
+
default: W(({ activeIdx: n, setActiveIdx: T }) => [
|
|
166
|
+
(M(!0), Z(_, null, ee(a.value, (b, i) => (M(), z(re, {
|
|
167
|
+
key: i,
|
|
168
|
+
active: n === i,
|
|
173
169
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
174
|
-
onClick: (
|
|
175
|
-
onMouseover: (
|
|
170
|
+
onClick: (g) => F(i),
|
|
171
|
+
onMouseover: (g) => T(i)
|
|
176
172
|
}, {
|
|
177
|
-
default:
|
|
178
|
-
|
|
179
|
-
option:
|
|
180
|
-
idx:
|
|
173
|
+
default: W(() => [
|
|
174
|
+
m(l.$slots, "option-content", {
|
|
175
|
+
option: b,
|
|
176
|
+
idx: i
|
|
181
177
|
}, () => [
|
|
182
178
|
s("span", {
|
|
183
|
-
innerHTML:
|
|
184
|
-
}, null, 8,
|
|
179
|
+
innerHTML: b.label
|
|
180
|
+
}, null, 8, fe)
|
|
185
181
|
])
|
|
186
182
|
]),
|
|
187
183
|
_: 2
|
|
@@ -192,5 +188,5 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
192
188
|
}
|
|
193
189
|
});
|
|
194
190
|
export {
|
|
195
|
-
|
|
191
|
+
ye as default
|
|
196
192
|
};
|
package/package.json
CHANGED
|
File without changes
|