@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 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 { getCurrentInstance as ge, inject as ye, readonly as Z, markRaw as oe, defineComponent as k, createElementBlock as U, openBlock as m, Fragment as M, renderList as J, unref as l, createBlock as p, resolveDynamicComponent as F, mergeProps as $, ref as E, computed as y, onMounted as Ce, createSlots as Te, withCtx as d, toDisplayString as G, createVNode as s, TransitionGroup as we, normalizeClass as le, isRef as xe, createTextVNode as te, createElementVNode as N, createCommentVNode as S, normalizeProps as re, toValue as ne, useTemplateRef as De } from "vue";
2
- import { VAlert as Ve, VIcon as Ie, VOverlay as Ae, VProgressCircular as Re, VDialog as K, VCard as z, VCardTitle as ue, VBtn as A, VCardText as se, VCardActions as q, VToolbar as ce, VToolbarTitle as ie, VSpacer as B, VDivider as de, VDefaultsProvider as he } from "vuetify/components";
3
- import { useI18n as me } from "vue-i18n";
4
- import { useDisplay as fe } from "vuetify";
5
- import { merge as Q } from "lodash";
6
- import Ee from "@vuelidate/core";
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 ke = new Uint8Array(16);
15
- function Oe() {
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(ke);
22
+ return Y(Ie);
22
23
  }
