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