@schwarzdavid/ui-kit 0.0.1-alpha.14 → 0.0.1-alpha.16
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/main.js +49 -49
- package/dist/validators.d.ts +2 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -104,7 +104,7 @@ function ee() {
|
|
|
104
104
|
removeFromQueue: r
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
var
|
|
107
|
+
var D = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e))(D || {});
|
|
108
108
|
const Se = { key: 0 }, je = { key: 1 }, Me = /* @__PURE__ */ k({
|
|
109
109
|
__name: "ToastEntry",
|
|
110
110
|
props: {
|
|
@@ -112,15 +112,15 @@ const Se = { key: 0 }, je = { key: 1 }, Me = /* @__PURE__ */ k({
|
|
|
112
112
|
},
|
|
113
113
|
setup(e) {
|
|
114
114
|
const a = {
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
[
|
|
115
|
+
[D.ERROR]: "mdi-alert-circle-outline",
|
|
116
|
+
[D.SUCCESS]: "mdi-check-circle-outline",
|
|
117
|
+
[D.INFO]: "mdi-information-outline",
|
|
118
|
+
[D.WARNING]: "mdi-alert-circle-outline"
|
|
119
119
|
}, t = {
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
120
|
+
[D.ERROR]: "error",
|
|
121
|
+
[D.SUCCESS]: "success",
|
|
122
|
+
[D.INFO]: "primary",
|
|
123
|
+
[D.WARNING]: "warning"
|
|
124
124
|
}, r = e, o = ee(), u = E(-1), c = y(() => a[r.entry.type]), n = y(() => t[r.entry.type]), { t: i } = me({ useScope: "global" });
|
|
125
125
|
function f() {
|
|
126
126
|
window.clearTimeout(u.value), o.removeFromQueue(r.entry.id);
|
|
@@ -129,7 +129,7 @@ const Se = { key: 0 }, je = { key: 1 }, Me = /* @__PURE__ */ k({
|
|
|
129
129
|
u.value = window.setTimeout(() => {
|
|
130
130
|
f();
|
|
131
131
|
}, r.entry.timeout);
|
|
132
|
-
}), (_,
|
|
132
|
+
}), (_, V) => (m(), p(l(Ve), {
|
|
133
133
|
theme: "dark",
|
|
134
134
|
class: "toast-entry",
|
|
135
135
|
closable: "",
|
|
@@ -248,7 +248,7 @@ const $e = /* @__PURE__ */ k({
|
|
|
248
248
|
component: t.data.component,
|
|
249
249
|
props: t.data.props
|
|
250
250
|
} : null), _ = y(() => t.data.defaultCta === !1 ? null : Q({}, u, t.data.defaultCta));
|
|
251
|
-
function
|
|
251
|
+
function V(v) {
|
|
252
252
|
R(v) ? v.action() : b(v.value);
|
|
253
253
|
}
|
|
254
254
|
function R(v) {
|
|
@@ -262,7 +262,7 @@ const $e = /* @__PURE__ */ k({
|
|
|
262
262
|
}
|
|
263
263
|
return (v, T) => (m(), p(l(K), {
|
|
264
264
|
modelValue: n.value,
|
|
265
|
-
"onUpdate:modelValue": T[1] || (T[1] = (
|
|
265
|
+
"onUpdate:modelValue": T[1] || (T[1] = (w) => n.value = w),
|
|
266
266
|
"max-width": v.data.width ?? Ge,
|
|
267
267
|
onAfterLeave: h
|
|
268
268
|
}, {
|
|
@@ -282,7 +282,7 @@ const $e = /* @__PURE__ */ k({
|
|
|
282
282
|
s(l(A), {
|
|
283
283
|
icon: "$close",
|
|
284
284
|
variant: "text",
|
|
285
|
-
onClick: T[0] || (T[0] = (
|
|
285
|
+
onClick: T[0] || (T[0] = (w) => b(null))
|
|
286
286
|
})
|
|
287
287
|
]),
|
|
288
288
|
i.value ? (m(), p(l(se), { key: 0 }, {
|
|
@@ -299,16 +299,16 @@ const $e = /* @__PURE__ */ k({
|
|
|
299
299
|
f.value ? (m(), p(F(f.value.component), re($({ key: 1 }, f.value.props)), null, 16)) : S("", !0),
|
|
300
300
|
s(l(q), { class: "justify-end" }, {
|
|
301
301
|
default: d(() => [
|
|
302
|
-
(m(!0), U(M, null, J(v.data.additionalCta ?? [], (
|
|
302
|
+
(m(!0), U(M, null, J(v.data.additionalCta ?? [], (w, I) => (m(), p(l(A), {
|
|
303
303
|
key: I,
|
|
304
304
|
color: "primary",
|
|
305
305
|
variant: "text",
|
|
306
|
-
onClick: () =>
|
|
306
|
+
onClick: () => V(w)
|
|
307
307
|
}, {
|
|
308
308
|
default: d(() => [
|
|
309
309
|
s(C, {
|
|
310
|
-
translate:
|
|
311
|
-
content:
|
|
310
|
+
translate: w.translateText,
|
|
311
|
+
content: w.text
|
|
312
312
|
}, null, 8, ["translate", "content"])
|
|
313
313
|
]),
|
|
314
314
|
_: 2
|
|
@@ -356,14 +356,14 @@ const Ke = /* @__PURE__ */ k({
|
|
|
356
356
|
const t = e, r = a, o = {
|
|
357
357
|
[L.SMALL]: 650,
|
|
358
358
|
[L.LARGE]: 1200
|
|
359
|
-
}, u = H(t.data.saveCta, "save"), c = H(t.data.abortCta, "cancel"), n = E(!0), i = E(ne(t.data.initialValue) ?? null), f = E(null), { mobile: _ } = fe(),
|
|
359
|
+
}, u = H(t.data.saveCta, "save"), c = H(t.data.abortCta, "cancel"), n = E(!0), i = E(ne(t.data.initialValue) ?? null), f = E(null), { mobile: _ } = fe(), V = y(() => t.data.required && !i.value), R = y(() => o[t.data.size ?? L.SMALL]), b = y(() => t.data.size === L.LARGE ? _.value : !1), h = y(() => t.data.size === L.LARGE ? "secondary" : "primary");
|
|
360
360
|
function v() {
|
|
361
361
|
return t.data.props ?? {};
|
|
362
362
|
}
|
|
363
363
|
function T() {
|
|
364
364
|
i.value = ne(t.data.initialValue) ?? null, n.value = !1;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function w() {
|
|
367
367
|
n.value = !1;
|
|
368
368
|
}
|
|
369
369
|
function I() {
|
|
@@ -373,12 +373,12 @@ const Ke = /* @__PURE__ */ k({
|
|
|
373
373
|
}
|
|
374
374
|
r("resolve", i.value);
|
|
375
375
|
}
|
|
376
|
-
return (
|
|
376
|
+
return (x, O) => (m(), p(l(K), {
|
|
377
377
|
modelValue: n.value,
|
|
378
378
|
"onUpdate:modelValue": O[1] || (O[1] = (P) => n.value = P),
|
|
379
379
|
"max-width": R.value,
|
|
380
380
|
fullscreen: b.value,
|
|
381
|
-
scrollable:
|
|
381
|
+
scrollable: x.data.size === l(L).LARGE,
|
|
382
382
|
onAfterLeave: I
|
|
383
383
|
}, {
|
|
384
384
|
default: d(() => [
|
|
@@ -389,8 +389,8 @@ const Ke = /* @__PURE__ */ k({
|
|
|
389
389
|
s(l(ie), null, {
|
|
390
390
|
default: d(() => [
|
|
391
391
|
s(C, {
|
|
392
|
-
translate:
|
|
393
|
-
content:
|
|
392
|
+
translate: x.data.translateTitle,
|
|
393
|
+
content: x.data.title
|
|
394
394
|
}, null, 8, ["translate", "content"])
|
|
395
395
|
]),
|
|
396
396
|
_: 1
|
|
@@ -408,7 +408,7 @@ const Ke = /* @__PURE__ */ k({
|
|
|
408
408
|
]),
|
|
409
409
|
_: 1
|
|
410
410
|
}),
|
|
411
|
-
f.value ? (m(), p(F(
|
|
411
|
+
f.value ? (m(), p(F(x.data.component), $({ key: 0 }, v(), {
|
|
412
412
|
modelValue: i.value,
|
|
413
413
|
"onUpdate:modelValue": O[0] || (O[0] = (P) => i.value = P),
|
|
414
414
|
toolbar: f.value
|
|
@@ -432,8 +432,8 @@ const Ke = /* @__PURE__ */ k({
|
|
|
432
432
|
s(l(A), {
|
|
433
433
|
variant: "elevated",
|
|
434
434
|
color: h.value,
|
|
435
|
-
disabled:
|
|
436
|
-
onClick:
|
|
435
|
+
disabled: V.value,
|
|
436
|
+
onClick: w
|
|
437
437
|
}, {
|
|
438
438
|
default: d(() => [
|
|
439
439
|
s(C, {
|
|
@@ -471,14 +471,14 @@ const Ke = /* @__PURE__ */ k({
|
|
|
471
471
|
const f = E(!0), _ = y(() => Object.hasOwn(t.data, "content") ? {
|
|
472
472
|
content: t.data.content,
|
|
473
473
|
translateContent: t.data.translateContent
|
|
474
|
-
} : null),
|
|
474
|
+
} : null), V = y(() => Object.hasOwn(t.data, "component") ? {
|
|
475
475
|
component: t.data.component,
|
|
476
476
|
props: t.data.props
|
|
477
477
|
} : null), R = y(() => Q({}, c, t.data.confirmCta)), b = y(() => Q({}, n, t.data.rejectCta)), h = y(() => t.data.highlightCta ?? "confirm"), v = y(() => t.data.level ?? "primary");
|
|
478
478
|
function T() {
|
|
479
479
|
f.value = !1;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function w() {
|
|
482
482
|
i = !0, f.value = !1;
|
|
483
483
|
}
|
|
484
484
|
function I() {
|
|
@@ -488,11 +488,11 @@ const Ke = /* @__PURE__ */ k({
|
|
|
488
488
|
}
|
|
489
489
|
r("resolve", i);
|
|
490
490
|
}
|
|
491
|
-
return (
|
|
491
|
+
return (x, O) => (m(), p(l(K), {
|
|
492
492
|
modelValue: f.value,
|
|
493
493
|
"onUpdate:modelValue": O[0] || (O[0] = (P) => f.value = P),
|
|
494
|
-
persistent: !!
|
|
495
|
-
"max-width":
|
|
494
|
+
persistent: !!x.data.permanent,
|
|
495
|
+
"max-width": x.data.maxWidth ?? Ye,
|
|
496
496
|
onAfterLeave: I
|
|
497
497
|
}, {
|
|
498
498
|
default: d(() => [
|
|
@@ -502,13 +502,13 @@ const Ke = /* @__PURE__ */ k({
|
|
|
502
502
|
s(l(ue), null, {
|
|
503
503
|
default: d(() => [
|
|
504
504
|
s(C, {
|
|
505
|
-
translate:
|
|
506
|
-
content:
|
|
505
|
+
translate: x.data.translateTitle,
|
|
506
|
+
content: x.data.title
|
|
507
507
|
}, null, 8, ["translate", "content"])
|
|
508
508
|
]),
|
|
509
509
|
_: 1
|
|
510
510
|
}),
|
|
511
|
-
|
|
511
|
+
x.data.permanent ? S("", !0) : (m(), p(l(A), {
|
|
512
512
|
key: 0,
|
|
513
513
|
icon: "$close",
|
|
514
514
|
variant: "text",
|
|
@@ -524,7 +524,7 @@ const Ke = /* @__PURE__ */ k({
|
|
|
524
524
|
]),
|
|
525
525
|
_: 1
|
|
526
526
|
})) : S("", !0),
|
|
527
|
-
|
|
527
|
+
V.value ? (m(), p(F(V.value.component), re($({ key: 1 }, V.value.props)), null, 16)) : S("", !0),
|
|
528
528
|
s(l(q), { class: "justify-end" }, {
|
|
529
529
|
default: d(() => [
|
|
530
530
|
N("div", {
|
|
@@ -546,7 +546,7 @@ const Ke = /* @__PURE__ */ k({
|
|
|
546
546
|
s(l(A), {
|
|
547
547
|
variant: h.value === "confirm" ? "elevated" : "text",
|
|
548
548
|
color: v.value,
|
|
549
|
-
onClick:
|
|
549
|
+
onClick: w
|
|
550
550
|
}, {
|
|
551
551
|
default: d(() => [
|
|
552
552
|
s(C, {
|
|
@@ -600,7 +600,7 @@ const tt = /* @__PURE__ */ k({
|
|
|
600
600
|
},
|
|
601
601
|
emits: ["resolve", "reject"],
|
|
602
602
|
setup(e, { emit: a }) {
|
|
603
|
-
const t = e, r = a, o = H(t.data.saveCta, "save"), u = H(t.data.abortCta, "cancel"), c = De("formComponent"), n = E(!0), i = Ee(), { loading: f, action: _ } = et(v),
|
|
603
|
+
const t = e, r = a, o = H(t.data.saveCta, "save"), u = H(t.data.abortCta, "cancel"), c = De("formComponent"), n = E(!0), i = Ee(), { loading: f, action: _ } = et(v), V = y(() => ({
|
|
604
604
|
global: {
|
|
605
605
|
disabled: f.value
|
|
606
606
|
}
|
|
@@ -616,22 +616,22 @@ const tt = /* @__PURE__ */ k({
|
|
|
616
616
|
if (!c.value)
|
|
617
617
|
throw new Error("Form component not mounted");
|
|
618
618
|
const I = await c.value.finish();
|
|
619
|
-
typeof t.data.action == "function" ? R = await t.data.action(I) : R = I;
|
|
619
|
+
typeof t.data.action == "function" ? R = await t.data.action(I) : R = I, w();
|
|
620
620
|
}
|
|
621
621
|
function T() {
|
|
622
622
|
n.value = !1;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function w() {
|
|
625
625
|
if (t.data.rejectOnEmpty && R === null) {
|
|
626
626
|
r("reject");
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
629
|
r("resolve", R);
|
|
630
630
|
}
|
|
631
|
-
return (I,
|
|
631
|
+
return (I, x) => (m(), p(l(K), {
|
|
632
632
|
modelValue: n.value,
|
|
633
|
-
"onUpdate:modelValue":
|
|
634
|
-
onAfterLeave:
|
|
633
|
+
"onUpdate:modelValue": x[0] || (x[0] = (O) => n.value = O),
|
|
634
|
+
onAfterLeave: w,
|
|
635
635
|
"max-width": "1200",
|
|
636
636
|
scrollable: ""
|
|
637
637
|
}, {
|
|
@@ -657,7 +657,7 @@ const tt = /* @__PURE__ */ k({
|
|
|
657
657
|
]),
|
|
658
658
|
_: 1
|
|
659
659
|
}),
|
|
660
|
-
s(l(he), { defaults:
|
|
660
|
+
s(l(he), { defaults: V.value }, {
|
|
661
661
|
default: d(() => [
|
|
662
662
|
(m(), p(F(I.data.component), $({
|
|
663
663
|
ref_key: "formComponent",
|
|
@@ -744,13 +744,13 @@ function mt() {
|
|
|
744
744
|
content: c,
|
|
745
745
|
level: n
|
|
746
746
|
}), new Promise((f, _) => {
|
|
747
|
-
const
|
|
747
|
+
const V = {
|
|
748
748
|
component: Ze,
|
|
749
749
|
props: { data: i },
|
|
750
750
|
resolve: f,
|
|
751
751
|
reject: _
|
|
752
752
|
};
|
|
753
|
-
e.addToQueue(
|
|
753
|
+
e.addToQueue(V);
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
756
|
function o(u) {
|
|
@@ -781,7 +781,7 @@ function ft() {
|
|
|
781
781
|
resolve: i,
|
|
782
782
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
783
783
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
784
|
-
type:
|
|
784
|
+
type: D.INFO
|
|
785
785
|
});
|
|
786
786
|
});
|
|
787
787
|
}
|
|
@@ -792,7 +792,7 @@ function ft() {
|
|
|
792
792
|
resolve: i,
|
|
793
793
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
794
794
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
795
|
-
type:
|
|
795
|
+
type: D.WARNING
|
|
796
796
|
});
|
|
797
797
|
});
|
|
798
798
|
}
|
|
@@ -803,7 +803,7 @@ function ft() {
|
|
|
803
803
|
resolve: i,
|
|
804
804
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
805
805
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
806
|
-
type:
|
|
806
|
+
type: D.ERROR
|
|
807
807
|
});
|
|
808
808
|
});
|
|
809
809
|
}
|
|
@@ -814,7 +814,7 @@ function ft() {
|
|
|
814
814
|
resolve: i,
|
|
815
815
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
816
816
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
817
|
-
type:
|
|
817
|
+
type: D.SUCCESS
|
|
818
818
|
});
|
|
819
819
|
});
|
|
820
820
|
}
|
package/dist/validators.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import { PartialDeep } from 'type-fest';
|
|
3
|
+
import { Primitive } from 'type-fest';
|
|
3
4
|
import { Ref } from 'vue';
|
|
4
5
|
import { TranslationFunction } from '@vuelidate/validators';
|
|
5
6
|
import { Validation } from '@vuelidate/core';
|
|
@@ -64,7 +65,7 @@ export declare const url: ValidationRuleWithoutParams<any>;
|
|
|
64
65
|
export declare const useVuelidateErrors: <T extends object>(validation: Ref<Validation<ValidationArgs<T>, T>>) => ComputedRef<ValidationErrors<T>>;
|
|
65
66
|
|
|
66
67
|
export declare type ValidationErrors<T extends object> = {
|
|
67
|
-
[key in keyof T]: T[key] extends
|
|
68
|
+
[key in keyof T]: T[key] extends Primitive ? string[] : T[key] extends null | undefined ? ValidationErrors<NonNullable<T[key]>> | undefined : ValidationErrors<NonNullable<T[key]>>;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
export declare type ValidationMessageOptions = ValidationTranslationFn | ValidationTranslationTransformOptions;
|