@webilio-xyz/webilio-vue 1.1.1 → 1.1.3

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.
Files changed (2) hide show
  1. package/dist/Input.js +185 -167
  2. package/package.json +1 -1
package/dist/Input.js CHANGED
@@ -1,12 +1,12 @@
1
- import { computed as y, withDirectives as O, openBlock as b, createElementBlock as S, vModelCheckbox as J, ref as I, onMounted as T, renderSlot as v, createCommentVNode as N, createElementVNode as U, unref as z, Fragment as se, createBlock as $, createVNode as L, normalizeClass as w, normalizeStyle as ue, createSlots as q, withCtx as h, createTextVNode as M, toDisplayString as A } from "vue";
2
- import { trans as oe, isLoaded as re, getActiveLanguage as ie } from "laravel-vue-i18n";
3
- import de from "@vuepic/vue-datepicker";
4
- import { s as me, u as H, _ as K, E as Q } from "./LabelComponent-CfsH2P2a.js";
1
+ import { computed as v, withDirectives as U, openBlock as b, createElementBlock as S, vModelCheckbox as J, ref as A, onMounted as M, renderSlot as y, createCommentVNode as N, createElementVNode as D, normalizeClass as V, unref as z, Fragment as se, createBlock as C, createVNode as L, normalizeStyle as ue, createSlots as q, withCtx as h, createTextVNode as E, toDisplayString as B, normalizeProps as oe, guardReactiveProps as ie } from "vue";
2
+ import { trans as re, isLoaded as de, getActiveLanguage as me } from "laravel-vue-i18n";
3
+ import ce from "@vuepic/vue-datepicker";
4
+ import { s as pe, u as H, _ as K, E as Q } from "./LabelComponent-CfsH2P2a.js";
5
5
  import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- import { a as ce } from "./toString-CykDHNcE.js";
