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