@schwarzdavid/ui-kit 0.0.1-alpha.5 → 0.0.1-alpha.7

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