@webilio-xyz/webilio-vue 1.1.0 → 1.1.2
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/Input.js +148 -130
- package/package.json +1 -1
package/dist/Input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as y, withDirectives as U, openBlock as b, createElementBlock as S, vModelCheckbox as J, ref as I, onMounted as T, renderSlot as v, 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 A, toDisplayString as M } from "vue";
|
|
2
2
|
import { trans as oe, isLoaded as ie, getActiveLanguage as re } from "laravel-vue-i18n";
|
|
3
3
|
import de from "@vuepic/vue-datepicker";
|
|
4
4
|
import { s as me, u as H, _ as K, E as Q } from "./LabelComponent-CfsH2P2a.js";
|
|
@@ -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 =
|
|
20
|
+
const l = a, t = e, s = y({
|
|
21
21
|
get() {
|
|
22
22
|
return t.checked;
|
|
23
23
|
},
|
|
@@ -25,7 +25,7 @@ const Y = {
|
|
|
25
25
|
l("update:checked", u), l("update:modelValue", u);
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
return (u, i) =>
|
|
28
|
+
return (u, i) => U((b(), S("input", {
|
|
29
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"
|
|
@@ -34,42 +34,42 @@ const Y = {
|
|
|
34
34
|
]);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
var be = Object.defineProperty,
|
|
38
|
-
const
|
|
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 j = {
|
|
39
39
|
"#": { pattern: /[0-9]/ },
|
|
40
40
|
"@": { pattern: /[a-zA-Z]/ },
|
|
41
41
|
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
42
|
-
},
|
|
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
|
-
},
|
|
49
|
+
}, ve = (e, a = !0, l) => {
|
|
50
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
|
|
54
|
-
if (
|
|
55
|
-
const x =
|
|
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
|
+
if (p === "" || Number.isNaN(p)) return o;
|
|
55
|
+
const x = p.split(".");
|
|
56
56
|
if (x[1] != null && x[1].length >= 1) {
|
|
57
57
|
const r = x[1].length <= n ? x[1].length : n;
|
|
58
58
|
d = G(r, n, l);
|
|
59
59
|
}
|
|
60
|
-
let
|
|
61
|
-
return a ? n > 0 &&
|
|
60
|
+
let c = d.format(parseFloat(p));
|
|
61
|
+
return a ? n > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (c += m) : c = Z(c, g, m), o + c;
|
|
62
62
|
};
|
|
63
63
|
class ke {
|
|
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 } : { ...
|
|
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 =
|
|
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,22 +108,22 @@ 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
|
|
111
|
+
if (this.opts.number != null) return ve(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: i } = this.escapeMask(l), o = [], n = this.opts.tokens != null ? this.opts.tokens : {}, d = this.isReversed() ? -1 : 1,
|
|
116
|
-
let x,
|
|
117
|
-
for (;
|
|
118
|
-
const
|
|
119
|
-
if (!i.includes(r) &&
|
|
120
|
-
for (;
|
|
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, F = !1;
|
|
117
|
+
for (; m(); ) {
|
|
118
|
+
const $ = u.charAt(r), w = n[$], E = (w == null ? void 0 : w.transform) != null ? w.transform(a.charAt(k)) : a.charAt(k);
|
|
119
|
+
if (!i.includes(r) && w != null ? (E.match(w.pattern) != null ? (o[f](E), w.repeated ? (c === -1 ? c = r : r === g && r !== c && (r = c - d), g === c && (r -= d)) : w.multiple && (F = !0, r -= d), r += d) : w.multiple ? F && (r += d, k -= d, F = !1) : E === x ? x = void 0 : w.optional && (r += d, k -= d), k += d) : (t && !this.isEager() && o[f]($), E === $ && !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[
|
|
123
|
-
r += 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(r) === a.charAt(
|
|
126
|
+
} else u.charAt(r) === a.charAt(k) && (k += d);
|
|
127
127
|
r += d;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -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 i = a.value, o = u.slice(0, s), n = i.slice(0, s), d = this.processInput(a, o).unmasked,
|
|
191
|
-
let
|
|
192
|
-
o !== n && (
|
|
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
|
+
let g = s;
|
|
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,11 +207,11 @@ class Se {
|
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
const
|
|
210
|
+
const O = /* @__PURE__ */ new WeakMap(), Ce = (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
|
-
},
|
|
214
|
+
}, $e = (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;
|
|
@@ -219,12 +219,12 @@ const D = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
|
|
|
219
219
|
if (a.value != null && (s = typeof a.value == "string" ? { mask: a.value } : { ...a.value }), a.arg != null) {
|
|
220
220
|
const u = (i) => {
|
|
221
221
|
const o = a.modifiers.unmasked ? i.unmasked : a.modifiers.completed ? i.completed : i.masked;
|
|
222
|
-
|
|
222
|
+
Ce(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
|
-
|
|
227
|
-
},
|
|
226
|
+
O.has(t) ? (l = O.get(t)) == null || l.update(s) : O.set(t, new Se(t, s));
|
|
227
|
+
}, Ae = { 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" }, Me = {
|
|
228
228
|
key: 0,
|
|
229
229
|
class: "wv-text-input-prefix flex items-center pl-2"
|
|
230
230
|
}, Ie = ["type", "inputmode", "value", "min", "max", "step"], Te = {
|
|
@@ -251,43 +251,51 @@ const D = /* @__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 =
|
|
259
|
-
|
|
262
|
+
const t = e, s = l, u = y(() => t.type === "number"), i = 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) => {
|
|
263
|
+
if (!u.value || m === "" || m === "-" || m === "." || m === "-.") return m;
|
|
264
|
+
const p = parseFloat(m);
|
|
265
|
+
return isNaN(p) ? m : t.min !== null && p < parseFloat(t.min) ? t.min : t.max !== null && p > parseFloat(t.max) ? t.max : m;
|
|
266
|
+
}, f = (m) => {
|
|
267
|
+
let p = m.target.value;
|
|
260
268
|
if (u.value && t.precision !== null) {
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
|
|
269
|
+
const x = new RegExp(`^-?\\d*\\.?\\d{0,${t.precision}}$`);
|
|
270
|
+
if (p !== "" && p !== "-" && p !== "." && p !== "-." && !x.test(p)) {
|
|
271
|
+
m.target.value = t.modelValue || "";
|
|
264
272
|
return;
|
|
265
273
|
}
|
|
266
274
|
}
|
|
267
|
-
s("update:modelValue",
|
|
268
|
-
},
|
|
275
|
+
p = d(p), m.target.value = p, s("update:modelValue", p);
|
|
276
|
+
}, g = I(null);
|
|
269
277
|
return T(() => {
|
|
270
|
-
|
|
271
|
-
}), a({ focus: () =>
|
|
272
|
-
|
|
273
|
-
v(
|
|
278
|
+
g.value.hasAttribute("autofocus") && g.value.focus();
|
|
279
|
+
}), a({ focus: () => g.value.focus() }), (m, p) => (b(), S("div", Ae, [
|
|
280
|
+
m.$slots.prefix ? (b(), S("div", Me, [
|
|
281
|
+
v(m.$slots, "prefix")
|
|
274
282
|
])) : N("", !0),
|
|
275
|
-
|
|
283
|
+
U(D("input", {
|
|
276
284
|
ref_key: "input",
|
|
277
|
-
ref:
|
|
285
|
+
ref: g,
|
|
278
286
|
type: i.value,
|
|
279
287
|
inputmode: o.value,
|
|
280
|
-
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]),
|
|
281
289
|
value: e.modelValue,
|
|
282
290
|
min: e.min,
|
|
283
291
|
max: e.max,
|
|
284
292
|
step: n.value,
|
|
285
|
-
onInput:
|
|
286
|
-
}, null,
|
|
287
|
-
[z(
|
|
293
|
+
onInput: f
|
|
294
|
+
}, null, 42, Ie), [
|
|
295
|
+
[z($e), e.mask]
|
|
288
296
|
]),
|
|
289
|
-
|
|
290
|
-
v(
|
|
297
|
+
m.$slots.suffix ? (b(), S("div", Te, [
|
|
298
|
+
v(m.$slots, "suffix")
|
|
291
299
|
])) : N("", !0)
|
|
292
300
|
]));
|
|
293
301
|
}
|
|
@@ -322,39 +330,39 @@ const D = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
|
|
|
322
330
|
import("date-fns"),
|
|
323
331
|
import("date-fns-tz")
|
|
324
332
|
]));
|
|
325
|
-
}, u =
|
|
326
|
-
let
|
|
333
|
+
}, u = y(() => {
|
|
334
|
+
let c = "yyyy/MM/dd";
|
|
327
335
|
if (i.value && l)
|
|
328
336
|
try {
|
|
329
|
-
const r = oe("date.format").toString(),
|
|
330
|
-
l.format(
|
|
337
|
+
const r = oe("date.format").toString(), k = l.parse("29/10/1989", "P", /* @__PURE__ */ new Date());
|
|
338
|
+
l.format(k, r), c = r;
|
|
331
339
|
} catch {
|
|
332
340
|
}
|
|
333
|
-
return
|
|
341
|
+
return c;
|
|
334
342
|
}), i = I(!1);
|
|
335
343
|
T(async () => {
|
|
336
344
|
await s();
|
|
337
|
-
const
|
|
338
|
-
ie() && (i.value = !0, clearInterval(
|
|
345
|
+
const c = setInterval(() => {
|
|
346
|
+
ie() && (i.value = !0, clearInterval(c));
|
|
339
347
|
}, 50);
|
|
340
348
|
});
|
|
341
|
-
const o =
|
|
342
|
-
d("update:modelValue",
|
|
349
|
+
const o = y(() => re()), 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 = y(() => f(n.modelValue)), m = y(() => f(n.min)), p = y(() => f(n.max)), x = (c) => {
|
|
350
|
+
d("update:modelValue", c);
|
|
343
351
|
};
|
|
344
|
-
return (
|
|
345
|
-
u.value ? (
|
|
352
|
+
return (c, r) => (b(), S(se, null, [
|
|
353
|
+
u.value ? (b(), C(z(de), {
|
|
346
354
|
key: 0,
|
|
347
355
|
class: "print:hidden wv-input wv-date-input",
|
|
348
|
-
"model-value":
|
|
349
|
-
"min-date":
|
|
350
|
-
"max-date":
|
|
356
|
+
"model-value": g.value,
|
|
357
|
+
"min-date": m.value,
|
|
358
|
+
"max-date": p.value,
|
|
351
359
|
"enable-time-picker": e.enableTimePicker,
|
|
352
360
|
format: u.value,
|
|
353
361
|
locale: o.value,
|
|
354
362
|
range: e.range,
|
|
355
|
-
"select-text":
|
|
356
|
-
"cancel-text-text":
|
|
357
|
-
"now-button-label":
|
|
363
|
+
"select-text": c.$t("Select"),
|
|
364
|
+
"cancel-text-text": c.$t("Cancel"),
|
|
365
|
+
"now-button-label": c.$t("Now"),
|
|
358
366
|
"time-picker": !1,
|
|
359
367
|
"auto-apply": !0,
|
|
360
368
|
"partial-flow": !0,
|
|
@@ -385,9 +393,9 @@ const D = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
|
|
|
385
393
|
},
|
|
386
394
|
emits: ["update:checked", "update:modelValue"],
|
|
387
395
|
setup(e, { emit: a }) {
|
|
388
|
-
const l = a, t = e, s =
|
|
396
|
+
const l = a, t = e, s = y(() => ({
|
|
389
397
|
"--size": `${t.size}rem`
|
|
390
|
-
})), u =
|
|
398
|
+
})), u = y({
|
|
391
399
|
get() {
|
|
392
400
|
return !!t.modelValue;
|
|
393
401
|
},
|
|
@@ -395,10 +403,10 @@ const D = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
|
|
|
395
403
|
t.disabled || (l("update:modelValue", i), l("update:checked", i));
|
|
396
404
|
}
|
|
397
405
|
});
|
|
398
|
-
return (i, o) => (
|
|
399
|
-
class:
|
|
406
|
+
return (i, o) => (b(), S("label", {
|
|
407
|
+
class: V(["inline-flex items-center", { "cursor-pointer": !e.disabled }])
|
|
400
408
|
}, [
|
|
401
|
-
|
|
409
|
+
U(D("input", {
|
|
402
410
|
"onUpdate:modelValue": o[0] || (o[0] = (n) => u.value = n),
|
|
403
411
|
type: "checkbox",
|
|
404
412
|
value: "",
|
|
@@ -407,9 +415,9 @@ const D = /* @__PURE__ */ new WeakMap(), $e = (e, a) => {
|
|
|
407
415
|
}, null, 8, Be), [
|
|
408
416
|
[J, u.value]
|
|
409
417
|
]),
|
|
410
|
-
|
|
418
|
+
D("div", {
|
|
411
419
|
style: ue(s.value),
|
|
412
|
-
class:
|
|
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", {
|
|
413
421
|
"after:bg-gray-300": e.disabled,
|
|
414
422
|
"bg-gray-400": e.disabled,
|
|
415
423
|
"peer-checked:bg-blue-400": e.disabled
|
|
@@ -424,7 +432,7 @@ function Le(e, a) {
|
|
|
424
432
|
t[++l] = a(s, u, i);
|
|
425
433
|
}), t;
|
|
426
434
|
}
|
|
427
|
-
function
|
|
435
|
+
function P(e, a) {
|
|
428
436
|
var l = he(e) ? ce : Le;
|
|
429
437
|
return l(e, pe(a));
|
|
430
438
|
}
|
|
@@ -483,7 +491,7 @@ const ae = {
|
|
|
483
491
|
},
|
|
484
492
|
emits: ["update:modelValue", "tag"],
|
|
485
493
|
setup(e, { emit: a }) {
|
|
486
|
-
const l = a, t = e, s =
|
|
494
|
+
const l = a, t = e, s = y({
|
|
487
495
|
get() {
|
|
488
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);
|
|
489
497
|
},
|
|
@@ -492,29 +500,29 @@ const ae = {
|
|
|
492
500
|
if (!t.multiple)
|
|
493
501
|
l("update:modelValue", n == null ? void 0 : n.value);
|
|
494
502
|
else {
|
|
495
|
-
const d =
|
|
503
|
+
const d = P(n, (f) => f == null ? void 0 : f.value);
|
|
496
504
|
l("update:modelValue", d);
|
|
497
505
|
}
|
|
498
506
|
}
|
|
499
|
-
}), u =
|
|
507
|
+
}), u = y(() => P(t == null ? void 0 : t.options, (n) => typeof n == "string" ? {
|
|
500
508
|
label: n,
|
|
501
509
|
value: n
|
|
502
510
|
} : n) ?? []), i = (n) => {
|
|
503
511
|
if (t.deselectable) {
|
|
504
512
|
let d;
|
|
505
513
|
if (t.multiple) {
|
|
506
|
-
const
|
|
507
|
-
d =
|
|
514
|
+
const f = n == null ? void 0 : n.value;
|
|
515
|
+
d = P(s.value ?? [], (m) => m == null ? void 0 : m.value).filter((m) => m !== f);
|
|
508
516
|
}
|
|
509
517
|
l("update:modelValue", d);
|
|
510
518
|
}
|
|
511
519
|
}, o = (n) => {
|
|
512
520
|
l("tag", n);
|
|
513
521
|
};
|
|
514
|
-
return (n, d) => (
|
|
522
|
+
return (n, d) => (b(), C(z(me), {
|
|
515
523
|
id: "value",
|
|
516
524
|
modelValue: s.value,
|
|
517
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
525
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => s.value = f),
|
|
518
526
|
class: "wv-input wv-select-input border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm",
|
|
519
527
|
options: u.value,
|
|
520
528
|
placeholder: e.placeholder ?? n.$t("select.placeholder"),
|
|
@@ -532,79 +540,79 @@ const ae = {
|
|
|
532
540
|
onTag: o,
|
|
533
541
|
onRemove: i
|
|
534
542
|
}, q({
|
|
535
|
-
maxElements:
|
|
536
|
-
M(
|
|
543
|
+
maxElements: h(() => [
|
|
544
|
+
A(M(n.$tChoice("select.maxElements", e.max)), 1)
|
|
537
545
|
]),
|
|
538
|
-
noResult:
|
|
539
|
-
M(
|
|
546
|
+
noResult: h(() => [
|
|
547
|
+
A(M(n.$t("select.noResult")), 1)
|
|
540
548
|
]),
|
|
541
|
-
noOptions:
|
|
542
|
-
M(
|
|
549
|
+
noOptions: h(() => [
|
|
550
|
+
A(M(n.$t("select.noOptions")), 1)
|
|
543
551
|
]),
|
|
544
|
-
tag:
|
|
545
|
-
M(
|
|
552
|
+
tag: h(() => [
|
|
553
|
+
A(M(n.$t("select.tag")), 1)
|
|
546
554
|
]),
|
|
547
555
|
_: 2
|
|
548
556
|
}, [
|
|
549
557
|
n.$slots.beforeList ? {
|
|
550
558
|
name: "beforeList",
|
|
551
|
-
fn:
|
|
559
|
+
fn: h(() => [
|
|
552
560
|
v(n.$slots, "beforeList")
|
|
553
561
|
]),
|
|
554
562
|
key: "0"
|
|
555
563
|
} : void 0,
|
|
556
564
|
n.$slots.afterList ? {
|
|
557
565
|
name: "afterList",
|
|
558
|
-
fn:
|
|
566
|
+
fn: h(() => [
|
|
559
567
|
v(n.$slots, "afterList")
|
|
560
568
|
]),
|
|
561
569
|
key: "1"
|
|
562
570
|
} : void 0,
|
|
563
571
|
n.$slots.caret ? {
|
|
564
572
|
name: "caret",
|
|
565
|
-
fn:
|
|
573
|
+
fn: h(() => [
|
|
566
574
|
v(n.$slots, "caret")
|
|
567
575
|
]),
|
|
568
576
|
key: "2"
|
|
569
577
|
} : void 0,
|
|
570
578
|
n.$slots.singleLabel ? {
|
|
571
579
|
name: "singleLabel",
|
|
572
|
-
fn:
|
|
580
|
+
fn: h(() => [
|
|
573
581
|
v(n.$slots, "singleLabel")
|
|
574
582
|
]),
|
|
575
583
|
key: "3"
|
|
576
584
|
} : void 0,
|
|
577
585
|
n.$slots.placeholder ? {
|
|
578
586
|
name: "placeholder",
|
|
579
|
-
fn:
|
|
587
|
+
fn: h(() => [
|
|
580
588
|
v(n.$slots, "placeholder")
|
|
581
589
|
]),
|
|
582
590
|
key: "4"
|
|
583
591
|
} : void 0,
|
|
584
592
|
n.$slots.limit ? {
|
|
585
593
|
name: "limit",
|
|
586
|
-
fn:
|
|
594
|
+
fn: h(() => [
|
|
587
595
|
v(n.$slots, "limit")
|
|
588
596
|
]),
|
|
589
597
|
key: "5"
|
|
590
598
|
} : void 0,
|
|
591
599
|
n.$slots.clear ? {
|
|
592
600
|
name: "clear",
|
|
593
|
-
fn:
|
|
601
|
+
fn: h(() => [
|
|
594
602
|
v(n.$slots, "clear")
|
|
595
603
|
]),
|
|
596
604
|
key: "6"
|
|
597
605
|
} : void 0,
|
|
598
606
|
n.$slots.tag ? {
|
|
599
607
|
name: "tag",
|
|
600
|
-
fn:
|
|
608
|
+
fn: h(() => [
|
|
601
609
|
v(n.$slots, "tag")
|
|
602
610
|
]),
|
|
603
611
|
key: "7"
|
|
604
612
|
} : void 0,
|
|
605
613
|
n.$slots.selection ? {
|
|
606
614
|
name: "selection",
|
|
607
|
-
fn:
|
|
615
|
+
fn: h(() => [
|
|
608
616
|
v(n.$slots, "selection")
|
|
609
617
|
]),
|
|
610
618
|
key: "8"
|
|
@@ -622,7 +630,7 @@ const ae = {
|
|
|
622
630
|
const l = I(null);
|
|
623
631
|
return T(() => {
|
|
624
632
|
l.value.hasAttribute("autofocus") && l.value.focus();
|
|
625
|
-
}), a({ focus: () => l.value.focus() }), (t, s) => (
|
|
633
|
+
}), a({ focus: () => l.value.focus() }), (t, s) => (b(), S("textarea", {
|
|
626
634
|
ref_key: "input",
|
|
627
635
|
ref: l,
|
|
628
636
|
class: "wv-input wv-textarea-input border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm disabled:bg-gray-200",
|
|
@@ -631,7 +639,7 @@ const ae = {
|
|
|
631
639
|
onInput: s[0] || (s[0] = (u) => t.$emit("update:modelValue", u.target.value))
|
|
632
640
|
}, null, 40, Re));
|
|
633
641
|
}
|
|
634
|
-
},
|
|
642
|
+
}, Fe = {
|
|
635
643
|
key: 1,
|
|
636
644
|
class: "h-10 flex items-center"
|
|
637
645
|
}, ne = {
|
|
@@ -696,6 +704,10 @@ const ae = {
|
|
|
696
704
|
step: {
|
|
697
705
|
type: [String, Number],
|
|
698
706
|
default: null
|
|
707
|
+
},
|
|
708
|
+
inputClass: {
|
|
709
|
+
type: [String, Array, Object],
|
|
710
|
+
default: null
|
|
699
711
|
}
|
|
700
712
|
},
|
|
701
713
|
emits: ["update:modelValue", "tag"],
|
|
@@ -704,31 +716,31 @@ const ae = {
|
|
|
704
716
|
T(() => {
|
|
705
717
|
s.value = H("input_group_");
|
|
706
718
|
});
|
|
707
|
-
const u =
|
|
708
|
-
return (i, o) => e.type === "checkbox" ? (
|
|
719
|
+
const u = y(() => l.type === "tel" ? "(###) ###-####" : null);
|
|
720
|
+
return (i, o) => e.type === "checkbox" ? (b(), C(Y, {
|
|
709
721
|
key: 0,
|
|
710
722
|
id: s.value,
|
|
711
723
|
name: e.name,
|
|
712
724
|
"model-value": e.modelValue,
|
|
713
|
-
class:
|
|
725
|
+
class: V("size-10 " + e.customClass),
|
|
714
726
|
disabled: e.disabled,
|
|
715
727
|
"onUpdate:modelValue": o[0] || (o[0] = (n) => t("update:modelValue", n))
|
|
716
|
-
}, null, 8, ["id", "name", "model-value", "class", "disabled"])) : e.type === "toggle" ? (
|
|
728
|
+
}, null, 8, ["id", "name", "model-value", "class", "disabled"])) : e.type === "toggle" ? (b(), S("div", Fe, [
|
|
717
729
|
L(te, {
|
|
718
730
|
id: s.value,
|
|
719
731
|
name: e.name,
|
|
720
732
|
"model-value": !!e.modelValue,
|
|
721
733
|
size: "15",
|
|
722
|
-
class:
|
|
734
|
+
class: V(e.customClass),
|
|
723
735
|
disabled: e.disabled,
|
|
724
736
|
"onUpdate:modelValue": o[1] || (o[1] = (n) => t("update:modelValue", n))
|
|
725
737
|
}, null, 8, ["id", "name", "model-value", "class", "disabled"])
|
|
726
|
-
])) : e.type === "select" ? (
|
|
738
|
+
])) : e.type === "select" ? (b(), C(ae, {
|
|
727
739
|
key: 2,
|
|
728
740
|
id: s.value,
|
|
729
741
|
name: e.name,
|
|
730
742
|
"model-value": e.modelValue,
|
|
731
|
-
class:
|
|
743
|
+
class: V("w-full " + e.customClass),
|
|
732
744
|
options: e.options,
|
|
733
745
|
disabled: e.disabled,
|
|
734
746
|
multiple: e.multiple,
|
|
@@ -737,28 +749,28 @@ const ae = {
|
|
|
737
749
|
deselectable: e.deselectable,
|
|
738
750
|
"onUpdate:modelValue": o[2] || (o[2] = (n) => t("update:modelValue", n)),
|
|
739
751
|
onTag: o[3] || (o[3] = (n) => t("tag", n))
|
|
740
|
-
}, null, 8, ["id", "name", "model-value", "class", "options", "disabled", "multiple", "searchable", "taggable", "deselectable"])) : e.type === "textarea" ? (
|
|
752
|
+
}, null, 8, ["id", "name", "model-value", "class", "options", "disabled", "multiple", "searchable", "taggable", "deselectable"])) : e.type === "textarea" ? (b(), C(le, {
|
|
741
753
|
key: 3,
|
|
742
754
|
id: s.value,
|
|
743
755
|
name: e.name,
|
|
744
756
|
"model-value": e.modelValue,
|
|
745
|
-
class:
|
|
757
|
+
class: V("w-full " + e.customClass),
|
|
746
758
|
placeholder: e.placeholder,
|
|
747
759
|
disabled: e.disabled,
|
|
748
760
|
"onUpdate:modelValue": o[4] || (o[4] = (n) => t("update:modelValue", n))
|
|
749
|
-
}, null, 8, ["id", "name", "model-value", "class", "placeholder", "disabled"])) : e.type === "date" ? (
|
|
761
|
+
}, null, 8, ["id", "name", "model-value", "class", "placeholder", "disabled"])) : e.type === "date" ? (b(), C(ee, {
|
|
750
762
|
key: 4,
|
|
751
763
|
id: s.value,
|
|
752
764
|
name: e.name,
|
|
753
765
|
"model-value": e.modelValue,
|
|
754
|
-
class:
|
|
766
|
+
class: V("w-full " + e.customClass),
|
|
755
767
|
max: e.max,
|
|
756
768
|
min: e.min,
|
|
757
769
|
range: e.range,
|
|
758
770
|
"enable-time-picker": e.enableTimePicker,
|
|
759
771
|
disabled: e.disabled,
|
|
760
772
|
"onUpdate:modelValue": o[5] || (o[5] = (n) => t("update:modelValue", n))
|
|
761
|
-
}, null, 8, ["id", "name", "model-value", "class", "max", "min", "range", "enable-time-picker", "disabled"])) : (
|
|
773
|
+
}, null, 8, ["id", "name", "model-value", "class", "max", "min", "range", "enable-time-picker", "disabled"])) : (b(), C(W, {
|
|
762
774
|
key: 5,
|
|
763
775
|
id: s.value,
|
|
764
776
|
type: e.type,
|
|
@@ -771,26 +783,27 @@ const ae = {
|
|
|
771
783
|
mask: u.value,
|
|
772
784
|
precision: e.precision,
|
|
773
785
|
step: e.step,
|
|
774
|
-
class:
|
|
786
|
+
class: V("w-full " + e.customClass),
|
|
787
|
+
"input-class": e.inputClass,
|
|
775
788
|
"onUpdate:modelValue": o[6] || (o[6] = (n) => t("update:modelValue", n))
|
|
776
789
|
}, q({ _: 2 }, [
|
|
777
790
|
i.$slots.prefix ? {
|
|
778
791
|
name: "prefix",
|
|
779
|
-
fn:
|
|
792
|
+
fn: h(() => [
|
|
780
793
|
v(i.$slots, "prefix")
|
|
781
794
|
]),
|
|
782
795
|
key: "0"
|
|
783
796
|
} : void 0,
|
|
784
797
|
i.$slots.suffix ? {
|
|
785
798
|
name: "suffix",
|
|
786
|
-
fn:
|
|
799
|
+
fn: h(() => [
|
|
787
800
|
v(i.$slots, "suffix")
|
|
788
801
|
]),
|
|
789
802
|
key: "1"
|
|
790
803
|
} : void 0
|
|
791
|
-
]), 1032, ["id", "type", "name", "placeholder", "model-value", "disabled", "min", "max", "mask", "precision", "step", "class"]));
|
|
804
|
+
]), 1032, ["id", "type", "name", "placeholder", "model-value", "disabled", "min", "max", "mask", "precision", "step", "class", "input-class"]));
|
|
792
805
|
}
|
|
793
|
-
},
|
|
806
|
+
}, Oe = {
|
|
794
807
|
__name: "InputGroupComponent",
|
|
795
808
|
props: {
|
|
796
809
|
modelValue: String,
|
|
@@ -861,6 +874,10 @@ const ae = {
|
|
|
861
874
|
step: {
|
|
862
875
|
type: [String, Number],
|
|
863
876
|
default: null
|
|
877
|
+
},
|
|
878
|
+
inputClass: {
|
|
879
|
+
type: [String, Array, Object],
|
|
880
|
+
default: null
|
|
864
881
|
}
|
|
865
882
|
},
|
|
866
883
|
emits: ["update:modelValue", "tag"],
|
|
@@ -869,9 +886,9 @@ const ae = {
|
|
|
869
886
|
T(() => {
|
|
870
887
|
s.value = H("input_group_");
|
|
871
888
|
});
|
|
872
|
-
const u =
|
|
873
|
-
return (i, o) => (
|
|
874
|
-
class:
|
|
889
|
+
const u = y(() => l.type === "tel" ? "(###) ###-####" : null);
|
|
890
|
+
return (i, o) => (b(), S("div", {
|
|
891
|
+
class: V(["w-full", { error: e.errors !== null && e.errors !== "" }])
|
|
875
892
|
}, [
|
|
876
893
|
L(K, {
|
|
877
894
|
for: s.value,
|
|
@@ -879,8 +896,8 @@ const ae = {
|
|
|
879
896
|
required: e.required,
|
|
880
897
|
class: "w-full mb-2"
|
|
881
898
|
}, {
|
|
882
|
-
default:
|
|
883
|
-
M(
|
|
899
|
+
default: h(() => [
|
|
900
|
+
A(M(e.label), 1)
|
|
884
901
|
]),
|
|
885
902
|
_: 1
|
|
886
903
|
}, 8, ["for", "value", "required"]),
|
|
@@ -904,25 +921,26 @@ const ae = {
|
|
|
904
921
|
"custom-class": e.customClass,
|
|
905
922
|
precision: e.precision,
|
|
906
923
|
step: e.step,
|
|
924
|
+
"input-class": e.inputClass,
|
|
907
925
|
"onUpdate:modelValue": o[0] || (o[0] = (n) => t("update:modelValue", n)),
|
|
908
926
|
onTag: o[1] || (o[1] = (n) => t("tag", n))
|
|
909
927
|
}, q({ _: 2 }, [
|
|
910
928
|
i.$slots.prefix ? {
|
|
911
929
|
name: "prefix",
|
|
912
|
-
fn:
|
|
930
|
+
fn: h(() => [
|
|
913
931
|
v(i.$slots, "prefix")
|
|
914
932
|
]),
|
|
915
933
|
key: "0"
|
|
916
934
|
} : void 0,
|
|
917
935
|
i.$slots.suffix ? {
|
|
918
936
|
name: "suffix",
|
|
919
|
-
fn:
|
|
937
|
+
fn: h(() => [
|
|
920
938
|
v(i.$slots, "suffix")
|
|
921
939
|
]),
|
|
922
940
|
key: "1"
|
|
923
941
|
} : void 0
|
|
924
|
-
]), 1032, ["id", "name", "type", "model-value", "disabled", "multiple", "options", "max", "min", "range", "mask", "searchable", "placeholder", "taggable", "deselectable", "enable-time-picker", "custom-class", "precision", "step"]),
|
|
925
|
-
e.errors ? (
|
|
942
|
+
]), 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"]),
|
|
943
|
+
e.errors ? (b(), C(Q, {
|
|
926
944
|
key: 0,
|
|
927
945
|
class: "mt-2",
|
|
928
946
|
message: e.errors
|
|
@@ -934,7 +952,7 @@ const ae = {
|
|
|
934
952
|
DateComponent: ee,
|
|
935
953
|
ErrorComponent: Q,
|
|
936
954
|
InputComponent: ne,
|
|
937
|
-
InputGroupComponent:
|
|
955
|
+
InputGroupComponent: Oe,
|
|
938
956
|
LabelComponent: K,
|
|
939
957
|
SelectComponent: ae,
|
|
940
958
|
TextareaComponent: le,
|
|
@@ -946,7 +964,7 @@ export {
|
|
|
946
964
|
ee as DateComponent,
|
|
947
965
|
Q as ErrorComponent,
|
|
948
966
|
ne as InputComponent,
|
|
949
|
-
|
|
967
|
+
Oe as InputGroupComponent,
|
|
950
968
|
K as LabelComponent,
|
|
951
969
|
ae as SelectComponent,
|
|
952
970
|
W as TextInputComponent,
|