@wikicasa-dev/components 2.9.0-alpha.1 → 2.9.0-alpha.2
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.
|
@@ -47,6 +47,7 @@ declare const __VLS_export: <TID extends string | number | undefined, TPayload>(
|
|
|
47
47
|
} ? P : {});
|
|
48
48
|
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
49
49
|
getRootElement: () => HTMLDivElement | null | undefined;
|
|
50
|
+
clearSuggestions: () => void;
|
|
50
51
|
select: () => void;
|
|
51
52
|
focus: () => void;
|
|
52
53
|
}>) => void;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import e from "../BaseSelect/SelectItem.js";
|
|
2
2
|
import t from "../BaseDropDown.js";
|
|
3
|
-
import {
|
|
3
|
+
import { afterPaint as n } from "../frameUtils.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, isMemoSame as ee, mergeModels as d, normalizeClass as f, normalizeStyle as te, onMounted as ne, onUnmounted as re, openBlock as p, renderList as ie, renderSlot as m, shallowRef as h, toDisplayString as ae, unref as oe, useId as g, useModel as _, useTemplateRef as v, vModelText as se, vShow as ce, watch as y, withCtx as b, withDirectives as x, withModifiers as le } from "vue";
|
|
4
5
|
import '../../assets/ClearableAutocomplete.css';//#region lib/UIKit/Autocomplete/ClearableAutocomplete.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var ue = [
|
|
6
7
|
"id",
|
|
7
8
|
"data-cy",
|
|
8
9
|
"placeholder"
|
|
9
|
-
],
|
|
10
|
+
], de = ["data-cy"], fe = {
|
|
10
11
|
key: 1,
|
|
11
12
|
name: "loading-state",
|
|
12
13
|
class: "uikit-progress-bar-track uikit-absolute uikit-left-0 uikit-top-0 uikit-w-full"
|
|
13
|
-
},
|
|
14
|
-
typeof requestAnimationFrame == "function" && requestAnimationFrame(() => setTimeout(e, 0));
|
|
15
|
-
}, C = /*@__PURE__*/ l({
|
|
14
|
+
}, pe = ["innerHTML"], S = /*@__PURE__*/ u({
|
|
16
15
|
__name: "ClearableAutocomplete",
|
|
17
|
-
props: /*@__PURE__*/
|
|
16
|
+
props: /*@__PURE__*/ d({
|
|
18
17
|
dataCy: {},
|
|
19
18
|
placeholder: {},
|
|
20
19
|
enableKeyboardController: {
|
|
@@ -45,7 +44,7 @@ var le = [
|
|
|
45
44
|
inputValue: { default: "" },
|
|
46
45
|
inputValueModifiers: {}
|
|
47
46
|
}),
|
|
48
|
-
emits: /*@__PURE__*/
|
|
47
|
+
emits: /*@__PURE__*/ d([
|
|
49
48
|
"input",
|
|
50
49
|
"click",
|
|
51
50
|
"inputClick",
|
|
@@ -55,49 +54,49 @@ var le = [
|
|
|
55
54
|
"update:modelValue",
|
|
56
55
|
"update:inputValue"
|
|
57
56
|
]),
|
|
58
|
-
setup(
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
let t =
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
setup(u, { expose: d, emit: S }) {
|
|
58
|
+
let C = _(u, "open"), w = _(u, "modelValue"), T = _(u, "inputValue"), E = S, me = g(), D = v("inputRef"), O = h(0), k = h(!1), A = h(!1), j = h(!1), M = h(-1), N = h(-1), P = h([]), he = i(() => ["uikit-z-30", u.dropdownClasses]), F = null, I = 0, L = v("dropdownRef"), R = v("hiddenSpan"), z = v("inputWrapperRef"), B = v("clearButtonRef"), V = () => {
|
|
59
|
+
M.value = -1, N.value = -1;
|
|
60
|
+
}, H = () => {
|
|
61
|
+
F &&= (clearTimeout(F), null), I += 1, A.value = !1, j.value = !1;
|
|
62
|
+
}, U = !1, W = () => {
|
|
63
|
+
U = !1, P.value = [];
|
|
64
|
+
}, G = () => {
|
|
65
|
+
U && W();
|
|
66
|
+
}, ge = (e) => {
|
|
67
|
+
H(), G();
|
|
68
|
+
let t = I;
|
|
69
|
+
A.value = !0, F = setTimeout(async () => {
|
|
70
|
+
F = null, C.value = !0, j.value = !0;
|
|
72
71
|
let n = [];
|
|
73
72
|
try {
|
|
74
|
-
n = await
|
|
73
|
+
n = await u.onInputChangeCb(e);
|
|
75
74
|
} catch {
|
|
76
75
|
n = [];
|
|
77
76
|
}
|
|
78
|
-
t ===
|
|
77
|
+
t === I && (P.value = n, V(), A.value = !1, j.value = !1, C.value = !!P.value.length);
|
|
79
78
|
}, 300);
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
},
|
|
79
|
+
}, K = () => {
|
|
80
|
+
H(), W(), C.value = !1, T.value = "", w.value = null, k.value = !1, O.value = 0, V();
|
|
81
|
+
}, q = () => {
|
|
82
|
+
K();
|
|
83
|
+
}, _e = (e) => {
|
|
85
84
|
if (!e) {
|
|
86
|
-
|
|
85
|
+
K();
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
88
|
+
if (u.disableCb && e === w.value?.label) {
|
|
89
|
+
H(), G();
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
let
|
|
98
|
-
!
|
|
99
|
-
},
|
|
100
|
-
if (!
|
|
92
|
+
ge(e);
|
|
93
|
+
}, ve = (e) => {
|
|
94
|
+
E("input", e), k.value = !1, O.value = 0, !e.isComposing && _e(e.target.value);
|
|
95
|
+
}, J = (e = -1, t) => {
|
|
96
|
+
let r = P.value[e];
|
|
97
|
+
!r || r.id === w.value?.id || (N.value = e, u.onOptionSelectedCb?.(r, { trigger: t }), T.value = r.label, C.value = !1, w.value = r, k.value = !0, H(), U = !0, n(G));
|
|
98
|
+
}, Y = (e) => {
|
|
99
|
+
if (!u.enableKeyboardController || !C.value || ![
|
|
101
100
|
"ArrowUp",
|
|
102
101
|
"ArrowDown",
|
|
103
102
|
"Enter",
|
|
@@ -108,11 +107,11 @@ var le = [
|
|
|
108
107
|
"End"
|
|
109
108
|
].includes(e.key)) return;
|
|
110
109
|
if (e.key === "Escape") {
|
|
111
|
-
|
|
110
|
+
M.value = N.value, C.value = !1, e.stopPropagation();
|
|
112
111
|
return;
|
|
113
112
|
}
|
|
114
|
-
if (!
|
|
115
|
-
let t =
|
|
113
|
+
if (!P.value.length) return;
|
|
114
|
+
let t = P.value.length - 1;
|
|
116
115
|
if ([
|
|
117
116
|
"ArrowUp",
|
|
118
117
|
"ArrowDown",
|
|
@@ -120,136 +119,147 @@ var le = [
|
|
|
120
119
|
"Home",
|
|
121
120
|
"PageDown",
|
|
122
121
|
"End"
|
|
123
|
-
].includes(e.key) && e.preventDefault(), e.key === "ArrowUp")
|
|
124
|
-
else if (e.key === "ArrowDown")
|
|
122
|
+
].includes(e.key) && e.preventDefault(), e.key === "ArrowUp") M.value = M.value <= 0 ? t : M.value - 1;
|
|
123
|
+
else if (e.key === "ArrowDown") M.value = M.value >= t ? 0 : M.value + 1;
|
|
125
124
|
else if (e.key === "Enter") {
|
|
126
|
-
if (
|
|
127
|
-
e.preventDefault(),
|
|
128
|
-
} else e.key === "PageUp" || e.key === "Home" ?
|
|
125
|
+
if (M.value === -1) return;
|
|
126
|
+
e.preventDefault(), J(M.value, "enter");
|
|
127
|
+
} else e.key === "PageUp" || e.key === "Home" ? M.value = 0 : (e.key === "PageDown" || e.key === "End") && (M.value = t);
|
|
129
128
|
e.stopPropagation();
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
}, ye = (e) => {
|
|
130
|
+
E("keydown", e), Y(e);
|
|
131
|
+
}, be = () => {
|
|
132
|
+
H(), W(), V(), C.value = !1;
|
|
133
|
+
}, xe = () => {
|
|
134
|
+
D.value?.select();
|
|
135
|
+
}, Se = () => {
|
|
136
|
+
D.value?.focus();
|
|
137
|
+
}, X = null, Z = () => {
|
|
138
|
+
if (!k.value) return;
|
|
139
|
+
let e = R.value, t = z.value, n = B.value;
|
|
139
140
|
if (!e || !t) return;
|
|
140
141
|
let r = e.offsetWidth, i = t.offsetWidth;
|
|
141
142
|
if (!i) return;
|
|
142
|
-
let a =
|
|
143
|
-
c !==
|
|
143
|
+
let a = u.clearButton?.offset || 0, o = u.clearButton?.width || n?.offsetWidth || 0, s = i - a - o, c = Math.min(r, s);
|
|
144
|
+
c !== O.value && (O.value = c);
|
|
145
|
+
}, Q = !1, $ = () => {
|
|
146
|
+
Q || (Q = !0, n(() => {
|
|
147
|
+
Q = !1, Z();
|
|
148
|
+
}));
|
|
144
149
|
};
|
|
145
|
-
return
|
|
146
|
-
|
|
150
|
+
return ne(() => {
|
|
151
|
+
z.value && (X = new ResizeObserver(() => {
|
|
152
|
+
if (O.value) {
|
|
153
|
+
Z();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
147
156
|
$();
|
|
148
|
-
}),
|
|
149
|
-
}),
|
|
150
|
-
|
|
157
|
+
}), X.observe(z.value));
|
|
158
|
+
}), re(() => {
|
|
159
|
+
X?.disconnect(), H();
|
|
151
160
|
}), y([
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
161
|
+
T,
|
|
162
|
+
k,
|
|
163
|
+
R,
|
|
164
|
+
B
|
|
156
165
|
], () => {
|
|
157
|
-
|
|
158
|
-
}), y(
|
|
159
|
-
if (e?.label ===
|
|
166
|
+
$();
|
|
167
|
+
}), y(w, (e) => {
|
|
168
|
+
if (e?.label === T.value) return;
|
|
160
169
|
let t = e?.label || "";
|
|
161
|
-
|
|
162
|
-
}, { immediate: !0 }),
|
|
163
|
-
getRootElement: () =>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
T.value = t, t && (k.value = !0);
|
|
171
|
+
}, { immediate: !0 }), d({
|
|
172
|
+
getRootElement: () => L.value?.getRootElement(),
|
|
173
|
+
clearSuggestions: be,
|
|
174
|
+
select: xe,
|
|
175
|
+
focus: Se
|
|
176
|
+
}), (n, i) => (p(), a(t, {
|
|
167
177
|
ref: "dropdownRef",
|
|
168
178
|
class: "uikit-clearable-autocomplete",
|
|
169
|
-
"data-cy":
|
|
179
|
+
"data-cy": u.dataCy,
|
|
170
180
|
"dropdown-element": "ul",
|
|
171
|
-
"dropdown-classes":
|
|
172
|
-
"keep-state":
|
|
181
|
+
"dropdown-classes": he.value,
|
|
182
|
+
"keep-state": u.keepState === "closed" ? "closed" : "opened",
|
|
173
183
|
"activate-keyboard-controller": !1,
|
|
174
|
-
open:
|
|
175
|
-
"onUpdate:open":
|
|
184
|
+
open: C.value,
|
|
185
|
+
"onUpdate:open": i[5] ||= (e) => C.value = e
|
|
176
186
|
}, {
|
|
177
|
-
btn_slot: b(() => [
|
|
178
|
-
class:
|
|
179
|
-
onClick:
|
|
187
|
+
btn_slot: b(() => [c("div", {
|
|
188
|
+
class: f(["uikit-text-16", u.triggerWrapperClasses]),
|
|
189
|
+
onClick: i[2] ||= (e) => E("click", e)
|
|
180
190
|
}, [
|
|
181
|
-
m(
|
|
182
|
-
|
|
191
|
+
m(n.$slots, "left-icon"),
|
|
192
|
+
c("div", {
|
|
183
193
|
ref: "inputWrapperRef",
|
|
184
|
-
class:
|
|
194
|
+
class: f(["uikit-relative", u.inputWrapperClasses])
|
|
185
195
|
}, [
|
|
186
|
-
x(
|
|
196
|
+
x(c("input", {
|
|
187
197
|
ref: "inputRef",
|
|
188
|
-
"onUpdate:modelValue":
|
|
189
|
-
id:
|
|
190
|
-
"data-cy":
|
|
198
|
+
"onUpdate:modelValue": i[0] ||= (e) => T.value = e,
|
|
199
|
+
id: oe(me),
|
|
200
|
+
"data-cy": u.dataCy ? `ac_input_${u.dataCy}` : "",
|
|
191
201
|
type: "text",
|
|
192
202
|
autocomplete: "off",
|
|
193
|
-
class:
|
|
203
|
+
class: f(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", u.inputClasses]),
|
|
194
204
|
style: {
|
|
195
205
|
font: "inherit",
|
|
196
206
|
fontSize: "inherit"
|
|
197
207
|
},
|
|
198
|
-
placeholder:
|
|
199
|
-
onKeydown:
|
|
200
|
-
onInput:
|
|
201
|
-
onClick:
|
|
202
|
-
|
|
208
|
+
placeholder: u.placeholder,
|
|
209
|
+
onKeydown: ye,
|
|
210
|
+
onInput: ve,
|
|
211
|
+
onClick: i[1] ||= (e) => {
|
|
212
|
+
E("inputClick", e), D.value?.select();
|
|
203
213
|
}
|
|
204
|
-
}, null, 42,
|
|
205
|
-
|
|
214
|
+
}, null, 42, ue), [[se, T.value]]),
|
|
215
|
+
c("span", {
|
|
206
216
|
ref_key: "hiddenSpan",
|
|
207
|
-
ref:
|
|
208
|
-
class:
|
|
217
|
+
ref: R,
|
|
218
|
+
class: f(["uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-max-w-full uikit-overflow-hidden uikit-whitespace-pre", u.hiddenTextClasses]),
|
|
209
219
|
style: {
|
|
210
220
|
font: "inherit",
|
|
211
221
|
fontSize: "inherit"
|
|
212
222
|
}
|
|
213
|
-
},
|
|
214
|
-
x(
|
|
223
|
+
}, ae(T.value), 3),
|
|
224
|
+
x(c("button", {
|
|
215
225
|
ref: "clearButtonRef",
|
|
216
226
|
type: "button",
|
|
217
|
-
class:
|
|
218
|
-
"data-cy":
|
|
227
|
+
class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", u.clearButton?.classes]),
|
|
228
|
+
"data-cy": u.clearButton?.dataCy || "clear-btn",
|
|
219
229
|
"aria-label": "Clear input",
|
|
220
|
-
style:
|
|
221
|
-
left: `${
|
|
222
|
-
width:
|
|
223
|
-
height:
|
|
230
|
+
style: te({
|
|
231
|
+
left: `${O.value + (u.clearButton?.offset || 0)}px`,
|
|
232
|
+
width: u.clearButton?.width ? `${u.clearButton.width}px` : "auto",
|
|
233
|
+
height: u.clearButton?.height ? `${u.clearButton.height}px` : "auto"
|
|
224
234
|
}),
|
|
225
|
-
onClick:
|
|
226
|
-
}, [m(
|
|
235
|
+
onClick: le(q, ["stop"])
|
|
236
|
+
}, [m(n.$slots, "clear-icon", {}, () => [i[6] ||= l("X", -1)])], 14, de), [[ce, k.value && O.value]])
|
|
227
237
|
], 2),
|
|
228
|
-
m(
|
|
238
|
+
m(n.$slots, "right-icon")
|
|
229
239
|
], 2)]),
|
|
230
240
|
default: b(() => [
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
let
|
|
241
|
+
j.value && !P.value.length ? m(n.$slots, "loading-state", {}, void 0, void 0, 0) : o("", !0),
|
|
242
|
+
A.value && P.value.length ? (p(), s("div", fe, [...i[7] ||= [c("div", { class: "uikit-progress-bar-fill" }, null, -1)]])) : o("", !0),
|
|
243
|
+
P.value.length ? (p(!0), s(r, { key: 2 }, ie(P.value, (t, r, i, o) => {
|
|
244
|
+
let s = [
|
|
235
245
|
t,
|
|
236
|
-
|
|
237
|
-
|
|
246
|
+
M.value === r,
|
|
247
|
+
u.enableKeyboardController
|
|
238
248
|
];
|
|
239
|
-
if (o && o.el && o.key ===
|
|
240
|
-
let
|
|
241
|
-
key:
|
|
242
|
-
active:
|
|
243
|
-
"focus-on-active":
|
|
249
|
+
if (o && o.el && o.key === r && ee(o, s)) return o;
|
|
250
|
+
let l = (p(), a(e, {
|
|
251
|
+
key: r,
|
|
252
|
+
active: M.value === r,
|
|
253
|
+
"focus-on-active": u.enableKeyboardController,
|
|
244
254
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
245
|
-
onClick: (e) =>
|
|
246
|
-
onKeydown:
|
|
247
|
-
onMouseover: (e) =>
|
|
255
|
+
onClick: (e) => J(r, "click"),
|
|
256
|
+
onKeydown: Y,
|
|
257
|
+
onMouseover: (e) => M.value = r
|
|
248
258
|
}, {
|
|
249
|
-
default: b(() => [m(
|
|
259
|
+
default: b(() => [m(n.$slots, "option-content", {
|
|
250
260
|
option: t,
|
|
251
|
-
idx:
|
|
252
|
-
}, () => [
|
|
261
|
+
idx: r
|
|
262
|
+
}, () => [c("span", { innerHTML: t.label }, null, 8, pe)])]),
|
|
253
263
|
_: 2
|
|
254
264
|
}, 1032, [
|
|
255
265
|
"active",
|
|
@@ -257,8 +267,8 @@ var le = [
|
|
|
257
267
|
"onClick",
|
|
258
268
|
"onMouseover"
|
|
259
269
|
]));
|
|
260
|
-
return
|
|
261
|
-
},
|
|
270
|
+
return l.memo = s, l;
|
|
271
|
+
}, i, 3), 128)) : o("", !0)
|
|
262
272
|
]),
|
|
263
273
|
_: 3
|
|
264
274
|
}, 8, [
|
|
@@ -270,4 +280,4 @@ var le = [
|
|
|
270
280
|
}
|
|
271
281
|
});
|
|
272
282
|
//#endregion
|
|
273
|
-
export {
|
|
283
|
+
export { S as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { afterPaint as e } from "./frameUtils.js";
|
|
2
|
+
import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, onUnmounted as d, openBlock as f, renderSlot as p, shallowRef as m, unref as h, useModel as g, useTemplateRef as _, vShow as v, withCtx as y, withDirectives as b, withModifiers as x } from "vue";
|
|
3
|
+
import { CloseIcon as S } from "@wikicasa-dev/svg-icons";
|
|
3
4
|
import '../assets/baseModal.css';//#region lib/UIKit/BaseModal.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
+
var C = [
|
|
5
6
|
"id",
|
|
6
7
|
"data-cy",
|
|
7
8
|
"data-state"
|
|
8
|
-
],
|
|
9
|
+
], w = ["innerHTML"], T = /*@__PURE__*/ c({
|
|
9
10
|
__name: "BaseModal",
|
|
10
|
-
props: /*@__PURE__*/
|
|
11
|
+
props: /*@__PURE__*/ l({
|
|
11
12
|
id: { default: "base-bt-modal" },
|
|
12
13
|
size: { default: "modal-md" },
|
|
13
14
|
customBackdropClasses: {},
|
|
@@ -44,118 +45,120 @@ var S = [
|
|
|
44
45
|
},
|
|
45
46
|
showModalModifiers: {}
|
|
46
47
|
}),
|
|
47
|
-
emits: /*@__PURE__*/
|
|
48
|
+
emits: /*@__PURE__*/ l([
|
|
48
49
|
"closed",
|
|
49
50
|
"opened",
|
|
50
51
|
"dialogClick"
|
|
51
52
|
], ["update:showModal"]),
|
|
52
|
-
setup(
|
|
53
|
-
let
|
|
54
|
-
e === "Escape" &&
|
|
55
|
-
}, M = () => {
|
|
56
|
-
document?.body.addEventListener("keydown", j);
|
|
53
|
+
setup(c, { emit: l }) {
|
|
54
|
+
let T = l, E = g(c, "showModal"), D = E.value, O = _("backdrop"), k = _("modalDialog"), A = m(!1), j = m(!1), M = ({ key: e }) => {
|
|
55
|
+
e === "Escape" && z();
|
|
57
56
|
}, N = () => {
|
|
58
|
-
document?.body.
|
|
57
|
+
document?.body.addEventListener("keydown", M);
|
|
59
58
|
}, P = () => {
|
|
60
|
-
|
|
59
|
+
document?.body.removeEventListener("keydown", M);
|
|
61
60
|
}, F = () => {
|
|
62
|
-
|
|
63
|
-
R();
|
|
64
|
-
}, s.autoClose);
|
|
61
|
+
j.value ||= (N(), document?.body.classList.add("sm:uikit-pr-15px", "sm:uikit-mr-0", "uikit-overflow-hidden"), !0);
|
|
65
62
|
}, I = () => {
|
|
66
|
-
|
|
63
|
+
T("opened"), c.autoClose !== void 0 && setTimeout(() => {
|
|
64
|
+
z();
|
|
65
|
+
}, c.autoClose);
|
|
67
66
|
}, L = () => {
|
|
68
|
-
|
|
67
|
+
e(() => {
|
|
68
|
+
E.value || document?.body.classList.remove("sm:uikit-pr-15px", "sm:uikit-mr-0", "uikit-overflow-hidden");
|
|
69
|
+
});
|
|
69
70
|
}, R = () => {
|
|
70
|
-
|
|
71
|
-
}, z = (
|
|
72
|
-
|
|
71
|
+
P(), j.value = !1, T("closed");
|
|
72
|
+
}, z = () => {
|
|
73
|
+
E.value = !1;
|
|
73
74
|
}, B = (e) => {
|
|
74
|
-
|
|
75
|
-
}, V =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
k.value && k.value.contains(e.target) && (A.value = !0);
|
|
76
|
+
}, V = (e) => {
|
|
77
|
+
k.value && k.value.contains(e.target) && (A.value = !1);
|
|
78
|
+
}, H = async (e) => {
|
|
79
|
+
if (!(e.target !== O.value && O.value?.contains(e.target)) && c.closeOnClickOut) {
|
|
80
|
+
if (A.value) {
|
|
81
|
+
A.value = !1;
|
|
79
82
|
return;
|
|
80
83
|
}
|
|
81
|
-
|
|
84
|
+
z();
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
d(() => {
|
|
88
|
+
P(), document?.body.classList.remove("sm:uikit-pr-15px", "sm:uikit-mr-0", "uikit-overflow-hidden");
|
|
86
89
|
});
|
|
87
|
-
let
|
|
88
|
-
|
|
90
|
+
let U = (e) => {
|
|
91
|
+
k.value === e.target && e.stopPropagation();
|
|
89
92
|
};
|
|
90
|
-
return (
|
|
91
|
-
appear:
|
|
93
|
+
return (e, l) => (f(), r(t, { to: "body" }, [s(n, {
|
|
94
|
+
appear: h(D),
|
|
92
95
|
name: "modal-transition",
|
|
93
96
|
duration: {
|
|
94
97
|
enter: 250,
|
|
95
98
|
leave: 250
|
|
96
99
|
},
|
|
97
|
-
onBeforeEnter:
|
|
98
|
-
onAfterEnter:
|
|
99
|
-
onLeave:
|
|
100
|
-
onAfterLeave:
|
|
100
|
+
onBeforeEnter: F,
|
|
101
|
+
onAfterEnter: I,
|
|
102
|
+
onLeave: L,
|
|
103
|
+
onAfterLeave: R
|
|
101
104
|
}, {
|
|
102
|
-
default:
|
|
105
|
+
default: y(() => [b(o("div", {
|
|
103
106
|
ref: "backdrop",
|
|
104
|
-
class:
|
|
105
|
-
|
|
106
|
-
{ "uikit-bg-w-secondary/70":
|
|
107
|
-
{ "uikit-bg-transparent": !
|
|
108
|
-
{ "sm:uikit-pt-[30px]": !
|
|
107
|
+
class: u(["bbt-backdrop uikit-fixed uikit-left-0 uikit-top-0 uikit-z-50 uikit-h-full uikit-w-full", [
|
|
108
|
+
c.customBackdropClasses,
|
|
109
|
+
{ "uikit-bg-w-secondary/70": E.value },
|
|
110
|
+
{ "uikit-bg-transparent": !E.value },
|
|
111
|
+
{ "sm:uikit-pt-[30px]": !c.centered }
|
|
109
112
|
]]),
|
|
110
|
-
onClick:
|
|
111
|
-
onMousedown:
|
|
112
|
-
onMouseup:
|
|
113
|
-
}, [
|
|
114
|
-
id:
|
|
113
|
+
onClick: H,
|
|
114
|
+
onMousedown: B,
|
|
115
|
+
onMouseup: V
|
|
116
|
+
}, [o("dialog", {
|
|
117
|
+
id: c.id,
|
|
115
118
|
ref: "modalDialog",
|
|
116
|
-
"data-cy":
|
|
117
|
-
class:
|
|
118
|
-
|
|
119
|
-
{ "centered sm:uikit-absolute sm:uikit-top-1/2 sm:-uikit-translate-y-1/2":
|
|
120
|
-
{ "uikit-static": !
|
|
121
|
-
`base-${
|
|
122
|
-
|
|
119
|
+
"data-cy": c.dataCy,
|
|
120
|
+
class: u(["uikit-modal-dialog uikit-mx-auto uikit-block uikit-w-full uikit-overflow-y-auto uikit-overflow-x-hidden uikit-rounded uikit-border-none uikit-bg-transparent uikit-bg-white uikit-p-0 uikit-shadow-lg uikit-no-scrollbar uikit-safe-bottom max-sm:uikit-fixed max-sm:uikit-bottom-0 max-sm:uikit-max-h-[95%] max-sm:uikit-rounded-bl-none max-sm:uikit-rounded-br-none sm:uikit-h-auto", [
|
|
121
|
+
c.customModalDialogClasses,
|
|
122
|
+
{ "centered sm:uikit-absolute sm:uikit-top-1/2 sm:-uikit-translate-y-1/2": c.centered },
|
|
123
|
+
{ "uikit-static": !c.centered },
|
|
124
|
+
`base-${c.size}`,
|
|
125
|
+
c.fullHeight ? "uikit-h-[95%]" : "uikit-h-auto"
|
|
123
126
|
]]),
|
|
124
127
|
tabindex: "-1",
|
|
125
|
-
"data-state":
|
|
126
|
-
onClick:
|
|
127
|
-
onFocusin:
|
|
128
|
+
"data-state": E.value ? "open" : "closed",
|
|
129
|
+
onClick: l[1] ||= (e) => T("dialogClick", e),
|
|
130
|
+
onFocusin: U
|
|
128
131
|
}, [
|
|
129
|
-
|
|
132
|
+
o("div", { class: u(["default-header uikit-sticky uikit-top-0 uikit-z-10 uikit-rounded-t uikit-border-0 uikit-bg-white uikit-px-4 uikit-pb-10px uikit-pt-20px sm:uikit-px-6", [c.customModalHeaderClasses]]) }, [c.withCloseIcon ? (f(), a("button", {
|
|
130
133
|
key: 0,
|
|
131
134
|
id: "close-icon-btn",
|
|
132
135
|
"data-cy": "bbt-default-close-icon-btn",
|
|
133
|
-
class:
|
|
136
|
+
class: u(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent uikit-p-5px", c.closeIconBtnClasses]),
|
|
134
137
|
type: "button",
|
|
135
138
|
"aria-label": "Close",
|
|
136
|
-
onClick:
|
|
137
|
-
}, [
|
|
138
|
-
class:
|
|
139
|
-
width:
|
|
140
|
-
height:
|
|
139
|
+
onClick: l[0] ||= x((e) => E.value = !1, ["prevent", "stop"])
|
|
140
|
+
}, [s(h(S), {
|
|
141
|
+
class: u(["bbt-close-icon uikit-box-border", c.closeIcon?.classes]),
|
|
142
|
+
width: c.closeIcon?.size || 20,
|
|
143
|
+
height: c.closeIcon?.size || 20
|
|
141
144
|
}, null, 8, [
|
|
142
145
|
"class",
|
|
143
146
|
"width",
|
|
144
147
|
"height"
|
|
145
|
-
])], 2)) :
|
|
146
|
-
class:
|
|
147
|
-
innerHTML:
|
|
148
|
-
}, null, 10,
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
])], 2)) : i("", !0), p(e.$slots, "header", { closeModal: z }, () => [o("span", {
|
|
149
|
+
class: u(["uikit-w-auto uikit-text-18 uikit-font-semibold sm:uikit-text-22", c.titleClasses]),
|
|
150
|
+
innerHTML: c.headerTitle
|
|
151
|
+
}, null, 10, w)])], 2),
|
|
152
|
+
o("div", { class: u(["uikit-bbt-body uikit-flex-auto uikit-overflow-y-auto uikit-overflow-x-hidden uikit-px-4 uikit-pb-0 uikit-no-scrollbar sm:uikit-px-6 sm:uikit-pb-25px", [c.customModalBodyClasses]]) }, [p(e.$slots, "body", { closeModal: z })], 2),
|
|
153
|
+
e.$slots.footer ? (f(), a("div", {
|
|
151
154
|
key: 0,
|
|
152
|
-
class:
|
|
153
|
-
}, [
|
|
154
|
-
|
|
155
|
-
], 42,
|
|
155
|
+
class: u(["uikit-bbt-footer uikit-sticky uikit-bottom-0 uikit-border-0 uikit-bg-white uikit-px-4 uikit-py-15px sm:uikit-px-6", c.customModalFooterClasses])
|
|
156
|
+
}, [p(e.$slots, "footer", { closeModal: z })], 2)) : i("", !0),
|
|
157
|
+
p(e.$slots, "fixed-bottom")
|
|
158
|
+
], 42, C)], 34), [[v, E.value]])]),
|
|
156
159
|
_: 3
|
|
157
160
|
}, 8, ["appear"])]));
|
|
158
161
|
}
|
|
159
162
|
});
|
|
160
163
|
//#endregion
|
|
161
|
-
export {
|
|
164
|
+
export { T as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a callback once the browser has painted the next frame:
|
|
3
|
+
* `requestAnimationFrame` fires *before* that paint, the nested task after it.
|
|
4
|
+
*
|
|
5
|
+
* Used for work an interaction triggers that the user cannot perceive in the
|
|
6
|
+
* paint they are waiting on. Two rules come with it:
|
|
7
|
+
*
|
|
8
|
+
* - It no-ops without `requestAnimationFrame`, and rAF does not fire in a hidden
|
|
9
|
+
* document at all - so nothing that must survive an unload belongs here.
|
|
10
|
+
* - It defers the *work*, not the reason for it: a caller whose state may have
|
|
11
|
+
* changed again by the time the frame arrives has to re-check it inside the
|
|
12
|
+
* callback.
|
|
13
|
+
*/
|
|
14
|
+
export declare const afterPaint: (cb: () => void) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/components",
|
|
3
|
-
"version": "2.9.0-alpha.
|
|
3
|
+
"version": "2.9.0-alpha.2",
|
|
4
4
|
"description": "Wikicasa frontend components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"vue": "^3.5.41",
|
|
84
84
|
"vue-router": "^5.1.0",
|
|
85
85
|
"vue-tsc": "^3.3.3",
|
|
86
|
-
"@wikicasa-dev/eslint-config": "0.0.0",
|
|
87
86
|
"@wikicasa-dev/tsconfig": "0.0.0",
|
|
87
|
+
"@wikicasa-dev/types": "2.8.0",
|
|
88
|
+
"@wikicasa-dev/eslint-config": "0.0.0",
|
|
89
|
+
"@wikicasa-dev/vue-composables": "0.2.0",
|
|
88
90
|
"@wikicasa-dev/svg-icons": "1.3.7",
|
|
89
91
|
"@wikicasa-dev/tailwind-plugins": "0.0.7",
|
|
90
|
-
"@wikicasa-dev/
|
|
91
|
-
"@wikicasa-dev/utilities": "1.2.11",
|
|
92
|
-
"@wikicasa-dev/vue-composables": "0.2.0"
|
|
92
|
+
"@wikicasa-dev/utilities": "1.2.11"
|
|
93
93
|
},
|
|
94
94
|
"readme": "ERROR: No README data found!",
|
|
95
95
|
"scripts": {
|