@schwarzdavid/ui-kit 0.0.1-alpha.1 → 0.0.1-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.
- package/dist/ui-kit.d.ts +25 -0
- package/dist/ui-kit.js +332 -240
- package/package.json +1 -1
package/dist/ui-kit.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { DefineComponent } from 'vue';
|
|
|
8
8
|
import { MaybeRefOrGetter } from 'vue';
|
|
9
9
|
import { MethodOptions } from 'vue';
|
|
10
10
|
import { PublicProps } from 'vue';
|
|
11
|
+
import { Ref } from 'vue';
|
|
11
12
|
|
|
12
13
|
declare interface ConfirmDialogBaseProps {
|
|
13
14
|
title: string;
|
|
@@ -87,6 +88,17 @@ export declare interface InfoDialogValueCta<T> extends InfoDialogBaseCta {
|
|
|
87
88
|
value: T;
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
export declare type LoadingAction = (...args: any) => any | Promise<any>;
|
|
92
|
+
|
|
93
|
+
export declare interface LoadingComposable<A extends LoadingAction> {
|
|
94
|
+
loading: Readonly<Ref<boolean>>;
|
|
95
|
+
action(...args: Parameters<A>): Promise<Awaited<ReturnType<A>>>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export declare interface LoadingOptions {
|
|
99
|
+
overlay: MaybeRefOrGetter<boolean>;
|
|
100
|
+
}
|
|
101
|
+
|
|
90
102
|
export declare type PromptDialogComponent<T> = ComponentPublicInstance<PromptDialogComponentProps<T>, any, any, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, PromptDialogComponentEmits<T>>;
|
|
91
103
|
|
|
92
104
|
export declare type PromptDialogComponentEmits<T> = (name: 'update:modelValue', value: T | null) => unknown;
|
|
@@ -118,8 +130,21 @@ export declare enum PromptDialogSize {
|
|
|
118
130
|
LARGE = "lg"
|
|
119
131
|
}
|
|
120
132
|
|
|
133
|
+
export declare interface ToastComposable {
|
|
134
|
+
info(message: string): Promise<void>;
|
|
135
|
+
warn(message: string): Promise<void>;
|
|
136
|
+
error(message: string): Promise<void>;
|
|
137
|
+
success(message: string): Promise<void>;
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
export declare const UiKitOutlet: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
122
141
|
|
|
123
142
|
export declare function useDialog(): DialogComposable;
|
|
124
143
|
|
|
144
|
+
export declare function useLoading<A extends LoadingAction>(actionCallback: A, { overlay }?: Partial<LoadingOptions>): LoadingComposable<A>;
|
|
145
|
+
|
|
146
|
+
export declare function useLoadingOverlay(): Ref<boolean>;
|
|
147
|
+
|
|
148
|
+
export declare function useToast(): ToastComposable;
|
|
149
|
+
|
|
125
150
|
export { }
|
package/dist/ui-kit.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { VAlert as
|
|
3
|
-
import { merge as
|
|
4
|
-
import { useI18n as
|
|
1
|
+
import { ref as b, readonly as J, markRaw as le, defineComponent as A, openBlock as m, createElementBlock as L, Fragment as R, renderList as Y, unref as u, createBlock as g, resolveDynamicComponent as B, mergeProps as G, onMounted as fe, withCtx as c, createTextVNode as H, toDisplayString as K, getCurrentInstance as ve, inject as ge, computed as f, TransitionGroup as _e, normalizeClass as re, isRef as ye, createVNode as s, createElementVNode as Q, createCommentVNode as k, normalizeProps as ue, toValue as X } from "vue";
|
|
2
|
+
import { VAlert as Ce, VOverlay as Te, VProgressCircular as be, VDialog as Z, VCard as ee, VCardTitle as se, VBtn as x, VCardText as ie, VCardActions as te, VToolbar as he, VToolbarTitle as we, VSpacer as ae, VDivider as xe } from "vuetify/components";
|
|
3
|
+
import { merge as $ } from "lodash";
|
|
4
|
+
import { useI18n as Ae } from "vue-i18n";
|
|
5
5
|
const v = [];
|
|
6
6
|
for (let e = 0; e < 256; ++e)
|
|
7
7
|
v.push((e + 256).toString(16).slice(1));
|
|
8
|
-
function
|
|
8
|
+
function Ve(e, n = 0) {
|
|
9
9
|
return (v[e[n + 0]] + v[e[n + 1]] + v[e[n + 2]] + v[e[n + 3]] + "-" + v[e[n + 4]] + v[e[n + 5]] + "-" + v[e[n + 6]] + v[e[n + 7]] + "-" + v[e[n + 8]] + v[e[n + 9]] + "-" + v[e[n + 10]] + v[e[n + 11]] + v[e[n + 12]] + v[e[n + 13]] + v[e[n + 14]] + v[e[n + 15]]).toLowerCase();
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
11
|
+
let q;
|
|
12
|
+
const De = new Uint8Array(16);
|
|
13
|
+
function ke() {
|
|
14
|
+
if (!q) {
|
|
15
15
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
16
16
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
17
|
-
|
|
17
|
+
q = crypto.getRandomValues.bind(crypto);
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return q(De);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
21
|
+
const Ee = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: Ee };
|
|
22
|
+
function ce(e, n, t) {
|
|
23
|
+
if (oe.randomUUID && !n && !e)
|
|
24
|
+
return oe.randomUUID();
|
|
25
25
|
e = e || {};
|
|
26
|
-
const a = e.random || (e.rng ||
|
|
27
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
26
|
+
const a = e.random || (e.rng || ke)();
|
|
27
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Ve(a);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
29
|
+
const U = b([]);
|
|
30
|
+
function de() {
|
|
31
31
|
function e() {
|
|
32
32
|
let a;
|
|
33
33
|
for (; ; )
|
|
34
|
-
if (a =
|
|
34
|
+
if (a = ce(), !U.value.some((o) => o.id === a))
|
|
35
35
|
return a;
|
|
36
36
|
}
|
|
37
37
|
function n(a) {
|
|
38
|
-
const o = e(),
|
|
38
|
+
const o = e(), i = le({ ...a, id: o, resolve: (d) => {
|
|
39
39
|
t(o), a.resolve(d);
|
|
40
40
|
}, reject: (d) => {
|
|
41
41
|
t(o), a.reject(d);
|
|
42
42
|
} });
|
|
43
|
-
return
|
|
43
|
+
return U.value.push(i), i;
|
|
44
44
|
}
|
|
45
45
|
function t(a) {
|
|
46
|
-
const o = typeof a == "string" ? a : a.id,
|
|
47
|
-
|
|
46
|
+
const o = typeof a == "string" ? a : a.id, l = U.value.findIndex((r) => r.id === o);
|
|
47
|
+
l >= 0 && U.value.splice(l, 1);
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
queue:
|
|
50
|
+
queue: J(U),
|
|
51
51
|
addToQueue: n,
|
|
52
52
|
removeFromQueue: t
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const Ie = /* @__PURE__ */ A({
|
|
56
56
|
__name: "DialogOutlet",
|
|
57
57
|
setup(e) {
|
|
58
|
-
const { queue: n } =
|
|
59
|
-
return (t, a) => (m(!0),
|
|
58
|
+
const { queue: n } = de();
|
|
59
|
+
return (t, a) => (m(!0), L(R, null, Y(u(n), (o) => (m(), g(B(o.component), G({
|
|
60
60
|
key: o.id,
|
|
61
61
|
ref_for: !0
|
|
62
62
|
}, o.props, {
|
|
@@ -64,90 +64,90 @@ const Ve = /* @__PURE__ */ w({
|
|
|
64
64
|
onReject: o.reject
|
|
65
65
|
}), null, 16, ["onResolve", "onReject"]))), 128));
|
|
66
66
|
}
|
|
67
|
-
}), P =
|
|
68
|
-
function
|
|
67
|
+
}), P = b([]);
|
|
68
|
+
function ne() {
|
|
69
69
|
function e() {
|
|
70
70
|
let a;
|
|
71
71
|
for (; ; )
|
|
72
|
-
if (a =
|
|
72
|
+
if (a = ce(), !P.value.some((o) => o.id === a))
|
|
73
73
|
return a;
|
|
74
74
|
}
|
|
75
75
|
function n(a) {
|
|
76
|
-
const o = e(),
|
|
76
|
+
const o = e(), r = le({ ...a, id: o, resolve: () => {
|
|
77
77
|
t(o), a.resolve();
|
|
78
78
|
} });
|
|
79
|
-
return P.value.unshift(
|
|
79
|
+
return P.value.unshift(r), r;
|
|
80
80
|
}
|
|
81
81
|
function t(a) {
|
|
82
|
-
const o = typeof a == "string" ? a : a.id,
|
|
83
|
-
|
|
82
|
+
const o = typeof a == "string" ? a : a.id, l = P.value.findIndex((r) => r.id === o);
|
|
83
|
+
l >= 0 && P.value.splice(l, 1);
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
|
-
queue:
|
|
86
|
+
queue: J(P),
|
|
87
87
|
addToQueue: n,
|
|
88
88
|
removeFromQueue: t
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const Le = /* @__PURE__ */ A({
|
|
92
92
|
__name: "ToastEntry",
|
|
93
93
|
props: {
|
|
94
94
|
entry: {}
|
|
95
95
|
},
|
|
96
96
|
setup(e) {
|
|
97
|
-
const n = e, t =
|
|
97
|
+
const n = e, t = ne(), a = b(-1);
|
|
98
98
|
function o() {
|
|
99
99
|
window.clearTimeout(a.value), t.removeFromQueue(n.entry.id);
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return fe(() => {
|
|
102
102
|
a.value = window.setTimeout(() => {
|
|
103
103
|
o();
|
|
104
104
|
}, n.entry.timeout);
|
|
105
|
-
}), (
|
|
105
|
+
}), (l, r) => (m(), g(u(Ce), {
|
|
106
106
|
theme: "dark",
|
|
107
107
|
class: "toast-entry",
|
|
108
108
|
closable: "",
|
|
109
109
|
"onClick:close": o
|
|
110
110
|
}, {
|
|
111
|
-
default:
|
|
112
|
-
|
|
111
|
+
default: c(() => [
|
|
112
|
+
H(K(l.entry.message), 1)
|
|
113
113
|
]),
|
|
114
114
|
_: 1
|
|
115
115
|
}));
|
|
116
116
|
}
|
|
117
|
-
}),
|
|
117
|
+
}), N = (e, n) => {
|
|
118
118
|
const t = e.__vccOpts || e;
|
|
119
119
|
for (const [a, o] of n)
|
|
120
120
|
t[a] = o;
|
|
121
121
|
return t;
|
|
122
|
-
},
|
|
123
|
-
function
|
|
122
|
+
}, Re = /* @__PURE__ */ N(Le, [["__scopeId", "data-v-419b7d95"]]);
|
|
123
|
+
function S() {
|
|
124
124
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
125
|
-
if (
|
|
125
|
+
if (S.cache.has(e)) return S.cache.get(e);
|
|
126
126
|
const n = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
127
|
-
return
|
|
127
|
+
return S.cache.set(e, n), n;
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
function
|
|
131
|
-
const t =
|
|
129
|
+
S.cache = /* @__PURE__ */ new Map();
|
|
130
|
+
function je(e, n) {
|
|
131
|
+
const t = ve();
|
|
132
132
|
if (!t)
|
|
133
133
|
throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Ue() {
|
|
137
137
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
|
|
138
|
-
const n =
|
|
139
|
-
return
|
|
138
|
+
const n = je(e).type;
|
|
139
|
+
return S((n == null ? void 0 : n.aliasName) || (n == null ? void 0 : n.name));
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
143
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
144
|
-
const t =
|
|
141
|
+
const Pe = Symbol.for("vuetify:display");
|
|
142
|
+
function me() {
|
|
143
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ue();
|
|
144
|
+
const t = ge(Pe);
|
|
145
145
|
if (!t) throw new Error("Could not find Vuetify display injection");
|
|
146
146
|
const a = f(() => {
|
|
147
147
|
if (e.mobile != null) return e.mobile;
|
|
148
148
|
if (!e.mobileBreakpoint) return t.mobile.value;
|
|
149
|
-
const
|
|
150
|
-
return t.width.value <
|
|
149
|
+
const l = typeof e.mobileBreakpoint == "number" ? e.mobileBreakpoint : t.thresholds.value[e.mobileBreakpoint];
|
|
150
|
+
return t.width.value < l;
|
|
151
151
|
}), o = f(() => n ? {
|
|
152
152
|
[`${n}--mobile`]: a.value
|
|
153
153
|
} : {});
|
|
@@ -157,52 +157,77 @@ function de() {
|
|
|
157
157
|
mobile: a
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const Oe = /* @__PURE__ */ A({
|
|
161
161
|
__name: "ToastOutlet",
|
|
162
162
|
setup(e) {
|
|
163
|
-
const { queue: n } =
|
|
164
|
-
function o(
|
|
165
|
-
const { width:
|
|
166
|
-
|
|
163
|
+
const { queue: n } = ne(), { mobile: t } = me(), a = f(() => t.value ? "" : "toast-outlet--desktop");
|
|
164
|
+
function o(l) {
|
|
165
|
+
const { width: r } = l.getBoundingClientRect();
|
|
166
|
+
l instanceof HTMLElement && (l.style.width = `${r.toFixed()}px`);
|
|
167
167
|
}
|
|
168
|
-
return (
|
|
168
|
+
return (l, r) => (m(), g(_e, {
|
|
169
169
|
name: "fade",
|
|
170
170
|
tag: "div",
|
|
171
|
-
class:
|
|
171
|
+
class: re(["toast-outlet", a.value]),
|
|
172
172
|
onBeforeLeave: o
|
|
173
173
|
}, {
|
|
174
|
-
default:
|
|
175
|
-
(m(!0),
|
|
176
|
-
key:
|
|
177
|
-
entry:
|
|
174
|
+
default: c(() => [
|
|
175
|
+
(m(!0), L(R, null, Y(u(n), (i) => (m(), g(Re, {
|
|
176
|
+
key: i.id,
|
|
177
|
+
entry: i
|
|
178
178
|
}, null, 8, ["entry"]))), 128))
|
|
179
179
|
]),
|
|
180
180
|
_: 1
|
|
181
181
|
}, 8, ["class"]));
|
|
182
182
|
}
|
|
183
|
-
}),
|
|
183
|
+
}), Se = /* @__PURE__ */ N(Oe, [["__scopeId", "data-v-93b5ec8a"]]), Qe = b(!1);
|
|
184
|
+
function pe() {
|
|
185
|
+
return Qe;
|
|
186
|
+
}
|
|
187
|
+
const $e = /* @__PURE__ */ A({
|
|
188
|
+
__name: "LoadingOverlay",
|
|
189
|
+
setup(e) {
|
|
190
|
+
const n = pe();
|
|
191
|
+
return (t, a) => (m(), g(u(Te), {
|
|
192
|
+
modelValue: u(n),
|
|
193
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => ye(n) ? n.value = o : null),
|
|
194
|
+
persistent: "",
|
|
195
|
+
class: "d-flex align-center justify-center"
|
|
196
|
+
}, {
|
|
197
|
+
default: c(() => [
|
|
198
|
+
s(u(be), {
|
|
199
|
+
indeterminate: "",
|
|
200
|
+
color: "primary",
|
|
201
|
+
size: "100"
|
|
202
|
+
})
|
|
203
|
+
]),
|
|
204
|
+
_: 1
|
|
205
|
+
}, 8, ["modelValue"]));
|
|
206
|
+
}
|
|
207
|
+
}), tt = /* @__PURE__ */ A({
|
|
184
208
|
__name: "UiKitOutlet",
|
|
185
209
|
setup(e) {
|
|
186
|
-
return (n, t) => (m(),
|
|
187
|
-
|
|
188
|
-
|
|
210
|
+
return (n, t) => (m(), L(R, null, [
|
|
211
|
+
s(Ie),
|
|
212
|
+
s(Se),
|
|
213
|
+
s($e)
|
|
189
214
|
], 64));
|
|
190
215
|
}
|
|
191
|
-
}),
|
|
216
|
+
}), C = /* @__PURE__ */ A({
|
|
192
217
|
__name: "MaybeTranslation",
|
|
193
218
|
props: {
|
|
194
219
|
content: {},
|
|
195
220
|
translate: { type: Boolean, default: !0 }
|
|
196
221
|
},
|
|
197
222
|
setup(e) {
|
|
198
|
-
const { t: n } =
|
|
199
|
-
return (t, a) => t.translate ? (m(),
|
|
200
|
-
|
|
201
|
-
], 64)) : (m(),
|
|
202
|
-
|
|
223
|
+
const { t: n } = Ae({ useScope: "global" });
|
|
224
|
+
return (t, a) => t.translate ? (m(), L(R, { key: 0 }, [
|
|
225
|
+
H(K(u(n)(t.content)), 1)
|
|
226
|
+
], 64)) : (m(), L(R, { key: 1 }, [
|
|
227
|
+
H(K(t.content), 1)
|
|
203
228
|
], 64));
|
|
204
229
|
}
|
|
205
|
-
}),
|
|
230
|
+
}), Ne = { class: "d-flex justify-space-between pr-2 py-2" }, Fe = 650, Me = /* @__PURE__ */ A({
|
|
206
231
|
__name: "InfoDialog",
|
|
207
232
|
props: {
|
|
208
233
|
data: {}
|
|
@@ -214,87 +239,87 @@ const je = /* @__PURE__ */ w({
|
|
|
214
239
|
translateText: !0,
|
|
215
240
|
value: null
|
|
216
241
|
};
|
|
217
|
-
let
|
|
218
|
-
const
|
|
242
|
+
let l = null;
|
|
243
|
+
const r = b(!0), i = f(() => Object.hasOwn(t.data, "content") ? {
|
|
219
244
|
content: t.data.content,
|
|
220
245
|
translateContent: t.data.translateContent
|
|
221
246
|
} : null), d = f(() => Object.hasOwn(t.data, "component") ? {
|
|
222
247
|
component: t.data.component,
|
|
223
248
|
props: t.data.props
|
|
224
|
-
} : null), _ = f(() => t.data.defaultCta === !1 ? null :
|
|
225
|
-
function
|
|
226
|
-
E(p) ? p.action() :
|
|
249
|
+
} : null), _ = f(() => t.data.defaultCta === !1 ? null : $({}, o, t.data.defaultCta));
|
|
250
|
+
function V(p) {
|
|
251
|
+
E(p) ? p.action() : h(p.value);
|
|
227
252
|
}
|
|
228
253
|
function E(p) {
|
|
229
254
|
return Object.hasOwn(p, "action");
|
|
230
255
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
256
|
+
function h(p = null) {
|
|
257
|
+
l = p, r.value = !1;
|
|
233
258
|
}
|
|
234
259
|
function I() {
|
|
235
|
-
a("resolve",
|
|
260
|
+
a("resolve", l);
|
|
236
261
|
}
|
|
237
|
-
return (p,
|
|
238
|
-
modelValue:
|
|
239
|
-
"onUpdate:modelValue":
|
|
240
|
-
"max-width": p.data.width ??
|
|
262
|
+
return (p, w) => (m(), g(u(Z), {
|
|
263
|
+
modelValue: r.value,
|
|
264
|
+
"onUpdate:modelValue": w[1] || (w[1] = (y) => r.value = y),
|
|
265
|
+
"max-width": p.data.width ?? Fe,
|
|
241
266
|
onAfterLeave: I
|
|
242
267
|
}, {
|
|
243
|
-
default:
|
|
244
|
-
|
|
245
|
-
default:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
default:
|
|
249
|
-
|
|
268
|
+
default: c(() => [
|
|
269
|
+
s(u(ee), { class: "info-dialog-card" }, {
|
|
270
|
+
default: c(() => [
|
|
271
|
+
Q("div", Ne, [
|
|
272
|
+
s(u(se), null, {
|
|
273
|
+
default: c(() => [
|
|
274
|
+
s(C, {
|
|
250
275
|
translate: p.data.translateTitle,
|
|
251
276
|
content: p.data.title
|
|
252
277
|
}, null, 8, ["translate", "content"])
|
|
253
278
|
]),
|
|
254
279
|
_: 1
|
|
255
280
|
}),
|
|
256
|
-
|
|
281
|
+
s(u(x), {
|
|
257
282
|
icon: "$close",
|
|
258
283
|
variant: "text",
|
|
259
|
-
onClick:
|
|
284
|
+
onClick: w[0] || (w[0] = (y) => h(null))
|
|
260
285
|
})
|
|
261
286
|
]),
|
|
262
|
-
|
|
263
|
-
default:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
translate:
|
|
267
|
-
content:
|
|
287
|
+
i.value ? (m(), g(u(ie), { key: 0 }, {
|
|
288
|
+
default: c(() => [
|
|
289
|
+
Q("p", null, [
|
|
290
|
+
s(C, {
|
|
291
|
+
translate: i.value.translateContent,
|
|
292
|
+
content: i.value.content
|
|
268
293
|
}, null, 8, ["translate", "content"])
|
|
269
294
|
])
|
|
270
295
|
]),
|
|
271
296
|
_: 1
|
|
272
297
|
})) : k("", !0),
|
|
273
|
-
d.value ? (m(), g(
|
|
274
|
-
|
|
275
|
-
default:
|
|
276
|
-
(m(!0),
|
|
298
|
+
d.value ? (m(), g(B(d.value.component), ue(G({ key: 1 }, d.value.props)), null, 16)) : k("", !0),
|
|
299
|
+
s(u(te), { class: "justify-end" }, {
|
|
300
|
+
default: c(() => [
|
|
301
|
+
(m(!0), L(R, null, Y(p.data.additionalCta ?? [], (y, T) => (m(), g(u(x), {
|
|
277
302
|
key: T,
|
|
278
303
|
color: "primary",
|
|
279
304
|
variant: "text",
|
|
280
|
-
onClick: () =>
|
|
305
|
+
onClick: () => V(y)
|
|
281
306
|
}, {
|
|
282
|
-
default:
|
|
283
|
-
|
|
284
|
-
translate:
|
|
285
|
-
content:
|
|
307
|
+
default: c(() => [
|
|
308
|
+
s(C, {
|
|
309
|
+
translate: y.translateText,
|
|
310
|
+
content: y.text
|
|
286
311
|
}, null, 8, ["translate", "content"])
|
|
287
312
|
]),
|
|
288
313
|
_: 2
|
|
289
314
|
}, 1032, ["onClick"]))), 128)),
|
|
290
|
-
_.value ? (m(), g(
|
|
315
|
+
_.value ? (m(), g(u(x), {
|
|
291
316
|
key: 0,
|
|
292
317
|
color: "primary",
|
|
293
318
|
variant: "elevated",
|
|
294
|
-
onClick:
|
|
319
|
+
onClick: h
|
|
295
320
|
}, {
|
|
296
|
-
default:
|
|
297
|
-
|
|
321
|
+
default: c(() => [
|
|
322
|
+
s(C, {
|
|
298
323
|
translate: _.value.translateText,
|
|
299
324
|
content: _.value.text
|
|
300
325
|
}, null, 8, ["translate", "content"])
|
|
@@ -311,9 +336,9 @@ const je = /* @__PURE__ */ w({
|
|
|
311
336
|
_: 1
|
|
312
337
|
}, 8, ["modelValue", "max-width"]));
|
|
313
338
|
}
|
|
314
|
-
}),
|
|
339
|
+
}), Be = /* @__PURE__ */ N(Me, [["__scopeId", "data-v-ab153f63"]]);
|
|
315
340
|
var D = /* @__PURE__ */ ((e) => (e.SMALL = "sm", e.LARGE = "lg", e))(D || {});
|
|
316
|
-
const
|
|
341
|
+
const Ge = /* @__PURE__ */ A({
|
|
317
342
|
__name: "PromptDialog",
|
|
318
343
|
props: {
|
|
319
344
|
data: {}
|
|
@@ -323,92 +348,92 @@ const Me = /* @__PURE__ */ w({
|
|
|
323
348
|
const t = e, a = n, o = {
|
|
324
349
|
[D.SMALL]: 650,
|
|
325
350
|
[D.LARGE]: 1200
|
|
326
|
-
},
|
|
351
|
+
}, l = {
|
|
327
352
|
text: "APP.CANCEL",
|
|
328
353
|
translateText: !0
|
|
329
|
-
},
|
|
354
|
+
}, r = {
|
|
330
355
|
text: "APP.SAVE",
|
|
331
356
|
translateText: !0
|
|
332
|
-
},
|
|
357
|
+
}, i = b(!0), d = b(X(t.data.initialValue) ?? null), _ = b(null), { mobile: V } = me(), E = f(() => t.data.required && !d.value), h = f(() => o[t.data.size ?? D.SMALL]), I = f(() => t.data.size === D.LARGE ? V.value : !1), p = f(() => $({}, l, t.data.abortCta)), w = f(() => $({}, r, t.data.saveCta)), y = f(() => t.data.size === D.LARGE ? "secondary" : "primary");
|
|
333
358
|
function T() {
|
|
334
|
-
d.value =
|
|
359
|
+
d.value = X(t.data.initialValue) ?? null, i.value = !1;
|
|
335
360
|
}
|
|
336
|
-
function
|
|
337
|
-
|
|
361
|
+
function F() {
|
|
362
|
+
i.value = !1;
|
|
338
363
|
}
|
|
339
|
-
function
|
|
364
|
+
function W() {
|
|
340
365
|
if (t.data.required && !d.value) {
|
|
341
366
|
a("reject");
|
|
342
367
|
return;
|
|
343
368
|
}
|
|
344
369
|
a("resolve", d.value);
|
|
345
370
|
}
|
|
346
|
-
return (
|
|
347
|
-
modelValue:
|
|
348
|
-
"onUpdate:modelValue":
|
|
349
|
-
"max-width":
|
|
371
|
+
return (j, M) => (m(), g(u(Z), {
|
|
372
|
+
modelValue: i.value,
|
|
373
|
+
"onUpdate:modelValue": M[1] || (M[1] = (z) => i.value = z),
|
|
374
|
+
"max-width": h.value,
|
|
350
375
|
fullscreen: I.value,
|
|
351
|
-
scrollable:
|
|
352
|
-
onAfterLeave:
|
|
376
|
+
scrollable: j.data.size === u(D).LARGE,
|
|
377
|
+
onAfterLeave: W
|
|
353
378
|
}, {
|
|
354
|
-
default:
|
|
355
|
-
|
|
356
|
-
default:
|
|
357
|
-
|
|
358
|
-
default:
|
|
359
|
-
|
|
360
|
-
default:
|
|
361
|
-
|
|
362
|
-
translate:
|
|
363
|
-
content:
|
|
379
|
+
default: c(() => [
|
|
380
|
+
s(u(ee), { class: "prompt-dialog-card" }, {
|
|
381
|
+
default: c(() => [
|
|
382
|
+
s(u(he), { color: "primary" }, {
|
|
383
|
+
default: c(() => [
|
|
384
|
+
s(u(we), null, {
|
|
385
|
+
default: c(() => [
|
|
386
|
+
s(C, {
|
|
387
|
+
translate: j.data.translateTitle,
|
|
388
|
+
content: j.data.title
|
|
364
389
|
}, null, 8, ["translate", "content"])
|
|
365
390
|
]),
|
|
366
391
|
_: 1
|
|
367
392
|
}),
|
|
368
|
-
|
|
369
|
-
|
|
393
|
+
s(u(ae)),
|
|
394
|
+
Q("div", {
|
|
370
395
|
ref_key: "toolbar",
|
|
371
396
|
ref: _,
|
|
372
397
|
class: "prompt-dialog-toolbar-slot"
|
|
373
398
|
}, null, 512),
|
|
374
|
-
|
|
399
|
+
s(u(x), {
|
|
375
400
|
icon: "mdi-close",
|
|
376
401
|
onClick: T
|
|
377
402
|
})
|
|
378
403
|
]),
|
|
379
404
|
_: 1
|
|
380
405
|
}),
|
|
381
|
-
_.value ? (m(), g(
|
|
406
|
+
_.value ? (m(), g(B(j.data.component), G({ key: 0 }, j.data.props, {
|
|
382
407
|
modelValue: d.value,
|
|
383
|
-
"onUpdate:modelValue":
|
|
408
|
+
"onUpdate:modelValue": M[0] || (M[0] = (z) => d.value = z),
|
|
384
409
|
toolbar: _.value
|
|
385
410
|
}), null, 16, ["modelValue", "toolbar"])) : k("", !0),
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
default:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
color:
|
|
411
|
+
s(u(xe)),
|
|
412
|
+
s(u(te), null, {
|
|
413
|
+
default: c(() => [
|
|
414
|
+
s(u(ae)),
|
|
415
|
+
s(u(x), {
|
|
416
|
+
color: y.value,
|
|
392
417
|
onClick: T
|
|
393
418
|
}, {
|
|
394
|
-
default:
|
|
395
|
-
|
|
419
|
+
default: c(() => [
|
|
420
|
+
s(C, {
|
|
396
421
|
translate: p.value.translateText,
|
|
397
422
|
content: p.value.text
|
|
398
423
|
}, null, 8, ["translate", "content"])
|
|
399
424
|
]),
|
|
400
425
|
_: 1
|
|
401
426
|
}, 8, ["color"]),
|
|
402
|
-
|
|
427
|
+
s(u(x), {
|
|
403
428
|
variant: "elevated",
|
|
404
|
-
color:
|
|
429
|
+
color: y.value,
|
|
405
430
|
disabled: E.value,
|
|
406
|
-
onClick:
|
|
431
|
+
onClick: F
|
|
407
432
|
}, {
|
|
408
|
-
default:
|
|
409
|
-
|
|
410
|
-
translate:
|
|
411
|
-
content:
|
|
433
|
+
default: c(() => [
|
|
434
|
+
s(C, {
|
|
435
|
+
translate: w.value.translateText,
|
|
436
|
+
content: w.value.text
|
|
412
437
|
}, null, 8, ["translate", "content"])
|
|
413
438
|
]),
|
|
414
439
|
_: 1
|
|
@@ -423,7 +448,7 @@ const Me = /* @__PURE__ */ w({
|
|
|
423
448
|
_: 1
|
|
424
449
|
}, 8, ["modelValue", "max-width", "fullscreen", "scrollable"]));
|
|
425
450
|
}
|
|
426
|
-
}),
|
|
451
|
+
}), We = /* @__PURE__ */ N(Ge, [["__scopeId", "data-v-1f5a0caf"]]), ze = { class: "d-flex justify-space-between pr-2 py-2" }, qe = 550, He = /* @__PURE__ */ A({
|
|
427
452
|
__name: "ConfirmDialog",
|
|
428
453
|
props: {
|
|
429
454
|
data: {}
|
|
@@ -433,95 +458,95 @@ const Me = /* @__PURE__ */ w({
|
|
|
433
458
|
const t = e, a = n, o = {
|
|
434
459
|
text: "APP.YES",
|
|
435
460
|
translateText: !0
|
|
436
|
-
},
|
|
461
|
+
}, l = {
|
|
437
462
|
text: "APP.NO",
|
|
438
463
|
translateText: !0
|
|
439
464
|
};
|
|
440
|
-
let
|
|
441
|
-
const
|
|
465
|
+
let r = !1;
|
|
466
|
+
const i = b(!0), d = f(() => Object.hasOwn(t.data, "content") ? {
|
|
442
467
|
content: t.data.content,
|
|
443
468
|
translateContent: t.data.translateContent
|
|
444
469
|
} : null), _ = f(() => Object.hasOwn(t.data, "component") ? {
|
|
445
470
|
component: t.data.component,
|
|
446
471
|
props: t.data.props
|
|
447
|
-
} : null),
|
|
472
|
+
} : null), V = f(() => $({}, o, t.data.confirmCta)), E = f(() => $({}, l, t.data.rejectCta)), h = f(() => t.data.highlightCta ?? "confirm"), I = f(() => t.data.level ?? "primary");
|
|
448
473
|
function p() {
|
|
449
|
-
|
|
474
|
+
i.value = !1;
|
|
450
475
|
}
|
|
451
|
-
function
|
|
452
|
-
|
|
476
|
+
function w() {
|
|
477
|
+
r = !0, i.value = !1;
|
|
453
478
|
}
|
|
454
|
-
function
|
|
455
|
-
if (t.data.throwOnReject && !
|
|
479
|
+
function y() {
|
|
480
|
+
if (t.data.throwOnReject && !r) {
|
|
456
481
|
a("reject");
|
|
457
482
|
return;
|
|
458
483
|
}
|
|
459
|
-
a("resolve",
|
|
484
|
+
a("resolve", r);
|
|
460
485
|
}
|
|
461
|
-
return (T,
|
|
462
|
-
modelValue:
|
|
463
|
-
"onUpdate:modelValue":
|
|
486
|
+
return (T, F) => (m(), g(u(Z), {
|
|
487
|
+
modelValue: i.value,
|
|
488
|
+
"onUpdate:modelValue": F[0] || (F[0] = (W) => i.value = W),
|
|
464
489
|
persistent: !!T.data.permanent,
|
|
465
|
-
"max-width": T.data.maxWidth ??
|
|
466
|
-
onAfterLeave:
|
|
490
|
+
"max-width": T.data.maxWidth ?? qe,
|
|
491
|
+
onAfterLeave: y
|
|
467
492
|
}, {
|
|
468
|
-
default:
|
|
469
|
-
|
|
470
|
-
default:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
default:
|
|
474
|
-
|
|
493
|
+
default: c(() => [
|
|
494
|
+
s(u(ee), { class: "confirm-dialog-card" }, {
|
|
495
|
+
default: c(() => [
|
|
496
|
+
Q("div", ze, [
|
|
497
|
+
s(u(se), null, {
|
|
498
|
+
default: c(() => [
|
|
499
|
+
s(C, {
|
|
475
500
|
translate: T.data.translateTitle,
|
|
476
501
|
content: T.data.title
|
|
477
502
|
}, null, 8, ["translate", "content"])
|
|
478
503
|
]),
|
|
479
504
|
_: 1
|
|
480
505
|
}),
|
|
481
|
-
T.data.permanent ? k("", !0) : (m(), g(
|
|
506
|
+
T.data.permanent ? k("", !0) : (m(), g(u(x), {
|
|
482
507
|
key: 0,
|
|
483
508
|
icon: "$close",
|
|
484
509
|
variant: "text",
|
|
485
510
|
onClick: p
|
|
486
511
|
}))
|
|
487
512
|
]),
|
|
488
|
-
d.value ? (m(), g(
|
|
489
|
-
default:
|
|
490
|
-
|
|
513
|
+
d.value ? (m(), g(u(ie), { key: 0 }, {
|
|
514
|
+
default: c(() => [
|
|
515
|
+
s(C, {
|
|
491
516
|
translate: d.value.translateContent,
|
|
492
517
|
content: d.value.content
|
|
493
518
|
}, null, 8, ["translate", "content"])
|
|
494
519
|
]),
|
|
495
520
|
_: 1
|
|
496
521
|
})) : k("", !0),
|
|
497
|
-
_.value ? (m(), g(
|
|
498
|
-
|
|
499
|
-
default:
|
|
500
|
-
|
|
501
|
-
class:
|
|
522
|
+
_.value ? (m(), g(B(_.value.component), ue(G({ key: 1 }, _.value.props)), null, 16)) : k("", !0),
|
|
523
|
+
s(u(te), { class: "justify-end" }, {
|
|
524
|
+
default: c(() => [
|
|
525
|
+
Q("div", {
|
|
526
|
+
class: re(["d-flex align-center", h.value === "confirm" ? "" : "flex-row-reverse"])
|
|
502
527
|
}, [
|
|
503
|
-
|
|
504
|
-
variant:
|
|
528
|
+
s(u(x), {
|
|
529
|
+
variant: h.value === "reject" ? "elevated" : "text",
|
|
505
530
|
color: I.value,
|
|
506
531
|
onClick: p
|
|
507
532
|
}, {
|
|
508
|
-
default:
|
|
509
|
-
|
|
533
|
+
default: c(() => [
|
|
534
|
+
s(C, {
|
|
510
535
|
translate: E.value.translateText,
|
|
511
536
|
content: E.value.text
|
|
512
537
|
}, null, 8, ["translate", "content"])
|
|
513
538
|
]),
|
|
514
539
|
_: 1
|
|
515
540
|
}, 8, ["variant", "color"]),
|
|
516
|
-
|
|
517
|
-
variant:
|
|
541
|
+
s(u(x), {
|
|
542
|
+
variant: h.value === "confirm" ? "elevated" : "text",
|
|
518
543
|
color: I.value,
|
|
519
|
-
onClick:
|
|
544
|
+
onClick: w
|
|
520
545
|
}, {
|
|
521
|
-
default:
|
|
522
|
-
|
|
523
|
-
translate:
|
|
524
|
-
content:
|
|
546
|
+
default: c(() => [
|
|
547
|
+
s(C, {
|
|
548
|
+
translate: V.value.translateText,
|
|
549
|
+
content: V.value.text
|
|
525
550
|
}, null, 8, ["translate", "content"])
|
|
526
551
|
]),
|
|
527
552
|
_: 1
|
|
@@ -537,51 +562,51 @@ const Me = /* @__PURE__ */ w({
|
|
|
537
562
|
_: 1
|
|
538
563
|
}, 8, ["modelValue", "persistent", "max-width"]));
|
|
539
564
|
}
|
|
540
|
-
}),
|
|
541
|
-
function
|
|
542
|
-
const e =
|
|
543
|
-
function n(o,
|
|
544
|
-
let
|
|
545
|
-
return typeof o == "string" ?
|
|
565
|
+
}), Ke = /* @__PURE__ */ N(He, [["__scopeId", "data-v-634f1f39"]]);
|
|
566
|
+
function nt() {
|
|
567
|
+
const e = de();
|
|
568
|
+
function n(o, l) {
|
|
569
|
+
let r;
|
|
570
|
+
return typeof o == "string" ? r = {
|
|
546
571
|
title: o,
|
|
547
|
-
content:
|
|
548
|
-
} :
|
|
572
|
+
content: l ?? ""
|
|
573
|
+
} : r = o, new Promise((i) => {
|
|
549
574
|
const d = {
|
|
550
|
-
component:
|
|
551
|
-
props: { data:
|
|
552
|
-
resolve:
|
|
575
|
+
component: Be,
|
|
576
|
+
props: { data: r },
|
|
577
|
+
resolve: i,
|
|
553
578
|
reject: () => {
|
|
554
|
-
|
|
579
|
+
i(null);
|
|
555
580
|
}
|
|
556
581
|
};
|
|
557
582
|
e.addToQueue(d);
|
|
558
583
|
});
|
|
559
584
|
}
|
|
560
585
|
function t(o) {
|
|
561
|
-
return new Promise((
|
|
562
|
-
const
|
|
563
|
-
component:
|
|
586
|
+
return new Promise((l, r) => {
|
|
587
|
+
const i = {
|
|
588
|
+
component: We,
|
|
564
589
|
props: { data: o },
|
|
565
|
-
resolve:
|
|
566
|
-
reject:
|
|
590
|
+
resolve: l,
|
|
591
|
+
reject: r
|
|
567
592
|
};
|
|
568
|
-
e.addToQueue(
|
|
593
|
+
e.addToQueue(i);
|
|
569
594
|
});
|
|
570
595
|
}
|
|
571
|
-
function a(o,
|
|
572
|
-
let
|
|
573
|
-
return typeof o == "string" && typeof
|
|
596
|
+
function a(o, l, r) {
|
|
597
|
+
let i = o;
|
|
598
|
+
return typeof o == "string" && typeof l == "string" && (i = {
|
|
574
599
|
title: o,
|
|
575
|
-
content:
|
|
576
|
-
level:
|
|
600
|
+
content: l,
|
|
601
|
+
level: r
|
|
577
602
|
}), new Promise((d, _) => {
|
|
578
|
-
const
|
|
579
|
-
component:
|
|
580
|
-
props: { data:
|
|
603
|
+
const V = {
|
|
604
|
+
component: Ke,
|
|
605
|
+
props: { data: i },
|
|
581
606
|
resolve: d,
|
|
582
607
|
reject: _
|
|
583
608
|
};
|
|
584
|
-
e.addToQueue(
|
|
609
|
+
e.addToQueue(V);
|
|
585
610
|
});
|
|
586
611
|
}
|
|
587
612
|
return {
|
|
@@ -590,10 +615,77 @@ function Ke() {
|
|
|
590
615
|
confirm: a
|
|
591
616
|
};
|
|
592
617
|
}
|
|
593
|
-
var
|
|
618
|
+
var Xe = /* @__PURE__ */ ((e) => (e.DEFAULT = "primary", e.WARNING = "warning", e.DANGER = "error", e))(Xe || {}), O = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e))(O || {});
|
|
619
|
+
function at() {
|
|
620
|
+
const e = ne();
|
|
621
|
+
function n(l) {
|
|
622
|
+
return new Promise((r) => {
|
|
623
|
+
e.addToQueue({
|
|
624
|
+
message: l,
|
|
625
|
+
resolve: r,
|
|
626
|
+
timeout: 4e3,
|
|
627
|
+
type: O.INFO
|
|
628
|
+
});
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
function t(l) {
|
|
632
|
+
return new Promise((r) => {
|
|
633
|
+
e.addToQueue({
|
|
634
|
+
message: l,
|
|
635
|
+
resolve: r,
|
|
636
|
+
timeout: 4e3,
|
|
637
|
+
type: O.WARNING
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
function a(l) {
|
|
642
|
+
return new Promise((r) => {
|
|
643
|
+
e.addToQueue({
|
|
644
|
+
message: l,
|
|
645
|
+
resolve: r,
|
|
646
|
+
timeout: 4e3,
|
|
647
|
+
type: O.ERROR
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
function o(l) {
|
|
652
|
+
return new Promise((r) => {
|
|
653
|
+
e.addToQueue({
|
|
654
|
+
message: l,
|
|
655
|
+
resolve: r,
|
|
656
|
+
timeout: 4e3,
|
|
657
|
+
type: O.SUCCESS
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
return {
|
|
662
|
+
info: n,
|
|
663
|
+
warn: t,
|
|
664
|
+
error: a,
|
|
665
|
+
success: o
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
function ot(e, { overlay: n } = {}) {
|
|
669
|
+
const t = b(!1), a = pe();
|
|
670
|
+
async function o(...l) {
|
|
671
|
+
const r = X(n);
|
|
672
|
+
t.value = !0, r && (a.value = !0);
|
|
673
|
+
try {
|
|
674
|
+
return await e(...l);
|
|
675
|
+
} catch (i) {
|
|
676
|
+
throw i;
|
|
677
|
+
} finally {
|
|
678
|
+
t.value = !1, r && (a.value = !1);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return { loading: J(t), action: o };
|
|
682
|
+
}
|
|
594
683
|
export {
|
|
595
|
-
|
|
684
|
+
Xe as ConfirmDialogLevel,
|
|
596
685
|
D as PromptDialogSize,
|
|
597
|
-
|
|
598
|
-
|
|
686
|
+
tt as UiKitOutlet,
|
|
687
|
+
nt as useDialog,
|
|
688
|
+
ot as useLoading,
|
|
689
|
+
pe as useLoadingOverlay,
|
|
690
|
+
at as useToast
|
|
599
691
|
};
|