23
- const Ue = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ae = { randomUUID: Ue };
24
- function ve(e, a, t) {
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 (ae.randomUUID && !e)
27
- return ae.randomUUID();
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)) ?? Oe();
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
- var X = /* @__PURE__ */ ((e) => (e.NOT_INSTALLED = "Need to install with `app.use` function", e.UNEXPECTED_ERROR = "Unexpected error", e))(X || {});
35
- function j() {
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 = ve(), !e.value.some((u) => u.id === 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 = oe({ ...o, id: u, resolve: (f) => {
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: Z(e),
56
+ queue: X(e),
66
57
  addToQueue: t,
67
58
  removeFromQueue: r
68
59
  };
69
60
  }
70
- const Le = /* @__PURE__ */ k({
61
+ const Ee = /* @__PURE__ */ E({
71
62
  __name: "DialogOutlet",
72
63
  setup(e) {
73
- const { queue: a } = pe();
74
- return (t, r) => (m(!0), U(M, null, J(l(a), (o) => (m(), p(F(o.component), $({
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 ee() {
84
- const { toastQueue: e } = j();
74
+ function J() {
75
+ const { toastQueue: e } = S();
85
76
  function a() {
86
77
  let o;
87
78
  for (; ; )
88
- if (o = ve(), !e.value.some((u) => u.id === 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 = oe({ ...o, id: u, resolve: () => {
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: Z(e),
93
+ queue: X(e),
103
94
  addToQueue: t,
104
95
  removeFromQueue: r
105
96
  };
106
97
  }
107
- var x = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e))(x || {});
108
- const Se = { key: 0 }, je = { key: 1 }, Me = /* @__PURE__ */ k({
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
- [x.ERROR]: "mdi-alert-circle-outline",
116
- [x.SUCCESS]: "mdi-check-circle-outline",
117
- [x.INFO]: "mdi-information-outline",
118
- [x.WARNING]: "mdi-alert-circle-outline"
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
- [x.ERROR]: "error",
121
- [x.SUCCESS]: "success",
122
- [x.INFO]: "primary",
123
- [x.WARNING]: "warning"
124
- }, r = e, o = ee(), u = E(-1), c = y(() => a[r.entry.type]), n = y(() => t[r.entry.type]), { t: i } = me({ useScope: "global" });
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 Ce(() => {
119
+ return _e(() => {
129
120
  u.value = window.setTimeout(() => {
130
121
  f();
131
122
  }, r.entry.timeout);
132
- }), (_, D) => (m(), p(l(Ve), {
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
- }, Te({
129
+ }, ge({
139
130
  default: d(() => [
140
- _.entry.translateMessage ? (m(), U("span", Se, G(l(i)(_.entry.message)), 1)) : (m(), U("span", je, G(_.entry.message), 1))
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(Ie), {
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
- }), W = (e, a) => {
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
- }, Pe = /* @__PURE__ */ W(Me, [["__scopeId", "data-v-7b5e0267"]]), Ne = /* @__PURE__ */ k({
152
+ }, Le = /* @__PURE__ */ G(je, [["__scopeId", "data-v-7b5e0267"]]), Se = /* @__PURE__ */ E({
162
153
  __name: "ToastOutlet",
163
154
  setup(e) {
164
- const { queue: a } = ee(), { mobile: t } = fe(), r = y(() => t.value ? "" : "toast-outlet--desktop");
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(we, {
160
+ return (u, c) => (m(), p(ye, {
170
161
  name: "fade",
171
162
  tag: "div",
172
- class: le(["toast-outlet", r.value]),
163
+ class: oe(["toast-outlet", r.value]),
173
164
  onBeforeLeave: o
174
165
  }, {
175
166
  default: d(() => [
176
- (m(!0), U(M, null, J(l(a), (n) => (m(), p(Pe, {
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
- }), Qe = /* @__PURE__ */ W(Ne, [["__scopeId", "data-v-ba5c8268"]]), Fe = E(!1);
185
- function _e() {
186
- return Fe;
175
+ }), Me = /* @__PURE__ */ G(Se, [["__scopeId", "data-v-ba5c8268"]]), Pe = R(!1);
176
+ function pe() {
177
+ return Pe;
187
178
  }
188
- const $e = /* @__PURE__ */ k({
179
+ const Qe = /* @__PURE__ */ E({
189
180
  __name: "LoadingOverlay",
190
181
  setup(e) {
191
- const a = _e();
192
- return (t, r) => (m(), p(l(Ae), {
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) => xe(a) ? a.value = o : null),
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(Re), {
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
- }), dt = /* @__PURE__ */ k({
199
+ }), ct = /* @__PURE__ */ E({
209
200
  __name: "UiKitOutlet",
210
201
  setup(e) {
211
- return (a, t) => (m(), U(M, null, [
212
- s(Le),
213
- s(Qe),
214
- s($e)
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__ */ k({
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 } = me({ useScope: "global" });
225
- return (t, r) => t.translate ? (m(), U(M, { key: 0 }, [
226
- te(G(l(a)(t.content)), 1)
227
- ], 64)) : (m(), U(M, { key: 1 }, [
228
- te(G(t.content), 1)
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
- }), We = { class: "d-flex justify-space-between pr-2 py-2" }, Ge = 650, Be = /* @__PURE__ */ k({
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 } } } } = j(), u = {
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 = E(!0), i = y(() => Object.hasOwn(t.data, "content") ? {
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 : Q({}, u, t.data.defaultCta));
251
- function D(v) {
252
- R(v) ? v.action() : b(v.value);
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 R(v) {
245
+ function b(v) {
255
246
  return Object.hasOwn(v, "action");
256
247
  }
257
- function b(v = null) {
248
+ function k(v = null) {
258
249
  c = v, n.value = !1;
259
250
  }
260
- function h() {
251
+ function I() {
261
252
  r("resolve", c);
262
253
  }
263
- return (v, T) => (m(), p(l(K), {
254
+ return (v, T) => (m(), p(l(H), {
264
255
  modelValue: n.value,
265
- "onUpdate:modelValue": T[1] || (T[1] = (V) => n.value = V),
266
- "max-width": v.data.width ?? Ge,
267
- onAfterLeave: h
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(z), { class: "info-dialog-card" }, {
261
+ s(l(q), { class: "info-dialog-card" }, {
271
262
  default: d(() => [
272
- N("div", We, [
273
- s(l(ue), null, {
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] = (V) => b(null))
276
+ onClick: T[0] || (T[0] = (D) => k(null))
286
277
  })
287
278
  ]),
288
- i.value ? (m(), p(l(se), { key: 0 }, {
279
+ i.value ? (m(), p(l(ue), { key: 0 }, {
289
280
  default: d(() => [
290
- N("p", null, [
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
- })) : S("", !0),
299
- f.value ? (m(), p(F(f.value.component), re($({ key: 1 }, f.value.props)), null, 16)) : S("", !0),
300
- s(l(q), { class: "justify-end" }, {
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), U(M, null, J(v.data.additionalCta ?? [], (V, I) => (m(), p(l(A), {
303
- key: I,
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(V)
297
+ onClick: () => V(D)
307
298
  }, {
308
299
  default: d(() => [
309
300
  s(C, {
310
- translate: V.translateText,
311
- content: V.text
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: b
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
- })) : S("", !0)
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
- }), He = /* @__PURE__ */ W(Be, [["__scopeId", "data-v-0f8116ef"]]);
341
- var L = /* @__PURE__ */ ((e) => (e.SMALL = "sm", e.LARGE = "lg", e))(L || {});
342
- function H(e, a) {
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: j().options.i18n.messages[a],
335
+ text: S().options.i18n.messages[a],
345
336
  translateText: !0
346
337
  };
347
- return Q(r, e);
338
+ return N(r, e);
348
339
  }
349
- const Ke = /* @__PURE__ */ k({
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
- [L.SMALL]: 650,
358
- [L.LARGE]: 1200
359
- }, u = H(t.data.saveCta, "save"), c = H(t.data.abortCta, "cancel"), n = E(!0), i = E(ne(t.data.initialValue) ?? null), f = E(null), { mobile: _ } = fe(), D = y(() => t.data.required && !i.value), R = y(() => o[t.data.size ?? L.SMALL]), b = y(() => t.data.size === L.LARGE ? _.value : !1), h = y(() => t.data.size === L.LARGE ? "secondary" : "primary");
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 = ne(t.data.initialValue) ?? null, n.value = !1;
355
+ i.value = te(t.data.initialValue) ?? null, n.value = !1;
365
356
  }
366
- function V() {
357
+ function D() {
367
358
  n.value = !1;
368
359
  }
369
- function I() {
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 (w, O) => (m(), p(l(K), {
367
+ return (x, U) => (m(), p(l(H), {
377
368
  modelValue: n.value,
378
- "onUpdate:modelValue": O[1] || (O[1] = (P) => n.value = P),
379
- "max-width": R.value,
380
- fullscreen: b.value,
381
- scrollable: w.data.size === l(L).LARGE,
382
- onAfterLeave: I
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(z), { class: "prompt-dialog-card" }, {
376
+ s(l(q), { class: "prompt-dialog-card" }, {
386
377
  default: d(() => [
387
- s(l(ce), { color: "primary" }, {
378
+ s(l(se), { color: "primary" }, {
388
379
  default: d(() => [
389
- s(l(ie), null, {
380
+ s(l(ce), null, {
390
381
  default: d(() => [
391
382
  s(C, {
392
- translate: w.data.translateTitle,
393
- content: w.data.title
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
- N("div", {
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(w.data.component), $({ key: 0 }, v(), {
402
+ f.value ? (m(), p(F(x.data.component), $({ key: 0 }, v(), {
412
403
  modelValue: i.value,
413
- "onUpdate:modelValue": O[0] || (O[0] = (P) => i.value = P),
404
+ "onUpdate:modelValue": U[0] || (U[0] = (P) => i.value = P),
414
405
  toolbar: f.value
415
- }), null, 16, ["modelValue", "toolbar"])) : S("", !0),
416
- s(l(de)),
417
- s(l(q), null, {
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: h.value,
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: h.value,
435
- disabled: D.value,
436
- onClick: V
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
- }), ze = /* @__PURE__ */ W(Ke, [["__scopeId", "data-v-6cec23a5"]]), qe = { class: "d-flex justify-space-between pr-2 py-2" }, Ye = 550, Xe = /* @__PURE__ */ k({
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 } } } } = j(), c = {
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 = E(!0), _ = y(() => Object.hasOwn(t.data, "content") ? {
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), D = y(() => Object.hasOwn(t.data, "component") ? {
465
+ } : null), V = y(() => Object.hasOwn(t.data, "component") ? {
475
466
  component: t.data.component,
476
467
  props: t.data.props
477
- } : null), R = y(() => Q({}, c, t.data.confirmCta)), b = y(() => Q({}, n, t.data.rejectCta)), h = y(() => t.data.highlightCta ?? "confirm"), v = y(() => t.data.level ?? "primary");
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 V() {
472
+ function D() {
482
473
  i = !0, f.value = !1;
483
474
  }
484
- function I() {
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 (w, O) => (m(), p(l(K), {
482
+ return (x, U) => (m(), p(l(H), {
492
483
  modelValue: f.value,
493
- "onUpdate:modelValue": O[0] || (O[0] = (P) => f.value = P),
494
- persistent: !!w.data.permanent,
495
- "max-width": w.data.maxWidth ?? Ye,
496
- onAfterLeave: I
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(z), { class: "confirm-dialog-card" }, {
490
+ s(l(q), { class: "confirm-dialog-card" }, {
500
491
  default: d(() => [
501
- N("div", qe, [
502
- s(l(ue), null, {
492
+ Q("div", ze, [
493
+ s(l(re), null, {
503
494
  default: d(() => [
504
495
  s(C, {
505
- translate: w.data.translateTitle,
506
- content: w.data.title
496
+ translate: x.data.translateTitle,
497
+ content: x.data.title
507
498
  }, null, 8, ["translate", "content"])
508
499
  ]),
509
500
  _: 1
510
501
  }),
511
- w.data.permanent ? S("", !0) : (m(), p(l(A), {
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(se), { key: 0 }, {
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
- })) : S("", !0),
527
- D.value ? (m(), p(F(D.value.component), re($({ key: 1 }, D.value.props)), null, 16)) : S("", !0),
528
- s(l(q), { class: "justify-end" }, {
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
- N("div", {
531
- class: le(["d-flex align-center", h.value === "confirm" ? "" : "flex-row-reverse"])
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: h.value === "reject" ? "elevated" : "text",
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: b.value.translateText,
541
- content: b.value.text
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: h.value === "confirm" ? "elevated" : "text",
538
+ variant: I.value === "confirm" ? "elevated" : "text",
548
539
  color: v.value,
549
- onClick: V
540
+ onClick: D
550
541
  }, {
551
542
  default: d(() => [
552
543
  s(C, {
553
- translate: R.value.translateText,
554
- content: R.value.text
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
- }), Ze = /* @__PURE__ */ W(Xe, [["__scopeId", "data-v-3e8b3358"]]);
571
- function Je(e) {
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 et(e, a = {}) {
579
- const { options: { loading: { delay: t, overlay: r } } } = j(), o = E(!1), u = _e();
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
- Je(t)
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: Z(o), action: c };
585
+ return { loading: X(o), action: c };
595
586
  }
596
- const tt = /* @__PURE__ */ k({
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 = H(t.data.saveCta, "save"), u = H(t.data.abortCta, "cancel"), c = De("formComponent"), n = E(!0), i = Ee(), { loading: f, action: _ } = et(v), D = y(() => ({
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 R = null;
609
- function b() {
599
+ let b = null;
600
+ function k() {
610
601
  return t.data.props ?? {};
611
602
  }
612
- async function h() {
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 I = await c.value.finish();
619
- typeof t.data.action == "function" ? R = await t.data.action(I) : R = I;
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 V() {
625
- if (t.data.rejectOnEmpty && R === null) {
615
+ function D() {
616
+ if (t.data.rejectOnEmpty && b === null) {
626
617
  r("reject");
627
618
  return;
628
619
  }
629
- r("resolve", R);
620
+ r("resolve", b);
630
621
  }
631
- return (I, w) => (m(), p(l(K), {
622
+ return (h, x) => (m(), p(l(H), {
632
623
  modelValue: n.value,
633
- "onUpdate:modelValue": w[0] || (w[0] = (O) => n.value = O),
634
- onAfterLeave: V,
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(z), null, {
630
+ s(l(q), null, {
640
631
  default: d(() => [
641
- s(l(ce), { color: "primary" }, {
632
+ s(l(se), { color: "primary" }, {
642
633
  default: d(() => [
643
- s(l(ie), null, {
634
+ s(l(ce), null, {
644
635
  default: d(() => [
645
636
  s(C, {
646
- content: I.data.title,
647
- translate: !!I.data.translateTitle
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: D.value }, {
651
+ s(l(he), { defaults: V.value }, {
661
652
  default: d(() => [
662
- (m(), p(F(I.data.component), $({
653
+ (m(), p(F(h.data.component), $({
663
654
  ref_key: "formComponent",
664
655
  ref: c,
665
- onSave: h
666
- }, b()), null, 16))
656
+ onSave: I
657
+ }, k()), null, 16))
667
658
  ]),
668
659
  _: 1
669
660
  }, 8, ["defaults"]),
670
- s(l(de)),
671
- s(l(q), null, {
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: h,
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 mt() {
711
- const e = pe();
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: He,
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: ze,
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 D = {
748
- component: Ze,
738
+ const V = {
739
+ component: Ke,
749
740
  props: { data: i },
750
741
  resolve: f,
751
742
  reject: _
752
743
  };
753
- e.addToQueue(D);
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: tt,
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 nt = /* @__PURE__ */ ((e) => (e.DEFAULT = "primary", e.WARNING = "warning", e.DANGER = "error", e))(nt || {});
775
- function ft() {
776
- const e = ee(), { options: { toast: { timeout: a } } } = j();
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: x.INFO
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: x.WARNING
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: x.ERROR
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: x.SUCCESS
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 at = () => ({
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 ot(e) {
847
- const a = E([]), t = E([]);
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 vt(e) {
849
+ function mt(e) {
855
850
  return (a) => {
856
- const t = at(), r = Q(t, e), o = ot(r);
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
- nt as ConfirmDialogLevel,
862
- L as PromptDialogSize,
863
- dt as UiKitOutlet,
864
- vt as createUIKit,
865
- mt as useDialog,
866
- et as useLoading,
867
- _e as useLoadingOverlay,
868
- ft as useToast
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
+ };
@@ -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 a } from "vue-i18n";
4
- import { computed as m, unref as l } from "vue";
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 } = a({ useScope: "global" });
9
+ const { t } = m({ useScope: "global" });
8
10
  return t(...e);
9
11
  },
10
12
  messagePath(e) {
11
- return console.log(e.$validator), "validation." + e.$validator;
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
- }), A = n(r.required), b = n(r.requiredIf, { withArguments: !0 }), V = n(r.requiredUnless, { withArguments: !0 }), O = n(r.minLength, { withArguments: !0 }), j = n(r.maxLength, { withArguments: !0 }), $ = n(r.minValue, { withArguments: !0 }), q = n(r.maxValue, { withArguments: !0 }), x = n(r.between, { withArguments: !0 }), I = n(r.alpha), y = n(r.alphaNum), L = n(r.numeric), E = n(r.integer), N = n(r.decimal), U = n(r.email), W = n(r.ipAddress), B = n(r.macAddress), M = n(r.sameAs, { withArguments: !0 }), P = n(r.url), T = n((e) => o.withParams({
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 }), R = (e) => m(() => i(e.value));
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] : f(s) ? [t, d(s)] : h(s) ? [t, i(s)] : (console.warn("Unknown validation type.", t, s), [t, null])).reduce((t, [s, u]) => (u && (t[s] = u), t), {});
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 f(e) {
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 h(e) {
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 d(e) {
33
- return e.$errors.map((t) => l(t.$message));
53
+ function V(e) {
54
+ return e.$errors.map((t) => g(t.$message));
34
55
  }
35
56
  export {
36
- I as alpha,
37
- y as alphaNum,
38
- x as between,
39
- N as decimal,
40
- U as email,
41
- E as integer,
42
- W as ipAddress,
43
- B as maxAddress,
44
- j as maxLength,
45
- q as maxValue,
46
- O as minLength,
47
- $ as minValue,
48
- L as numeric,
49
- T as oneOf,
50
- A as required,
51
- b as requiredIf,
52
- V as requiredUnless,
53
- M as sameAs,
54
- P as url,
55
- R as useVuelidateErrors
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schwarzdavid/ui-kit",
3
- "version": "0.0.1-alpha.11",
3
+ "version": "0.0.1-alpha.12",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "preview": "vite preview",