@schwarzdavid/ui-kit 0.0.1-alpha.6 → 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 x, readonly as H, markRaw as le, defineComponent as I, openBlock as m, createElementBlock as L, Fragment as O, renderList as X, unref as s, createBlock as g, resolveDynamicComponent as B, mergeProps as G, computed as p, onMounted as ge, createSlots as _e, withCtx as d, createElementVNode as j, toDisplayString as K, createVNode as i, getCurrentInstance as ye, inject as re, TransitionGroup as Ce, normalizeClass as ue, isRef as Te, createTextVNode as te, createCommentVNode as k, normalizeProps as se, toValue as ne } from "vue";
2
- import { VAlert as be, VIcon as xe, VOverlay as we, VProgressCircular as he, VDialog as Y, VCard as J, VCardTitle as ie, VBtn as V, VCardText as ce, VCardActions as Z, VToolbar as Ae, VToolbarTitle as Ve, VSpacer as ae, VDivider as Ie } from "vuetify/components";
3
- 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 = x([]);
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,161 +81,124 @@ const Le = /* @__PURE__ */ I({
64
81
  onReject: o.reject
65
82
  }), null, 16, ["onResolve", "onReject"]))), 128));
66
83
  }
67
- }), S = x([]);
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 = x(-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
- c();
115
- }, a.entry.timeout);
116
- }), (_, w) => (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), {
117
135
  theme: "dark",
118
136
  class: "toast-entry",
119
137
  closable: "",
120
- "onClick:close": c,
138
+ "onClick:close": f,
121
139
  density: "compact"
122
- }, _e({
140
+ }, Te({
123
141
  default: d(() => [
124
- j("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))
125
143
  ]),
126
144
  _: 2
127
145
  }, [
128
- u.value ? {
146
+ c.value ? {
129
147
  name: "prepend",
130
148
  fn: d(() => [
131
- i(s(xe), {
132
- icon: u.value,
133
- color: r.value
149
+ u(l(Re), {
150
+ icon: c.value,
151
+ color: a.value
134
152
  }, null, 8, ["icon", "color"])
135
153
  ]),
136
154
  key: "0"
137
155
  } : void 0
138
156
  ]), 1024));
139
157
  }
140
- }), $ = (e, t) => {
141
- const n = e.__vccOpts || e;
142
- for (const [a, o] of t)
143
- n[a] = o;
144
- return n;
145
- }, je = /* @__PURE__ */ $(Oe, [["__scopeId", "data-v-4c652270"]]);
146
- function Q() {
147
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
148
- if (Q.cache.has(e)) return Q.cache.get(e);
149
- const t = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
150
- return Q.cache.set(e, t), t;
151
- }
152
- Q.cache = /* @__PURE__ */ new Map();
153
- function Pe(e, t) {
154
- const n = ye();
155
- if (!n)
156
- throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
157
- return n;
158
- }
159
- function Ne() {
160
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
161
- const t = Pe(e).type;
162
- return Q((t == null ? void 0 : t.aliasName) || (t == null ? void 0 : t.name));
163
- }
164
- const Se = Symbol.for("vuetify:display");
165
- function pe() {
166
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne();
167
- const n = re(Se);
168
- if (!n) throw new Error("Could not find Vuetify display injection");
169
- const a = p(() => {
170
- if (e.mobile != null) return e.mobile;
171
- if (!e.mobileBreakpoint) return n.mobile.value;
172
- const l = typeof e.mobileBreakpoint == "number" ? e.mobileBreakpoint : n.thresholds.value[e.mobileBreakpoint];
173
- return n.width.value < l;
174
- }), o = p(() => t ? {
175
- [`${t}--mobile`]: a.value
176
- } : {});
177
- return {
178
- ...n,
179
- displayClasses: o,
180
- mobile: a
181
- };
182
- }
183
- 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({
184
164
  __name: "ToastOutlet",
185
165
  setup(e) {
186
- const { queue: t } = ee(), { mobile: n } = pe(), a = p(() => n.value ? "" : "toast-outlet--desktop");
187
- function o(l) {
188
- const { width: u } = l.getBoundingClientRect();
189
- 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`);
190
170
  }
191
- return (l, u) => (m(), g(Ce, {
171
+ return (s, c) => (m(), y(xe, {
192
172
  name: "fade",
193
173
  tag: "div",
194
- class: ue(["toast-outlet", a.value]),
174
+ class: ce(["toast-outlet", r.value]),
195
175
  onBeforeLeave: o
196
176
  }, {
197
177
  default: d(() => [
198
- (m(!0), L(O, null, X(s(t), (r) => (m(), g(je, {
199
- key: r.id,
200
- entry: r
178
+ (m(!0), U(P, null, te(l(n), (a) => (m(), y(Qe, {
179
+ key: a.id,
180
+ entry: a
201
181
  }, null, 8, ["entry"]))), 128))
202
182
  ]),
203
183
  _: 1
204
184
  }, 8, ["class"]));
205
185
  }
206
- }), $e = /* @__PURE__ */ $(Qe, [["__scopeId", "data-v-ba5c8268"]]), Fe = x(!1);
207
- function fe() {
208
- return Fe;
186
+ }), $e = /* @__PURE__ */ G(Fe, [["__scopeId", "data-v-ba5c8268"]]), We = R(!1);
187
+ function Ce() {
188
+ return We;
209
189
  }
210
- const Me = /* @__PURE__ */ I({
190
+ const qe = /* @__PURE__ */ k({
211
191
  __name: "LoadingOverlay",
212
192
  setup(e) {
213
- const t = fe();
214
- return (n, a) => (m(), g(s(we), {
215
- modelValue: s(t),
216
- "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),
217
197
  persistent: "",
218
198
  class: "d-flex align-center justify-center"
219
199
  }, {
220
200
  default: d(() => [
221
- i(s(he), {
201
+ u(l(Ee), {
222
202
  indeterminate: "",
223
203
  color: "primary",
224
204
  size: "100"
@@ -227,128 +207,128 @@ const Me = /* @__PURE__ */ I({
227
207
  _: 1
228
208
  }, 8, ["modelValue"]));
229
209
  }
230
- }), st = /* @__PURE__ */ I({
210
+ }), pt = /* @__PURE__ */ k({
231
211
  __name: "UiKitOutlet",
232
212
  setup(e) {
233
- return (t, n) => (m(), L(O, null, [
234
- i(Le),
235
- i($e),
236
- i(Me)
213
+ return (n, t) => (m(), U(P, null, [
214
+ u(Me),
215
+ u($e),
216
+ u(qe)
237
217
  ], 64));
238
218
  }
239
- }), T = /* @__PURE__ */ I({
219
+ }), T = /* @__PURE__ */ k({
240
220
  __name: "MaybeTranslation",
241
221
  props: {
242
222
  content: {},
243
223
  translate: { type: Boolean, default: !0 }
244
224
  },
245
225
  setup(e) {
246
- const { t } = Ee({ useScope: "global" });
247
- return (n, a) => n.translate ? (m(), L(O, { key: 0 }, [
248
- te(K(s(t)(n.content)), 1)
249
- ], 64)) : (m(), L(O, { key: 1 }, [
250
- 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)
251
231
  ], 64));
252
232
  }
253
- }), 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({
254
234
  __name: "InfoDialog",
255
235
  props: {
256
236
  data: {}
257
237
  },
258
238
  emits: ["resolve", "reject"],
259
- setup(e, { emit: t }) {
260
- const n = e, a = t, o = {
261
- text: "APP.CLOSE",
239
+ setup(e, { emit: n }) {
240
+ const t = e, r = n, { options: { i18n: { messages: { close: o } } } } = N(), s = {
241
+ text: o,
262
242
  translateText: !0,
263
243
  value: null
264
244
  };
265
- let l = null;
266
- const u = x(!0), r = p(() => Object.hasOwn(n.data, "content") ? {
267
- content: n.data.content,
268
- translateContent: n.data.translateContent
269
- } : null), c = p(() => Object.hasOwn(n.data, "component") ? {
270
- component: n.data.component,
271
- props: n.data.props
272
- } : null), _ = p(() => n.data.defaultCta === !1 ? null : D({}, o, n.data.defaultCta));
273
- function w(f) {
274
- R(f) ? f.action() : h(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);
275
255
  }
276
- function R(f) {
277
- return Object.hasOwn(f, "action");
256
+ function L(p) {
257
+ return Object.hasOwn(p, "action");
278
258
  }
279
- function h(f = null) {
280
- l = f, u.value = !1;
259
+ function b(p = null) {
260
+ c = p, a.value = !1;
281
261
  }
282
- function U() {
283
- a("resolve", l);
262
+ function D() {
263
+ r("resolve", c);
284
264
  }
285
- return (f, A) => (m(), g(s(Y), {
286
- modelValue: u.value,
287
- "onUpdate:modelValue": A[1] || (A[1] = (C) => u.value = C),
288
- "max-width": f.data.width ?? Ge,
289
- 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
290
270
  }, {
291
271
  default: d(() => [
292
- i(s(J), { class: "info-dialog-card" }, {
272
+ u(l(Y), { class: "info-dialog-card" }, {
293
273
  default: d(() => [
294
- j("div", Be, [
295
- i(s(ie), null, {
274
+ F("div", Ge, [
275
+ u(l(de), null, {
296
276
  default: d(() => [
297
- i(T, {
298
- translate: f.data.translateTitle,
299
- content: f.data.title
277
+ u(T, {
278
+ translate: p.data.translateTitle,
279
+ content: p.data.title
300
280
  }, null, 8, ["translate", "content"])
301
281
  ]),
302
282
  _: 1
303
283
  }),
304
- i(s(V), {
284
+ u(l(I), {
305
285
  icon: "$close",
306
286
  variant: "text",
307
- onClick: A[0] || (A[0] = (C) => h(null))
287
+ onClick: g[0] || (g[0] = (h) => b(null))
308
288
  })
309
289
  ]),
310
- r.value ? (m(), g(s(ce), { key: 0 }, {
290
+ i.value ? (m(), y(l(me), { key: 0 }, {
311
291
  default: d(() => [
312
- j("p", null, [
313
- i(T, {
314
- translate: r.value.translateContent,
315
- content: r.value.content
292
+ F("p", null, [
293
+ u(T, {
294
+ translate: i.value.translateContent,
295
+ content: i.value.content
316
296
  }, null, 8, ["translate", "content"])
317
297
  ])
318
298
  ]),
319
299
  _: 1
320
- })) : k("", !0),
321
- c.value ? (m(), g(B(c.value.component), se(G({ key: 1 }, c.value.props)), null, 16)) : k("", !0),
322
- 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" }, {
323
303
  default: d(() => [
324
- (m(!0), L(O, null, X(f.data.additionalCta ?? [], (C, b) => (m(), g(s(V), {
325
- key: b,
304
+ (m(!0), U(P, null, te(p.data.additionalCta ?? [], (h, O) => (m(), y(l(I), {
305
+ key: O,
326
306
  color: "primary",
327
307
  variant: "text",
328
- onClick: () => w(C)
308
+ onClick: () => V(h)
329
309
  }, {
330
310
  default: d(() => [
331
- i(T, {
332
- translate: C.translateText,
333
- content: C.text
311
+ u(T, {
312
+ translate: h.translateText,
313
+ content: h.text
334
314
  }, null, 8, ["translate", "content"])
335
315
  ]),
336
316
  _: 2
337
317
  }, 1032, ["onClick"]))), 128)),
338
- _.value ? (m(), g(s(V), {
318
+ C.value ? (m(), y(l(I), {
339
319
  key: 0,
340
320
  color: "primary",
341
321
  variant: "elevated",
342
- onClick: h
322
+ onClick: b
343
323
  }, {
344
324
  default: d(() => [
345
- i(T, {
346
- translate: _.value.translateText,
347
- content: _.value.text
325
+ u(T, {
326
+ translate: C.value.translateText,
327
+ content: C.value.text
348
328
  }, null, 8, ["translate", "content"])
349
329
  ]),
350
330
  _: 1
351
- })) : k("", !0)
331
+ })) : j("", !0)
352
332
  ]),
353
333
  _: 1
354
334
  })
@@ -359,104 +339,108 @@ const Me = /* @__PURE__ */ I({
359
339
  _: 1
360
340
  }, 8, ["modelValue", "max-width"]));
361
341
  }
362
- }), ze = /* @__PURE__ */ $(We, [["__scopeId", "data-v-48bbcd24"]]);
363
- var E = /* @__PURE__ */ ((e) => (e.SMALL = "sm", e.LARGE = "lg", e))(E || {});
364
- 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({
365
352
  __name: "PromptDialog",
366
353
  props: {
367
354
  data: {}
368
355
  },
369
356
  emits: ["resolve", "reject"],
370
- setup(e, { emit: t }) {
371
- const n = e, a = t, o = {
372
- [E.SMALL]: 650,
373
- [E.LARGE]: 1200
374
- }, l = {
375
- text: "APP.CANCEL",
376
- translateText: !0
377
- }, u = {
378
- text: "APP.SAVE",
379
- translateText: !0
380
- }, r = x(!0), c = x(ne(n.data.initialValue) ?? null), _ = x(null), { mobile: w } = pe(), R = p(() => n.data.required && !c.value), h = p(() => o[n.data.size ?? E.SMALL]), U = p(() => n.data.size === E.LARGE ? w.value : !1), f = p(() => D({}, l, n.data.abortCta)), A = p(() => D({}, u, n.data.saveCta)), C = p(() => n.data.size === E.LARGE ? "secondary" : "primary");
381
- function b() {
382
- 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;
383
367
  }
384
- function F() {
385
- r.value = !1;
368
+ function h() {
369
+ a.value = !1;
386
370
  }
387
- function W() {
388
- if (n.data.required && !c.value) {
389
- a("reject");
371
+ function O() {
372
+ if (t.data.required && !i.value) {
373
+ r("reject");
390
374
  return;
391
375
  }
392
- a("resolve", c.value);
376
+ r("resolve", i.value);
393
377
  }
394
- return (P, M) => (m(), g(s(Y), {
395
- modelValue: r.value,
396
- "onUpdate:modelValue": M[1] || (M[1] = (z) => r.value = z),
397
- "max-width": h.value,
398
- fullscreen: U.value,
399
- scrollable: P.data.size === s(E).LARGE,
400
- 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
401
385
  }, {
402
386
  default: d(() => [
403
- i(s(J), { class: "prompt-dialog-card" }, {
387
+ u(l(Y), { class: "prompt-dialog-card" }, {
404
388
  default: d(() => [
405
- i(s(Ae), { color: "primary" }, {
389
+ u(l(fe), { color: "primary" }, {
406
390
  default: d(() => [
407
- i(s(Ve), null, {
391
+ u(l(pe), null, {
408
392
  default: d(() => [
409
- i(T, {
410
- translate: P.data.translateTitle,
411
- content: P.data.title
393
+ u(T, {
394
+ translate: E.data.translateTitle,
395
+ content: E.data.title
412
396
  }, null, 8, ["translate", "content"])
413
397
  ]),
414
398
  _: 1
415
399
  }),
416
- i(s(ae)),
417
- j("div", {
400
+ u(l(H)),
401
+ F("div", {
418
402
  ref_key: "toolbar",
419
- ref: _,
403
+ ref: f,
420
404
  class: "prompt-dialog-toolbar-slot"
421
405
  }, null, 512),
422
- i(s(V), {
406
+ u(l(I), {
423
407
  icon: "mdi-close",
424
- onClick: b
408
+ onClick: g
425
409
  })
426
410
  ]),
427
411
  _: 1
428
412
  }),
429
- _.value ? (m(), g(B(P.data.component), G({ key: 0 }, P.data.props, {
430
- modelValue: c.value,
431
- "onUpdate:modelValue": M[0] || (M[0] = (z) => c.value = z),
432
- toolbar: _.value
433
- }), null, 16, ["modelValue", "toolbar"])) : k("", !0),
434
- i(s(Ie)),
435
- 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, {
436
420
  default: d(() => [
437
- i(s(ae)),
438
- i(s(V), {
439
- color: C.value,
440
- onClick: b
421
+ u(l(H)),
422
+ u(l(I), {
423
+ color: D.value,
424
+ onClick: g
441
425
  }, {
442
426
  default: d(() => [
443
- i(T, {
444
- translate: f.value.translateText,
445
- content: f.value.text
427
+ u(T, {
428
+ translate: l(c).translateText,
429
+ content: l(c).text
446
430
  }, null, 8, ["translate", "content"])
447
431
  ]),
448
432
  _: 1
449
433
  }, 8, ["color"]),
450
- i(s(V), {
434
+ u(l(I), {
451
435
  variant: "elevated",
452
- color: C.value,
453
- disabled: R.value,
454
- onClick: F
436
+ color: D.value,
437
+ disabled: V.value,
438
+ onClick: h
455
439
  }, {
456
440
  default: d(() => [
457
- i(T, {
458
- translate: A.value.translateText,
459
- content: A.value.text
441
+ u(T, {
442
+ translate: l(s).translateText,
443
+ content: l(s).text
460
444
  }, null, 8, ["translate", "content"])
461
445
  ]),
462
446
  _: 1
@@ -471,105 +455,105 @@ const qe = /* @__PURE__ */ I({
471
455
  _: 1
472
456
  }, 8, ["modelValue", "max-width", "fullscreen", "scrollable"]));
473
457
  }
474
- }), 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({
475
459
  __name: "ConfirmDialog",
476
460
  props: {
477
461
  data: {}
478
462
  },
479
463
  emits: ["resolve", "reject"],
480
- setup(e, { emit: t }) {
481
- const n = e, a = t, o = {
482
- 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,
483
467
  translateText: !0
484
- }, l = {
485
- text: "common.no",
468
+ }, a = {
469
+ text: s,
486
470
  translateText: !0
487
471
  };
488
- let u = !1;
489
- const r = x(!0), c = p(() => Object.hasOwn(n.data, "content") ? {
490
- content: n.data.content,
491
- translateContent: n.data.translateContent
492
- } : null), _ = p(() => Object.hasOwn(n.data, "component") ? {
493
- component: n.data.component,
494
- props: n.data.props
495
- } : null), w = p(() => D({}, o, n.data.confirmCta)), R = p(() => D({}, l, n.data.rejectCta)), h = p(() => n.data.highlightCta ?? "confirm"), U = p(() => n.data.level ?? "primary");
496
- function f() {
497
- 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;
498
482
  }
499
- function A() {
500
- u = !0, r.value = !1;
483
+ function h() {
484
+ i = !0, f.value = !1;
501
485
  }
502
- function C() {
503
- if (n.data.throwOnReject && !u) {
504
- a("reject");
486
+ function O() {
487
+ if (t.data.throwOnReject && !i) {
488
+ r("reject");
505
489
  return;
506
490
  }
507
- a("resolve", u);
491
+ r("resolve", i);
508
492
  }
509
- return (b, F) => (m(), g(s(Y), {
510
- modelValue: r.value,
511
- "onUpdate:modelValue": F[0] || (F[0] = (W) => r.value = W),
512
- persistent: !!b.data.permanent,
513
- "max-width": b.data.maxWidth ?? Xe,
514
- 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
515
499
  }, {
516
500
  default: d(() => [
517
- i(s(J), { class: "confirm-dialog-card" }, {
501
+ u(l(Y), { class: "confirm-dialog-card" }, {
518
502
  default: d(() => [
519
- j("div", He, [
520
- i(s(ie), null, {
503
+ F("div", Xe, [
504
+ u(l(de), null, {
521
505
  default: d(() => [
522
- i(T, {
523
- translate: b.data.translateTitle,
524
- content: b.data.title
506
+ u(T, {
507
+ translate: E.data.translateTitle,
508
+ content: E.data.title
525
509
  }, null, 8, ["translate", "content"])
526
510
  ]),
527
511
  _: 1
528
512
  }),
529
- b.data.permanent ? k("", !0) : (m(), g(s(V), {
513
+ E.data.permanent ? j("", !0) : (m(), y(l(I), {
530
514
  key: 0,
531
515
  icon: "$close",
532
516
  variant: "text",
533
- onClick: f
517
+ onClick: g
534
518
  }))
535
519
  ]),
536
- c.value ? (m(), g(s(ce), { key: 0 }, {
520
+ C.value ? (m(), y(l(me), { key: 0 }, {
537
521
  default: d(() => [
538
- i(T, {
539
- translate: c.value.translateContent,
540
- content: c.value.content
522
+ u(T, {
523
+ translate: C.value.translateContent,
524
+ content: C.value.content
541
525
  }, null, 8, ["translate", "content"])
542
526
  ]),
543
527
  _: 1
544
- })) : k("", !0),
545
- _.value ? (m(), g(B(_.value.component), se(G({ key: 1 }, _.value.props)), null, 16)) : k("", !0),
546
- 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" }, {
547
531
  default: d(() => [
548
- j("div", {
549
- class: ue(["d-flex align-center", h.value === "confirm" ? "" : "flex-row-reverse"])
532
+ F("div", {
533
+ class: ce(["d-flex align-center", D.value === "confirm" ? "" : "flex-row-reverse"])
550
534
  }, [
551
- i(s(V), {
552
- variant: h.value === "reject" ? "elevated" : "text",
553
- color: U.value,
554
- onClick: f
535
+ u(l(I), {
536
+ variant: D.value === "reject" ? "elevated" : "text",
537
+ color: p.value,
538
+ onClick: g
555
539
  }, {
556
540
  default: d(() => [
557
- i(T, {
558
- translate: R.value.translateText,
559
- content: R.value.text
541
+ u(T, {
542
+ translate: b.value.translateText,
543
+ content: b.value.text
560
544
  }, null, 8, ["translate", "content"])
561
545
  ]),
562
546
  _: 1
563
547
  }, 8, ["variant", "color"]),
564
- i(s(V), {
565
- variant: h.value === "confirm" ? "elevated" : "text",
566
- color: U.value,
567
- onClick: A
548
+ u(l(I), {
549
+ variant: D.value === "confirm" ? "elevated" : "text",
550
+ color: p.value,
551
+ onClick: h
568
552
  }, {
569
553
  default: d(() => [
570
- i(T, {
571
- translate: w.value.translateText,
572
- content: w.value.text
554
+ u(T, {
555
+ translate: L.value.translateText,
556
+ content: L.value.text
573
557
  }, null, 8, ["translate", "content"])
574
558
  ]),
575
559
  _: 1
@@ -585,188 +569,329 @@ const qe = /* @__PURE__ */ I({
585
569
  _: 1
586
570
  }, 8, ["modelValue", "persistent", "max-width"]));
587
571
  }
588
- }), Je = /* @__PURE__ */ $(Ye, [["__scopeId", "data-v-e571516e"]]);
589
- function it() {
590
- const e = me();
591
- function t(o, l) {
592
- let u;
593
- return typeof o == "string" ? u = {
594
- title: o,
595
- content: l ?? ""
596
- } : u = o, new Promise((r) => {
597
- const c = {
598
- component: ze,
599
- props: { data: u },
600
- 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,
601
717
  reject: () => {
602
- r(null);
718
+ i(null);
603
719
  }
604
720
  };
605
- e.addToQueue(c);
721
+ e.addToQueue(f);
606
722
  });
607
723
  }
608
- function n(o) {
609
- return new Promise((l, u) => {
610
- const r = {
611
- component: Ke,
612
- props: { data: o },
613
- resolve: l,
614
- 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
615
731
  };
616
- e.addToQueue(r);
732
+ e.addToQueue(i);
617
733
  });
618
734
  }
619
- function a(o, l, u) {
620
- let r = o;
621
- return typeof o == "string" && typeof l == "string" && (r = {
622
- title: o,
623
- content: l,
624
- level: u
625
- }), new Promise((c, _) => {
626
- const w = {
627
- component: Je,
628
- props: { data: r },
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
747
+ };
748
+ e.addToQueue(V);
749
+ });
750
+ }
751
+ function o(s) {
752
+ return new Promise((c, a) => {
753
+ const i = {
754
+ component: at,
755
+ props: { data: s },
629
756
  resolve: c,
630
- reject: _
757
+ reject: a
631
758
  };
632
- e.addToQueue(w);
759
+ e.addToQueue(i);
633
760
  });
634
761
  }
635
762
  return {
636
- info: t,
637
- prompt: n,
638
- confirm: a
763
+ info: n,
764
+ prompt: t,
765
+ confirm: r,
766
+ form: o
639
767
  };
640
768
  }
641
- var Ze = /* @__PURE__ */ ((e) => (e.DEFAULT = "primary", e.WARNING = "warning", e.DANGER = "error", e))(Ze || {});
642
- function ct() {
643
- const e = ee();
644
- function t(l, u) {
645
- 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) => {
646
774
  e.addToQueue({
647
- message: l,
648
- resolve: r,
649
- timeout: 4e3,
650
- 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
651
780
  });
652
781
  });
653
782
  }
654
- function n(l, u) {
655
- return new Promise((r) => {
783
+ function r(c, a) {
784
+ return new Promise((i) => {
656
785
  e.addToQueue({
657
- message: l,
658
- resolve: r,
659
- timeout: 4e3,
660
- 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
661
791
  });
662
792
  });
663
793
  }
664
- function a(l, u) {
665
- return new Promise((r) => {
794
+ function o(c, a) {
795
+ return new Promise((i) => {
666
796
  e.addToQueue({
667
- message: l,
668
- resolve: r,
669
- timeout: 4e3,
670
- 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
671
802
  });
672
803
  });
673
804
  }
674
- function o(l, u) {
675
- return new Promise((r) => {
805
+ function s(c, a) {
806
+ return new Promise((i) => {
676
807
  e.addToQueue({
677
- message: l,
678
- resolve: r,
679
- timeout: 4e3,
680
- 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
681
813
  });
682
814
  });
683
815
  }
684
816
  return {
685
817
  info: t,
686
- warn: n,
687
- error: a,
688
- success: o
818
+ warn: r,
819
+ error: o,
820
+ success: s
689
821
  };
690
822
  }
691
- 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 = () => ({
692
838
  loading: {
693
839
  delay: 2e3,
694
840
  overlay: !1
695
841
  },
696
- dialog: {
697
- info: {
698
- defaultCta: {
699
- text: ""
700
- }
701
- },
702
- confirm: {
703
- confirmCta: {
704
- text: ""
705
- },
706
- rejectCta: {
707
- text: ""
708
- }
709
- },
710
- prompt: {
711
- abortCta: {
712
- text: ""
713
- },
714
- saveCta: {
715
- text: ""
716
- }
717
- }
718
- },
719
842
  toast: {
720
843
  timeout: 4e3
721
- }
722
- }), ve = "plugin:@schwarzdavid/ui-kit";
723
- function tt(e, t) {
724
- const n = D(et(), t);
725
- e.provide(ve, n);
726
- }
727
- function nt(e) {
728
- const t = re(ve);
729
- if (!t)
730
- throw new Error("UIKit Plugin not installed");
731
- return D({}, t, e);
732
- }
733
- function at(e) {
734
- return e ? new Promise((t) => {
735
- setTimeout(() => {
736
- t();
737
- }, e);
738
- }) : Promise.resolve();
739
- }
740
- function dt(e, t = {}) {
741
- const { loading: { delay: n, overlay: a } } = nt({ loading: t }), o = x(!1), l = fe();
742
- async function u(...r) {
743
- o.value = !0, a && (l.value = !0);
744
- try {
745
- const [c] = await Promise.all([
746
- e(...r),
747
- at(n)
748
- ]);
749
- return c;
750
- } catch (c) {
751
- throw c;
752
- } finally {
753
- o.value = !1, a && (l.value = !1);
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"
754
852
  }
755
853
  }
756
- 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
+ };
757
862
  }
758
- function mt(e) {
759
- return (t) => {
760
- 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);
761
867
  };
762
868
  }
763
869
  export {
764
- Ze as ConfirmDialogLevel,
765
- E as PromptDialogSize,
766
- st as UiKitOutlet,
767
- mt as createUIKit,
768
- it as useDialog,
769
- dt as useLoading,
770
- fe as useLoadingOverlay,
771
- 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
772
897
  };