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