@webilio-xyz/webilio-vue 1.1.8 → 1.1.10
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 +124 -109
- package/package.json +1 -1
package/dist/Input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { computed as v, withDirectives as U, openBlock as b, createElementBlock as
|
|
2
|
-
import { trans as
|
|
1
|
+
import { computed as v, withDirectives as U, openBlock as b, createElementBlock as w, vModelCheckbox as J, ref as A, onMounted as M, normalizeClass as V, renderSlot as y, createCommentVNode as N, createElementVNode as D, unref as z, Fragment as se, createBlock as $, createVNode as L, normalizeStyle as ue, createSlots as q, withCtx as h, createTextVNode as T, toDisplayString as E, normalizeProps as re, guardReactiveProps as ie } from "vue";
|
|
2
|
+
import { trans as oe, isLoaded as de, getActiveLanguage as me } from "laravel-vue-i18n";
|
|
3
3
|
import ce from "@vuepic/vue-datepicker";
|
|
4
4
|
import { s as pe, u as H, _ as K, E as Q } from "./LabelComponent-DgoJlPcL.js";
|
|
5
5
|
import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -29,10 +29,10 @@ const ve = ["disabled"], Y = {
|
|
|
29
29
|
l("update:checked", u), l("update:modelValue", u);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
return (u,
|
|
33
|
-
"onUpdate:modelValue":
|
|
32
|
+
return (u, i) => U((b(), w("input", {
|
|
33
|
+
"onUpdate:modelValue": i[0] || (i[0] = (r) => s.value = r),
|
|
34
34
|
disabled: e.disabled,
|
|
35
|
-
class: "wv-input wv-checkbox-input rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 disabled:bg-gray-400",
|
|
35
|
+
class: "wv-input wv-checkbox-input rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 disabled:bg-gray-400 disabled:text-gray-400",
|
|
36
36
|
type: "checkbox"
|
|
37
37
|
}, null, 8, ve)), [
|
|
38
38
|
[J, s.value]
|
|
@@ -52,20 +52,20 @@ const j = {
|
|
|
52
52
|
roundingMode: "trunc"
|
|
53
53
|
});
|
|
54
54
|
}, Ve = (e, a = !0, l) => {
|
|
55
|
-
var t, s, u,
|
|
56
|
-
const
|
|
55
|
+
var t, s, u, i;
|
|
56
|
+
const r = ((t = l.number) == null ? void 0 : t.unsigned) == null && e.startsWith("-") ? "-" : "", n = ((s = l.number) == null ? void 0 : s.fraction) ?? 0;
|
|
57
57
|
let d = G(0, n, l);
|
|
58
|
-
const f = d.formatToParts(1000.12), g = ((u = f.find((
|
|
59
|
-
if (p === "" || Number.isNaN(p)) return
|
|
58
|
+
const f = d.formatToParts(1000.12), g = ((u = f.find((o) => o.type === "group")) == null ? void 0 : u.value) ?? " ", m = ((i = f.find((o) => o.type === "decimal")) == null ? void 0 : i.value) ?? ".", p = Z(e, g, m);
|
|
59
|
+
if (p === "" || Number.isNaN(p)) return r;
|
|
60
60
|
const x = p.split(".");
|
|
61
61
|
if (x[1] != null && x[1].length >= 1) {
|
|
62
|
-
const
|
|
63
|
-
d = G(
|
|
62
|
+
const o = x[1].length <= n ? x[1].length : n;
|
|
63
|
+
d = G(o, n, l);
|
|
64
64
|
}
|
|
65
65
|
let c = d.format(parseFloat(p));
|
|
66
|
-
return a ? n > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (c += m) : c = Z(c, g, m),
|
|
66
|
+
return a ? n > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (c += m) : c = Z(c, g, m), r + c;
|
|
67
67
|
};
|
|
68
|
-
class
|
|
68
|
+
class Se {
|
|
69
69
|
constructor(a = {}) {
|
|
70
70
|
R(this, "opts", {}), R(this, "memo", /* @__PURE__ */ new Map());
|
|
71
71
|
const l = { ...a };
|
|
@@ -117,30 +117,30 @@ class we {
|
|
|
117
117
|
if (l == null) return a;
|
|
118
118
|
const s = `v=${a},mr=${l},m=${t ? 1 : 0}`;
|
|
119
119
|
if (this.memo.has(s)) return this.memo.get(s);
|
|
120
|
-
const { mask: u, escaped:
|
|
121
|
-
let x, c = -1,
|
|
120
|
+
const { mask: u, escaped: i } = this.escapeMask(l), r = [], 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() ? () => o > -1 && k > -1 : () => o < u.length && k < a.length, p = (C) => !this.isReversed() && C <= g || this.isReversed() && C >= g;
|
|
121
|
+
let x, c = -1, o = this.isReversed() ? u.length - 1 : 0, k = this.isReversed() ? a.length - 1 : 0, P = !1;
|
|
122
122
|
for (; m(); ) {
|
|
123
|
-
const C = u.charAt(
|
|
124
|
-
if (!
|
|
125
|
-
for (; p(
|
|
123
|
+
const C = u.charAt(o), S = n[C], I = (S == null ? void 0 : S.transform) != null ? S.transform(a.charAt(k)) : a.charAt(k);
|
|
124
|
+
if (!i.includes(o) && S != null ? (I.match(S.pattern) != null ? (r[f](I), S.repeated ? (c === -1 ? c = o : o === g && o !== c && (o = c - d), g === c && (o -= d)) : S.multiple && (P = !0, o -= d), o += d) : S.multiple ? P && (o += d, k -= d, P = !1) : I === x ? x = void 0 : S.optional && (o += d, k -= d), k += d) : (t && !this.isEager() && r[f](C), I === C && !this.isEager() ? k += d : x = C, this.isEager() || (o += d)), this.isEager())
|
|
125
|
+
for (; p(o) && (n[u.charAt(o)] == null || i.includes(o)); ) {
|
|
126
126
|
if (t) {
|
|
127
|
-
if (
|
|
128
|
-
|
|
127
|
+
if (r[f](u.charAt(o)), a.charAt(k) === u.charAt(o)) {
|
|
128
|
+
o += d, k += d;
|
|
129
129
|
continue;
|
|
130
130
|
}
|
|
131
|
-
} else u.charAt(
|
|
132
|
-
|
|
131
|
+
} else u.charAt(o) === a.charAt(k) && (k += d);
|
|
132
|
+
o += d;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
return this.memo.set(s,
|
|
135
|
+
return this.memo.set(s, r.join("")), this.memo.get(s);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
const _ = (e) => JSON.parse(e.replaceAll("'", '"')),
|
|
138
|
+
const _ = (e) => JSON.parse(e.replaceAll("'", '"')), we = (e, a = {}) => {
|
|
139
139
|
const l = { ...a };
|
|
140
|
-
e.dataset.maska != null && e.dataset.maska !== "" && (l.mask = $e(e.dataset.maska)), e.dataset.maskaEager != null && (l.eager =
|
|
140
|
+
e.dataset.maska != null && e.dataset.maska !== "" && (l.mask = $e(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 = Ce(e.dataset.maskaTokens));
|
|
141
141
|
const t = {};
|
|
142
|
-
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 =
|
|
143
|
-
},
|
|
142
|
+
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;
|
|
143
|
+
}, B = (e) => e !== "" ? !!JSON.parse(e) : !0, $e = (e) => e.startsWith("[") && e.endsWith("]") ? _(e) : e, Ce = (e) => {
|
|
144
144
|
if (e.startsWith("{") && e.endsWith("}"))
|
|
145
145
|
return _(e);
|
|
146
146
|
const a = {};
|
|
@@ -159,8 +159,8 @@ class Ae {
|
|
|
159
159
|
R(this, "items", /* @__PURE__ */ new Map()), R(this, "onInput", (t) => {
|
|
160
160
|
if (t instanceof CustomEvent && t.type === "input")
|
|
161
161
|
return;
|
|
162
|
-
const s = t.target, u = this.items.get(s),
|
|
163
|
-
this.fixCursor(s,
|
|
162
|
+
const s = t.target, u = this.items.get(s), i = "inputType" in t && t.inputType.startsWith("delete"), r = u.isEager(), n = i && r && u.unmasked(s.value) === "" ? "" : s.value;
|
|
163
|
+
this.fixCursor(s, i, () => this.setValue(s, n));
|
|
164
164
|
}), this.options = l, this.init(this.getInputs(a));
|
|
165
165
|
}
|
|
166
166
|
update(a = {}) {
|
|
@@ -178,7 +178,7 @@ class Ae {
|
|
|
178
178
|
const l = this.getOptions(this.options);
|
|
179
179
|
for (const t of a) {
|
|
180
180
|
this.items.has(t) || t.addEventListener("input", this.onInput, { capture: !0 });
|
|
181
|
-
const s = new we(
|
|
181
|
+
const s = new Se(we(t, l));
|
|
182
182
|
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);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -192,9 +192,9 @@ class Ae {
|
|
|
192
192
|
fixCursor(a, l, t) {
|
|
193
193
|
const s = a.selectionStart, u = a.value;
|
|
194
194
|
if (t(), s === null || s === u.length && !l) return;
|
|
195
|
-
const
|
|
195
|
+
const i = a.value, r = u.slice(0, s), n = i.slice(0, s), d = this.processInput(a, r).unmasked, f = this.processInput(a, n).unmasked;
|
|
196
196
|
let g = s;
|
|
197
|
-
|
|
197
|
+
r !== n && (g += l ? i.length - u.length : d.length - f.length), a.setSelectionRange(g, g);
|
|
198
198
|
}
|
|
199
199
|
setValue(a, l) {
|
|
200
200
|
const t = this.processInput(a, l);
|
|
@@ -222,17 +222,17 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
222
222
|
if (t == null || (t == null ? void 0 : t.type) === "file") return;
|
|
223
223
|
let s = {};
|
|
224
224
|
if (a.value != null && (s = typeof a.value == "string" ? { mask: a.value } : { ...a.value }), a.arg != null) {
|
|
225
|
-
const u = (
|
|
226
|
-
const
|
|
227
|
-
Me(a,
|
|
225
|
+
const u = (i) => {
|
|
226
|
+
const r = a.modifiers.unmasked ? i.unmasked : a.modifiers.completed ? i.completed : i.masked;
|
|
227
|
+
Me(a, r);
|
|
228
228
|
};
|
|
229
229
|
s.onMaska = s.onMaska == null ? u : Array.isArray(s.onMaska) ? [...s.onMaska, u] : [s.onMaska, u];
|
|
230
230
|
}
|
|
231
231
|
F.has(t) ? (l = F.get(t)) == null || l.update(s) : F.set(t, new Ae(t, s));
|
|
232
|
-
},
|
|
232
|
+
}, Be = {
|
|
233
233
|
key: 0,
|
|
234
234
|
class: "wv-text-input-prefix flex items-center pl-2"
|
|
235
|
-
},
|
|
235
|
+
}, Te = ["disabled", "inputmode", "max", "min", "step", "type", "value"], Ee = {
|
|
236
236
|
key: 1,
|
|
237
237
|
class: "wv-text-input-suffix flex items-center pr-2"
|
|
238
238
|
}, W = {
|
|
@@ -268,7 +268,7 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
268
268
|
},
|
|
269
269
|
emits: ["update:modelValue"],
|
|
270
270
|
setup(e, { expose: a, emit: l }) {
|
|
271
|
-
const t = e, s = l, u = v(() => t.type === "number"),
|
|
271
|
+
const t = e, s = l, u = v(() => t.type === "number"), i = v(() => u.value && t.precision !== null ? "text" : t.type), r = 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) => {
|
|
272
272
|
if (!u.value || m === "" || m === "-" || m === "." || m === "-.") return m;
|
|
273
273
|
const p = parseFloat(m);
|
|
274
274
|
return isNaN(p) ? m : t.min !== null && p < parseFloat(t.min) ? t.min : t.max !== null && p > parseFloat(t.max) ? t.max : m;
|
|
@@ -285,10 +285,10 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
285
285
|
}, g = A(null);
|
|
286
286
|
return M(() => {
|
|
287
287
|
g.value.hasAttribute("autofocus") && g.value.focus();
|
|
288
|
-
}), a({ focus: () => g.value.focus() }), (m, p) => (b(),
|
|
288
|
+
}), a({ focus: () => g.value.focus() }), (m, p) => (b(), w("div", {
|
|
289
289
|
class: V(["wv-input 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", { "disabled-input": e.disabled }])
|
|
290
290
|
}, [
|
|
291
|
-
m.$slots.prefix ? (b(),
|
|
291
|
+
m.$slots.prefix ? (b(), w("div", Be, [
|
|
292
292
|
y(m.$slots, "prefix")
|
|
293
293
|
])) : N("", !0),
|
|
294
294
|
U(D("input", {
|
|
@@ -296,17 +296,17 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
296
296
|
ref: g,
|
|
297
297
|
class: V(["wv-text-input flex-1 border-0 focus:ring-0 disabled:bg-gray-200 px-1", e.inputClass]),
|
|
298
298
|
disabled: e.disabled,
|
|
299
|
-
inputmode:
|
|
299
|
+
inputmode: r.value,
|
|
300
300
|
max: e.max,
|
|
301
301
|
min: e.min,
|
|
302
302
|
step: n.value,
|
|
303
|
-
type:
|
|
303
|
+
type: i.value,
|
|
304
304
|
value: e.modelValue,
|
|
305
305
|
onInput: f
|
|
306
|
-
}, null, 42,
|
|
306
|
+
}, null, 42, Te), [
|
|
307
307
|
[z(Ie), e.mask]
|
|
308
308
|
]),
|
|
309
|
-
m.$slots.suffix ? (b(),
|
|
309
|
+
m.$slots.suffix ? (b(), w("div", Ee, [
|
|
310
310
|
y(m.$slots, "suffix")
|
|
311
311
|
])) : N("", !0)
|
|
312
312
|
], 2));
|
|
@@ -344,24 +344,24 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
344
344
|
]));
|
|
345
345
|
}, u = v(() => {
|
|
346
346
|
let c = "yyyy/MM/dd";
|
|
347
|
-
if (
|
|
347
|
+
if (i.value && l)
|
|
348
348
|
try {
|
|
349
|
-
const
|
|
350
|
-
l.format(k,
|
|
349
|
+
const o = oe("date.format").toString(), k = l.parse("29/10/1989", "P", /* @__PURE__ */ new Date());
|
|
350
|
+
l.format(k, o), c = o;
|
|
351
351
|
} catch {
|
|
352
352
|
}
|
|
353
353
|
return c;
|
|
354
|
-
}),
|
|
354
|
+
}), i = A(!1);
|
|
355
355
|
M(async () => {
|
|
356
356
|
await s();
|
|
357
357
|
const c = setInterval(() => {
|
|
358
|
-
de() && (
|
|
358
|
+
de() && (i.value = !0, clearInterval(c));
|
|
359
359
|
}, 50);
|
|
360
360
|
});
|
|
361
|
-
const
|
|
361
|
+
const r = v(() => me()), n = e, d = a, f = (c) => !c || !t ? null : Array.isArray(c) ? c.map((o) => t.fromZonedTime(o, 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) => {
|
|
362
362
|
d("update:modelValue", c);
|
|
363
363
|
};
|
|
364
|
-
return (c,
|
|
364
|
+
return (c, o) => (b(), w(se, null, [
|
|
365
365
|
u.value ? (b(), $(z(ce), {
|
|
366
366
|
key: 0,
|
|
367
367
|
class: "print:hidden wv-input wv-date-input",
|
|
@@ -370,7 +370,7 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
370
370
|
"max-date": p.value,
|
|
371
371
|
"enable-time-picker": e.enableTimePicker,
|
|
372
372
|
format: u.value,
|
|
373
|
-
locale:
|
|
373
|
+
locale: r.value,
|
|
374
374
|
range: e.range,
|
|
375
375
|
"select-text": c.$t("Select"),
|
|
376
376
|
"cancel-text-text": c.$t("Cancel"),
|
|
@@ -411,15 +411,15 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
411
411
|
get() {
|
|
412
412
|
return !!t.modelValue;
|
|
413
413
|
},
|
|
414
|
-
set(
|
|
415
|
-
t.disabled || (l("update:modelValue",
|
|
414
|
+
set(i) {
|
|
415
|
+
t.disabled || (l("update:modelValue", i), l("update:checked", i));
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
|
-
return (
|
|
418
|
+
return (i, r) => (b(), w("label", {
|
|
419
419
|
class: V(["inline-flex items-center", { "cursor-pointer": !e.disabled }])
|
|
420
420
|
}, [
|
|
421
421
|
U(D("input", {
|
|
422
|
-
"onUpdate:modelValue":
|
|
422
|
+
"onUpdate:modelValue": r[0] || (r[0] = (n) => u.value = n),
|
|
423
423
|
type: "checkbox",
|
|
424
424
|
value: "",
|
|
425
425
|
disabled: e.disabled,
|
|
@@ -440,8 +440,8 @@ const F = /* @__PURE__ */ new WeakMap(), Me = (e, a) => {
|
|
|
440
440
|
}, te = /* @__PURE__ */ X(Re, [["__scopeId", "data-v-bd8a97d8"]]);
|
|
441
441
|
function Pe(e, a) {
|
|
442
442
|
var l = -1, t = he(e) ? Array(e.length) : [];
|
|
443
|
-
return be(e, function(s, u,
|
|
444
|
-
t[++l] = a(s, u,
|
|
443
|
+
return be(e, function(s, u, i) {
|
|
444
|
+
t[++l] = a(s, u, i);
|
|
445
445
|
}), t;
|
|
446
446
|
}
|
|
447
447
|
function O(e, a) {
|
|
@@ -499,6 +499,10 @@ const ae = {
|
|
|
499
499
|
taggable: {
|
|
500
500
|
type: Boolean,
|
|
501
501
|
default: !1
|
|
502
|
+
},
|
|
503
|
+
preserveSearch: {
|
|
504
|
+
type: Boolean,
|
|
505
|
+
default: !1
|
|
502
506
|
}
|
|
503
507
|
},
|
|
504
508
|
emits: ["update:modelValue", "tag"],
|
|
@@ -519,7 +523,7 @@ const ae = {
|
|
|
519
523
|
}), u = v(() => O(t == null ? void 0 : t.options, (n) => typeof n == "string" ? {
|
|
520
524
|
label: n,
|
|
521
525
|
value: n
|
|
522
|
-
} : n) ?? []),
|
|
526
|
+
} : n) ?? []), i = (n) => {
|
|
523
527
|
if (t.deselectable) {
|
|
524
528
|
let d;
|
|
525
529
|
if (t.multiple) {
|
|
@@ -528,7 +532,7 @@ const ae = {
|
|
|
528
532
|
}
|
|
529
533
|
l("update:modelValue", d);
|
|
530
534
|
}
|
|
531
|
-
},
|
|
535
|
+
}, r = (n) => {
|
|
532
536
|
l("tag", n);
|
|
533
537
|
};
|
|
534
538
|
return (n, d) => (b(), $(z(pe), {
|
|
@@ -549,24 +553,25 @@ const ae = {
|
|
|
549
553
|
"group-values": e.groupValues,
|
|
550
554
|
"group-label": e.groupLabel,
|
|
551
555
|
taggable: e.taggable,
|
|
552
|
-
|
|
553
|
-
|
|
556
|
+
preserveSearch: e.preserveSearch,
|
|
557
|
+
onTag: r,
|
|
558
|
+
onRemove: i
|
|
554
559
|
}, q({
|
|
555
560
|
maxElements: h(() => [
|
|
556
|
-
E(
|
|
561
|
+
T(E(n.$tChoice("select.maxElements", e.max)), 1)
|
|
557
562
|
]),
|
|
558
563
|
noResult: h(() => [
|
|
559
|
-
E(
|
|
564
|
+
T(E(n.$t("select.noResult")), 1)
|
|
560
565
|
]),
|
|
561
566
|
noOptions: h(() => [
|
|
562
|
-
E(
|
|
567
|
+
T(E(n.$t("select.noOptions")), 1)
|
|
563
568
|
]),
|
|
564
569
|
_: 2
|
|
565
570
|
}, [
|
|
566
571
|
n.$slots.tag ? {
|
|
567
572
|
name: "tag",
|
|
568
573
|
fn: h((f) => [
|
|
569
|
-
y(n.$slots, "tag", ie(
|
|
574
|
+
y(n.$slots, "tag", re(ie(f)))
|
|
570
575
|
]),
|
|
571
576
|
key: "0"
|
|
572
577
|
} : void 0,
|
|
@@ -633,7 +638,7 @@ const ae = {
|
|
|
633
638
|
]),
|
|
634
639
|
key: "9"
|
|
635
640
|
} : void 0
|
|
636
|
-
]), 1032, ["modelValue", "options", "placeholder", "multiple", "max", "open-direction", "close-on-select", "searchable", "group-select", "group-values", "group-label", "taggable"]));
|
|
641
|
+
]), 1032, ["modelValue", "options", "placeholder", "multiple", "max", "open-direction", "close-on-select", "searchable", "group-select", "group-values", "group-label", "taggable", "preserveSearch"]));
|
|
637
642
|
}
|
|
638
643
|
}, Fe = ["value", "placeholder"], le = {
|
|
639
644
|
__name: "TextareaComponent",
|
|
@@ -646,7 +651,7 @@ const ae = {
|
|
|
646
651
|
const l = A(null);
|
|
647
652
|
return M(() => {
|
|
648
653
|
l.value.hasAttribute("autofocus") && l.value.focus();
|
|
649
|
-
}), a({ focus: () => l.value.focus() }), (t, s) => (b(),
|
|
654
|
+
}), a({ focus: () => l.value.focus() }), (t, s) => (b(), w("textarea", {
|
|
650
655
|
ref_key: "input",
|
|
651
656
|
ref: l,
|
|
652
657
|
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",
|
|
@@ -724,6 +729,10 @@ const ae = {
|
|
|
724
729
|
inputClass: {
|
|
725
730
|
type: [String, Array, Object],
|
|
726
731
|
default: null
|
|
732
|
+
},
|
|
733
|
+
preserveSearch: {
|
|
734
|
+
type: Boolean,
|
|
735
|
+
default: !1
|
|
727
736
|
}
|
|
728
737
|
},
|
|
729
738
|
emits: ["update:modelValue", "tag"],
|
|
@@ -733,15 +742,15 @@ const ae = {
|
|
|
733
742
|
s.value = H("input_group_");
|
|
734
743
|
});
|
|
735
744
|
const u = v(() => l.type === "tel" ? "(###) ###-####" : null);
|
|
736
|
-
return (
|
|
745
|
+
return (i, r) => e.type === "checkbox" ? (b(), $(Y, {
|
|
737
746
|
key: 0,
|
|
738
747
|
id: s.value,
|
|
739
748
|
name: e.name,
|
|
740
749
|
"model-value": e.modelValue,
|
|
741
750
|
class: V("size-10 " + e.customClass),
|
|
742
751
|
disabled: e.disabled,
|
|
743
|
-
"onUpdate:modelValue":
|
|
744
|
-
}, null, 8, ["id", "name", "model-value", "class", "disabled"])) : e.type === "toggle" ? (b(),
|
|
752
|
+
"onUpdate:modelValue": r[0] || (r[0] = (n) => t("update:modelValue", n))
|
|
753
|
+
}, null, 8, ["id", "name", "model-value", "class", "disabled"])) : e.type === "toggle" ? (b(), w("div", Oe, [
|
|
745
754
|
L(te, {
|
|
746
755
|
id: s.value,
|
|
747
756
|
name: e.name,
|
|
@@ -749,7 +758,7 @@ const ae = {
|
|
|
749
758
|
size: "15",
|
|
750
759
|
class: V(e.customClass),
|
|
751
760
|
disabled: e.disabled,
|
|
752
|
-
"onUpdate:modelValue":
|
|
761
|
+
"onUpdate:modelValue": r[1] || (r[1] = (n) => t("update:modelValue", n))
|
|
753
762
|
}, null, 8, ["id", "name", "model-value", "class", "disabled"])
|
|
754
763
|
])) : e.type === "select" ? (b(), $(ae, {
|
|
755
764
|
key: 2,
|
|
@@ -763,9 +772,10 @@ const ae = {
|
|
|
763
772
|
searchable: e.searchable,
|
|
764
773
|
taggable: e.taggable,
|
|
765
774
|
deselectable: e.deselectable,
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
775
|
+
preserveSearch: e.preserveSearch,
|
|
776
|
+
"onUpdate:modelValue": r[2] || (r[2] = (n) => t("update:modelValue", n)),
|
|
777
|
+
onTag: r[3] || (r[3] = (n) => t("tag", n))
|
|
778
|
+
}, null, 8, ["id", "name", "model-value", "class", "options", "disabled", "multiple", "searchable", "taggable", "deselectable", "preserveSearch"])) : e.type === "textarea" ? (b(), $(le, {
|
|
769
779
|
key: 3,
|
|
770
780
|
id: s.value,
|
|
771
781
|
name: e.name,
|
|
@@ -773,7 +783,7 @@ const ae = {
|
|
|
773
783
|
class: V("w-full " + e.customClass),
|
|
774
784
|
placeholder: e.placeholder,
|
|
775
785
|
disabled: e.disabled,
|
|
776
|
-
"onUpdate:modelValue":
|
|
786
|
+
"onUpdate:modelValue": r[4] || (r[4] = (n) => t("update:modelValue", n))
|
|
777
787
|
}, null, 8, ["id", "name", "model-value", "class", "placeholder", "disabled"])) : e.type === "date" ? (b(), $(ee, {
|
|
778
788
|
key: 4,
|
|
779
789
|
id: s.value,
|
|
@@ -785,7 +795,7 @@ const ae = {
|
|
|
785
795
|
range: e.range,
|
|
786
796
|
"enable-time-picker": e.enableTimePicker,
|
|
787
797
|
disabled: e.disabled,
|
|
788
|
-
"onUpdate:modelValue":
|
|
798
|
+
"onUpdate:modelValue": r[5] || (r[5] = (n) => t("update:modelValue", n))
|
|
789
799
|
}, null, 8, ["id", "name", "model-value", "class", "max", "min", "range", "enable-time-picker", "disabled"])) : (b(), $(W, {
|
|
790
800
|
key: 5,
|
|
791
801
|
id: s.value,
|
|
@@ -801,19 +811,19 @@ const ae = {
|
|
|
801
811
|
step: e.step,
|
|
802
812
|
class: V("w-full " + e.customClass),
|
|
803
813
|
"input-class": e.inputClass,
|
|
804
|
-
"onUpdate:modelValue":
|
|
814
|
+
"onUpdate:modelValue": r[6] || (r[6] = (n) => t("update:modelValue", n))
|
|
805
815
|
}, q({ _: 2 }, [
|
|
806
|
-
|
|
816
|
+
i.$slots.prefix ? {
|
|
807
817
|
name: "prefix",
|
|
808
818
|
fn: h(() => [
|
|
809
|
-
y(
|
|
819
|
+
y(i.$slots, "prefix")
|
|
810
820
|
]),
|
|
811
821
|
key: "0"
|
|
812
822
|
} : void 0,
|
|
813
|
-
|
|
823
|
+
i.$slots.suffix ? {
|
|
814
824
|
name: "suffix",
|
|
815
825
|
fn: h(() => [
|
|
816
|
-
y(
|
|
826
|
+
y(i.$slots, "suffix")
|
|
817
827
|
]),
|
|
818
828
|
key: "1"
|
|
819
829
|
} : void 0
|
|
@@ -894,6 +904,10 @@ const ae = {
|
|
|
894
904
|
inputClass: {
|
|
895
905
|
type: [String, Array, Object],
|
|
896
906
|
default: null
|
|
907
|
+
},
|
|
908
|
+
preserveSearch: {
|
|
909
|
+
type: Boolean,
|
|
910
|
+
default: !1
|
|
897
911
|
}
|
|
898
912
|
},
|
|
899
913
|
emits: ["update:modelValue", "tag"],
|
|
@@ -903,63 +917,64 @@ const ae = {
|
|
|
903
917
|
s.value = H("input_group_");
|
|
904
918
|
});
|
|
905
919
|
const u = v(() => l.type === "tel" ? "(###) ###-####" : null);
|
|
906
|
-
return (
|
|
907
|
-
class: V([
|
|
920
|
+
return (i, r) => (b(), w("div", {
|
|
921
|
+
class: V([{ error: e.errors !== null && e.errors !== "" }, "w-full"])
|
|
908
922
|
}, [
|
|
909
923
|
L(K, {
|
|
910
924
|
for: s.value,
|
|
911
|
-
value: e.label,
|
|
912
925
|
required: e.required,
|
|
926
|
+
value: e.label,
|
|
913
927
|
class: "w-full mb-2"
|
|
914
928
|
}, {
|
|
915
929
|
default: h(() => [
|
|
916
|
-
E(
|
|
930
|
+
T(E(e.label), 1)
|
|
917
931
|
]),
|
|
918
932
|
_: 1
|
|
919
|
-
}, 8, ["for", "
|
|
933
|
+
}, 8, ["for", "required", "value"]),
|
|
920
934
|
L(ne, {
|
|
921
935
|
id: s.value,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
"model-value": e.modelValue ?? null,
|
|
936
|
+
"custom-class": e.customClass,
|
|
937
|
+
deselectable: e.deselectable,
|
|
925
938
|
disabled: e.disabled,
|
|
926
|
-
|
|
927
|
-
|
|
939
|
+
"enable-time-picker": e.enableTimePicker,
|
|
940
|
+
"input-class": e.inputClass,
|
|
941
|
+
mask: u.value,
|
|
928
942
|
max: e.max,
|
|
929
943
|
min: e.min,
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
944
|
+
"model-value": e.modelValue ?? null,
|
|
945
|
+
multiple: e.multiple,
|
|
946
|
+
name: e.name,
|
|
947
|
+
options: e.options,
|
|
933
948
|
placeholder: e.placeholder,
|
|
934
|
-
taggable: e.taggable,
|
|
935
|
-
deselectable: e.deselectable,
|
|
936
|
-
"enable-time-picker": e.enableTimePicker,
|
|
937
|
-
"custom-class": e.customClass,
|
|
938
949
|
precision: e.precision,
|
|
950
|
+
range: e.range,
|
|
951
|
+
searchable: e.searchable,
|
|
939
952
|
step: e.step,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
953
|
+
taggable: e.taggable,
|
|
954
|
+
type: e.type,
|
|
955
|
+
preserveSearch: e.preserveSearch,
|
|
956
|
+
onTag: r[0] || (r[0] = (n) => t("tag", n)),
|
|
957
|
+
"onUpdate:modelValue": r[1] || (r[1] = (n) => t("update:modelValue", n))
|
|
943
958
|
}, q({ _: 2 }, [
|
|
944
|
-
|
|
959
|
+
i.$slots.prefix ? {
|
|
945
960
|
name: "prefix",
|
|
946
961
|
fn: h(() => [
|
|
947
|
-
y(
|
|
962
|
+
y(i.$slots, "prefix")
|
|
948
963
|
]),
|
|
949
964
|
key: "0"
|
|
950
965
|
} : void 0,
|
|
951
|
-
|
|
966
|
+
i.$slots.suffix ? {
|
|
952
967
|
name: "suffix",
|
|
953
968
|
fn: h(() => [
|
|
954
|
-
y(
|
|
969
|
+
y(i.$slots, "suffix")
|
|
955
970
|
]),
|
|
956
971
|
key: "1"
|
|
957
972
|
} : void 0
|
|
958
|
-
]), 1032, ["id", "
|
|
973
|
+
]), 1032, ["id", "custom-class", "deselectable", "disabled", "enable-time-picker", "input-class", "mask", "max", "min", "model-value", "multiple", "name", "options", "placeholder", "precision", "range", "searchable", "step", "taggable", "type", "preserveSearch"]),
|
|
959
974
|
e.errors ? (b(), $(Q, {
|
|
960
975
|
key: 0,
|
|
961
|
-
|
|
962
|
-
|
|
976
|
+
message: e.errors,
|
|
977
|
+
class: "mt-2"
|
|
963
978
|
}, null, 8, ["message"])) : N("", !0)
|
|
964
979
|
], 2));
|
|
965
980
|
}
|