@schwarzdavid/ui-kit 0.0.1-alpha.2 → 0.0.1-alpha.20
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/LICENSE.md +201 -201
- package/README.md +165 -1
- package/dist/main.d.ts +365 -0
- package/dist/main.js +1394 -0
- package/dist/styles.d.ts +1 -0
- package/dist/ui-kit.css +2 -0
- package/dist/validators.d.ts +91 -0
- package/dist/validators.js +61 -0
- package/dist/vuetify/settings.scss +32 -0
- package/dist/vuetify.d.ts +31 -0
- package/dist/vuetify.js +288 -0
- package/package.json +120 -87
- package/dist/favicon.ico +0 -0
- package/dist/style.css +0 -1
- package/dist/ui-kit.d.ts +0 -150
- package/dist/ui-kit.js +0 -691
package/dist/main.js
ADDED
|
@@ -0,0 +1,1394 @@
|
|
|
1
|
+
import { Fragment as e, Teleport as t, TransitionGroup as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createVNode as l, defineComponent as u, hasInjectionContext as d, inject as f, isRef as p, markRaw as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onBeforeUpdate as x, onMounted as S, onScopeDispose as C, openBlock as w, provide as T, readonly as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, shallowReadonly as j, shallowRef as M, toDisplayString as N, toValue as ee, unref as P, useAttrs as te, useSlots as ne, useTemplateRef as F, vShow as re, watch as I, watchEffect as ie, withCtx as L, withDirectives as ae, withKeys as oe, withModifiers as se } from "vue";
|
|
2
|
+
import { useDisplay as R } from "vuetify";
|
|
3
|
+
import { useI18n as ce } from "vue-i18n";
|
|
4
|
+
import { VAlert as le, VBottomSheet as ue, VBtn as z, VCard as de, VDialog as B, VIcon as fe, VOverlay as pe, VProgressCircular as me } from "vuetify/components";
|
|
5
|
+
import { merge as V } from "lodash-es";
|
|
6
|
+
import he from "@vuelidate/core";
|
|
7
|
+
//#region lib/internal/createId.ts
|
|
8
|
+
function ge(e) {
|
|
9
|
+
let t = Array.from(e, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
10
|
+
return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
|
|
11
|
+
}
|
|
12
|
+
function H() {
|
|
13
|
+
let e = globalThis.crypto;
|
|
14
|
+
if (e.randomUUID) return e.randomUUID();
|
|
15
|
+
let t = globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
16
|
+
return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, ge(t);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region lib/plugin/constants/errors.ts
|
|
20
|
+
var U = {
|
|
21
|
+
NOT_INSTALLED: "@schwarzdavid/ui-kit is not available in this context. Install it with app.use(createUIKit()) and call its composables inside setup() or app.runWithContext().",
|
|
22
|
+
DIALOG_ENTRY_CONTEXT_MISSING: "useDialogEntry() must be called inside a dialog preset rendered by UiKitOutlet.",
|
|
23
|
+
DIALOG_FORM_CONTEXT_MISSING: "useDialogForm() must be called inside a component rendered by the form dialog preset.",
|
|
24
|
+
TOAST_ENTRY_CONTEXT_MISSING: "useToastEntry() must be called inside a toast component rendered by UiKitOutlet."
|
|
25
|
+
}, W = Symbol("@schwarzdavid/ui-kit");
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region lib/plugin/composables/usePluginContext.ts
|
|
28
|
+
function G() {
|
|
29
|
+
let e = d() ? f(W, null) : null;
|
|
30
|
+
if (!e) throw Error(U.NOT_INSTALLED);
|
|
31
|
+
return e;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region lib/composables/dialog/internal/useDialogQueue.ts
|
|
35
|
+
function K() {
|
|
36
|
+
let { dialogQueue: e } = G();
|
|
37
|
+
function t(t) {
|
|
38
|
+
let r = H(), i = (e) => {
|
|
39
|
+
n(r), t.resolve(e);
|
|
40
|
+
}, a = (e) => {
|
|
41
|
+
n(r), t.reject(e);
|
|
42
|
+
}, o = m({
|
|
43
|
+
...t,
|
|
44
|
+
id: r,
|
|
45
|
+
resolve: i,
|
|
46
|
+
reject: a
|
|
47
|
+
});
|
|
48
|
+
return e.value.push(o), o;
|
|
49
|
+
}
|
|
50
|
+
function n(t) {
|
|
51
|
+
let n = typeof t == "string" ? t : t.id, r = e.value.findIndex((e) => e.id === n);
|
|
52
|
+
r >= 0 && e.value.splice(r, 1);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
queue: j(e),
|
|
56
|
+
addToQueue: t,
|
|
57
|
+
removeFromQueue: n
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region lib/composables/dialog/constants/injectionKeys.ts
|
|
62
|
+
var q = Symbol("@schwarzdavid/ui-kit:dialog-entry"), _e = Symbol("@schwarzdavid/ui-kit:dialog-form"), J = /* @__PURE__ */ u({
|
|
63
|
+
__name: "DialogEntryProvider",
|
|
64
|
+
props: { entry: {} },
|
|
65
|
+
setup(e) {
|
|
66
|
+
let t = e;
|
|
67
|
+
return T(q, {
|
|
68
|
+
id: t.entry.id,
|
|
69
|
+
data: t.entry.data,
|
|
70
|
+
resolve: t.entry.resolve,
|
|
71
|
+
reject: t.entry.reject
|
|
72
|
+
}), (t, n) => (w(), i(A(e.entry.component)));
|
|
73
|
+
}
|
|
74
|
+
}), ve = /* @__PURE__ */ u({
|
|
75
|
+
__name: "DialogOutlet",
|
|
76
|
+
setup(t) {
|
|
77
|
+
let { queue: n } = K();
|
|
78
|
+
return (t, r) => (w(!0), o(e, null, O(P(n), (e) => (w(), i(J, {
|
|
79
|
+
key: e.id,
|
|
80
|
+
entry: e
|
|
81
|
+
}, null, 8, ["entry"]))), 128));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region lib/composables/internal/useMaybeTranslation.ts
|
|
86
|
+
function Y() {
|
|
87
|
+
let e = ce({ useScope: "global" }), t = (t) => e.availableLocales.some((n) => e.te(t, n));
|
|
88
|
+
return (n, r = !0) => r && t(n) ? e.t(n) : n;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region lib/components/internal/MaybeTranslation.vue
|
|
92
|
+
var X = /* @__PURE__ */ u({
|
|
93
|
+
__name: "MaybeTranslation",
|
|
94
|
+
props: {
|
|
95
|
+
content: {},
|
|
96
|
+
translate: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: !0
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
setup(e) {
|
|
102
|
+
let t = e, n = Y(), i = r(() => n(t.content, t.translate));
|
|
103
|
+
return (e, t) => N(i.value);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region lib/composables/toast/internal/useToastQueue.ts
|
|
108
|
+
function ye() {
|
|
109
|
+
let { toastQueue: e, toastTimers: t } = G();
|
|
110
|
+
function n(t) {
|
|
111
|
+
return e.value.find((e) => e.id === t);
|
|
112
|
+
}
|
|
113
|
+
function r(e, t) {
|
|
114
|
+
t.startedAt = Date.now(), t.handle = setTimeout(() => {
|
|
115
|
+
o(e);
|
|
116
|
+
}, t.remaining);
|
|
117
|
+
}
|
|
118
|
+
function i(e) {
|
|
119
|
+
let n = t.get(e);
|
|
120
|
+
n !== void 0 && (clearTimeout(n.handle), t.delete(e));
|
|
121
|
+
}
|
|
122
|
+
function a(t) {
|
|
123
|
+
let n = typeof t == "string" ? t : t.id;
|
|
124
|
+
i(n);
|
|
125
|
+
let r = e.value.findIndex((e) => e.id === n);
|
|
126
|
+
r >= 0 && e.value.splice(r, 1);
|
|
127
|
+
}
|
|
128
|
+
function o(e) {
|
|
129
|
+
let t = n(e);
|
|
130
|
+
t && (a(e), t.resolve(!1));
|
|
131
|
+
}
|
|
132
|
+
function s(e) {
|
|
133
|
+
let t = n(e);
|
|
134
|
+
t && (a(e), t.resolve(!0), t.action?.handler?.());
|
|
135
|
+
}
|
|
136
|
+
function c(e, n) {
|
|
137
|
+
let r = t.get(e);
|
|
138
|
+
r && (r.handle !== void 0 && (clearTimeout(r.handle), r.handle = void 0, r.remaining = Math.max(0, r.remaining - (Date.now() - r.startedAt))), r.holds.add(n));
|
|
139
|
+
}
|
|
140
|
+
function l(e, n) {
|
|
141
|
+
let i = t.get(e);
|
|
142
|
+
!i?.holds.delete(n) || i.holds.size > 0 || r(e, i);
|
|
143
|
+
}
|
|
144
|
+
function u(n) {
|
|
145
|
+
let i = H(), a = m({
|
|
146
|
+
...n,
|
|
147
|
+
id: i
|
|
148
|
+
});
|
|
149
|
+
if (e.value.push(a), typeof n.timeout == "number" && n.timeout > 0) {
|
|
150
|
+
let e = {
|
|
151
|
+
remaining: n.timeout,
|
|
152
|
+
startedAt: 0,
|
|
153
|
+
handle: void 0,
|
|
154
|
+
holds: /* @__PURE__ */ new Set()
|
|
155
|
+
};
|
|
156
|
+
t.set(i, e), r(i, e);
|
|
157
|
+
}
|
|
158
|
+
return a;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
queue: j(e),
|
|
162
|
+
addToQueue: u,
|
|
163
|
+
removeFromQueue: a,
|
|
164
|
+
close: o,
|
|
165
|
+
trigger: s,
|
|
166
|
+
pause: c,
|
|
167
|
+
resume: l
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region lib/composables/toast/constants/injectionKey.ts
|
|
172
|
+
var be = Symbol("@schwarzdavid/ui-kit:toast-entry"), xe = /* @__PURE__ */ u({
|
|
173
|
+
__name: "ToastEntryProvider",
|
|
174
|
+
props: { entry: {} },
|
|
175
|
+
setup(e) {
|
|
176
|
+
let t = e, { options: n } = G(), { close: a, trigger: o, pause: s, resume: c } = ye(), l = r(() => n.components.toast);
|
|
177
|
+
function u(e) {
|
|
178
|
+
let n = e.currentTarget;
|
|
179
|
+
n instanceof Node && e.relatedTarget instanceof Node && n.contains(e.relatedTarget) || c(t.entry.id, "focus");
|
|
180
|
+
}
|
|
181
|
+
return T(be, {
|
|
182
|
+
entry: t.entry,
|
|
183
|
+
close: () => {
|
|
184
|
+
a(t.entry.id);
|
|
185
|
+
},
|
|
186
|
+
trigger: () => {
|
|
187
|
+
o(t.entry.id);
|
|
188
|
+
}
|
|
189
|
+
}), (t, n) => (w(), i(A(l.value), {
|
|
190
|
+
onMouseenter: n[0] ||= (t) => P(s)(e.entry.id, "hover"),
|
|
191
|
+
onMouseleave: n[1] ||= (t) => P(c)(e.entry.id, "hover"),
|
|
192
|
+
onFocusin: n[2] ||= (t) => P(s)(e.entry.id, "focus"),
|
|
193
|
+
onFocusout: u
|
|
194
|
+
}, null, 32));
|
|
195
|
+
}
|
|
196
|
+
}), Z = /* @__PURE__ */ function(e) {
|
|
197
|
+
return e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e;
|
|
198
|
+
}({}), Se = {
|
|
199
|
+
class: "ui-toast-outlet__announcer",
|
|
200
|
+
"aria-live": "polite",
|
|
201
|
+
"aria-atomic": "true"
|
|
202
|
+
}, Ce = /* @__PURE__ */ u({
|
|
203
|
+
__name: "ToastOutlet",
|
|
204
|
+
setup(t) {
|
|
205
|
+
let { queue: r, pause: c, resume: u } = ye(), { xs: d } = R(), f = M(null), p = /* @__PURE__ */ new WeakSet();
|
|
206
|
+
I(() => r.value.at(-1), (e) => {
|
|
207
|
+
e && e.type !== Z.ERROR && !p.has(e) && (p.add(e), f.value = null, g(() => {
|
|
208
|
+
f.value = e;
|
|
209
|
+
}));
|
|
210
|
+
});
|
|
211
|
+
let m = M(!1);
|
|
212
|
+
function h() {
|
|
213
|
+
m.value = document.visibilityState === "hidden";
|
|
214
|
+
}
|
|
215
|
+
S(() => {
|
|
216
|
+
h(), document.addEventListener("visibilitychange", h);
|
|
217
|
+
}), b(() => {
|
|
218
|
+
document.removeEventListener("visibilitychange", h);
|
|
219
|
+
}), ie(() => {
|
|
220
|
+
for (let e of r.value) m.value ? c(e.id, "hidden") : u(e.id, "hidden");
|
|
221
|
+
});
|
|
222
|
+
function v(e) {
|
|
223
|
+
if (e instanceof HTMLElement) {
|
|
224
|
+
let { width: t } = e.getBoundingClientRect();
|
|
225
|
+
e.style.width = `${t.toFixed()}px`;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return (t, c) => (w(), o(e, null, [s("div", Se, [f.value ? (w(), i(X, {
|
|
229
|
+
key: 0,
|
|
230
|
+
content: f.value.message,
|
|
231
|
+
translate: f.value.translateMessage
|
|
232
|
+
}, null, 8, ["content", "translate"])) : a("", !0)]), l(n, {
|
|
233
|
+
name: "ui-toast",
|
|
234
|
+
tag: "div",
|
|
235
|
+
class: _(["ui-toast-outlet", { "ui-toast-outlet--mobile": P(d) }]),
|
|
236
|
+
onBeforeLeave: v
|
|
237
|
+
}, {
|
|
238
|
+
default: L(() => [(w(!0), o(e, null, O(P(r), (e) => (w(), i(xe, {
|
|
239
|
+
key: e.id,
|
|
240
|
+
entry: e
|
|
241
|
+
}, null, 8, ["entry"]))), 128))]),
|
|
242
|
+
_: 1
|
|
243
|
+
}, 8, ["class"])], 64));
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region lib/composables/loading-overlay/useLoadingOverlay.ts
|
|
248
|
+
function we() {
|
|
249
|
+
return G().loadingOverlay;
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region lib/composables/loading-overlay/components/LoadingOverlay.vue
|
|
253
|
+
var Te = /* @__PURE__ */ u({
|
|
254
|
+
__name: "LoadingOverlay",
|
|
255
|
+
setup(e) {
|
|
256
|
+
let t = we();
|
|
257
|
+
return (e, n) => (w(), i(P(pe), {
|
|
258
|
+
modelValue: P(t),
|
|
259
|
+
"onUpdate:modelValue": n[0] ||= (e) => p(t) ? t.value = e : null,
|
|
260
|
+
persistent: "",
|
|
261
|
+
class: "d-flex align-center justify-center"
|
|
262
|
+
}, {
|
|
263
|
+
default: L(() => [l(P(me), {
|
|
264
|
+
indeterminate: "",
|
|
265
|
+
color: "primary",
|
|
266
|
+
size: "100"
|
|
267
|
+
})]),
|
|
268
|
+
_: 1
|
|
269
|
+
}, 8, ["modelValue"]));
|
|
270
|
+
}
|
|
271
|
+
}), Ee = /* @__PURE__ */ u({
|
|
272
|
+
__name: "UiKitOutlet",
|
|
273
|
+
setup(t) {
|
|
274
|
+
return (t, n) => (w(), o(e, null, [
|
|
275
|
+
l(ve),
|
|
276
|
+
l(Ce),
|
|
277
|
+
l(Te)
|
|
278
|
+
], 64));
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region lib/components/sheet/internal/resolveSheetStages.ts
|
|
283
|
+
function De(e, t) {
|
|
284
|
+
return t ? [e ? "preview" : "content", "fullscreen"] : e ? ["preview", "content"] : ["content"];
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region lib/components/sheet/internal/resolveSheetRelease.ts
|
|
288
|
+
var Oe = .5, ke = 1.5, Ae = .6;
|
|
289
|
+
function je(e) {
|
|
290
|
+
let { heights: t, current: n, delta: r, velocity: i, dismissible: a } = e, o = t.length - 1, s = t[n] - r;
|
|
291
|
+
if (a && (i > ke || s < t[0] * Ae)) return { type: "dismiss" };
|
|
292
|
+
if (i > Oe) return n === 0 ? a ? { type: "dismiss" } : {
|
|
293
|
+
type: "stage",
|
|
294
|
+
index: 0
|
|
295
|
+
} : {
|
|
296
|
+
type: "stage",
|
|
297
|
+
index: n - 1
|
|
298
|
+
};
|
|
299
|
+
if (i < -.5) return {
|
|
300
|
+
type: "stage",
|
|
301
|
+
index: Math.min(n + 1, o)
|
|
302
|
+
};
|
|
303
|
+
let c = 0;
|
|
304
|
+
for (let e = 1; e <= o; e++) Math.abs(t[e] - s) < Math.abs(t[c] - s) && (c = e);
|
|
305
|
+
return {
|
|
306
|
+
type: "stage",
|
|
307
|
+
index: c
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region lib/components/sheet/internal/useSheetDrag.ts
|
|
312
|
+
var Me = 8, Ne = 100, Pe = "input, textarea, select, [contenteditable]";
|
|
313
|
+
function Fe(e) {
|
|
314
|
+
let t = D(!1), n = D(0), r = null, i = 0, a = 0, o = !1, s = [], c = null, l = !1;
|
|
315
|
+
function u(e) {
|
|
316
|
+
let t = performance.now();
|
|
317
|
+
s = s.filter((e) => t - e.time <= Ne), s.push({
|
|
318
|
+
y: e,
|
|
319
|
+
time: t
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function d() {
|
|
323
|
+
let e = s[0], t = s[s.length - 1];
|
|
324
|
+
return e === t || t.time === e.time ? 0 : (t.y - e.y) / (t.time - e.time);
|
|
325
|
+
}
|
|
326
|
+
function f(e, t) {
|
|
327
|
+
return Math.abs(e) > Math.abs(t);
|
|
328
|
+
}
|
|
329
|
+
function p(e, t) {
|
|
330
|
+
return Math.max(Math.abs(e), Math.abs(t)) >= Me;
|
|
331
|
+
}
|
|
332
|
+
function m() {
|
|
333
|
+
window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", b);
|
|
334
|
+
}
|
|
335
|
+
function h() {
|
|
336
|
+
r !== null && m(), r = null, s = [], c = null, t.value = !1, n.value = 0;
|
|
337
|
+
}
|
|
338
|
+
function g(t) {
|
|
339
|
+
if (r !== null || t.button > 0) return;
|
|
340
|
+
l = !1;
|
|
341
|
+
let n = t.target;
|
|
342
|
+
n instanceof Element && n.closest(Pe) || (o = n instanceof Node && !!e.body.value?.contains(n), !(o && t.pointerType !== "touch" && t.pointerType !== "pen") && (r = t.pointerId, i = t.clientX, a = t.clientY, s = [], u(t.clientY), window.addEventListener("pointermove", v), window.addEventListener("pointerup", y), window.addEventListener("pointercancel", b)));
|
|
343
|
+
}
|
|
344
|
+
function _(t) {
|
|
345
|
+
return o ? t > 0 ? (e.body.value?.scrollTop ?? 0) === 0 : e.current.value < e.heights().length - 1 : !0;
|
|
346
|
+
}
|
|
347
|
+
function v(o) {
|
|
348
|
+
if (o.pointerId !== r) return;
|
|
349
|
+
let s = o.clientY - a;
|
|
350
|
+
if (!t.value) {
|
|
351
|
+
let n = o.clientX - i;
|
|
352
|
+
if (!p(n, s)) return;
|
|
353
|
+
if (f(n, s) || !_(s)) {
|
|
354
|
+
h();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
t.value = !0;
|
|
358
|
+
let r = e.surface.value;
|
|
359
|
+
r && typeof r.setPointerCapture == "function" && r.setPointerCapture(o.pointerId);
|
|
360
|
+
}
|
|
361
|
+
n.value = s, u(o.clientY);
|
|
362
|
+
}
|
|
363
|
+
function y(n) {
|
|
364
|
+
if (n.pointerId !== r) return;
|
|
365
|
+
if (!t.value) {
|
|
366
|
+
h();
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
u(n.clientY);
|
|
370
|
+
let i = je({
|
|
371
|
+
heights: e.heights(),
|
|
372
|
+
current: e.current.value,
|
|
373
|
+
delta: n.clientY - a,
|
|
374
|
+
velocity: d(),
|
|
375
|
+
dismissible: e.dismissible.value
|
|
376
|
+
});
|
|
377
|
+
h(), l = !0, i.type === "dismiss" ? e.onDismiss() : e.current.value = i.index;
|
|
378
|
+
}
|
|
379
|
+
function b(e) {
|
|
380
|
+
e.pointerId === r && h();
|
|
381
|
+
}
|
|
382
|
+
function x(e) {
|
|
383
|
+
if (r !== null) {
|
|
384
|
+
if (!o) e.preventDefault();
|
|
385
|
+
else {
|
|
386
|
+
if (c === null) {
|
|
387
|
+
let t = e.touches[0], n = t.clientX - i, r = t.clientY - a;
|
|
388
|
+
if (!p(n, r)) return;
|
|
389
|
+
if (f(n, r)) {
|
|
390
|
+
h();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
c = _(r);
|
|
394
|
+
}
|
|
395
|
+
c && e.preventDefault();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function S() {
|
|
400
|
+
c = null;
|
|
401
|
+
}
|
|
402
|
+
function w(e) {
|
|
403
|
+
l && (l = !1, e.detail !== 0 && (e.preventDefault(), e.stopPropagation()));
|
|
404
|
+
}
|
|
405
|
+
return I(e.surface, (e, t, n) => {
|
|
406
|
+
e && (e.addEventListener("pointerdown", g), e.addEventListener("touchmove", x, { passive: !1 }), e.addEventListener("touchend", S), e.addEventListener("touchcancel", S), e.addEventListener("click", w, !0), n(() => {
|
|
407
|
+
e.removeEventListener("pointerdown", g), e.removeEventListener("touchmove", x), e.removeEventListener("touchend", S), e.removeEventListener("touchcancel", S), e.removeEventListener("click", w, !0), h();
|
|
408
|
+
}));
|
|
409
|
+
}, {
|
|
410
|
+
immediate: !0,
|
|
411
|
+
flush: "sync"
|
|
412
|
+
}), C(h), {
|
|
413
|
+
dragging: E(t),
|
|
414
|
+
offset: E(n)
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region node_modules/@mdi/js/mdi.js
|
|
419
|
+
var Ie = "M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z", Le = "M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16", Re = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z", ze = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", Be = "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z";
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region lib/internal/icons.ts
|
|
422
|
+
function Ve(e) {
|
|
423
|
+
return `svg:${e}`;
|
|
424
|
+
}
|
|
425
|
+
var Q = {
|
|
426
|
+
close: Ve(ze),
|
|
427
|
+
success: Ve(Re),
|
|
428
|
+
error: Ve(Ie),
|
|
429
|
+
warning: Ve(Le),
|
|
430
|
+
info: Ve(Be)
|
|
431
|
+
}, He = ["aria-label"], Ue = {
|
|
432
|
+
key: 1,
|
|
433
|
+
class: "ui-sheet__handle",
|
|
434
|
+
"aria-hidden": "true"
|
|
435
|
+
}, We = { class: "ui-sheet__header" }, Ge = {
|
|
436
|
+
key: 0,
|
|
437
|
+
class: "ui-sheet__title"
|
|
438
|
+
}, Ke = {
|
|
439
|
+
key: 0,
|
|
440
|
+
ref: "preview",
|
|
441
|
+
class: "ui-sheet__preview"
|
|
442
|
+
}, qe = {
|
|
443
|
+
ref: "content",
|
|
444
|
+
class: "ui-sheet__content"
|
|
445
|
+
}, Je = {
|
|
446
|
+
key: 2,
|
|
447
|
+
class: "ui-sheet__footer"
|
|
448
|
+
}, Ye = .9, Xe = .2, Ze = /* @__PURE__ */ u({
|
|
449
|
+
__name: "UiBottomSheet",
|
|
450
|
+
props: {
|
|
451
|
+
modelValue: { type: Boolean },
|
|
452
|
+
stage: { default: void 0 },
|
|
453
|
+
title: { default: void 0 },
|
|
454
|
+
translateTitle: {
|
|
455
|
+
type: Boolean,
|
|
456
|
+
default: !0
|
|
457
|
+
},
|
|
458
|
+
expandable: {
|
|
459
|
+
type: Boolean,
|
|
460
|
+
default: !0
|
|
461
|
+
},
|
|
462
|
+
closable: {
|
|
463
|
+
type: Boolean,
|
|
464
|
+
default: !0
|
|
465
|
+
},
|
|
466
|
+
persistent: {
|
|
467
|
+
type: Boolean,
|
|
468
|
+
default: !1
|
|
469
|
+
},
|
|
470
|
+
form: {
|
|
471
|
+
type: Boolean,
|
|
472
|
+
default: !1
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
emits: [
|
|
476
|
+
"update:modelValue",
|
|
477
|
+
"update:stage",
|
|
478
|
+
"close",
|
|
479
|
+
"submit",
|
|
480
|
+
"opened",
|
|
481
|
+
"closed"
|
|
482
|
+
],
|
|
483
|
+
setup(e, { emit: t }) {
|
|
484
|
+
let n = e, c = t, u = ne(), { options: d } = G(), f = Y(), p = F("surface"), m = F("body"), g = F("preview"), v = F("content"), C = D(!!u.preview);
|
|
485
|
+
x(() => {
|
|
486
|
+
C.value = !!u.preview;
|
|
487
|
+
});
|
|
488
|
+
let T = r(() => De(C.value, n.expandable)), E = D(N()), O = r(() => T.value.includes(E.value) ? E.value : T.value[0]), j = r({
|
|
489
|
+
get: () => T.value.indexOf(O.value),
|
|
490
|
+
set: (e) => {
|
|
491
|
+
E.value = T.value[e];
|
|
492
|
+
}
|
|
493
|
+
}), M = r(() => j.value >= T.value.length - 1);
|
|
494
|
+
function N() {
|
|
495
|
+
return n.stage && T.value.includes(n.stage) ? n.stage : T.value[0];
|
|
496
|
+
}
|
|
497
|
+
let ee = r(() => d.i18n.messages), te = r(() => f(M.value ? ee.value.collapse : ee.value.expand)), ie = r(() => f(ee.value.close)), R = D({
|
|
498
|
+
chrome: 0,
|
|
499
|
+
preview: 0,
|
|
500
|
+
content: 0
|
|
501
|
+
}), ce = D(0);
|
|
502
|
+
function le(e) {
|
|
503
|
+
let t = getComputedStyle(e);
|
|
504
|
+
return (parseFloat(t.paddingTop) || 0) + (parseFloat(t.paddingBottom) || 0);
|
|
505
|
+
}
|
|
506
|
+
function de(e) {
|
|
507
|
+
if (!e) return 0;
|
|
508
|
+
if (e.style.display !== "none") return e.offsetHeight;
|
|
509
|
+
e.style.display = "";
|
|
510
|
+
let t = e.offsetHeight;
|
|
511
|
+
return e.style.display = "none", t;
|
|
512
|
+
}
|
|
513
|
+
function B() {
|
|
514
|
+
let e = p.value, t = m.value;
|
|
515
|
+
ce.value = window.innerHeight, e && t && (R.value = {
|
|
516
|
+
chrome: e.offsetHeight - t.offsetHeight + le(t),
|
|
517
|
+
preview: de(g.value),
|
|
518
|
+
content: de(v.value)
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function fe(e) {
|
|
522
|
+
let { chrome: t, preview: n, content: r } = R.value;
|
|
523
|
+
return e === "fullscreen" ? ce.value : e === "preview" ? t + n : Math.min(t + r, Ye * ce.value);
|
|
524
|
+
}
|
|
525
|
+
function pe() {
|
|
526
|
+
return B(), T.value.map(fe);
|
|
527
|
+
}
|
|
528
|
+
let me = null, V = D(null), he = r(() => n.modelValue ? null : V.value);
|
|
529
|
+
function ge(e) {
|
|
530
|
+
V.value = e, c("update:modelValue", !1), c("close");
|
|
531
|
+
}
|
|
532
|
+
function H() {
|
|
533
|
+
ge(null);
|
|
534
|
+
}
|
|
535
|
+
function U() {
|
|
536
|
+
ge(me);
|
|
537
|
+
}
|
|
538
|
+
let { dragging: W, offset: K } = Fe({
|
|
539
|
+
surface: p,
|
|
540
|
+
body: m,
|
|
541
|
+
heights: pe,
|
|
542
|
+
current: j,
|
|
543
|
+
dismissible: r(() => !n.persistent),
|
|
544
|
+
onDismiss: U
|
|
545
|
+
}), q = D([]);
|
|
546
|
+
I(W, (e) => {
|
|
547
|
+
q.value = e ? pe() : [], e && (me = null, V.value = null);
|
|
548
|
+
}, { flush: "sync" }), I(K, (e) => {
|
|
549
|
+
W.value && q.value.length && (me = {
|
|
550
|
+
height: q.value[j.value],
|
|
551
|
+
offset: Math.max(e, 0)
|
|
552
|
+
});
|
|
553
|
+
}, { flush: "sync" });
|
|
554
|
+
let _e = r(() => {
|
|
555
|
+
if (he.value) {
|
|
556
|
+
let { height: e, offset: t } = he.value;
|
|
557
|
+
return {
|
|
558
|
+
height: `${String(e)}px`,
|
|
559
|
+
transform: `translateY(${String(t)}px)`
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
if (W.value && q.value.length) {
|
|
563
|
+
let e = q.value[j.value];
|
|
564
|
+
if (K.value >= 0) return {
|
|
565
|
+
height: `${String(e)}px`,
|
|
566
|
+
transform: `translateY(${String(K.value)}px)`
|
|
567
|
+
};
|
|
568
|
+
let t = q.value[q.value.length - 1], n = e - K.value, r = Math.min(n, t) + Math.max(n - t, 0) * Xe;
|
|
569
|
+
return { height: `${String(r)}px` };
|
|
570
|
+
}
|
|
571
|
+
let { chrome: e, preview: t, content: n } = R.value;
|
|
572
|
+
return O.value === "preview" && e + t > 0 ? { height: `${String(e + t)}px` } : O.value === "content" && e + n > 0 ? { height: `min(${String(e + n)}px, 90dvh)` } : {};
|
|
573
|
+
}), J = null;
|
|
574
|
+
function ve() {
|
|
575
|
+
J?.disconnect(), J = null;
|
|
576
|
+
let e = [g.value, v.value].filter((e) => !!e);
|
|
577
|
+
e.length && typeof ResizeObserver < "u" && (J = new ResizeObserver(() => {
|
|
578
|
+
W.value || B();
|
|
579
|
+
}), e.forEach((e) => {
|
|
580
|
+
J?.observe(e);
|
|
581
|
+
}));
|
|
582
|
+
}
|
|
583
|
+
I([g, v], ve, { flush: "post" }), S(() => {
|
|
584
|
+
ce.value = window.innerHeight, window.addEventListener("resize", B);
|
|
585
|
+
}), b(() => {
|
|
586
|
+
J?.disconnect(), window.removeEventListener("resize", B);
|
|
587
|
+
});
|
|
588
|
+
function ye() {
|
|
589
|
+
O.value !== n.stage && c("update:stage", O.value);
|
|
590
|
+
}
|
|
591
|
+
I(() => n.stage, (e) => {
|
|
592
|
+
e && T.value.includes(e) ? E.value = e : ye();
|
|
593
|
+
}), I(T, (e) => {
|
|
594
|
+
e.includes(E.value) || (E.value = e[0]);
|
|
595
|
+
}), I(() => n.modelValue, (e) => {
|
|
596
|
+
e && (V.value = null, E.value = N());
|
|
597
|
+
}), I(O, ye, { immediate: !0 }), I(O, B, { flush: "post" });
|
|
598
|
+
function be() {
|
|
599
|
+
j.value = M.value ? 0 : T.value.length - 1;
|
|
600
|
+
}
|
|
601
|
+
function xe() {
|
|
602
|
+
V.value = null, c("closed");
|
|
603
|
+
}
|
|
604
|
+
function Z() {
|
|
605
|
+
n.persistent || H();
|
|
606
|
+
}
|
|
607
|
+
function Se() {
|
|
608
|
+
d.dialog.closeOnOverlayClick && !n.persistent && H();
|
|
609
|
+
}
|
|
610
|
+
function Ce() {
|
|
611
|
+
n.form && c("submit");
|
|
612
|
+
}
|
|
613
|
+
return (t, n) => (w(), i(P(ue), {
|
|
614
|
+
"model-value": e.modelValue,
|
|
615
|
+
persistent: "",
|
|
616
|
+
"no-click-animation": "",
|
|
617
|
+
scrollable: !1,
|
|
618
|
+
"retain-focus": "",
|
|
619
|
+
"content-class": "ui-sheet-overlay",
|
|
620
|
+
"onClick:outside": Se,
|
|
621
|
+
onKeydown: oe(se(Z, ["stop", "prevent"]), ["esc"]),
|
|
622
|
+
onAfterEnter: n[0] ||= (e) => c("opened"),
|
|
623
|
+
onAfterLeave: xe
|
|
624
|
+
}, {
|
|
625
|
+
default: L(() => [s("div", {
|
|
626
|
+
ref_key: "surface",
|
|
627
|
+
ref: p,
|
|
628
|
+
class: _(["ui-sheet", [`ui-sheet--${O.value}`, {
|
|
629
|
+
"ui-sheet--dragging": P(W),
|
|
630
|
+
"ui-sheet--dismissing": !!he.value
|
|
631
|
+
}]]),
|
|
632
|
+
style: y(_e.value)
|
|
633
|
+
}, [(w(), i(A(e.form ? "form" : "div"), h({ class: "ui-sheet__layout" }, e.form ? { novalidate: !0 } : {}, { onSubmit: se(Ce, ["prevent"]) }), {
|
|
634
|
+
default: L(() => [
|
|
635
|
+
T.value.length > 1 ? (w(), o("button", {
|
|
636
|
+
key: 0,
|
|
637
|
+
type: "button",
|
|
638
|
+
class: "ui-sheet__handle",
|
|
639
|
+
"aria-label": te.value,
|
|
640
|
+
onClick: be
|
|
641
|
+
}, [...n[1] ||= [s("span", { class: "ui-sheet__grip" }, null, -1)]], 8, He)) : (w(), o("div", Ue, [...n[2] ||= [s("span", { class: "ui-sheet__grip" }, null, -1)]])),
|
|
642
|
+
s("header", We, [
|
|
643
|
+
e.title ? (w(), o("h2", Ge, [l(X, {
|
|
644
|
+
content: e.title,
|
|
645
|
+
translate: e.translateTitle
|
|
646
|
+
}, null, 8, ["content", "translate"])])) : a("", !0),
|
|
647
|
+
k(t.$slots, "header"),
|
|
648
|
+
e.closable && O.value !== "preview" ? (w(), i(P(z), {
|
|
649
|
+
key: 1,
|
|
650
|
+
variant: "text",
|
|
651
|
+
density: "comfortable",
|
|
652
|
+
icon: P(Q).close,
|
|
653
|
+
"aria-label": ie.value,
|
|
654
|
+
disabled: e.persistent,
|
|
655
|
+
class: "ui-sheet__close",
|
|
656
|
+
onClick: H
|
|
657
|
+
}, null, 8, [
|
|
658
|
+
"icon",
|
|
659
|
+
"aria-label",
|
|
660
|
+
"disabled"
|
|
661
|
+
])) : a("", !0)
|
|
662
|
+
]),
|
|
663
|
+
s("div", {
|
|
664
|
+
ref_key: "body",
|
|
665
|
+
ref: m,
|
|
666
|
+
class: "ui-sheet__body"
|
|
667
|
+
}, [C.value ? ae((w(), o("div", Ke, [k(t.$slots, "preview")], 512)), [[re, O.value === "preview"]]) : a("", !0), ae(s("div", qe, [k(t.$slots, "default")], 512), [[re, O.value !== "preview"]])], 512),
|
|
668
|
+
P(u).actions ? (w(), o("footer", Je, [k(t.$slots, "actions")])) : a("", !0)
|
|
669
|
+
]),
|
|
670
|
+
_: 3
|
|
671
|
+
}, 16))], 6)]),
|
|
672
|
+
_: 3
|
|
673
|
+
}, 8, ["model-value", "onKeydown"]));
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region lib/composables/dialog/internal/useDialogCta.ts
|
|
678
|
+
function $(e, t) {
|
|
679
|
+
let n = {
|
|
680
|
+
text: G().options.i18n.messages[t],
|
|
681
|
+
translateText: !0
|
|
682
|
+
};
|
|
683
|
+
return V(n, e);
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region lib/composables/dialog/internal/dialogWidths.ts
|
|
687
|
+
var Qe = {
|
|
688
|
+
sm: 440,
|
|
689
|
+
md: 560,
|
|
690
|
+
lg: 720
|
|
691
|
+
};
|
|
692
|
+
function $e(e) {
|
|
693
|
+
return typeof e == "number" ? e : Qe[e];
|
|
694
|
+
}
|
|
695
|
+
//#endregion
|
|
696
|
+
//#region lib/components/sheet/UiResponsiveDialog.vue?vue&type=script&setup=true&lang.ts
|
|
697
|
+
var et = { class: "ui-responsive-dialog__sheet-section" }, tt = { class: "ui-dialog__header" }, nt = { class: "ui-dialog__title" }, rt = { class: "ui-dialog__body" }, it = {
|
|
698
|
+
key: 0,
|
|
699
|
+
class: "ui-dialog__footer"
|
|
700
|
+
}, at = /* @__PURE__ */ u({
|
|
701
|
+
inheritAttrs: !1,
|
|
702
|
+
__name: "UiResponsiveDialog",
|
|
703
|
+
props: {
|
|
704
|
+
modelValue: { type: Boolean },
|
|
705
|
+
title: {},
|
|
706
|
+
translateTitle: {
|
|
707
|
+
type: Boolean,
|
|
708
|
+
default: !0
|
|
709
|
+
},
|
|
710
|
+
width: { default: "md" },
|
|
711
|
+
closable: {
|
|
712
|
+
type: Boolean,
|
|
713
|
+
default: !0
|
|
714
|
+
},
|
|
715
|
+
persistent: {
|
|
716
|
+
type: Boolean,
|
|
717
|
+
default: !1
|
|
718
|
+
},
|
|
719
|
+
form: {
|
|
720
|
+
type: Boolean,
|
|
721
|
+
default: !1
|
|
722
|
+
},
|
|
723
|
+
expandable: {
|
|
724
|
+
type: Boolean,
|
|
725
|
+
default: !0
|
|
726
|
+
},
|
|
727
|
+
stage: { default: void 0 }
|
|
728
|
+
},
|
|
729
|
+
emits: [
|
|
730
|
+
"update:modelValue",
|
|
731
|
+
"close",
|
|
732
|
+
"submit",
|
|
733
|
+
"opened",
|
|
734
|
+
"closed",
|
|
735
|
+
"update:stage"
|
|
736
|
+
],
|
|
737
|
+
setup(n, { emit: u }) {
|
|
738
|
+
let d = n, f = u, p = ne(), m = te(), { options: g } = G(), { mobile: _ } = R(), v = Y(), y = $(void 0, "close"), b = r(() => v(y.text, y.translateText)), x = r(() => $e(d.width)), S = M(null), C = !1;
|
|
739
|
+
function T(e) {
|
|
740
|
+
e instanceof HTMLElement && (S.value = e);
|
|
741
|
+
}
|
|
742
|
+
I(() => d.modelValue, (e, t) => {
|
|
743
|
+
C = !e && t;
|
|
744
|
+
}), I(_, () => {
|
|
745
|
+
C && !d.modelValue && E();
|
|
746
|
+
});
|
|
747
|
+
function E() {
|
|
748
|
+
C = !1, d.modelValue || (S.value = null), f("closed");
|
|
749
|
+
}
|
|
750
|
+
function D() {
|
|
751
|
+
f("update:modelValue", !1), f("close");
|
|
752
|
+
}
|
|
753
|
+
function O() {
|
|
754
|
+
d.persistent || D();
|
|
755
|
+
}
|
|
756
|
+
function j() {
|
|
757
|
+
g.dialog.closeOnOverlayClick && !d.persistent && D();
|
|
758
|
+
}
|
|
759
|
+
function N() {
|
|
760
|
+
d.form && f("submit");
|
|
761
|
+
}
|
|
762
|
+
return (r, u) => (w(), o(e, null, [P(_) ? (w(), i(Ze, h({ key: 0 }, P(m), {
|
|
763
|
+
"model-value": n.modelValue,
|
|
764
|
+
stage: n.stage,
|
|
765
|
+
title: n.title,
|
|
766
|
+
"translate-title": n.translateTitle,
|
|
767
|
+
expandable: n.expandable,
|
|
768
|
+
closable: n.closable,
|
|
769
|
+
persistent: n.persistent,
|
|
770
|
+
form: n.form,
|
|
771
|
+
"onUpdate:modelValue": u[0] ||= (e) => f("update:modelValue", e),
|
|
772
|
+
"onUpdate:stage": u[1] ||= (e) => f("update:stage", e),
|
|
773
|
+
onClose: u[2] ||= (e) => f("close"),
|
|
774
|
+
onSubmit: u[3] ||= (e) => f("submit"),
|
|
775
|
+
onOpened: u[4] ||= (e) => f("opened"),
|
|
776
|
+
onClosed: E
|
|
777
|
+
}), c({
|
|
778
|
+
default: L(() => [s("div", {
|
|
779
|
+
ref: T,
|
|
780
|
+
class: "ui-responsive-dialog__sheet-section"
|
|
781
|
+
}, null, 512)]),
|
|
782
|
+
_: 2
|
|
783
|
+
}, [
|
|
784
|
+
P(p).preview ? {
|
|
785
|
+
name: "preview",
|
|
786
|
+
fn: L(() => [s("div", et, [k(r.$slots, "preview")])]),
|
|
787
|
+
key: "0"
|
|
788
|
+
} : void 0,
|
|
789
|
+
P(p).header ? {
|
|
790
|
+
name: "header",
|
|
791
|
+
fn: L(() => [k(r.$slots, "header")]),
|
|
792
|
+
key: "1"
|
|
793
|
+
} : void 0,
|
|
794
|
+
P(p).actions ? {
|
|
795
|
+
name: "actions",
|
|
796
|
+
fn: L(() => [k(r.$slots, "actions")]),
|
|
797
|
+
key: "2"
|
|
798
|
+
} : void 0
|
|
799
|
+
]), 1040, [
|
|
800
|
+
"model-value",
|
|
801
|
+
"stage",
|
|
802
|
+
"title",
|
|
803
|
+
"translate-title",
|
|
804
|
+
"expandable",
|
|
805
|
+
"closable",
|
|
806
|
+
"persistent",
|
|
807
|
+
"form"
|
|
808
|
+
])) : (w(), i(P(B), h({ key: 1 }, P(m), {
|
|
809
|
+
"model-value": n.modelValue,
|
|
810
|
+
"max-width": x.value,
|
|
811
|
+
persistent: "",
|
|
812
|
+
"no-click-animation": "",
|
|
813
|
+
scrollable: !1,
|
|
814
|
+
"retain-focus": "",
|
|
815
|
+
"onClick:outside": j,
|
|
816
|
+
onKeydown: oe(se(O, ["stop", "prevent"]), ["esc"]),
|
|
817
|
+
onAfterEnter: u[5] ||= (e) => f("opened"),
|
|
818
|
+
onAfterLeave: E
|
|
819
|
+
}), {
|
|
820
|
+
default: L(() => [l(P(de), {
|
|
821
|
+
variant: "flat",
|
|
822
|
+
border: !1,
|
|
823
|
+
rounded: !1,
|
|
824
|
+
class: "ui-dialog"
|
|
825
|
+
}, {
|
|
826
|
+
default: L(() => [(w(), i(A(n.form ? "form" : "div"), h({ class: "ui-dialog__layout" }, n.form ? { novalidate: !0 } : {}, { onSubmit: se(N, ["prevent"]) }), {
|
|
827
|
+
default: L(() => [
|
|
828
|
+
s("header", tt, [
|
|
829
|
+
s("h2", nt, [l(X, {
|
|
830
|
+
content: n.title,
|
|
831
|
+
translate: n.translateTitle
|
|
832
|
+
}, null, 8, ["content", "translate"])]),
|
|
833
|
+
k(r.$slots, "header"),
|
|
834
|
+
n.closable ? (w(), i(P(z), {
|
|
835
|
+
key: 0,
|
|
836
|
+
variant: "text",
|
|
837
|
+
density: "comfortable",
|
|
838
|
+
icon: P(Q).close,
|
|
839
|
+
"aria-label": b.value,
|
|
840
|
+
disabled: n.persistent,
|
|
841
|
+
class: "ui-dialog__close",
|
|
842
|
+
onClick: D
|
|
843
|
+
}, null, 8, [
|
|
844
|
+
"icon",
|
|
845
|
+
"aria-label",
|
|
846
|
+
"disabled"
|
|
847
|
+
])) : a("", !0)
|
|
848
|
+
]),
|
|
849
|
+
s("div", rt, [s("div", {
|
|
850
|
+
ref: T,
|
|
851
|
+
class: "ui-responsive-dialog__slot"
|
|
852
|
+
}, null, 512)]),
|
|
853
|
+
P(p).actions ? (w(), o("footer", it, [k(r.$slots, "actions")])) : a("", !0)
|
|
854
|
+
]),
|
|
855
|
+
_: 3
|
|
856
|
+
}, 16))]),
|
|
857
|
+
_: 3
|
|
858
|
+
})]),
|
|
859
|
+
_: 3
|
|
860
|
+
}, 16, [
|
|
861
|
+
"model-value",
|
|
862
|
+
"max-width",
|
|
863
|
+
"onKeydown"
|
|
864
|
+
])), S.value ? (w(), i(t, {
|
|
865
|
+
key: 2,
|
|
866
|
+
to: S.value
|
|
867
|
+
}, [k(r.$slots, "default")], 8, ["to"])) : a("", !0)], 64));
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
//#endregion
|
|
871
|
+
//#region lib/composables/dialog/useDialog.ts
|
|
872
|
+
function ot() {
|
|
873
|
+
let e = K(), { options: { components: { dialog: t } } } = G();
|
|
874
|
+
function n(n, r) {
|
|
875
|
+
let i = typeof n == "string" ? {
|
|
876
|
+
title: n,
|
|
877
|
+
content: r ?? ""
|
|
878
|
+
} : n;
|
|
879
|
+
return new Promise((n) => {
|
|
880
|
+
let r = {
|
|
881
|
+
component: t.info,
|
|
882
|
+
data: i,
|
|
883
|
+
resolve: n,
|
|
884
|
+
reject: () => {
|
|
885
|
+
n(null);
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
e.addToQueue(r);
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
function r(n, r, i) {
|
|
892
|
+
let a = typeof n == "string" ? {
|
|
893
|
+
title: n,
|
|
894
|
+
content: r ?? "",
|
|
895
|
+
level: i
|
|
896
|
+
} : n;
|
|
897
|
+
return new Promise((n, r) => {
|
|
898
|
+
let i = {
|
|
899
|
+
component: t.confirm,
|
|
900
|
+
data: a,
|
|
901
|
+
resolve: n,
|
|
902
|
+
reject: r
|
|
903
|
+
};
|
|
904
|
+
e.addToQueue(i);
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
function i(n) {
|
|
908
|
+
return new Promise((r, i) => {
|
|
909
|
+
let a = {
|
|
910
|
+
component: t.form,
|
|
911
|
+
data: n,
|
|
912
|
+
resolve: r,
|
|
913
|
+
reject: i
|
|
914
|
+
};
|
|
915
|
+
e.addToQueue(a);
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
return {
|
|
919
|
+
info: n,
|
|
920
|
+
confirm: r,
|
|
921
|
+
form: i
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
//#endregion
|
|
925
|
+
//#region lib/composables/dialog/useDialogEntry.ts
|
|
926
|
+
function st() {
|
|
927
|
+
let e = d() ? f(q, null) : null;
|
|
928
|
+
if (!e) throw Error(U.DIALOG_ENTRY_CONTEXT_MISSING);
|
|
929
|
+
return e;
|
|
930
|
+
}
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region lib/composables/dialog/useDialogForm.ts
|
|
933
|
+
function ct(e) {
|
|
934
|
+
let t = d() ? f(_e, null) : null;
|
|
935
|
+
if (!t) throw Error(U.DIALOG_FORM_CONTEXT_MISSING);
|
|
936
|
+
return t.register(e), {
|
|
937
|
+
submit: t.submit,
|
|
938
|
+
loading: t.loading
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
//#endregion
|
|
942
|
+
//#region lib/composables/dialog/presets/ConfirmDialogProps.ts
|
|
943
|
+
var lt = /* @__PURE__ */ function(e) {
|
|
944
|
+
return e.DEFAULT = "primary", e.WARNING = "warning", e.DANGER = "error", e;
|
|
945
|
+
}({});
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region lib/composables/toast/useToast.ts
|
|
948
|
+
function ut() {
|
|
949
|
+
let e = ye(), { options: { toast: t } } = G();
|
|
950
|
+
function n(e) {
|
|
951
|
+
return e === Z.ERROR ? t.errorTimeout : t.timeout;
|
|
952
|
+
}
|
|
953
|
+
function r(t) {
|
|
954
|
+
return (r, i) => new Promise((a) => {
|
|
955
|
+
e.addToQueue({
|
|
956
|
+
message: r,
|
|
957
|
+
resolve: a,
|
|
958
|
+
timeout: i?.timeout ?? n(t),
|
|
959
|
+
translateMessage: i?.translateMessage ?? !0,
|
|
960
|
+
action: i?.action,
|
|
961
|
+
type: t
|
|
962
|
+
});
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
return {
|
|
966
|
+
info: r(Z.INFO),
|
|
967
|
+
warn: r(Z.WARNING),
|
|
968
|
+
error: r(Z.ERROR),
|
|
969
|
+
success: r(Z.SUCCESS)
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
//#endregion
|
|
973
|
+
//#region lib/composables/toast/useToastEntry.ts
|
|
974
|
+
function dt() {
|
|
975
|
+
let e = d() ? f(be, null) : null;
|
|
976
|
+
if (!e) throw Error(U.TOAST_ENTRY_CONTEXT_MISSING);
|
|
977
|
+
return e;
|
|
978
|
+
}
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region lib/composables/loading/useLoading.ts
|
|
981
|
+
function ft(e) {
|
|
982
|
+
return e ? new Promise((t) => {
|
|
983
|
+
setTimeout(t, e);
|
|
984
|
+
}) : Promise.resolve();
|
|
985
|
+
}
|
|
986
|
+
function pt(e, t = {}) {
|
|
987
|
+
let { options: { loading: n } } = G(), r = t.delay ?? n.delay, i = t.overlay ?? n.overlay, a = D(!1), o = we(), s = e;
|
|
988
|
+
async function c(...e) {
|
|
989
|
+
a.value = !0, i && (o.value = !0);
|
|
990
|
+
try {
|
|
991
|
+
let [t] = await Promise.all([s(...e), ft(r)]);
|
|
992
|
+
return t;
|
|
993
|
+
} finally {
|
|
994
|
+
a.value = !1, i && (o.value = !1);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return {
|
|
998
|
+
loading: E(a),
|
|
999
|
+
action: c
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
//#endregion
|
|
1003
|
+
//#region lib/composables/dialog/components/dialog/presets/InfoDialog.vue?vue&type=script&setup=true&lang.ts
|
|
1004
|
+
var mt = {
|
|
1005
|
+
key: 0,
|
|
1006
|
+
class: "ui-dialog__text"
|
|
1007
|
+
}, ht = /* @__PURE__ */ u({
|
|
1008
|
+
__name: "InfoDialog",
|
|
1009
|
+
setup(t) {
|
|
1010
|
+
let { data: n, resolve: s } = st(), u = n.defaultCta === !1 ? null : $(n.defaultCta, "close"), d = r(() => n.additionalCta ?? []), { mobile: f } = R(), p = r(() => u !== null && !f.value), m = r(() => p.value || d.value.length > 0), g = D(!0), _ = r(() => "props" in n ? n.props : {}), y = null;
|
|
1011
|
+
function b(e) {
|
|
1012
|
+
"action" in e ? e.action() : x(e.value);
|
|
1013
|
+
}
|
|
1014
|
+
function x(e) {
|
|
1015
|
+
g.value &&= (y = e, !1);
|
|
1016
|
+
}
|
|
1017
|
+
function S() {
|
|
1018
|
+
x(null);
|
|
1019
|
+
}
|
|
1020
|
+
function C() {
|
|
1021
|
+
s(y);
|
|
1022
|
+
}
|
|
1023
|
+
return (t, r) => (w(), i(at, {
|
|
1024
|
+
"model-value": g.value,
|
|
1025
|
+
title: P(n).title,
|
|
1026
|
+
"translate-title": P(n).translateTitle,
|
|
1027
|
+
width: P(n).width ?? "sm",
|
|
1028
|
+
onClose: S,
|
|
1029
|
+
onClosed: C
|
|
1030
|
+
}, c({
|
|
1031
|
+
default: L(() => ["content" in P(n) ? (w(), o("p", mt, [l(X, {
|
|
1032
|
+
content: P(n).content,
|
|
1033
|
+
translate: P(n).translateContent
|
|
1034
|
+
}, null, 8, ["content", "translate"])])) : (w(), i(A(P(n).component), v(h({ key: 1 }, _.value)), null, 16))]),
|
|
1035
|
+
_: 2
|
|
1036
|
+
}, [m.value ? {
|
|
1037
|
+
name: "actions",
|
|
1038
|
+
fn: L(() => [(w(!0), o(e, null, O(d.value, (e, t) => (w(), i(P(z), {
|
|
1039
|
+
key: t,
|
|
1040
|
+
variant: "text",
|
|
1041
|
+
onClick: () => b(e)
|
|
1042
|
+
}, {
|
|
1043
|
+
default: L(() => [l(X, {
|
|
1044
|
+
content: e.text,
|
|
1045
|
+
translate: e.translateText
|
|
1046
|
+
}, null, 8, ["content", "translate"])]),
|
|
1047
|
+
_: 2
|
|
1048
|
+
}, 1032, ["onClick"]))), 128)), p.value && P(u) ? (w(), i(P(z), {
|
|
1049
|
+
key: 0,
|
|
1050
|
+
variant: "flat",
|
|
1051
|
+
color: "primary",
|
|
1052
|
+
onClick: S
|
|
1053
|
+
}, {
|
|
1054
|
+
default: L(() => [l(X, {
|
|
1055
|
+
content: P(u).text,
|
|
1056
|
+
translate: P(u).translateText
|
|
1057
|
+
}, null, 8, ["content", "translate"])]),
|
|
1058
|
+
_: 1
|
|
1059
|
+
})) : a("", !0)]),
|
|
1060
|
+
key: "0"
|
|
1061
|
+
} : void 0]), 1032, [
|
|
1062
|
+
"model-value",
|
|
1063
|
+
"title",
|
|
1064
|
+
"translate-title",
|
|
1065
|
+
"width"
|
|
1066
|
+
]));
|
|
1067
|
+
}
|
|
1068
|
+
}), gt = {
|
|
1069
|
+
key: 0,
|
|
1070
|
+
class: "ui-dialog__text"
|
|
1071
|
+
}, _t = /* @__PURE__ */ u({
|
|
1072
|
+
__name: "ConfirmDialog",
|
|
1073
|
+
setup(t) {
|
|
1074
|
+
let { data: n, resolve: a, reject: s } = st(), c = $(n.confirmCta, "yes"), u = $(n.rejectCta, "no"), d = D(!0), f = {
|
|
1075
|
+
reject: null,
|
|
1076
|
+
confirm: null
|
|
1077
|
+
}, p = r(() => n.highlightCta ?? "confirm"), m = r(() => n.level ?? "primary"), g = r(() => "props" in n ? n.props : {}), _ = r(() => {
|
|
1078
|
+
let e = p.value, t = [{
|
|
1079
|
+
key: "reject",
|
|
1080
|
+
cta: u,
|
|
1081
|
+
variant: e === "reject" ? "flat" : "text",
|
|
1082
|
+
color: e === "reject" ? m.value : void 0,
|
|
1083
|
+
onClick: x
|
|
1084
|
+
}, {
|
|
1085
|
+
key: "confirm",
|
|
1086
|
+
cta: c,
|
|
1087
|
+
variant: e === "confirm" ? "flat" : "text",
|
|
1088
|
+
color: e === "confirm" ? m.value : void 0,
|
|
1089
|
+
onClick: S
|
|
1090
|
+
}];
|
|
1091
|
+
return e === "reject" ? t.reverse() : t;
|
|
1092
|
+
}), y = !1;
|
|
1093
|
+
function b(e, t) {
|
|
1094
|
+
t && "$el" in t ? f[e] = t.$el : f[e] = null;
|
|
1095
|
+
}
|
|
1096
|
+
function x() {
|
|
1097
|
+
d.value &&= (y = !1, !1);
|
|
1098
|
+
}
|
|
1099
|
+
function S() {
|
|
1100
|
+
d.value &&= (y = !0, !1);
|
|
1101
|
+
}
|
|
1102
|
+
function C() {
|
|
1103
|
+
f[n.level === lt.DANGER ? "reject" : "confirm"]?.focus();
|
|
1104
|
+
}
|
|
1105
|
+
function T() {
|
|
1106
|
+
!y && n.throwOnReject ? s() : a(y);
|
|
1107
|
+
}
|
|
1108
|
+
return (t, r) => (w(), i(at, {
|
|
1109
|
+
"model-value": d.value,
|
|
1110
|
+
title: P(n).title,
|
|
1111
|
+
"translate-title": P(n).translateTitle,
|
|
1112
|
+
width: P(n).width ?? "sm",
|
|
1113
|
+
closable: !1,
|
|
1114
|
+
persistent: !!P(n).permanent,
|
|
1115
|
+
onClose: x,
|
|
1116
|
+
onOpened: C,
|
|
1117
|
+
onClosed: T
|
|
1118
|
+
}, {
|
|
1119
|
+
actions: L(() => [(w(!0), o(e, null, O(_.value, (e) => (w(), i(P(z), {
|
|
1120
|
+
key: e.key,
|
|
1121
|
+
ref_for: !0,
|
|
1122
|
+
ref: (t) => b(e.key, t),
|
|
1123
|
+
variant: e.variant,
|
|
1124
|
+
color: e.color,
|
|
1125
|
+
onClick: e.onClick
|
|
1126
|
+
}, {
|
|
1127
|
+
default: L(() => [l(X, {
|
|
1128
|
+
content: e.cta.text,
|
|
1129
|
+
translate: e.cta.translateText
|
|
1130
|
+
}, null, 8, ["content", "translate"])]),
|
|
1131
|
+
_: 2
|
|
1132
|
+
}, 1032, [
|
|
1133
|
+
"variant",
|
|
1134
|
+
"color",
|
|
1135
|
+
"onClick"
|
|
1136
|
+
]))), 128))]),
|
|
1137
|
+
default: L(() => ["content" in P(n) ? (w(), o("p", gt, [l(X, {
|
|
1138
|
+
content: P(n).content,
|
|
1139
|
+
translate: P(n).translateContent
|
|
1140
|
+
}, null, 8, ["content", "translate"])])) : (w(), i(A(P(n).component), v(h({ key: 1 }, g.value)), null, 16))]),
|
|
1141
|
+
_: 1
|
|
1142
|
+
}, 8, [
|
|
1143
|
+
"model-value",
|
|
1144
|
+
"title",
|
|
1145
|
+
"translate-title",
|
|
1146
|
+
"width",
|
|
1147
|
+
"persistent"
|
|
1148
|
+
]));
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region lib/composables/dialog/internal/declaresProp.ts
|
|
1153
|
+
function vt(e, t) {
|
|
1154
|
+
let n = e.props;
|
|
1155
|
+
return Array.isArray(n) ? n.includes(t) : typeof n == "object" && !!n && t in n;
|
|
1156
|
+
}
|
|
1157
|
+
//#endregion
|
|
1158
|
+
//#region lib/composables/dialog/internal/isEmptyValue.ts
|
|
1159
|
+
function yt(e) {
|
|
1160
|
+
let t = Object.getPrototypeOf(e);
|
|
1161
|
+
return t === Object.prototype || t === null;
|
|
1162
|
+
}
|
|
1163
|
+
function bt(e) {
|
|
1164
|
+
return e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : e instanceof Date ? Number.isNaN(e.getTime()) : e instanceof Map || e instanceof Set ? e.size === 0 : typeof e == "object" && yt(e) && Object.keys(e).length === 0;
|
|
1165
|
+
}
|
|
1166
|
+
//#endregion
|
|
1167
|
+
//#region lib/internal/toErrorMessage.ts
|
|
1168
|
+
function xt(e, t) {
|
|
1169
|
+
return e instanceof Error ? e.message : typeof e == "string" ? e : typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : t;
|
|
1170
|
+
}
|
|
1171
|
+
//#endregion
|
|
1172
|
+
//#region lib/composables/dialog/components/dialog/presets/FormDialog.vue
|
|
1173
|
+
var St = /* @__PURE__ */ u({
|
|
1174
|
+
__name: "FormDialog",
|
|
1175
|
+
setup(e) {
|
|
1176
|
+
let { data: t, resolve: n, reject: o } = st(), { options: c } = G(), u = Y(), d = $(t.saveCta, "save"), f = $(t.abortCta, "cancel"), p = r(() => u(c.i18n.messages.saveFailed, !0)), m = r(() => u(c.i18n.messages.unknownError, !0)), g = D(!0), _ = D(null), y = D(ee(t.initialValue) ?? null), b = M(null), x = M(null), S = F("content"), C = he(), { loading: E, action: O } = pt(I), k = D(!1), j = r(() => !!t.required && b.value === null && bt(y.value)), N = r(() => {
|
|
1177
|
+
let e = { ...t.props };
|
|
1178
|
+
return vt(t.component, "modelValue") && (e.modelValue = y.value, e["onUpdate:modelValue"] = (e) => {
|
|
1179
|
+
y.value = e;
|
|
1180
|
+
}), vt(t.component, "toolbar") && (e.toolbar = x.value), e;
|
|
1181
|
+
}), te = null;
|
|
1182
|
+
function ne(e) {
|
|
1183
|
+
e instanceof HTMLDivElement && (x.value = e);
|
|
1184
|
+
}
|
|
1185
|
+
T(_e, {
|
|
1186
|
+
register(e) {
|
|
1187
|
+
b.value = e;
|
|
1188
|
+
},
|
|
1189
|
+
submit: re,
|
|
1190
|
+
loading: E
|
|
1191
|
+
});
|
|
1192
|
+
async function re() {
|
|
1193
|
+
if (!(E.value || k.value || j.value)) {
|
|
1194
|
+
k.value = !0;
|
|
1195
|
+
try {
|
|
1196
|
+
if (!await C.value.$validate() || !g.value) return;
|
|
1197
|
+
_.value = null, await O();
|
|
1198
|
+
} catch (e) {
|
|
1199
|
+
_.value = xt(e, m.value);
|
|
1200
|
+
} finally {
|
|
1201
|
+
k.value = !1;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
async function I() {
|
|
1206
|
+
let e = b.value ? await b.value() : y.value;
|
|
1207
|
+
te = t.action ? await t.action(e) : e, g.value = !1;
|
|
1208
|
+
}
|
|
1209
|
+
function ie() {
|
|
1210
|
+
E.value || k.value || (g.value = !1);
|
|
1211
|
+
}
|
|
1212
|
+
function ae() {
|
|
1213
|
+
S.value?.querySelector("input:not([type=hidden]), textarea, select")?.focus();
|
|
1214
|
+
}
|
|
1215
|
+
function oe() {
|
|
1216
|
+
t.required && te === null ? o() : n(te);
|
|
1217
|
+
}
|
|
1218
|
+
return (e, n) => (w(), i(at, {
|
|
1219
|
+
"model-value": g.value,
|
|
1220
|
+
title: P(t).title,
|
|
1221
|
+
"translate-title": P(t).translateTitle,
|
|
1222
|
+
width: P(t).width ?? "md",
|
|
1223
|
+
persistent: P(E) || k.value,
|
|
1224
|
+
form: "",
|
|
1225
|
+
onClose: ie,
|
|
1226
|
+
onSubmit: re,
|
|
1227
|
+
onOpened: ae,
|
|
1228
|
+
onClosed: oe
|
|
1229
|
+
}, {
|
|
1230
|
+
header: L(() => [s("div", {
|
|
1231
|
+
ref: ne,
|
|
1232
|
+
class: "ui-dialog__toolbar"
|
|
1233
|
+
}, null, 512)]),
|
|
1234
|
+
actions: L(() => [l(P(z), {
|
|
1235
|
+
variant: "text",
|
|
1236
|
+
disabled: P(E),
|
|
1237
|
+
onClick: ie
|
|
1238
|
+
}, {
|
|
1239
|
+
default: L(() => [l(X, {
|
|
1240
|
+
content: P(f).text,
|
|
1241
|
+
translate: P(f).translateText
|
|
1242
|
+
}, null, 8, ["content", "translate"])]),
|
|
1243
|
+
_: 1
|
|
1244
|
+
}, 8, ["disabled"]), l(P(z), {
|
|
1245
|
+
variant: "flat",
|
|
1246
|
+
color: "primary",
|
|
1247
|
+
type: "submit",
|
|
1248
|
+
disabled: j.value,
|
|
1249
|
+
loading: P(E)
|
|
1250
|
+
}, {
|
|
1251
|
+
default: L(() => [l(X, {
|
|
1252
|
+
content: P(d).text,
|
|
1253
|
+
translate: P(d).translateText
|
|
1254
|
+
}, null, 8, ["content", "translate"])]),
|
|
1255
|
+
_: 1
|
|
1256
|
+
}, 8, ["disabled", "loading"])]),
|
|
1257
|
+
default: L(() => [_.value === null ? a("", !0) : (w(), i(P(le), {
|
|
1258
|
+
key: 0,
|
|
1259
|
+
type: "error",
|
|
1260
|
+
variant: "tonal",
|
|
1261
|
+
density: "compact",
|
|
1262
|
+
icon: P(Q).error,
|
|
1263
|
+
title: p.value,
|
|
1264
|
+
text: _.value
|
|
1265
|
+
}, null, 8, [
|
|
1266
|
+
"icon",
|
|
1267
|
+
"title",
|
|
1268
|
+
"text"
|
|
1269
|
+
])), s("div", {
|
|
1270
|
+
ref_key: "content",
|
|
1271
|
+
ref: S,
|
|
1272
|
+
class: "ui-dialog__content"
|
|
1273
|
+
}, [x.value ? (w(), i(A(P(t).component), v(h({ key: 0 }, N.value)), null, 16)) : a("", !0)], 512)]),
|
|
1274
|
+
_: 1
|
|
1275
|
+
}, 8, [
|
|
1276
|
+
"model-value",
|
|
1277
|
+
"title",
|
|
1278
|
+
"translate-title",
|
|
1279
|
+
"width",
|
|
1280
|
+
"persistent"
|
|
1281
|
+
]));
|
|
1282
|
+
}
|
|
1283
|
+
}), Ct = ["role"], wt = { class: "ui-toast__message" }, Tt = /* @__PURE__ */ u({
|
|
1284
|
+
__name: "ToastEntry",
|
|
1285
|
+
setup(e) {
|
|
1286
|
+
let t = {
|
|
1287
|
+
[Z.ERROR]: Q.error,
|
|
1288
|
+
[Z.SUCCESS]: Q.success,
|
|
1289
|
+
[Z.INFO]: Q.info,
|
|
1290
|
+
[Z.WARNING]: Q.warning
|
|
1291
|
+
}, { entry: n, close: c, trigger: u } = dt(), { options: d } = G(), f = Y(), p = r(() => f(d.i18n.messages.close, !0)), m = r(() => t[n.type]), h = r(() => n.type === Z.ERROR ? "alert" : void 0);
|
|
1292
|
+
return (e, t) => (w(), o("div", {
|
|
1293
|
+
class: "ui-toast",
|
|
1294
|
+
role: h.value
|
|
1295
|
+
}, [
|
|
1296
|
+
l(P(fe), {
|
|
1297
|
+
icon: m.value,
|
|
1298
|
+
size: "20",
|
|
1299
|
+
class: "ui-toast__icon"
|
|
1300
|
+
}, null, 8, ["icon"]),
|
|
1301
|
+
s("span", wt, [l(X, {
|
|
1302
|
+
content: P(n).message,
|
|
1303
|
+
translate: P(n).translateMessage
|
|
1304
|
+
}, null, 8, ["content", "translate"])]),
|
|
1305
|
+
P(n).action ? (w(), i(P(z), {
|
|
1306
|
+
key: 0,
|
|
1307
|
+
variant: "text",
|
|
1308
|
+
size: "small",
|
|
1309
|
+
class: "ui-toast__action",
|
|
1310
|
+
onClick: P(u)
|
|
1311
|
+
}, {
|
|
1312
|
+
default: L(() => [l(X, {
|
|
1313
|
+
content: P(n).action.text,
|
|
1314
|
+
translate: P(n).action.translateText ?? !0
|
|
1315
|
+
}, null, 8, ["content", "translate"])]),
|
|
1316
|
+
_: 1
|
|
1317
|
+
}, 8, ["onClick"])) : a("", !0),
|
|
1318
|
+
l(P(z), {
|
|
1319
|
+
variant: "text",
|
|
1320
|
+
size: "small",
|
|
1321
|
+
icon: P(Q).close,
|
|
1322
|
+
"aria-label": p.value,
|
|
1323
|
+
class: "ui-toast__close",
|
|
1324
|
+
onClick: P(c)
|
|
1325
|
+
}, null, 8, [
|
|
1326
|
+
"icon",
|
|
1327
|
+
"aria-label",
|
|
1328
|
+
"onClick"
|
|
1329
|
+
])
|
|
1330
|
+
], 8, Ct));
|
|
1331
|
+
}
|
|
1332
|
+
}), Et = () => ({
|
|
1333
|
+
loading: {
|
|
1334
|
+
delay: 2e3,
|
|
1335
|
+
overlay: !1
|
|
1336
|
+
},
|
|
1337
|
+
toast: {
|
|
1338
|
+
timeout: 4e3,
|
|
1339
|
+
errorTimeout: !1
|
|
1340
|
+
},
|
|
1341
|
+
dialog: { closeOnOverlayClick: !0 },
|
|
1342
|
+
i18n: { messages: {
|
|
1343
|
+
yes: "common.yes",
|
|
1344
|
+
no: "common.no",
|
|
1345
|
+
cancel: "action.cancel",
|
|
1346
|
+
close: "action.close",
|
|
1347
|
+
save: "action.save",
|
|
1348
|
+
saveFailed: "dialog.saveFailed",
|
|
1349
|
+
unknownError: "error.unknown",
|
|
1350
|
+
expand: "action.expand",
|
|
1351
|
+
collapse: "action.collapse"
|
|
1352
|
+
} },
|
|
1353
|
+
components: {
|
|
1354
|
+
dialog: {
|
|
1355
|
+
info: m(ht),
|
|
1356
|
+
confirm: m(_t),
|
|
1357
|
+
form: m(St)
|
|
1358
|
+
},
|
|
1359
|
+
toast: m(Tt)
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
//#endregion
|
|
1363
|
+
//#region lib/plugin/helper/resolvePluginOptions.ts
|
|
1364
|
+
function Dt(e = {}) {
|
|
1365
|
+
let { components: t, ...n } = e, r = Et(), i = V(r, n);
|
|
1366
|
+
return i.components = {
|
|
1367
|
+
dialog: {
|
|
1368
|
+
info: m(t?.dialog?.info ?? r.components.dialog.info),
|
|
1369
|
+
confirm: m(t?.dialog?.confirm ?? r.components.dialog.confirm),
|
|
1370
|
+
form: m(t?.dialog?.form ?? r.components.dialog.form)
|
|
1371
|
+
},
|
|
1372
|
+
toast: m(t?.toast ?? r.components.toast)
|
|
1373
|
+
}, i;
|
|
1374
|
+
}
|
|
1375
|
+
//#endregion
|
|
1376
|
+
//#region lib/plugin/helper/createPluginContext.ts
|
|
1377
|
+
function Ot(e) {
|
|
1378
|
+
return {
|
|
1379
|
+
dialogQueue: D([]),
|
|
1380
|
+
toastQueue: D([]),
|
|
1381
|
+
toastTimers: /* @__PURE__ */ new Map(),
|
|
1382
|
+
loadingOverlay: D(!1),
|
|
1383
|
+
options: e
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
//#endregion
|
|
1387
|
+
//#region lib/plugin/createUIKit.ts
|
|
1388
|
+
function kt(e) {
|
|
1389
|
+
return (t) => {
|
|
1390
|
+
t.provide(W, Ot(Dt(e)));
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
//#endregion
|
|
1394
|
+
export { lt as ConfirmDialogLevel, Z as ToastType, Ze as UiBottomSheet, Ee as UiKitOutlet, at as UiResponsiveDialog, kt as createUIKit, ot as useDialog, st as useDialogEntry, ct as useDialogForm, pt as useLoading, we as useLoadingOverlay, ut as useToast, dt as useToastEntry };
|