7
- import { b as pe } from "./_baseIteratee-r_6HOn93.js";
8
- import { i as fe, b as ge } from "./_baseEach-BeZ5ghU7.js";
9
- import { i as he } from "./isObject-BD_iszZg.js";
6
+ import { a as fe } from "./toString-CykDHNcE.js";
7
+ import { b as ge } from "./_baseIteratee-r_6HOn93.js";
8
+ import { i as he, b as be } from "./_baseEach-BeZ5ghU7.js";
9
+ import { i as ye } from "./isObject-BD_iszZg.js";
10
10
  const Y = {
11
11
  __name: "CheckboxComponent",
12
12
  props: {
@@ -17,7 +17,7 @@ const Y = {
17
17
  },
18
18
  emits: ["update:checked", "update:modelValue"],
19
19
  setup(e, { emit: a }) {
20
- const l = a, t = e, s = y({
20
+ const l = a, t = e, s = v({
21
21
  get() {
22
22
  return t.checked;
23
23
  },
@@ -25,8 +25,8 @@ const Y = {
25
25
  l("update:checked", u), l("update:modelValue", u);
26
26
  }
27
27
  });
28
- return (u, r) => O((b(), S("input", {
29
- "onUpdate:modelValue": r[0] || (r[0] = (o) => s.value = o),
28
+ return (u, i) => U((b(), S("input", {
29
+ "onUpdate:modelValue": i[0] || (i[0] = (o) => s.value = o),
30
30
  type: "checkbox",
31
31
  class: "wv-input wv-checkbox-input rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500"
32
32
  }, null, 512)), [
@@ -34,42 +34,42 @@ const Y = {
34
34
  ]);
35
35
  }
36
36
  };
37
- var be = Object.defineProperty, ye = (e, a, l) => a in e ? be(e, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[a] = l, R = (e, a, l) => ye(e, typeof a != "symbol" ? a + "" : a, l);
38
- const Z = {
37
+ var ve = Object.defineProperty, ke = (e, a, l) => a in e ? ve(e, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[a] = l, R = (e, a, l) => ke(e, typeof a != "symbol" ? a + "" : a, l);
38
+ const j = {
39
39
  "#": { pattern: /[0-9]/ },
40
40
  "@": { pattern: /[a-zA-Z]/ },
41
41
  "*": { pattern: /[a-zA-Z0-9]/ }
42
- }, j = (e, a, l) => e.replaceAll(a, "").replace(l, ".").replace("..", ".").replace(/[^.\d]/g, ""), G = (e, a, l) => {
42
+ }, Z = (e, a, l) => e.replaceAll(a, "").replace(l, ".").replace("..", ".").replace(/[^.\d]/g, ""), G = (e, a, l) => {
43
43
  var t;
44
44
  return new Intl.NumberFormat(((t = l.number) == null ? void 0 : t.locale) ?? "en", {
45
45
  minimumFractionDigits: e,
46
46
  maximumFractionDigits: a,
47
47
  roundingMode: "trunc"
48
48
  });
49
- }, ve = (e, a = !0, l) => {
50
- var t, s, u, r;
49
+ }, xe = (e, a = !0, l) => {
50
+ var t, s, u, i;
51
51
  const o = ((t = l.number) == null ? void 0 : t.unsigned) == null && e.startsWith("-") ? "-" : "", n = ((s = l.number) == null ? void 0 : s.fraction) ?? 0;
52
52
  let d = G(0, n, l);
53
- const f = d.formatToParts(1000.12), g = ((u = f.find((i) => i.type === "group")) == null ? void 0 : u.value) ?? " ", m = ((r = f.find((i) => i.type === "decimal")) == null ? void 0 : r.value) ?? ".", p = j(e, g, m);
53
+ const f = d.formatToParts(1000.12), g = ((u = f.find((r) => r.type === "group")) == null ? void 0 : u.value) ?? " ", m = ((i = f.find((r) => r.type === "decimal")) == null ? void 0 : i.value) ?? ".", p = Z(e, g, m);
54
54
  if (p === "" || Number.isNaN(p)) return o;
55
55
  const x = p.split(".");
56
56
  if (x[1] != null && x[1].length >= 1) {
57
- const i = x[1].length <= n ? x[1].length : n;
58
- d = G(i, n, l);
57
+ const r = x[1].length <= n ? x[1].length : n;
58
+ d = G(r, n, l);
59
59
  }
60
60
  let c = d.format(parseFloat(p));
61
- return a ? n > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (c += m) : c = j(c, g, m), o + c;
61
+ return a ? n > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (c += m) : c = Z(c, g, m), o + c;
62
62
  };
63
- class ke {
63
+ class Ve {
64
64
  constructor(a = {}) {
65
65
  R(this, "opts", {}), R(this, "memo", /* @__PURE__ */ new Map());
66
66
  const l = { ...a };
67
67
  if (l.tokens != null) {
68
- l.tokens = l.tokensReplace ? { ...l.tokens } : { ...Z, ...l.tokens };
68
+ l.tokens = l.tokensReplace ? { ...l.tokens } : { ...j, ...l.tokens };
69
69
  for (const t of Object.values(l.tokens))
70
70
  typeof t.pattern == "string" && (t.pattern = new RegExp(t.pattern));
71
71
  } else
72
- l.tokens = Z;
72
+ l.tokens = j;
73
73
  Array.isArray(l.mask) && (l.mask.length > 1 ? l.mask = [...l.mask].sort((t, s) => t.length - s.length) : l.mask = l.mask[0] ?? ""), l.mask === "" && (l.mask = null), this.opts = l;
74
74
  }
75
75
  masked(a) {
@@ -108,34 +108,34 @@ class ke {
108
108
  }), { mask: l.join(""), escaped: t };
109
109
  }
110
110
  process(a, l, t = !0) {
111
- if (this.opts.number != null) return ve(a, t, this.opts);
111
+ if (this.opts.number != null) return xe(a, t, this.opts);
112
112
  if (l == null) return a;
113
113
  const s = `v=${a},mr=${l},m=${t ? 1 : 0}`;
114
114
  if (this.memo.has(s)) return this.memo.get(s);
115
- const { mask: u, escaped: r } = this.escapeMask(l), o = [], n = this.opts.tokens != null ? this.opts.tokens : {}, d = this.isReversed() ? -1 : 1, f = this.isReversed() ? "unshift" : "push", g = this.isReversed() ? 0 : u.length - 1, m = this.isReversed() ? () => i > -1 && k > -1 : () => i < u.length && k < a.length, p = (C) => !this.isReversed() && C <= g || this.isReversed() && C >= g;
116
- let x, c = -1, i = this.isReversed() ? u.length - 1 : 0, k = this.isReversed() ? a.length - 1 : 0, F = !1;
115
+ const { mask: u, escaped: i } = this.escapeMask(l), o = [], n = this.opts.tokens != null ? this.opts.tokens : {}, d = this.isReversed() ? -1 : 1, f = this.isReversed() ? "unshift" : "push", g = this.isReversed() ? 0 : u.length - 1, m = this.isReversed() ? () => r > -1 && k > -1 : () => r < u.length && k < a.length, p = ($) => !this.isReversed() && $ <= g || this.isReversed() && $ >= g;
116
+ let x, c = -1, r = this.isReversed() ? u.length - 1 : 0, k = this.isReversed() ? a.length - 1 : 0, P = !1;
117
117
  for (; m(); ) {
118
- const C = u.charAt(i), V = n[C], E = (V == null ? void 0 : V.transform) != null ? V.transform(a.charAt(k)) : a.charAt(k);
119
- if (!r.includes(i) && V != null ? (E.match(V.pattern) != null ? (o[f](E), V.repeated ? (c === -1 ? c = i : i === g && i !== c && (i = c - d), g === c && (i -= d)) : V.multiple && (F = !0, i -= d), i += d) : V.multiple ? F && (i += d, k -= d, F = !1) : E === x ? x = void 0 : V.optional && (i += d, k -= d), k += d) : (t && !this.isEager() && o[f](C), E === C && !this.isEager() ? k += d : x = C, this.isEager() || (i += d)), this.isEager())
120
- for (; p(i) && (n[u.charAt(i)] == null || r.includes(i)); ) {
118
+ const $ = u.charAt(r), w = n[$], I = (w == null ? void 0 : w.transform) != null ? w.transform(a.charAt(k)) : a.charAt(k);
119
+ if (!i.includes(r) && w != null ? (I.match(w.pattern) != null ? (o[f](I), w.repeated ? (c === -1 ? c = r : r === g && r !== c && (r = c - d), g === c && (r -= d)) : w.multiple && (P = !0, r -= d), r += d) : w.multiple ? P && (r += d, k -= d, P = !1) : I === x ? x = void 0 : w.optional && (r += d, k -= d), k += d) : (t && !this.isEager() && o[f]($), I === $ && !this.isEager() ? k += d : x = $, this.isEager() || (r += d)), this.isEager())
120
+ for (; p(r) && (n[u.charAt(r)] == null || i.includes(r)); ) {
121
121
  if (t) {
122
- if (o[f](u.charAt(i)), a.charAt(k) === u.charAt(i)) {
123
- i += d, k += d;
122
+ if (o[f](u.charAt(r)), a.charAt(k) === u.charAt(r)) {
123
+ r += d, k += d;
124
124
  continue;
125
125
  }
126
- } else u.charAt(i) === a.charAt(k) && (k += d);
127
- i += d;
126
+ } else u.charAt(r) === a.charAt(k) && (k += d);
127
+ r += d;
128
128
  }
129
129
  }
130
130
  return this.memo.set(s, o.join("")), this.memo.get(s);
131
131
  }
132
132
  }
133
- const _ = (e) => JSON.parse(e.replaceAll("'", '"')), xe = (e, a = {}) => {
133
+ const _ = (e) => JSON.parse(e.replaceAll("'", '"')), we = (e, a = {}) => {
134
134
  const l = { ...a };
135
- e.dataset.maska != null && e.dataset.maska !== "" && (l.mask = Ve(e.dataset.maska)), e.dataset.maskaEager != null && (l.eager = B(e.dataset.maskaEager)), e.dataset.maskaReversed != null && (l.reversed = B(e.dataset.maskaReversed)), e.dataset.maskaTokensReplace != null && (l.tokensReplace = B(e.dataset.maskaTokensReplace)), e.dataset.maskaTokens != null && (l.tokens = we(e.dataset.maskaTokens));
135
+ e.dataset.maska != null && e.dataset.maska !== "" && (l.mask = Se(e.dataset.maska)), e.dataset.maskaEager != null && (l.eager = T(e.dataset.maskaEager)), e.dataset.maskaReversed != null && (l.reversed = T(e.dataset.maskaReversed)), e.dataset.maskaTokensReplace != null && (l.tokensReplace = T(e.dataset.maskaTokensReplace)), e.dataset.maskaTokens != null && (l.tokens = Ce(e.dataset.maskaTokens));
136
136
  const t = {};
137
- return e.dataset.maskaNumberLocale != null && (t.locale = e.dataset.maskaNumberLocale), e.dataset.maskaNumberFraction != null && (t.fraction = parseInt(e.dataset.maskaNumberFraction)), e.dataset.maskaNumberUnsigned != null && (t.unsigned = B(e.dataset.maskaNumberUnsigned)), (e.dataset.maskaNumber != null || Object.values(t).length > 0) && (l.number = t), l;
138
- }, B = (e) => e !== "" ? !!JSON.parse(e) : !0, Ve = (e) => e.startsWith("[") && e.endsWith("]") ? _(e) : e, we = (e) => {
137
+ return e.dataset.maskaNumberLocale != null && (t.locale = e.dataset.maskaNumberLocale), e.dataset.maskaNumberFraction != null && (t.fraction = parseInt(e.dataset.maskaNumberFraction)), e.dataset.maskaNumberUnsigned != null && (t.unsigned = T(e.dataset.maskaNumberUnsigned)), (e.dataset.maskaNumber != null || Object.values(t).length > 0) && (l.number = t), l;
138
+ }, T = (e) => e !== "" ? !!JSON.parse(e) : !0, Se = (e) => e.startsWith("[") && e.endsWith("]") ? _(e) : e, Ce = (e) => {
139
139
  if (e.startsWith("{") && e.endsWith("}"))
140
140
  return _(e);
141
141
  const a = {};
@@ -149,13 +149,13 @@ const _ = (e) => JSON.parse(e.replaceAll("'", '"')), xe = (e, a = {}) => {
149
149
  };
150
150
  }), a;
151
151
  };
152
- class Se {
152
+ class $e {
153
153
  constructor(a, l = {}) {
154
154
  R(this, "items", /* @__PURE__ */ new Map()), R(this, "onInput", (t) => {
155
155
  if (t instanceof CustomEvent && t.type === "input")
156
156
  return;
157
- const s = t.target, u = this.items.get(s), r = "inputType" in t && t.inputType.startsWith("delete"), o = u.isEager(), n = r && o && u.unmasked(s.value) === "" ? "" : s.value;
158
- this.fixCursor(s, r, () => this.setValue(s, n));
157
+ const s = t.target, u = this.items.get(s), i = "inputType" in t && t.inputType.startsWith("delete"), o = u.isEager(), n = i && o && u.unmasked(s.value) === "" ? "" : s.value;
158
+ this.fixCursor(s, i, () => this.setValue(s, n));
159
159
  }), this.options = l, this.init(this.getInputs(a));
160
160
  }
161
161
  update(a = {}) {
@@ -173,7 +173,7 @@ class Se {
173
173
  const l = this.getOptions(this.options);
174
174
  for (const t of a) {
175
175
  this.items.has(t) || t.addEventListener("input", this.onInput, { capture: !0 });
176
- const s = new ke(xe(t, l));
176
+ const s = new Ve(we(t, l));
177
177
  this.items.set(t, s), queueMicrotask(() => this.updateValue(t)), t.selectionStart === null && s.isEager() && console.warn("Maska: input of `%s` type is not supported", t.type);
178
178
  }
179
179
  }
@@ -187,9 +187,9 @@ class Se {
187
187
  fixCursor(a, l, t) {
188
188
  const s = a.selectionStart, u = a.value;
189
189
  if (t(), s === null || s === u.length && !l) return;
190
- const r = a.value, o = u.slice(0, s), n = r.slice(0, s), d = this.processInput(a, o).unmasked, f = this.processInput(a, n).unmasked;
190
+ const i = a.value, o = u.slice(0, s), n = i.slice(0, s), d = this.processInput(a, o).unmasked, f = this.processInput(a, n).unmasked;
191
191
  let g = s;
192
- o !== n && (g += l ? r.length - u.length : d.length - f.length), a.setSelectionRange(g, g);
192
+ o !== n && (g += l ? i.length - u.length : d.length - f.length), a.setSelectionRange(g, g);
193
193
  }
194
194
  setValue(a, l) {
195
195
  const t = this.processInput(a, l);
@@ -207,27 +207,27 @@ class Se {
207
207
  };
208
208
  }
209
209
  }
210
- const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
210
+ const F = /* @__PURE__ */ new WeakMap(), Ae = (e, a) => {
211
211
  if (e.arg == null || e.instance == null) return;
212
212
  const l = "setup" in e.instance.$.type;
213
213
  e.arg in e.instance ? e.instance[e.arg] = a : l && console.warn("Maska: please expose `%s` using defineExpose", e.arg);
214
- }, Ce = (e, a) => {
214
+ }, Me = (e, a) => {
215
215
  var l;
216
216
  const t = e instanceof HTMLInputElement ? e : e.querySelector("input");
217
217
  if (t == null || (t == null ? void 0 : t.type) === "file") return;
218
218
  let s = {};
219
219
  if (a.value != null && (s = typeof a.value == "string" ? { mask: a.value } : { ...a.value }), a.arg != null) {
220
- const u = (r) => {
221
- const o = a.modifiers.unmasked ? r.unmasked : a.modifiers.completed ? r.completed : r.masked;
222
- $e(a, o);
220
+ const u = (i) => {
221
+ const o = a.modifiers.unmasked ? i.unmasked : a.modifiers.completed ? i.completed : i.masked;
222
+ Ae(a, o);
223
223
  };
224
224
  s.onMaska = s.onMaska == null ? u : Array.isArray(s.onMaska) ? [...s.onMaska, u] : [s.onMaska, u];
225
225
  }
226
- P.has(t) ? (l = P.get(t)) == null || l.update(s) : P.set(t, new Se(t, s));
227
- }, Me = { class: "wv-text-input-wrapper flex items-center border border-gray-300 focus-within:border-indigo-500 focus-within:ring-1 focus-within:ring-indigo-500 rounded-md shadow-sm" }, Ae = {
226
+ F.has(t) ? (l = F.get(t)) == null || l.update(s) : F.set(t, new $e(t, s));
227
+ }, Ie = { class: "wv-text-input-wrapper flex items-center border border-gray-300 focus-within:border-indigo-500 focus-within:ring-1 focus-within:ring-indigo-500 rounded-md shadow-sm" }, Te = {
228
228
  key: 0,
229
229
  class: "wv-text-input-prefix flex items-center pl-2"
230
- }, Ie = ["type", "inputmode", "value", "min", "max", "step"], Te = {
230
+ }, Ee = ["type", "inputmode", "value", "min", "max", "step"], Be = {
231
231
  key: 1,
232
232
  class: "wv-text-input-suffix flex items-center pr-2"
233
233
  }, W = {
@@ -251,11 +251,15 @@ const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
251
251
  step: {
252
252
  type: [String, Number],
253
253
  default: null
254
+ },
255
+ inputClass: {
256
+ type: [String, Array, Object],
257
+ default: null
254
258
  }
255
259
  },
256
260
  emits: ["update:modelValue"],
257
261
  setup(e, { expose: a, emit: l }) {
258
- const t = e, s = l, u = y(() => t.type === "number"), r = y(() => u.value && t.precision !== null ? "text" : t.type), o = y(() => u.value && t.precision !== null ? "decimal" : null), n = y(() => t.step ? t.step : t.precision !== null ? Math.pow(10, -t.precision).toFixed(t.precision) : null), d = (m) => {
262
+ const t = e, s = l, u = v(() => t.type === "number"), i = v(() => u.value && t.precision !== null ? "text" : t.type), o = v(() => u.value && t.precision !== null ? "decimal" : null), n = v(() => t.step ? t.step : t.precision !== null ? Math.pow(10, -t.precision).toFixed(t.precision) : null), d = (m) => {
259
263
  if (!u.value || m === "" || m === "-" || m === "." || m === "-.") return m;
260
264
  const p = parseFloat(m);
261
265
  return isNaN(p) ? m : t.min !== null && p < parseFloat(t.min) ? t.min : t.max !== null && p > parseFloat(t.max) ? t.max : m;
@@ -269,33 +273,33 @@ const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
269
273
  }
270
274
  }
271
275
  p = d(p), m.target.value = p, s("update:modelValue", p);
272
- }, g = I(null);
273
- return T(() => {
276
+ }, g = A(null);
277
+ return M(() => {
274
278
  g.value.hasAttribute("autofocus") && g.value.focus();
275
- }), a({ focus: () => g.value.focus() }), (m, p) => (b(), S("div", Me, [
276
- m.$slots.prefix ? (b(), S("div", Ae, [
277
- v(m.$slots, "prefix")
279
+ }), a({ focus: () => g.value.focus() }), (m, p) => (b(), S("div", Ie, [
280
+ m.$slots.prefix ? (b(), S("div", Te, [
281
+ y(m.$slots, "prefix")
278
282
  ])) : N("", !0),
279
- O(U("input", {
283
+ U(D("input", {
280
284
  ref_key: "input",
281
285
  ref: g,
282
- type: r.value,
286
+ type: i.value,
283
287
  inputmode: o.value,
284
- class: "wv-input wv-text-input flex-1 border-0 focus:ring-0 disabled:bg-gray-200 px-1",
288
+ class: V(["wv-input wv-text-input flex-1 border-0 focus:ring-0 disabled:bg-gray-200 px-1", e.inputClass]),
285
289
  value: e.modelValue,
286
290
  min: e.min,
287
291
  max: e.max,
288
292
  step: n.value,
289
293
  onInput: f
290
- }, null, 40, Ie), [
291
- [z(Ce), e.mask]
294
+ }, null, 42, Ee), [
295
+ [z(Me), e.mask]
292
296
  ]),
293
- m.$slots.suffix ? (b(), S("div", Te, [
294
- v(m.$slots, "suffix")
297
+ m.$slots.suffix ? (b(), S("div", Be, [
298
+ y(m.$slots, "suffix")
295
299
  ])) : N("", !0)
296
300
  ]));
297
301
  }
298
- }, Ee = {
302
+ }, Ne = {
299
303
  __name: "DateComponent",
300
304
  props: {
301
305
  modelValue: String,
@@ -326,27 +330,27 @@ const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
326
330
  import("date-fns"),
327
331
  import("date-fns-tz")
328
332
  ]));
329
- }, u = y(() => {
333
+ }, u = v(() => {
330
334
  let c = "yyyy/MM/dd";
331
- if (r.value && l)
335
+ if (i.value && l)
332
336
  try {
333
- const i = oe("date.format").toString(), k = l.parse("29/10/1989", "P", /* @__PURE__ */ new Date());
334
- l.format(k, i), c = i;
337
+ const r = re("date.format").toString(), k = l.parse("29/10/1989", "P", /* @__PURE__ */ new Date());
338
+ l.format(k, r), c = r;
335
339
  } catch {
336
340
  }
337
341
  return c;
338
- }), r = I(!1);
339
- T(async () => {
342
+ }), i = A(!1);
343
+ M(async () => {
340
344
  await s();
341
345
  const c = setInterval(() => {
342
- re() && (r.value = !0, clearInterval(c));
346
+ de() && (i.value = !0, clearInterval(c));
343
347
  }, 50);
344
348
  });
345
- const o = y(() => ie()), n = e, d = a, f = (c) => !c || !t ? null : Array.isArray(c) ? c.map((i) => t.fromZonedTime(i, Intl.DateTimeFormat().resolvedOptions().timeZone)) : t.fromZonedTime(c, Intl.DateTimeFormat().resolvedOptions().timeZone), g = y(() => f(n.modelValue)), m = y(() => f(n.min)), p = y(() => f(n.max)), x = (c) => {
349
+ const o = v(() => me()), n = e, d = a, f = (c) => !c || !t ? null : Array.isArray(c) ? c.map((r) => t.fromZonedTime(r, Intl.DateTimeFormat().resolvedOptions().timeZone)) : t.fromZonedTime(c, Intl.DateTimeFormat().resolvedOptions().timeZone), g = v(() => f(n.modelValue)), m = v(() => f(n.min)), p = v(() => f(n.max)), x = (c) => {
346
350
  d("update:modelValue", c);
347
351
  };
348
- return (c, i) => (b(), S(se, null, [
349
- u.value ? (b(), $(z(de), {
352
+ return (c, r) => (b(), S(se, null, [
353
+ u.value ? (b(), C(z(ce), {
350
354
  key: 0,
351
355
  class: "print:hidden wv-input wv-date-input",
352
356
  "model-value": g.value,
@@ -371,7 +375,7 @@ const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
371
375
  }, null, 8, ["model-value"])
372
376
  ], 64));
373
377
  }
374
- }, ee = /* @__PURE__ */ X(Ee, [["__scopeId", "data-v-75d7c74c"]]), Be = ["disabled"], Ne = {
378
+ }, ee = /* @__PURE__ */ X(Ne, [["__scopeId", "data-v-75d7c74c"]]), Le = ["disabled"], Re = {
375
379
  __name: "ToggleComponent",
376
380
  props: {
377
381
  modelValue: {
@@ -389,31 +393,31 @@ const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
389
393
  },
390
394
  emits: ["update:checked", "update:modelValue"],
391
395
  setup(e, { emit: a }) {
392
- const l = a, t = e, s = y(() => ({
396
+ const l = a, t = e, s = v(() => ({
393
397
  "--size": `${t.size}rem`
394
- })), u = y({
398
+ })), u = v({
395
399
  get() {
396
400
  return !!t.modelValue;
397
401
  },
398
- set(r) {
399
- t.disabled || (l("update:modelValue", r), l("update:checked", r));
402
+ set(i) {
403
+ t.disabled || (l("update:modelValue", i), l("update:checked", i));
400
404
  }
401
405
  });
402
- return (r, o) => (b(), S("label", {
403
- class: w(["inline-flex items-center", { "cursor-pointer": !e.disabled }])
406
+ return (i, o) => (b(), S("label", {
407
+ class: V(["inline-flex items-center", { "cursor-pointer": !e.disabled }])
404
408
  }, [
405
- O(U("input", {
409
+ U(D("input", {
406
410
  "onUpdate:modelValue": o[0] || (o[0] = (n) => u.value = n),
407
411
  type: "checkbox",
408
412
  value: "",
409
413
  disabled: e.disabled,
410
414
  class: "sr-only peer"
411
- }, null, 8, Be), [
415
+ }, null, 8, Le), [
412
416
  [J, u.value]
413
417
  ]),
414
- U("div", {
418
+ D("div", {
415
419
  style: ue(s.value),
416
- class: w(["wv-input wv-toggle-input relative bg-gray-700 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:transition-all dark:border-gray-600 peer-checked:bg-blue-600", {
420
+ class: V(["wv-input wv-toggle-input relative bg-gray-700 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:transition-all dark:border-gray-600 peer-checked:bg-blue-600", {
417
421
  "after:bg-gray-300": e.disabled,
418
422
  "bg-gray-400": e.disabled,
419
423
  "peer-checked:bg-blue-400": e.disabled
@@ -421,16 +425,16 @@ const P = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
421
425
  }, null, 6)
422
426
  ], 2));
423
427
  }
424
- }, te = /* @__PURE__ */ X(Ne, [["__scopeId", "data-v-d62d3d36"]]);
425
- function Le(e, a) {
426
- var l = -1, t = fe(e) ? Array(e.length) : [];
427
- return ge(e, function(s, u, r) {
428
- t[++l] = a(s, u, r);
428
+ }, te = /* @__PURE__ */ X(Re, [["__scopeId", "data-v-d62d3d36"]]);
429
+ function Pe(e, a) {
430
+ var l = -1, t = he(e) ? Array(e.length) : [];
431
+ return be(e, function(s, u, i) {
432
+ t[++l] = a(s, u, i);
429
433
  }), t;
430
434
  }
431
- function D(e, a) {
432
- var l = he(e) ? ce : Le;
433
- return l(e, pe(a));
435
+ function O(e, a) {
436
+ var l = ye(e) ? fe : Pe;
437
+ return l(e, ge(a));
434
438
  }
435
439
  const ae = {
436
440
  __name: "SelectComponent",
@@ -487,7 +491,7 @@ const ae = {
487
491
  },
488
492
  emits: ["update:modelValue", "tag"],
489
493
  setup(e, { emit: a }) {
490
- const l = a, t = e, s = y({
494
+ const l = a, t = e, s = v({
491
495
  get() {
492
496
  return Array.isArray(t.modelValue) ? u.value.filter((n) => t.modelValue.includes(n == null ? void 0 : n.value)) : u.value.find((n) => (n == null ? void 0 : n.value) === t.modelValue);
493
497
  },
@@ -496,26 +500,26 @@ const ae = {
496
500
  if (!t.multiple)
497
501
  l("update:modelValue", n == null ? void 0 : n.value);
498
502
  else {
499
- const d = D(n, (f) => f == null ? void 0 : f.value);
503
+ const d = O(n, (f) => f == null ? void 0 : f.value);
500
504
  l("update:modelValue", d);
501
505
  }
502
506
  }
503
- }), u = y(() => D(t == null ? void 0 : t.options, (n) => typeof n == "string" ? {
507
+ }), u = v(() => O(t == null ? void 0 : t.options, (n) => typeof n == "string" ? {
504
508
  label: n,
505
509
  value: n
506
- } : n) ?? []), r = (n) => {
510
+ } : n) ?? []), i = (n) => {
507
511
  if (t.deselectable) {
508
512
  let d;
509
513
  if (t.multiple) {
510
514
  const f = n == null ? void 0 : n.value;
511
- d = D(s.value ?? [], (m) => m == null ? void 0 : m.value).filter((m) => m !== f);
515
+ d = O(s.value ?? [], (m) => m == null ? void 0 : m.value).filter((m) => m !== f);
512
516
  }
513
517
  l("update:modelValue", d);
514
518
  }
515
519
  }, o = (n) => {
516
520
  l("tag", n);
517
521
  };
518
- return (n, d) => (b(), $(z(me), {
522
+ return (n, d) => (b(), C(z(pe), {
519
523
  id: "value",
520
524
  modelValue: s.value,
521
525
  "onUpdate:modelValue": d[0] || (d[0] = (f) => s.value = f),
@@ -534,88 +538,92 @@ const ae = {
534
538
  "group-label": e.groupLabel,
535
539
  taggable: e.taggable,
536
540
  onTag: o,
537
- onRemove: r
541
+ onRemove: i
538
542
  }, q({
539
543
  maxElements: h(() => [
540
- M(A(n.$tChoice("select.maxElements", e.max)), 1)
544
+ E(B(n.$tChoice("select.maxElements", e.max)), 1)
541
545
  ]),
542
546
  noResult: h(() => [
543
- M(A(n.$t("select.noResult")), 1)
547
+ E(B(n.$t("select.noResult")), 1)
544
548
  ]),
545
549
  noOptions: h(() => [
546
- M(A(n.$t("select.noOptions")), 1)
547
- ]),
548
- tag: h(() => [
549
- M(A(n.$t("select.tag")), 1)
550
+ E(B(n.$t("select.noOptions")), 1)
550
551
  ]),
551
552
  _: 2
552
553
  }, [
554
+ n.$slots.tag ? {
555
+ name: "tag",
556
+ fn: h((f) => [
557
+ y(n.$slots, "tag", oe(ie(f)))
558
+ ]),
559
+ key: "0"
560
+ } : void 0,
553
561
  n.$slots.beforeList ? {
554
562
  name: "beforeList",
555
563
  fn: h(() => [
556
- v(n.$slots, "beforeList")
564
+ y(n.$slots, "beforeList")
557
565
  ]),
558
- key: "0"
566
+ key: "1"
559
567
  } : void 0,
560
568
  n.$slots.afterList ? {
561
569
  name: "afterList",
562
570
  fn: h(() => [
563
- v(n.$slots, "afterList")
571
+ y(n.$slots, "afterList")
564
572
  ]),
565
- key: "1"
573
+ key: "2"
566
574
  } : void 0,
567
575
  n.$slots.caret ? {
568
576
  name: "caret",
569
577
  fn: h(() => [
570
- v(n.$slots, "caret")
578
+ y(n.$slots, "caret")
571
579
  ]),
572
- key: "2"
580
+ key: "3"
573
581
  } : void 0,
574
582
  n.$slots.singleLabel ? {
575
583
  name: "singleLabel",
576
584
  fn: h(() => [
577
- v(n.$slots, "singleLabel")
585
+ y(n.$slots, "singleLabel")
578
586
  ]),
579
- key: "3"
587
+ key: "4"
580
588
  } : void 0,
581
589
  n.$slots.placeholder ? {
582
590
  name: "placeholder",
583
591
  fn: h(() => [
584
- v(n.$slots, "placeholder")
592
+ y(n.$slots, "placeholder")
585
593
  ]),
586
- key: "4"
594
+ key: "5"
587
595
  } : void 0,
588
596
  n.$slots.limit ? {
589
597
  name: "limit",
590
598
  fn: h(() => [
591
- v(n.$slots, "limit")
599
+ y(n.$slots, "limit")
592
600
  ]),
593
- key: "5"
601
+ key: "6"
594
602
  } : void 0,
595
603
  n.$slots.clear ? {
596
604
  name: "clear",
597
605
  fn: h(() => [
598
- v(n.$slots, "clear")
606
+ y(n.$slots, "clear")
599
607
  ]),
600
- key: "6"
608
+ key: "7"
601
609
  } : void 0,
602
610
  n.$slots.tag ? {
603
611
  name: "tag",
604
612
  fn: h(() => [
605
- v(n.$slots, "tag")
613
+ y(n.$slots, "tag")
606
614
  ]),
607
- key: "7"
615
+ key: "8"
608
616
  } : void 0,
609
617
  n.$slots.selection ? {
610
618
  name: "selection",
611
619
  fn: h(() => [
612
- v(n.$slots, "selection")
620
+ y(n.$slots, "selection")
613
621
  ]),
614
- key: "8"
622
+ key: "9"
615
623
  } : void 0
616
624
  ]), 1032, ["modelValue", "options", "placeholder", "multiple", "max", "open-direction", "close-on-select", "searchable", "group-select", "group-values", "group-label", "taggable"]));
617
625
  }
618
- }, Re = ["value", "placeholder"], le = {
626
+ }, Fe = ["value", "placeholder"], le = {
619
627
  __name: "TextareaComponent",
620
628
  props: {
621
629
  modelValue: String,
@@ -623,8 +631,8 @@ const ae = {
623
631
  },
624
632
  emits: ["update:modelValue"],
625
633
  setup(e, { expose: a }) {
626
- const l = I(null);
627
- return T(() => {
634
+ const l = A(null);
635
+ return M(() => {
628
636
  l.value.hasAttribute("autofocus") && l.value.focus();
629
637
  }), a({ focus: () => l.value.focus() }), (t, s) => (b(), S("textarea", {
630
638
  ref_key: "input",
@@ -633,9 +641,9 @@ const ae = {
633
641
  value: e.modelValue,
634
642
  placeholder: e.placeholder,
635
643
  onInput: s[0] || (s[0] = (u) => t.$emit("update:modelValue", u.target.value))
636
- }, null, 40, Re));
644
+ }, null, 40, Fe));
637
645
  }
638
- }, Fe = {
646
+ }, Oe = {
639
647
  key: 1,
640
648
  class: "h-10 flex items-center"
641
649
  }, ne = {
@@ -700,39 +708,43 @@ const ae = {
700
708
  step: {
701
709
  type: [String, Number],
702
710
  default: null
711
+ },
712
+ inputClass: {
713
+ type: [String, Array, Object],
714
+ default: null
703
715
  }
704
716
  },
705
717
  emits: ["update:modelValue", "tag"],
706
718
  setup(e, { emit: a }) {
707
- const l = e, t = a, s = I(null);
708
- T(() => {
719
+ const l = e, t = a, s = A(null);
720
+ M(() => {
709
721
  s.value = H("input_group_");
710
722
  });
711
- const u = y(() => l.type === "tel" ? "(###) ###-####" : null);
712
- return (r, o) => e.type === "checkbox" ? (b(), $(Y, {
723
+ const u = v(() => l.type === "tel" ? "(###) ###-####" : null);
724
+ return (i, o) => e.type === "checkbox" ? (b(), C(Y, {
713
725
  key: 0,
714
726
  id: s.value,
715
727
  name: e.name,
716
728
  "model-value": e.modelValue,
717
- class: w("size-10 " + e.customClass),
729
+ class: V("size-10 " + e.customClass),
718
730
  disabled: e.disabled,
719
731
  "onUpdate:modelValue": o[0] || (o[0] = (n) => t("update:modelValue", n))
720
- }, null, 8, ["id", "name", "model-value", "class", "disabled"])) : e.type === "toggle" ? (b(), S("div", Fe, [
732
+ }, null, 8, ["id", "name", "model-value", "class", "disabled"])) : e.type === "toggle" ? (b(), S("div", Oe, [
721
733
  L(te, {
722
734
  id: s.value,
723
735
  name: e.name,
724
736
  "model-value": !!e.modelValue,
725
737
  size: "15",
726
- class: w(e.customClass),
738
+ class: V(e.customClass),
727
739
  disabled: e.disabled,
728
740
  "onUpdate:modelValue": o[1] || (o[1] = (n) => t("update:modelValue", n))
729
741
  }, null, 8, ["id", "name", "model-value", "class", "disabled"])
730
- ])) : e.type === "select" ? (b(), $(ae, {
742
+ ])) : e.type === "select" ? (b(), C(ae, {
731
743
  key: 2,
732
744
  id: s.value,
733
745
  name: e.name,
734
746
  "model-value": e.modelValue,
735
- class: w("w-full " + e.customClass),
747
+ class: V("w-full " + e.customClass),
736
748
  options: e.options,
737
749
  disabled: e.disabled,
738
750
  multiple: e.multiple,
@@ -741,28 +753,28 @@ const ae = {
741
753
  deselectable: e.deselectable,
742
754
  "onUpdate:modelValue": o[2] || (o[2] = (n) => t("update:modelValue", n)),
743
755
  onTag: o[3] || (o[3] = (n) => t("tag", n))
744
- }, null, 8, ["id", "name", "model-value", "class", "options", "disabled", "multiple", "searchable", "taggable", "deselectable"])) : e.type === "textarea" ? (b(), $(le, {
756
+ }, null, 8, ["id", "name", "model-value", "class", "options", "disabled", "multiple", "searchable", "taggable", "deselectable"])) : e.type === "textarea" ? (b(), C(le, {
745
757
  key: 3,
746
758
  id: s.value,
747
759
  name: e.name,
748
760
  "model-value": e.modelValue,
749
- class: w("w-full " + e.customClass),
761
+ class: V("w-full " + e.customClass),
750
762
  placeholder: e.placeholder,
751
763
  disabled: e.disabled,
752
764
  "onUpdate:modelValue": o[4] || (o[4] = (n) => t("update:modelValue", n))
753
- }, null, 8, ["id", "name", "model-value", "class", "placeholder", "disabled"])) : e.type === "date" ? (b(), $(ee, {
765
+ }, null, 8, ["id", "name", "model-value", "class", "placeholder", "disabled"])) : e.type === "date" ? (b(), C(ee, {
754
766
  key: 4,
755
767
  id: s.value,
756
768
  name: e.name,
757
769
  "model-value": e.modelValue,
758
- class: w("w-full " + e.customClass),
770
+ class: V("w-full " + e.customClass),
759
771
  max: e.max,
760
772
  min: e.min,
761
773
  range: e.range,
762
774
  "enable-time-picker": e.enableTimePicker,
763
775
  disabled: e.disabled,
764
776
  "onUpdate:modelValue": o[5] || (o[5] = (n) => t("update:modelValue", n))
765
- }, null, 8, ["id", "name", "model-value", "class", "max", "min", "range", "enable-time-picker", "disabled"])) : (b(), $(W, {
777
+ }, null, 8, ["id", "name", "model-value", "class", "max", "min", "range", "enable-time-picker", "disabled"])) : (b(), C(W, {
766
778
  key: 5,
767
779
  id: s.value,
768
780
  type: e.type,
@@ -775,26 +787,27 @@ const ae = {
775
787
  mask: u.value,
776
788
  precision: e.precision,
777
789
  step: e.step,
778
- class: w("w-full " + e.customClass),
790
+ class: V("w-full " + e.customClass),
791
+ "input-class": e.inputClass,
779
792
  "onUpdate:modelValue": o[6] || (o[6] = (n) => t("update:modelValue", n))
780
793
  }, q({ _: 2 }, [
781
- r.$slots.prefix ? {
794
+ i.$slots.prefix ? {
782
795
  name: "prefix",
783
796
  fn: h(() => [
784
- v(r.$slots, "prefix")
797
+ y(i.$slots, "prefix")
785
798
  ]),
786
799
  key: "0"
787
800
  } : void 0,
788
- r.$slots.suffix ? {
801
+ i.$slots.suffix ? {
789
802
  name: "suffix",
790
803
  fn: h(() => [
791
- v(r.$slots, "suffix")
804
+ y(i.$slots, "suffix")
792
805
  ]),
793
806
  key: "1"
794
807
  } : void 0
795
- ]), 1032, ["id", "type", "name", "placeholder", "model-value", "disabled", "min", "max", "mask", "precision", "step", "class"]));
808
+ ]), 1032, ["id", "type", "name", "placeholder", "model-value", "disabled", "min", "max", "mask", "precision", "step", "class", "input-class"]));
796
809
  }
797
- }, Pe = {
810
+ }, De = {
798
811
  __name: "InputGroupComponent",
799
812
  props: {
800
813
  modelValue: String,
@@ -865,17 +878,21 @@ const ae = {
865
878
  step: {
866
879
  type: [String, Number],
867
880
  default: null
881
+ },
882
+ inputClass: {
883
+ type: [String, Array, Object],
884
+ default: null
868
885
  }
869
886
  },
870
887
  emits: ["update:modelValue", "tag"],
871
888
  setup(e, { emit: a }) {
872
- const l = e, t = a, s = I(null);
873
- T(() => {
889
+ const l = e, t = a, s = A(null);
890
+ M(() => {
874
891
  s.value = H("input_group_");
875
892
  });
876
- const u = y(() => l.type === "tel" ? "(###) ###-####" : null);
877
- return (r, o) => (b(), S("div", {
878
- class: w(["w-full", { error: e.errors !== null && e.errors !== "" }])
893
+ const u = v(() => l.type === "tel" ? "(###) ###-####" : null);
894
+ return (i, o) => (b(), S("div", {
895
+ class: V(["w-full", { error: e.errors !== null && e.errors !== "" }])
879
896
  }, [
880
897
  L(K, {
881
898
  for: s.value,
@@ -884,7 +901,7 @@ const ae = {
884
901
  class: "w-full mb-2"
885
902
  }, {
886
903
  default: h(() => [
887
- M(A(e.label), 1)
904
+ E(B(e.label), 1)
888
905
  ]),
889
906
  _: 1
890
907
  }, 8, ["for", "value", "required"]),
@@ -908,37 +925,38 @@ const ae = {
908
925
  "custom-class": e.customClass,
909
926
  precision: e.precision,
910
927
  step: e.step,
928
+ "input-class": e.inputClass,
911
929
  "onUpdate:modelValue": o[0] || (o[0] = (n) => t("update:modelValue", n)),
912
930
  onTag: o[1] || (o[1] = (n) => t("tag", n))
913
931
  }, q({ _: 2 }, [
914
- r.$slots.prefix ? {
932
+ i.$slots.prefix ? {
915
933
  name: "prefix",
916
934
  fn: h(() => [
917
- v(r.$slots, "prefix")
935
+ y(i.$slots, "prefix")
918
936
  ]),
919
937
  key: "0"
920
938
  } : void 0,
921
- r.$slots.suffix ? {
939
+ i.$slots.suffix ? {
922
940
  name: "suffix",
923
941
  fn: h(() => [
924
- v(r.$slots, "suffix")
942
+ y(i.$slots, "suffix")
925
943
  ]),
926
944
  key: "1"
927
945
  } : void 0
928
- ]), 1032, ["id", "name", "type", "model-value", "disabled", "multiple", "options", "max", "min", "range", "mask", "searchable", "placeholder", "taggable", "deselectable", "enable-time-picker", "custom-class", "precision", "step"]),
929
- e.errors ? (b(), $(Q, {
946
+ ]), 1032, ["id", "name", "type", "model-value", "disabled", "multiple", "options", "max", "min", "range", "mask", "searchable", "placeholder", "taggable", "deselectable", "enable-time-picker", "custom-class", "precision", "step", "input-class"]),
947
+ e.errors ? (b(), C(Q, {
930
948
  key: 0,
931
949
  class: "mt-2",
932
950
  message: e.errors
933
951
  }, null, 8, ["message"])) : N("", !0)
934
952
  ], 2));
935
953
  }
936
- }, Je = {
954
+ }, Ke = {
937
955
  CheckboxComponent: Y,
938
956
  DateComponent: ee,
939
957
  ErrorComponent: Q,
940
958
  InputComponent: ne,
941
- InputGroupComponent: Pe,
959
+ InputGroupComponent: De,
942
960
  LabelComponent: K,
943
961
  SelectComponent: ae,
944
962
  TextareaComponent: le,
@@ -950,11 +968,11 @@ export {
950
968
  ee as DateComponent,
951
969
  Q as ErrorComponent,
952
970
  ne as InputComponent,
953
- Pe as InputGroupComponent,
971
+ De as InputGroupComponent,
954
972
  K as LabelComponent,
955
973
  ae as SelectComponent,
956
974
  W as TextInputComponent,
957
975
  le as TextareaComponent,
958
976
  te as ToggleComponent,
959
- Je as default
977
+ Ke as default
960
978
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webilio-xyz/webilio-vue",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host 0.0.0.0",