@schwarzdavid/ui-kit 0.0.1-alpha.11 → 0.0.1-alpha.12
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.d.ts +10 -0
- package/dist/main.js +225 -230
- package/dist/usePluginContext-CyxsFQjN.js +14 -0
- package/dist/validators.js +52 -31
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -128,8 +128,18 @@ declare type PluginI18nMessageKey = 'save' | 'cancel' | 'close' | 'yes' | 'no';
|
|
|
128
128
|
|
|
129
129
|
declare interface PluginI18nOptions {
|
|
130
130
|
messages: Record<PluginI18nMessageKey, string>;
|
|
131
|
+
validation: PluginI18nValidationFn | PluginI18nValidationOptions;
|
|
131
132
|
}
|
|
132
133
|
|
|
134
|
+
declare type PluginI18nValidationFn = (validatorName: string) => string;
|
|
135
|
+
|
|
136
|
+
declare interface PluginI18nValidationOptions {
|
|
137
|
+
prefix: string;
|
|
138
|
+
transform: PluginI18nValidationTransform;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare type PluginI18nValidationTransform = 'snake_case' | 'camelCase' | 'PascalCase' | 'kebab-case' | 'none';
|
|
142
|
+
|
|
133
143
|
declare interface PluginLoadingOptions {
|
|
134
144
|
delay: number | false;
|
|
135
145
|
overlay: boolean;
|
package/dist/main.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { readonly as X, markRaw as ae, defineComponent as E, createElementBlock as O, openBlock as m, Fragment as M, renderList as Z, unref as l, createBlock as p, resolveDynamicComponent as F, mergeProps as $, ref as R, computed as y, onMounted as _e, createSlots as ge, withCtx as d, toDisplayString as W, createVNode as s, TransitionGroup as ye, normalizeClass as oe, isRef as Ce, createTextVNode as ee, createElementVNode as Q, createCommentVNode as L, normalizeProps as le, toValue as te, useTemplateRef as Te } from "vue";
|
|
2
|
+
import { u as S } from "./usePluginContext-CyxsFQjN.js";
|
|
3
|
+
import { VAlert as xe, VIcon as we, VOverlay as Ve, VProgressCircular as De, VDialog as H, VCard as q, VCardTitle as re, VBtn as A, VCardText as ue, VCardActions as K, VToolbar as se, VToolbarTitle as ce, VSpacer as B, VDivider as ie, VDefaultsProvider as he } from "vuetify/components";
|
|
4
|
+
import { useI18n as de } from "vue-i18n";
|
|
5
|
+
import { useDisplay as me } from "vuetify";
|
|
6
|
+
import { merge as N } from "lodash";
|
|
7
|
+
import Ae from "@vuelidate/core";
|
|
7
8
|
const g = [];
|
|
8
9
|
for (let e = 0; e < 256; ++e)
|
|
9
10
|
g.push((e + 256).toString(16).slice(1));
|
|
@@ -11,46 +12,36 @@ function be(e, a = 0) {
|
|
|
11
12
|
return (g[e[a + 0]] + g[e[a + 1]] + g[e[a + 2]] + g[e[a + 3]] + "-" + g[e[a + 4]] + g[e[a + 5]] + "-" + g[e[a + 6]] + g[e[a + 7]] + "-" + g[e[a + 8]] + g[e[a + 9]] + "-" + g[e[a + 10]] + g[e[a + 11]] + g[e[a + 12]] + g[e[a + 13]] + g[e[a + 14]] + g[e[a + 15]]).toLowerCase();
|
|
12
13
|
}
|
|
13
14
|
let Y;
|
|
14
|
-
const
|
|
15
|
-
function
|
|
15
|
+
const Ie = new Uint8Array(16);
|
|
16
|
+
function Re() {
|
|
16
17
|
if (!Y) {
|
|
17
18
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
18
19
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
19
20
|
Y = crypto.getRandomValues.bind(crypto);
|
|
20
21
|
}
|
|
21
|
-
return Y(
|
|
22
|
+
return Y(Ie);
|
|
22
23
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
24
|
+
const ke = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ne = { randomUUID: ke };
|
|
25
|
+
function fe(e, a, t) {
|
|
25
26
|
var o;
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
27
|
+
if (ne.randomUUID && !e)
|
|
28
|
+
return ne.randomUUID();
|
|
28
29
|
e = e || {};
|
|
29
|
-
const r = e.random ?? ((o = e.rng) == null ? void 0 : o.call(e)) ??
|
|
30
|
+
const r = e.random ?? ((o = e.rng) == null ? void 0 : o.call(e)) ?? Re();
|
|
30
31
|
if (r.length < 16)
|
|
31
32
|
throw new Error("Random bytes length must be >= 16");
|
|
32
33
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, be(r);
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const e = ge();
|
|
37
|
-
if (!(e != null && e.appContext.app.__SCHWARZDAVID_UIKIT_SYMBOL__))
|
|
38
|
-
throw new Error(X.NOT_INSTALLED);
|
|
39
|
-
const a = e.appContext.app.__SCHWARZDAVID_UIKIT_SYMBOL__, t = ye(a);
|
|
40
|
-
if (!t)
|
|
41
|
-
throw new Error(X.UNEXPECTED_ERROR);
|
|
42
|
-
return t;
|
|
43
|
-
}
|
|
44
|
-
function pe() {
|
|
45
|
-
const { dialogQueue: e } = j();
|
|
35
|
+
function ve() {
|
|
36
|
+
const { dialogQueue: e } = S();
|
|
46
37
|
function a() {
|
|
47
38
|
let o;
|
|
48
39
|
for (; ; )
|
|
49
|
-
if (o =
|
|
40
|
+
if (o = fe(), !e.value.some((u) => u.id === o))
|
|
50
41
|
return o;
|
|
51
42
|
}
|
|
52
43
|
function t(o) {
|
|
53
|
-
const u = a(), i =
|
|
44
|
+
const u = a(), i = ae({ ...o, id: u, resolve: (f) => {
|
|
54
45
|
r(u), o.resolve(f);
|
|
55
46
|
}, reject: (f) => {
|
|
56
47
|
r(u), o.reject(f);
|
|
@@ -62,16 +53,16 @@ function pe() {
|
|
|
62
53
|
c >= 0 && e.value.splice(c, 1);
|
|
63
54
|
}
|
|
64
55
|
return {
|
|
65
|
-
queue:
|
|
56
|
+
queue: X(e),
|
|
66
57
|
addToQueue: t,
|
|
67
58
|
removeFromQueue: r
|
|
68
59
|
};
|
|
69
60
|
}
|
|
70
|
-
const
|
|
61
|
+
const Ee = /* @__PURE__ */ E({
|
|
71
62
|
__name: "DialogOutlet",
|
|
72
63
|
setup(e) {
|
|
73
|
-
const { queue: a } =
|
|
74
|
-
return (t, r) => (m(!0),
|
|
64
|
+
const { queue: a } = ve();
|
|
65
|
+
return (t, r) => (m(!0), O(M, null, Z(l(a), (o) => (m(), p(F(o.component), $({
|
|
75
66
|
key: o.id,
|
|
76
67
|
ref_for: !0
|
|
77
68
|
}, o.props, {
|
|
@@ -80,16 +71,16 @@ const Le = /* @__PURE__ */ k({
|
|
|
80
71
|
}), null, 16, ["onResolve", "onReject"]))), 128));
|
|
81
72
|
}
|
|
82
73
|
});
|
|
83
|
-
function
|
|
84
|
-
const { toastQueue: e } =
|
|
74
|
+
function J() {
|
|
75
|
+
const { toastQueue: e } = S();
|
|
85
76
|
function a() {
|
|
86
77
|
let o;
|
|
87
78
|
for (; ; )
|
|
88
|
-
if (o =
|
|
79
|
+
if (o = fe(), !e.value.some((u) => u.id === o))
|
|
89
80
|
return o;
|
|
90
81
|
}
|
|
91
82
|
function t(o) {
|
|
92
|
-
const u = a(), n =
|
|
83
|
+
const u = a(), n = ae({ ...o, id: u, resolve: () => {
|
|
93
84
|
r(u), o.resolve();
|
|
94
85
|
} });
|
|
95
86
|
return e.value.unshift(n), n;
|
|
@@ -99,52 +90,52 @@ function ee() {
|
|
|
99
90
|
c >= 0 && e.value.splice(c, 1);
|
|
100
91
|
}
|
|
101
92
|
return {
|
|
102
|
-
queue:
|
|
93
|
+
queue: X(e),
|
|
103
94
|
addToQueue: t,
|
|
104
95
|
removeFromQueue: r
|
|
105
96
|
};
|
|
106
97
|
}
|
|
107
|
-
var
|
|
108
|
-
const
|
|
98
|
+
var w = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e))(w || {});
|
|
99
|
+
const Ue = { key: 0 }, Oe = { key: 1 }, je = /* @__PURE__ */ E({
|
|
109
100
|
__name: "ToastEntry",
|
|
110
101
|
props: {
|
|
111
102
|
entry: {}
|
|
112
103
|
},
|
|
113
104
|
setup(e) {
|
|
114
105
|
const a = {
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
[
|
|
106
|
+
[w.ERROR]: "mdi-alert-circle-outline",
|
|
107
|
+
[w.SUCCESS]: "mdi-check-circle-outline",
|
|
108
|
+
[w.INFO]: "mdi-information-outline",
|
|
109
|
+
[w.WARNING]: "mdi-alert-circle-outline"
|
|
119
110
|
}, t = {
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
}, r = e, o =
|
|
111
|
+
[w.ERROR]: "error",
|
|
112
|
+
[w.SUCCESS]: "success",
|
|
113
|
+
[w.INFO]: "primary",
|
|
114
|
+
[w.WARNING]: "warning"
|
|
115
|
+
}, r = e, o = J(), u = R(-1), c = y(() => a[r.entry.type]), n = y(() => t[r.entry.type]), { t: i } = de({ useScope: "global" });
|
|
125
116
|
function f() {
|
|
126
117
|
window.clearTimeout(u.value), o.removeFromQueue(r.entry.id);
|
|
127
118
|
}
|
|
128
|
-
return
|
|
119
|
+
return _e(() => {
|
|
129
120
|
u.value = window.setTimeout(() => {
|
|
130
121
|
f();
|
|
131
122
|
}, r.entry.timeout);
|
|
132
|
-
}), (_,
|
|
123
|
+
}), (_, V) => (m(), p(l(xe), {
|
|
133
124
|
theme: "dark",
|
|
134
125
|
class: "toast-entry",
|
|
135
126
|
closable: "",
|
|
136
127
|
"onClick:close": f,
|
|
137
128
|
density: "compact"
|
|
138
|
-
},
|
|
129
|
+
}, ge({
|
|
139
130
|
default: d(() => [
|
|
140
|
-
_.entry.translateMessage ? (m(),
|
|
131
|
+
_.entry.translateMessage ? (m(), O("span", Ue, W(l(i)(_.entry.message)), 1)) : (m(), O("span", Oe, W(_.entry.message), 1))
|
|
141
132
|
]),
|
|
142
133
|
_: 2
|
|
143
134
|
}, [
|
|
144
135
|
c.value ? {
|
|
145
136
|
name: "prepend",
|
|
146
137
|
fn: d(() => [
|
|
147
|
-
s(l(
|
|
138
|
+
s(l(we), {
|
|
148
139
|
icon: c.value,
|
|
149
140
|
color: n.value
|
|
150
141
|
}, null, 8, ["icon", "color"])
|
|
@@ -153,27 +144,27 @@ const Se = { key: 0 }, je = { key: 1 }, Me = /* @__PURE__ */ k({
|
|
|
153
144
|
} : void 0
|
|
154
145
|
]), 1024));
|
|
155
146
|
}
|
|
156
|
-
}),
|
|
147
|
+
}), G = (e, a) => {
|
|
157
148
|
const t = e.__vccOpts || e;
|
|
158
149
|
for (const [r, o] of a)
|
|
159
150
|
t[r] = o;
|
|
160
151
|
return t;
|
|
161
|
-
},
|
|
152
|
+
}, Le = /* @__PURE__ */ G(je, [["__scopeId", "data-v-7b5e0267"]]), Se = /* @__PURE__ */ E({
|
|
162
153
|
__name: "ToastOutlet",
|
|
163
154
|
setup(e) {
|
|
164
|
-
const { queue: a } =
|
|
155
|
+
const { queue: a } = J(), { mobile: t } = me(), r = y(() => t.value ? "" : "toast-outlet--desktop");
|
|
165
156
|
function o(u) {
|
|
166
157
|
const { width: c } = u.getBoundingClientRect();
|
|
167
158
|
u instanceof HTMLElement && (u.style.width = `${c.toFixed()}px`);
|
|
168
159
|
}
|
|
169
|
-
return (u, c) => (m(), p(
|
|
160
|
+
return (u, c) => (m(), p(ye, {
|
|
170
161
|
name: "fade",
|
|
171
162
|
tag: "div",
|
|
172
|
-
class:
|
|
163
|
+
class: oe(["toast-outlet", r.value]),
|
|
173
164
|
onBeforeLeave: o
|
|
174
165
|
}, {
|
|
175
166
|
default: d(() => [
|
|
176
|
-
(m(!0),
|
|
167
|
+
(m(!0), O(M, null, Z(l(a), (n) => (m(), p(Le, {
|
|
177
168
|
key: n.id,
|
|
178
169
|
entry: n
|
|
179
170
|
}, null, 8, ["entry"]))), 128))
|
|
@@ -181,22 +172,22 @@ const Se = { key: 0 }, je = { key: 1 }, Me = /* @__PURE__ */ k({
|
|
|
181
172
|
_: 1
|
|
182
173
|
}, 8, ["class"]));
|
|
183
174
|
}
|
|
184
|
-
}),
|
|
185
|
-
function
|
|
186
|
-
return
|
|
175
|
+
}), Me = /* @__PURE__ */ G(Se, [["__scopeId", "data-v-ba5c8268"]]), Pe = R(!1);
|
|
176
|
+
function pe() {
|
|
177
|
+
return Pe;
|
|
187
178
|
}
|
|
188
|
-
const
|
|
179
|
+
const Qe = /* @__PURE__ */ E({
|
|
189
180
|
__name: "LoadingOverlay",
|
|
190
181
|
setup(e) {
|
|
191
|
-
const a =
|
|
192
|
-
return (t, r) => (m(), p(l(
|
|
182
|
+
const a = pe();
|
|
183
|
+
return (t, r) => (m(), p(l(Ve), {
|
|
193
184
|
modelValue: l(a),
|
|
194
|
-
"onUpdate:modelValue": r[0] || (r[0] = (o) =>
|
|
185
|
+
"onUpdate:modelValue": r[0] || (r[0] = (o) => Ce(a) ? a.value = o : null),
|
|
195
186
|
persistent: "",
|
|
196
187
|
class: "d-flex align-center justify-center"
|
|
197
188
|
}, {
|
|
198
189
|
default: d(() => [
|
|
199
|
-
s(l(
|
|
190
|
+
s(l(De), {
|
|
200
191
|
indeterminate: "",
|
|
201
192
|
color: "primary",
|
|
202
193
|
size: "100"
|
|
@@ -205,72 +196,72 @@ const $e = /* @__PURE__ */ k({
|
|
|
205
196
|
_: 1
|
|
206
197
|
}, 8, ["modelValue"]));
|
|
207
198
|
}
|
|
208
|
-
}),
|
|
199
|
+
}), ct = /* @__PURE__ */ E({
|
|
209
200
|
__name: "UiKitOutlet",
|
|
210
201
|
setup(e) {
|
|
211
|
-
return (a, t) => (m(),
|
|
212
|
-
s(
|
|
213
|
-
s(
|
|
214
|
-
s(
|
|
202
|
+
return (a, t) => (m(), O(M, null, [
|
|
203
|
+
s(Ee),
|
|
204
|
+
s(Me),
|
|
205
|
+
s(Qe)
|
|
215
206
|
], 64));
|
|
216
207
|
}
|
|
217
|
-
}), C = /* @__PURE__ */
|
|
208
|
+
}), C = /* @__PURE__ */ E({
|
|
218
209
|
__name: "MaybeTranslation",
|
|
219
210
|
props: {
|
|
220
211
|
content: {},
|
|
221
212
|
translate: { type: Boolean, default: !0 }
|
|
222
213
|
},
|
|
223
214
|
setup(e) {
|
|
224
|
-
const { t: a } =
|
|
225
|
-
return (t, r) => t.translate ? (m(),
|
|
226
|
-
|
|
227
|
-
], 64)) : (m(),
|
|
228
|
-
|
|
215
|
+
const { t: a } = de({ useScope: "global" });
|
|
216
|
+
return (t, r) => t.translate ? (m(), O(M, { key: 0 }, [
|
|
217
|
+
ee(W(l(a)(t.content)), 1)
|
|
218
|
+
], 64)) : (m(), O(M, { key: 1 }, [
|
|
219
|
+
ee(W(t.content), 1)
|
|
229
220
|
], 64));
|
|
230
221
|
}
|
|
231
|
-
}),
|
|
222
|
+
}), Ne = { class: "d-flex justify-space-between pr-2 py-2" }, Fe = 650, $e = /* @__PURE__ */ E({
|
|
232
223
|
__name: "InfoDialog",
|
|
233
224
|
props: {
|
|
234
225
|
data: {}
|
|
235
226
|
},
|
|
236
227
|
emits: ["resolve", "reject"],
|
|
237
228
|
setup(e, { emit: a }) {
|
|
238
|
-
const t = e, r = a, { options: { i18n: { messages: { close: o } } } } =
|
|
229
|
+
const t = e, r = a, { options: { i18n: { messages: { close: o } } } } = S(), u = {
|
|
239
230
|
text: o,
|
|
240
231
|
translateText: !0,
|
|
241
232
|
value: null
|
|
242
233
|
};
|
|
243
234
|
let c = null;
|
|
244
|
-
const n =
|
|
235
|
+
const n = R(!0), i = y(() => Object.hasOwn(t.data, "content") ? {
|
|
245
236
|
content: t.data.content,
|
|
246
237
|
translateContent: t.data.translateContent
|
|
247
238
|
} : null), f = y(() => Object.hasOwn(t.data, "component") ? {
|
|
248
239
|
component: t.data.component,
|
|
249
240
|
props: t.data.props
|
|
250
|
-
} : null), _ = y(() => t.data.defaultCta === !1 ? null :
|
|
251
|
-
function
|
|
252
|
-
|
|
241
|
+
} : null), _ = y(() => t.data.defaultCta === !1 ? null : N({}, u, t.data.defaultCta));
|
|
242
|
+
function V(v) {
|
|
243
|
+
b(v) ? v.action() : k(v.value);
|
|
253
244
|
}
|
|
254
|
-
function
|
|
245
|
+
function b(v) {
|
|
255
246
|
return Object.hasOwn(v, "action");
|
|
256
247
|
}
|
|
257
|
-
function
|
|
248
|
+
function k(v = null) {
|
|
258
249
|
c = v, n.value = !1;
|
|
259
250
|
}
|
|
260
|
-
function
|
|
251
|
+
function I() {
|
|
261
252
|
r("resolve", c);
|
|
262
253
|
}
|
|
263
|
-
return (v, T) => (m(), p(l(
|
|
254
|
+
return (v, T) => (m(), p(l(H), {
|
|
264
255
|
modelValue: n.value,
|
|
265
|
-
"onUpdate:modelValue": T[1] || (T[1] = (
|
|
266
|
-
"max-width": v.data.width ??
|
|
267
|
-
onAfterLeave:
|
|
256
|
+
"onUpdate:modelValue": T[1] || (T[1] = (D) => n.value = D),
|
|
257
|
+
"max-width": v.data.width ?? Fe,
|
|
258
|
+
onAfterLeave: I
|
|
268
259
|
}, {
|
|
269
260
|
default: d(() => [
|
|
270
|
-
s(l(
|
|
261
|
+
s(l(q), { class: "info-dialog-card" }, {
|
|
271
262
|
default: d(() => [
|
|
272
|
-
|
|
273
|
-
s(l(
|
|
263
|
+
Q("div", Ne, [
|
|
264
|
+
s(l(re), null, {
|
|
274
265
|
default: d(() => [
|
|
275
266
|
s(C, {
|
|
276
267
|
translate: v.data.translateTitle,
|
|
@@ -282,12 +273,12 @@ const $e = /* @__PURE__ */ k({
|
|
|
282
273
|
s(l(A), {
|
|
283
274
|
icon: "$close",
|
|
284
275
|
variant: "text",
|
|
285
|
-
onClick: T[0] || (T[0] = (
|
|
276
|
+
onClick: T[0] || (T[0] = (D) => k(null))
|
|
286
277
|
})
|
|
287
278
|
]),
|
|
288
|
-
i.value ? (m(), p(l(
|
|
279
|
+
i.value ? (m(), p(l(ue), { key: 0 }, {
|
|
289
280
|
default: d(() => [
|
|
290
|
-
|
|
281
|
+
Q("p", null, [
|
|
291
282
|
s(C, {
|
|
292
283
|
translate: i.value.translateContent,
|
|
293
284
|
content: i.value.content
|
|
@@ -295,20 +286,20 @@ const $e = /* @__PURE__ */ k({
|
|
|
295
286
|
])
|
|
296
287
|
]),
|
|
297
288
|
_: 1
|
|
298
|
-
})) :
|
|
299
|
-
f.value ? (m(), p(F(f.value.component),
|
|
300
|
-
s(l(
|
|
289
|
+
})) : L("", !0),
|
|
290
|
+
f.value ? (m(), p(F(f.value.component), le($({ key: 1 }, f.value.props)), null, 16)) : L("", !0),
|
|
291
|
+
s(l(K), { class: "justify-end" }, {
|
|
301
292
|
default: d(() => [
|
|
302
|
-
(m(!0),
|
|
303
|
-
key:
|
|
293
|
+
(m(!0), O(M, null, Z(v.data.additionalCta ?? [], (D, h) => (m(), p(l(A), {
|
|
294
|
+
key: h,
|
|
304
295
|
color: "primary",
|
|
305
296
|
variant: "text",
|
|
306
|
-
onClick: () => D
|
|
297
|
+
onClick: () => V(D)
|
|
307
298
|
}, {
|
|
308
299
|
default: d(() => [
|
|
309
300
|
s(C, {
|
|
310
|
-
translate:
|
|
311
|
-
content:
|
|
301
|
+
translate: D.translateText,
|
|
302
|
+
content: D.text
|
|
312
303
|
}, null, 8, ["translate", "content"])
|
|
313
304
|
]),
|
|
314
305
|
_: 2
|
|
@@ -317,7 +308,7 @@ const $e = /* @__PURE__ */ k({
|
|
|
317
308
|
key: 0,
|
|
318
309
|
color: "primary",
|
|
319
310
|
variant: "elevated",
|
|
320
|
-
onClick:
|
|
311
|
+
onClick: k
|
|
321
312
|
}, {
|
|
322
313
|
default: d(() => [
|
|
323
314
|
s(C, {
|
|
@@ -326,7 +317,7 @@ const $e = /* @__PURE__ */ k({
|
|
|
326
317
|
}, null, 8, ["translate", "content"])
|
|
327
318
|
]),
|
|
328
319
|
_: 1
|
|
329
|
-
})) :
|
|
320
|
+
})) : L("", !0)
|
|
330
321
|
]),
|
|
331
322
|
_: 1
|
|
332
323
|
})
|
|
@@ -337,16 +328,16 @@ const $e = /* @__PURE__ */ k({
|
|
|
337
328
|
_: 1
|
|
338
329
|
}, 8, ["modelValue", "max-width"]));
|
|
339
330
|
}
|
|
340
|
-
}),
|
|
341
|
-
var
|
|
342
|
-
function
|
|
331
|
+
}), Ge = /* @__PURE__ */ G($e, [["__scopeId", "data-v-0f8116ef"]]);
|
|
332
|
+
var j = /* @__PURE__ */ ((e) => (e.SMALL = "sm", e.LARGE = "lg", e))(j || {});
|
|
333
|
+
function z(e, a) {
|
|
343
334
|
const r = {
|
|
344
|
-
text:
|
|
335
|
+
text: S().options.i18n.messages[a],
|
|
345
336
|
translateText: !0
|
|
346
337
|
};
|
|
347
|
-
return
|
|
338
|
+
return N(r, e);
|
|
348
339
|
}
|
|
349
|
-
const
|
|
340
|
+
const We = /* @__PURE__ */ E({
|
|
350
341
|
__name: "PromptDialog",
|
|
351
342
|
props: {
|
|
352
343
|
data: {}
|
|
@@ -354,49 +345,49 @@ const Ke = /* @__PURE__ */ k({
|
|
|
354
345
|
emits: ["resolve", "reject"],
|
|
355
346
|
setup(e, { emit: a }) {
|
|
356
347
|
const t = e, r = a, o = {
|
|
357
|
-
[
|
|
358
|
-
[
|
|
359
|
-
}, u =
|
|
348
|
+
[j.SMALL]: 650,
|
|
349
|
+
[j.LARGE]: 1200
|
|
350
|
+
}, u = z(t.data.saveCta, "save"), c = z(t.data.abortCta, "cancel"), n = R(!0), i = R(te(t.data.initialValue) ?? null), f = R(null), { mobile: _ } = me(), V = y(() => t.data.required && !i.value), b = y(() => o[t.data.size ?? j.SMALL]), k = y(() => t.data.size === j.LARGE ? _.value : !1), I = y(() => t.data.size === j.LARGE ? "secondary" : "primary");
|
|
360
351
|
function v() {
|
|
361
352
|
return t.data.props ?? {};
|
|
362
353
|
}
|
|
363
354
|
function T() {
|
|
364
|
-
i.value =
|
|
355
|
+
i.value = te(t.data.initialValue) ?? null, n.value = !1;
|
|
365
356
|
}
|
|
366
|
-
function
|
|
357
|
+
function D() {
|
|
367
358
|
n.value = !1;
|
|
368
359
|
}
|
|
369
|
-
function
|
|
360
|
+
function h() {
|
|
370
361
|
if (t.data.required && !i.value) {
|
|
371
362
|
r("reject");
|
|
372
363
|
return;
|
|
373
364
|
}
|
|
374
365
|
r("resolve", i.value);
|
|
375
366
|
}
|
|
376
|
-
return (
|
|
367
|
+
return (x, U) => (m(), p(l(H), {
|
|
377
368
|
modelValue: n.value,
|
|
378
|
-
"onUpdate:modelValue":
|
|
379
|
-
"max-width":
|
|
380
|
-
fullscreen:
|
|
381
|
-
scrollable:
|
|
382
|
-
onAfterLeave:
|
|
369
|
+
"onUpdate:modelValue": U[1] || (U[1] = (P) => n.value = P),
|
|
370
|
+
"max-width": b.value,
|
|
371
|
+
fullscreen: k.value,
|
|
372
|
+
scrollable: x.data.size === l(j).LARGE,
|
|
373
|
+
onAfterLeave: h
|
|
383
374
|
}, {
|
|
384
375
|
default: d(() => [
|
|
385
|
-
s(l(
|
|
376
|
+
s(l(q), { class: "prompt-dialog-card" }, {
|
|
386
377
|
default: d(() => [
|
|
387
|
-
s(l(
|
|
378
|
+
s(l(se), { color: "primary" }, {
|
|
388
379
|
default: d(() => [
|
|
389
|
-
s(l(
|
|
380
|
+
s(l(ce), null, {
|
|
390
381
|
default: d(() => [
|
|
391
382
|
s(C, {
|
|
392
|
-
translate:
|
|
393
|
-
content:
|
|
383
|
+
translate: x.data.translateTitle,
|
|
384
|
+
content: x.data.title
|
|
394
385
|
}, null, 8, ["translate", "content"])
|
|
395
386
|
]),
|
|
396
387
|
_: 1
|
|
397
388
|
}),
|
|
398
389
|
s(l(B)),
|
|
399
|
-
|
|
390
|
+
Q("div", {
|
|
400
391
|
ref_key: "toolbar",
|
|
401
392
|
ref: f,
|
|
402
393
|
class: "prompt-dialog-toolbar-slot"
|
|
@@ -408,17 +399,17 @@ const Ke = /* @__PURE__ */ k({
|
|
|
408
399
|
]),
|
|
409
400
|
_: 1
|
|
410
401
|
}),
|
|
411
|
-
f.value ? (m(), p(F(
|
|
402
|
+
f.value ? (m(), p(F(x.data.component), $({ key: 0 }, v(), {
|
|
412
403
|
modelValue: i.value,
|
|
413
|
-
"onUpdate:modelValue":
|
|
404
|
+
"onUpdate:modelValue": U[0] || (U[0] = (P) => i.value = P),
|
|
414
405
|
toolbar: f.value
|
|
415
|
-
}), null, 16, ["modelValue", "toolbar"])) :
|
|
416
|
-
s(l(
|
|
417
|
-
s(l(
|
|
406
|
+
}), null, 16, ["modelValue", "toolbar"])) : L("", !0),
|
|
407
|
+
s(l(ie)),
|
|
408
|
+
s(l(K), null, {
|
|
418
409
|
default: d(() => [
|
|
419
410
|
s(l(B)),
|
|
420
411
|
s(l(A), {
|
|
421
|
-
color:
|
|
412
|
+
color: I.value,
|
|
422
413
|
onClick: T
|
|
423
414
|
}, {
|
|
424
415
|
default: d(() => [
|
|
@@ -431,9 +422,9 @@ const Ke = /* @__PURE__ */ k({
|
|
|
431
422
|
}, 8, ["color"]),
|
|
432
423
|
s(l(A), {
|
|
433
424
|
variant: "elevated",
|
|
434
|
-
color:
|
|
435
|
-
disabled:
|
|
436
|
-
onClick:
|
|
425
|
+
color: I.value,
|
|
426
|
+
disabled: V.value,
|
|
427
|
+
onClick: D
|
|
437
428
|
}, {
|
|
438
429
|
default: d(() => [
|
|
439
430
|
s(C, {
|
|
@@ -453,14 +444,14 @@ const Ke = /* @__PURE__ */ k({
|
|
|
453
444
|
_: 1
|
|
454
445
|
}, 8, ["modelValue", "max-width", "fullscreen", "scrollable"]));
|
|
455
446
|
}
|
|
456
|
-
}),
|
|
447
|
+
}), Be = /* @__PURE__ */ G(We, [["__scopeId", "data-v-6cec23a5"]]), ze = { class: "d-flex justify-space-between pr-2 py-2" }, He = 550, qe = /* @__PURE__ */ E({
|
|
457
448
|
__name: "ConfirmDialog",
|
|
458
449
|
props: {
|
|
459
450
|
data: {}
|
|
460
451
|
},
|
|
461
452
|
emits: ["resolve", "reject"],
|
|
462
453
|
setup(e, { emit: a }) {
|
|
463
|
-
const t = e, r = a, { options: { i18n: { messages: { yes: o, no: u } } } } =
|
|
454
|
+
const t = e, r = a, { options: { i18n: { messages: { yes: o, no: u } } } } = S(), c = {
|
|
464
455
|
text: o,
|
|
465
456
|
translateText: !0
|
|
466
457
|
}, n = {
|
|
@@ -468,54 +459,54 @@ const Ke = /* @__PURE__ */ k({
|
|
|
468
459
|
translateText: !0
|
|
469
460
|
};
|
|
470
461
|
let i = !1;
|
|
471
|
-
const f =
|
|
462
|
+
const f = R(!0), _ = y(() => Object.hasOwn(t.data, "content") ? {
|
|
472
463
|
content: t.data.content,
|
|
473
464
|
translateContent: t.data.translateContent
|
|
474
|
-
} : null),
|
|
465
|
+
} : null), V = y(() => Object.hasOwn(t.data, "component") ? {
|
|
475
466
|
component: t.data.component,
|
|
476
467
|
props: t.data.props
|
|
477
|
-
} : null),
|
|
468
|
+
} : null), b = y(() => N({}, c, t.data.confirmCta)), k = y(() => N({}, n, t.data.rejectCta)), I = y(() => t.data.highlightCta ?? "confirm"), v = y(() => t.data.level ?? "primary");
|
|
478
469
|
function T() {
|
|
479
470
|
f.value = !1;
|
|
480
471
|
}
|
|
481
|
-
function
|
|
472
|
+
function D() {
|
|
482
473
|
i = !0, f.value = !1;
|
|
483
474
|
}
|
|
484
|
-
function
|
|
475
|
+
function h() {
|
|
485
476
|
if (t.data.throwOnReject && !i) {
|
|
486
477
|
r("reject");
|
|
487
478
|
return;
|
|
488
479
|
}
|
|
489
480
|
r("resolve", i);
|
|
490
481
|
}
|
|
491
|
-
return (
|
|
482
|
+
return (x, U) => (m(), p(l(H), {
|
|
492
483
|
modelValue: f.value,
|
|
493
|
-
"onUpdate:modelValue":
|
|
494
|
-
persistent: !!
|
|
495
|
-
"max-width":
|
|
496
|
-
onAfterLeave:
|
|
484
|
+
"onUpdate:modelValue": U[0] || (U[0] = (P) => f.value = P),
|
|
485
|
+
persistent: !!x.data.permanent,
|
|
486
|
+
"max-width": x.data.maxWidth ?? He,
|
|
487
|
+
onAfterLeave: h
|
|
497
488
|
}, {
|
|
498
489
|
default: d(() => [
|
|
499
|
-
s(l(
|
|
490
|
+
s(l(q), { class: "confirm-dialog-card" }, {
|
|
500
491
|
default: d(() => [
|
|
501
|
-
|
|
502
|
-
s(l(
|
|
492
|
+
Q("div", ze, [
|
|
493
|
+
s(l(re), null, {
|
|
503
494
|
default: d(() => [
|
|
504
495
|
s(C, {
|
|
505
|
-
translate:
|
|
506
|
-
content:
|
|
496
|
+
translate: x.data.translateTitle,
|
|
497
|
+
content: x.data.title
|
|
507
498
|
}, null, 8, ["translate", "content"])
|
|
508
499
|
]),
|
|
509
500
|
_: 1
|
|
510
501
|
}),
|
|
511
|
-
|
|
502
|
+
x.data.permanent ? L("", !0) : (m(), p(l(A), {
|
|
512
503
|
key: 0,
|
|
513
504
|
icon: "$close",
|
|
514
505
|
variant: "text",
|
|
515
506
|
onClick: T
|
|
516
507
|
}))
|
|
517
508
|
]),
|
|
518
|
-
_.value ? (m(), p(l(
|
|
509
|
+
_.value ? (m(), p(l(ue), { key: 0 }, {
|
|
519
510
|
default: d(() => [
|
|
520
511
|
s(C, {
|
|
521
512
|
translate: _.value.translateContent,
|
|
@@ -523,35 +514,35 @@ const Ke = /* @__PURE__ */ k({
|
|
|
523
514
|
}, null, 8, ["translate", "content"])
|
|
524
515
|
]),
|
|
525
516
|
_: 1
|
|
526
|
-
})) :
|
|
527
|
-
|
|
528
|
-
s(l(
|
|
517
|
+
})) : L("", !0),
|
|
518
|
+
V.value ? (m(), p(F(V.value.component), le($({ key: 1 }, V.value.props)), null, 16)) : L("", !0),
|
|
519
|
+
s(l(K), { class: "justify-end" }, {
|
|
529
520
|
default: d(() => [
|
|
530
|
-
|
|
531
|
-
class:
|
|
521
|
+
Q("div", {
|
|
522
|
+
class: oe(["d-flex align-center", I.value === "confirm" ? "" : "flex-row-reverse"])
|
|
532
523
|
}, [
|
|
533
524
|
s(l(A), {
|
|
534
|
-
variant:
|
|
525
|
+
variant: I.value === "reject" ? "elevated" : "text",
|
|
535
526
|
color: v.value,
|
|
536
527
|
onClick: T
|
|
537
528
|
}, {
|
|
538
529
|
default: d(() => [
|
|
539
530
|
s(C, {
|
|
540
|
-
translate:
|
|
541
|
-
content:
|
|
531
|
+
translate: k.value.translateText,
|
|
532
|
+
content: k.value.text
|
|
542
533
|
}, null, 8, ["translate", "content"])
|
|
543
534
|
]),
|
|
544
535
|
_: 1
|
|
545
536
|
}, 8, ["variant", "color"]),
|
|
546
537
|
s(l(A), {
|
|
547
|
-
variant:
|
|
538
|
+
variant: I.value === "confirm" ? "elevated" : "text",
|
|
548
539
|
color: v.value,
|
|
549
|
-
onClick:
|
|
540
|
+
onClick: D
|
|
550
541
|
}, {
|
|
551
542
|
default: d(() => [
|
|
552
543
|
s(C, {
|
|
553
|
-
translate:
|
|
554
|
-
content:
|
|
544
|
+
translate: b.value.translateText,
|
|
545
|
+
content: b.value.text
|
|
555
546
|
}, null, 8, ["translate", "content"])
|
|
556
547
|
]),
|
|
557
548
|
_: 1
|
|
@@ -567,22 +558,22 @@ const Ke = /* @__PURE__ */ k({
|
|
|
567
558
|
_: 1
|
|
568
559
|
}, 8, ["modelValue", "persistent", "max-width"]));
|
|
569
560
|
}
|
|
570
|
-
}),
|
|
571
|
-
function
|
|
561
|
+
}), Ke = /* @__PURE__ */ G(qe, [["__scopeId", "data-v-3e8b3358"]]);
|
|
562
|
+
function Ye(e) {
|
|
572
563
|
return e ? new Promise((a) => {
|
|
573
564
|
setTimeout(() => {
|
|
574
565
|
a();
|
|
575
566
|
}, e);
|
|
576
567
|
}) : Promise.resolve();
|
|
577
568
|
}
|
|
578
|
-
function
|
|
579
|
-
const { options: { loading: { delay: t, overlay: r } } } =
|
|
569
|
+
function Xe(e, a = {}) {
|
|
570
|
+
const { options: { loading: { delay: t, overlay: r } } } = S(), o = R(!1), u = pe();
|
|
580
571
|
async function c(...n) {
|
|
581
572
|
o.value = !0, r && (u.value = !0);
|
|
582
573
|
try {
|
|
583
574
|
const [i] = await Promise.all([
|
|
584
575
|
e(...n),
|
|
585
|
-
|
|
576
|
+
Ye(t)
|
|
586
577
|
]);
|
|
587
578
|
return i;
|
|
588
579
|
} catch (i) {
|
|
@@ -591,60 +582,60 @@ function et(e, a = {}) {
|
|
|
591
582
|
o.value = !1, r && (u.value = !1);
|
|
592
583
|
}
|
|
593
584
|
}
|
|
594
|
-
return { loading:
|
|
585
|
+
return { loading: X(o), action: c };
|
|
595
586
|
}
|
|
596
|
-
const
|
|
587
|
+
const Ze = /* @__PURE__ */ E({
|
|
597
588
|
__name: "FormDialog",
|
|
598
589
|
props: {
|
|
599
590
|
data: {}
|
|
600
591
|
},
|
|
601
592
|
emits: ["resolve", "reject"],
|
|
602
593
|
setup(e, { emit: a }) {
|
|
603
|
-
const t = e, r = a, o =
|
|
594
|
+
const t = e, r = a, o = z(t.data.saveCta, "save"), u = z(t.data.abortCta, "cancel"), c = Te("formComponent"), n = R(!0), i = Ae(), { loading: f, action: _ } = Xe(v), V = y(() => ({
|
|
604
595
|
global: {
|
|
605
596
|
disabled: f.value
|
|
606
597
|
}
|
|
607
598
|
}));
|
|
608
|
-
let
|
|
609
|
-
function
|
|
599
|
+
let b = null;
|
|
600
|
+
function k() {
|
|
610
601
|
return t.data.props ?? {};
|
|
611
602
|
}
|
|
612
|
-
async function
|
|
603
|
+
async function I() {
|
|
613
604
|
await i.value.$validate() && await _();
|
|
614
605
|
}
|
|
615
606
|
async function v() {
|
|
616
607
|
if (!c.value)
|
|
617
608
|
throw new Error("Form component not mounted");
|
|
618
|
-
const
|
|
619
|
-
typeof t.data.action == "function" ?
|
|
609
|
+
const h = await c.value.finish();
|
|
610
|
+
typeof t.data.action == "function" ? b = await t.data.action(h) : b = h;
|
|
620
611
|
}
|
|
621
612
|
function T() {
|
|
622
613
|
n.value = !1;
|
|
623
614
|
}
|
|
624
|
-
function
|
|
625
|
-
if (t.data.rejectOnEmpty &&
|
|
615
|
+
function D() {
|
|
616
|
+
if (t.data.rejectOnEmpty && b === null) {
|
|
626
617
|
r("reject");
|
|
627
618
|
return;
|
|
628
619
|
}
|
|
629
|
-
r("resolve",
|
|
620
|
+
r("resolve", b);
|
|
630
621
|
}
|
|
631
|
-
return (
|
|
622
|
+
return (h, x) => (m(), p(l(H), {
|
|
632
623
|
modelValue: n.value,
|
|
633
|
-
"onUpdate:modelValue":
|
|
634
|
-
onAfterLeave:
|
|
624
|
+
"onUpdate:modelValue": x[0] || (x[0] = (U) => n.value = U),
|
|
625
|
+
onAfterLeave: D,
|
|
635
626
|
"max-width": "1200",
|
|
636
627
|
scrollable: ""
|
|
637
628
|
}, {
|
|
638
629
|
default: d(() => [
|
|
639
|
-
s(l(
|
|
630
|
+
s(l(q), null, {
|
|
640
631
|
default: d(() => [
|
|
641
|
-
s(l(
|
|
632
|
+
s(l(se), { color: "primary" }, {
|
|
642
633
|
default: d(() => [
|
|
643
|
-
s(l(
|
|
634
|
+
s(l(ce), null, {
|
|
644
635
|
default: d(() => [
|
|
645
636
|
s(C, {
|
|
646
|
-
content:
|
|
647
|
-
translate: !!
|
|
637
|
+
content: h.data.title,
|
|
638
|
+
translate: !!h.data.translateTitle
|
|
648
639
|
}, null, 8, ["content", "translate"])
|
|
649
640
|
]),
|
|
650
641
|
_: 1
|
|
@@ -657,18 +648,18 @@ const tt = /* @__PURE__ */ k({
|
|
|
657
648
|
]),
|
|
658
649
|
_: 1
|
|
659
650
|
}),
|
|
660
|
-
s(l(he), { defaults:
|
|
651
|
+
s(l(he), { defaults: V.value }, {
|
|
661
652
|
default: d(() => [
|
|
662
|
-
(m(), p(F(
|
|
653
|
+
(m(), p(F(h.data.component), $({
|
|
663
654
|
ref_key: "formComponent",
|
|
664
655
|
ref: c,
|
|
665
|
-
onSave:
|
|
666
|
-
},
|
|
656
|
+
onSave: I
|
|
657
|
+
}, k()), null, 16))
|
|
667
658
|
]),
|
|
668
659
|
_: 1
|
|
669
660
|
}, 8, ["defaults"]),
|
|
670
|
-
s(l(
|
|
671
|
-
s(l(
|
|
661
|
+
s(l(ie)),
|
|
662
|
+
s(l(K), null, {
|
|
672
663
|
default: d(() => [
|
|
673
664
|
s(l(B)),
|
|
674
665
|
s(l(A), {
|
|
@@ -684,7 +675,7 @@ const tt = /* @__PURE__ */ k({
|
|
|
684
675
|
_: 1
|
|
685
676
|
}),
|
|
686
677
|
s(l(A), {
|
|
687
|
-
onClick:
|
|
678
|
+
onClick: I,
|
|
688
679
|
variant: "elevated",
|
|
689
680
|
color: "primary"
|
|
690
681
|
}, {
|
|
@@ -707,8 +698,8 @@ const tt = /* @__PURE__ */ k({
|
|
|
707
698
|
}, 8, ["modelValue"]));
|
|
708
699
|
}
|
|
709
700
|
});
|
|
710
|
-
function
|
|
711
|
-
const e =
|
|
701
|
+
function it() {
|
|
702
|
+
const e = ve();
|
|
712
703
|
function a(u, c) {
|
|
713
704
|
let n;
|
|
714
705
|
return typeof u == "string" ? n = {
|
|
@@ -716,7 +707,7 @@ function mt() {
|
|
|
716
707
|
content: c ?? ""
|
|
717
708
|
} : n = u, new Promise((i) => {
|
|
718
709
|
const f = {
|
|
719
|
-
component:
|
|
710
|
+
component: Ge,
|
|
720
711
|
props: { data: n },
|
|
721
712
|
resolve: i,
|
|
722
713
|
reject: () => {
|
|
@@ -729,7 +720,7 @@ function mt() {
|
|
|
729
720
|
function t(u) {
|
|
730
721
|
return new Promise((c, n) => {
|
|
731
722
|
const i = {
|
|
732
|
-
component:
|
|
723
|
+
component: Be,
|
|
733
724
|
props: { data: u },
|
|
734
725
|
resolve: c,
|
|
735
726
|
reject: n
|
|
@@ -744,19 +735,19 @@ function mt() {
|
|
|
744
735
|
content: c,
|
|
745
736
|
level: n
|
|
746
737
|
}), new Promise((f, _) => {
|
|
747
|
-
const
|
|
748
|
-
component:
|
|
738
|
+
const V = {
|
|
739
|
+
component: Ke,
|
|
749
740
|
props: { data: i },
|
|
750
741
|
resolve: f,
|
|
751
742
|
reject: _
|
|
752
743
|
};
|
|
753
|
-
e.addToQueue(
|
|
744
|
+
e.addToQueue(V);
|
|
754
745
|
});
|
|
755
746
|
}
|
|
756
747
|
function o(u) {
|
|
757
748
|
return new Promise((c, n) => {
|
|
758
749
|
const i = {
|
|
759
|
-
component:
|
|
750
|
+
component: Ze,
|
|
760
751
|
props: { data: u },
|
|
761
752
|
resolve: c,
|
|
762
753
|
reject: n
|
|
@@ -771,9 +762,9 @@ function mt() {
|
|
|
771
762
|
form: o
|
|
772
763
|
};
|
|
773
764
|
}
|
|
774
|
-
var
|
|
775
|
-
function
|
|
776
|
-
const e =
|
|
765
|
+
var Je = /* @__PURE__ */ ((e) => (e.DEFAULT = "primary", e.WARNING = "warning", e.DANGER = "error", e))(Je || {});
|
|
766
|
+
function dt() {
|
|
767
|
+
const e = J(), { options: { toast: { timeout: a } } } = S();
|
|
777
768
|
function t(c, n) {
|
|
778
769
|
return new Promise((i) => {
|
|
779
770
|
e.addToQueue({
|
|
@@ -781,7 +772,7 @@ function ft() {
|
|
|
781
772
|
resolve: i,
|
|
782
773
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
783
774
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
784
|
-
type:
|
|
775
|
+
type: w.INFO
|
|
785
776
|
});
|
|
786
777
|
});
|
|
787
778
|
}
|
|
@@ -792,7 +783,7 @@ function ft() {
|
|
|
792
783
|
resolve: i,
|
|
793
784
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
794
785
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
795
|
-
type:
|
|
786
|
+
type: w.WARNING
|
|
796
787
|
});
|
|
797
788
|
});
|
|
798
789
|
}
|
|
@@ -803,7 +794,7 @@ function ft() {
|
|
|
803
794
|
resolve: i,
|
|
804
795
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
805
796
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
806
|
-
type:
|
|
797
|
+
type: w.ERROR
|
|
807
798
|
});
|
|
808
799
|
});
|
|
809
800
|
}
|
|
@@ -814,7 +805,7 @@ function ft() {
|
|
|
814
805
|
resolve: i,
|
|
815
806
|
timeout: (n == null ? void 0 : n.timeout) ?? a,
|
|
816
807
|
translateMessage: (n == null ? void 0 : n.translateMessage) ?? !0,
|
|
817
|
-
type:
|
|
808
|
+
type: w.SUCCESS
|
|
818
809
|
});
|
|
819
810
|
});
|
|
820
811
|
}
|
|
@@ -825,7 +816,7 @@ function ft() {
|
|
|
825
816
|
success: u
|
|
826
817
|
};
|
|
827
818
|
}
|
|
828
|
-
const
|
|
819
|
+
const et = () => ({
|
|
829
820
|
loading: {
|
|
830
821
|
delay: 2e3,
|
|
831
822
|
overlay: !1
|
|
@@ -840,30 +831,34 @@ const at = () => ({
|
|
|
840
831
|
cancel: "action.cancel",
|
|
841
832
|
close: "action.close",
|
|
842
833
|
save: "action.save"
|
|
834
|
+
},
|
|
835
|
+
validation: {
|
|
836
|
+
prefix: "validation",
|
|
837
|
+
transform: "none"
|
|
843
838
|
}
|
|
844
839
|
}
|
|
845
840
|
});
|
|
846
|
-
function
|
|
847
|
-
const a =
|
|
841
|
+
function tt(e) {
|
|
842
|
+
const a = R([]), t = R([]);
|
|
848
843
|
return {
|
|
849
844
|
dialogQueue: a,
|
|
850
845
|
toastQueue: t,
|
|
851
846
|
options: e
|
|
852
847
|
};
|
|
853
848
|
}
|
|
854
|
-
function
|
|
849
|
+
function mt(e) {
|
|
855
850
|
return (a) => {
|
|
856
|
-
const t =
|
|
851
|
+
const t = et(), r = N(t, e), o = tt(r);
|
|
857
852
|
a.__SCHWARZDAVID_UIKIT_SYMBOL__ = Symbol("@schwarzdavid/ui-kit"), a.provide(a.__SCHWARZDAVID_UIKIT_SYMBOL__, o);
|
|
858
853
|
};
|
|
859
854
|
}
|
|
860
855
|
export {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
856
|
+
Je as ConfirmDialogLevel,
|
|
857
|
+
j as PromptDialogSize,
|
|
858
|
+
ct as UiKitOutlet,
|
|
859
|
+
mt as createUIKit,
|
|
860
|
+
it as useDialog,
|
|
861
|
+
Xe as useLoading,
|
|
862
|
+
pe as useLoadingOverlay,
|
|
863
|
+
dt as useToast
|
|
869
864
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getCurrentInstance as r, inject as _ } from "vue";
|
|
2
|
+
var e = /* @__PURE__ */ ((t) => (t.NOT_INSTALLED = "Need to install with `app.use` function", t.UNEXPECTED_ERROR = "Unexpected error", t))(e || {});
|
|
3
|
+
function E() {
|
|
4
|
+
const t = r();
|
|
5
|
+
if (!(t != null && t.appContext.app.__SCHWARZDAVID_UIKIT_SYMBOL__))
|
|
6
|
+
throw new Error(e.NOT_INSTALLED);
|
|
7
|
+
const o = t.appContext.app.__SCHWARZDAVID_UIKIT_SYMBOL__, n = _(o);
|
|
8
|
+
if (!n)
|
|
9
|
+
throw new Error(e.UNEXPECTED_ERROR);
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
E as u
|
|
14
|
+
};
|
package/dist/validators.js
CHANGED
|
@@ -1,56 +1,77 @@
|
|
|
1
1
|
import * as r from "@vuelidate/validators";
|
|
2
2
|
import { helpers as o } from "@vuelidate/validators";
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import {
|
|
3
|
+
import { useI18n as m } from "vue-i18n";
|
|
4
|
+
import { u as l } from "./usePluginContext-CyxsFQjN.js";
|
|
5
|
+
import { upperFirst as f, camelCase as a, snakeCase as p, kebabCase as h } from "lodash";
|
|
6
|
+
import { computed as d, unref as g } from "vue";
|
|
5
7
|
const n = r.createI18nMessage({
|
|
6
8
|
t: (...e) => {
|
|
7
|
-
const { t } =
|
|
9
|
+
const { t } = m({ useScope: "global" });
|
|
8
10
|
return t(...e);
|
|
9
11
|
},
|
|
10
12
|
messagePath(e) {
|
|
11
|
-
|
|
13
|
+
const { options: { i18n: { validation: t } } } = l();
|
|
14
|
+
if (typeof t == "function")
|
|
15
|
+
return t(e.$validator);
|
|
16
|
+
const s = w(e.$validator, t.transform);
|
|
17
|
+
return `${t.prefix}.${s}`;
|
|
12
18
|
}
|
|
13
|
-
})
|
|
19
|
+
});
|
|
20
|
+
function w(e, t) {
|
|
21
|
+
switch (t) {
|
|
22
|
+
case "camelCase":
|
|
23
|
+
return a(e);
|
|
24
|
+
case "kebab-case":
|
|
25
|
+
return h(e);
|
|
26
|
+
case "snake_case":
|
|
27
|
+
return p(e);
|
|
28
|
+
case "PascalCase":
|
|
29
|
+
return f(a(e));
|
|
30
|
+
default:
|
|
31
|
+
return e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const C = n(r.required), y = n(r.requiredIf, { withArguments: !0 }), I = n(r.requiredUnless, { withArguments: !0 }), L = n(r.minLength, { withArguments: !0 }), P = n(r.maxLength, { withArguments: !0 }), E = n(r.minValue, { withArguments: !0 }), N = n(r.maxValue, { withArguments: !0 }), U = n(r.between, { withArguments: !0 }), W = n(r.alpha), B = n(r.alphaNum), M = n(r.numeric), T = n(r.integer), F = n(r.decimal), R = n(r.email), S = n(r.ipAddress), _ = n(r.macAddress), k = n(r.sameAs, { withArguments: !0 }), z = n(r.url), D = n((e) => o.withParams({
|
|
14
35
|
type: "oneOf",
|
|
15
36
|
values: e
|
|
16
37
|
}, (t) => {
|
|
17
38
|
const s = Array.isArray(e) ? e : Object.values(e);
|
|
18
39
|
return !o.req(t) || s.includes(t);
|
|
19
|
-
}), { withArguments: !0 }),
|
|
40
|
+
}), { withArguments: !0 }), G = (e) => d(() => i(e.value));
|
|
20
41
|
function i(e) {
|
|
21
|
-
return Object.entries(e).map(([t, s]) => t.startsWith("$") ? [t, null] :
|
|
42
|
+
return Object.entries(e).map(([t, s]) => t.startsWith("$") ? [t, null] : A(s) ? [t, V(s)] : b(s) ? [t, i(s)] : (console.warn("Unknown validation type.", t, s), [t, null])).reduce((t, [s, u]) => (u && (t[s] = u), t), {});
|
|
22
43
|
}
|
|
23
|
-
function
|
|
44
|
+
function A(e) {
|
|
24
45
|
return typeof e != "object" || e === null ? !1 : Object.hasOwn(e, "$model") && Object.entries(e).filter(([t]) => !t.startsWith("$")).every(([, t]) => c(t));
|
|
25
46
|
}
|
|
26
|
-
function
|
|
47
|
+
function b(e) {
|
|
27
48
|
return typeof e != "object" || e === null ? !1 : Object.entries(e).filter(([t]) => !t.startsWith("$")).some(([, t]) => !c(t));
|
|
28
49
|
}
|
|
29
50
|
function c(e) {
|
|
30
51
|
return typeof e == "object" && e !== null && Object.hasOwn(e, "$params");
|
|
31
52
|
}
|
|
32
|
-
function
|
|
33
|
-
return e.$errors.map((t) =>
|
|
53
|
+
function V(e) {
|
|
54
|
+
return e.$errors.map((t) => g(t.$message));
|
|
34
55
|
}
|
|
35
56
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
W as alpha,
|
|
58
|
+
B as alphaNum,
|
|
59
|
+
U as between,
|
|
60
|
+
F as decimal,
|
|
61
|
+
R as email,
|
|
62
|
+
T as integer,
|
|
63
|
+
S as ipAddress,
|
|
64
|
+
_ as maxAddress,
|
|
65
|
+
P as maxLength,
|
|
66
|
+
N as maxValue,
|
|
67
|
+
L as minLength,
|
|
68
|
+
E as minValue,
|
|
69
|
+
M as numeric,
|
|
70
|
+
D as oneOf,
|
|
71
|
+
C as required,
|
|
72
|
+
y as requiredIf,
|
|
73
|
+
I as requiredUnless,
|
|
74
|
+
k as sameAs,
|
|
75
|
+
z as url,
|
|
76
|
+
G as useVuelidateErrors
|
|
56
77
|
};
|