@luis-angel-martin-dzul/vue-input-styles 0.0.44 → 0.0.45
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/README.md +115 -254
- package/dist/vue-input-styles.es.js +440 -445
- package/dist/vue-input-styles.umd.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as i, openBlock as
|
|
1
|
+
import { createElementBlock as i, openBlock as o, normalizeClass as m, renderSlot as C, createElementVNode as d, createCommentVNode as c, toDisplayString as g, Fragment as x, renderList as p, withDirectives as y, createTextVNode as f, withModifiers as k, vModelText as v, mergeProps as w, vModelDynamic as _, vModelSelect as U, normalizeStyle as V } from "vue";
|
|
2
2
|
class b {
|
|
3
3
|
static type = {
|
|
4
4
|
success: "success",
|
|
@@ -15,53 +15,53 @@ class b {
|
|
|
15
15
|
info: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM288 224C288 206.3 302.3 192 320 192C337.7 192 352 206.3 352 224C352 241.7 337.7 256 320 256C302.3 256 288 241.7 288 224zM280 288L328 288C341.3 288 352 298.7 352 312L352 400L360 400C373.3 400 384 410.7 384 424C384 437.3 373.3 448 360 448L280 448C266.7 448 256 437.3 256 424C256 410.7 266.7 400 280 400L304 400L304 336L280 336C266.7 336 256 325.3 256 312C256 298.7 266.7 288 280 288z"/></svg>',
|
|
16
16
|
neutral: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320zM272 272C272 254.3 257.7 240 240 240C222.3 240 208 254.3 208 272C208 289.7 222.3 304 240 304C257.7 304 272 289.7 272 272zM400 304C417.7 304 432 289.7 432 272C432 254.3 417.7 240 400 240C382.3 240 368 254.3 368 272C368 289.7 382.3 304 400 304z"/></svg>'
|
|
17
17
|
};
|
|
18
|
-
static #e(
|
|
18
|
+
static #e(t, l, n = b.type.info, a = 4e3) {
|
|
19
19
|
b.ensureContainer();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
<div class="alert-icon">${
|
|
20
|
+
const r = b.container.querySelector(`.alert-${n}`);
|
|
21
|
+
r && r.remove();
|
|
22
|
+
const s = document.createElement("div");
|
|
23
|
+
s.className = `alert alert-${n}`;
|
|
24
|
+
const u = b.iconMap[n] || "";
|
|
25
|
+
s.innerHTML = `
|
|
26
|
+
<div class="alert-icon">${u}</div>
|
|
27
27
|
<div class="alert-texts">
|
|
28
|
-
<div class="alert-title">${
|
|
29
|
-
<div class="alert-message">${
|
|
28
|
+
<div class="alert-title">${t}</div>
|
|
29
|
+
<div class="alert-message">${l}</div>
|
|
30
30
|
</div>
|
|
31
31
|
<div class="alert-close">×</div>
|
|
32
|
-
`,
|
|
33
|
-
b.remove(
|
|
34
|
-
}), b.container.appendChild(
|
|
32
|
+
`, s.querySelector(".alert-close").addEventListener("click", () => {
|
|
33
|
+
b.remove(s);
|
|
34
|
+
}), b.container.appendChild(s), setTimeout(() => s.classList.add("show"), 10), a > 0 && setTimeout(() => b.remove(s), a);
|
|
35
35
|
}
|
|
36
36
|
// Métodos públicos reutilizables
|
|
37
|
-
static success(
|
|
38
|
-
this.#e(
|
|
37
|
+
static success(t, l = "") {
|
|
38
|
+
this.#e(t, l, this.type.success);
|
|
39
39
|
}
|
|
40
|
-
static error(
|
|
41
|
-
this.#e(
|
|
40
|
+
static error(t, l = "") {
|
|
41
|
+
this.#e(t, l, this.type.error);
|
|
42
42
|
}
|
|
43
|
-
static warning(
|
|
44
|
-
this.#e(
|
|
43
|
+
static warning(t, l = "") {
|
|
44
|
+
this.#e(t, l, this.type.warning);
|
|
45
45
|
}
|
|
46
|
-
static info(
|
|
47
|
-
this.#e(
|
|
46
|
+
static info(t, l = "") {
|
|
47
|
+
this.#e(t, l, this.type.info);
|
|
48
48
|
}
|
|
49
|
-
static neutral(
|
|
50
|
-
this.#e(
|
|
49
|
+
static neutral(t, l = "") {
|
|
50
|
+
this.#e(t, l, this.type.neutral);
|
|
51
51
|
}
|
|
52
52
|
static ensureContainer() {
|
|
53
53
|
this.container || (this.container = document.createElement("div"), this.container.className = "alert-container", document.body.appendChild(this.container));
|
|
54
54
|
}
|
|
55
|
-
static remove(
|
|
56
|
-
|
|
55
|
+
static remove(t) {
|
|
56
|
+
t.classList.add("hide"), setTimeout(() => t.remove(), 250);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
for (const [n,
|
|
62
|
-
|
|
63
|
-
return
|
|
64
|
-
},
|
|
59
|
+
const h = (e, t) => {
|
|
60
|
+
const l = e.__vccOpts || e;
|
|
61
|
+
for (const [n, a] of t)
|
|
62
|
+
l[n] = a;
|
|
63
|
+
return l;
|
|
64
|
+
}, I = {
|
|
65
65
|
name: "ButtonStyle",
|
|
66
66
|
emits: ["click"],
|
|
67
67
|
props: {
|
|
@@ -86,7 +86,7 @@ const g = (e, l) => {
|
|
|
86
86
|
return `${this.class} cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed`;
|
|
87
87
|
const e = [
|
|
88
88
|
"h-min font-semibold items-center justify-center rounded px-3 py-1.5 gap-1 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"
|
|
89
|
-
],
|
|
89
|
+
], t = {
|
|
90
90
|
solid: {
|
|
91
91
|
gray: "text-white bg-slate-600 enabled:hover:bg-slate-700",
|
|
92
92
|
green: "text-white bg-emerald-600 enabled:hover:bg-emerald-700",
|
|
@@ -102,7 +102,7 @@ const g = (e, l) => {
|
|
|
102
102
|
yellow: "text-amber-700 enabled:hover:bg-amber-50 border border-amber-700"
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
return e.push(
|
|
105
|
+
return e.push(t[this.variant][this.color]), e;
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
methods: {
|
|
@@ -112,18 +112,18 @@ const g = (e, l) => {
|
|
|
112
112
|
}, 1e3 * Number(this.delay)));
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
},
|
|
116
|
-
function
|
|
117
|
-
return
|
|
118
|
-
type:
|
|
119
|
-
onClick:
|
|
120
|
-
disabled:
|
|
121
|
-
class: m(
|
|
115
|
+
}, B = ["type", "disabled"];
|
|
116
|
+
function T(e, t, l, n, a, r) {
|
|
117
|
+
return o(), i("button", {
|
|
118
|
+
type: l.type,
|
|
119
|
+
onClick: t[0] || (t[0] = (...s) => r.handleClick && r.handleClick(...s)),
|
|
120
|
+
disabled: r.isDisabled,
|
|
121
|
+
class: m(r.buttonClasses)
|
|
122
122
|
}, [
|
|
123
123
|
C(e.$slots, "default")
|
|
124
|
-
], 10,
|
|
124
|
+
], 10, B);
|
|
125
125
|
}
|
|
126
|
-
const q = /* @__PURE__ */
|
|
126
|
+
const q = /* @__PURE__ */ h(I, [["render", T]]), L = {
|
|
127
127
|
name: "CheckStyle",
|
|
128
128
|
props: {
|
|
129
129
|
label: { type: String, default: "" },
|
|
@@ -161,8 +161,8 @@ const q = /* @__PURE__ */ g(T, [["render", B]]), L = {
|
|
|
161
161
|
return this.returnType === "object" ? e : this.returnType === "text" ? e.name : e.id;
|
|
162
162
|
},
|
|
163
163
|
isChecked(e) {
|
|
164
|
-
const
|
|
165
|
-
return this.realSelection.includes(
|
|
164
|
+
const t = this.getValue(e);
|
|
165
|
+
return this.realSelection.includes(t);
|
|
166
166
|
},
|
|
167
167
|
emitExternal() {
|
|
168
168
|
if (!this.returnAll && this.realSelection.length === this.list.length) {
|
|
@@ -175,60 +175,60 @@ const q = /* @__PURE__ */ g(T, [["render", B]]), L = {
|
|
|
175
175
|
);
|
|
176
176
|
},
|
|
177
177
|
onChange(e) {
|
|
178
|
-
const
|
|
179
|
-
this.realSelection.includes(
|
|
180
|
-
(
|
|
181
|
-
) : this.all ? this.realSelection.push(
|
|
178
|
+
const t = this.getValue(e);
|
|
179
|
+
this.realSelection.includes(t) ? this.realSelection = this.realSelection.filter(
|
|
180
|
+
(l) => l !== t
|
|
181
|
+
) : this.all ? this.realSelection.push(t) : this.realSelection = [t], this.emitExternal();
|
|
182
182
|
},
|
|
183
183
|
toggleSelectAll() {
|
|
184
184
|
this.all && (this.isAllSelected ? this.realSelection = [] : this.realSelection = this.list.map((e) => this.getValue(e)), this.emitExternal());
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
}, N = { class: "w-full" },
|
|
187
|
+
}, N = { class: "w-full" }, M = { class: "flex items-center justify-between" }, A = { class: "block text-sm font-medium text-gray-700" }, z = {
|
|
188
188
|
key: 0,
|
|
189
189
|
class: "flex items-center gap-2 select-none"
|
|
190
|
-
},
|
|
191
|
-
function K(e,
|
|
192
|
-
return
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
}, F = ["id", "checked"], P = ["for"], E = ["id", "checked", "onChange"], j = ["for"];
|
|
191
|
+
function K(e, t, l, n, a, r) {
|
|
192
|
+
return o(), i("div", N, [
|
|
193
|
+
d("div", M, [
|
|
194
|
+
d("h3", A, g(l.label), 1),
|
|
195
|
+
l.all ? (o(), i("div", z, [
|
|
196
|
+
d("input", {
|
|
197
197
|
type: "checkbox",
|
|
198
|
-
id: "todos-" +
|
|
199
|
-
checked:
|
|
200
|
-
onChange:
|
|
198
|
+
id: "todos-" + r.getUUID,
|
|
199
|
+
checked: r.isAllSelected,
|
|
200
|
+
onChange: t[0] || (t[0] = (...s) => r.toggleSelectAll && r.toggleSelectAll(...s)),
|
|
201
201
|
class: "w-4 h-4 accent-indigo-600 border-gray-300 rounded focus:ring-indigo-200"
|
|
202
|
-
}, null, 40,
|
|
203
|
-
|
|
204
|
-
for: "todos-" +
|
|
202
|
+
}, null, 40, F),
|
|
203
|
+
d("label", {
|
|
204
|
+
for: "todos-" + r.getUUID,
|
|
205
205
|
class: "text-sm text-gray-600 uppercase truncate"
|
|
206
|
-
}, " Seleccionar todos ", 8,
|
|
207
|
-
])) :
|
|
206
|
+
}, " Seleccionar todos ", 8, P)
|
|
207
|
+
])) : c("", !0)
|
|
208
208
|
]),
|
|
209
|
-
|
|
210
|
-
class: m(["max-h-48 overflow-auto space-y-1",
|
|
209
|
+
d("div", {
|
|
210
|
+
class: m(["max-h-48 overflow-auto space-y-1", l.grid])
|
|
211
211
|
}, [
|
|
212
|
-
(
|
|
213
|
-
key:
|
|
212
|
+
(o(!0), i(x, null, p(l.list, (s) => (o(), i("div", {
|
|
213
|
+
key: s.id,
|
|
214
214
|
class: "flex items-center gap-2 select-none"
|
|
215
215
|
}, [
|
|
216
|
-
|
|
216
|
+
d("input", {
|
|
217
217
|
type: "checkbox",
|
|
218
|
-
id:
|
|
219
|
-
checked:
|
|
220
|
-
onChange: (
|
|
218
|
+
id: r.getUUID + "-" + s.id,
|
|
219
|
+
checked: r.isChecked(s),
|
|
220
|
+
onChange: (u) => r.onChange(s),
|
|
221
221
|
class: "w-4 h-4 accent-indigo-600 border-gray-300 rounded focus:ring-indigo-200"
|
|
222
|
-
}, null, 40,
|
|
223
|
-
|
|
224
|
-
for:
|
|
222
|
+
}, null, 40, E),
|
|
223
|
+
d("label", {
|
|
224
|
+
for: r.getUUID + "-" + s.id,
|
|
225
225
|
class: "truncate text-gray-700"
|
|
226
|
-
},
|
|
226
|
+
}, g(s.name), 9, j)
|
|
227
227
|
]))), 128))
|
|
228
228
|
], 2)
|
|
229
229
|
]);
|
|
230
230
|
}
|
|
231
|
-
const W = /* @__PURE__ */
|
|
231
|
+
const W = /* @__PURE__ */ h(L, [["render", K]]), O = {
|
|
232
232
|
name: "ComboBoxStyle",
|
|
233
233
|
props: {
|
|
234
234
|
modelValue: [String, Number, Object, null],
|
|
@@ -270,8 +270,8 @@ const W = /* @__PURE__ */ g(L, [["render", K]]), O = {
|
|
|
270
270
|
this.search = "", this.searchCopy = "";
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
|
|
273
|
+
const t = this.list.find((l) => l.id === e);
|
|
274
|
+
t && (this.search = t.name, this.searchCopy = t.name);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
},
|
|
@@ -301,86 +301,94 @@ const W = /* @__PURE__ */ g(L, [["render", K]]), O = {
|
|
|
301
301
|
key: 0,
|
|
302
302
|
class: "px-3 py-2 text-gray-800"
|
|
303
303
|
}, te = ["onMousedown"];
|
|
304
|
-
function le(e,
|
|
305
|
-
return
|
|
306
|
-
|
|
304
|
+
function le(e, t, l, n, a, r) {
|
|
305
|
+
return o(), i("div", H, [
|
|
306
|
+
d("label", {
|
|
307
307
|
class: "flex justify-between",
|
|
308
|
-
for:
|
|
308
|
+
for: a.uuid
|
|
309
309
|
}, [
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
d("div", G, [
|
|
311
|
+
f(g(l.label) + " ", 1),
|
|
312
|
+
l.required ? (o(), i("span", J, "*")) : c("", !0)
|
|
313
313
|
]),
|
|
314
|
-
|
|
314
|
+
r.model ? (o(), i("span", {
|
|
315
315
|
key: 0,
|
|
316
316
|
class: "text-xs px-2.5 rounded text-red-800 hover:bg-red-50 cursor-pointer",
|
|
317
|
-
onMousedown:
|
|
317
|
+
onMousedown: t[0] || (t[0] = k(() => {
|
|
318
318
|
}, ["prevent"])),
|
|
319
|
-
onClick:
|
|
320
|
-
}, "Limpiar ", 32)) :
|
|
319
|
+
onClick: t[1] || (t[1] = (...s) => r.clearItem && r.clearItem(...s))
|
|
320
|
+
}, "Limpiar ", 32)) : c("", !0)
|
|
321
321
|
], 8, R),
|
|
322
|
-
e.$slots.icon ? (
|
|
323
|
-
|
|
322
|
+
e.$slots.icon ? (o(), i("div", Q, [
|
|
323
|
+
d("div", X, [
|
|
324
324
|
C(e.$slots, "icon")
|
|
325
325
|
]),
|
|
326
|
-
|
|
327
|
-
id:
|
|
326
|
+
y(d("input", {
|
|
327
|
+
id: a.uuid,
|
|
328
328
|
type: "text",
|
|
329
|
-
"onUpdate:modelValue":
|
|
330
|
-
placeholder:
|
|
331
|
-
disabled:
|
|
332
|
-
required:
|
|
333
|
-
onBlur:
|
|
334
|
-
onFocus:
|
|
335
|
-
onInput:
|
|
329
|
+
"onUpdate:modelValue": t[2] || (t[2] = (s) => a.search = s),
|
|
330
|
+
placeholder: l.placeholder,
|
|
331
|
+
disabled: l.disabled,
|
|
332
|
+
required: l.required,
|
|
333
|
+
onBlur: t[3] || (t[3] = (...s) => r.closeWithDelay && r.closeWithDelay(...s)),
|
|
334
|
+
onFocus: t[4] || (t[4] = (s) => a.open = !l.disabled),
|
|
335
|
+
onInput: t[5] || (t[5] = (s) => a.open = !l.disabled),
|
|
336
336
|
class: "w-full pl-10 pr-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600"
|
|
337
337
|
}, null, 40, Y), [
|
|
338
|
-
[v,
|
|
338
|
+
[v, a.search]
|
|
339
339
|
])
|
|
340
|
-
])) :
|
|
340
|
+
])) : y((o(), i("input", {
|
|
341
341
|
key: 1,
|
|
342
|
-
id:
|
|
342
|
+
id: a.uuid,
|
|
343
343
|
type: "text",
|
|
344
|
-
"onUpdate:modelValue":
|
|
345
|
-
placeholder:
|
|
346
|
-
disabled:
|
|
347
|
-
required:
|
|
348
|
-
onBlur:
|
|
349
|
-
onFocus:
|
|
350
|
-
onInput:
|
|
344
|
+
"onUpdate:modelValue": t[6] || (t[6] = (s) => a.search = s),
|
|
345
|
+
placeholder: l.placeholder,
|
|
346
|
+
disabled: l.disabled,
|
|
347
|
+
required: l.required,
|
|
348
|
+
onBlur: t[7] || (t[7] = (...s) => r.closeWithDelay && r.closeWithDelay(...s)),
|
|
349
|
+
onFocus: t[8] || (t[8] = (s) => a.open = !l.disabled),
|
|
350
|
+
onInput: t[9] || (t[9] = (s) => a.open = !l.disabled),
|
|
351
351
|
class: "w-full px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600"
|
|
352
352
|
}, null, 40, Z)), [
|
|
353
|
-
[v,
|
|
353
|
+
[v, a.search]
|
|
354
354
|
]),
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
(
|
|
358
|
-
key:
|
|
359
|
-
onMousedown: k((
|
|
355
|
+
a.open && !l.disabled ? (o(), i("div", $, [
|
|
356
|
+
r.filteredList.length === 0 ? (o(), i("div", ee, g(l.oEmpty), 1)) : c("", !0),
|
|
357
|
+
(o(!0), i(x, null, p(r.filteredList, (s) => (o(), i("div", {
|
|
358
|
+
key: s.id,
|
|
359
|
+
onMousedown: k((u) => r.selectItem(s), ["prevent"]),
|
|
360
360
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100"
|
|
361
|
-
},
|
|
362
|
-
])) :
|
|
361
|
+
}, g(s.name), 41, te))), 128))
|
|
362
|
+
])) : c("", !0)
|
|
363
363
|
]);
|
|
364
364
|
}
|
|
365
|
-
const
|
|
365
|
+
const re = /* @__PURE__ */ h(O, [["render", le]]), se = {
|
|
366
366
|
name: "DateTimeStyle",
|
|
367
367
|
props: {
|
|
368
368
|
modelValue: String,
|
|
369
369
|
disabled: { type: Boolean, default: !1 },
|
|
370
370
|
required: { type: Boolean, default: !1 },
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
371
|
+
mode: {
|
|
372
|
+
type: String,
|
|
373
|
+
default: "datetime",
|
|
374
|
+
validator(e) {
|
|
375
|
+
return ["date", "time", "datetime", "datetime2"].includes(e);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
label: { type: String, default: "" },
|
|
375
379
|
secondsMode: { type: String, default: "default" }
|
|
376
380
|
},
|
|
377
381
|
data() {
|
|
378
382
|
return {
|
|
379
383
|
localDate: "",
|
|
380
|
-
localTime: ""
|
|
384
|
+
localTime: "",
|
|
385
|
+
localDateTime: ""
|
|
381
386
|
};
|
|
382
387
|
},
|
|
383
388
|
computed: {
|
|
389
|
+
getUUID() {
|
|
390
|
+
return crypto.randomUUID();
|
|
391
|
+
},
|
|
384
392
|
model: {
|
|
385
393
|
get() {
|
|
386
394
|
return this.modelValue;
|
|
@@ -389,25 +397,8 @@ const se = /* @__PURE__ */ g(O, [["render", le]]), re = {
|
|
|
389
397
|
this.$emit("update:modelValue", e);
|
|
390
398
|
}
|
|
391
399
|
},
|
|
392
|
-
showDate() {
|
|
393
|
-
return ["date", "datetime", "datetime2"].includes(this.mode);
|
|
394
|
-
},
|
|
395
|
-
showTime() {
|
|
396
|
-
return ["time", "datetime"].includes(this.mode);
|
|
397
|
-
},
|
|
398
400
|
segundos() {
|
|
399
401
|
return this.secondsMode === "max" ? "59" : "01";
|
|
400
|
-
},
|
|
401
|
-
dateInputClass() {
|
|
402
|
-
let e = "w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed";
|
|
403
|
-
return this.showDate && this.showTime ? e + " rounded-l" : e + " rounded";
|
|
404
|
-
},
|
|
405
|
-
timeInputClass() {
|
|
406
|
-
let e = "w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed";
|
|
407
|
-
return this.showDate && this.showTime ? e + " rounded-r" : e + " rounded";
|
|
408
|
-
},
|
|
409
|
-
gridClass() {
|
|
410
|
-
return this.showDate && this.showTime ? "grid grid-cols-2" : "";
|
|
411
402
|
}
|
|
412
403
|
},
|
|
413
404
|
watch: {
|
|
@@ -415,110 +406,103 @@ const se = /* @__PURE__ */ g(O, [["render", le]]), re = {
|
|
|
415
406
|
immediate: !0,
|
|
416
407
|
handler(e) {
|
|
417
408
|
if (!e) {
|
|
418
|
-
this.localDate = "", this.localTime = "";
|
|
409
|
+
this.localDate = "", this.localTime = "", this.localDateTime = "";
|
|
419
410
|
return;
|
|
420
411
|
}
|
|
421
|
-
|
|
422
|
-
this.localDate = e;
|
|
423
|
-
else if (this.mode === "time")
|
|
424
|
-
this.localTime = e;
|
|
425
|
-
else if (this.mode === "datetime") {
|
|
426
|
-
const [l, t] = e.split("T");
|
|
427
|
-
this.localDate = l || "", this.localTime = t ? t.slice(0, 5) : "";
|
|
428
|
-
} else this.mode === "datetime2" && (this.localDate = e.split("T")[0] || "", this.localTime = "");
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
mode: {
|
|
432
|
-
immediate: !0,
|
|
433
|
-
handler() {
|
|
434
|
-
this.parseValue(this.modelValue);
|
|
412
|
+
this.mode === "date" ? this.localDate = e : this.mode === "time" ? this.localTime = e.slice(0, 5) : this.mode === "datetime" ? this.localDateTime = e.slice(0, 16) : this.mode === "datetime2" && (this.localDate = e.split("T")[0] || "");
|
|
435
413
|
}
|
|
436
414
|
}
|
|
437
415
|
},
|
|
438
416
|
methods: {
|
|
439
|
-
parseValue(e) {
|
|
440
|
-
if (!e) {
|
|
441
|
-
this.localDate = "", this.localTime = "";
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
if (this.mode === "date")
|
|
445
|
-
this.localDate = e, this.localTime = "";
|
|
446
|
-
else if (this.mode === "time")
|
|
447
|
-
this.localDate = "", this.localTime = e;
|
|
448
|
-
else if (this.mode === "datetime") {
|
|
449
|
-
const [l, t] = e.split("T");
|
|
450
|
-
this.localDate = l || "", this.localTime = t ? t.slice(0, 5) : "";
|
|
451
|
-
} else this.mode === "datetime2" && (this.localDate = e.split("T")[0] || "", this.localTime = "");
|
|
452
|
-
this.emitValue();
|
|
453
|
-
},
|
|
454
417
|
emitValue() {
|
|
455
418
|
let e = "";
|
|
456
|
-
this.mode === "date" ? e = this.localDate || "" : this.mode === "time" ? e = this.localTime || "" : this.mode === "datetime" ?
|
|
419
|
+
this.mode === "date" ? e = this.localDate || "" : this.mode === "time" ? e = this.localTime || "" : this.mode === "datetime" ? this.localDateTime ? e = `${this.localDateTime}:${this.segundos}.000` : e = "" : this.mode === "datetime2" && (this.localDate ? e = this.secondsMode === "max" ? `${this.localDate}T23:59:59.000` : `${this.localDate}T00:01:00.000` : e = ""), this.model = e;
|
|
457
420
|
}
|
|
458
421
|
}
|
|
459
|
-
}, ie = { class: "w-full" },
|
|
422
|
+
}, ie = { class: "w-full" }, oe = ["for"], de = {
|
|
460
423
|
key: 0,
|
|
461
424
|
class: "text-red-800 ml-2"
|
|
462
|
-
};
|
|
463
|
-
function
|
|
464
|
-
return
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
]),
|
|
469
|
-
o("div", {
|
|
470
|
-
class: m(s.gridClass)
|
|
425
|
+
}, ae = ["id"], ne = ["id"], ue = ["id"];
|
|
426
|
+
function ce(e, t, l, n, a, r) {
|
|
427
|
+
return o(), i("div", ie, [
|
|
428
|
+
d("label", {
|
|
429
|
+
for: r.getUUID,
|
|
430
|
+
class: "block text-sm font-medium text-gray-700"
|
|
471
431
|
}, [
|
|
472
|
-
|
|
432
|
+
l.required ? (o(), i("span", de, "*")) : c("", !0),
|
|
433
|
+
f(" " + g(l.label), 1)
|
|
434
|
+
], 8, oe),
|
|
435
|
+
d("div", null, [
|
|
436
|
+
l.mode === "date" || l.mode === "datetime2" ? y((o(), i("input", w({
|
|
473
437
|
key: 0,
|
|
438
|
+
id: r.getUUID,
|
|
474
439
|
type: "date"
|
|
475
|
-
}, { disabled:
|
|
476
|
-
"onUpdate:modelValue":
|
|
477
|
-
onInput:
|
|
478
|
-
class:
|
|
479
|
-
}), null, 16)), [
|
|
480
|
-
[v,
|
|
481
|
-
]) :
|
|
482
|
-
|
|
440
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
441
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => a.localDate = s),
|
|
442
|
+
onInput: t[1] || (t[1] = (...s) => r.emitValue && r.emitValue(...s)),
|
|
443
|
+
class: "w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed rounded"
|
|
444
|
+
}), null, 16, ae)), [
|
|
445
|
+
[v, a.localDate]
|
|
446
|
+
]) : c("", !0),
|
|
447
|
+
l.mode === "time" ? y((o(), i("input", w({
|
|
483
448
|
key: 1,
|
|
449
|
+
id: r.getUUID,
|
|
484
450
|
type: "time"
|
|
485
|
-
}, { disabled:
|
|
486
|
-
"onUpdate:modelValue":
|
|
487
|
-
onInput:
|
|
488
|
-
class:
|
|
489
|
-
}), null, 16)), [
|
|
490
|
-
[v,
|
|
491
|
-
]) :
|
|
492
|
-
|
|
451
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
452
|
+
"onUpdate:modelValue": t[2] || (t[2] = (s) => a.localTime = s),
|
|
453
|
+
onInput: t[3] || (t[3] = (...s) => r.emitValue && r.emitValue(...s)),
|
|
454
|
+
class: "w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed rounded"
|
|
455
|
+
}), null, 16, ne)), [
|
|
456
|
+
[v, a.localTime]
|
|
457
|
+
]) : c("", !0),
|
|
458
|
+
l.mode === "datetime" ? y((o(), i("input", w({
|
|
459
|
+
key: 2,
|
|
460
|
+
id: r.getUUID,
|
|
461
|
+
type: "datetime-local"
|
|
462
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
463
|
+
"onUpdate:modelValue": t[4] || (t[4] = (s) => a.localDateTime = s),
|
|
464
|
+
onInput: t[5] || (t[5] = (...s) => r.emitValue && r.emitValue(...s)),
|
|
465
|
+
class: "w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed rounded"
|
|
466
|
+
}), null, 16, ue)), [
|
|
467
|
+
[v, a.localDateTime]
|
|
468
|
+
]) : c("", !0)
|
|
469
|
+
])
|
|
493
470
|
]);
|
|
494
471
|
}
|
|
495
|
-
const
|
|
472
|
+
const ge = /* @__PURE__ */ h(se, [["render", ce]]), me = {
|
|
496
473
|
name: "InputDecimalStyle",
|
|
497
474
|
props: {
|
|
498
475
|
modelValue: { type: [String, Number], default: "" },
|
|
499
476
|
label: { type: String, default: "" },
|
|
500
477
|
placeholder: { type: String, default: "" },
|
|
478
|
+
digits: { type: String, default: "10" },
|
|
501
479
|
decimals: { type: String, default: "2" },
|
|
502
|
-
|
|
503
|
-
disabled: { type: Boolean, default: !1 }
|
|
504
|
-
|
|
480
|
+
required: { type: Boolean, default: !1 },
|
|
481
|
+
disabled: { type: Boolean, default: !1 }
|
|
482
|
+
},
|
|
483
|
+
data() {
|
|
484
|
+
return {
|
|
485
|
+
isFocused: !1
|
|
486
|
+
};
|
|
505
487
|
},
|
|
506
488
|
computed: {
|
|
507
489
|
getUUID() {
|
|
508
490
|
return crypto.randomUUID();
|
|
509
491
|
},
|
|
510
|
-
|
|
492
|
+
displayValue() {
|
|
493
|
+
if (this.isFocused)
|
|
494
|
+
return this.modelValue?.toString() ?? "";
|
|
511
495
|
if (this.modelValue === "" || this.modelValue === null) return "";
|
|
512
|
-
const e =
|
|
496
|
+
const e = Number(this.modelValue);
|
|
513
497
|
return isNaN(e) ? "" : e.toLocaleString("en-US", {
|
|
514
|
-
minimumFractionDigits:
|
|
498
|
+
minimumFractionDigits: Number(this.decimals),
|
|
515
499
|
maximumFractionDigits: Number(this.decimals)
|
|
516
500
|
});
|
|
517
501
|
}
|
|
518
502
|
},
|
|
519
503
|
methods: {
|
|
520
504
|
onKeyDown(e) {
|
|
521
|
-
const
|
|
505
|
+
const t = [
|
|
522
506
|
"Backspace",
|
|
523
507
|
"Delete",
|
|
524
508
|
"Tab",
|
|
@@ -531,83 +515,94 @@ const ne = /* @__PURE__ */ g(re, [["render", de]]), ue = {
|
|
|
531
515
|
"Home",
|
|
532
516
|
"End"
|
|
533
517
|
];
|
|
534
|
-
if (
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
518
|
+
if ((e.ctrlKey || e.metaKey) && ["a", "c", "v", "x", "z"].includes(e.key.toLowerCase()) || t.includes(e.key)) return;
|
|
519
|
+
const l = e.target.value, n = e.target.selectionStart, a = e.target.selectionStart !== e.target.selectionEnd, [r = "", s = ""] = l.split("."), u = l.includes(".");
|
|
520
|
+
if (e.key >= "0" && e.key <= "9") {
|
|
521
|
+
if (!u || n <= r.length) {
|
|
522
|
+
!a && r.length >= Number(this.digits) && e.preventDefault();
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (u && n > r.length) {
|
|
526
|
+
!a && s.length >= Number(this.decimals) && e.preventDefault();
|
|
541
527
|
return;
|
|
542
528
|
}
|
|
543
|
-
e.key === "." || e.key === "," ? (Number(this.decimals) === 0 || e.target.value.includes(".")) && e.preventDefault() : e.preventDefault();
|
|
544
529
|
}
|
|
530
|
+
if (e.key === ".") {
|
|
531
|
+
(Number(this.decimals) === 0 || u) && e.preventDefault();
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
e.preventDefault();
|
|
545
535
|
},
|
|
546
536
|
onInput(e) {
|
|
547
|
-
let
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
t.length > 2 && (l = t[0] + "." + t.slice(1).join("")), t[1] && t[1].length > Number(this.decimals) && (l = t[0] + "." + t[1].slice(0, Number(this.decimals))), this.$emit("update:modelValue", l);
|
|
537
|
+
let t = e.target.value.replace(/[^0-9.]/g, "");
|
|
538
|
+
const [l, n = ""] = t.split(".");
|
|
539
|
+
this.$emit("update:modelValue", n ? `${l}.${n}` : l);
|
|
551
540
|
},
|
|
552
541
|
onPaste(e) {
|
|
553
|
-
let t =
|
|
554
|
-
Number(this.
|
|
555
|
-
const n = t.split(".");
|
|
556
|
-
n.length > 2 && (t = n[0] + "." + n.slice(1).join("")), n[1] && n[1].length > Number(this.decimals) && (t = n[0] + "." + n[1].slice(0, Number(this.decimals))), t !== "" && this.$emit("update:modelValue", t);
|
|
542
|
+
let t = e.clipboardData.getData("text").replace(/[^0-9.]/g, ""), [l, n = ""] = t.split(".");
|
|
543
|
+
l.length > Number(this.digits) || n.length > Number(this.decimals) || this.$emit("update:modelValue", n ? `${l}.${n}` : l);
|
|
557
544
|
},
|
|
558
545
|
onBlur() {
|
|
559
|
-
|
|
560
|
-
|
|
546
|
+
if (this.isFocused = !1, this.modelValue === "" || this.modelValue === ".") {
|
|
547
|
+
this.$emit("update:modelValue", "");
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
const e = Number(this.modelValue);
|
|
551
|
+
isNaN(e) || this.$emit("update:modelValue", e.toFixed(Number(this.decimals)));
|
|
561
552
|
}
|
|
562
553
|
}
|
|
563
|
-
},
|
|
554
|
+
}, he = { class: "w-full" }, be = ["for"], ye = {
|
|
564
555
|
key: 0,
|
|
565
556
|
class: "text-red-800 ml-2"
|
|
566
|
-
},
|
|
557
|
+
}, fe = {
|
|
567
558
|
key: 0,
|
|
568
559
|
class: "relative"
|
|
569
|
-
},
|
|
570
|
-
function
|
|
571
|
-
return
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
560
|
+
}, xe = { class: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5" }, pe = ["id", "value", "disabled", "placeholder"], we = ["id", "value", "disabled", "placeholder"];
|
|
561
|
+
function ve(e, t, l, n, a, r) {
|
|
562
|
+
return o(), i("div", he, [
|
|
563
|
+
d("label", {
|
|
564
|
+
for: r.getUUID,
|
|
565
|
+
class: "block text-sm font-medium text-gray-700 mb-1"
|
|
575
566
|
}, [
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
], 8,
|
|
579
|
-
e.$slots.icon ? (
|
|
580
|
-
|
|
567
|
+
l.required ? (o(), i("span", ye, "*")) : c("", !0),
|
|
568
|
+
f(" " + g(l.label), 1)
|
|
569
|
+
], 8, be),
|
|
570
|
+
e.$slots.icon ? (o(), i("div", fe, [
|
|
571
|
+
d("div", xe, [
|
|
581
572
|
C(e.$slots, "icon")
|
|
582
573
|
]),
|
|
583
|
-
|
|
574
|
+
d("input", {
|
|
584
575
|
type: "text",
|
|
585
|
-
id:
|
|
586
|
-
value:
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
576
|
+
id: r.getUUID,
|
|
577
|
+
value: r.displayValue,
|
|
578
|
+
onFocus: t[0] || (t[0] = (s) => a.isFocused = !0),
|
|
579
|
+
onBlur: t[1] || (t[1] = (...s) => r.onBlur && r.onBlur(...s)),
|
|
580
|
+
onKeydown: t[2] || (t[2] = (...s) => r.onKeyDown && r.onKeyDown(...s)),
|
|
581
|
+
onInput: t[3] || (t[3] = (...s) => r.onInput && r.onInput(...s)),
|
|
582
|
+
onPaste: t[4] || (t[4] = k((...s) => r.onPaste && r.onPaste(...s), ["prevent"])),
|
|
583
|
+
disabled: l.disabled,
|
|
590
584
|
inputmode: "decimal",
|
|
591
|
-
placeholder:
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
key: 1,
|
|
585
|
+
placeholder: l.placeholder,
|
|
586
|
+
class: "w-full text-gray-800 bg-white px-3 py-2 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed text-right"
|
|
587
|
+
}, null, 40, pe)
|
|
588
|
+
])) : c("", !0),
|
|
589
|
+
d("input", {
|
|
597
590
|
type: "text",
|
|
598
|
-
id:
|
|
599
|
-
value:
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
591
|
+
id: r.getUUID,
|
|
592
|
+
value: r.displayValue,
|
|
593
|
+
onFocus: t[5] || (t[5] = (s) => a.isFocused = !0),
|
|
594
|
+
onBlur: t[6] || (t[6] = (...s) => r.onBlur && r.onBlur(...s)),
|
|
595
|
+
onKeydown: t[7] || (t[7] = (...s) => r.onKeyDown && r.onKeyDown(...s)),
|
|
596
|
+
onInput: t[8] || (t[8] = (...s) => r.onInput && r.onInput(...s)),
|
|
597
|
+
onPaste: t[9] || (t[9] = k((...s) => r.onPaste && r.onPaste(...s), ["prevent"])),
|
|
598
|
+
disabled: l.disabled,
|
|
603
599
|
inputmode: "decimal",
|
|
604
|
-
placeholder:
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}, { disabled: t.disabled, required: t.required }, { class: "w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 text-right focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed" }), null, 16, fe))
|
|
600
|
+
placeholder: l.placeholder,
|
|
601
|
+
class: "w-full text-gray-800 bg-white px-3 py-2 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed text-right"
|
|
602
|
+
}, null, 40, we)
|
|
608
603
|
]);
|
|
609
604
|
}
|
|
610
|
-
const
|
|
605
|
+
const Ce = /* @__PURE__ */ h(me, [["render", ve]]), Se = {
|
|
611
606
|
name: "InputStyle",
|
|
612
607
|
props: {
|
|
613
608
|
modelValue: { type: [String, Number], default: "" },
|
|
@@ -631,52 +626,52 @@ const pe = /* @__PURE__ */ g(ue, [["render", xe]]), we = {
|
|
|
631
626
|
}
|
|
632
627
|
}
|
|
633
628
|
}
|
|
634
|
-
},
|
|
629
|
+
}, ke = { class: "w-full" }, _e = ["for"], De = {
|
|
635
630
|
key: 0,
|
|
636
631
|
class: "text-red-800 ml-2"
|
|
637
|
-
},
|
|
632
|
+
}, Ue = {
|
|
638
633
|
key: 0,
|
|
639
634
|
class: "relative"
|
|
640
|
-
},
|
|
641
|
-
function
|
|
642
|
-
return
|
|
643
|
-
|
|
635
|
+
}, Ve = { class: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5" }, Ie = ["id", "type", "maxlength", "placeholder"], Be = ["id", "type", "maxlength", "placeholder"];
|
|
636
|
+
function Te(e, t, l, n, a, r) {
|
|
637
|
+
return o(), i("div", ke, [
|
|
638
|
+
d("label", {
|
|
644
639
|
class: "block text-sm font-medium text-gray-700",
|
|
645
|
-
for:
|
|
640
|
+
for: r.getUUID
|
|
646
641
|
}, [
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
], 8,
|
|
650
|
-
e.$slots.icon ? (
|
|
651
|
-
|
|
642
|
+
l.required ? (o(), i("span", De, "*")) : c("", !0),
|
|
643
|
+
f(" " + g(l.label), 1)
|
|
644
|
+
], 8, _e),
|
|
645
|
+
e.$slots.icon ? (o(), i("div", Ue, [
|
|
646
|
+
d("div", Ve, [
|
|
652
647
|
C(e.$slots, "icon")
|
|
653
648
|
]),
|
|
654
|
-
|
|
655
|
-
id:
|
|
656
|
-
type:
|
|
657
|
-
maxlength:
|
|
658
|
-
placeholder:
|
|
659
|
-
}, { disabled:
|
|
660
|
-
"onUpdate:modelValue":
|
|
649
|
+
y(d("input", w({
|
|
650
|
+
id: r.getUUID,
|
|
651
|
+
type: l.type,
|
|
652
|
+
maxlength: l.maxlength ? Number(l.maxlength) : null,
|
|
653
|
+
placeholder: l.placeholder
|
|
654
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
655
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => r.model = s),
|
|
661
656
|
class: "w-full text-gray-800 bg-white pl-8 pr-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"
|
|
662
|
-
}), null, 16,
|
|
663
|
-
[_,
|
|
657
|
+
}), null, 16, Ie), [
|
|
658
|
+
[_, r.model]
|
|
664
659
|
])
|
|
665
|
-
])) :
|
|
660
|
+
])) : y((o(), i("input", w({
|
|
666
661
|
key: 1,
|
|
667
|
-
id:
|
|
668
|
-
type:
|
|
669
|
-
maxlength:
|
|
670
|
-
placeholder:
|
|
671
|
-
}, { disabled:
|
|
672
|
-
"onUpdate:modelValue":
|
|
662
|
+
id: r.getUUID,
|
|
663
|
+
type: l.type,
|
|
664
|
+
maxlength: l.maxlength ? Number(l.maxlength) : null,
|
|
665
|
+
placeholder: l.placeholder
|
|
666
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
667
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => r.model = s),
|
|
673
668
|
class: "w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"
|
|
674
|
-
}), null, 16,
|
|
675
|
-
[_,
|
|
669
|
+
}), null, 16, Be)), [
|
|
670
|
+
[_, r.model]
|
|
676
671
|
])
|
|
677
672
|
]);
|
|
678
673
|
}
|
|
679
|
-
const
|
|
674
|
+
const qe = /* @__PURE__ */ h(Se, [["render", Te]]), Le = {
|
|
680
675
|
name: "SelectStyle",
|
|
681
676
|
props: {
|
|
682
677
|
modelValue: [String, Number, Object, null],
|
|
@@ -702,39 +697,39 @@ const Te = /* @__PURE__ */ g(we, [["render", Ue]]), Ie = {
|
|
|
702
697
|
}
|
|
703
698
|
}
|
|
704
699
|
}
|
|
705
|
-
},
|
|
700
|
+
}, Ne = { class: "w-full" }, Me = ["for"], Ae = {
|
|
706
701
|
key: 0,
|
|
707
702
|
class: "text-red-800 ml-2"
|
|
708
|
-
},
|
|
703
|
+
}, ze = ["id"], Fe = {
|
|
709
704
|
value: "",
|
|
710
705
|
disabled: ""
|
|
711
|
-
},
|
|
712
|
-
function
|
|
713
|
-
return
|
|
714
|
-
|
|
706
|
+
}, Pe = ["value"];
|
|
707
|
+
function Ee(e, t, l, n, a, r) {
|
|
708
|
+
return o(), i("div", Ne, [
|
|
709
|
+
d("label", {
|
|
715
710
|
class: "block text-sm font-medium text-gray-700",
|
|
716
|
-
for:
|
|
711
|
+
for: r.getUUID
|
|
717
712
|
}, [
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
], 8,
|
|
721
|
-
|
|
722
|
-
"onUpdate:modelValue":
|
|
723
|
-
}, { disabled:
|
|
724
|
-
id:
|
|
713
|
+
l.required ? (o(), i("span", Ae, "*")) : c("", !0),
|
|
714
|
+
f(" " + g(l.label), 1)
|
|
715
|
+
], 8, Me),
|
|
716
|
+
y(d("select", w({
|
|
717
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => r.model = s)
|
|
718
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
719
|
+
id: r.getUUID,
|
|
725
720
|
class: "w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"
|
|
726
721
|
}), [
|
|
727
|
-
|
|
728
|
-
(
|
|
729
|
-
key:
|
|
730
|
-
value:
|
|
731
|
-
},
|
|
732
|
-
], 16,
|
|
733
|
-
[
|
|
722
|
+
d("option", Fe, g(l.list.length > 0 ? l.option : l.oEmpty), 1),
|
|
723
|
+
(o(!0), i(x, null, p(l.list, (s, u) => (o(), i("option", {
|
|
724
|
+
key: u,
|
|
725
|
+
value: s.id
|
|
726
|
+
}, g(s.text), 9, Pe))), 128))
|
|
727
|
+
], 16, ze), [
|
|
728
|
+
[U, r.model]
|
|
734
729
|
])
|
|
735
730
|
]);
|
|
736
731
|
}
|
|
737
|
-
const je = /* @__PURE__ */
|
|
732
|
+
const je = /* @__PURE__ */ h(Le, [["render", Ee]]), Ke = {
|
|
738
733
|
props: {
|
|
739
734
|
modelValue: { type: Number, default: 0 },
|
|
740
735
|
steps: { type: Array, required: !0 },
|
|
@@ -799,129 +794,129 @@ const je = /* @__PURE__ */ g(Ie, [["render", ze]]), Ee = {
|
|
|
799
794
|
this.$emit("submit");
|
|
800
795
|
}
|
|
801
796
|
}
|
|
802
|
-
},
|
|
797
|
+
}, We = { class: "flex items-center gap-6 w-full" }, Oe = ["disabled"], He = { class: "flex-1" }, Re = {
|
|
803
798
|
key: 0,
|
|
804
799
|
class: "flex items-center"
|
|
805
|
-
},
|
|
800
|
+
}, Ge = ["onClick"], Je = {
|
|
806
801
|
key: 0,
|
|
807
802
|
class: "w-4 h-4",
|
|
808
803
|
fill: "none",
|
|
809
804
|
stroke: "currentColor",
|
|
810
805
|
viewBox: "0 0 24 24"
|
|
811
|
-
},
|
|
806
|
+
}, Qe = {
|
|
812
807
|
key: 1,
|
|
813
808
|
class: "text-sm"
|
|
814
|
-
},
|
|
809
|
+
}, Xe = {
|
|
815
810
|
key: 1,
|
|
816
811
|
class: "w-full"
|
|
817
|
-
},
|
|
812
|
+
}, Ye = {
|
|
818
813
|
key: 0,
|
|
819
814
|
class: "text-xs mb-1 block"
|
|
820
|
-
},
|
|
821
|
-
function
|
|
822
|
-
return
|
|
823
|
-
|
|
815
|
+
}, Ze = { class: "w-full h-3 rounded-full bg-gray-200 overflow-hidden relative" }, $e = { key: 1 };
|
|
816
|
+
function et(e, t, l, n, a, r) {
|
|
817
|
+
return o(), i("div", We, [
|
|
818
|
+
l.button ? (o(), i("button", {
|
|
824
819
|
key: 0,
|
|
825
820
|
type: "button",
|
|
826
|
-
disabled:
|
|
827
|
-
onClick:
|
|
828
|
-
class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",
|
|
821
|
+
disabled: r.step === 0,
|
|
822
|
+
onClick: t[0] || (t[0] = (...s) => r.previous && r.previous(...s)),
|
|
823
|
+
class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", r.solid[l.color]])
|
|
829
824
|
}, [
|
|
830
|
-
|
|
825
|
+
t[3] || (t[3] = d("svg", {
|
|
831
826
|
class: "w-5 h-5",
|
|
832
827
|
fill: "none",
|
|
833
828
|
stroke: "currentColor",
|
|
834
829
|
viewBox: "0 0 24 24"
|
|
835
830
|
}, [
|
|
836
|
-
|
|
831
|
+
d("path", {
|
|
837
832
|
"stroke-linecap": "round",
|
|
838
833
|
"stroke-linejoin": "round",
|
|
839
834
|
"stroke-width": "2",
|
|
840
835
|
d: "M15 19l-7-7 7-7"
|
|
841
836
|
})
|
|
842
837
|
], -1)),
|
|
843
|
-
|
|
844
|
-
], 10,
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
(
|
|
848
|
-
key:
|
|
849
|
-
class: m(["flex items-center",
|
|
838
|
+
f(" " + g(l.btnPrevious), 1)
|
|
839
|
+
], 10, Oe)) : c("", !0),
|
|
840
|
+
d("div", He, [
|
|
841
|
+
l.type === "circle" ? (o(), i("div", Re, [
|
|
842
|
+
(o(!0), i(x, null, p(l.steps, (s, u) => (o(), i("div", {
|
|
843
|
+
key: u,
|
|
844
|
+
class: m(["flex items-center", u < l.steps.length - 1 ? "flex-1" : ""])
|
|
850
845
|
}, [
|
|
851
|
-
|
|
852
|
-
class: m(["flex flex-col items-center relative",
|
|
853
|
-
onClick: (S) =>
|
|
846
|
+
d("div", {
|
|
847
|
+
class: m(["flex flex-col items-center relative", l.selected ? "cursor-pointer" : "pointer-events-none"]),
|
|
848
|
+
onClick: (S) => r.select(u)
|
|
854
849
|
}, [
|
|
855
|
-
|
|
856
|
-
class: m(["w-9 h-9 rounded-full flex items-center justify-center border-2 font-semibold transition-colors duration-200",
|
|
850
|
+
d("div", {
|
|
851
|
+
class: m(["w-9 h-9 rounded-full flex items-center justify-center border-2 font-semibold transition-colors duration-200", r.circleClass(u)])
|
|
857
852
|
}, [
|
|
858
|
-
|
|
859
|
-
|
|
853
|
+
r.step > u ? (o(), i("svg", Je, [...t[4] || (t[4] = [
|
|
854
|
+
d("path", {
|
|
860
855
|
"stroke-linecap": "round",
|
|
861
856
|
"stroke-linejoin": "round",
|
|
862
857
|
"stroke-width": "3",
|
|
863
858
|
d: "M5 13l4 4L19 7"
|
|
864
859
|
}, null, -1)
|
|
865
|
-
])])) : (
|
|
860
|
+
])])) : (o(), i("span", Qe, g(u + 1), 1))
|
|
866
861
|
], 2),
|
|
867
|
-
|
|
862
|
+
l.text === "all" || l.text === "only" && r.step === u ? (o(), i("span", {
|
|
868
863
|
key: 0,
|
|
869
|
-
class: m(["absolute -top-5 text-xs font-medium whitespace-nowrap transition-colors duration-200",
|
|
870
|
-
},
|
|
871
|
-
], 10,
|
|
872
|
-
|
|
864
|
+
class: m(["absolute -top-5 text-xs font-medium whitespace-nowrap transition-colors duration-200", r.textClass(u)])
|
|
865
|
+
}, g(s), 3)) : c("", !0)
|
|
866
|
+
], 10, Ge),
|
|
867
|
+
u < l.steps.length - 1 ? (o(), i("div", {
|
|
873
868
|
key: 0,
|
|
874
|
-
class: m(["flex-1 h-2 mx-3 rounded transition-colors duration-200",
|
|
875
|
-
}, null, 2)) :
|
|
869
|
+
class: m(["flex-1 h-2 mx-3 rounded transition-colors duration-200", r.step > u ? r.lineActive : "bg-gray-300"])
|
|
870
|
+
}, null, 2)) : c("", !0)
|
|
876
871
|
], 2))), 128))
|
|
877
|
-
])) :
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
class: m(["h-full rounded-full transition-all duration-300 relative shadow-md",
|
|
883
|
-
style:
|
|
884
|
-
}, [...
|
|
885
|
-
|
|
872
|
+
])) : l.type === "linear" ? (o(), i("div", Xe, [
|
|
873
|
+
l.text === "all" ? (o(), i("span", Ye, g(Math.round(r.progressWidth)) + "% ", 1)) : c("", !0),
|
|
874
|
+
d("div", Ze, [
|
|
875
|
+
t[6] || (t[6] = d("div", { class: "absolute inset-0" }, null, -1)),
|
|
876
|
+
d("div", {
|
|
877
|
+
class: m(["h-full rounded-full transition-all duration-300 relative shadow-md", r.barActive]),
|
|
878
|
+
style: V({ width: r.progressWidth + "%" })
|
|
879
|
+
}, [...t[5] || (t[5] = [
|
|
880
|
+
d("div", { class: "absolute inset-0 bg-white/20 mix-blend-overlay animate-pulse" }, null, -1)
|
|
886
881
|
])], 6)
|
|
887
882
|
])
|
|
888
|
-
])) :
|
|
883
|
+
])) : c("", !0)
|
|
889
884
|
]),
|
|
890
|
-
|
|
891
|
-
|
|
885
|
+
l.button ? (o(), i("div", $e, [
|
|
886
|
+
r.step < l.steps.length - 1 ? (o(), i("button", {
|
|
892
887
|
key: 0,
|
|
893
888
|
type: "button",
|
|
894
|
-
onClick:
|
|
895
|
-
class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",
|
|
889
|
+
onClick: t[1] || (t[1] = (...s) => r.next && r.next(...s)),
|
|
890
|
+
class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", r.solid[l.color]])
|
|
896
891
|
}, [
|
|
897
|
-
|
|
898
|
-
|
|
892
|
+
f(g(l.btnNext) + " ", 1),
|
|
893
|
+
t[7] || (t[7] = d("svg", {
|
|
899
894
|
class: "w-5 h-5",
|
|
900
895
|
fill: "none",
|
|
901
896
|
stroke: "currentColor",
|
|
902
897
|
viewBox: "0 0 24 24"
|
|
903
898
|
}, [
|
|
904
|
-
|
|
899
|
+
d("path", {
|
|
905
900
|
"stroke-linecap": "round",
|
|
906
901
|
"stroke-linejoin": "round",
|
|
907
902
|
"stroke-width": "2",
|
|
908
903
|
d: "M9 5l7 7-7 7"
|
|
909
904
|
})
|
|
910
905
|
], -1))
|
|
911
|
-
], 2)) : (
|
|
906
|
+
], 2)) : (o(), i("button", {
|
|
912
907
|
key: 1,
|
|
913
908
|
type: "button",
|
|
914
|
-
onClick:
|
|
915
|
-
class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",
|
|
909
|
+
onClick: t[2] || (t[2] = (...s) => r.submitForm && r.submitForm(...s)),
|
|
910
|
+
class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", r.solid[l.color]])
|
|
916
911
|
}, [
|
|
917
|
-
|
|
918
|
-
|
|
912
|
+
f(g(l.btnFinish) + " ", 1),
|
|
913
|
+
t[8] || (t[8] = d("svg", {
|
|
919
914
|
class: "w-5 h-5",
|
|
920
915
|
fill: "none",
|
|
921
916
|
stroke: "currentColor",
|
|
922
917
|
viewBox: "0 0 24 24"
|
|
923
918
|
}, [
|
|
924
|
-
|
|
919
|
+
d("path", {
|
|
925
920
|
"stroke-linecap": "round",
|
|
926
921
|
"stroke-linejoin": "round",
|
|
927
922
|
"stroke-width": "2",
|
|
@@ -929,57 +924,57 @@ function Ye(e, l, t, n, d, s) {
|
|
|
929
924
|
})
|
|
930
925
|
], -1))
|
|
931
926
|
], 2))
|
|
932
|
-
])) :
|
|
927
|
+
])) : c("", !0)
|
|
933
928
|
]);
|
|
934
929
|
}
|
|
935
|
-
const
|
|
930
|
+
const tt = /* @__PURE__ */ h(Ke, [["render", et]]), lt = {
|
|
936
931
|
name: "TableStyle",
|
|
937
932
|
props: {
|
|
938
933
|
columns: { type: Array, required: !0 },
|
|
939
934
|
rows: { type: Array, default: () => [] }
|
|
940
935
|
}
|
|
941
|
-
},
|
|
942
|
-
function
|
|
943
|
-
return
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
(
|
|
948
|
-
key:
|
|
936
|
+
}, rt = { class: "w-full overflow-x-auto bg-white border border-gray-300 rounded shadow-sm" }, st = { class: "min-w-full" }, it = { class: "bg-gray-800" }, ot = { key: 1 }, dt = { key: 0 }, at = ["colspan"];
|
|
937
|
+
function nt(e, t, l, n, a, r) {
|
|
938
|
+
return o(), i("div", rt, [
|
|
939
|
+
d("table", st, [
|
|
940
|
+
d("thead", null, [
|
|
941
|
+
d("tr", it, [
|
|
942
|
+
(o(!0), i(x, null, p(l.columns, (s, u) => (o(), i("th", {
|
|
943
|
+
key: u,
|
|
949
944
|
class: "px-4 py-1.5 text-left text-sm font-semibold text-white border-b border-gray-600"
|
|
950
|
-
},
|
|
945
|
+
}, g(s.label), 1))), 128))
|
|
951
946
|
])
|
|
952
947
|
]),
|
|
953
|
-
|
|
954
|
-
(
|
|
955
|
-
key:
|
|
948
|
+
d("tbody", null, [
|
|
949
|
+
(o(!0), i(x, null, p(l.rows, (s, u) => (o(), i("tr", {
|
|
950
|
+
key: u,
|
|
956
951
|
class: "hover:bg-gray-100 transition-colors cursor-default"
|
|
957
952
|
}, [
|
|
958
|
-
(
|
|
953
|
+
(o(!0), i(x, null, p(l.columns, (S, D) => (o(), i("td", {
|
|
959
954
|
key: D,
|
|
960
955
|
class: "px-4 py-1.5 text-sm text-gray-700 border-b border-gray-200"
|
|
961
956
|
}, [
|
|
962
957
|
e.$slots[S.field] ? C(e.$slots, S.field, {
|
|
963
958
|
key: 0,
|
|
964
|
-
row:
|
|
965
|
-
}) : (
|
|
959
|
+
row: s
|
|
960
|
+
}) : (o(), i("span", ot, g(s[S.field]), 1))
|
|
966
961
|
]))), 128))
|
|
967
962
|
]))), 128)),
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
colspan:
|
|
963
|
+
l.rows.length === 0 ? (o(), i("tr", dt, [
|
|
964
|
+
d("td", {
|
|
965
|
+
colspan: l.columns.length,
|
|
971
966
|
class: "px-4 py-10 text-center text-gray-500 text-sm bg-gray-50"
|
|
972
|
-
}, [...
|
|
973
|
-
|
|
974
|
-
|
|
967
|
+
}, [...t[0] || (t[0] = [
|
|
968
|
+
d("div", { class: "flex flex-col items-center gap-3" }, [
|
|
969
|
+
d("span", { class: "text-gray-600 font-medium" }, "No hay datos para mostrar")
|
|
975
970
|
], -1)
|
|
976
|
-
])], 8,
|
|
977
|
-
])) :
|
|
971
|
+
])], 8, at)
|
|
972
|
+
])) : c("", !0)
|
|
978
973
|
])
|
|
979
974
|
])
|
|
980
975
|
]);
|
|
981
976
|
}
|
|
982
|
-
const
|
|
977
|
+
const ut = /* @__PURE__ */ h(lt, [["render", nt]]), ct = {
|
|
983
978
|
name: "TextAreaStyle",
|
|
984
979
|
props: {
|
|
985
980
|
modelValue: String,
|
|
@@ -1004,40 +999,40 @@ const ot = /* @__PURE__ */ g($e, [["render", at]]), dt = {
|
|
|
1004
999
|
}
|
|
1005
1000
|
}
|
|
1006
1001
|
}
|
|
1007
|
-
},
|
|
1002
|
+
}, gt = { class: "w-full" }, mt = { class: "flex justify-between" }, ht = ["for"], bt = {
|
|
1008
1003
|
key: 0,
|
|
1009
1004
|
class: "text-red-800 ml-2"
|
|
1010
|
-
},
|
|
1011
|
-
function
|
|
1012
|
-
return
|
|
1013
|
-
|
|
1014
|
-
|
|
1005
|
+
}, yt = ["for"], ft = ["id", "placeholder", "maxlength", "rows"];
|
|
1006
|
+
function xt(e, t, l, n, a, r) {
|
|
1007
|
+
return o(), i("div", gt, [
|
|
1008
|
+
d("div", mt, [
|
|
1009
|
+
d("label", {
|
|
1015
1010
|
class: "block text-sm font-medium text-gray-700",
|
|
1016
|
-
for:
|
|
1011
|
+
for: r.getUUID
|
|
1017
1012
|
}, [
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
], 8,
|
|
1021
|
-
|
|
1013
|
+
l.required ? (o(), i("span", bt, "*")) : c("", !0),
|
|
1014
|
+
f(" " + g(l.label), 1)
|
|
1015
|
+
], 8, ht),
|
|
1016
|
+
l.note ? (o(), i("label", {
|
|
1022
1017
|
key: 0,
|
|
1023
1018
|
class: "block text-xs text-gray-700",
|
|
1024
|
-
for:
|
|
1025
|
-
},
|
|
1019
|
+
for: r.getUUID
|
|
1020
|
+
}, g(l.note), 9, yt)) : c("", !0)
|
|
1026
1021
|
]),
|
|
1027
|
-
|
|
1028
|
-
"onUpdate:modelValue":
|
|
1029
|
-
id:
|
|
1030
|
-
placeholder:
|
|
1031
|
-
}, { disabled:
|
|
1032
|
-
maxlength:
|
|
1033
|
-
rows: Number(
|
|
1022
|
+
y(d("textarea", w({
|
|
1023
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => r.model = s),
|
|
1024
|
+
id: r.getUUID,
|
|
1025
|
+
placeholder: l.placeholder
|
|
1026
|
+
}, { disabled: l.disabled, required: l.required }, {
|
|
1027
|
+
maxlength: l.maxlength ? Number(l.maxlength) : null,
|
|
1028
|
+
rows: Number(l.row),
|
|
1034
1029
|
class: "w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed resize-none"
|
|
1035
|
-
}), null, 16,
|
|
1036
|
-
[v,
|
|
1030
|
+
}), null, 16, ft), [
|
|
1031
|
+
[v, r.model]
|
|
1037
1032
|
])
|
|
1038
1033
|
]);
|
|
1039
1034
|
}
|
|
1040
|
-
const
|
|
1035
|
+
const pt = /* @__PURE__ */ h(ct, [["render", xt]]), wt = {
|
|
1041
1036
|
name: "ToggleStyle",
|
|
1042
1037
|
props: {
|
|
1043
1038
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1092,45 +1087,45 @@ const yt = /* @__PURE__ */ g(dt, [["render", bt]]), ft = {
|
|
|
1092
1087
|
this.disabled || (this.model = !this.model);
|
|
1093
1088
|
}
|
|
1094
1089
|
}
|
|
1095
|
-
},
|
|
1096
|
-
function
|
|
1097
|
-
return
|
|
1098
|
-
|
|
1099
|
-
|
|
1090
|
+
}, vt = { class: "block text-sm font-medium text-gray-700" };
|
|
1091
|
+
function Ct(e, t, l, n, a, r) {
|
|
1092
|
+
return o(), i("div", null, [
|
|
1093
|
+
d("label", vt, g(l.label), 1),
|
|
1094
|
+
d("div", {
|
|
1100
1095
|
class: m([
|
|
1101
1096
|
"relative w-11 h-6 inline-flex items-center transition-colors duration-300 px-1",
|
|
1102
|
-
|
|
1103
|
-
|
|
1097
|
+
r.shapeToggle,
|
|
1098
|
+
l.disabled ? r.disabledClasses : r.computedClasses
|
|
1104
1099
|
]),
|
|
1105
|
-
onClick:
|
|
1100
|
+
onClick: t[0] || (t[0] = (...s) => r.toggle && r.toggle(...s))
|
|
1106
1101
|
}, [
|
|
1107
|
-
|
|
1102
|
+
d("div", {
|
|
1108
1103
|
class: m([
|
|
1109
1104
|
"absolute top-0.75 left-1 w-4 h-4 bg-white shadow transform transition-all duration-300",
|
|
1110
|
-
|
|
1111
|
-
|
|
1105
|
+
r.shapeToggle,
|
|
1106
|
+
r.model ? "translate-x-full" : "translate-x-0"
|
|
1112
1107
|
])
|
|
1113
1108
|
}, null, 2)
|
|
1114
1109
|
], 2)
|
|
1115
1110
|
]);
|
|
1116
1111
|
}
|
|
1117
|
-
const
|
|
1112
|
+
const St = /* @__PURE__ */ h(wt, [["render", Ct]]), _t = {
|
|
1118
1113
|
install(e) {
|
|
1119
|
-
e.component("AlertStyle", b), e.component("ButtonStyle", q), e.component("CheckStyle", W), e.component("ComboBoxStyle",
|
|
1114
|
+
e.component("AlertStyle", b), e.component("ButtonStyle", q), e.component("CheckStyle", W), e.component("ComboBoxStyle", re), e.component("DateTimeStyle", ge), e.component("InputDecimalStyle", Ce), e.component("InputStyle", qe), e.component("SelectStyle", je), e.component("StepperStyle", tt), e.component("TableStyle", ut), e.component("TextAreaStyle", pt), e.component("ToggleStyle", St), e.config.globalProperties.$alertstyle = b;
|
|
1120
1115
|
}
|
|
1121
1116
|
};
|
|
1122
1117
|
export {
|
|
1123
1118
|
b as AlertStyle,
|
|
1124
1119
|
q as ButtonStyle,
|
|
1125
1120
|
W as CheckStyle,
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1121
|
+
re as ComboBoxStyle,
|
|
1122
|
+
ge as DateTimeStyle,
|
|
1123
|
+
Ce as InputDecimalStyle,
|
|
1124
|
+
qe as InputStyle,
|
|
1130
1125
|
je as SelectStyle,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1126
|
+
tt as StepperStyle,
|
|
1127
|
+
ut as TableStyle,
|
|
1128
|
+
pt as TextAreaStyle,
|
|
1129
|
+
St as ToggleStyle,
|
|
1130
|
+
_t as default
|
|
1136
1131
|
};
|