@schwarzdavid/ui-kit 0.0.1-alpha.1 → 0.0.1-alpha.3
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 +1 -1
- package/dist/style.css +1 -1
- package/dist/ui-kit.d.ts +25 -0
- package/dist/ui-kit.js +313 -221
- package/package.json +87 -87
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 T, readonly as J, markRaw as le, defineComponent as A, openBlock as m, createElementBlock as L, Fragment as R, renderList as Z, unref as u, createBlock as g, resolveDynamicComponent as B, mergeProps as G, onMounted as fe, withCtx as i, 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 be, VProgressCircular as Te, VDialog as Y, VCard as ee, VCardTitle as se, VBtn as x, VCardText as ce, 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 Ie = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: Ie };
|
|
22
|
+
function ie(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 = T([]);
|
|
30
|
+
function de() {
|
|
31
31
|
function e() {
|
|
32
32
|
let a;
|
|
33
33
|
for (; ; )
|
|
34
|
-
if (a =
|
|
34
|
+
if (a = ie(), !U.value.some((o) => o.id === a))
|
|
35
35
|
return a;
|
|
36
36
|
}
|
|
37
37
|
function n(a) {
|
|
38
|
-
const o = e(), c =
|
|
38
|
+
const o = e(), c = 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(c), c;
|
|
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 Ee = /* @__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, Z(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
|
-
}),
|
|
68
|
-
function
|
|
67
|
+
}), O = T([]);
|
|
68
|
+
function ne() {
|
|
69
69
|
function e() {
|
|
70
70
|
let a;
|
|
71
71
|
for (; ; )
|
|
72
|
-
if (a =
|
|
72
|
+
if (a = ie(), !O.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
|
|
79
|
+
return O.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 = O.value.findIndex((r) => r.id === o);
|
|
83
|
+
l >= 0 && O.value.splice(l, 1);
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
|
-
queue:
|
|
86
|
+
queue: J(O),
|
|
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 = T(-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
111
|
default: i(() => [
|
|
112
|
-
|
|
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-ad30c2cc"]]);
|
|
123
|
+
function P() {
|
|
124
124
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
125
|
-
if (
|
|
125
|
+
if (P.cache.has(e)) return P.cache.get(e);
|
|
126
126
|
const n = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
127
|
-
return
|
|
127
|
+
return P.cache.set(e, n), n;
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
function
|
|
131
|
-
const t =
|
|
129
|
+
P.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 P((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 Oe = 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(Oe);
|
|
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,22 +157,22 @@ function de() {
|
|
|
157
157
|
mobile: a
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const Se = /* @__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
174
|
default: i(() => [
|
|
175
|
-
(m(!0),
|
|
175
|
+
(m(!0), L(R, null, Z(u(n), (c) => (m(), g(Re, {
|
|
176
176
|
key: c.id,
|
|
177
177
|
entry: c
|
|
178
178
|
}, null, 8, ["entry"]))), 128))
|
|
@@ -180,29 +180,54 @@ const je = /* @__PURE__ */ w({
|
|
|
180
180
|
_: 1
|
|
181
181
|
}, 8, ["class"]));
|
|
182
182
|
}
|
|
183
|
-
}),
|
|
183
|
+
}), Pe = /* @__PURE__ */ N(Se, [["__scopeId", "data-v-98dd8b51"]]), Qe = T(!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(be), {
|
|
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: i(() => [
|
|
198
|
+
s(u(Te), {
|
|
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(Ee),
|
|
212
|
+
s(Pe),
|
|
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,55 +239,55 @@ 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 = T(!0), c = 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
|
-
|
|
249
|
+
} : null), _ = f(() => t.data.defaultCta === !1 ? null : $({}, o, t.data.defaultCta));
|
|
250
|
+
function V(p) {
|
|
251
|
+
I(p) ? p.action() : h(p.value);
|
|
227
252
|
}
|
|
228
|
-
function
|
|
253
|
+
function I(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
|
-
function
|
|
235
|
-
a("resolve",
|
|
259
|
+
function E() {
|
|
260
|
+
a("resolve", l);
|
|
236
261
|
}
|
|
237
|
-
return (p,
|
|
238
|
-
modelValue:
|
|
239
|
-
"onUpdate:modelValue":
|
|
240
|
-
"max-width": p.data.width ??
|
|
241
|
-
onAfterLeave:
|
|
262
|
+
return (p, w) => (m(), g(u(Y), {
|
|
263
|
+
modelValue: r.value,
|
|
264
|
+
"onUpdate:modelValue": w[1] || (w[1] = (y) => r.value = y),
|
|
265
|
+
"max-width": p.data.width ?? Fe,
|
|
266
|
+
onAfterLeave: E
|
|
242
267
|
}, {
|
|
243
268
|
default: i(() => [
|
|
244
|
-
|
|
269
|
+
s(u(ee), { class: "info-dialog-card" }, {
|
|
245
270
|
default: i(() => [
|
|
246
|
-
|
|
247
|
-
|
|
271
|
+
Q("div", Ne, [
|
|
272
|
+
s(u(se), null, {
|
|
248
273
|
default: i(() => [
|
|
249
|
-
|
|
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
|
-
c.value ? (m(), g(
|
|
287
|
+
c.value ? (m(), g(u(ce), { key: 0 }, {
|
|
263
288
|
default: i(() => [
|
|
264
|
-
|
|
265
|
-
|
|
289
|
+
Q("p", null, [
|
|
290
|
+
s(C, {
|
|
266
291
|
translate: c.value.translateContent,
|
|
267
292
|
content: c.value.content
|
|
268
293
|
}, null, 8, ["translate", "content"])
|
|
@@ -270,31 +295,31 @@ const je = /* @__PURE__ */ w({
|
|
|
270
295
|
]),
|
|
271
296
|
_: 1
|
|
272
297
|
})) : k("", !0),
|
|
273
|
-
d.value ? (m(), g(
|
|
274
|
-
|
|
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" }, {
|
|
275
300
|
default: i(() => [
|
|
276
|
-
(m(!0),
|
|
277
|
-
key:
|
|
301
|
+
(m(!0), L(R, null, Z(p.data.additionalCta ?? [], (y, b) => (m(), g(u(x), {
|
|
302
|
+
key: b,
|
|
278
303
|
color: "primary",
|
|
279
304
|
variant: "text",
|
|
280
|
-
onClick: () =>
|
|
305
|
+
onClick: () => V(y)
|
|
281
306
|
}, {
|
|
282
307
|
default: i(() => [
|
|
283
|
-
|
|
284
|
-
translate:
|
|
285
|
-
content:
|
|
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
321
|
default: i(() => [
|
|
297
|
-
|
|
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-48bbcd24"]]);
|
|
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
|
-
}, c =
|
|
333
|
-
function
|
|
334
|
-
d.value =
|
|
357
|
+
}, c = T(!0), d = T(X(t.data.initialValue) ?? null), _ = T(null), { mobile: V } = me(), I = f(() => t.data.required && !d.value), h = f(() => o[t.data.size ?? D.SMALL]), E = 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");
|
|
358
|
+
function b() {
|
|
359
|
+
d.value = X(t.data.initialValue) ?? null, c.value = !1;
|
|
335
360
|
}
|
|
336
|
-
function
|
|
361
|
+
function F() {
|
|
337
362
|
c.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 (
|
|
371
|
+
return (j, M) => (m(), g(u(Y), {
|
|
347
372
|
modelValue: c.value,
|
|
348
|
-
"onUpdate:modelValue":
|
|
349
|
-
"max-width":
|
|
350
|
-
fullscreen:
|
|
351
|
-
scrollable:
|
|
352
|
-
onAfterLeave:
|
|
373
|
+
"onUpdate:modelValue": M[1] || (M[1] = (z) => c.value = z),
|
|
374
|
+
"max-width": h.value,
|
|
375
|
+
fullscreen: E.value,
|
|
376
|
+
scrollable: j.data.size === u(D).LARGE,
|
|
377
|
+
onAfterLeave: W
|
|
353
378
|
}, {
|
|
354
379
|
default: i(() => [
|
|
355
|
-
|
|
380
|
+
s(u(ee), { class: "prompt-dialog-card" }, {
|
|
356
381
|
default: i(() => [
|
|
357
|
-
|
|
382
|
+
s(u(he), { color: "primary" }, {
|
|
358
383
|
default: i(() => [
|
|
359
|
-
|
|
384
|
+
s(u(we), null, {
|
|
360
385
|
default: i(() => [
|
|
361
|
-
|
|
362
|
-
translate:
|
|
363
|
-
content:
|
|
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
|
-
onClick:
|
|
401
|
+
onClick: b
|
|
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
|
-
|
|
411
|
+
s(u(xe)),
|
|
412
|
+
s(u(te), null, {
|
|
388
413
|
default: i(() => [
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
color:
|
|
392
|
-
onClick:
|
|
414
|
+
s(u(ae)),
|
|
415
|
+
s(u(x), {
|
|
416
|
+
color: y.value,
|
|
417
|
+
onClick: b
|
|
393
418
|
}, {
|
|
394
419
|
default: i(() => [
|
|
395
|
-
|
|
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:
|
|
405
|
-
disabled:
|
|
406
|
-
onClick:
|
|
429
|
+
color: y.value,
|
|
430
|
+
disabled: I.value,
|
|
431
|
+
onClick: F
|
|
407
432
|
}, {
|
|
408
433
|
default: i(() => [
|
|
409
|
-
|
|
410
|
-
translate:
|
|
411
|
-
content:
|
|
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-aa6b77b6"]]), 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: {}
|
|
@@ -431,97 +456,97 @@ const Me = /* @__PURE__ */ w({
|
|
|
431
456
|
emits: ["resolve", "reject"],
|
|
432
457
|
setup(e, { emit: n }) {
|
|
433
458
|
const t = e, a = n, o = {
|
|
434
|
-
text: "
|
|
459
|
+
text: "common.yes",
|
|
435
460
|
translateText: !0
|
|
436
|
-
},
|
|
437
|
-
text: "
|
|
461
|
+
}, l = {
|
|
462
|
+
text: "common.no",
|
|
438
463
|
translateText: !0
|
|
439
464
|
};
|
|
440
|
-
let
|
|
441
|
-
const c =
|
|
465
|
+
let r = !1;
|
|
466
|
+
const c = T(!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)), I = f(() => $({}, l, t.data.rejectCta)), h = f(() => t.data.highlightCta ?? "confirm"), E = f(() => t.data.level ?? "primary");
|
|
448
473
|
function p() {
|
|
449
474
|
c.value = !1;
|
|
450
475
|
}
|
|
451
|
-
function
|
|
452
|
-
|
|
476
|
+
function w() {
|
|
477
|
+
r = !0, c.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 (
|
|
486
|
+
return (b, F) => (m(), g(u(Y), {
|
|
462
487
|
modelValue: c.value,
|
|
463
|
-
"onUpdate:modelValue":
|
|
464
|
-
persistent: !!
|
|
465
|
-
"max-width":
|
|
466
|
-
onAfterLeave:
|
|
488
|
+
"onUpdate:modelValue": F[0] || (F[0] = (W) => c.value = W),
|
|
489
|
+
persistent: !!b.data.permanent,
|
|
490
|
+
"max-width": b.data.maxWidth ?? qe,
|
|
491
|
+
onAfterLeave: y
|
|
467
492
|
}, {
|
|
468
493
|
default: i(() => [
|
|
469
|
-
|
|
494
|
+
s(u(ee), { class: "confirm-dialog-card" }, {
|
|
470
495
|
default: i(() => [
|
|
471
|
-
|
|
472
|
-
|
|
496
|
+
Q("div", ze, [
|
|
497
|
+
s(u(se), null, {
|
|
473
498
|
default: i(() => [
|
|
474
|
-
|
|
475
|
-
translate:
|
|
476
|
-
content:
|
|
499
|
+
s(C, {
|
|
500
|
+
translate: b.data.translateTitle,
|
|
501
|
+
content: b.data.title
|
|
477
502
|
}, null, 8, ["translate", "content"])
|
|
478
503
|
]),
|
|
479
504
|
_: 1
|
|
480
505
|
}),
|
|
481
|
-
|
|
506
|
+
b.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(
|
|
513
|
+
d.value ? (m(), g(u(ce), { key: 0 }, {
|
|
489
514
|
default: i(() => [
|
|
490
|
-
|
|
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
|
-
|
|
522
|
+
_.value ? (m(), g(B(_.value.component), ue(G({ key: 1 }, _.value.props)), null, 16)) : k("", !0),
|
|
523
|
+
s(u(te), { class: "justify-end" }, {
|
|
499
524
|
default: i(() => [
|
|
500
|
-
|
|
501
|
-
class:
|
|
525
|
+
Q("div", {
|
|
526
|
+
class: re(["d-flex align-center", h.value === "confirm" ? "" : "flex-row-reverse"])
|
|
502
527
|
}, [
|
|
503
|
-
|
|
504
|
-
variant:
|
|
505
|
-
color:
|
|
528
|
+
s(u(x), {
|
|
529
|
+
variant: h.value === "reject" ? "elevated" : "text",
|
|
530
|
+
color: E.value,
|
|
506
531
|
onClick: p
|
|
507
532
|
}, {
|
|
508
533
|
default: i(() => [
|
|
509
|
-
|
|
510
|
-
translate:
|
|
511
|
-
content:
|
|
534
|
+
s(C, {
|
|
535
|
+
translate: I.value.translateText,
|
|
536
|
+
content: I.value.text
|
|
512
537
|
}, null, 8, ["translate", "content"])
|
|
513
538
|
]),
|
|
514
539
|
_: 1
|
|
515
540
|
}, 8, ["variant", "color"]),
|
|
516
|
-
|
|
517
|
-
variant:
|
|
518
|
-
color:
|
|
519
|
-
onClick:
|
|
541
|
+
s(u(x), {
|
|
542
|
+
variant: h.value === "confirm" ? "elevated" : "text",
|
|
543
|
+
color: E.value,
|
|
544
|
+
onClick: w
|
|
520
545
|
}, {
|
|
521
546
|
default: i(() => [
|
|
522
|
-
|
|
523
|
-
translate:
|
|
524
|
-
content:
|
|
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,18 +562,18 @@ 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-e571516e"]]);
|
|
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((c) => {
|
|
549
574
|
const d = {
|
|
550
|
-
component:
|
|
551
|
-
props: { data:
|
|
575
|
+
component: Be,
|
|
576
|
+
props: { data: r },
|
|
552
577
|
resolve: c,
|
|
553
578
|
reject: () => {
|
|
554
579
|
c(null);
|
|
@@ -558,30 +583,30 @@ function Ke() {
|
|
|
558
583
|
});
|
|
559
584
|
}
|
|
560
585
|
function t(o) {
|
|
561
|
-
return new Promise((
|
|
586
|
+
return new Promise((l, r) => {
|
|
562
587
|
const c = {
|
|
563
|
-
component:
|
|
588
|
+
component: We,
|
|
564
589
|
props: { data: o },
|
|
565
|
-
resolve:
|
|
566
|
-
reject:
|
|
590
|
+
resolve: l,
|
|
591
|
+
reject: r
|
|
567
592
|
};
|
|
568
593
|
e.addToQueue(c);
|
|
569
594
|
});
|
|
570
595
|
}
|
|
571
|
-
function a(o,
|
|
596
|
+
function a(o, l, r) {
|
|
572
597
|
let c = o;
|
|
573
|
-
return typeof o == "string" && typeof
|
|
598
|
+
return typeof o == "string" && typeof l == "string" && (c = {
|
|
574
599
|
title: o,
|
|
575
|
-
content:
|
|
576
|
-
level:
|
|
600
|
+
content: l,
|
|
601
|
+
level: r
|
|
577
602
|
}), new Promise((d, _) => {
|
|
578
|
-
const
|
|
579
|
-
component:
|
|
603
|
+
const V = {
|
|
604
|
+
component: Ke,
|
|
580
605
|
props: { data: c },
|
|
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 || {}), S = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e))(S || {});
|
|
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: S.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: S.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: S.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: S.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 = T(!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 (c) {
|
|
676
|
+
throw c;
|
|
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
|
};
|