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