@schwarzdavid/ui-kit 0.0.1-alpha.5 → 0.0.1-alpha.6
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/style.css +1 -1
- package/dist/ui-kit.d.ts +1 -1
- package/dist/ui-kit.js +78 -51
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.toast-entry[data-v-
|
|
1
|
+
.toast-entry[data-v-4c652270]{pointer-events:all}.toast-entry[data-v-4c652270] .v-alert__prepend{align-self:center}.toast-outlet[data-v-ba5c8268]{position:fixed;z-index:9999;bottom:8px;right:8px;left:8px;display:flex;flex-direction:column;row-gap:8px;pointer-events:none}.toast-outlet--desktop[data-v-ba5c8268]{left:unset;max-width:500px;width:100%}.fade-move[data-v-ba5c8268],.fade-enter-active[data-v-ba5c8268],.fade-leave-active[data-v-ba5c8268]{transition:all .3s cubic-bezier(.4,0,.2,1)}.fade-enter-from[data-v-ba5c8268],.fade-leave-to[data-v-ba5c8268]{opacity:0;transform:translate(50%) scaleY(.5)}.fade-leave-active[data-v-ba5c8268]{position:absolute}.info-dialog-card[data-v-48bbcd24]>.v-card-text{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-card[data-v-aa6b77b6]>.v-card-item{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-toolbar-slot[data-v-aa6b77b6]{display:contents}.confirm-dialog-card[data-v-e571516e]>.v-card-text{padding-left:16px!important;padding-right:16px!important}
|
package/dist/ui-kit.d.ts
CHANGED
package/dist/ui-kit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { VAlert as be, VIcon as
|
|
1
|
+
import { ref as x, readonly as H, markRaw as le, defineComponent as I, openBlock as m, createElementBlock as L, Fragment as O, renderList as X, unref as s, createBlock as g, resolveDynamicComponent as B, mergeProps as G, computed as p, onMounted as ge, createSlots as _e, withCtx as d, createElementVNode as j, toDisplayString as K, createVNode as i, getCurrentInstance as ye, inject as re, TransitionGroup as Ce, normalizeClass as ue, isRef as Te, createTextVNode as te, createCommentVNode as k, normalizeProps as se, toValue as ne } from "vue";
|
|
2
|
+
import { VAlert as be, VIcon as xe, VOverlay as we, VProgressCircular as he, VDialog as Y, VCard as J, VCardTitle as ie, VBtn as V, VCardText as ce, VCardActions as Z, VToolbar as Ae, VToolbarTitle as Ve, VSpacer as ae, VDivider as Ie } from "vuetify/components";
|
|
3
3
|
import { merge as D } from "lodash";
|
|
4
4
|
import { useI18n as Ee } from "vue-i18n";
|
|
5
5
|
const v = [];
|
|
@@ -26,7 +26,7 @@ function de(e, t, n) {
|
|
|
26
26
|
const a = e.random || (e.rng || Re)();
|
|
27
27
|
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ke(a);
|
|
28
28
|
}
|
|
29
|
-
const N =
|
|
29
|
+
const N = x([]);
|
|
30
30
|
function me() {
|
|
31
31
|
function e() {
|
|
32
32
|
let a;
|
|
@@ -64,7 +64,7 @@ const Le = /* @__PURE__ */ I({
|
|
|
64
64
|
onReject: o.reject
|
|
65
65
|
}), null, 16, ["onResolve", "onReject"]))), 128));
|
|
66
66
|
}
|
|
67
|
-
}), S =
|
|
67
|
+
}), S = x([]);
|
|
68
68
|
function ee() {
|
|
69
69
|
function e() {
|
|
70
70
|
let a;
|
|
@@ -105,14 +105,15 @@ const Oe = /* @__PURE__ */ I({
|
|
|
105
105
|
[y.SUCCESS]: "success",
|
|
106
106
|
[y.INFO]: "primary",
|
|
107
107
|
[y.WARNING]: "warning"
|
|
108
|
-
}, a = e, o = ee(), l =
|
|
108
|
+
}, a = e, o = ee(), l = x(-1), u = p(() => t[a.entry.type]), r = p(() => n[a.entry.type]);
|
|
109
109
|
function c() {
|
|
110
110
|
window.clearTimeout(l.value), o.removeFromQueue(a.entry.id);
|
|
111
111
|
}
|
|
112
112
|
return ge(() => {
|
|
113
113
|
l.value = window.setTimeout(() => {
|
|
114
|
+
c();
|
|
114
115
|
}, a.entry.timeout);
|
|
115
|
-
}), (_,
|
|
116
|
+
}), (_, w) => (m(), g(s(be), {
|
|
116
117
|
theme: "dark",
|
|
117
118
|
class: "toast-entry",
|
|
118
119
|
closable: "",
|
|
@@ -120,14 +121,14 @@ const Oe = /* @__PURE__ */ I({
|
|
|
120
121
|
density: "compact"
|
|
121
122
|
}, _e({
|
|
122
123
|
default: d(() => [
|
|
123
|
-
|
|
124
|
+
j("span", null, K(_.entry.message), 1)
|
|
124
125
|
]),
|
|
125
126
|
_: 2
|
|
126
127
|
}, [
|
|
127
128
|
u.value ? {
|
|
128
129
|
name: "prepend",
|
|
129
130
|
fn: d(() => [
|
|
130
|
-
i(s(
|
|
131
|
+
i(s(xe), {
|
|
131
132
|
icon: u.value,
|
|
132
133
|
color: r.value
|
|
133
134
|
}, null, 8, ["icon", "color"])
|
|
@@ -141,7 +142,7 @@ const Oe = /* @__PURE__ */ I({
|
|
|
141
142
|
for (const [a, o] of t)
|
|
142
143
|
n[a] = o;
|
|
143
144
|
return n;
|
|
144
|
-
},
|
|
145
|
+
}, je = /* @__PURE__ */ $(Oe, [["__scopeId", "data-v-4c652270"]]);
|
|
145
146
|
function Q() {
|
|
146
147
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
147
148
|
if (Q.cache.has(e)) return Q.cache.get(e);
|
|
@@ -149,7 +150,7 @@ function Q() {
|
|
|
149
150
|
return Q.cache.set(e, t), t;
|
|
150
151
|
}
|
|
151
152
|
Q.cache = /* @__PURE__ */ new Map();
|
|
152
|
-
function
|
|
153
|
+
function Pe(e, t) {
|
|
153
154
|
const n = ye();
|
|
154
155
|
if (!n)
|
|
155
156
|
throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
|
|
@@ -157,7 +158,7 @@ function je(e, t) {
|
|
|
157
158
|
}
|
|
158
159
|
function Ne() {
|
|
159
160
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
|
|
160
|
-
const t =
|
|
161
|
+
const t = Pe(e).type;
|
|
161
162
|
return Q((t == null ? void 0 : t.aliasName) || (t == null ? void 0 : t.name));
|
|
162
163
|
}
|
|
163
164
|
const Se = Symbol.for("vuetify:display");
|
|
@@ -194,7 +195,7 @@ const Qe = /* @__PURE__ */ I({
|
|
|
194
195
|
onBeforeLeave: o
|
|
195
196
|
}, {
|
|
196
197
|
default: d(() => [
|
|
197
|
-
(m(!0), L(O, null, X(s(t), (r) => (m(), g(
|
|
198
|
+
(m(!0), L(O, null, X(s(t), (r) => (m(), g(je, {
|
|
198
199
|
key: r.id,
|
|
199
200
|
entry: r
|
|
200
201
|
}, null, 8, ["entry"]))), 128))
|
|
@@ -202,7 +203,7 @@ const Qe = /* @__PURE__ */ I({
|
|
|
202
203
|
_: 1
|
|
203
204
|
}, 8, ["class"]));
|
|
204
205
|
}
|
|
205
|
-
}), $e = /* @__PURE__ */ $(Qe, [["__scopeId", "data-v-ba5c8268"]]), Fe =
|
|
206
|
+
}), $e = /* @__PURE__ */ $(Qe, [["__scopeId", "data-v-ba5c8268"]]), Fe = x(!1);
|
|
206
207
|
function fe() {
|
|
207
208
|
return Fe;
|
|
208
209
|
}
|
|
@@ -210,14 +211,14 @@ const Me = /* @__PURE__ */ I({
|
|
|
210
211
|
__name: "LoadingOverlay",
|
|
211
212
|
setup(e) {
|
|
212
213
|
const t = fe();
|
|
213
|
-
return (n, a) => (m(), g(s(
|
|
214
|
+
return (n, a) => (m(), g(s(we), {
|
|
214
215
|
modelValue: s(t),
|
|
215
216
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => Te(t) ? t.value = o : null),
|
|
216
217
|
persistent: "",
|
|
217
218
|
class: "d-flex align-center justify-center"
|
|
218
219
|
}, {
|
|
219
220
|
default: d(() => [
|
|
220
|
-
i(s(
|
|
221
|
+
i(s(he), {
|
|
221
222
|
indeterminate: "",
|
|
222
223
|
color: "primary",
|
|
223
224
|
size: "100"
|
|
@@ -262,35 +263,35 @@ const Me = /* @__PURE__ */ I({
|
|
|
262
263
|
value: null
|
|
263
264
|
};
|
|
264
265
|
let l = null;
|
|
265
|
-
const u =
|
|
266
|
+
const u = x(!0), r = p(() => Object.hasOwn(n.data, "content") ? {
|
|
266
267
|
content: n.data.content,
|
|
267
268
|
translateContent: n.data.translateContent
|
|
268
269
|
} : null), c = p(() => Object.hasOwn(n.data, "component") ? {
|
|
269
270
|
component: n.data.component,
|
|
270
271
|
props: n.data.props
|
|
271
272
|
} : null), _ = p(() => n.data.defaultCta === !1 ? null : D({}, o, n.data.defaultCta));
|
|
272
|
-
function
|
|
273
|
-
R(f) ? f.action() :
|
|
273
|
+
function w(f) {
|
|
274
|
+
R(f) ? f.action() : h(f.value);
|
|
274
275
|
}
|
|
275
276
|
function R(f) {
|
|
276
277
|
return Object.hasOwn(f, "action");
|
|
277
278
|
}
|
|
278
|
-
function
|
|
279
|
+
function h(f = null) {
|
|
279
280
|
l = f, u.value = !1;
|
|
280
281
|
}
|
|
281
282
|
function U() {
|
|
282
283
|
a("resolve", l);
|
|
283
284
|
}
|
|
284
|
-
return (f,
|
|
285
|
+
return (f, A) => (m(), g(s(Y), {
|
|
285
286
|
modelValue: u.value,
|
|
286
|
-
"onUpdate:modelValue":
|
|
287
|
+
"onUpdate:modelValue": A[1] || (A[1] = (C) => u.value = C),
|
|
287
288
|
"max-width": f.data.width ?? Ge,
|
|
288
289
|
onAfterLeave: U
|
|
289
290
|
}, {
|
|
290
291
|
default: d(() => [
|
|
291
292
|
i(s(J), { class: "info-dialog-card" }, {
|
|
292
293
|
default: d(() => [
|
|
293
|
-
|
|
294
|
+
j("div", Be, [
|
|
294
295
|
i(s(ie), null, {
|
|
295
296
|
default: d(() => [
|
|
296
297
|
i(T, {
|
|
@@ -303,12 +304,12 @@ const Me = /* @__PURE__ */ I({
|
|
|
303
304
|
i(s(V), {
|
|
304
305
|
icon: "$close",
|
|
305
306
|
variant: "text",
|
|
306
|
-
onClick:
|
|
307
|
+
onClick: A[0] || (A[0] = (C) => h(null))
|
|
307
308
|
})
|
|
308
309
|
]),
|
|
309
310
|
r.value ? (m(), g(s(ce), { key: 0 }, {
|
|
310
311
|
default: d(() => [
|
|
311
|
-
|
|
312
|
+
j("p", null, [
|
|
312
313
|
i(T, {
|
|
313
314
|
translate: r.value.translateContent,
|
|
314
315
|
content: r.value.content
|
|
@@ -324,7 +325,7 @@ const Me = /* @__PURE__ */ I({
|
|
|
324
325
|
key: b,
|
|
325
326
|
color: "primary",
|
|
326
327
|
variant: "text",
|
|
327
|
-
onClick: () =>
|
|
328
|
+
onClick: () => w(C)
|
|
328
329
|
}, {
|
|
329
330
|
default: d(() => [
|
|
330
331
|
i(T, {
|
|
@@ -338,7 +339,7 @@ const Me = /* @__PURE__ */ I({
|
|
|
338
339
|
key: 0,
|
|
339
340
|
color: "primary",
|
|
340
341
|
variant: "elevated",
|
|
341
|
-
onClick:
|
|
342
|
+
onClick: h
|
|
342
343
|
}, {
|
|
343
344
|
default: d(() => [
|
|
344
345
|
i(T, {
|
|
@@ -376,7 +377,7 @@ const qe = /* @__PURE__ */ I({
|
|
|
376
377
|
}, u = {
|
|
377
378
|
text: "APP.SAVE",
|
|
378
379
|
translateText: !0
|
|
379
|
-
}, r =
|
|
380
|
+
}, r = x(!0), c = x(ne(n.data.initialValue) ?? null), _ = x(null), { mobile: w } = pe(), R = p(() => n.data.required && !c.value), h = p(() => o[n.data.size ?? E.SMALL]), U = p(() => n.data.size === E.LARGE ? w.value : !1), f = p(() => D({}, l, n.data.abortCta)), A = p(() => D({}, u, n.data.saveCta)), C = p(() => n.data.size === E.LARGE ? "secondary" : "primary");
|
|
380
381
|
function b() {
|
|
381
382
|
c.value = ne(n.data.initialValue) ?? null, r.value = !1;
|
|
382
383
|
}
|
|
@@ -390,30 +391,30 @@ const qe = /* @__PURE__ */ I({
|
|
|
390
391
|
}
|
|
391
392
|
a("resolve", c.value);
|
|
392
393
|
}
|
|
393
|
-
return (
|
|
394
|
+
return (P, M) => (m(), g(s(Y), {
|
|
394
395
|
modelValue: r.value,
|
|
395
396
|
"onUpdate:modelValue": M[1] || (M[1] = (z) => r.value = z),
|
|
396
|
-
"max-width":
|
|
397
|
+
"max-width": h.value,
|
|
397
398
|
fullscreen: U.value,
|
|
398
|
-
scrollable:
|
|
399
|
+
scrollable: P.data.size === s(E).LARGE,
|
|
399
400
|
onAfterLeave: W
|
|
400
401
|
}, {
|
|
401
402
|
default: d(() => [
|
|
402
403
|
i(s(J), { class: "prompt-dialog-card" }, {
|
|
403
404
|
default: d(() => [
|
|
404
|
-
i(s(
|
|
405
|
+
i(s(Ae), { color: "primary" }, {
|
|
405
406
|
default: d(() => [
|
|
406
407
|
i(s(Ve), null, {
|
|
407
408
|
default: d(() => [
|
|
408
409
|
i(T, {
|
|
409
|
-
translate:
|
|
410
|
-
content:
|
|
410
|
+
translate: P.data.translateTitle,
|
|
411
|
+
content: P.data.title
|
|
411
412
|
}, null, 8, ["translate", "content"])
|
|
412
413
|
]),
|
|
413
414
|
_: 1
|
|
414
415
|
}),
|
|
415
416
|
i(s(ae)),
|
|
416
|
-
|
|
417
|
+
j("div", {
|
|
417
418
|
ref_key: "toolbar",
|
|
418
419
|
ref: _,
|
|
419
420
|
class: "prompt-dialog-toolbar-slot"
|
|
@@ -425,7 +426,7 @@ const qe = /* @__PURE__ */ I({
|
|
|
425
426
|
]),
|
|
426
427
|
_: 1
|
|
427
428
|
}),
|
|
428
|
-
_.value ? (m(), g(B(
|
|
429
|
+
_.value ? (m(), g(B(P.data.component), G({ key: 0 }, P.data.props, {
|
|
429
430
|
modelValue: c.value,
|
|
430
431
|
"onUpdate:modelValue": M[0] || (M[0] = (z) => c.value = z),
|
|
431
432
|
toolbar: _.value
|
|
@@ -454,8 +455,8 @@ const qe = /* @__PURE__ */ I({
|
|
|
454
455
|
}, {
|
|
455
456
|
default: d(() => [
|
|
456
457
|
i(T, {
|
|
457
|
-
translate:
|
|
458
|
-
content:
|
|
458
|
+
translate: A.value.translateText,
|
|
459
|
+
content: A.value.text
|
|
459
460
|
}, null, 8, ["translate", "content"])
|
|
460
461
|
]),
|
|
461
462
|
_: 1
|
|
@@ -485,17 +486,17 @@ const qe = /* @__PURE__ */ I({
|
|
|
485
486
|
translateText: !0
|
|
486
487
|
};
|
|
487
488
|
let u = !1;
|
|
488
|
-
const r =
|
|
489
|
+
const r = x(!0), c = p(() => Object.hasOwn(n.data, "content") ? {
|
|
489
490
|
content: n.data.content,
|
|
490
491
|
translateContent: n.data.translateContent
|
|
491
492
|
} : null), _ = p(() => Object.hasOwn(n.data, "component") ? {
|
|
492
493
|
component: n.data.component,
|
|
493
494
|
props: n.data.props
|
|
494
|
-
} : null),
|
|
495
|
+
} : null), w = p(() => D({}, o, n.data.confirmCta)), R = p(() => D({}, l, n.data.rejectCta)), h = p(() => n.data.highlightCta ?? "confirm"), U = p(() => n.data.level ?? "primary");
|
|
495
496
|
function f() {
|
|
496
497
|
r.value = !1;
|
|
497
498
|
}
|
|
498
|
-
function
|
|
499
|
+
function A() {
|
|
499
500
|
u = !0, r.value = !1;
|
|
500
501
|
}
|
|
501
502
|
function C() {
|
|
@@ -515,7 +516,7 @@ const qe = /* @__PURE__ */ I({
|
|
|
515
516
|
default: d(() => [
|
|
516
517
|
i(s(J), { class: "confirm-dialog-card" }, {
|
|
517
518
|
default: d(() => [
|
|
518
|
-
|
|
519
|
+
j("div", He, [
|
|
519
520
|
i(s(ie), null, {
|
|
520
521
|
default: d(() => [
|
|
521
522
|
i(T, {
|
|
@@ -544,11 +545,11 @@ const qe = /* @__PURE__ */ I({
|
|
|
544
545
|
_.value ? (m(), g(B(_.value.component), se(G({ key: 1 }, _.value.props)), null, 16)) : k("", !0),
|
|
545
546
|
i(s(Z), { class: "justify-end" }, {
|
|
546
547
|
default: d(() => [
|
|
547
|
-
|
|
548
|
-
class: ue(["d-flex align-center",
|
|
548
|
+
j("div", {
|
|
549
|
+
class: ue(["d-flex align-center", h.value === "confirm" ? "" : "flex-row-reverse"])
|
|
549
550
|
}, [
|
|
550
551
|
i(s(V), {
|
|
551
|
-
variant:
|
|
552
|
+
variant: h.value === "reject" ? "elevated" : "text",
|
|
552
553
|
color: U.value,
|
|
553
554
|
onClick: f
|
|
554
555
|
}, {
|
|
@@ -561,14 +562,14 @@ const qe = /* @__PURE__ */ I({
|
|
|
561
562
|
_: 1
|
|
562
563
|
}, 8, ["variant", "color"]),
|
|
563
564
|
i(s(V), {
|
|
564
|
-
variant:
|
|
565
|
+
variant: h.value === "confirm" ? "elevated" : "text",
|
|
565
566
|
color: U.value,
|
|
566
|
-
onClick:
|
|
567
|
+
onClick: A
|
|
567
568
|
}, {
|
|
568
569
|
default: d(() => [
|
|
569
570
|
i(T, {
|
|
570
|
-
translate:
|
|
571
|
-
content:
|
|
571
|
+
translate: w.value.translateText,
|
|
572
|
+
content: w.value.text
|
|
572
573
|
}, null, 8, ["translate", "content"])
|
|
573
574
|
]),
|
|
574
575
|
_: 1
|
|
@@ -622,13 +623,13 @@ function it() {
|
|
|
622
623
|
content: l,
|
|
623
624
|
level: u
|
|
624
625
|
}), new Promise((c, _) => {
|
|
625
|
-
const
|
|
626
|
+
const w = {
|
|
626
627
|
component: Je,
|
|
627
628
|
props: { data: r },
|
|
628
629
|
resolve: c,
|
|
629
630
|
reject: _
|
|
630
631
|
};
|
|
631
|
-
e.addToQueue(
|
|
632
|
+
e.addToQueue(w);
|
|
632
633
|
});
|
|
633
634
|
}
|
|
634
635
|
return {
|
|
@@ -691,6 +692,32 @@ const et = () => ({
|
|
|
691
692
|
loading: {
|
|
692
693
|
delay: 2e3,
|
|
693
694
|
overlay: !1
|
|
695
|
+
},
|
|
696
|
+
dialog: {
|
|
697
|
+
info: {
|
|
698
|
+
defaultCta: {
|
|
699
|
+
text: ""
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
confirm: {
|
|
703
|
+
confirmCta: {
|
|
704
|
+
text: ""
|
|
705
|
+
},
|
|
706
|
+
rejectCta: {
|
|
707
|
+
text: ""
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
prompt: {
|
|
711
|
+
abortCta: {
|
|
712
|
+
text: ""
|
|
713
|
+
},
|
|
714
|
+
saveCta: {
|
|
715
|
+
text: ""
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
toast: {
|
|
720
|
+
timeout: 4e3
|
|
694
721
|
}
|
|
695
722
|
}), ve = "plugin:@schwarzdavid/ui-kit";
|
|
696
723
|
function tt(e, t) {
|
|
@@ -711,7 +738,7 @@ function at(e) {
|
|
|
711
738
|
}) : Promise.resolve();
|
|
712
739
|
}
|
|
713
740
|
function dt(e, t = {}) {
|
|
714
|
-
const { loading: { delay: n, overlay: a } } = nt({ loading: t }), o =
|
|
741
|
+
const { loading: { delay: n, overlay: a } } = nt({ loading: t }), o = x(!1), l = fe();
|
|
715
742
|
async function u(...r) {
|
|
716
743
|
o.value = !0, a && (l.value = !0);
|
|
717
744
|
try {
|