@luis-angel-martin-dzul/vue-input-styles 0.0.42 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -17
- package/dist/vue-input-styles.es.js +444 -446
- package/dist/vue-input-styles.umd.js +3 -3
- package/package.json +1 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as i, openBlock as a, normalizeClass as
|
|
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";
|
|
2
2
|
class b {
|
|
3
3
|
static type = {
|
|
4
4
|
success: "success",
|
|
@@ -15,39 +15,39 @@ 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,
|
|
18
|
+
static #e(l, t, n = b.type.info, d = 4e3) {
|
|
19
19
|
b.ensureContainer();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
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
24
|
const c = b.iconMap[n] || "";
|
|
25
|
-
|
|
25
|
+
r.innerHTML = `
|
|
26
26
|
<div class="alert-icon">${c}</div>
|
|
27
27
|
<div class="alert-texts">
|
|
28
28
|
<div class="alert-title">${l}</div>
|
|
29
|
-
<div class="alert-message">${
|
|
29
|
+
<div class="alert-message">${t}</div>
|
|
30
30
|
</div>
|
|
31
31
|
<div class="alert-close">×</div>
|
|
32
|
-
`,
|
|
33
|
-
b.remove(
|
|
34
|
-
}), b.container.appendChild(
|
|
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);
|
|
35
35
|
}
|
|
36
36
|
// Métodos públicos reutilizables
|
|
37
|
-
static success(l,
|
|
38
|
-
this.#e(l,
|
|
37
|
+
static success(l, t = "") {
|
|
38
|
+
this.#e(l, t, this.type.success);
|
|
39
39
|
}
|
|
40
|
-
static error(l,
|
|
41
|
-
this.#e(l,
|
|
40
|
+
static error(l, t = "") {
|
|
41
|
+
this.#e(l, t, this.type.error);
|
|
42
42
|
}
|
|
43
|
-
static warning(l,
|
|
44
|
-
this.#e(l,
|
|
43
|
+
static warning(l, t = "") {
|
|
44
|
+
this.#e(l, t, this.type.warning);
|
|
45
45
|
}
|
|
46
|
-
static info(l,
|
|
47
|
-
this.#e(l,
|
|
46
|
+
static info(l, t = "") {
|
|
47
|
+
this.#e(l, t, this.type.info);
|
|
48
48
|
}
|
|
49
|
-
static neutral(l,
|
|
50
|
-
this.#e(l,
|
|
49
|
+
static neutral(l, t = "") {
|
|
50
|
+
this.#e(l, t, 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));
|
|
@@ -56,21 +56,21 @@ class b {
|
|
|
56
56
|
l.classList.add("hide"), setTimeout(() => l.remove(), 250);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
const
|
|
59
|
+
const g = (e, l) => {
|
|
60
|
+
const t = e.__vccOpts || e;
|
|
61
61
|
for (const [n, d] of l)
|
|
62
|
-
|
|
63
|
-
return
|
|
62
|
+
t[n] = d;
|
|
63
|
+
return t;
|
|
64
64
|
}, T = {
|
|
65
65
|
name: "ButtonStyle",
|
|
66
66
|
emits: ["click"],
|
|
67
67
|
props: {
|
|
68
|
+
type: { type: String, default: "button", validator: (e) => ["button", "submit"].includes(e) },
|
|
68
69
|
class: { type: String, default: "" },
|
|
69
70
|
variant: { type: String, default: "solid" },
|
|
70
71
|
color: { type: String, default: "gray" },
|
|
71
72
|
disabled: { type: Boolean, default: !1 },
|
|
72
|
-
delay: { type: String, default: "1.5" }
|
|
73
|
-
full: { type: Boolean, default: !1 }
|
|
73
|
+
delay: { type: String, default: "1.5" }
|
|
74
74
|
},
|
|
75
75
|
data() {
|
|
76
76
|
return {
|
|
@@ -83,49 +83,47 @@ const m = (t, l) => {
|
|
|
83
83
|
},
|
|
84
84
|
buttonClasses() {
|
|
85
85
|
if (this.class)
|
|
86
|
-
return `${this.class} disabled:opacity-60 disabled:cursor-not-allowed`;
|
|
87
|
-
const
|
|
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 = {
|
|
86
|
+
return `${this.class} cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed`;
|
|
87
|
+
const e = [
|
|
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 = {
|
|
92
90
|
solid: {
|
|
93
|
-
gray: "text-white bg-slate-600 enabled:hover:bg-slate-700
|
|
94
|
-
green: "text-white bg-emerald-600 enabled:hover:bg-emerald-700
|
|
95
|
-
blue: "text-white bg-sky-600 enabled:hover:bg-sky-700
|
|
96
|
-
red: "text-white bg-rose-600 enabled:hover:bg-rose-700
|
|
97
|
-
yellow: "text-white bg-amber-600 enabled:hover:bg-amber-700
|
|
91
|
+
gray: "text-white bg-slate-600 enabled:hover:bg-slate-700",
|
|
92
|
+
green: "text-white bg-emerald-600 enabled:hover:bg-emerald-700",
|
|
93
|
+
blue: "text-white bg-sky-600 enabled:hover:bg-sky-700",
|
|
94
|
+
red: "text-white bg-rose-600 enabled:hover:bg-rose-700",
|
|
95
|
+
yellow: "text-white bg-amber-600 enabled:hover:bg-amber-700"
|
|
98
96
|
},
|
|
99
97
|
outline: {
|
|
100
|
-
gray: "text-slate-700 enabled:hover:bg-slate-50 border border-slate-700
|
|
101
|
-
green: "text-emerald-700 enabled:hover:bg-emerald-50 border border-emerald-700
|
|
102
|
-
blue: "text-sky-700 enabled:hover:bg-sky-50 border border-sky-700
|
|
103
|
-
red: "text-rose-700 enabled:hover:bg-rose-50 border border-rose-700
|
|
104
|
-
yellow: "text-amber-700 enabled:hover:bg-amber-50 border border-amber-700
|
|
98
|
+
gray: "text-slate-700 enabled:hover:bg-slate-50 border border-slate-700",
|
|
99
|
+
green: "text-emerald-700 enabled:hover:bg-emerald-50 border border-emerald-700",
|
|
100
|
+
blue: "text-sky-700 enabled:hover:bg-sky-50 border border-sky-700",
|
|
101
|
+
red: "text-rose-700 enabled:hover:bg-rose-50 border border-rose-700",
|
|
102
|
+
yellow: "text-amber-700 enabled:hover:bg-amber-50 border border-amber-700"
|
|
105
103
|
}
|
|
106
104
|
};
|
|
107
|
-
return
|
|
105
|
+
return e.push(l[this.variant][this.color]), e;
|
|
108
106
|
}
|
|
109
107
|
},
|
|
110
108
|
methods: {
|
|
111
|
-
handleClick(
|
|
112
|
-
this.isDisabled || (this.$emit("click",
|
|
109
|
+
handleClick(e) {
|
|
110
|
+
this.isDisabled || (this.$emit("click", e), this.internalDisabled = !0, setTimeout(() => {
|
|
113
111
|
this.internalDisabled = !1;
|
|
114
112
|
}, 1e3 * Number(this.delay)));
|
|
115
113
|
}
|
|
116
114
|
}
|
|
117
|
-
}, I = ["disabled"];
|
|
118
|
-
function B(
|
|
115
|
+
}, I = ["type", "disabled"];
|
|
116
|
+
function B(e, l, t, n, d, s) {
|
|
119
117
|
return a(), i("button", {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
class:
|
|
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)
|
|
124
122
|
}, [
|
|
125
|
-
|
|
123
|
+
C(e.$slots, "default")
|
|
126
124
|
], 10, I);
|
|
127
125
|
}
|
|
128
|
-
const
|
|
126
|
+
const q = /* @__PURE__ */ g(T, [["render", B]]), L = {
|
|
129
127
|
name: "CheckStyle",
|
|
130
128
|
props: {
|
|
131
129
|
label: { type: String, default: "" },
|
|
@@ -153,17 +151,17 @@ const L = /* @__PURE__ */ m(T, [["render", B]]), q = {
|
|
|
153
151
|
watch: {
|
|
154
152
|
modelValue: {
|
|
155
153
|
immediate: !0,
|
|
156
|
-
handler(
|
|
157
|
-
Array.isArray(
|
|
154
|
+
handler(e) {
|
|
155
|
+
Array.isArray(e) ? this.realSelection = [...e] : e ? this.realSelection = [e] : this.realSelection = [];
|
|
158
156
|
}
|
|
159
157
|
}
|
|
160
158
|
},
|
|
161
159
|
methods: {
|
|
162
|
-
getValue(
|
|
163
|
-
return this.returnType === "object" ?
|
|
160
|
+
getValue(e) {
|
|
161
|
+
return this.returnType === "object" ? e : this.returnType === "text" ? e.name : e.id;
|
|
164
162
|
},
|
|
165
|
-
isChecked(
|
|
166
|
-
const l = this.getValue(
|
|
163
|
+
isChecked(e) {
|
|
164
|
+
const l = this.getValue(e);
|
|
167
165
|
return this.realSelection.includes(l);
|
|
168
166
|
},
|
|
169
167
|
emitExternal() {
|
|
@@ -176,61 +174,61 @@ const L = /* @__PURE__ */ m(T, [["render", B]]), q = {
|
|
|
176
174
|
this.realSelection.length ? [...this.realSelection] : ""
|
|
177
175
|
);
|
|
178
176
|
},
|
|
179
|
-
onChange(
|
|
180
|
-
const l = this.getValue(
|
|
177
|
+
onChange(e) {
|
|
178
|
+
const l = this.getValue(e);
|
|
181
179
|
this.realSelection.includes(l) ? this.realSelection = this.realSelection.filter(
|
|
182
|
-
(
|
|
180
|
+
(t) => t !== l
|
|
183
181
|
) : this.all ? this.realSelection.push(l) : this.realSelection = [l], this.emitExternal();
|
|
184
182
|
},
|
|
185
183
|
toggleSelectAll() {
|
|
186
|
-
this.all && (this.isAllSelected ? this.realSelection = [] : this.realSelection = this.list.map((
|
|
184
|
+
this.all && (this.isAllSelected ? this.realSelection = [] : this.realSelection = this.list.map((e) => this.getValue(e)), this.emitExternal());
|
|
187
185
|
}
|
|
188
186
|
}
|
|
189
187
|
}, N = { class: "w-full" }, A = { class: "flex items-center justify-between" }, M = { class: "block text-sm font-medium text-gray-700" }, z = {
|
|
190
188
|
key: 0,
|
|
191
189
|
class: "flex items-center gap-2 select-none"
|
|
192
|
-
},
|
|
193
|
-
function K(
|
|
190
|
+
}, j = ["id", "checked"], E = ["for"], F = ["id", "checked", "onChange"], P = ["for"];
|
|
191
|
+
function K(e, l, t, n, d, s) {
|
|
194
192
|
return a(), i("div", N, [
|
|
195
193
|
o("div", A, [
|
|
196
|
-
o("h3", M, u(
|
|
197
|
-
|
|
194
|
+
o("h3", M, u(t.label), 1),
|
|
195
|
+
t.all ? (a(), i("div", z, [
|
|
198
196
|
o("input", {
|
|
199
197
|
type: "checkbox",
|
|
200
|
-
id: "todos-" +
|
|
201
|
-
checked:
|
|
202
|
-
onChange: l[0] || (l[0] = (...
|
|
203
|
-
class: "w-4 h-4
|
|
204
|
-
}, null, 40,
|
|
198
|
+
id: "todos-" + s.getUUID,
|
|
199
|
+
checked: s.isAllSelected,
|
|
200
|
+
onChange: l[0] || (l[0] = (...r) => s.toggleSelectAll && s.toggleSelectAll(...r)),
|
|
201
|
+
class: "w-4 h-4 accent-indigo-600 border-gray-300 rounded focus:ring-indigo-200"
|
|
202
|
+
}, null, 40, j),
|
|
205
203
|
o("label", {
|
|
206
|
-
for: "todos-" +
|
|
204
|
+
for: "todos-" + s.getUUID,
|
|
207
205
|
class: "text-sm text-gray-600 uppercase truncate"
|
|
208
|
-
}, " Seleccionar todos ", 8,
|
|
206
|
+
}, " Seleccionar todos ", 8, E)
|
|
209
207
|
])) : h("", !0)
|
|
210
208
|
]),
|
|
211
209
|
o("div", {
|
|
212
|
-
class:
|
|
210
|
+
class: m(["max-h-48 overflow-auto space-y-1", t.grid])
|
|
213
211
|
}, [
|
|
214
|
-
(a(!0), i(
|
|
215
|
-
key:
|
|
212
|
+
(a(!0), i(p, null, w(t.list, (r) => (a(), i("div", {
|
|
213
|
+
key: r.id,
|
|
216
214
|
class: "flex items-center gap-2 select-none"
|
|
217
215
|
}, [
|
|
218
216
|
o("input", {
|
|
219
217
|
type: "checkbox",
|
|
220
|
-
id:
|
|
221
|
-
checked:
|
|
222
|
-
onChange: (c) =>
|
|
223
|
-
class: "w-4 h-4
|
|
218
|
+
id: s.getUUID + "-" + r.id,
|
|
219
|
+
checked: s.isChecked(r),
|
|
220
|
+
onChange: (c) => s.onChange(r),
|
|
221
|
+
class: "w-4 h-4 accent-indigo-600 border-gray-300 rounded focus:ring-indigo-200"
|
|
224
222
|
}, null, 40, F),
|
|
225
223
|
o("label", {
|
|
226
|
-
for:
|
|
224
|
+
for: s.getUUID + "-" + r.id,
|
|
227
225
|
class: "truncate text-gray-700"
|
|
228
|
-
}, u(
|
|
226
|
+
}, u(r.name), 9, P)
|
|
229
227
|
]))), 128))
|
|
230
228
|
], 2)
|
|
231
229
|
]);
|
|
232
230
|
}
|
|
233
|
-
const W = /* @__PURE__ */
|
|
231
|
+
const W = /* @__PURE__ */ g(L, [["render", K]]), O = {
|
|
234
232
|
name: "ComboBoxStyle",
|
|
235
233
|
props: {
|
|
236
234
|
modelValue: [String, Number, Object, null],
|
|
@@ -243,128 +241,128 @@ const W = /* @__PURE__ */ m(q, [["render", K]]), O = {
|
|
|
243
241
|
},
|
|
244
242
|
data() {
|
|
245
243
|
return {
|
|
244
|
+
uuid: crypto.randomUUID(),
|
|
246
245
|
search: "",
|
|
246
|
+
searchCopy: "",
|
|
247
247
|
open: !1
|
|
248
248
|
};
|
|
249
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
250
|
computed: {
|
|
257
|
-
getUUID() {
|
|
258
|
-
return crypto.randomUUID();
|
|
259
|
-
},
|
|
260
251
|
filteredList() {
|
|
261
252
|
return this.search ? this.list.filter(
|
|
262
|
-
(
|
|
253
|
+
(e) => e.name.toLowerCase().includes(this.search.toLowerCase())
|
|
263
254
|
) : this.list;
|
|
264
255
|
},
|
|
265
256
|
model: {
|
|
266
257
|
get() {
|
|
267
258
|
return this.modelValue;
|
|
268
259
|
},
|
|
269
|
-
set(
|
|
270
|
-
this.$emit("update:modelValue",
|
|
260
|
+
set(e) {
|
|
261
|
+
this.$emit("update:modelValue", e);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
watch: {
|
|
266
|
+
modelValue: {
|
|
267
|
+
immediate: !0,
|
|
268
|
+
handler(e) {
|
|
269
|
+
if (e === null || e === "") {
|
|
270
|
+
this.search = "", this.searchCopy = "";
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const l = this.list.find((t) => t.id === e);
|
|
274
|
+
l && (this.search = l.name, this.searchCopy = l.name);
|
|
271
275
|
}
|
|
272
276
|
}
|
|
273
277
|
},
|
|
274
278
|
methods: {
|
|
275
|
-
selectItem(
|
|
276
|
-
this.model =
|
|
279
|
+
selectItem(e) {
|
|
280
|
+
this.model = e.id, this.search = e.name, this.searchCopy = e.name, this.open = !1;
|
|
281
|
+
},
|
|
282
|
+
clearItem() {
|
|
283
|
+
this.disabled || (this.model = null, this.search = "", this.searchCopy = "", this.open = !1);
|
|
277
284
|
},
|
|
278
285
|
closeWithDelay() {
|
|
279
286
|
setTimeout(() => {
|
|
280
|
-
this.open = !1;
|
|
281
|
-
},
|
|
287
|
+
this.model ? this.search.trim() !== this.searchCopy && (this.search = this.searchCopy) : this.search = "", this.open = !1;
|
|
288
|
+
}, 120);
|
|
282
289
|
}
|
|
283
290
|
}
|
|
284
|
-
}, H = { class: "w-full" }, R = ["for"], G = {
|
|
291
|
+
}, H = { class: "w-full relative" }, R = ["for"], G = { class: "text-sm font-medium text-gray-700" }, J = {
|
|
285
292
|
key: 0,
|
|
286
|
-
class: "text-red-800 ml-
|
|
287
|
-
},
|
|
293
|
+
class: "text-red-800 ml-1"
|
|
294
|
+
}, Q = {
|
|
288
295
|
key: 0,
|
|
289
296
|
class: "relative"
|
|
290
|
-
},
|
|
291
|
-
key:
|
|
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,
|
|
297
|
+
}, X = { class: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5" }, Y = ["id", "placeholder", "disabled", "required"], Z = ["id", "placeholder", "disabled", "required"], $ = {
|
|
298
|
+
key: 2,
|
|
301
299
|
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
|
-
},
|
|
300
|
+
}, ee = {
|
|
303
301
|
key: 0,
|
|
304
|
-
class: "
|
|
305
|
-
},
|
|
306
|
-
function
|
|
302
|
+
class: "px-3 py-2 text-gray-800"
|
|
303
|
+
}, te = ["onMousedown"];
|
|
304
|
+
function le(e, l, t, n, d, s) {
|
|
307
305
|
return a(), i("div", H, [
|
|
308
306
|
o("label", {
|
|
309
|
-
class: "
|
|
310
|
-
for:
|
|
307
|
+
class: "flex justify-between",
|
|
308
|
+
for: d.uuid
|
|
311
309
|
}, [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
t.$slots.icon ? (a(), i("div", J, [
|
|
316
|
-
o("div", Q, [
|
|
317
|
-
_(t.$slots, "icon")
|
|
310
|
+
o("div", G, [
|
|
311
|
+
y(u(t.label) + " ", 1),
|
|
312
|
+
t.required ? (a(), i("span", J, "*")) : h("", !0)
|
|
318
313
|
]),
|
|
314
|
+
s.model ? (a(), i("span", {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: "text-xs px-2.5 rounded text-red-800 hover:bg-red-50 cursor-pointer",
|
|
317
|
+
onMousedown: l[0] || (l[0] = k(() => {
|
|
318
|
+
}, ["prevent"])),
|
|
319
|
+
onClick: l[1] || (l[1] = (...r) => s.clearItem && s.clearItem(...r))
|
|
320
|
+
}, "Limpiar ", 32)) : h("", !0)
|
|
321
|
+
], 8, R),
|
|
322
|
+
e.$slots.icon ? (a(), i("div", Q, [
|
|
319
323
|
o("div", X, [
|
|
320
|
-
|
|
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]
|
|
324
|
+
C(e.$slots, "icon")
|
|
355
325
|
]),
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
326
|
+
f(o("input", {
|
|
327
|
+
id: d.uuid,
|
|
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),
|
|
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
|
+
}, null, 40, Y), [
|
|
338
|
+
[v, d.search]
|
|
339
|
+
])
|
|
340
|
+
])) : f((a(), i("input", {
|
|
341
|
+
key: 1,
|
|
342
|
+
id: d.uuid,
|
|
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),
|
|
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
|
+
}, null, 40, Z)), [
|
|
353
|
+
[v, d.search]
|
|
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"]),
|
|
360
|
+
class: "px-3 py-2 cursor-pointer hover:bg-gray-100"
|
|
361
|
+
}, u(r.name), 41, te))), 128))
|
|
362
|
+
])) : h("", !0)
|
|
365
363
|
]);
|
|
366
364
|
}
|
|
367
|
-
const
|
|
365
|
+
const se = /* @__PURE__ */ g(O, [["render", le]]), re = {
|
|
368
366
|
name: "DateTimeStyle",
|
|
369
367
|
props: {
|
|
370
368
|
modelValue: String,
|
|
@@ -387,8 +385,8 @@ const oe = /* @__PURE__ */ m(O, [["render", ae]]), de = {
|
|
|
387
385
|
get() {
|
|
388
386
|
return this.modelValue;
|
|
389
387
|
},
|
|
390
|
-
set(
|
|
391
|
-
this.$emit("update:modelValue",
|
|
388
|
+
set(e) {
|
|
389
|
+
this.$emit("update:modelValue", e);
|
|
392
390
|
}
|
|
393
391
|
},
|
|
394
392
|
showDate() {
|
|
@@ -401,12 +399,12 @@ const oe = /* @__PURE__ */ m(O, [["render", ae]]), de = {
|
|
|
401
399
|
return this.secondsMode === "max" ? "59" : "01";
|
|
402
400
|
},
|
|
403
401
|
dateInputClass() {
|
|
404
|
-
let
|
|
405
|
-
return this.showDate && this.showTime ?
|
|
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";
|
|
406
404
|
},
|
|
407
405
|
timeInputClass() {
|
|
408
|
-
let
|
|
409
|
-
return this.showDate && this.showTime ?
|
|
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";
|
|
410
408
|
},
|
|
411
409
|
gridClass() {
|
|
412
410
|
return this.showDate && this.showTime ? "grid grid-cols-2" : "";
|
|
@@ -415,19 +413,19 @@ const oe = /* @__PURE__ */ m(O, [["render", ae]]), de = {
|
|
|
415
413
|
watch: {
|
|
416
414
|
modelValue: {
|
|
417
415
|
immediate: !0,
|
|
418
|
-
handler(
|
|
419
|
-
if (!
|
|
416
|
+
handler(e) {
|
|
417
|
+
if (!e) {
|
|
420
418
|
this.localDate = "", this.localTime = "";
|
|
421
419
|
return;
|
|
422
420
|
}
|
|
423
421
|
if (this.mode === "date")
|
|
424
|
-
this.localDate =
|
|
422
|
+
this.localDate = e;
|
|
425
423
|
else if (this.mode === "time")
|
|
426
|
-
this.localTime =
|
|
424
|
+
this.localTime = e;
|
|
427
425
|
else if (this.mode === "datetime") {
|
|
428
|
-
const [l,
|
|
429
|
-
this.localDate = l || "", this.localTime =
|
|
430
|
-
} else this.mode === "datetime2" && (this.localDate =
|
|
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 = "");
|
|
431
429
|
}
|
|
432
430
|
},
|
|
433
431
|
mode: {
|
|
@@ -438,63 +436,63 @@ const oe = /* @__PURE__ */ m(O, [["render", ae]]), de = {
|
|
|
438
436
|
}
|
|
439
437
|
},
|
|
440
438
|
methods: {
|
|
441
|
-
parseValue(
|
|
442
|
-
if (!
|
|
439
|
+
parseValue(e) {
|
|
440
|
+
if (!e) {
|
|
443
441
|
this.localDate = "", this.localTime = "";
|
|
444
442
|
return;
|
|
445
443
|
}
|
|
446
444
|
if (this.mode === "date")
|
|
447
|
-
this.localDate =
|
|
445
|
+
this.localDate = e, this.localTime = "";
|
|
448
446
|
else if (this.mode === "time")
|
|
449
|
-
this.localDate = "", this.localTime =
|
|
447
|
+
this.localDate = "", this.localTime = e;
|
|
450
448
|
else if (this.mode === "datetime") {
|
|
451
|
-
const [l,
|
|
452
|
-
this.localDate = l || "", this.localTime =
|
|
453
|
-
} else this.mode === "datetime2" && (this.localDate =
|
|
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 = "");
|
|
454
452
|
this.emitValue();
|
|
455
453
|
},
|
|
456
454
|
emitValue() {
|
|
457
|
-
let
|
|
458
|
-
this.mode === "date" ?
|
|
455
|
+
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;
|
|
459
457
|
}
|
|
460
458
|
}
|
|
461
|
-
},
|
|
459
|
+
}, ie = { class: "w-full" }, ae = { class: "block text-sm font-medium text-gray-700" }, oe = {
|
|
462
460
|
key: 0,
|
|
463
461
|
class: "text-red-800 ml-2"
|
|
464
462
|
};
|
|
465
|
-
function
|
|
466
|
-
return a(), i("div",
|
|
467
|
-
o("label",
|
|
468
|
-
|
|
469
|
-
|
|
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)
|
|
470
468
|
]),
|
|
471
469
|
o("div", {
|
|
472
|
-
class:
|
|
470
|
+
class: m(s.gridClass)
|
|
473
471
|
}, [
|
|
474
|
-
|
|
472
|
+
s.showDate ? f((a(), i("input", x({
|
|
475
473
|
key: 0,
|
|
476
474
|
type: "date"
|
|
477
|
-
}, { disabled:
|
|
478
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
479
|
-
onInput: l[1] || (l[1] = (...
|
|
480
|
-
class:
|
|
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
|
|
481
479
|
}), null, 16)), [
|
|
482
|
-
[
|
|
480
|
+
[v, d.localDate]
|
|
483
481
|
]) : h("", !0),
|
|
484
|
-
|
|
482
|
+
s.showTime ? f((a(), i("input", x({
|
|
485
483
|
key: 1,
|
|
486
484
|
type: "time"
|
|
487
|
-
}, { disabled:
|
|
488
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
489
|
-
onInput: l[3] || (l[3] = (...
|
|
490
|
-
class:
|
|
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
|
|
491
489
|
}), null, 16)), [
|
|
492
|
-
[
|
|
490
|
+
[v, d.localTime]
|
|
493
491
|
]) : h("", !0)
|
|
494
492
|
], 2)
|
|
495
493
|
]);
|
|
496
494
|
}
|
|
497
|
-
const
|
|
495
|
+
const ne = /* @__PURE__ */ g(re, [["render", de]]), ue = {
|
|
498
496
|
name: "InputDecimalStyle",
|
|
499
497
|
props: {
|
|
500
498
|
modelValue: { type: [String, Number], default: "" },
|
|
@@ -511,15 +509,15 @@ const ge = /* @__PURE__ */ m(de, [["render", he]]), me = {
|
|
|
511
509
|
},
|
|
512
510
|
formattedValue() {
|
|
513
511
|
if (this.modelValue === "" || this.modelValue === null) return "";
|
|
514
|
-
const
|
|
515
|
-
return isNaN(
|
|
512
|
+
const e = parseFloat(this.modelValue);
|
|
513
|
+
return isNaN(e) ? "" : e.toLocaleString("en-US", {
|
|
516
514
|
minimumFractionDigits: 0,
|
|
517
515
|
maximumFractionDigits: Number(this.decimals)
|
|
518
516
|
});
|
|
519
517
|
}
|
|
520
518
|
},
|
|
521
519
|
methods: {
|
|
522
|
-
onKeyDown(
|
|
520
|
+
onKeyDown(e) {
|
|
523
521
|
const l = [
|
|
524
522
|
"Backspace",
|
|
525
523
|
"Delete",
|
|
@@ -533,83 +531,83 @@ const ge = /* @__PURE__ */ m(de, [["render", he]]), me = {
|
|
|
533
531
|
"Home",
|
|
534
532
|
"End"
|
|
535
533
|
];
|
|
536
|
-
if (!((
|
|
537
|
-
if (
|
|
538
|
-
const
|
|
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(".");
|
|
539
537
|
if (d.length === 2) {
|
|
540
|
-
const
|
|
541
|
-
n >
|
|
538
|
+
const s = d[1];
|
|
539
|
+
n > t.indexOf(".") && s.length >= Number(this.decimals) && e.preventDefault();
|
|
542
540
|
}
|
|
543
541
|
return;
|
|
544
542
|
}
|
|
545
|
-
|
|
543
|
+
e.key === "." || e.key === "," ? (Number(this.decimals) === 0 || e.target.value.includes(".")) && e.preventDefault() : e.preventDefault();
|
|
546
544
|
}
|
|
547
545
|
},
|
|
548
|
-
onInput(
|
|
549
|
-
let l =
|
|
546
|
+
onInput(e) {
|
|
547
|
+
let l = e.target.value.replace(/[^0-9.]/g, "");
|
|
550
548
|
Number(this.decimals) === 0 && (l = l.replace(/\./g, ""));
|
|
551
|
-
const
|
|
552
|
-
|
|
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);
|
|
553
551
|
},
|
|
554
|
-
onPaste(
|
|
555
|
-
let
|
|
556
|
-
Number(this.decimals) === 0 && (
|
|
557
|
-
const n =
|
|
558
|
-
n.length > 2 && (
|
|
552
|
+
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);
|
|
559
557
|
},
|
|
560
558
|
onBlur() {
|
|
561
|
-
let
|
|
562
|
-
!isNaN(
|
|
559
|
+
let e = this.modelValue ? parseFloat(this.modelValue) : "";
|
|
560
|
+
!isNaN(e) && e !== "" && (e = e.toFixed(Number(this.decimals))), this.$emit("update:modelValue", e);
|
|
563
561
|
}
|
|
564
562
|
}
|
|
565
|
-
},
|
|
563
|
+
}, ce = { class: "w-full" }, he = ["for"], me = {
|
|
566
564
|
key: 0,
|
|
567
565
|
class: "text-red-800 ml-2"
|
|
568
|
-
},
|
|
566
|
+
}, ge = {
|
|
569
567
|
key: 0,
|
|
570
568
|
class: "relative"
|
|
571
|
-
},
|
|
572
|
-
function
|
|
573
|
-
return a(), i("div",
|
|
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, [
|
|
574
572
|
o("label", {
|
|
575
573
|
class: "block text-sm font-medium text-gray-700",
|
|
576
|
-
for:
|
|
574
|
+
for: s.getUUID
|
|
577
575
|
}, [
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
], 8,
|
|
581
|
-
|
|
582
|
-
o("div",
|
|
583
|
-
|
|
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, [
|
|
581
|
+
C(e.$slots, "icon")
|
|
584
582
|
]),
|
|
585
|
-
o("input",
|
|
583
|
+
o("input", x({
|
|
586
584
|
type: "text",
|
|
587
|
-
id:
|
|
588
|
-
value:
|
|
589
|
-
onInput: l[0] || (l[0] = (...
|
|
590
|
-
onKeydown: l[1] || (l[1] = (...
|
|
591
|
-
onBlur: l[2] || (l[2] = (...
|
|
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)),
|
|
592
590
|
inputmode: "decimal",
|
|
593
|
-
placeholder:
|
|
594
|
-
onPaste: l[3] || (l[3] =
|
|
595
|
-
maxlength:
|
|
596
|
-
}, { disabled:
|
|
597
|
-
])) : (a(), i("input",
|
|
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({
|
|
598
596
|
key: 1,
|
|
599
597
|
type: "text",
|
|
600
|
-
id:
|
|
601
|
-
value:
|
|
602
|
-
onInput: l[4] || (l[4] = (...
|
|
603
|
-
onKeydown: l[5] || (l[5] = (...
|
|
604
|
-
onBlur: l[6] || (l[6] = (...
|
|
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)),
|
|
605
603
|
inputmode: "decimal",
|
|
606
|
-
placeholder:
|
|
607
|
-
onPaste: l[7] || (l[7] =
|
|
608
|
-
maxlength:
|
|
609
|
-
}, { disabled:
|
|
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))
|
|
610
608
|
]);
|
|
611
609
|
}
|
|
612
|
-
const
|
|
610
|
+
const pe = /* @__PURE__ */ g(ue, [["render", xe]]), we = {
|
|
613
611
|
name: "InputStyle",
|
|
614
612
|
props: {
|
|
615
613
|
modelValue: { type: [String, Number], default: "" },
|
|
@@ -628,57 +626,57 @@ const _e = /* @__PURE__ */ m(me, [["render", Ce]]), Se = {
|
|
|
628
626
|
get() {
|
|
629
627
|
return this.modelValue;
|
|
630
628
|
},
|
|
631
|
-
set(
|
|
632
|
-
this.$emit("update:modelValue",
|
|
629
|
+
set(e) {
|
|
630
|
+
this.$emit("update:modelValue", e);
|
|
633
631
|
}
|
|
634
632
|
}
|
|
635
633
|
}
|
|
636
|
-
},
|
|
634
|
+
}, ve = { class: "w-full" }, Ce = ["for"], Se = {
|
|
637
635
|
key: 0,
|
|
638
636
|
class: "text-red-800 ml-2"
|
|
639
|
-
},
|
|
637
|
+
}, ke = {
|
|
640
638
|
key: 0,
|
|
641
639
|
class: "relative"
|
|
642
|
-
},
|
|
643
|
-
function
|
|
644
|
-
return a(), i("div",
|
|
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, [
|
|
645
643
|
o("label", {
|
|
646
644
|
class: "block text-sm font-medium text-gray-700",
|
|
647
|
-
for:
|
|
645
|
+
for: s.getUUID
|
|
648
646
|
}, [
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
], 8,
|
|
652
|
-
|
|
653
|
-
o("div",
|
|
654
|
-
|
|
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, [
|
|
652
|
+
C(e.$slots, "icon")
|
|
655
653
|
]),
|
|
656
|
-
|
|
657
|
-
id:
|
|
658
|
-
type:
|
|
659
|
-
maxlength:
|
|
660
|
-
placeholder:
|
|
661
|
-
}, { disabled:
|
|
662
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
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),
|
|
663
661
|
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,
|
|
665
|
-
[
|
|
662
|
+
}), null, 16, De), [
|
|
663
|
+
[_, s.model]
|
|
666
664
|
])
|
|
667
|
-
])) :
|
|
665
|
+
])) : f((a(), i("input", x({
|
|
668
666
|
key: 1,
|
|
669
|
-
id:
|
|
670
|
-
type:
|
|
671
|
-
maxlength:
|
|
672
|
-
placeholder:
|
|
673
|
-
}, { disabled:
|
|
674
|
-
"onUpdate:modelValue": l[1] || (l[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),
|
|
675
673
|
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,
|
|
677
|
-
[
|
|
674
|
+
}), null, 16, Ve)), [
|
|
675
|
+
[_, s.model]
|
|
678
676
|
])
|
|
679
677
|
]);
|
|
680
678
|
}
|
|
681
|
-
const
|
|
679
|
+
const Te = /* @__PURE__ */ g(we, [["render", Ue]]), Ie = {
|
|
682
680
|
name: "SelectStyle",
|
|
683
681
|
props: {
|
|
684
682
|
modelValue: [String, Number, Object, null],
|
|
@@ -699,44 +697,44 @@ const qe = /* @__PURE__ */ m(Se, [["render", Le]]), Ne = {
|
|
|
699
697
|
get() {
|
|
700
698
|
return this.modelValue;
|
|
701
699
|
},
|
|
702
|
-
set(
|
|
703
|
-
this.$emit("update:modelValue",
|
|
700
|
+
set(e) {
|
|
701
|
+
this.$emit("update:modelValue", e);
|
|
704
702
|
}
|
|
705
703
|
}
|
|
706
704
|
}
|
|
707
|
-
},
|
|
705
|
+
}, Be = { class: "w-full" }, qe = ["for"], Le = {
|
|
708
706
|
key: 0,
|
|
709
707
|
class: "text-red-800 ml-2"
|
|
710
|
-
},
|
|
708
|
+
}, Ne = ["id"], Ae = {
|
|
711
709
|
value: "",
|
|
712
710
|
disabled: ""
|
|
713
|
-
},
|
|
714
|
-
function
|
|
715
|
-
return a(), i("div",
|
|
711
|
+
}, Me = ["value"];
|
|
712
|
+
function ze(e, l, t, n, d, s) {
|
|
713
|
+
return a(), i("div", Be, [
|
|
716
714
|
o("label", {
|
|
717
715
|
class: "block text-sm font-medium text-gray-700",
|
|
718
|
-
for:
|
|
716
|
+
for: s.getUUID
|
|
719
717
|
}, [
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
], 8,
|
|
723
|
-
|
|
724
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
725
|
-
}, { disabled:
|
|
726
|
-
id:
|
|
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,
|
|
727
725
|
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
726
|
}), [
|
|
729
|
-
o("option",
|
|
730
|
-
(a(!0), i(
|
|
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", {
|
|
731
729
|
key: c,
|
|
732
|
-
value:
|
|
733
|
-
}, u(
|
|
734
|
-
], 16,
|
|
735
|
-
[
|
|
730
|
+
value: r.id
|
|
731
|
+
}, u(r.text), 9, Me))), 128))
|
|
732
|
+
], 16, Ne), [
|
|
733
|
+
[V, s.model]
|
|
736
734
|
])
|
|
737
735
|
]);
|
|
738
736
|
}
|
|
739
|
-
const
|
|
737
|
+
const je = /* @__PURE__ */ g(Ie, [["render", ze]]), Ee = {
|
|
740
738
|
props: {
|
|
741
739
|
modelValue: { type: Number, default: 0 },
|
|
742
740
|
steps: { type: Array, required: !0 },
|
|
@@ -757,8 +755,8 @@ const Ke = /* @__PURE__ */ m(Ne, [["render", Pe]]), We = {
|
|
|
757
755
|
get() {
|
|
758
756
|
return this.modelValue;
|
|
759
757
|
},
|
|
760
|
-
set(
|
|
761
|
-
this.$emit("update:modelValue",
|
|
758
|
+
set(e) {
|
|
759
|
+
this.$emit("update:modelValue", e);
|
|
762
760
|
}
|
|
763
761
|
},
|
|
764
762
|
solid() {
|
|
@@ -771,22 +769,22 @@ const Ke = /* @__PURE__ */ m(Ne, [["render", Pe]]), We = {
|
|
|
771
769
|
};
|
|
772
770
|
},
|
|
773
771
|
barActive() {
|
|
774
|
-
return this.solid[this.color].split(" ").find((
|
|
772
|
+
return this.solid[this.color].split(" ").find((e) => e.startsWith("bg-"));
|
|
775
773
|
},
|
|
776
774
|
lineActive() {
|
|
777
775
|
return this.barActive;
|
|
778
776
|
},
|
|
779
777
|
progressWidth() {
|
|
780
|
-
const
|
|
781
|
-
return this.step === 0 ? 10 : this.step / (
|
|
778
|
+
const e = this.steps.length;
|
|
779
|
+
return this.step === 0 ? 10 : this.step / (e - 1) * 100;
|
|
782
780
|
}
|
|
783
781
|
},
|
|
784
782
|
methods: {
|
|
785
|
-
circleClass(
|
|
786
|
-
return this.step ===
|
|
783
|
+
circleClass(e) {
|
|
784
|
+
return this.step === e ? `${this.barActive} text-white` : this.step > e ? `${this.barActive} text-white opacity-90` : "bg-white text-gray-400 border-gray-300";
|
|
787
785
|
},
|
|
788
|
-
textClass(
|
|
789
|
-
return this.step >=
|
|
786
|
+
textClass(e) {
|
|
787
|
+
return this.step >= e ? this.barActive.replace("bg-", "text-") : "text-gray-400";
|
|
790
788
|
},
|
|
791
789
|
next() {
|
|
792
790
|
this.step < this.steps.length - 1 && this.step++;
|
|
@@ -794,40 +792,40 @@ const Ke = /* @__PURE__ */ m(Ne, [["render", Pe]]), We = {
|
|
|
794
792
|
previous() {
|
|
795
793
|
this.step > 0 && this.step--;
|
|
796
794
|
},
|
|
797
|
-
select(
|
|
798
|
-
this.step =
|
|
795
|
+
select(e) {
|
|
796
|
+
this.step = e;
|
|
799
797
|
},
|
|
800
798
|
submitForm() {
|
|
801
799
|
this.$emit("submit");
|
|
802
800
|
}
|
|
803
801
|
}
|
|
804
|
-
},
|
|
802
|
+
}, Fe = { class: "flex items-center gap-6 w-full" }, Pe = ["disabled"], Ke = { class: "flex-1" }, We = {
|
|
805
803
|
key: 0,
|
|
806
804
|
class: "flex items-center"
|
|
807
|
-
},
|
|
805
|
+
}, Oe = ["onClick"], He = {
|
|
808
806
|
key: 0,
|
|
809
807
|
class: "w-4 h-4",
|
|
810
808
|
fill: "none",
|
|
811
809
|
stroke: "currentColor",
|
|
812
810
|
viewBox: "0 0 24 24"
|
|
813
|
-
},
|
|
811
|
+
}, Re = {
|
|
814
812
|
key: 1,
|
|
815
813
|
class: "text-sm"
|
|
816
|
-
},
|
|
814
|
+
}, Ge = {
|
|
817
815
|
key: 1,
|
|
818
816
|
class: "w-full"
|
|
819
|
-
},
|
|
817
|
+
}, Je = {
|
|
820
818
|
key: 0,
|
|
821
819
|
class: "text-xs mb-1 block"
|
|
822
|
-
},
|
|
823
|
-
function
|
|
824
|
-
return a(), i("div",
|
|
825
|
-
|
|
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", {
|
|
826
824
|
key: 0,
|
|
827
825
|
type: "button",
|
|
828
|
-
disabled:
|
|
829
|
-
onClick: l[0] || (l[0] = (...
|
|
830
|
-
class:
|
|
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]])
|
|
831
829
|
}, [
|
|
832
830
|
l[3] || (l[3] = o("svg", {
|
|
833
831
|
class: "w-5 h-5",
|
|
@@ -842,61 +840,61 @@ function tt(t, l, e, n, d, r) {
|
|
|
842
840
|
d: "M15 19l-7-7 7-7"
|
|
843
841
|
})
|
|
844
842
|
], -1)),
|
|
845
|
-
|
|
846
|
-
], 10,
|
|
847
|
-
o("div",
|
|
848
|
-
|
|
849
|
-
(a(!0), i(
|
|
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", {
|
|
850
848
|
key: c,
|
|
851
|
-
class:
|
|
849
|
+
class: m(["flex items-center", c < t.steps.length - 1 ? "flex-1" : ""])
|
|
852
850
|
}, [
|
|
853
851
|
o("div", {
|
|
854
|
-
class:
|
|
855
|
-
onClick: (
|
|
852
|
+
class: m(["flex flex-col items-center relative", t.selected ? "cursor-pointer" : "pointer-events-none"]),
|
|
853
|
+
onClick: (S) => s.select(c)
|
|
856
854
|
}, [
|
|
857
855
|
o("div", {
|
|
858
|
-
class:
|
|
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)])
|
|
859
857
|
}, [
|
|
860
|
-
|
|
858
|
+
s.step > c ? (a(), i("svg", He, [...l[4] || (l[4] = [
|
|
861
859
|
o("path", {
|
|
862
860
|
"stroke-linecap": "round",
|
|
863
861
|
"stroke-linejoin": "round",
|
|
864
862
|
"stroke-width": "3",
|
|
865
863
|
d: "M5 13l4 4L19 7"
|
|
866
864
|
}, null, -1)
|
|
867
|
-
])])) : (a(), i("span",
|
|
865
|
+
])])) : (a(), i("span", Re, u(c + 1), 1))
|
|
868
866
|
], 2),
|
|
869
|
-
|
|
867
|
+
t.text === "all" || t.text === "only" && s.step === c ? (a(), i("span", {
|
|
870
868
|
key: 0,
|
|
871
|
-
class:
|
|
872
|
-
}, u(
|
|
873
|
-
], 10,
|
|
874
|
-
c <
|
|
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", {
|
|
875
873
|
key: 0,
|
|
876
|
-
class:
|
|
874
|
+
class: m(["flex-1 h-2 mx-3 rounded transition-colors duration-200", s.step > c ? s.lineActive : "bg-gray-300"])
|
|
877
875
|
}, null, 2)) : h("", !0)
|
|
878
876
|
], 2))), 128))
|
|
879
|
-
])) :
|
|
880
|
-
|
|
881
|
-
o("div",
|
|
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, [
|
|
882
880
|
l[6] || (l[6] = o("div", { class: "absolute inset-0" }, null, -1)),
|
|
883
881
|
o("div", {
|
|
884
|
-
class:
|
|
885
|
-
style:
|
|
882
|
+
class: m(["h-full rounded-full transition-all duration-300 relative shadow-md", s.barActive]),
|
|
883
|
+
style: U({ width: s.progressWidth + "%" })
|
|
886
884
|
}, [...l[5] || (l[5] = [
|
|
887
885
|
o("div", { class: "absolute inset-0 bg-white/20 mix-blend-overlay animate-pulse" }, null, -1)
|
|
888
886
|
])], 6)
|
|
889
887
|
])
|
|
890
888
|
])) : h("", !0)
|
|
891
889
|
]),
|
|
892
|
-
|
|
893
|
-
|
|
890
|
+
t.button ? (a(), i("div", Xe, [
|
|
891
|
+
s.step < t.steps.length - 1 ? (a(), i("button", {
|
|
894
892
|
key: 0,
|
|
895
893
|
type: "button",
|
|
896
|
-
onClick: l[1] || (l[1] = (...
|
|
897
|
-
class:
|
|
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]])
|
|
898
896
|
}, [
|
|
899
|
-
|
|
897
|
+
y(u(t.btnNext) + " ", 1),
|
|
900
898
|
l[7] || (l[7] = o("svg", {
|
|
901
899
|
class: "w-5 h-5",
|
|
902
900
|
fill: "none",
|
|
@@ -913,10 +911,10 @@ function tt(t, l, e, n, d, r) {
|
|
|
913
911
|
], 2)) : (a(), i("button", {
|
|
914
912
|
key: 1,
|
|
915
913
|
type: "button",
|
|
916
|
-
onClick: l[2] || (l[2] = (...
|
|
917
|
-
class:
|
|
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]])
|
|
918
916
|
}, [
|
|
919
|
-
|
|
917
|
+
y(u(t.btnFinish) + " ", 1),
|
|
920
918
|
l[8] || (l[8] = o("svg", {
|
|
921
919
|
class: "w-5 h-5",
|
|
922
920
|
fill: "none",
|
|
@@ -934,54 +932,54 @@ function tt(t, l, e, n, d, r) {
|
|
|
934
932
|
])) : h("", !0)
|
|
935
933
|
]);
|
|
936
934
|
}
|
|
937
|
-
const
|
|
935
|
+
const Ze = /* @__PURE__ */ g(Ee, [["render", Ye]]), $e = {
|
|
938
936
|
name: "TableStyle",
|
|
939
937
|
props: {
|
|
940
938
|
columns: { type: Array, required: !0 },
|
|
941
939
|
rows: { type: Array, default: () => [] }
|
|
942
940
|
}
|
|
943
|
-
},
|
|
944
|
-
function
|
|
945
|
-
return a(), i("div",
|
|
946
|
-
o("table",
|
|
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, [
|
|
947
945
|
o("thead", null, [
|
|
948
|
-
o("tr",
|
|
949
|
-
(a(!0), i(
|
|
946
|
+
o("tr", lt, [
|
|
947
|
+
(a(!0), i(p, null, w(t.columns, (r, c) => (a(), i("th", {
|
|
950
948
|
key: c,
|
|
951
949
|
class: "px-4 py-1.5 text-left text-sm font-semibold text-white border-b border-gray-600"
|
|
952
|
-
}, u(
|
|
950
|
+
}, u(r.label), 1))), 128))
|
|
953
951
|
])
|
|
954
952
|
]),
|
|
955
953
|
o("tbody", null, [
|
|
956
|
-
(a(!0), i(
|
|
954
|
+
(a(!0), i(p, null, w(t.rows, (r, c) => (a(), i("tr", {
|
|
957
955
|
key: c,
|
|
958
956
|
class: "hover:bg-gray-100 transition-colors cursor-default"
|
|
959
957
|
}, [
|
|
960
|
-
(a(!0), i(
|
|
958
|
+
(a(!0), i(p, null, w(t.columns, (S, D) => (a(), i("td", {
|
|
961
959
|
key: D,
|
|
962
960
|
class: "px-4 py-1.5 text-sm text-gray-700 border-b border-gray-200"
|
|
963
961
|
}, [
|
|
964
|
-
|
|
962
|
+
e.$slots[S.field] ? C(e.$slots, S.field, {
|
|
965
963
|
key: 0,
|
|
966
|
-
row:
|
|
967
|
-
}) : (a(), i("span",
|
|
964
|
+
row: r
|
|
965
|
+
}) : (a(), i("span", st, u(r[S.field]), 1))
|
|
968
966
|
]))), 128))
|
|
969
967
|
]))), 128)),
|
|
970
|
-
|
|
968
|
+
t.rows.length === 0 ? (a(), i("tr", rt, [
|
|
971
969
|
o("td", {
|
|
972
|
-
colspan:
|
|
970
|
+
colspan: t.columns.length,
|
|
973
971
|
class: "px-4 py-10 text-center text-gray-500 text-sm bg-gray-50"
|
|
974
972
|
}, [...l[0] || (l[0] = [
|
|
975
973
|
o("div", { class: "flex flex-col items-center gap-3" }, [
|
|
976
974
|
o("span", { class: "text-gray-600 font-medium" }, "No hay datos para mostrar")
|
|
977
975
|
], -1)
|
|
978
|
-
])], 8,
|
|
976
|
+
])], 8, it)
|
|
979
977
|
])) : h("", !0)
|
|
980
978
|
])
|
|
981
979
|
])
|
|
982
980
|
]);
|
|
983
981
|
}
|
|
984
|
-
const
|
|
982
|
+
const ot = /* @__PURE__ */ g($e, [["render", at]]), dt = {
|
|
985
983
|
name: "TextAreaStyle",
|
|
986
984
|
props: {
|
|
987
985
|
modelValue: String,
|
|
@@ -1001,45 +999,45 @@ const ct = /* @__PURE__ */ m(rt, [["render", ut]]), ht = {
|
|
|
1001
999
|
get() {
|
|
1002
1000
|
return this.modelValue;
|
|
1003
1001
|
},
|
|
1004
|
-
set(
|
|
1005
|
-
this.$emit("update:modelValue",
|
|
1002
|
+
set(e) {
|
|
1003
|
+
this.$emit("update:modelValue", e);
|
|
1006
1004
|
}
|
|
1007
1005
|
}
|
|
1008
1006
|
}
|
|
1009
|
-
},
|
|
1007
|
+
}, nt = { class: "w-full" }, ut = { class: "flex justify-between" }, ct = ["for"], ht = {
|
|
1010
1008
|
key: 0,
|
|
1011
1009
|
class: "text-red-800 ml-2"
|
|
1012
|
-
},
|
|
1013
|
-
function
|
|
1014
|
-
return a(), i("div",
|
|
1015
|
-
o("div",
|
|
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, [
|
|
1016
1014
|
o("label", {
|
|
1017
1015
|
class: "block text-sm font-medium text-gray-700",
|
|
1018
|
-
for:
|
|
1016
|
+
for: s.getUUID
|
|
1019
1017
|
}, [
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
], 8,
|
|
1023
|
-
|
|
1018
|
+
t.required ? (a(), i("span", ht, "*")) : h("", !0),
|
|
1019
|
+
y(" " + u(t.label), 1)
|
|
1020
|
+
], 8, ct),
|
|
1021
|
+
t.note ? (a(), i("label", {
|
|
1024
1022
|
key: 0,
|
|
1025
1023
|
class: "block text-xs text-gray-700",
|
|
1026
|
-
for:
|
|
1027
|
-
}, u(
|
|
1024
|
+
for: s.getUUID
|
|
1025
|
+
}, u(t.note), 9, mt)) : h("", !0)
|
|
1028
1026
|
]),
|
|
1029
|
-
|
|
1030
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
1031
|
-
id:
|
|
1032
|
-
placeholder:
|
|
1033
|
-
}, { disabled:
|
|
1034
|
-
maxlength:
|
|
1035
|
-
rows: Number(
|
|
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),
|
|
1036
1034
|
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,
|
|
1038
|
-
[
|
|
1035
|
+
}), null, 16, gt), [
|
|
1036
|
+
[v, s.model]
|
|
1039
1037
|
])
|
|
1040
1038
|
]);
|
|
1041
1039
|
}
|
|
1042
|
-
const
|
|
1040
|
+
const yt = /* @__PURE__ */ g(dt, [["render", bt]]), ft = {
|
|
1043
1041
|
name: "ToggleStyle",
|
|
1044
1042
|
props: {
|
|
1045
1043
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1055,8 +1053,8 @@ const wt = /* @__PURE__ */ m(ht, [["render", pt]]), vt = {
|
|
|
1055
1053
|
get() {
|
|
1056
1054
|
return this.modelValue;
|
|
1057
1055
|
},
|
|
1058
|
-
set(
|
|
1059
|
-
this.$emit("update:modelValue",
|
|
1056
|
+
set(e) {
|
|
1057
|
+
this.$emit("update:modelValue", e);
|
|
1060
1058
|
}
|
|
1061
1059
|
},
|
|
1062
1060
|
shapeToggle() {
|
|
@@ -1066,24 +1064,24 @@ const wt = /* @__PURE__ */ m(ht, [["render", pt]]), vt = {
|
|
|
1066
1064
|
}[this.shape];
|
|
1067
1065
|
},
|
|
1068
1066
|
computedClasses() {
|
|
1069
|
-
const
|
|
1067
|
+
const e = {
|
|
1070
1068
|
gray: "bg-slate-600 hover:bg-slate-700 border border-gray-800 cursor-pointer",
|
|
1071
1069
|
green: "bg-emerald-600 hover:bg-emerald-700 border border-green-700 cursor-pointer",
|
|
1072
1070
|
blue: "bg-sky-600 hover:bg-sky-700 border border-blue-700 cursor-pointer",
|
|
1073
1071
|
red: "bg-rose-600 hover:bg-rose-700 border border-red-700 cursor-pointer",
|
|
1074
1072
|
yellow: "bg-amber-600 hover:bg-amber-700 border border-yellow-600 cursor-pointer"
|
|
1075
1073
|
};
|
|
1076
|
-
return this.model ?
|
|
1074
|
+
return this.model ? e[this.color] : "bg-gray-200 border border-gray-300";
|
|
1077
1075
|
},
|
|
1078
1076
|
disabledColorClasses() {
|
|
1079
|
-
const
|
|
1077
|
+
const e = {
|
|
1080
1078
|
gray: "bg-slate-600 border border-slate-300 cursor-not-allowed opacity-60",
|
|
1081
1079
|
green: "bg-emerald-600 border border-emerald-300 cursor-not-allowed opacity-60",
|
|
1082
1080
|
blue: "bg-sky-600 border border-sky-300 cursor-not-allowed opacity-60",
|
|
1083
1081
|
red: "bg-rose-600 border border-rose-300 cursor-not-allowed opacity-60",
|
|
1084
1082
|
yellow: "bg-amber-600 border border-amber-300 cursor-not-allowed opacity-60"
|
|
1085
1083
|
};
|
|
1086
|
-
return this.modelValue ?
|
|
1084
|
+
return this.modelValue ? e[this.color] : "bg-gray-200 border border-gray-300 cursor-not-allowed";
|
|
1087
1085
|
},
|
|
1088
1086
|
disabledClasses() {
|
|
1089
1087
|
return this.disabledColorClasses;
|
|
@@ -1094,45 +1092,45 @@ const wt = /* @__PURE__ */ m(ht, [["render", pt]]), vt = {
|
|
|
1094
1092
|
this.disabled || (this.model = !this.model);
|
|
1095
1093
|
}
|
|
1096
1094
|
}
|
|
1097
|
-
},
|
|
1098
|
-
function
|
|
1095
|
+
}, xt = { class: "block text-sm font-medium text-gray-700" };
|
|
1096
|
+
function pt(e, l, t, n, d, s) {
|
|
1099
1097
|
return a(), i("div", null, [
|
|
1100
|
-
o("label",
|
|
1098
|
+
o("label", xt, u(t.label), 1),
|
|
1101
1099
|
o("div", {
|
|
1102
|
-
class:
|
|
1100
|
+
class: m([
|
|
1103
1101
|
"relative w-11 h-6 inline-flex items-center transition-colors duration-300 px-1",
|
|
1104
|
-
|
|
1105
|
-
|
|
1102
|
+
s.shapeToggle,
|
|
1103
|
+
t.disabled ? s.disabledClasses : s.computedClasses
|
|
1106
1104
|
]),
|
|
1107
|
-
onClick: l[0] || (l[0] = (...
|
|
1105
|
+
onClick: l[0] || (l[0] = (...r) => s.toggle && s.toggle(...r))
|
|
1108
1106
|
}, [
|
|
1109
1107
|
o("div", {
|
|
1110
|
-
class:
|
|
1108
|
+
class: m([
|
|
1111
1109
|
"absolute top-0.75 left-1 w-4 h-4 bg-white shadow transform transition-all duration-300",
|
|
1112
|
-
|
|
1113
|
-
|
|
1110
|
+
s.shapeToggle,
|
|
1111
|
+
s.model ? "translate-x-full" : "translate-x-0"
|
|
1114
1112
|
])
|
|
1115
1113
|
}, null, 2)
|
|
1116
1114
|
], 2)
|
|
1117
1115
|
]);
|
|
1118
1116
|
}
|
|
1119
|
-
const
|
|
1120
|
-
install(
|
|
1121
|
-
|
|
1117
|
+
const wt = /* @__PURE__ */ g(ft, [["render", pt]]), Ct = {
|
|
1118
|
+
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;
|
|
1122
1120
|
}
|
|
1123
1121
|
};
|
|
1124
1122
|
export {
|
|
1125
1123
|
b as AlertStyle,
|
|
1126
|
-
|
|
1124
|
+
q as ButtonStyle,
|
|
1127
1125
|
W as CheckStyle,
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1126
|
+
se as ComboBoxStyle,
|
|
1127
|
+
ne as DateTimeStyle,
|
|
1128
|
+
pe as InputDecimalStyle,
|
|
1129
|
+
Te as InputStyle,
|
|
1130
|
+
je as SelectStyle,
|
|
1131
|
+
Ze as StepperStyle,
|
|
1132
|
+
ot as TableStyle,
|
|
1133
|
+
yt as TextAreaStyle,
|
|
1134
|
+
wt as ToggleStyle,
|
|
1135
|
+
Ct as default
|
|
1138
1136
|
};
|