@luis-angel-martin-dzul/vue-input-styles 0.0.42

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.
@@ -0,0 +1,1138 @@
1
+ import { createElementBlock as i, openBlock as a, normalizeClass as g, renderSlot as _, createElementVNode as o, createCommentVNode as h, toDisplayString as u, Fragment as x, renderList as p, createTextVNode as f, withDirectives as w, mergeProps as y, vModelText as C, withModifiers as S, vModelDynamic as k, vModelSelect as U, normalizeStyle as V } from "vue";
2
+ class b {
3
+ static type = {
4
+ success: "success",
5
+ error: "error",
6
+ warning: "warning",
7
+ info: "info",
8
+ neutral: "neutral"
9
+ };
10
+ static container = null;
11
+ static iconMap = {
12
+ success: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM438 209.7C427.3 201.9 412.3 204.3 404.5 215L285.1 379.2L233 327.1C223.6 317.7 208.4 317.7 199.1 327.1C189.8 336.5 189.7 351.7 199.1 361L271.1 433C276.1 438 282.9 440.5 289.9 440C296.9 439.5 303.3 435.9 307.4 430.2L443.3 243.2C451.1 232.5 448.7 217.5 438 209.7z"/></svg>',
13
+ error: '<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 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"/></svg>',
14
+ warning: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384zM320 192C301.8 192 287.3 207.5 288.6 225.7L296 329.7C296.9 342.3 307.4 352 319.9 352C332.5 352 342.9 342.3 343.8 329.7L351.2 225.7C352.5 207.5 338.1 192 319.8 192z"/></svg>',
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
+ 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
+ };
18
+ static #e(l, e, n = b.type.info, d = 4e3) {
19
+ b.ensureContainer();
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 c = b.iconMap[n] || "";
25
+ s.innerHTML = `
26
+ <div class="alert-icon">${c}</div>
27
+ <div class="alert-texts">
28
+ <div class="alert-title">${l}</div>
29
+ <div class="alert-message">${e}</div>
30
+ </div>
31
+ <div class="alert-close">&times;</div>
32
+ `, s.querySelector(".alert-close").addEventListener("click", () => {
33
+ b.remove(s);
34
+ }), b.container.appendChild(s), setTimeout(() => s.classList.add("show"), 10), d > 0 && setTimeout(() => b.remove(s), d);
35
+ }
36
+ // Métodos públicos reutilizables
37
+ static success(l, e = "") {
38
+ this.#e(l, e, this.type.success);
39
+ }
40
+ static error(l, e = "") {
41
+ this.#e(l, e, this.type.error);
42
+ }
43
+ static warning(l, e = "") {
44
+ this.#e(l, e, this.type.warning);
45
+ }
46
+ static info(l, e = "") {
47
+ this.#e(l, e, this.type.info);
48
+ }
49
+ static neutral(l, e = "") {
50
+ this.#e(l, e, this.type.neutral);
51
+ }
52
+ static ensureContainer() {
53
+ this.container || (this.container = document.createElement("div"), this.container.className = "alert-container", document.body.appendChild(this.container));
54
+ }
55
+ static remove(l) {
56
+ l.classList.add("hide"), setTimeout(() => l.remove(), 250);
57
+ }
58
+ }
59
+ const m = (t, l) => {
60
+ const e = t.__vccOpts || t;
61
+ for (const [n, d] of l)
62
+ e[n] = d;
63
+ return e;
64
+ }, T = {
65
+ name: "ButtonStyle",
66
+ emits: ["click"],
67
+ props: {
68
+ class: { type: String, default: "" },
69
+ variant: { type: String, default: "solid" },
70
+ color: { type: String, default: "gray" },
71
+ disabled: { type: Boolean, default: !1 },
72
+ delay: { type: String, default: "1.5" },
73
+ full: { type: Boolean, default: !1 }
74
+ },
75
+ data() {
76
+ return {
77
+ internalDisabled: !1
78
+ };
79
+ },
80
+ computed: {
81
+ isDisabled() {
82
+ return this.disabled || this.internalDisabled;
83
+ },
84
+ buttonClasses() {
85
+ if (this.class)
86
+ return `${this.class} disabled:opacity-60 disabled:cursor-not-allowed`;
87
+ const t = [
88
+ "h-min font-semibold items-center justify-center rounded px-3 py-1.5 gap-1"
89
+ ];
90
+ t.push(this.full ? "w-full flex" : "inline-flex");
91
+ const l = {
92
+ solid: {
93
+ gray: "text-white bg-slate-600 enabled:hover:bg-slate-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
94
+ green: "text-white bg-emerald-600 enabled:hover:bg-emerald-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
95
+ blue: "text-white bg-sky-600 enabled:hover:bg-sky-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
96
+ red: "text-white bg-rose-600 enabled:hover:bg-rose-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
97
+ yellow: "text-white bg-amber-600 enabled:hover:bg-amber-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"
98
+ },
99
+ outline: {
100
+ gray: "text-slate-700 enabled:hover:bg-slate-50 border border-slate-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
101
+ green: "text-emerald-700 enabled:hover:bg-emerald-50 border border-emerald-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
102
+ blue: "text-sky-700 enabled:hover:bg-sky-50 border border-sky-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
103
+ red: "text-rose-700 enabled:hover:bg-rose-50 border border-rose-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",
104
+ yellow: "text-amber-700 enabled:hover:bg-amber-50 border border-amber-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"
105
+ }
106
+ };
107
+ return t.push(l[this.variant][this.color]), t;
108
+ }
109
+ },
110
+ methods: {
111
+ handleClick(t) {
112
+ this.isDisabled || (this.$emit("click", t), this.internalDisabled = !0, setTimeout(() => {
113
+ this.internalDisabled = !1;
114
+ }, 1e3 * Number(this.delay)));
115
+ }
116
+ }
117
+ }, I = ["disabled"];
118
+ function B(t, l, e, n, d, r) {
119
+ return a(), i("button", {
120
+ disabled: r.isDisabled,
121
+ type: "button",
122
+ onClick: l[0] || (l[0] = (...s) => r.handleClick && r.handleClick(...s)),
123
+ class: g(r.buttonClasses)
124
+ }, [
125
+ _(t.$slots, "default")
126
+ ], 10, I);
127
+ }
128
+ const L = /* @__PURE__ */ m(T, [["render", B]]), q = {
129
+ name: "CheckStyle",
130
+ props: {
131
+ label: { type: String, default: "" },
132
+ list: { type: Array, default: () => [] },
133
+ grid: { type: String, default: "grid grid-cols-4" },
134
+ all: { type: Boolean, default: !1 },
135
+ modelValue: { type: [Array, String, Number, Object], default: () => [] },
136
+ returnAll: { type: Boolean, default: !1 },
137
+ returnType: { type: String, default: "id" }
138
+ // object | text | id
139
+ },
140
+ data() {
141
+ return {
142
+ realSelection: []
143
+ };
144
+ },
145
+ computed: {
146
+ getUUID() {
147
+ return crypto.randomUUID();
148
+ },
149
+ isAllSelected() {
150
+ return this.list.length > 0 && this.realSelection.length === this.list.length;
151
+ }
152
+ },
153
+ watch: {
154
+ modelValue: {
155
+ immediate: !0,
156
+ handler(t) {
157
+ Array.isArray(t) ? this.realSelection = [...t] : t ? this.realSelection = [t] : this.realSelection = [];
158
+ }
159
+ }
160
+ },
161
+ methods: {
162
+ getValue(t) {
163
+ return this.returnType === "object" ? t : this.returnType === "text" ? t.name : t.id;
164
+ },
165
+ isChecked(t) {
166
+ const l = this.getValue(t);
167
+ return this.realSelection.includes(l);
168
+ },
169
+ emitExternal() {
170
+ if (!this.returnAll && this.realSelection.length === this.list.length) {
171
+ this.$emit("update:modelValue", "");
172
+ return;
173
+ }
174
+ this.$emit(
175
+ "update:modelValue",
176
+ this.realSelection.length ? [...this.realSelection] : ""
177
+ );
178
+ },
179
+ onChange(t) {
180
+ const l = this.getValue(t);
181
+ this.realSelection.includes(l) ? this.realSelection = this.realSelection.filter(
182
+ (e) => e !== l
183
+ ) : this.all ? this.realSelection.push(l) : this.realSelection = [l], this.emitExternal();
184
+ },
185
+ toggleSelectAll() {
186
+ this.all && (this.isAllSelected ? this.realSelection = [] : this.realSelection = this.list.map((t) => this.getValue(t)), this.emitExternal());
187
+ }
188
+ }
189
+ }, N = { class: "w-full" }, A = { class: "flex items-center justify-between" }, M = { class: "block text-sm font-medium text-gray-700" }, z = {
190
+ key: 0,
191
+ class: "flex items-center gap-2 select-none"
192
+ }, E = ["id", "checked"], j = ["for"], F = ["id", "checked", "onChange"], P = ["for"];
193
+ function K(t, l, e, n, d, r) {
194
+ return a(), i("div", N, [
195
+ o("div", A, [
196
+ o("h3", M, u(e.label), 1),
197
+ e.all ? (a(), i("div", z, [
198
+ o("input", {
199
+ type: "checkbox",
200
+ id: "todos-" + r.getUUID,
201
+ checked: r.isAllSelected,
202
+ onChange: l[0] || (l[0] = (...s) => r.toggleSelectAll && r.toggleSelectAll(...s)),
203
+ class: "w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-200"
204
+ }, null, 40, E),
205
+ o("label", {
206
+ for: "todos-" + r.getUUID,
207
+ class: "text-sm text-gray-600 uppercase truncate"
208
+ }, " Seleccionar todos ", 8, j)
209
+ ])) : h("", !0)
210
+ ]),
211
+ o("div", {
212
+ class: g(["max-h-48 overflow-auto space-y-1", e.grid])
213
+ }, [
214
+ (a(!0), i(x, null, p(e.list, (s) => (a(), i("div", {
215
+ key: s.id,
216
+ class: "flex items-center gap-2 select-none"
217
+ }, [
218
+ o("input", {
219
+ type: "checkbox",
220
+ id: r.getUUID + "-" + s.id,
221
+ checked: r.isChecked(s),
222
+ onChange: (c) => r.onChange(s),
223
+ class: "w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-200"
224
+ }, null, 40, F),
225
+ o("label", {
226
+ for: r.getUUID + "-" + s.id,
227
+ class: "truncate text-gray-700"
228
+ }, u(s.name), 9, P)
229
+ ]))), 128))
230
+ ], 2)
231
+ ]);
232
+ }
233
+ const W = /* @__PURE__ */ m(q, [["render", K]]), O = {
234
+ name: "ComboBoxStyle",
235
+ props: {
236
+ modelValue: [String, Number, Object, null],
237
+ label: { type: String, default: "" },
238
+ placeholder: { type: String, default: "Buscar..." },
239
+ disabled: { type: Boolean, default: !1 },
240
+ required: { type: Boolean, default: !1 },
241
+ list: { type: Array, default: () => [] },
242
+ oEmpty: { type: String, default: "- Sin registros" }
243
+ },
244
+ data() {
245
+ return {
246
+ search: "",
247
+ open: !1
248
+ };
249
+ },
250
+ watch: {
251
+ modelValue(t) {
252
+ const l = this.list.find((e) => e.id === t);
253
+ l && (this.search = l.name);
254
+ }
255
+ },
256
+ computed: {
257
+ getUUID() {
258
+ return crypto.randomUUID();
259
+ },
260
+ filteredList() {
261
+ return this.search ? this.list.filter(
262
+ (t) => t.name.toLowerCase().includes(this.search.toLowerCase())
263
+ ) : this.list;
264
+ },
265
+ model: {
266
+ get() {
267
+ return this.modelValue;
268
+ },
269
+ set(t) {
270
+ this.$emit("update:modelValue", t);
271
+ }
272
+ }
273
+ },
274
+ methods: {
275
+ selectItem(t) {
276
+ this.model = t.id, this.search = t.name, this.open = !1;
277
+ },
278
+ closeWithDelay() {
279
+ setTimeout(() => {
280
+ this.open = !1;
281
+ }, 150);
282
+ }
283
+ }
284
+ }, H = { class: "w-full" }, R = ["for"], G = {
285
+ key: 0,
286
+ class: "text-red-800 ml-2"
287
+ }, J = {
288
+ key: 0,
289
+ class: "relative"
290
+ }, Q = { class: "z-2 absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-7 h-7" }, X = { class: "relative w-full" }, Y = ["id", "placeholder"], Z = {
291
+ key: 0,
292
+ class: "absolute z-10 left-0 right-0 mt-0.5 bg-white border border-gray-200 rounded shadow max-h-48 overflow-auto"
293
+ }, $ = {
294
+ key: 0,
295
+ class: "w-full text-gray-800 bg-white px-3 py-2"
296
+ }, ee = ["onClick"], te = {
297
+ key: 1,
298
+ class: "relative w-full"
299
+ }, le = ["id", "placeholder"], re = {
300
+ key: 0,
301
+ class: "absolute z-10 left-0 right-0 mt-0.5 bg-white border border-gray-200 rounded shadow max-h-48 overflow-auto"
302
+ }, se = {
303
+ key: 0,
304
+ class: "w-full text-gray-800 bg-white px-3 py-2"
305
+ }, ie = ["onClick"];
306
+ function ae(t, l, e, n, d, r) {
307
+ return a(), i("div", H, [
308
+ o("label", {
309
+ class: "block text-sm font-medium text-gray-700",
310
+ for: r.getUUID
311
+ }, [
312
+ e.required ? (a(), i("span", G, "*")) : h("", !0),
313
+ f(" " + u(e.label), 1)
314
+ ], 8, R),
315
+ t.$slots.icon ? (a(), i("div", J, [
316
+ o("div", Q, [
317
+ _(t.$slots, "icon")
318
+ ]),
319
+ o("div", X, [
320
+ w(o("input", y({
321
+ id: r.getUUID,
322
+ type: "text",
323
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => d.search = s),
324
+ placeholder: e.placeholder
325
+ }, { disabled: e.disabled, required: e.required }, {
326
+ class: "w-full text-gray-800 bg-white 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 disabled:cursor-not-allowed",
327
+ onFocus: l[1] || (l[1] = (s) => !e.disabled && (d.open = !0)),
328
+ onInput: l[2] || (l[2] = (s) => !e.disabled && (d.open = !0)),
329
+ onBlur: l[3] || (l[3] = (...s) => r.closeWithDelay && r.closeWithDelay(...s))
330
+ }), null, 16, Y), [
331
+ [C, d.search]
332
+ ]),
333
+ d.open && !e.disabled ? (a(), i("div", Z, [
334
+ r.filteredList.length === 0 ? (a(), i("div", $, u(e.oEmpty), 1)) : h("", !0),
335
+ (a(!0), i(x, null, p(r.filteredList, (s, c) => (a(), i("div", {
336
+ key: c,
337
+ onClick: (v) => r.selectItem(s),
338
+ class: "w-full text-gray-800 bg-white hover:bg-gray-100 px-3 py-2"
339
+ }, u(s.name), 9, ee))), 128))
340
+ ])) : h("", !0)
341
+ ])
342
+ ])) : (a(), i("div", te, [
343
+ w(o("input", y({
344
+ id: r.getUUID,
345
+ type: "text",
346
+ "onUpdate:modelValue": l[4] || (l[4] = (s) => d.search = s),
347
+ placeholder: e.placeholder
348
+ }, { disabled: e.disabled, required: e.required }, {
349
+ 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",
350
+ onFocus: l[5] || (l[5] = (s) => !e.disabled && (d.open = !0)),
351
+ onInput: l[6] || (l[6] = (s) => !e.disabled && (d.open = !0)),
352
+ onBlur: l[7] || (l[7] = (...s) => r.closeWithDelay && r.closeWithDelay(...s))
353
+ }), null, 16, le), [
354
+ [C, d.search]
355
+ ]),
356
+ d.open && !e.disabled ? (a(), i("div", re, [
357
+ r.filteredList.length === 0 ? (a(), i("div", se, u(e.oEmpty), 1)) : h("", !0),
358
+ (a(!0), i(x, null, p(r.filteredList, (s, c) => (a(), i("div", {
359
+ key: c,
360
+ onClick: (v) => r.selectItem(s),
361
+ class: "w-full text-gray-800 bg-white hover:bg-gray-100 px-3 py-2"
362
+ }, u(s.name), 9, ie))), 128))
363
+ ])) : h("", !0)
364
+ ]))
365
+ ]);
366
+ }
367
+ const oe = /* @__PURE__ */ m(O, [["render", ae]]), de = {
368
+ name: "DateTimeStyle",
369
+ props: {
370
+ modelValue: String,
371
+ disabled: { type: Boolean, default: !1 },
372
+ required: { type: Boolean, default: !1 },
373
+ /** "date", "time", "datetime", "datetime2" */
374
+ mode: { type: String, default: "datetime" },
375
+ label: { type: String, default: "Seleccionar fecha" },
376
+ /** segundos: "default"=01, "max"=59 */
377
+ secondsMode: { type: String, default: "default" }
378
+ },
379
+ data() {
380
+ return {
381
+ localDate: "",
382
+ localTime: ""
383
+ };
384
+ },
385
+ computed: {
386
+ model: {
387
+ get() {
388
+ return this.modelValue;
389
+ },
390
+ set(t) {
391
+ this.$emit("update:modelValue", t);
392
+ }
393
+ },
394
+ showDate() {
395
+ return ["date", "datetime", "datetime2"].includes(this.mode);
396
+ },
397
+ showTime() {
398
+ return ["time", "datetime"].includes(this.mode);
399
+ },
400
+ segundos() {
401
+ return this.secondsMode === "max" ? "59" : "01";
402
+ },
403
+ dateInputClass() {
404
+ let t = "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";
405
+ return this.showDate && this.showTime ? t + " rounded-l" : t + " rounded";
406
+ },
407
+ timeInputClass() {
408
+ let t = "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";
409
+ return this.showDate && this.showTime ? t + " rounded-r" : t + " rounded";
410
+ },
411
+ gridClass() {
412
+ return this.showDate && this.showTime ? "grid grid-cols-2" : "";
413
+ }
414
+ },
415
+ watch: {
416
+ modelValue: {
417
+ immediate: !0,
418
+ handler(t) {
419
+ if (!t) {
420
+ this.localDate = "", this.localTime = "";
421
+ return;
422
+ }
423
+ if (this.mode === "date")
424
+ this.localDate = t;
425
+ else if (this.mode === "time")
426
+ this.localTime = t;
427
+ else if (this.mode === "datetime") {
428
+ const [l, e] = t.split("T");
429
+ this.localDate = l || "", this.localTime = e ? e.slice(0, 5) : "";
430
+ } else this.mode === "datetime2" && (this.localDate = t.split("T")[0] || "", this.localTime = "");
431
+ }
432
+ },
433
+ mode: {
434
+ immediate: !0,
435
+ handler() {
436
+ this.parseValue(this.modelValue);
437
+ }
438
+ }
439
+ },
440
+ methods: {
441
+ parseValue(t) {
442
+ if (!t) {
443
+ this.localDate = "", this.localTime = "";
444
+ return;
445
+ }
446
+ if (this.mode === "date")
447
+ this.localDate = t, this.localTime = "";
448
+ else if (this.mode === "time")
449
+ this.localDate = "", this.localTime = t;
450
+ else if (this.mode === "datetime") {
451
+ const [l, e] = t.split("T");
452
+ this.localDate = l || "", this.localTime = e ? e.slice(0, 5) : "";
453
+ } else this.mode === "datetime2" && (this.localDate = t.split("T")[0] || "", this.localTime = "");
454
+ this.emitValue();
455
+ },
456
+ emitValue() {
457
+ let t = "";
458
+ this.mode === "date" ? t = this.localDate || "" : this.mode === "time" ? t = this.localTime || "" : this.mode === "datetime" ? !this.localDate || !this.localTime ? t = "" : t = `${this.localDate}T${this.localTime}:${this.segundos}.000` : this.mode === "datetime2" && (this.localDate ? t = `${this.localDate}T${this.secondsMode === "max" ? "23:59:59.000" : "00:01:00.000"}` : t = ""), this.model = t;
459
+ }
460
+ }
461
+ }, ne = { class: "w-full" }, ue = { class: "block text-sm font-medium text-gray-700" }, ce = {
462
+ key: 0,
463
+ class: "text-red-800 ml-2"
464
+ };
465
+ function he(t, l, e, n, d, r) {
466
+ return a(), i("div", ne, [
467
+ o("label", ue, [
468
+ e.required ? (a(), i("span", ce, "*")) : h("", !0),
469
+ f(" " + u(e.label), 1)
470
+ ]),
471
+ o("div", {
472
+ class: g(r.gridClass)
473
+ }, [
474
+ r.showDate ? w((a(), i("input", y({
475
+ key: 0,
476
+ type: "date"
477
+ }, { disabled: e.disabled, required: e.required }, {
478
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => d.localDate = s),
479
+ onInput: l[1] || (l[1] = (...s) => r.emitValue && r.emitValue(...s)),
480
+ class: r.dateInputClass
481
+ }), null, 16)), [
482
+ [C, d.localDate]
483
+ ]) : h("", !0),
484
+ r.showTime ? w((a(), i("input", y({
485
+ key: 1,
486
+ type: "time"
487
+ }, { disabled: e.disabled, required: e.required }, {
488
+ "onUpdate:modelValue": l[2] || (l[2] = (s) => d.localTime = s),
489
+ onInput: l[3] || (l[3] = (...s) => r.emitValue && r.emitValue(...s)),
490
+ class: r.timeInputClass
491
+ }), null, 16)), [
492
+ [C, d.localTime]
493
+ ]) : h("", !0)
494
+ ], 2)
495
+ ]);
496
+ }
497
+ const ge = /* @__PURE__ */ m(de, [["render", he]]), me = {
498
+ name: "InputDecimalStyle",
499
+ props: {
500
+ modelValue: { type: [String, Number], default: "" },
501
+ label: { type: String, default: "" },
502
+ placeholder: { type: String, default: "" },
503
+ decimals: { type: String, default: "2" },
504
+ maxlength: { type: String, default: "14" },
505
+ disabled: { type: Boolean, default: !1 },
506
+ required: { type: Boolean, default: !1 }
507
+ },
508
+ computed: {
509
+ getUUID() {
510
+ return crypto.randomUUID();
511
+ },
512
+ formattedValue() {
513
+ if (this.modelValue === "" || this.modelValue === null) return "";
514
+ const t = parseFloat(this.modelValue);
515
+ return isNaN(t) ? "" : t.toLocaleString("en-US", {
516
+ minimumFractionDigits: 0,
517
+ maximumFractionDigits: Number(this.decimals)
518
+ });
519
+ }
520
+ },
521
+ methods: {
522
+ onKeyDown(t) {
523
+ const l = [
524
+ "Backspace",
525
+ "Delete",
526
+ "Tab",
527
+ "Escape",
528
+ "Enter",
529
+ "ArrowLeft",
530
+ "ArrowRight",
531
+ "ArrowUp",
532
+ "ArrowDown",
533
+ "Home",
534
+ "End"
535
+ ];
536
+ if (!((t.ctrlKey || t.metaKey) && ["a", "c", "v", "x", "z"].includes(t.key.toLowerCase())) && !l.includes(t.key)) {
537
+ if (t.key >= "0" && t.key <= "9") {
538
+ const e = t.target.value.replace(/,/g, ""), n = t.target.selectionStart, d = e.split(".");
539
+ if (d.length === 2) {
540
+ const r = d[1];
541
+ n > e.indexOf(".") && r.length >= Number(this.decimals) && t.preventDefault();
542
+ }
543
+ return;
544
+ }
545
+ t.key === "." || t.key === "," ? (Number(this.decimals) === 0 || t.target.value.includes(".")) && t.preventDefault() : t.preventDefault();
546
+ }
547
+ },
548
+ onInput(t) {
549
+ let l = t.target.value.replace(/[^0-9.]/g, "");
550
+ Number(this.decimals) === 0 && (l = l.replace(/\./g, ""));
551
+ const e = l.split(".");
552
+ e.length > 2 && (l = e[0] + "." + e.slice(1).join("")), e[1] && e[1].length > Number(this.decimals) && (l = e[0] + "." + e[1].slice(0, Number(this.decimals))), this.$emit("update:modelValue", l);
553
+ },
554
+ onPaste(t) {
555
+ let e = (t.clipboardData || window.clipboardData).getData("text").replace(/[^0-9.]/g, "");
556
+ Number(this.decimals) === 0 && (e = e.replace(/\./g, ""));
557
+ const n = e.split(".");
558
+ n.length > 2 && (e = n[0] + "." + n.slice(1).join("")), n[1] && n[1].length > Number(this.decimals) && (e = n[0] + "." + n[1].slice(0, Number(this.decimals))), e !== "" && this.$emit("update:modelValue", e);
559
+ },
560
+ onBlur() {
561
+ let t = this.modelValue ? parseFloat(this.modelValue) : "";
562
+ !isNaN(t) && t !== "" && (t = t.toFixed(Number(this.decimals))), this.$emit("update:modelValue", t);
563
+ }
564
+ }
565
+ }, be = { class: "w-full" }, ye = ["for"], fe = {
566
+ key: 0,
567
+ class: "text-red-800 ml-2"
568
+ }, xe = {
569
+ key: 0,
570
+ class: "relative"
571
+ }, pe = { class: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5" }, we = ["id", "value", "placeholder", "maxlength"], ve = ["id", "value", "placeholder", "maxlength"];
572
+ function Ce(t, l, e, n, d, r) {
573
+ return a(), i("div", be, [
574
+ o("label", {
575
+ class: "block text-sm font-medium text-gray-700",
576
+ for: r.getUUID
577
+ }, [
578
+ e.required ? (a(), i("span", fe, "*")) : h("", !0),
579
+ f(" " + u(e.label), 1)
580
+ ], 8, ye),
581
+ t.$slots.icon ? (a(), i("div", xe, [
582
+ o("div", pe, [
583
+ _(t.$slots, "icon")
584
+ ]),
585
+ o("input", y({
586
+ type: "text",
587
+ id: r.getUUID,
588
+ value: r.formattedValue,
589
+ onInput: l[0] || (l[0] = (...s) => r.onInput && r.onInput(...s)),
590
+ onKeydown: l[1] || (l[1] = (...s) => r.onKeyDown && r.onKeyDown(...s)),
591
+ onBlur: l[2] || (l[2] = (...s) => r.onBlur && r.onBlur(...s)),
592
+ inputmode: "decimal",
593
+ placeholder: e.placeholder,
594
+ onPaste: l[3] || (l[3] = S((...s) => r.onPaste && r.onPaste(...s), ["prevent"])),
595
+ maxlength: e.maxlength ? Number(e.maxlength) : null
596
+ }, { disabled: e.disabled, required: e.required }, { class: "w-full text-gray-800 bg-white pl-8 pr-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, we)
597
+ ])) : (a(), i("input", y({
598
+ key: 1,
599
+ type: "text",
600
+ id: r.getUUID,
601
+ value: r.formattedValue,
602
+ onInput: l[4] || (l[4] = (...s) => r.onInput && r.onInput(...s)),
603
+ onKeydown: l[5] || (l[5] = (...s) => r.onKeyDown && r.onKeyDown(...s)),
604
+ onBlur: l[6] || (l[6] = (...s) => r.onBlur && r.onBlur(...s)),
605
+ inputmode: "decimal",
606
+ placeholder: e.placeholder,
607
+ onPaste: l[7] || (l[7] = S((...s) => r.onPaste && r.onPaste(...s), ["prevent"])),
608
+ maxlength: e.maxlength ? Number(e.maxlength) : null
609
+ }, { disabled: e.disabled, required: e.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, ve))
610
+ ]);
611
+ }
612
+ const _e = /* @__PURE__ */ m(me, [["render", Ce]]), Se = {
613
+ name: "InputStyle",
614
+ props: {
615
+ modelValue: { type: [String, Number], default: "" },
616
+ label: { type: String, default: "" },
617
+ type: { type: String, default: "text" },
618
+ maxlength: { type: String, default: null },
619
+ placeholder: { type: String, default: "" },
620
+ disabled: { type: Boolean, default: !1 },
621
+ required: { type: Boolean, default: !1 }
622
+ },
623
+ computed: {
624
+ getUUID() {
625
+ return crypto.randomUUID();
626
+ },
627
+ model: {
628
+ get() {
629
+ return this.modelValue;
630
+ },
631
+ set(t) {
632
+ this.$emit("update:modelValue", t);
633
+ }
634
+ }
635
+ }
636
+ }, ke = { class: "w-full" }, De = ["for"], Ue = {
637
+ key: 0,
638
+ class: "text-red-800 ml-2"
639
+ }, Ve = {
640
+ key: 0,
641
+ class: "relative"
642
+ }, Te = { 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"];
643
+ function Le(t, l, e, n, d, r) {
644
+ return a(), i("div", ke, [
645
+ o("label", {
646
+ class: "block text-sm font-medium text-gray-700",
647
+ for: r.getUUID
648
+ }, [
649
+ e.required ? (a(), i("span", Ue, "*")) : h("", !0),
650
+ f(" " + u(e.label), 1)
651
+ ], 8, De),
652
+ t.$slots.icon ? (a(), i("div", Ve, [
653
+ o("div", Te, [
654
+ _(t.$slots, "icon")
655
+ ]),
656
+ w(o("input", y({
657
+ id: r.getUUID,
658
+ type: e.type,
659
+ maxlength: e.maxlength ? Number(e.maxlength) : null,
660
+ placeholder: e.placeholder
661
+ }, { disabled: e.disabled, required: e.required }, {
662
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => r.model = s),
663
+ 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"
664
+ }), null, 16, Ie), [
665
+ [k, r.model]
666
+ ])
667
+ ])) : w((a(), i("input", y({
668
+ key: 1,
669
+ id: r.getUUID,
670
+ type: e.type,
671
+ maxlength: e.maxlength ? Number(e.maxlength) : null,
672
+ placeholder: e.placeholder
673
+ }, { disabled: e.disabled, required: e.required }, {
674
+ "onUpdate:modelValue": l[1] || (l[1] = (s) => r.model = s),
675
+ 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"
676
+ }), null, 16, Be)), [
677
+ [k, r.model]
678
+ ])
679
+ ]);
680
+ }
681
+ const qe = /* @__PURE__ */ m(Se, [["render", Le]]), Ne = {
682
+ name: "SelectStyle",
683
+ props: {
684
+ modelValue: [String, Number, Object, null],
685
+ label: { type: String, default: "" },
686
+ disabled: { type: Boolean, default: !1 },
687
+ required: { type: Boolean, default: !1 },
688
+ // lista de items
689
+ list: { type: Array, default: () => [] },
690
+ // texto para la opción inicial
691
+ option: { type: String, default: "- Seleccione…" },
692
+ oEmpty: { type: String, default: "- Sin registros" }
693
+ },
694
+ computed: {
695
+ getUUID() {
696
+ return crypto.randomUUID();
697
+ },
698
+ model: {
699
+ get() {
700
+ return this.modelValue;
701
+ },
702
+ set(t) {
703
+ this.$emit("update:modelValue", t);
704
+ }
705
+ }
706
+ }
707
+ }, Ae = { class: "w-full" }, Me = ["for"], ze = {
708
+ key: 0,
709
+ class: "text-red-800 ml-2"
710
+ }, Ee = ["id"], je = {
711
+ value: "",
712
+ disabled: ""
713
+ }, Fe = ["value"];
714
+ function Pe(t, l, e, n, d, r) {
715
+ return a(), i("div", Ae, [
716
+ o("label", {
717
+ class: "block text-sm font-medium text-gray-700",
718
+ for: r.getUUID
719
+ }, [
720
+ e.required ? (a(), i("span", ze, "*")) : h("", !0),
721
+ f(" " + u(e.label), 1)
722
+ ], 8, Me),
723
+ w(o("select", y({
724
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => r.model = s)
725
+ }, { disabled: e.disabled, required: e.required }, {
726
+ id: r.getUUID,
727
+ 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"
728
+ }), [
729
+ o("option", je, u(e.list.length > 0 ? e.option : e.oEmpty), 1),
730
+ (a(!0), i(x, null, p(e.list, (s, c) => (a(), i("option", {
731
+ key: c,
732
+ value: s.id
733
+ }, u(s.text), 9, Fe))), 128))
734
+ ], 16, Ee), [
735
+ [U, r.model]
736
+ ])
737
+ ]);
738
+ }
739
+ const Ke = /* @__PURE__ */ m(Ne, [["render", Pe]]), We = {
740
+ props: {
741
+ modelValue: { type: Number, default: 0 },
742
+ steps: { type: Array, required: !0 },
743
+ type: { type: String, default: "circle" },
744
+ text: { type: String, default: "all" },
745
+ // all | only | none
746
+ color: { type: String, default: "green" },
747
+ // gray | green | blue | red | yellow
748
+ btnPrevious: { type: String, default: "Anterior" },
749
+ btnNext: { type: String, default: "Siguiente" },
750
+ btnFinish: { type: String, default: "Finalizar" },
751
+ button: { type: Boolean, default: !0 },
752
+ selected: { type: Boolean, default: !1 }
753
+ },
754
+ emits: ["update:modelValue", "submit"],
755
+ computed: {
756
+ step: {
757
+ get() {
758
+ return this.modelValue;
759
+ },
760
+ set(t) {
761
+ this.$emit("update:modelValue", t);
762
+ }
763
+ },
764
+ solid() {
765
+ return {
766
+ gray: "text-white bg-slate-600 hover:bg-slate-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",
767
+ green: "text-white bg-emerald-600 hover:bg-emerald-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",
768
+ blue: "text-white bg-sky-600 hover:bg-sky-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",
769
+ red: "text-white bg-rose-600 hover:bg-rose-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",
770
+ yellow: "text-white bg-amber-600 hover:bg-amber-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none"
771
+ };
772
+ },
773
+ barActive() {
774
+ return this.solid[this.color].split(" ").find((t) => t.startsWith("bg-"));
775
+ },
776
+ lineActive() {
777
+ return this.barActive;
778
+ },
779
+ progressWidth() {
780
+ const t = this.steps.length;
781
+ return this.step === 0 ? 10 : this.step / (t - 1) * 100;
782
+ }
783
+ },
784
+ methods: {
785
+ circleClass(t) {
786
+ return this.step === t ? `${this.barActive} text-white` : this.step > t ? `${this.barActive} text-white opacity-90` : "bg-white text-gray-400 border-gray-300";
787
+ },
788
+ textClass(t) {
789
+ return this.step >= t ? this.barActive.replace("bg-", "text-") : "text-gray-400";
790
+ },
791
+ next() {
792
+ this.step < this.steps.length - 1 && this.step++;
793
+ },
794
+ previous() {
795
+ this.step > 0 && this.step--;
796
+ },
797
+ select(t) {
798
+ this.step = t;
799
+ },
800
+ submitForm() {
801
+ this.$emit("submit");
802
+ }
803
+ }
804
+ }, Oe = { class: "flex items-center gap-6 w-full" }, He = ["disabled"], Re = { class: "flex-1" }, Ge = {
805
+ key: 0,
806
+ class: "flex items-center"
807
+ }, Je = ["onClick"], Qe = {
808
+ key: 0,
809
+ class: "w-4 h-4",
810
+ fill: "none",
811
+ stroke: "currentColor",
812
+ viewBox: "0 0 24 24"
813
+ }, Xe = {
814
+ key: 1,
815
+ class: "text-sm"
816
+ }, Ye = {
817
+ key: 1,
818
+ class: "w-full"
819
+ }, Ze = {
820
+ key: 0,
821
+ class: "text-xs mb-1 block"
822
+ }, $e = { class: "w-full h-3 rounded-full bg-gray-200 overflow-hidden relative" }, et = { key: 1 };
823
+ function tt(t, l, e, n, d, r) {
824
+ return a(), i("div", Oe, [
825
+ e.button ? (a(), i("button", {
826
+ key: 0,
827
+ type: "button",
828
+ disabled: r.step === 0,
829
+ onClick: l[0] || (l[0] = (...s) => r.previous && r.previous(...s)),
830
+ class: g(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", r.solid[e.color]])
831
+ }, [
832
+ l[3] || (l[3] = o("svg", {
833
+ class: "w-5 h-5",
834
+ fill: "none",
835
+ stroke: "currentColor",
836
+ viewBox: "0 0 24 24"
837
+ }, [
838
+ o("path", {
839
+ "stroke-linecap": "round",
840
+ "stroke-linejoin": "round",
841
+ "stroke-width": "2",
842
+ d: "M15 19l-7-7 7-7"
843
+ })
844
+ ], -1)),
845
+ f(" " + u(e.btnPrevious), 1)
846
+ ], 10, He)) : h("", !0),
847
+ o("div", Re, [
848
+ e.type === "circle" ? (a(), i("div", Ge, [
849
+ (a(!0), i(x, null, p(e.steps, (s, c) => (a(), i("div", {
850
+ key: c,
851
+ class: g(["flex items-center", c < e.steps.length - 1 ? "flex-1" : ""])
852
+ }, [
853
+ o("div", {
854
+ class: g(["flex flex-col items-center relative", e.selected ? "cursor-pointer" : "pointer-events-none"]),
855
+ onClick: (v) => r.select(c)
856
+ }, [
857
+ o("div", {
858
+ class: g(["w-9 h-9 rounded-full flex items-center justify-center border-2 font-semibold transition-colors duration-200", r.circleClass(c)])
859
+ }, [
860
+ r.step > c ? (a(), i("svg", Qe, [...l[4] || (l[4] = [
861
+ o("path", {
862
+ "stroke-linecap": "round",
863
+ "stroke-linejoin": "round",
864
+ "stroke-width": "3",
865
+ d: "M5 13l4 4L19 7"
866
+ }, null, -1)
867
+ ])])) : (a(), i("span", Xe, u(c + 1), 1))
868
+ ], 2),
869
+ e.text === "all" || e.text === "only" && r.step === c ? (a(), i("span", {
870
+ key: 0,
871
+ class: g(["absolute -top-5 text-xs font-medium whitespace-nowrap transition-colors duration-200", r.textClass(c)])
872
+ }, u(s), 3)) : h("", !0)
873
+ ], 10, Je),
874
+ c < e.steps.length - 1 ? (a(), i("div", {
875
+ key: 0,
876
+ class: g(["flex-1 h-2 mx-3 rounded transition-colors duration-200", r.step > c ? r.lineActive : "bg-gray-300"])
877
+ }, null, 2)) : h("", !0)
878
+ ], 2))), 128))
879
+ ])) : e.type === "linear" ? (a(), i("div", Ye, [
880
+ e.text === "all" ? (a(), i("span", Ze, u(Math.round(r.progressWidth)) + "% ", 1)) : h("", !0),
881
+ o("div", $e, [
882
+ l[6] || (l[6] = o("div", { class: "absolute inset-0" }, null, -1)),
883
+ o("div", {
884
+ class: g(["h-full rounded-full transition-all duration-300 relative shadow-md", r.barActive]),
885
+ style: V({ width: r.progressWidth + "%" })
886
+ }, [...l[5] || (l[5] = [
887
+ o("div", { class: "absolute inset-0 bg-white/20 mix-blend-overlay animate-pulse" }, null, -1)
888
+ ])], 6)
889
+ ])
890
+ ])) : h("", !0)
891
+ ]),
892
+ e.button ? (a(), i("div", et, [
893
+ r.step < e.steps.length - 1 ? (a(), i("button", {
894
+ key: 0,
895
+ type: "button",
896
+ onClick: l[1] || (l[1] = (...s) => r.next && r.next(...s)),
897
+ class: g(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", r.solid[e.color]])
898
+ }, [
899
+ f(u(e.btnNext) + " ", 1),
900
+ l[7] || (l[7] = o("svg", {
901
+ class: "w-5 h-5",
902
+ fill: "none",
903
+ stroke: "currentColor",
904
+ viewBox: "0 0 24 24"
905
+ }, [
906
+ o("path", {
907
+ "stroke-linecap": "round",
908
+ "stroke-linejoin": "round",
909
+ "stroke-width": "2",
910
+ d: "M9 5l7 7-7 7"
911
+ })
912
+ ], -1))
913
+ ], 2)) : (a(), i("button", {
914
+ key: 1,
915
+ type: "button",
916
+ onClick: l[2] || (l[2] = (...s) => r.submitForm && r.submitForm(...s)),
917
+ class: g(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", r.solid[e.color]])
918
+ }, [
919
+ f(u(e.btnFinish) + " ", 1),
920
+ l[8] || (l[8] = o("svg", {
921
+ class: "w-5 h-5",
922
+ fill: "none",
923
+ stroke: "currentColor",
924
+ viewBox: "0 0 24 24"
925
+ }, [
926
+ o("path", {
927
+ "stroke-linecap": "round",
928
+ "stroke-linejoin": "round",
929
+ "stroke-width": "2",
930
+ d: "M5 13l4 4L19 7"
931
+ })
932
+ ], -1))
933
+ ], 2))
934
+ ])) : h("", !0)
935
+ ]);
936
+ }
937
+ const lt = /* @__PURE__ */ m(We, [["render", tt]]), rt = {
938
+ name: "TableStyle",
939
+ props: {
940
+ columns: { type: Array, required: !0 },
941
+ rows: { type: Array, default: () => [] }
942
+ }
943
+ }, st = { class: "w-full overflow-x-auto bg-white border border-gray-300 rounded shadow-sm" }, it = { class: "min-w-full" }, at = { class: "bg-gray-800" }, ot = { key: 1 }, dt = { key: 0 }, nt = ["colspan"];
944
+ function ut(t, l, e, n, d, r) {
945
+ return a(), i("div", st, [
946
+ o("table", it, [
947
+ o("thead", null, [
948
+ o("tr", at, [
949
+ (a(!0), i(x, null, p(e.columns, (s, c) => (a(), i("th", {
950
+ key: c,
951
+ class: "px-4 py-1.5 text-left text-sm font-semibold text-white border-b border-gray-600"
952
+ }, u(s.label), 1))), 128))
953
+ ])
954
+ ]),
955
+ o("tbody", null, [
956
+ (a(!0), i(x, null, p(e.rows, (s, c) => (a(), i("tr", {
957
+ key: c,
958
+ class: "hover:bg-gray-100 transition-colors cursor-default"
959
+ }, [
960
+ (a(!0), i(x, null, p(e.columns, (v, D) => (a(), i("td", {
961
+ key: D,
962
+ class: "px-4 py-1.5 text-sm text-gray-700 border-b border-gray-200"
963
+ }, [
964
+ t.$slots[v.field] ? _(t.$slots, v.field, {
965
+ key: 0,
966
+ row: s
967
+ }) : (a(), i("span", ot, u(s[v.field]), 1))
968
+ ]))), 128))
969
+ ]))), 128)),
970
+ e.rows.length === 0 ? (a(), i("tr", dt, [
971
+ o("td", {
972
+ colspan: e.columns.length,
973
+ class: "px-4 py-10 text-center text-gray-500 text-sm bg-gray-50"
974
+ }, [...l[0] || (l[0] = [
975
+ o("div", { class: "flex flex-col items-center gap-3" }, [
976
+ o("span", { class: "text-gray-600 font-medium" }, "No hay datos para mostrar")
977
+ ], -1)
978
+ ])], 8, nt)
979
+ ])) : h("", !0)
980
+ ])
981
+ ])
982
+ ]);
983
+ }
984
+ const ct = /* @__PURE__ */ m(rt, [["render", ut]]), ht = {
985
+ name: "TextAreaStyle",
986
+ props: {
987
+ modelValue: String,
988
+ label: { type: String, default: "" },
989
+ note: { type: String, default: "" },
990
+ placeholder: { type: String, default: "" },
991
+ disabled: { type: Boolean, default: !1 },
992
+ required: { type: Boolean, default: !1 },
993
+ row: { type: String, default: "3" },
994
+ maxlength: { type: String, default: null }
995
+ },
996
+ computed: {
997
+ getUUID() {
998
+ return crypto.randomUUID();
999
+ },
1000
+ model: {
1001
+ get() {
1002
+ return this.modelValue;
1003
+ },
1004
+ set(t) {
1005
+ this.$emit("update:modelValue", t);
1006
+ }
1007
+ }
1008
+ }
1009
+ }, gt = { class: "w-full" }, mt = { class: "flex justify-between" }, bt = ["for"], yt = {
1010
+ key: 0,
1011
+ class: "text-red-800 ml-2"
1012
+ }, ft = ["for"], xt = ["id", "placeholder", "maxlength", "rows"];
1013
+ function pt(t, l, e, n, d, r) {
1014
+ return a(), i("div", gt, [
1015
+ o("div", mt, [
1016
+ o("label", {
1017
+ class: "block text-sm font-medium text-gray-700",
1018
+ for: r.getUUID
1019
+ }, [
1020
+ e.required ? (a(), i("span", yt, "*")) : h("", !0),
1021
+ f(" " + u(e.label), 1)
1022
+ ], 8, bt),
1023
+ e.note ? (a(), i("label", {
1024
+ key: 0,
1025
+ class: "block text-xs text-gray-700",
1026
+ for: r.getUUID
1027
+ }, u(e.note), 9, ft)) : h("", !0)
1028
+ ]),
1029
+ w(o("textarea", y({
1030
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => r.model = s),
1031
+ id: r.getUUID,
1032
+ placeholder: e.placeholder
1033
+ }, { disabled: e.disabled, required: e.required }, {
1034
+ maxlength: e.maxlength ? Number(e.maxlength) : null,
1035
+ rows: Number(e.row),
1036
+ 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"
1037
+ }), null, 16, xt), [
1038
+ [C, r.model]
1039
+ ])
1040
+ ]);
1041
+ }
1042
+ const wt = /* @__PURE__ */ m(ht, [["render", pt]]), vt = {
1043
+ name: "ToggleStyle",
1044
+ props: {
1045
+ modelValue: { type: Boolean, default: !1 },
1046
+ label: { type: String, default: "" },
1047
+ color: { type: String, default: "gray" },
1048
+ // gray | green | blue | red | yellow
1049
+ shape: { type: String, default: "round" },
1050
+ // round | square
1051
+ disabled: { type: Boolean, default: !1 }
1052
+ },
1053
+ computed: {
1054
+ model: {
1055
+ get() {
1056
+ return this.modelValue;
1057
+ },
1058
+ set(t) {
1059
+ this.$emit("update:modelValue", t);
1060
+ }
1061
+ },
1062
+ shapeToggle() {
1063
+ return {
1064
+ round: "rounded-full",
1065
+ square: "rounded-md"
1066
+ }[this.shape];
1067
+ },
1068
+ computedClasses() {
1069
+ const t = {
1070
+ gray: "bg-slate-600 hover:bg-slate-700 border border-gray-800 cursor-pointer",
1071
+ green: "bg-emerald-600 hover:bg-emerald-700 border border-green-700 cursor-pointer",
1072
+ blue: "bg-sky-600 hover:bg-sky-700 border border-blue-700 cursor-pointer",
1073
+ red: "bg-rose-600 hover:bg-rose-700 border border-red-700 cursor-pointer",
1074
+ yellow: "bg-amber-600 hover:bg-amber-700 border border-yellow-600 cursor-pointer"
1075
+ };
1076
+ return this.model ? t[this.color] : "bg-gray-200 border border-gray-300";
1077
+ },
1078
+ disabledColorClasses() {
1079
+ const t = {
1080
+ gray: "bg-slate-600 border border-slate-300 cursor-not-allowed opacity-60",
1081
+ green: "bg-emerald-600 border border-emerald-300 cursor-not-allowed opacity-60",
1082
+ blue: "bg-sky-600 border border-sky-300 cursor-not-allowed opacity-60",
1083
+ red: "bg-rose-600 border border-rose-300 cursor-not-allowed opacity-60",
1084
+ yellow: "bg-amber-600 border border-amber-300 cursor-not-allowed opacity-60"
1085
+ };
1086
+ return this.modelValue ? t[this.color] : "bg-gray-200 border border-gray-300 cursor-not-allowed";
1087
+ },
1088
+ disabledClasses() {
1089
+ return this.disabledColorClasses;
1090
+ }
1091
+ },
1092
+ methods: {
1093
+ toggle() {
1094
+ this.disabled || (this.model = !this.model);
1095
+ }
1096
+ }
1097
+ }, Ct = { class: "block text-sm font-medium text-gray-700" };
1098
+ function _t(t, l, e, n, d, r) {
1099
+ return a(), i("div", null, [
1100
+ o("label", Ct, u(e.label), 1),
1101
+ o("div", {
1102
+ class: g([
1103
+ "relative w-11 h-6 inline-flex items-center transition-colors duration-300 px-1",
1104
+ r.shapeToggle,
1105
+ e.disabled ? r.disabledClasses : r.computedClasses
1106
+ ]),
1107
+ onClick: l[0] || (l[0] = (...s) => r.toggle && r.toggle(...s))
1108
+ }, [
1109
+ o("div", {
1110
+ class: g([
1111
+ "absolute top-0.75 left-1 w-4 h-4 bg-white shadow transform transition-all duration-300",
1112
+ r.shapeToggle,
1113
+ r.model ? "translate-x-full" : "translate-x-0"
1114
+ ])
1115
+ }, null, 2)
1116
+ ], 2)
1117
+ ]);
1118
+ }
1119
+ const St = /* @__PURE__ */ m(vt, [["render", _t]]), Dt = {
1120
+ install(t) {
1121
+ t.component("AlertStyle", b), t.component("ButtonStyle", L), t.component("CheckStyle", W), t.component("ComboBoxStyle", oe), t.component("DateTimeStyle", ge), t.component("InputDecimalStyle", _e), t.component("InputStyle", qe), t.component("SelectStyle", Ke), t.component("StepperStyle", lt), t.component("TableStyle", ct), t.component("TextAreaStyle", wt), t.component("ToggleStyle", St), t.config.globalProperties.$alertstyle = b;
1122
+ }
1123
+ };
1124
+ export {
1125
+ b as AlertStyle,
1126
+ L as ButtonStyle,
1127
+ W as CheckStyle,
1128
+ oe as ComboBoxStyle,
1129
+ ge as DateTimeStyle,
1130
+ _e as InputDecimalStyle,
1131
+ qe as InputStyle,
1132
+ Ke as SelectStyle,
1133
+ lt as StepperStyle,
1134
+ ct as TableStyle,
1135
+ wt as TextAreaStyle,
1136
+ St as ToggleStyle,
1137
+ Dt as default
1138
+ };