@wikicasa-dev/components 2.2.9-alpha.21 → 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 +51 -54
- package/package.json +1 -1
- /package/dist/assets/{swiper-keyboard.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,11 +1,11 @@
|
|
|
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
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ V({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
11
|
enableKeyboardController: { type: Boolean, default: !0 },
|
|
@@ -29,40 +29,43 @@ 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: 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
|
-
t.disableCb || (a.value = await
|
|
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
|
-
|
|
52
|
+
return G(() => {
|
|
53
|
+
M.value = ae({ delay: 300 }, t.onInputChangeCb);
|
|
54
54
|
}), g(
|
|
55
|
-
[o, R,
|
|
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
|
|
60
|
-
|
|
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
|
+
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
67
|
), g(
|
|
65
|
-
() =>
|
|
68
|
+
() => F.value?.selectedIdx,
|
|
66
69
|
(l) => {
|
|
67
70
|
const e = l ?? -1;
|
|
68
71
|
e !== -1 && $(e);
|
|
@@ -73,11 +76,11 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
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
|
+
), U({
|
|
80
|
+
getRootElement: () => F.value?.getRootElement(),
|
|
81
|
+
select: N,
|
|
82
|
+
focus: A
|
|
83
|
+
}), (l, e) => (S(), W(ne, {
|
|
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))
|
|
@@ -98,20 +101,15 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
98
101
|
m(l.$slots, "left-icon"),
|
|
99
102
|
s("div", {
|
|
100
103
|
ref: "inputWrapperRef",
|
|
101
|
-
class: f(["uikit-relative", t.inputWrapperClasses])
|
|
102
|
-
style: W(
|
|
103
|
-
t.clearButton?.width ? {
|
|
104
|
-
paddingRight: `${t.clearButton.width}px`
|
|
105
|
-
} : {}
|
|
106
|
-
)
|
|
104
|
+
class: f(["uikit-relative", t.inputWrapperClasses])
|
|
107
105
|
}, [
|
|
108
|
-
|
|
106
|
+
Q(s("input", {
|
|
109
107
|
ref: "inputRef",
|
|
110
108
|
"onUpdate:modelValue": [
|
|
111
109
|
e[0] || (e[0] = (n) => o.value = n),
|
|
112
|
-
|
|
110
|
+
K
|
|
113
111
|
],
|
|
114
|
-
id:
|
|
112
|
+
id: Y(I),
|
|
115
113
|
"data-cy": t.dataCy ? `ac_input_${t.dataCy}` : "",
|
|
116
114
|
type: "text",
|
|
117
115
|
autocomplete: "off",
|
|
@@ -123,13 +121,13 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
123
121
|
placeholder: t.placeholder,
|
|
124
122
|
onKeydown: e[1] || (e[1] = (n) => p("keydown", n)),
|
|
125
123
|
onInput: e[2] || (e[2] = (n) => {
|
|
126
|
-
p("input", n),
|
|
124
|
+
p("input", n), y.value = !1;
|
|
127
125
|
}),
|
|
128
126
|
onClick: e[3] || (e[3] = (n) => {
|
|
129
127
|
p("inputClick", n), C.value?.select();
|
|
130
128
|
})
|
|
131
|
-
}, null, 42,
|
|
132
|
-
[
|
|
129
|
+
}, null, 42, ie), [
|
|
130
|
+
[Z, o.value]
|
|
133
131
|
]),
|
|
134
132
|
s("span", {
|
|
135
133
|
ref_key: "hiddenSpan",
|
|
@@ -139,45 +137,44 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
139
137
|
font: "inherit",
|
|
140
138
|
fontSize: "inherit"
|
|
141
139
|
}
|
|
142
|
-
},
|
|
143
|
-
|
|
140
|
+
}, _(o.value), 3),
|
|
141
|
+
s("button", {
|
|
144
142
|
ref: "clearButtonRef",
|
|
145
143
|
type: "button",
|
|
146
144
|
class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", t.clearButton?.classes]),
|
|
147
145
|
"aria-label": "Clear input",
|
|
148
|
-
style:
|
|
146
|
+
style: te({
|
|
147
|
+
display: y.value && v.value ? "inline-block" : "none !important",
|
|
149
148
|
left: `${v.value + (t.clearButton?.offset || 0)}px`,
|
|
150
149
|
width: t.clearButton?.width ? `${t.clearButton.width}px` : "auto",
|
|
151
150
|
height: t.clearButton?.height ? `${t.clearButton.height}px` : "auto"
|
|
152
151
|
}),
|
|
153
|
-
onClick:
|
|
152
|
+
onClick: ee(z, ["stop"])
|
|
154
153
|
}, [
|
|
155
154
|
m(l.$slots, "clear-icon", {}, () => [
|
|
156
155
|
e[7] || (e[7] = le("X", -1))
|
|
157
156
|
])
|
|
158
|
-
], 6)
|
|
159
|
-
|
|
160
|
-
])
|
|
161
|
-
], 6),
|
|
157
|
+
], 6)
|
|
158
|
+
], 2),
|
|
162
159
|
m(l.$slots, "right-icon")
|
|
163
160
|
], 2)
|
|
164
161
|
]),
|
|
165
|
-
default:
|
|
166
|
-
(
|
|
162
|
+
default: x(({ activeIdx: n, setActiveIdx: h }) => [
|
|
163
|
+
(S(!0), j(q, null, J(a.value, (k, i) => (S(), W(oe, {
|
|
167
164
|
key: i,
|
|
168
165
|
active: n === i,
|
|
169
166
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
170
167
|
onClick: (w) => $(i),
|
|
171
|
-
onMouseover: (w) =>
|
|
168
|
+
onMouseover: (w) => h(i)
|
|
172
169
|
}, {
|
|
173
|
-
default:
|
|
170
|
+
default: x(() => [
|
|
174
171
|
m(l.$slots, "option-content", {
|
|
175
172
|
option: k,
|
|
176
173
|
idx: i
|
|
177
174
|
}, () => [
|
|
178
175
|
s("span", {
|
|
179
176
|
innerHTML: k.label
|
|
180
|
-
}, null, 8,
|
|
177
|
+
}, null, 8, ue)
|
|
181
178
|
])
|
|
182
179
|
]),
|
|
183
180
|
_: 2
|
|
@@ -188,5 +185,5 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
188
185
|
}
|
|
189
186
|
});
|
|
190
187
|
export {
|
|
191
|
-
|
|
188
|
+
ve as default
|
|
192
189
|
};
|
package/package.json
CHANGED
|
File without changes
|