@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.
@@ -1,4 +1,4 @@
1
- import { createElementBlock as i, openBlock as a, normalizeClass as m, renderSlot as C, createElementVNode as o, createCommentVNode as h, toDisplayString as u, Fragment as p, renderList as w, withDirectives as f, createTextVNode as y, withModifiers as k, vModelText as v, mergeProps as x, vModelDynamic as _, vModelSelect as V, normalizeStyle as U } from "vue";
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(l, t, n = b.type.info, d = 4e3) {
18
+ static #e(t, l, n = b.type.info, a = 4e3) {
19
19
  b.ensureContainer();
20
- const s = b.container.querySelector(`.alert-${n}`);
21
- s && s.remove();
22
- const r = document.createElement("div");
23
- r.className = `alert alert-${n}`;
24
- const c = b.iconMap[n] || "";
25
- r.innerHTML = `
26
- <div class="alert-icon">${c}</div>
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">${l}</div>
29
- <div class="alert-message">${t}</div>
28
+ <div class="alert-title">${t}</div>
29
+ <div class="alert-message">${l}</div>
30
30
  </div>
31
31
  <div class="alert-close">&times;</div>
32
- `, r.querySelector(".alert-close").addEventListener("click", () => {
33
- b.remove(r);
34
- }), b.container.appendChild(r), setTimeout(() => r.classList.add("show"), 10), d > 0 && setTimeout(() => b.remove(r), d);
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(l, t = "") {
38
- this.#e(l, t, this.type.success);
37
+ static success(t, l = "") {
38
+ this.#e(t, l, this.type.success);
39
39
  }
40
- static error(l, t = "") {
41
- this.#e(l, t, this.type.error);
40
+ static error(t, l = "") {
41
+ this.#e(t, l, this.type.error);
42
42
  }
43
- static warning(l, t = "") {
44
- this.#e(l, t, this.type.warning);
43
+ static warning(t, l = "") {
44
+ this.#e(t, l, this.type.warning);
45
45
  }
46
- static info(l, t = "") {
47
- this.#e(l, t, this.type.info);
46
+ static info(t, l = "") {
47
+ this.#e(t, l, this.type.info);
48
48
  }
49
- static neutral(l, t = "") {
50
- this.#e(l, t, this.type.neutral);
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(l) {
56
- l.classList.add("hide"), setTimeout(() => l.remove(), 250);
55
+ static remove(t) {
56
+ t.classList.add("hide"), setTimeout(() => t.remove(), 250);
57
57
  }
58
58
  }
59
- const g = (e, l) => {
60
- const t = e.__vccOpts || e;
61
- for (const [n, d] of l)
62
- t[n] = d;
63
- return t;
64
- }, T = {
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
- ], l = {
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(l[this.variant][this.color]), e;
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
- }, I = ["type", "disabled"];
116
- function B(e, l, t, n, d, s) {
117
- return a(), i("button", {
118
- type: t.type,
119
- onClick: l[0] || (l[0] = (...r) => s.handleClick && s.handleClick(...r)),
120
- disabled: s.isDisabled,
121
- class: m(s.buttonClasses)
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, I);
124
+ ], 10, B);
125
125
  }
126
- const q = /* @__PURE__ */ g(T, [["render", B]]), L = {
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 l = this.getValue(e);
165
- return this.realSelection.includes(l);
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 l = this.getValue(e);
179
- this.realSelection.includes(l) ? this.realSelection = this.realSelection.filter(
180
- (t) => t !== l
181
- ) : this.all ? this.realSelection.push(l) : this.realSelection = [l], this.emitExternal();
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" }, A = { class: "flex items-center justify-between" }, M = { class: "block text-sm font-medium text-gray-700" }, z = {
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
- }, j = ["id", "checked"], E = ["for"], F = ["id", "checked", "onChange"], P = ["for"];
191
- function K(e, l, t, n, d, s) {
192
- return a(), i("div", N, [
193
- o("div", A, [
194
- o("h3", M, u(t.label), 1),
195
- t.all ? (a(), i("div", z, [
196
- o("input", {
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-" + s.getUUID,
199
- checked: s.isAllSelected,
200
- onChange: l[0] || (l[0] = (...r) => s.toggleSelectAll && s.toggleSelectAll(...r)),
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, j),
203
- o("label", {
204
- for: "todos-" + s.getUUID,
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, E)
207
- ])) : h("", !0)
206
+ }, " Seleccionar todos ", 8, P)
207
+ ])) : c("", !0)
208
208
  ]),
209
- o("div", {
210
- class: m(["max-h-48 overflow-auto space-y-1", t.grid])
209
+ d("div", {
210
+ class: m(["max-h-48 overflow-auto space-y-1", l.grid])
211
211
  }, [
212
- (a(!0), i(p, null, w(t.list, (r) => (a(), i("div", {
213
- key: r.id,
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
- o("input", {
216
+ d("input", {
217
217
  type: "checkbox",
218
- id: s.getUUID + "-" + r.id,
219
- checked: s.isChecked(r),
220
- onChange: (c) => s.onChange(r),
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, F),
223
- o("label", {
224
- for: s.getUUID + "-" + r.id,
222
+ }, null, 40, E),
223
+ d("label", {
224
+ for: r.getUUID + "-" + s.id,
225
225
  class: "truncate text-gray-700"
226
- }, u(r.name), 9, P)
226
+ }, g(s.name), 9, j)
227
227
  ]))), 128))
228
228
  ], 2)
229
229
  ]);
230
230
  }
231
- const W = /* @__PURE__ */ g(L, [["render", K]]), O = {
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 l = this.list.find((t) => t.id === e);
274
- l && (this.search = l.name, this.searchCopy = l.name);
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, l, t, n, d, s) {
305
- return a(), i("div", H, [
306
- o("label", {
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: d.uuid
308
+ for: a.uuid
309
309
  }, [
310
- o("div", G, [
311
- y(u(t.label) + " ", 1),
312
- t.required ? (a(), i("span", J, "*")) : h("", !0)
310
+ d("div", G, [
311
+ f(g(l.label) + " ", 1),
312
+ l.required ? (o(), i("span", J, "*")) : c("", !0)
313
313
  ]),
314
- s.model ? (a(), i("span", {
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: l[0] || (l[0] = k(() => {
317
+ onMousedown: t[0] || (t[0] = k(() => {
318
318
  }, ["prevent"])),
319
- onClick: l[1] || (l[1] = (...r) => s.clearItem && s.clearItem(...r))
320
- }, "Limpiar ", 32)) : h("", !0)
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 ? (a(), i("div", Q, [
323
- o("div", X, [
322
+ e.$slots.icon ? (o(), i("div", Q, [
323
+ d("div", X, [
324
324
  C(e.$slots, "icon")
325
325
  ]),
326
- f(o("input", {
327
- id: d.uuid,
326
+ y(d("input", {
327
+ id: a.uuid,
328
328
  type: "text",
329
- "onUpdate:modelValue": l[2] || (l[2] = (r) => d.search = r),
330
- placeholder: t.placeholder,
331
- disabled: t.disabled,
332
- required: t.required,
333
- onBlur: l[3] || (l[3] = (...r) => s.closeWithDelay && s.closeWithDelay(...r)),
334
- onFocus: l[4] || (l[4] = (r) => d.open = !t.disabled),
335
- onInput: l[5] || (l[5] = (r) => d.open = !t.disabled),
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, d.search]
338
+ [v, a.search]
339
339
  ])
340
- ])) : f((a(), i("input", {
340
+ ])) : y((o(), i("input", {
341
341
  key: 1,
342
- id: d.uuid,
342
+ id: a.uuid,
343
343
  type: "text",
344
- "onUpdate:modelValue": l[6] || (l[6] = (r) => d.search = r),
345
- placeholder: t.placeholder,
346
- disabled: t.disabled,
347
- required: t.required,
348
- onBlur: l[7] || (l[7] = (...r) => s.closeWithDelay && s.closeWithDelay(...r)),
349
- onFocus: l[8] || (l[8] = (r) => d.open = !t.disabled),
350
- onInput: l[9] || (l[9] = (r) => d.open = !t.disabled),
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, d.search]
353
+ [v, a.search]
354
354
  ]),
355
- d.open && !t.disabled ? (a(), i("div", $, [
356
- s.filteredList.length === 0 ? (a(), i("div", ee, u(t.oEmpty), 1)) : h("", !0),
357
- (a(!0), i(p, null, w(s.filteredList, (r) => (a(), i("div", {
358
- key: r.id,
359
- onMousedown: k((c) => s.selectItem(r), ["prevent"]),
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
- }, u(r.name), 41, te))), 128))
362
- ])) : h("", !0)
361
+ }, g(s.name), 41, te))), 128))
362
+ ])) : c("", !0)
363
363
  ]);
364
364
  }
365
- const se = /* @__PURE__ */ g(O, [["render", le]]), re = {
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
- /** "date", "time", "datetime", "datetime2" */
372
- mode: { type: String, default: "datetime" },
373
- label: { type: String, default: "Seleccionar fecha" },
374
- /** segundos: "default"=01, "max"=59 */
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
- if (this.mode === "date")
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" ? !this.localDate || !this.localTime ? e = "" : e = `${this.localDate}T${this.localTime}:${this.segundos}.000` : this.mode === "datetime2" && (this.localDate ? e = `${this.localDate}T${this.secondsMode === "max" ? "23:59:59.000" : "00:01:00.000"}` : e = ""), this.model = e;
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" }, ae = { class: "block text-sm font-medium text-gray-700" }, oe = {
422
+ }, ie = { class: "w-full" }, oe = ["for"], de = {
460
423
  key: 0,
461
424
  class: "text-red-800 ml-2"
462
- };
463
- function de(e, l, t, n, d, s) {
464
- return a(), i("div", ie, [
465
- o("label", ae, [
466
- t.required ? (a(), i("span", oe, "*")) : h("", !0),
467
- y(" " + u(t.label), 1)
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
- s.showDate ? f((a(), i("input", x({
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: t.disabled, required: t.required }, {
476
- "onUpdate:modelValue": l[0] || (l[0] = (r) => d.localDate = r),
477
- onInput: l[1] || (l[1] = (...r) => s.emitValue && s.emitValue(...r)),
478
- class: s.dateInputClass
479
- }), null, 16)), [
480
- [v, d.localDate]
481
- ]) : h("", !0),
482
- s.showTime ? f((a(), i("input", x({
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: t.disabled, required: t.required }, {
486
- "onUpdate:modelValue": l[2] || (l[2] = (r) => d.localTime = r),
487
- onInput: l[3] || (l[3] = (...r) => s.emitValue && s.emitValue(...r)),
488
- class: s.timeInputClass
489
- }), null, 16)), [
490
- [v, d.localTime]
491
- ]) : h("", !0)
492
- ], 2)
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 ne = /* @__PURE__ */ g(re, [["render", de]]), ue = {
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
- maxlength: { type: String, default: "14" },
503
- disabled: { type: Boolean, default: !1 },
504
- required: { type: Boolean, default: !1 }
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
- formattedValue() {
492
+ displayValue() {
493
+ if (this.isFocused)
494
+ return this.modelValue?.toString() ?? "";
511
495
  if (this.modelValue === "" || this.modelValue === null) return "";
512
- const e = parseFloat(this.modelValue);
496
+ const e = Number(this.modelValue);
513
497
  return isNaN(e) ? "" : e.toLocaleString("en-US", {
514
- minimumFractionDigits: 0,
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 l = [
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 (!((e.ctrlKey || e.metaKey) && ["a", "c", "v", "x", "z"].includes(e.key.toLowerCase())) && !l.includes(e.key)) {
535
- if (e.key >= "0" && e.key <= "9") {
536
- const t = e.target.value.replace(/,/g, ""), n = e.target.selectionStart, d = t.split(".");
537
- if (d.length === 2) {
538
- const s = d[1];
539
- n > t.indexOf(".") && s.length >= Number(this.decimals) && e.preventDefault();
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 l = e.target.value.replace(/[^0-9.]/g, "");
548
- Number(this.decimals) === 0 && (l = l.replace(/\./g, ""));
549
- const t = l.split(".");
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 = (e.clipboardData || window.clipboardData).getData("text").replace(/[^0-9.]/g, "");
554
- Number(this.decimals) === 0 && (t = t.replace(/\./g, ""));
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
- let e = this.modelValue ? parseFloat(this.modelValue) : "";
560
- !isNaN(e) && e !== "" && (e = e.toFixed(Number(this.decimals))), this.$emit("update:modelValue", e);
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
- }, ce = { class: "w-full" }, he = ["for"], me = {
554
+ }, he = { class: "w-full" }, be = ["for"], ye = {
564
555
  key: 0,
565
556
  class: "text-red-800 ml-2"
566
- }, ge = {
557
+ }, fe = {
567
558
  key: 0,
568
559
  class: "relative"
569
- }, be = { class: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5" }, ye = ["id", "value", "placeholder", "maxlength"], fe = ["id", "value", "placeholder", "maxlength"];
570
- function xe(e, l, t, n, d, s) {
571
- return a(), i("div", ce, [
572
- o("label", {
573
- class: "block text-sm font-medium text-gray-700",
574
- for: s.getUUID
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
- t.required ? (a(), i("span", me, "*")) : h("", !0),
577
- y(" " + u(t.label), 1)
578
- ], 8, he),
579
- e.$slots.icon ? (a(), i("div", ge, [
580
- o("div", be, [
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
- o("input", x({
574
+ d("input", {
584
575
  type: "text",
585
- id: s.getUUID,
586
- value: s.formattedValue,
587
- onInput: l[0] || (l[0] = (...r) => s.onInput && s.onInput(...r)),
588
- onKeydown: l[1] || (l[1] = (...r) => s.onKeyDown && s.onKeyDown(...r)),
589
- onBlur: l[2] || (l[2] = (...r) => s.onBlur && s.onBlur(...r)),
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: t.placeholder,
592
- onPaste: l[3] || (l[3] = k((...r) => s.onPaste && s.onPaste(...r), ["prevent"])),
593
- maxlength: t.maxlength ? Number(t.maxlength) : null
594
- }, { disabled: t.disabled, required: t.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, ye)
595
- ])) : (a(), i("input", x({
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: s.getUUID,
599
- value: s.formattedValue,
600
- onInput: l[4] || (l[4] = (...r) => s.onInput && s.onInput(...r)),
601
- onKeydown: l[5] || (l[5] = (...r) => s.onKeyDown && s.onKeyDown(...r)),
602
- onBlur: l[6] || (l[6] = (...r) => s.onBlur && s.onBlur(...r)),
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: t.placeholder,
605
- onPaste: l[7] || (l[7] = k((...r) => s.onPaste && s.onPaste(...r), ["prevent"])),
606
- maxlength: t.maxlength ? Number(t.maxlength) : null
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 pe = /* @__PURE__ */ g(ue, [["render", xe]]), we = {
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
- }, ve = { class: "w-full" }, Ce = ["for"], Se = {
629
+ }, ke = { class: "w-full" }, _e = ["for"], De = {
635
630
  key: 0,
636
631
  class: "text-red-800 ml-2"
637
- }, ke = {
632
+ }, Ue = {
638
633
  key: 0,
639
634
  class: "relative"
640
- }, _e = { class: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5" }, De = ["id", "type", "maxlength", "placeholder"], Ve = ["id", "type", "maxlength", "placeholder"];
641
- function Ue(e, l, t, n, d, s) {
642
- return a(), i("div", ve, [
643
- o("label", {
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: s.getUUID
640
+ for: r.getUUID
646
641
  }, [
647
- t.required ? (a(), i("span", Se, "*")) : h("", !0),
648
- y(" " + u(t.label), 1)
649
- ], 8, Ce),
650
- e.$slots.icon ? (a(), i("div", ke, [
651
- o("div", _e, [
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
- f(o("input", x({
655
- id: s.getUUID,
656
- type: t.type,
657
- maxlength: t.maxlength ? Number(t.maxlength) : null,
658
- placeholder: t.placeholder
659
- }, { disabled: t.disabled, required: t.required }, {
660
- "onUpdate:modelValue": l[0] || (l[0] = (r) => s.model = r),
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, De), [
663
- [_, s.model]
657
+ }), null, 16, Ie), [
658
+ [_, r.model]
664
659
  ])
665
- ])) : f((a(), i("input", x({
660
+ ])) : y((o(), i("input", w({
666
661
  key: 1,
667
- id: s.getUUID,
668
- type: t.type,
669
- maxlength: t.maxlength ? Number(t.maxlength) : null,
670
- placeholder: t.placeholder
671
- }, { disabled: t.disabled, required: t.required }, {
672
- "onUpdate:modelValue": l[1] || (l[1] = (r) => s.model = r),
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, Ve)), [
675
- [_, s.model]
669
+ }), null, 16, Be)), [
670
+ [_, r.model]
676
671
  ])
677
672
  ]);
678
673
  }
679
- const Te = /* @__PURE__ */ g(we, [["render", Ue]]), Ie = {
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
- }, Be = { class: "w-full" }, qe = ["for"], Le = {
700
+ }, Ne = { class: "w-full" }, Me = ["for"], Ae = {
706
701
  key: 0,
707
702
  class: "text-red-800 ml-2"
708
- }, Ne = ["id"], Ae = {
703
+ }, ze = ["id"], Fe = {
709
704
  value: "",
710
705
  disabled: ""
711
- }, Me = ["value"];
712
- function ze(e, l, t, n, d, s) {
713
- return a(), i("div", Be, [
714
- o("label", {
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: s.getUUID
711
+ for: r.getUUID
717
712
  }, [
718
- t.required ? (a(), i("span", Le, "*")) : h("", !0),
719
- y(" " + u(t.label), 1)
720
- ], 8, qe),
721
- f(o("select", x({
722
- "onUpdate:modelValue": l[0] || (l[0] = (r) => s.model = r)
723
- }, { disabled: t.disabled, required: t.required }, {
724
- id: s.getUUID,
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
- o("option", Ae, u(t.list.length > 0 ? t.option : t.oEmpty), 1),
728
- (a(!0), i(p, null, w(t.list, (r, c) => (a(), i("option", {
729
- key: c,
730
- value: r.id
731
- }, u(r.text), 9, Me))), 128))
732
- ], 16, Ne), [
733
- [V, s.model]
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__ */ g(Ie, [["render", ze]]), Ee = {
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
- }, Fe = { class: "flex items-center gap-6 w-full" }, Pe = ["disabled"], Ke = { class: "flex-1" }, We = {
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
- }, Oe = ["onClick"], He = {
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
- }, Re = {
806
+ }, Qe = {
812
807
  key: 1,
813
808
  class: "text-sm"
814
- }, Ge = {
809
+ }, Xe = {
815
810
  key: 1,
816
811
  class: "w-full"
817
- }, Je = {
812
+ }, Ye = {
818
813
  key: 0,
819
814
  class: "text-xs mb-1 block"
820
- }, Qe = { class: "w-full h-3 rounded-full bg-gray-200 overflow-hidden relative" }, Xe = { key: 1 };
821
- function Ye(e, l, t, n, d, s) {
822
- return a(), i("div", Fe, [
823
- t.button ? (a(), i("button", {
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: s.step === 0,
827
- onClick: l[0] || (l[0] = (...r) => s.previous && s.previous(...r)),
828
- class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", s.solid[t.color]])
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
- l[3] || (l[3] = o("svg", {
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
- o("path", {
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
- y(" " + u(t.btnPrevious), 1)
844
- ], 10, Pe)) : h("", !0),
845
- o("div", Ke, [
846
- t.type === "circle" ? (a(), i("div", We, [
847
- (a(!0), i(p, null, w(t.steps, (r, c) => (a(), i("div", {
848
- key: c,
849
- class: m(["flex items-center", c < t.steps.length - 1 ? "flex-1" : ""])
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
- o("div", {
852
- class: m(["flex flex-col items-center relative", t.selected ? "cursor-pointer" : "pointer-events-none"]),
853
- onClick: (S) => s.select(c)
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
- o("div", {
856
- class: m(["w-9 h-9 rounded-full flex items-center justify-center border-2 font-semibold transition-colors duration-200", s.circleClass(c)])
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
- s.step > c ? (a(), i("svg", He, [...l[4] || (l[4] = [
859
- o("path", {
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
- ])])) : (a(), i("span", Re, u(c + 1), 1))
860
+ ])])) : (o(), i("span", Qe, g(u + 1), 1))
866
861
  ], 2),
867
- t.text === "all" || t.text === "only" && s.step === c ? (a(), i("span", {
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", s.textClass(c)])
870
- }, u(r), 3)) : h("", !0)
871
- ], 10, Oe),
872
- c < t.steps.length - 1 ? (a(), i("div", {
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", s.step > c ? s.lineActive : "bg-gray-300"])
875
- }, null, 2)) : h("", !0)
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
- ])) : t.type === "linear" ? (a(), i("div", Ge, [
878
- t.text === "all" ? (a(), i("span", Je, u(Math.round(s.progressWidth)) + "% ", 1)) : h("", !0),
879
- o("div", Qe, [
880
- l[6] || (l[6] = o("div", { class: "absolute inset-0" }, null, -1)),
881
- o("div", {
882
- class: m(["h-full rounded-full transition-all duration-300 relative shadow-md", s.barActive]),
883
- style: U({ width: s.progressWidth + "%" })
884
- }, [...l[5] || (l[5] = [
885
- o("div", { class: "absolute inset-0 bg-white/20 mix-blend-overlay animate-pulse" }, null, -1)
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
- ])) : h("", !0)
883
+ ])) : c("", !0)
889
884
  ]),
890
- t.button ? (a(), i("div", Xe, [
891
- s.step < t.steps.length - 1 ? (a(), i("button", {
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: l[1] || (l[1] = (...r) => s.next && s.next(...r)),
895
- class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", s.solid[t.color]])
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
- y(u(t.btnNext) + " ", 1),
898
- l[7] || (l[7] = o("svg", {
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
- o("path", {
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)) : (a(), i("button", {
906
+ ], 2)) : (o(), i("button", {
912
907
  key: 1,
913
908
  type: "button",
914
- onClick: l[2] || (l[2] = (...r) => s.submitForm && s.submitForm(...r)),
915
- class: m(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold", s.solid[t.color]])
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
- y(u(t.btnFinish) + " ", 1),
918
- l[8] || (l[8] = o("svg", {
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
- o("path", {
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
- ])) : h("", !0)
927
+ ])) : c("", !0)
933
928
  ]);
934
929
  }
935
- const Ze = /* @__PURE__ */ g(Ee, [["render", Ye]]), $e = {
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
- }, et = { class: "w-full overflow-x-auto bg-white border border-gray-300 rounded shadow-sm" }, tt = { class: "min-w-full" }, lt = { class: "bg-gray-800" }, st = { key: 1 }, rt = { key: 0 }, it = ["colspan"];
942
- function at(e, l, t, n, d, s) {
943
- return a(), i("div", et, [
944
- o("table", tt, [
945
- o("thead", null, [
946
- o("tr", lt, [
947
- (a(!0), i(p, null, w(t.columns, (r, c) => (a(), i("th", {
948
- key: c,
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
- }, u(r.label), 1))), 128))
945
+ }, g(s.label), 1))), 128))
951
946
  ])
952
947
  ]),
953
- o("tbody", null, [
954
- (a(!0), i(p, null, w(t.rows, (r, c) => (a(), i("tr", {
955
- key: c,
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
- (a(!0), i(p, null, w(t.columns, (S, D) => (a(), i("td", {
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: r
965
- }) : (a(), i("span", st, u(r[S.field]), 1))
959
+ row: s
960
+ }) : (o(), i("span", ot, g(s[S.field]), 1))
966
961
  ]))), 128))
967
962
  ]))), 128)),
968
- t.rows.length === 0 ? (a(), i("tr", rt, [
969
- o("td", {
970
- colspan: t.columns.length,
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
- }, [...l[0] || (l[0] = [
973
- o("div", { class: "flex flex-col items-center gap-3" }, [
974
- o("span", { class: "text-gray-600 font-medium" }, "No hay datos para mostrar")
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, it)
977
- ])) : h("", !0)
971
+ ])], 8, at)
972
+ ])) : c("", !0)
978
973
  ])
979
974
  ])
980
975
  ]);
981
976
  }
982
- const ot = /* @__PURE__ */ g($e, [["render", at]]), dt = {
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
- }, nt = { class: "w-full" }, ut = { class: "flex justify-between" }, ct = ["for"], ht = {
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
- }, mt = ["for"], gt = ["id", "placeholder", "maxlength", "rows"];
1011
- function bt(e, l, t, n, d, s) {
1012
- return a(), i("div", nt, [
1013
- o("div", ut, [
1014
- o("label", {
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: s.getUUID
1011
+ for: r.getUUID
1017
1012
  }, [
1018
- t.required ? (a(), i("span", ht, "*")) : h("", !0),
1019
- y(" " + u(t.label), 1)
1020
- ], 8, ct),
1021
- t.note ? (a(), i("label", {
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: s.getUUID
1025
- }, u(t.note), 9, mt)) : h("", !0)
1019
+ for: r.getUUID
1020
+ }, g(l.note), 9, yt)) : c("", !0)
1026
1021
  ]),
1027
- f(o("textarea", x({
1028
- "onUpdate:modelValue": l[0] || (l[0] = (r) => s.model = r),
1029
- id: s.getUUID,
1030
- placeholder: t.placeholder
1031
- }, { disabled: t.disabled, required: t.required }, {
1032
- maxlength: t.maxlength ? Number(t.maxlength) : null,
1033
- rows: Number(t.row),
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, gt), [
1036
- [v, s.model]
1030
+ }), null, 16, ft), [
1031
+ [v, r.model]
1037
1032
  ])
1038
1033
  ]);
1039
1034
  }
1040
- const yt = /* @__PURE__ */ g(dt, [["render", bt]]), ft = {
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
- }, xt = { class: "block text-sm font-medium text-gray-700" };
1096
- function pt(e, l, t, n, d, s) {
1097
- return a(), i("div", null, [
1098
- o("label", xt, u(t.label), 1),
1099
- o("div", {
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
- s.shapeToggle,
1103
- t.disabled ? s.disabledClasses : s.computedClasses
1097
+ r.shapeToggle,
1098
+ l.disabled ? r.disabledClasses : r.computedClasses
1104
1099
  ]),
1105
- onClick: l[0] || (l[0] = (...r) => s.toggle && s.toggle(...r))
1100
+ onClick: t[0] || (t[0] = (...s) => r.toggle && r.toggle(...s))
1106
1101
  }, [
1107
- o("div", {
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
- s.shapeToggle,
1111
- s.model ? "translate-x-full" : "translate-x-0"
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 wt = /* @__PURE__ */ g(ft, [["render", pt]]), Ct = {
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", se), e.component("DateTimeStyle", ne), e.component("InputDecimalStyle", pe), e.component("InputStyle", Te), e.component("SelectStyle", je), e.component("StepperStyle", Ze), e.component("TableStyle", ot), e.component("TextAreaStyle", yt), e.component("ToggleStyle", wt), e.config.globalProperties.$alertstyle = b;
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
- se as ComboBoxStyle,
1127
- ne as DateTimeStyle,
1128
- pe as InputDecimalStyle,
1129
- Te as InputStyle,
1121
+ re as ComboBoxStyle,
1122
+ ge as DateTimeStyle,
1123
+ Ce as InputDecimalStyle,
1124
+ qe as InputStyle,
1130
1125
  je as SelectStyle,
1131
- Ze as StepperStyle,
1132
- ot as TableStyle,
1133
- yt as TextAreaStyle,
1134
- wt as ToggleStyle,
1135
- Ct as default
1126
+ tt as StepperStyle,
1127
+ ut as TableStyle,
1128
+ pt as TextAreaStyle,
1129
+ St as ToggleStyle,
1130
+ _t as default
1136
1131
  };