diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index 73ae98e..451bf07 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,4 +1,4 @@ -import { defineComponent as N, createBlock as P, openBlock as m, mergeProps as oe, withCtx as z, renderSlot as ie, computed as A, ref as w, createElementBlock as k, createCommentVNode as J, createSlots as Le, createVNode as V, createTextVNode as pe, toDisplayString as Y, Fragment as K, renderList as ee, resolveComponent as H, createElementVNode as B, h as Ae, watch as le, withDirectives as He, withKeys as Ye, vModelText as Fe, normalizeStyle as ge, resolveDynamicComponent as ye, normalizeClass as se, withModifiers as De, Teleport as Re, onMounted as We, onBeforeUnmount as Je } from "vue"; +import { defineComponent as N, createBlock as P, openBlock as p, mergeProps as oe, withCtx as z, renderSlot as ie, computed as A, ref as w, createElementBlock as k, createCommentVNode as J, createSlots as Le, createVNode as V, createTextVNode as pe, toDisplayString as Y, Fragment as K, renderList as ee, resolveComponent as H, createElementVNode as B, h as Ae, watch as le, withDirectives as He, withKeys as Ye, vModelText as Fe, normalizeStyle as ge, resolveDynamicComponent as ye, normalizeClass as se, withModifiers as De, Teleport as Re, onMounted as We, onBeforeUnmount as Je } from "vue"; import { VBtn as Ze } from "vuetify/components/VBtn"; import { VBadge as Xe } from "vuetify/components/VBadge"; import { VCheckbox as Ge } from "vuetify/components/VCheckbox"; @@ -36,13 +36,13 @@ const oa = N({ } } }), j = (e, a) => { - const s = e.__vccOpts || e; - for (const [d, c] of a) - s[d] = c; - return s; + const u = e.__vccOpts || e; + for (const [i, c] of a) + u[i] = c; + return u; }; -function ra(e, a, s, d, c, p) { - return m(), P(Ze, oe({ +function ra(e, a, u, i, c, m) { + return p(), P(Ze, oe({ color: e.color, variant: e.variant, size: e.size, @@ -97,14 +97,14 @@ const Ue = /* @__PURE__ */ j(oa, [["render", ra]]), Ee = { } }, setup(e) { - const a = A(() => e.radius in Ee ? Ee[e.radius] : e.radius), s = A(() => e.dot || e.badge !== void 0 ? e.visible : !1), d = A(() => ({ + const a = A(() => e.radius in Ee ? Ee[e.radius] : e.radius), u = A(() => e.dot || e.badge !== void 0 ? e.visible : !1), i = A(() => ({ "--eli-badge-radius": a.value })); - return { showBadge: s, badgeStyle: d }; + return { showBadge: u, badgeStyle: i }; } }); -function la(e, a, s, d, c, p) { - return e.showBadge ? (m(), P(Xe, oe({ +function la(e, a, u, i, c, m) { + return e.showBadge ? (p(), P(Xe, oe({ key: 0, color: e.color }, e.$attrs, { @@ -140,8 +140,8 @@ function Ve(e) { return e.replace(/\D+/g, ""); } function Ne(e) { - const a = e.replace(/[^\d,]/g, ""), s = a.split(","); - return s.length > 2 ? s[0] + "," + s.slice(1).join("") : a; + const a = e.replace(/[^\d,]/g, ""), u = a.split(","); + return u.length > 2 ? u[0] + "," + u.slice(1).join("") : a; } function ca(e) { return Ne(e.replace(/%/g, "")); @@ -196,13 +196,13 @@ const fa = N({ chips: Boolean }, emits: ["update:modelValue", "change", "focus", "blur"], - setup(e, { emit: a, attrs: s }) { - const d = w(!1), c = w(!1), p = A({ + setup(e, { emit: a, attrs: u }) { + const i = w(!1), c = w(!1), m = A({ get: () => e.modelValue, - set: ($) => { - a("update:modelValue", $), a("change", $); + set: (y) => { + a("update:modelValue", y), a("change", y); } - }), t = A( + }), n = A( () => [ "text", "password", @@ -217,68 +217,68 @@ const fa = N({ "porcentagem", "cep" ].includes(e.type) - ), i = A( + ), s = A( () => e.type === "password" ? c.value ? "text" : "password" : "text" - ), h = A(() => { + ), $ = A(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), n = A( - () => e.error ? "error" : d.value ? e.color : void 0 + }), r = A( + () => e.error ? "error" : i.value ? e.color : void 0 ); - function g($) { - const O = $.target; - let M = O.value; + function h(y) { + const q = y.target; + let _ = q.value; switch (e.type) { case "numericoInteiro": - M = Ve(M); + _ = Ve(_); break; case "numericoDecimal": - M = Ne(M); + _ = Ne(_); break; case "numericoMoeda": - M = ma(M); + _ = ma(_); break; case "porcentagem": - M = ca(M); + _ = ca(_); break; case "telefone": - M = da(M); + _ = da(_); break; case "cpfCnpj": - M = sa(M); + _ = sa(_); break; case "cep": - M = pa(M); + _ = pa(_); break; } - O.value = M, a("update:modelValue", M), a("change", M); + q.value = _, a("update:modelValue", _), a("change", _); } - function y() { + function g() { c.value = !c.value; } - const T = A(() => (e.options || []).map(($) => { - if ($ && typeof $ == "object" && "value" in $) { - const M = $.value; + const T = A(() => (e.options || []).map((y) => { + if (y && typeof y == "object" && "value" in y) { + const _ = y.value; return { - label: $.label ?? String(M), - value: M, - disabled: $.disabled + label: y.label ?? String(_), + value: _, + disabled: y.disabled }; } - const O = $; - return { label: String(O), value: O }; + const q = y; + return { label: String(q), value: q }; })); return { - attrs: s, - value: p, - isTextLike: t, - inputHtmlType: i, - inputMode: h, - internalColor: n, + attrs: u, + value: m, + isTextLike: n, + inputHtmlType: s, + inputMode: $, + internalColor: r, showPassword: c, - togglePassword: y, - onInput: g, + togglePassword: g, + onInput: h, onFocus: () => a("focus"), onBlur: () => a("blur"), computedItems: T @@ -288,12 +288,12 @@ const fa = N({ key: 4, class: "checkbox-group" }; -function ha(e, a, s, d, c, p) { - return m(), k("div", ba, [ - e.isTextLike ? (m(), P(Pe, oe({ +function ha(e, a, u, i, c, m) { + return p(), k("div", ba, [ + e.isTextLike ? (p(), P(Pe, oe({ key: 0, modelValue: e.value, - "onUpdate:modelValue": a[0] || (a[0] = (t) => e.value = t), + "onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n), type: e.inputHtmlType, label: e.label, placeholder: e.placeholder, @@ -328,18 +328,18 @@ function ha(e, a, s, d, c, p) { ]), key: "0" } : void 0 - ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (m(), P(aa, oe({ + ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (p(), P(aa, oe({ key: 1, modelValue: e.value, - "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t), + "onUpdate:modelValue": a[1] || (a[1] = (n) => e.value = n), label: e.label, rows: e.rows, density: e.density, variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (m(), P(ea, oe({ + }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (p(), P(ea, oe({ key: 2, modelValue: e.value, - "onUpdate:modelValue": a[2] || (a[2] = (t) => e.value = t), + "onUpdate:modelValue": a[2] || (a[2] = (n) => e.value = n), items: e.computedItems, label: e.label, placeholder: e.placeholder, @@ -356,27 +356,27 @@ function ha(e, a, s, d, c, p) { }, e.attrs, { onFocus: e.onFocus, onBlur: e.onBlur - }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (m(), P(xe, { + }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (p(), P(xe, { key: 3, modelValue: e.value, - "onUpdate:modelValue": a[3] || (a[3] = (t) => e.value = t), + "onUpdate:modelValue": a[3] || (a[3] = (n) => e.value = n), row: e.row }, { default: z(() => [ - (m(!0), k(K, null, ee(e.computedItems, (t) => (m(), P(Qe, { - key: String(t.value), - label: t.label, - value: t.value + (p(!0), k(K, null, ee(e.computedItems, (n) => (p(), P(Qe, { + key: String(n.value), + label: n.label, + value: n.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (m(), k("div", va, [ - (m(!0), k(K, null, ee(e.computedItems, (t) => (m(), P(Ge, { - key: String(t.value), + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (p(), k("div", va, [ + (p(!0), k(K, null, ee(e.computedItems, (n) => (p(), P(Ge, { + key: String(n.value), modelValue: e.value, - "onUpdate:modelValue": a[4] || (a[4] = (i) => e.value = i), - label: t.label, - value: t.value, + "onUpdate:modelValue": a[4] || (a[4] = (s) => e.value = s), + label: n.label, + value: n.value, density: e.density }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) ])) : J("", !0) @@ -390,27 +390,27 @@ const je = /* @__PURE__ */ j(fa, [["render", ha], ["__scopeId", "data-v-756cb549 EliInput: je }, setup() { - const e = w(""), a = w([]), s = w(""), d = w(""), c = w(""), p = w(""), t = w(""), i = w(""), h = w(""), n = w(""), g = w(""), y = w(null), T = w([]); + const e = w(""), a = w([]), u = w(""), i = w(""), c = w(""), m = w(""), n = w(""), s = w(""), $ = w(""), r = w(""), h = w(""), g = w(null), T = w([]); return { nome: e, - email: i, - documento: g, + email: s, + documento: h, estado: a, - telefone: d, - mensagem: h, - senha: n, - cor: y, + telefone: i, + mensagem: $, + senha: r, + cor: g, habilidades: T, idade: c, - altura: p, - cep: s, - valor: t + altura: m, + cep: u, + valor: n }; } }), ya = { class: "grid-example" }; -function $a(e, a, s, d, c, p) { - const t = H("EliBadge"), i = H("EliInput"), h = H("EliBotao"); - return m(), P(ta, null, { +function $a(e, a, u, i, c, m) { + const n = H("EliBadge"), s = H("EliInput"), $ = H("EliBotao"); + return p(), P(ta, null, { default: z(() => [ V(Te, { class: "mx-auto", @@ -419,7 +419,7 @@ function $a(e, a, s, d, c, p) { default: z(() => [ V(Oe, null, { default: z(() => [ - V(t, { + V(n, { badge: "Novo", "offset-x": "-15", location: "right center" @@ -436,47 +436,47 @@ function $a(e, a, s, d, c, p) { default: z(() => [ a[15] || (a[15] = pe(" Este é um componente de exemplo integrado com Vuetify. ", -1)), B("div", ya, [ - V(i, { + V(s, { modelValue: e.nome, - "onUpdate:modelValue": a[0] || (a[0] = (n) => e.nome = n), + "onUpdate:modelValue": a[0] || (a[0] = (r) => e.nome = r), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.idade, - "onUpdate:modelValue": a[1] || (a[1] = (n) => e.idade = n), + "onUpdate:modelValue": a[1] || (a[1] = (r) => e.idade = r), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.altura, - "onUpdate:modelValue": a[2] || (a[2] = (n) => e.altura = n), + "onUpdate:modelValue": a[2] || (a[2] = (r) => e.altura = r), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.valor, - "onUpdate:modelValue": a[3] || (a[3] = (n) => e.valor = n), + "onUpdate:modelValue": a[3] || (a[3] = (r) => e.valor = r), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.telefone, - "onUpdate:modelValue": a[4] || (a[4] = (n) => e.telefone = n), + "onUpdate:modelValue": a[4] || (a[4] = (r) => e.telefone = r), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.cep, - "onUpdate:modelValue": a[5] || (a[5] = (n) => e.cep = n), + "onUpdate:modelValue": a[5] || (a[5] = (r) => e.cep = r), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - V(i, { + V(s, { type: "select", label: "Estado", options: [ @@ -484,58 +484,58 @@ function $a(e, a, s, d, c, p) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": a[6] || (a[6] = (n) => e.estado = n), + "onUpdate:modelValue": a[6] || (a[6] = (r) => e.estado = r), multiple: "" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.documento, - "onUpdate:modelValue": a[7] || (a[7] = (n) => e.documento = n), + "onUpdate:modelValue": a[7] || (a[7] = (r) => e.documento = r), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.email, - "onUpdate:modelValue": a[8] || (a[8] = (n) => e.email = n), + "onUpdate:modelValue": a[8] || (a[8] = (r) => e.email = r), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.senha, - "onUpdate:modelValue": a[9] || (a[9] = (n) => e.senha = n), + "onUpdate:modelValue": a[9] || (a[9] = (r) => e.senha = r), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - V(i, { + V(s, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": a[10] || (a[10] = (n) => e.mensagem = n), + "onUpdate:modelValue": a[10] || (a[10] = (r) => e.mensagem = r), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - V(i, { + V(s, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": a[11] || (a[11] = (n) => e.cor = n), + "onUpdate:modelValue": a[11] || (a[11] = (r) => e.cor = r), label: "Cor favorita", options: [ { label: "Azul", value: "azul" }, { label: "Verde", value: "verde" } ] }, null, 8, ["modelValue"]), - V(i, { + V(s, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": a[12] || (a[12] = (n) => e.habilidades = n), + "onUpdate:modelValue": a[12] || (a[12] = (r) => e.habilidades = r), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - V(i, { + V(s, { modelValue: e.nome, - "onUpdate:modelValue": a[13] || (a[13] = (n) => e.nome = n), + "onUpdate:modelValue": a[13] || (a[13] = (r) => e.nome = r), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -546,7 +546,7 @@ function $a(e, a, s, d, c, p) { }), V(Ie, null, { default: z(() => [ - V(h, { + V($, { color: "primary", variant: "elevated", block: "" @@ -595,7 +595,7 @@ const ka = /* @__PURE__ */ j(ga, [["render", $a]]), Aa = N({ clicar: (e) => !0 }, setup(e, { emit: a }) { - const s = A(() => e.status), d = A(() => { + const u = A(() => e.status), i = A(() => { switch (e.status) { case "novo": return "primary"; @@ -607,20 +607,20 @@ const ka = /* @__PURE__ */ j(ga, [["render", $a]]), Aa = N({ return "error"; } }), c = A(() => `eli-cartao--${e.status}`); - function p() { + function m() { a("clicar", e.status); } return { - rotuloStatus: s, - corStatus: d, + rotuloStatus: u, + corStatus: i, classeStatus: c, - onClick: p + onClick: m }; } }), Ca = { class: "eli-cartao__titulo-texto" }, Va = { class: "eli-cartao__status" }; -function Ea(e, a, s, d, c, p) { - const t = H("EliBadge"); - return m(), P(Te, oe({ +function Ea(e, a, u, i, c, m) { + const n = H("EliBadge"); + return p(), P(Te, oe({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { @@ -633,7 +633,7 @@ function Ea(e, a, s, d, c, p) { ], !0) ]), B("div", Va, [ - V(t, { + V(n, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus @@ -653,7 +653,7 @@ function Ea(e, a, s, d, c, p) { ]), _: 3 }), - e.$slots.acoes ? (m(), P(Ie, { + e.$slots.acoes ? (p(), P(Ie, { key: 0, class: "eli-cartao__acoes" }, { @@ -666,160 +666,160 @@ function Ea(e, a, s, d, c, p) { _: 3 }, 16, ["variant", "class"]); } -const Ma = /* @__PURE__ */ j(Aa, [["render", Ea], ["__scopeId", "data-v-6c492bd9"]]); -function _a(e) { +const _a = /* @__PURE__ */ j(Aa, [["render", Ea], ["__scopeId", "data-v-6c492bd9"]]); +function Ma(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var he = { exports: {} }, wa = he.exports, Me; +var he = { exports: {} }, wa = he.exports, _e; function Sa() { - return Me || (Me = 1, (function(e, a) { - (function(s, d) { - e.exports = d(); + return _e || (_e = 1, (function(e, a) { + (function(u, i) { + e.exports = i(); })(wa, (function() { - var s = 1e3, d = 6e4, c = 36e5, p = "millisecond", t = "second", i = "minute", h = "hour", n = "day", g = "week", y = "month", T = "quarter", $ = "year", O = "date", M = "Invalid Date", Q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, x = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, L = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) { - var o = ["th", "st", "nd", "rd"], r = f % 100; - return "[" + f + (o[(r - 20) % 10] || o[r] || o[0]) + "]"; - } }, re = function(f, o, r) { - var u = String(f); - return !u || u.length >= o ? f : "" + Array(o + 1 - u.length).join(r) + f; + var u = 1e3, i = 6e4, c = 36e5, m = "millisecond", n = "second", s = "minute", $ = "hour", r = "day", h = "week", g = "month", T = "quarter", y = "year", q = "date", _ = "Invalid Date", Q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, x = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, L = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) { + var t = ["th", "st", "nd", "rd"], o = f % 100; + return "[" + f + (t[(o - 20) % 10] || t[o] || t[0]) + "]"; + } }, re = function(f, t, o) { + var d = String(f); + return !d || d.length >= t ? f : "" + Array(t + 1 - d.length).join(o) + f; }, ke = { s: re, z: function(f) { - var o = -f.utcOffset(), r = Math.abs(o), u = Math.floor(r / 60), l = r % 60; - return (o <= 0 ? "+" : "-") + re(u, 2, "0") + ":" + re(l, 2, "0"); - }, m: function f(o, r) { - if (o.date() < r.date()) return -f(r, o); - var u = 12 * (r.year() - o.year()) + (r.month() - o.month()), l = o.clone().add(u, y), v = r - l < 0, b = o.clone().add(u + (v ? -1 : 1), y); - return +(-(u + (r - l) / (v ? l - b : b - l)) || 0); + var t = -f.utcOffset(), o = Math.abs(t), d = Math.floor(o / 60), l = o % 60; + return (t <= 0 ? "+" : "-") + re(d, 2, "0") + ":" + re(l, 2, "0"); + }, m: function f(t, o) { + if (t.date() < o.date()) return -f(o, t); + var d = 12 * (o.year() - t.year()) + (o.month() - t.month()), l = t.clone().add(d, g), v = o - l < 0, b = t.clone().add(d + (v ? -1 : 1), g); + return +(-(d + (o - l) / (v ? l - b : b - l)) || 0); }, a: function(f) { return f < 0 ? Math.ceil(f) || 0 : Math.floor(f); }, p: function(f) { - return { M: y, y: $, w: g, d: n, D: O, h, m: i, s: t, ms: p, Q: T }[f] || String(f || "").toLowerCase().replace(/s$/, ""); + return { M: g, y, w: h, d: r, D: q, h: $, m: s, s: n, ms: m, Q: T }[f] || String(f || "").toLowerCase().replace(/s$/, ""); }, u: function(f) { return f === void 0; } }, Z = "en", X = {}; X[Z] = L; var ue = "$isDayjsObject", de = function(f) { return f instanceof ae || !(!f || !f[ue]); - }, ne = function f(o, r, u) { + }, ne = function f(t, o, d) { var l; - if (!o) return Z; - if (typeof o == "string") { - var v = o.toLowerCase(); - X[v] && (l = v), r && (X[v] = r, l = v); - var b = o.split("-"); + if (!t) return Z; + if (typeof t == "string") { + var v = t.toLowerCase(); + X[v] && (l = v), o && (X[v] = o, l = v); + var b = t.split("-"); if (!l && b.length > 1) return f(b[0]); } else { - var C = o.name; - X[C] = o, l = C; + var C = t.name; + X[C] = t, l = C; } - return !u && l && (Z = l), l || !u && Z; - }, q = function(f, o) { + return !d && l && (Z = l), l || !d && Z; + }, O = function(f, t) { if (de(f)) return f.clone(); - var r = typeof o == "object" ? o : {}; - return r.date = f, r.args = arguments, new ae(r); + var o = typeof t == "object" ? t : {}; + return o.date = f, o.args = arguments, new ae(o); }, E = ke; - E.l = ne, E.i = de, E.w = function(f, o) { - return q(f, { locale: o.$L, utc: o.$u, x: o.$x, $offset: o.$offset }); + E.l = ne, E.i = de, E.w = function(f, t) { + return O(f, { locale: t.$L, utc: t.$u, x: t.$x, $offset: t.$offset }); }; var ae = (function() { - function f(r) { - this.$L = ne(r.locale, null, !0), this.parse(r), this.$x = this.$x || r.x || {}, this[ue] = !0; + function f(o) { + this.$L = ne(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[ue] = !0; } - var o = f.prototype; - return o.parse = function(r) { - this.$d = (function(u) { - var l = u.date, v = u.utc; + var t = f.prototype; + return t.parse = function(o) { + this.$d = (function(d) { + var l = d.date, v = d.utc; if (l === null) return /* @__PURE__ */ new Date(NaN); if (E.u(l)) return /* @__PURE__ */ new Date(); if (l instanceof Date) return new Date(l); if (typeof l == "string" && !/Z$/i.test(l)) { var b = l.match(Q); if (b) { - var C = b[2] - 1 || 0, _ = (b[7] || "0").substring(0, 3); - return v ? new Date(Date.UTC(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, _)) : new Date(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, _); + var C = b[2] - 1 || 0, M = (b[7] || "0").substring(0, 3); + return v ? new Date(Date.UTC(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, M)) : new Date(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, M); } } return new Date(l); - })(r), this.init(); - }, o.init = function() { - var r = this.$d; - this.$y = r.getFullYear(), this.$M = r.getMonth(), this.$D = r.getDate(), this.$W = r.getDay(), this.$H = r.getHours(), this.$m = r.getMinutes(), this.$s = r.getSeconds(), this.$ms = r.getMilliseconds(); - }, o.$utils = function() { + })(o), this.init(); + }, t.init = function() { + var o = this.$d; + this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds(); + }, t.$utils = function() { return E; - }, o.isValid = function() { - return this.$d.toString() !== M; - }, o.isSame = function(r, u) { - var l = q(r); - return this.startOf(u) <= l && l <= this.endOf(u); - }, o.isAfter = function(r, u) { - return q(r) < this.startOf(u); - }, o.isBefore = function(r, u) { - return this.endOf(u) < q(r); - }, o.$g = function(r, u, l) { - return E.u(r) ? this[u] : this.set(l, r); - }, o.unix = function() { + }, t.isValid = function() { + return this.$d.toString() !== _; + }, t.isSame = function(o, d) { + var l = O(o); + return this.startOf(d) <= l && l <= this.endOf(d); + }, t.isAfter = function(o, d) { + return O(o) < this.startOf(d); + }, t.isBefore = function(o, d) { + return this.endOf(d) < O(o); + }, t.$g = function(o, d, l) { + return E.u(o) ? this[d] : this.set(l, o); + }, t.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, o.valueOf = function() { + }, t.valueOf = function() { return this.$d.getTime(); - }, o.startOf = function(r, u) { - var l = this, v = !!E.u(u) || u, b = E.p(r), C = function(R, I) { + }, t.startOf = function(o, d) { + var l = this, v = !!E.u(d) || d, b = E.p(o), C = function(R, I) { var G = E.w(l.$u ? Date.UTC(l.$y, I, R) : new Date(l.$y, I, R), l); - return v ? G : G.endOf(n); - }, _ = function(R, I) { + return v ? G : G.endOf(r); + }, M = function(R, I) { return E.w(l.toDate()[R].apply(l.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(I)), l); }, S = this.$W, D = this.$M, U = this.$D, F = "set" + (this.$u ? "UTC" : ""); switch (b) { - case $: - return v ? C(1, 0) : C(31, 11); case y: - return v ? C(1, D) : C(0, D + 1); + return v ? C(1, 0) : C(31, 11); case g: + return v ? C(1, D) : C(0, D + 1); + case h: var W = this.$locale().weekStart || 0, te = (S < W ? S + 7 : S) - W; return C(v ? U - te : U + (6 - te), D); + case r: + case q: + return M(F + "Hours", 0); + case $: + return M(F + "Minutes", 1); + case s: + return M(F + "Seconds", 2); case n: - case O: - return _(F + "Hours", 0); - case h: - return _(F + "Minutes", 1); - case i: - return _(F + "Seconds", 2); - case t: - return _(F + "Milliseconds", 3); + return M(F + "Milliseconds", 3); default: return this.clone(); } - }, o.endOf = function(r) { - return this.startOf(r, !1); - }, o.$set = function(r, u) { - var l, v = E.p(r), b = "set" + (this.$u ? "UTC" : ""), C = (l = {}, l[n] = b + "Date", l[O] = b + "Date", l[y] = b + "Month", l[$] = b + "FullYear", l[h] = b + "Hours", l[i] = b + "Minutes", l[t] = b + "Seconds", l[p] = b + "Milliseconds", l)[v], _ = v === n ? this.$D + (u - this.$W) : u; - if (v === y || v === $) { - var S = this.clone().set(O, 1); - S.$d[C](_), S.init(), this.$d = S.set(O, Math.min(this.$D, S.daysInMonth())).$d; - } else C && this.$d[C](_); + }, t.endOf = function(o) { + return this.startOf(o, !1); + }, t.$set = function(o, d) { + var l, v = E.p(o), b = "set" + (this.$u ? "UTC" : ""), C = (l = {}, l[r] = b + "Date", l[q] = b + "Date", l[g] = b + "Month", l[y] = b + "FullYear", l[$] = b + "Hours", l[s] = b + "Minutes", l[n] = b + "Seconds", l[m] = b + "Milliseconds", l)[v], M = v === r ? this.$D + (d - this.$W) : d; + if (v === g || v === y) { + var S = this.clone().set(q, 1); + S.$d[C](M), S.init(), this.$d = S.set(q, Math.min(this.$D, S.daysInMonth())).$d; + } else C && this.$d[C](M); return this.init(), this; - }, o.set = function(r, u) { - return this.clone().$set(r, u); - }, o.get = function(r) { - return this[E.p(r)](); - }, o.add = function(r, u) { + }, t.set = function(o, d) { + return this.clone().$set(o, d); + }, t.get = function(o) { + return this[E.p(o)](); + }, t.add = function(o, d) { var l, v = this; - r = Number(r); - var b = E.p(u), C = function(D) { - var U = q(v); - return E.w(U.date(U.date() + Math.round(D * r)), v); + o = Number(o); + var b = E.p(d), C = function(D) { + var U = O(v); + return E.w(U.date(U.date() + Math.round(D * o)), v); }; - if (b === y) return this.set(y, this.$M + r); - if (b === $) return this.set($, this.$y + r); - if (b === n) return C(1); - if (b === g) return C(7); - var _ = (l = {}, l[i] = d, l[h] = c, l[t] = s, l)[b] || 1, S = this.$d.getTime() + r * _; + if (b === g) return this.set(g, this.$M + o); + if (b === y) return this.set(y, this.$y + o); + if (b === r) return C(1); + if (b === h) return C(7); + var M = (l = {}, l[s] = i, l[$] = c, l[n] = u, l)[b] || 1, S = this.$d.getTime() + o * M; return E.w(S, this); - }, o.subtract = function(r, u) { - return this.add(-1 * r, u); - }, o.format = function(r) { - var u = this, l = this.$locale(); - if (!this.isValid()) return l.invalidDate || M; - var v = r || "YYYY-MM-DDTHH:mm:ssZ", b = E.z(this), C = this.$H, _ = this.$m, S = this.$M, D = l.weekdays, U = l.months, F = l.meridiem, W = function(I, G, ce, be) { - return I && (I[G] || I(u, v)) || ce[G].slice(0, be); + }, t.subtract = function(o, d) { + return this.add(-1 * o, d); + }, t.format = function(o) { + var d = this, l = this.$locale(); + if (!this.isValid()) return l.invalidDate || _; + var v = o || "YYYY-MM-DDTHH:mm:ssZ", b = E.z(this), C = this.$H, M = this.$m, S = this.$M, D = l.weekdays, U = l.months, F = l.meridiem, W = function(I, G, ce, be) { + return I && (I[G] || I(d, v)) || ce[G].slice(0, be); }, te = function(I) { return E.s(C % 12 || 12, I, "0"); }, R = F || function(I, G, ce) { @@ -830,9 +830,9 @@ function Sa() { return G || (function(ce) { switch (ce) { case "YY": - return String(u.$y).slice(-2); + return String(d.$y).slice(-2); case "YYYY": - return E.s(u.$y, 4, "0"); + return E.s(d.$y, 4, "0"); case "M": return S + 1; case "MM": @@ -842,17 +842,17 @@ function Sa() { case "MMMM": return W(U, S); case "D": - return u.$D; + return d.$D; case "DD": - return E.s(u.$D, 2, "0"); + return E.s(d.$D, 2, "0"); case "d": - return String(u.$W); + return String(d.$W); case "dd": - return W(l.weekdaysMin, u.$W, D, 2); + return W(l.weekdaysMin, d.$W, D, 2); case "ddd": - return W(l.weekdaysShort, u.$W, D, 3); + return W(l.weekdaysShort, d.$W, D, 3); case "dddd": - return D[u.$W]; + return D[d.$W]; case "H": return String(C); case "HH": @@ -862,94 +862,94 @@ function Sa() { case "hh": return te(2); case "a": - return R(C, _, !0); + return R(C, M, !0); case "A": - return R(C, _, !1); + return R(C, M, !1); case "m": - return String(_); + return String(M); case "mm": - return E.s(_, 2, "0"); + return E.s(M, 2, "0"); case "s": - return String(u.$s); + return String(d.$s); case "ss": - return E.s(u.$s, 2, "0"); + return E.s(d.$s, 2, "0"); case "SSS": - return E.s(u.$ms, 3, "0"); + return E.s(d.$ms, 3, "0"); case "Z": return b; } return null; })(I) || b.replace(":", ""); })); - }, o.utcOffset = function() { + }, t.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, o.diff = function(r, u, l) { - var v, b = this, C = E.p(u), _ = q(r), S = (_.utcOffset() - this.utcOffset()) * d, D = this - _, U = function() { - return E.m(b, _); + }, t.diff = function(o, d, l) { + var v, b = this, C = E.p(d), M = O(o), S = (M.utcOffset() - this.utcOffset()) * i, D = this - M, U = function() { + return E.m(b, M); }; switch (C) { - case $: + case y: v = U() / 12; break; - case y: + case g: v = U(); break; case T: v = U() / 3; break; - case g: + case h: v = (D - S) / 6048e5; break; - case n: + case r: v = (D - S) / 864e5; break; - case h: + case $: v = D / c; break; - case i: - v = D / d; + case s: + v = D / i; break; - case t: - v = D / s; + case n: + v = D / u; break; default: v = D; } return l ? v : E.a(v); - }, o.daysInMonth = function() { - return this.endOf(y).$D; - }, o.$locale = function() { + }, t.daysInMonth = function() { + return this.endOf(g).$D; + }, t.$locale = function() { return X[this.$L]; - }, o.locale = function(r, u) { - if (!r) return this.$L; - var l = this.clone(), v = ne(r, u, !0); + }, t.locale = function(o, d) { + if (!o) return this.$L; + var l = this.clone(), v = ne(o, d, !0); return v && (l.$L = v), l; - }, o.clone = function() { + }, t.clone = function() { return E.w(this.$d, this); - }, o.toDate = function() { + }, t.toDate = function() { return new Date(this.valueOf()); - }, o.toJSON = function() { + }, t.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, o.toISOString = function() { + }, t.toISOString = function() { return this.$d.toISOString(); - }, o.toString = function() { + }, t.toString = function() { return this.$d.toUTCString(); }, f; })(), fe = ae.prototype; - return q.prototype = fe, [["$ms", p], ["$s", t], ["$m", i], ["$H", h], ["$W", n], ["$M", y], ["$y", $], ["$D", O]].forEach((function(f) { - fe[f[1]] = function(o) { - return this.$g(o, f[0], f[1]); + return O.prototype = fe, [["$ms", m], ["$s", n], ["$m", s], ["$H", $], ["$W", r], ["$M", g], ["$y", y], ["$D", q]].forEach((function(f) { + fe[f[1]] = function(t) { + return this.$g(t, f[0], f[1]); }; - })), q.extend = function(f, o) { - return f.$i || (f(o, ae, q), f.$i = !0), q; - }, q.locale = ne, q.isDayjs = de, q.unix = function(f) { - return q(1e3 * f); - }, q.en = X[Z], q.Ls = X, q.p = {}, q; + })), O.extend = function(f, t) { + return f.$i || (f(t, ae, O), f.$i = !0), O; + }, O.locale = ne, O.isDayjs = de, O.unix = function(f) { + return O(1e3 * f); + }, O.en = X[Z], O.Ls = X, O.p = {}, O; })); })(he)), he.exports; } var Ba = Sa(); -const ve = /* @__PURE__ */ _a(Ba), Da = N({ +const ve = /* @__PURE__ */ Ma(Ba), Da = N({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1048,42 +1048,42 @@ const ve = /* @__PURE__ */ _a(Ba), Da = N({ foco: () => !0, desfoco: () => !0 }, - setup(e, { emit: a, attrs: s }) { - const d = A( + setup(e, { emit: a, attrs: u }) { + const i = A( () => e.modo === "data" ? "date" : "datetime-local" ); - function c(n) { - return e.modo === "data" ? ve(n).format("YYYY-MM-DD") : ve(n).format("YYYY-MM-DDTHH:mm"); + function c(r) { + return e.modo === "data" ? ve(r).format("YYYY-MM-DD") : ve(r).format("YYYY-MM-DDTHH:mm"); } - function p(n) { - return e.modo === "data" ? ve(`${n}T00:00`).format() : ve(n).format(); + function m(r) { + return e.modo === "data" ? ve(`${r}T00:00`).format() : ve(r).format(); } - const t = A({ + const n = A({ get: () => e.modelValue ? c(e.modelValue) : "", - set: (n) => { - const g = n && n.length > 0 ? n : null; - if (!g) { + set: (r) => { + const h = r && r.length > 0 ? r : null; + if (!h) { a("update:modelValue", null), a("alterar", null); return; } - const y = p(g); - a("update:modelValue", y), a("alterar", y); + const g = m(h); + a("update:modelValue", g), a("alterar", g); } - }), i = A(() => { + }), s = A(() => { if (e.min) return c(e.min); - }), h = A(() => { + }), $ = A(() => { if (e.max) return c(e.max); }); - return { attrs: s, valor: t, emit: a, minLocal: i, maxLocal: h, tipoInput: d }; + return { attrs: u, valor: n, emit: a, minLocal: s, maxLocal: $, tipoInput: i }; } }), Pa = { class: "eli-data-hora" }; -function Ta(e, a, s, d, c, p) { - return m(), k("div", Pa, [ +function Ta(e, a, u, i, c, m) { + return p(), k("div", Pa, [ V(Pe, oe({ modelValue: e.valor, - "onUpdate:modelValue": a[0] || (a[0] = (t) => e.valor = t), + "onUpdate:modelValue": a[0] || (a[0] = (n) => e.valor = n), type: e.tipoInput, label: e.rotulo, placeholder: e.placeholder, @@ -1098,8 +1098,8 @@ function Ta(e, a, s, d, c, p) { min: e.minLocal, max: e.maxLocal }, e.attrs, { - onFocus: a[1] || (a[1] = (t) => e.emit("foco")), - onBlur: a[2] || (a[2] = (t) => e.emit("desfoco")) + onFocus: a[1] || (a[1] = (n) => e.emit("foco")), + onBlur: a[2] || (a[2] = (n) => e.emit("desfoco")) }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } @@ -1123,14 +1123,14 @@ const qa = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const _e = (e) => e === ""; +const Me = (e) => e === ""; /** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ia = (...e) => e.filter((a, s, d) => !!a && a.trim() !== "" && d.indexOf(a) === s).join(" ").trim(); +const Ia = (...e) => e.filter((a, u, i) => !!a && a.trim() !== "" && i.indexOf(a) === u).join(" ").trim(); /** * @license lucide-vue-next v0.563.0 - ISC * @@ -1146,7 +1146,7 @@ const we = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); */ const Ua = (e) => e.replace( /^([A-Z])|[\s-_]+(\w)/g, - (a, s, d) => d ? d.toUpperCase() : s.toLowerCase() + (a, u, i) => i ? i.toUpperCase() : u.toLowerCase() ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1184,30 +1184,30 @@ var me = { const ja = ({ name: e, iconNode: a, - absoluteStrokeWidth: s, - "absolute-stroke-width": d, + absoluteStrokeWidth: u, + "absolute-stroke-width": i, strokeWidth: c, - "stroke-width": p, - size: t = me.width, - color: i = me.stroke, - ...h -}, { slots: n }) => Ae( + "stroke-width": m, + size: n = me.width, + color: s = me.stroke, + ...$ +}, { slots: r }) => Ae( "svg", { ...me, - ...h, - width: t, - height: t, - stroke: i, - "stroke-width": _e(s) || _e(d) || s === !0 || d === !0 ? Number(c || p || me["stroke-width"]) * 24 / Number(t) : c || p || me["stroke-width"], + ...$, + width: n, + height: n, + stroke: s, + "stroke-width": Me(u) || Me(i) || u === !0 || i === !0 ? Number(c || m || me["stroke-width"]) * 24 / Number(n) : c || m || me["stroke-width"], class: Ia( "lucide", - h.class, + $.class, ...e ? [`lucide-${we(Na(e))}-icon`, `lucide-${we(e)}`] : ["lucide-icon"] ), - ...!n.default && !qa(h) && { "aria-hidden": "true" } + ...!r.default && !qa($) && { "aria-hidden": "true" } }, - [...a.map((g) => Ae(...g)), ...n.default ? [n.default()] : []] + [...a.map((h) => Ae(...h)), ...r.default ? [r.default()] : []] ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1215,15 +1215,15 @@ const ja = ({ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const $e = (e, a) => (s, { slots: d, attrs: c }) => Ae( +const $e = (e, a) => (u, { slots: i, attrs: c }) => Ae( ja, { ...c, - ...s, + ...u, iconNode: a, name: e }, - d + i ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1281,30 +1281,30 @@ const La = $e("search", [ } }, setup(e, { emit: a }) { - const s = w(e.modelo ?? ""); + const u = w(e.modelo ?? ""); le( () => e.modelo, (c) => { - c !== void 0 && c !== s.value && (s.value = c); + c !== void 0 && c !== u.value && (u.value = c); } ); - function d() { - a("buscar", s.value.trim()); + function i() { + a("buscar", u.value.trim()); } - return { texto: s, emitirBusca: d }; + return { texto: u, emitirBusca: i }; } }), Ya = { class: "eli-tabela__busca" }, Fa = { class: "eli-tabela__busca-input-wrapper" }; -function Ra(e, a, s, d, c, p) { - const t = H("Search"); - return m(), k("div", Ya, [ +function Ra(e, a, u, i, c, m) { + const n = H("Search"); + return p(), k("div", Ya, [ B("div", Fa, [ He(B("input", { id: "eli-tabela-busca", - "onUpdate:modelValue": a[0] || (a[0] = (i) => e.texto = i), + "onUpdate:modelValue": a[0] || (a[0] = (s) => e.texto = s), type: "search", class: "eli-tabela__busca-input", placeholder: "Digite termos para filtrar", - onKeyup: a[1] || (a[1] = Ye((...i) => e.emitirBusca && e.emitirBusca(...i), ["enter"])) + onKeyup: a[1] || (a[1] = Ye((...s) => e.emitirBusca && e.emitirBusca(...s), ["enter"])) }, null, 544), [ [Fe, e.texto] ]), @@ -1313,9 +1313,9 @@ function Ra(e, a, s, d, c, p) { class: "eli-tabela__busca-botao", "aria-label": "Buscar", title: "Buscar", - onClick: a[2] || (a[2] = (...i) => e.emitirBusca && e.emitirBusca(...i)) + onClick: a[2] || (a[2] = (...s) => e.emitirBusca && e.emitirBusca(...s)) }, [ - V(t, { + V(n, { class: "eli-tabela__busca-botao-icone", size: 16, "stroke-width": 2, @@ -1348,39 +1348,39 @@ const Wa = /* @__PURE__ */ j(Ha, [["render", Ra], ["__scopeId", "data-v-0fd1ad15 } }, setup(e, { emit: a }) { - const s = A(() => e.acoesCabecalho.length > 0); - function d(c) { + const u = A(() => e.acoesCabecalho.length > 0); + function i(c) { a("buscar", c); } - return { temAcoesCabecalho: s, emitBuscar: d }; + return { temAcoesCabecalho: u, emitBuscar: i }; } }), Za = { class: "eli-tabela__cabecalho" }, Xa = { key: 1, class: "eli-tabela__acoes-cabecalho" }, Ga = ["onClick"], Ka = { class: "eli-tabela__acoes-cabecalho-rotulo" }; -function Qa(e, a, s, d, c, p) { - const t = H("EliTabelaCaixaDeBusca"); - return m(), k("div", Za, [ - e.exibirBusca ? (m(), P(t, { +function Qa(e, a, u, i, c, m) { + const n = H("EliTabelaCaixaDeBusca"); + return p(), k("div", Za, [ + e.exibirBusca ? (p(), P(n, { key: 0, modelo: e.valorBusca, onBuscar: e.emitBuscar }, null, 8, ["modelo", "onBuscar"])) : J("", !0), - e.temAcoesCabecalho ? (m(), k("div", Xa, [ - (m(!0), k(K, null, ee(e.acoesCabecalho, (i, h) => (m(), k("button", { - key: `${i.rotulo}-${h}`, + e.temAcoesCabecalho ? (p(), k("div", Xa, [ + (p(!0), k(K, null, ee(e.acoesCabecalho, (s, $) => (p(), k("button", { + key: `${s.rotulo}-${$}`, type: "button", class: "eli-tabela__acoes-cabecalho-botao", - style: ge(i.cor ? { backgroundColor: i.cor, color: "#fff" } : void 0), - onClick: i.acao + style: ge(s.cor ? { backgroundColor: s.cor, color: "#fff" } : void 0), + onClick: s.acao }, [ - i.icone ? (m(), P(ye(i.icone), { + s.icone ? (p(), P(ye(s.icone), { key: 0, class: "eli-tabela__acoes-cabecalho-icone", size: 16, "stroke-width": 2 })) : J("", !0), - B("span", Ka, Y(i.rotulo), 1) + B("span", Ka, Y(s.rotulo), 1) ], 12, Ga))), 128)) ])) : J("", !0) ]); @@ -1414,11 +1414,11 @@ const xa = /* @__PURE__ */ j(Ja, [["render", Qa]]), et = N({ key: 2, class: "eli-tabela eli-tabela--vazio" }; -function nt(e, a, s, d, c, p) { - return e.carregando ? (m(), k("div", at, " Carregando... ")) : e.erro ? (m(), k("div", tt, [ +function nt(e, a, u, i, c, m) { + return e.carregando ? (p(), k("div", at, " Carregando... ")) : e.erro ? (p(), k("div", tt, [ a[0] || (a[0] = B("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), B("div", ot, Y(e.erro), 1) - ])) : (m(), k("div", rt, Y(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); + ])) : (p(), k("div", rt, Y(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); } const lt = /* @__PURE__ */ j(et, [["render", nt]]), it = N({ name: "EliTabelaDebug", @@ -1440,8 +1440,8 @@ const lt = /* @__PURE__ */ j(et, [["render", nt]]), it = N({ key: 0, style: { position: "fixed", left: "8px", bottom: "8px", "z-index": "999999", background: "rgba(185,28,28,0.9)", color: "#fff", padding: "6px 10px", "border-radius": "8px", "font-size": "12px", "max-width": "500px" } }; -function ut(e, a, s, d, c, p) { - return e.isDev ? (m(), k("div", st, [ +function ut(e, a, u, i, c, m) { + return e.isDev ? (p(), k("div", st, [ a[0] || (a[0] = B("div", null, [ B("b", null, "EliTabela debug") ], -1)), @@ -1476,20 +1476,20 @@ const dt = /* @__PURE__ */ j(it, [["render", ut]]), ct = N({ } }, setup(e, { emit: a }) { - function s(p) { - return (p == null ? void 0 : p.coluna_ordem) !== void 0 && (p == null ? void 0 : p.coluna_ordem) !== null; + function u(m) { + return (m == null ? void 0 : m.coluna_ordem) !== void 0 && (m == null ? void 0 : m.coluna_ordem) !== null; } - function d(p) { - return p === "direita" ? "eli-tabela__celula--direita" : p === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; + function i(m) { + return m === "direita" ? "eli-tabela__celula--direita" : m === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; } - function c(p) { - a("alternarOrdenacao", p); + function c(m) { + a("alternarOrdenacao", m); } return { ArrowUp: Be, ArrowDown: Se, - isOrdenavel: s, - obterClasseAlinhamento: d, + isOrdenavel: u, + obterClasseAlinhamento: i, emitAlternarOrdenacao: c }; } @@ -1501,43 +1501,43 @@ const dt = /* @__PURE__ */ j(it, [["render", ut]]), ct = N({ class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" }; -function gt(e, a, s, d, c, p) { - const t = H("ArrowUp"); - return m(), k("thead", mt, [ +function gt(e, a, u, i, c, m) { + const n = H("ArrowUp"); + return p(), k("thead", mt, [ B("tr", pt, [ - (m(!0), k(K, null, ee(e.colunas, (i, h) => (m(), k("th", { - key: `th-${h}`, + (p(!0), k(K, null, ee(e.colunas, (s, $) => (p(), k("th", { + key: `th-${$}`, class: se(["eli-tabela__th", [ - e.isOrdenavel(i) ? "eli-tabela__th--ordenavel" : void 0, - e.obterClasseAlinhamento(i.alinhamento) + e.isOrdenavel(s) ? "eli-tabela__th--ordenavel" : void 0, + e.obterClasseAlinhamento(s.alinhamento) ]]), scope: "col" }, [ - e.isOrdenavel(i) ? (m(), k("button", { + e.isOrdenavel(s) ? (p(), k("button", { key: 0, type: "button", class: se(["eli-tabela__th-botao", [ - e.colunaOrdenacao === String(i.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 + e.colunaOrdenacao === String(s.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 ]]), - onClick: (n) => e.emitAlternarOrdenacao(String(i.coluna_ordem)) + onClick: (r) => e.emitAlternarOrdenacao(String(s.coluna_ordem)) }, [ - B("span", bt, Y(i.rotulo), 1), - e.colunaOrdenacao === String(i.coluna_ordem) ? (m(), P(ye(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { + B("span", bt, Y(s.rotulo), 1), + e.colunaOrdenacao === String(s.coluna_ordem) ? (p(), P(ye(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { key: 0, class: "eli-tabela__th-icone", size: 16, "stroke-width": 2, "aria-hidden": "true" - })) : (m(), P(t, { + })) : (p(), P(n, { key: 1, class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", size: 16, "stroke-width": 2, "aria-hidden": "true" })) - ], 10, ft)) : (m(), k("span", vt, Y(i.rotulo), 1)) + ], 10, ft)) : (p(), k("span", vt, Y(s.rotulo), 1)) ], 2))), 128)), - e.temAcoes ? (m(), k("th", ht, " Ações ")) : J("", !0) + e.temAcoes ? (p(), k("th", ht, " Ações ")) : J("", !0) ]) ]); } @@ -1557,9 +1557,9 @@ const yt = /* @__PURE__ */ j(ct, [["render", gt]]), $t = N({ return { dados: e }; } }); -function kt(e, a, s, d, c, p) { - var t; - return Y((t = e.dados) == null ? void 0 : t.texto); +function kt(e, a, u, i, c, m) { + var n; + return Y((n = e.dados) == null ? void 0 : n.texto); } const At = /* @__PURE__ */ j($t, [["render", kt]]), Ct = N({ name: "EliTabelaCelulaNumero", @@ -1577,14 +1577,14 @@ const At = /* @__PURE__ */ j($t, [["render", kt]]), Ct = N({ return { dados: e }; } }); -function Vt(e, a, s, d, c, p) { - var t; - return Y(String((t = e.dados) == null ? void 0 : t.numero).replace(".", ",")); +function Vt(e, a, u, i, c, m) { + var n; + return Y(String((n = e.dados) == null ? void 0 : n.numero).replace(".", ",")); } -const Et = /* @__PURE__ */ j(Ct, [["render", Vt]]), Mt = { +const Et = /* @__PURE__ */ j(Ct, [["render", Vt]]), _t = { textoSimples: At, numero: Et -}, _t = N({ +}, Mt = N({ name: "EliTabelaCelula", props: { celula: { @@ -1594,14 +1594,14 @@ const Et = /* @__PURE__ */ j(Ct, [["render", Vt]]), Mt = { } }, setup(e) { - const a = A(() => e.celula[0]), s = A(() => e.celula[1]), d = A(() => Mt[a.value]), c = A(() => s.value); - return { Componente: d, dadosParaComponente: c }; + const a = A(() => e.celula[0]), u = A(() => e.celula[1]), i = A(() => _t[a.value]), c = A(() => u.value); + return { Componente: i, dadosParaComponente: c }; } }); -function wt(e, a, s, d, c, p) { - return m(), P(ye(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); +function wt(e, a, u, i, c, m) { + return p(), P(ye(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); } -const St = /* @__PURE__ */ j(_t, [["render", wt]]), Bt = N({ +const St = /* @__PURE__ */ j(Mt, [["render", wt]]), Bt = N({ name: "EliTabelaBody", components: { EliTabelaCelula: St, @@ -1627,92 +1627,87 @@ const St = /* @__PURE__ */ j(_t, [["render", wt]]), Bt = N({ possuiAcoes: { type: Function, required: !0 + }, + toggleMenu: { + type: Function, + required: !0 } }, - emits: { - toggleMenu(e) { - return e && typeof e.indice == "number"; + setup() { + function e(i) { + return i === "direita" ? "eli-tabela__celula--direita" : i === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; } - }, - setup(e, { emit: a }) { - function s(t) { - return t === "direita" ? "eli-tabela__celula--direita" : t === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; + function a(i) { + if (i != null) + return typeof i == "number" ? `${i}px` : String(i); } - function d(t) { - if (t != null) - return typeof t == "number" ? `${t}px` : String(t); - } - function c(t) { - if (!Array.isArray(t)) return; - const i = t[0], h = t[1]; - if (i === "textoSimples") - return typeof (h == null ? void 0 : h.texto) == "string" ? h.texto : void 0; - if (i === "numero") - return typeof (h == null ? void 0 : h.numero) == "number" ? String(h.numero) : void 0; - } - function p(t, i) { - a("toggleMenu", { indice: t, evento: i }); + function u(i) { + if (!Array.isArray(i)) return; + const c = i[0], m = i[1]; + if (c === "textoSimples") + return typeof (m == null ? void 0 : m.texto) == "string" ? m.texto : void 0; + if (c === "numero") + return typeof (m == null ? void 0 : m.numero) == "number" ? String(m.numero) : void 0; } return { - obterClasseAlinhamento: s, - obterMaxWidth: d, - obterTooltipCelula: c, - emitToggleMenu: p + obterClasseAlinhamento: e, + obterMaxWidth: a, + obterTooltipCelula: u }; } }), Dt = { class: "eli-tabela__tbody" }, Pt = ["onClick"], Tt = ["title"], Ot = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"]; -function qt(e, a, s, d, c, p) { - const t = H("EliTabelaCelula"), i = H("MoreVertical"); - return m(), k("tbody", Dt, [ - (m(!0), k(K, null, ee(e.linhas, (h, n) => (m(), k("tr", { - key: `tr-${n}`, - class: se(["eli-tabela__tr", [n % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) +function qt(e, a, u, i, c, m) { + const n = H("EliTabelaCelula"), s = H("MoreVertical"); + return p(), k("tbody", Dt, [ + (p(!0), k(K, null, ee(e.linhas, ($, r) => (p(), k("tr", { + key: `tr-${r}`, + class: se(["eli-tabela__tr", [r % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) }, [ - (m(!0), k(K, null, ee(e.colunas, (g, y) => (m(), k("td", { - key: `td-${n}-${y}`, + (p(!0), k(K, null, ee(e.colunas, (h, g) => (p(), k("td", { + key: `td-${r}-${g}`, class: se(["eli-tabela__td", [ - g.acao ? "eli-tabela__td--clicavel" : void 0, - e.obterClasseAlinhamento(g.alinhamento) + h.acao ? "eli-tabela__td--clicavel" : void 0, + e.obterClasseAlinhamento(h.alinhamento) ]]), - onClick: (T) => g.acao ? () => { - var $; - return ($ = g.acao) == null ? void 0 : $.call(g); + onClick: (T) => h.acao ? () => { + var y; + return (y = h.acao) == null ? void 0 : y.call(h); } : void 0 }, [ - g.truncar ? (m(), k("span", { + h.truncar ? (p(), k("span", { key: 0, class: "eli-tabela__celula-conteudo", - style: ge(g.largura_maxima ? { maxWidth: e.obterMaxWidth(g.largura_maxima) } : void 0), - title: e.obterTooltipCelula(g.celula(h)) + style: ge(h.largura_maxima ? { maxWidth: e.obterMaxWidth(h.largura_maxima) } : void 0), + title: e.obterTooltipCelula(h.celula($)) }, [ - V(t, { - celula: g.celula(h) + V(n, { + celula: h.celula($) }, null, 8, ["celula"]) - ], 12, Tt)) : (m(), P(t, { + ], 12, Tt)) : (p(), P(n, { key: 1, - celula: g.celula(h) + celula: h.celula($) }, null, 8, ["celula"])) ], 10, Pt))), 128)), - e.temAcoes ? (m(), k("td", { + e.temAcoes ? (p(), k("td", { class: "eli-tabela__td eli-tabela__td--acoes", - key: `td-${n}-acoes` + key: `td-${r}-acoes` }, [ B("div", { - class: se(["eli-tabela__acoes-container", [e.menuAberto === n ? "eli-tabela__acoes-container--aberto" : void 0]]) + class: se(["eli-tabela__acoes-container", [e.menuAberto === r ? "eli-tabela__acoes-container--aberto" : void 0]]) }, [ B("button", { class: "eli-tabela__acoes-toggle", type: "button", - id: `eli-tabela-acoes-toggle-${n}`, - disabled: !e.possuiAcoes(n), + id: `eli-tabela-acoes-toggle-${r}`, + disabled: !e.possuiAcoes(r), "aria-haspopup": "menu", - "aria-expanded": e.menuAberto === n ? "true" : "false", - "aria-controls": e.possuiAcoes(n) ? `eli-tabela-acoes-menu-${n}` : void 0, - "aria-label": e.possuiAcoes(n) ? "Ações da linha" : "Nenhuma ação disponível", - title: e.possuiAcoes(n) ? "Ações" : "Nenhuma ação disponível", - onClick: De((g) => e.emitToggleMenu(n, g), ["stop"]) + "aria-expanded": e.menuAberto === r ? "true" : "false", + "aria-controls": e.possuiAcoes(r) ? `eli-tabela-acoes-menu-${r}` : void 0, + "aria-label": e.possuiAcoes(r) ? "Ações da linha" : "Nenhuma ação disponível", + title: e.possuiAcoes(r) ? "Ações" : "Nenhuma ação disponível", + onClick: De((h) => e.toggleMenu(r, h), ["stop"]) }, [ - V(i, { + V(s, { class: "eli-tabela__acoes-toggle-icone", size: 18, "stroke-width": 2 @@ -1749,19 +1744,19 @@ const It = /* @__PURE__ */ j(Bt, [["render", qt]]), Ut = N({ return e !== null && typeof e == "object"; } }, - setup(e, { emit: a, expose: s }) { - const d = w(null); - s({ menuEl: d }); + setup(e, { emit: a, expose: u }) { + const i = w(null); + u({ menuEl: i }); const c = A(() => e.acoes.length > 0); - function p(t) { - e.linha && a("executar", { acao: t.acao, linha: e.linha }); + function m(n) { + e.linha && a("executar", { acao: n.acao, linha: e.linha }); } - return { menuEl: d, possuiAcoes: c, emitExecutar: p }; + return { menuEl: i, possuiAcoes: c, emitExecutar: m }; } }), Nt = ["id", "aria-labelledby"], jt = ["aria-label", "title", "onClick"], zt = { class: "eli-tabela__acoes-item-texto" }; -function Lt(e, a, s, d, c, p) { - return m(), P(Re, { to: "body" }, [ - e.menuAberto !== null && e.possuiAcoes ? (m(), k("ul", { +function Lt(e, a, u, i, c, m) { + return p(), P(Re, { to: "body" }, [ + e.menuAberto !== null && e.possuiAcoes ? (p(), k("ul", { key: 0, id: `eli-tabela-acoes-menu-${e.menuAberto}`, ref: "menuEl", @@ -1775,26 +1770,26 @@ function Lt(e, a, s, d, c, p) { zIndex: 999999 }) }, [ - (m(!0), k(K, null, ee(e.acoes, (t) => (m(), k("li", { - key: `acao-${e.menuAberto}-${t.indice}`, + (p(!0), k(K, null, ee(e.acoes, (n) => (p(), k("li", { + key: `acao-${e.menuAberto}-${n.indice}`, class: "eli-tabela__acoes-item", role: "none" }, [ B("button", { type: "button", class: "eli-tabela__acoes-item-botao", - style: ge({ color: t.acao.cor }), + style: ge({ color: n.acao.cor }), role: "menuitem", - "aria-label": t.acao.rotulo, - title: t.acao.rotulo, - onClick: De((i) => e.emitExecutar(t), ["stop"]) + "aria-label": n.acao.rotulo, + title: n.acao.rotulo, + onClick: De((s) => e.emitExecutar(n), ["stop"]) }, [ - (m(), P(ye(t.acao.icone), { + (p(), P(ye(n.acao.icone), { class: "eli-tabela__acoes-item-icone", size: 16, "stroke-width": 2 })), - B("span", zt, Y(t.acao.rotulo), 1) + B("span", zt, Y(n.acao.rotulo), 1) ], 12, jt) ]))), 128)) ], 12, Nt)) : J("", !0) @@ -1822,45 +1817,45 @@ const Ht = /* @__PURE__ */ j(Ut, [["render", Lt]]), Yt = N({ } }, setup(e, { emit: a }) { - const s = A(() => { - const n = e.maximoBotoes; - return typeof n == "number" && n >= 5 ? Math.floor(n) : 7; - }), d = A(() => { - const n = e.totalPaginas, g = e.pagina, y = s.value, T = [], $ = (L) => { + const u = A(() => { + const r = e.maximoBotoes; + return typeof r == "number" && r >= 5 ? Math.floor(r) : 7; + }), i = A(() => { + const r = e.totalPaginas, h = e.pagina, g = u.value, T = [], y = (L) => { T.push({ label: String(L), pagina: L, - ativo: L === g + ativo: L === h }); - }, O = () => { + }, q = () => { T.push({ label: "…", ehEllipsis: !0 }); }; - if (n <= y) { - for (let L = 1; L <= n; L += 1) - $(L); + if (r <= g) { + for (let L = 1; L <= r; L += 1) + y(L); return T; } - const M = Math.max(3, y - 2); - let Q = Math.max(2, g - Math.floor(M / 2)), x = Q + M - 1; - x >= n && (x = n - 1, Q = x - M + 1), $(1), Q > 2 && O(); + const _ = Math.max(3, g - 2); + let Q = Math.max(2, h - Math.floor(_ / 2)), x = Q + _ - 1; + x >= r && (x = r - 1, Q = x - _ + 1), y(1), Q > 2 && q(); for (let L = Q; L <= x; L += 1) - $(L); - return x < n - 1 && O(), $(n), T; + y(L); + return x < r - 1 && q(), y(r), T; }); - function c(n) { - if (!n) + function c(r) { + if (!r) return; - const g = Math.min(Math.max(1, n), e.totalPaginas); - g !== e.pagina && a("alterar", g); + const h = Math.min(Math.max(1, r), e.totalPaginas); + h !== e.pagina && a("alterar", h); } - const p = A(() => e.pagina <= 1), t = A(() => e.pagina >= e.totalPaginas), i = A(() => e.pagina), h = A(() => e.totalPaginas); + const m = A(() => e.pagina <= 1), n = A(() => e.pagina >= e.totalPaginas), s = A(() => e.pagina), $ = A(() => e.totalPaginas); return { - botoes: d, + botoes: i, irParaPagina: c, - anteriorDesabilitado: p, - proximaDesabilitada: t, - paginaAtual: i, - totalPaginasExibidas: h + anteriorDesabilitado: m, + proximaDesabilitada: n, + paginaAtual: s, + totalPaginasExibidas: $ }; } }), Ft = { @@ -1873,34 +1868,34 @@ const Ht = /* @__PURE__ */ j(Ut, [["render", Lt]]), Yt = N({ class: "eli-tabela__pagina-ellipsis", "aria-hidden": "true" }, Jt = ["disabled", "aria-current", "aria-label", "onClick"], Zt = ["disabled"]; -function Xt(e, a, s, d, c, p) { - return e.totalPaginasExibidas > 1 ? (m(), k("nav", Ft, [ +function Xt(e, a, u, i, c, m) { + return e.totalPaginasExibidas > 1 ? (p(), k("nav", Ft, [ B("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.anteriorDesabilitado, "aria-label": "Página anterior", - onClick: a[0] || (a[0] = (t) => e.irParaPagina(e.paginaAtual - 1)) + onClick: a[0] || (a[0] = (n) => e.irParaPagina(e.paginaAtual - 1)) }, " << ", 8, Rt), - (m(!0), k(K, null, ee(e.botoes, (t, i) => (m(), k(K, { - key: `${t.label}-${i}` + (p(!0), k(K, null, ee(e.botoes, (n, s) => (p(), k(K, { + key: `${n.label}-${s}` }, [ - t.ehEllipsis ? (m(), k("span", Wt, Y(t.label), 1)) : (m(), k("button", { + n.ehEllipsis ? (p(), k("span", Wt, Y(n.label), 1)) : (p(), k("button", { key: 1, type: "button", - class: se(["eli-tabela__pagina-botao", t.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), - disabled: t.ativo, - "aria-current": t.ativo ? "page" : void 0, - "aria-label": `Ir para página ${t.label}`, - onClick: (h) => e.irParaPagina(t.pagina) - }, Y(t.label), 11, Jt)) + class: se(["eli-tabela__pagina-botao", n.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + disabled: n.ativo, + "aria-current": n.ativo ? "page" : void 0, + "aria-label": `Ir para página ${n.label}`, + onClick: ($) => e.irParaPagina(n.pagina) + }, Y(n.label), 11, Jt)) ], 64))), 128)), B("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.proximaDesabilitada, "aria-label": "Próxima página", - onClick: a[1] || (a[1] = (t) => e.irParaPagina(e.paginaAtual + 1)) + onClick: a[1] || (a[1] = (n) => e.irParaPagina(e.paginaAtual + 1)) }, " >> ", 8, Zt) ])) : J("", !0); } @@ -1924,104 +1919,104 @@ const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455 } }, setup(e) { - const s = w(!1), d = w(null), c = w([]), p = w(0), t = w([]), i = w(null), h = w(null), n = w({ top: 0, left: 0 }), g = w(""), y = w(1), T = w(null), $ = w("asc"), O = A(() => e.tabela), M = A(() => !!e.tabela.mostrarCaixaDeBusca), Q = A(() => e.tabela.acoesTabela ?? []), x = A(() => Q.value.length > 0), L = A(() => { - const o = e.tabela.registros_por_consulta; - return typeof o == "number" && o > 0 ? Math.floor(o) : 10; + const u = w(!1), i = w(null), c = w([]), m = w(0), n = w([]), s = w(null), $ = w(null), r = w({ top: 0, left: 0 }), h = w(""), g = w(1), T = w(null), y = w("asc"), q = A(() => e.tabela), _ = A(() => !!e.tabela.mostrarCaixaDeBusca), Q = A(() => e.tabela.acoesTabela ?? []), x = A(() => Q.value.length > 0), L = A(() => { + const t = e.tabela.registros_por_consulta; + return typeof t == "number" && t > 0 ? Math.floor(t) : 10; }), re = A(() => { - const o = L.value; - if (!o || o <= 0) return 1; - const r = p.value; - return r ? Math.max(1, Math.ceil(r / o)) : 1; + const t = L.value; + if (!t || t <= 0) return 1; + const o = m.value; + return o ? Math.max(1, Math.ceil(o / t)) : 1; }), ke = A(() => (e.tabela.acoesLinha ?? []).length > 0); let Z = 0; - function X(o) { - var _, S, D, U, F, W; - const r = o.getBoundingClientRect(), u = 8, l = ((D = (S = (_ = h.value) == null ? void 0 : _.menuEl) == null ? void 0 : S.value) == null ? void 0 : D.offsetHeight) ?? 0, v = ((W = (F = (U = h.value) == null ? void 0 : U.menuEl) == null ? void 0 : F.value) == null ? void 0 : W.offsetWidth) ?? 180; - let b = r.bottom + u; - const C = r.right - v; - l && b + l > window.innerHeight - u && (b = r.top - u - l), n.value = { - top: Math.max(u, Math.round(b)), - left: Math.max(u, Math.round(C)) + function X(t) { + var M, S, D, U, F, W; + const o = t.getBoundingClientRect(), d = 8, l = ((D = (S = (M = $.value) == null ? void 0 : M.menuEl) == null ? void 0 : S.value) == null ? void 0 : D.offsetHeight) ?? 0, v = ((W = (F = (U = $.value) == null ? void 0 : U.menuEl) == null ? void 0 : F.value) == null ? void 0 : W.offsetWidth) ?? 180; + let b = o.bottom + d; + const C = o.right - v; + l && b + l > window.innerHeight - d && (b = o.top - d - l), r.value = { + top: Math.max(d, Math.round(b)), + left: Math.max(d, Math.round(C)) }; } - function ue(o) { - var u, l; - if (i.value === null) return; - const r = o.target; - (l = (u = h.value) == null ? void 0 : u.menuEl) != null && l.value && h.value.menuEl.value.contains(r) || (i.value = null); + function ue(t) { + var d, l; + if (s.value === null) return; + const o = t.target; + (l = (d = $.value) == null ? void 0 : d.menuEl) != null && l.value && $.value.menuEl.value.contains(o) || (s.value = null); } - function de(o) { - if (o) { - if (T.value === o) { - $.value = $.value === "asc" ? "desc" : "asc", f(); + function de(t) { + if (t) { + if (T.value === t) { + y.value = y.value === "asc" ? "desc" : "asc", f(); return; } - T.value = o, $.value = "asc", y.value !== 1 ? y.value = 1 : f(); + T.value = t, y.value = "asc", g.value !== 1 ? g.value = 1 : f(); } } - function ne(o) { - g.value !== o && (g.value = o, y.value !== 1 ? y.value = 1 : f()); + function ne(t) { + h.value !== t && (h.value = t, g.value !== 1 ? g.value = 1 : f()); } - function q(o) { - const r = Math.min(Math.max(1, o), re.value); - r !== y.value && (y.value = r); + function O(t) { + const o = Math.min(Math.max(1, t), re.value); + o !== g.value && (g.value = o); } - function E(o) { - const r = e.tabela.acoesLinha ?? [], u = t.value[o] ?? []; - return r.map((l, v) => { + function E(t) { + const o = e.tabela.acoesLinha ?? [], d = n.value[t] ?? []; + return o.map((l, v) => { const b = l.exibir === void 0 ? !0 : typeof l.exibir == "boolean" ? l.exibir : !1; return { acao: l, indice: v, - visivel: u[v] ?? b + visivel: d[v] ?? b }; }).filter((l) => l.visivel); } - function ae(o) { - return E(o).length > 0; + function ae(t) { + return E(t).length > 0; } - function fe(o, r) { - if (!ae(o)) return; - if (i.value === o) { - i.value = null; + function fe(t, o) { + if (!ae(t)) return; + if (s.value === t) { + s.value = null; return; } - i.value = o; - const u = (r == null ? void 0 : r.currentTarget) ?? null; - u && (X(u), requestAnimationFrame(() => X(u))); + s.value = t; + const d = (o == null ? void 0 : o.currentTarget) ?? null; + d && (X(d), requestAnimationFrame(() => X(d))); } async function f() { var v, b; - const o = ++Z; - s.value = !0, d.value = null, t.value = [], i.value = null; - const r = Math.max(1, L.value), l = { - offSet: (y.value - 1) * r, - limit: r + const t = ++Z; + u.value = !0, i.value = null, n.value = [], s.value = null; + const o = Math.max(1, L.value), l = { + offSet: (g.value - 1) * o, + limit: o }; - g.value && (l.texto_busca = g.value), T.value && (l.coluna_ordem = T.value, l.direcao_ordem = $.value); + h.value && (l.texto_busca = h.value), T.value && (l.coluna_ordem = T.value, l.direcao_ordem = y.value); try { - const C = e.tabela, _ = await C.consulta(l); - if (o !== Z) return; - if (_.cod !== ze.sucesso) { - c.value = [], p.value = 0, d.value = _.mensagem; + const C = e.tabela, M = await C.consulta(l); + if (t !== Z) return; + if (M.cod !== ze.sucesso) { + c.value = [], m.value = 0, i.value = M.mensagem; return; } - const S = ((v = _.valor) == null ? void 0 : v.valores) ?? [], D = ((b = _.valor) == null ? void 0 : b.quantidade) ?? S.length; - c.value = S, p.value = D; - const U = Math.max(1, Math.ceil((D || 0) / r)); - if (y.value > U) { - y.value = U; + const S = ((v = M.valor) == null ? void 0 : v.valores) ?? [], D = ((b = M.valor) == null ? void 0 : b.quantidade) ?? S.length; + c.value = S, m.value = D; + const U = Math.max(1, Math.ceil((D || 0) / o)); + if (g.value > U) { + g.value = U; return; } const F = C.acoesLinha ?? []; if (!F.length) { - t.value = []; + n.value = []; return; } const W = S.map( () => F.map((R) => R.exibir === void 0 ? !0 : typeof R.exibir == "boolean" ? R.exibir : !1) ); - t.value = W; + n.value = W; const te = await Promise.all( S.map( async (R) => Promise.all( @@ -2038,12 +2033,12 @@ const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455 ) ) ); - o === Z && (t.value = te); + t === Z && (n.value = te); } catch (C) { - if (o !== Z) return; - c.value = [], p.value = 0, d.value = C instanceof Error ? C.message : "Erro ao carregar dados."; + if (t !== Z) return; + c.value = [], m.value = 0, i.value = C instanceof Error ? C.message : "Erro ao carregar dados."; } finally { - o === Z && (s.value = !1); + t === Z && (u.value = !1); } } return We(() => { @@ -2052,70 +2047,70 @@ const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455 document.removeEventListener("click", ue); }), le( () => e.tabela.mostrarCaixaDeBusca, - (o) => { - !o && g.value && (g.value = "", y.value !== 1 ? y.value = 1 : f()); + (t) => { + !t && h.value && (h.value = "", g.value !== 1 ? g.value = 1 : f()); } - ), le(y, (o, r) => { - o !== r && f(); + ), le(g, (t, o) => { + t !== o && f(); }), le( () => e.tabela, () => { - i.value = null, T.value = null, $.value = "asc", g.value = "", y.value !== 1 ? y.value = 1 : f(); + s.value = null, T.value = null, y.value = "asc", h.value = "", g.value !== 1 ? g.value = 1 : f(); } ), le( () => e.tabela.registros_por_consulta, () => { - y.value !== 1 ? y.value = 1 : f(); + g.value !== 1 ? g.value = 1 : f(); } ), le(c, () => { - i.value = null; + s.value = null; }), { // state isDev: !1, - tabela: O, - carregando: s, - erro: d, + tabela: q, + carregando: u, + erro: i, linhas: c, - quantidade: p, - menuAberto: i, - valorBusca: g, - paginaAtual: y, + quantidade: m, + menuAberto: s, + valorBusca: h, + paginaAtual: g, colunaOrdenacao: T, - direcaoOrdenacao: $, + direcaoOrdenacao: y, totalPaginas: re, // computed - exibirBusca: M, + exibirBusca: _, acoesCabecalho: Q, temAcoesCabecalho: x, temAcoes: ke, // actions alternarOrdenacao: de, atualizarBusca: ne, - irParaPagina: q, + irParaPagina: O, acoesDisponiveisPorLinha: E, possuiAcoes: ae, toggleMenu: fe, // popup - menuPopup: h, - menuPopupPos: n + menuPopup: $, + menuPopupPos: r }; } }), Qt = { class: "eli-tabela" }, xt = { class: "eli-tabela__table" }; -function eo(e, a, s, d, c, p) { - const t = H("EliTabelaDebug"), i = H("EliTabelaEstados"), h = H("EliTabelaCabecalho"), n = H("EliTabelaHead"), g = H("EliTabelaBody"), y = H("EliTabelaMenuAcoes"), T = H("EliTabelaPaginacao"); - return m(), k("div", Qt, [ - V(t, { +function eo(e, a, u, i, c, m) { + const n = H("EliTabelaDebug"), s = H("EliTabelaEstados"), $ = H("EliTabelaCabecalho"), r = H("EliTabelaHead"), h = H("EliTabelaBody"), g = H("EliTabelaMenuAcoes"), T = H("EliTabelaPaginacao"); + return p(), k("div", Qt, [ + V(n, { isDev: e.isDev, menuAberto: e.menuAberto, menuPopupPos: e.menuPopupPos }, null, 8, ["isDev", "menuAberto", "menuPopupPos"]), - e.carregando || e.erro || !e.linhas.length ? (m(), P(i, { + e.carregando || e.erro || !e.linhas.length ? (p(), P(s, { key: 0, carregando: e.carregando, erro: e.erro, mensagemVazio: e.tabela.mensagemVazio - }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (m(), k(K, { key: 1 }, [ - e.exibirBusca || e.temAcoesCabecalho ? (m(), P(h, { + }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (p(), k(K, { key: 1 }, [ + e.exibirBusca || e.temAcoesCabecalho ? (p(), P($, { key: 0, exibirBusca: e.exibirBusca, valorBusca: e.valorBusca, @@ -2123,33 +2118,33 @@ function eo(e, a, s, d, c, p) { onBuscar: e.atualizarBusca }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar"])) : J("", !0), B("table", xt, [ - V(n, { + V(r, { colunas: e.tabela.colunas, temAcoes: e.temAcoes, colunaOrdenacao: e.colunaOrdenacao, direcaoOrdenacao: e.direcaoOrdenacao, onAlternarOrdenacao: e.alternarOrdenacao }, null, 8, ["colunas", "temAcoes", "colunaOrdenacao", "direcaoOrdenacao", "onAlternarOrdenacao"]), - V(g, { + V(h, { colunas: e.tabela.colunas, linhas: e.linhas, temAcoes: e.temAcoes, menuAberto: e.menuAberto, possuiAcoes: e.possuiAcoes, - onToggleMenu: a[0] || (a[0] = ({ indice: $, evento: O }) => e.toggleMenu($, O)) - }, null, 8, ["colunas", "linhas", "temAcoes", "menuAberto", "possuiAcoes"]) + toggleMenu: e.toggleMenu + }, null, 8, ["colunas", "linhas", "temAcoes", "menuAberto", "possuiAcoes", "toggleMenu"]) ]), - V(y, { + V(g, { ref: "menuPopup", menuAberto: e.menuAberto, posicao: e.menuPopupPos, acoes: e.menuAberto === null ? [] : e.acoesDisponiveisPorLinha(e.menuAberto), linha: e.menuAberto === null ? null : e.linhas[e.menuAberto], - onExecutar: a[1] || (a[1] = ({ acao: $, linha: O }) => { - e.menuAberto = null, $.acao(O); + onExecutar: a[0] || (a[0] = ({ acao: y, linha: q }) => { + e.menuAberto = null, y.acao(q); }) }, null, 8, ["menuAberto", "posicao", "acoes", "linha"]), - e.totalPaginas > 1 && e.quantidade > 0 ? (m(), P(T, { + e.totalPaginas > 1 && e.quantidade > 0 ? (p(), P(T, { key: 1, pagina: e.paginaAtual, totalPaginas: e.totalPaginas, @@ -2161,13 +2156,13 @@ function eo(e, a, s, d, c, p) { } const ao = /* @__PURE__ */ j(Kt, [["render", eo]]), bo = { install(e) { - e.component("EliOlaMundo", ka), e.component("EliBotao", Ue), e.component("EliBadge", Ce), e.component("EliInput", je), e.component("EliCartao", Ma), e.component("EliDataHora", Oa), e.component("EliTabela", ao); + e.component("EliOlaMundo", ka), e.component("EliBotao", Ue), e.component("EliBadge", Ce), e.component("EliInput", je), e.component("EliCartao", _a), e.component("EliDataHora", Oa), e.component("EliTabela", ao); } }; export { Ce as EliBadge, Ue as EliBotao, - Ma as EliCartao, + _a as EliCartao, Oa as EliDataHora, je as EliInput, ka as EliOlaMundo, diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index 72e5461..b910557 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1,4 +1,4 @@ -(function(w,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(w=typeof globalThis<"u"?globalThis:w||self,t(w.eli_vue={},w.Vue,w.VBtn,w.VBadge,w.VCheckbox,w.VIcon,w.VRadio,w.VRadioGroup,w.VSelect,w.VTextField,w.VTextarea,w.VCard,w.VGrid))})(this,(function(w,t,Be,Ve,Ce,Ee,Se,we,Ae,se,Me,Y,_e){"use strict";const De=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),N=(e,a)=>{const c=e.__vccOpts||e;for(const[u,m]of a)c[u]=m;return c};function Te(e,a,c,u,m,p){return t.openBlock(),t.createBlock(Be.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const ne=N(De,[["render",Te]]),ce={suave:"4px",pill:"10px"},Ne=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ce?ce[e.radius]:e.radius),c=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),u=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:c,badgeStyle:u}}});function Pe(e,a,c,u,m,p){return e.showBadge?(t.openBlock(),t.createBlock(Ve.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const Q=N(Ne,[["render",Pe],["__scopeId","data-v-de2fbf2f"]]);function Oe(e){return e.replace(/\D+/g,"")}function qe(e){const a=Oe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function Ie(e){return e.replace(/\D+/g,"")}function ze(e){const a=Ie(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function re(e){return e.replace(/\D+/g,"")}function de(e){const a=e.replace(/[^\d,]/g,""),c=a.split(",");return c.length>2?c[0]+","+c.slice(1).join(""):a}function Le(e){return de(e.replace(/%/g,""))}function Ue(e){const a=re(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function je(e){const a=re(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Fe=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:c}){const u=t.ref(!1),m=t.ref(!1),p=t.computed({get:()=>e.modelValue,set:k=>{a("update:modelValue",k),a("change",k)}}),o=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),s=t.computed(()=>e.type==="password"?m.value?"text":"password":"text"),y=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),l=t.computed(()=>e.error?"error":u.value?e.color:void 0);function g(k){const _=k.target;let C=_.value;switch(e.type){case"numericoInteiro":C=re(C);break;case"numericoDecimal":C=de(C);break;case"numericoMoeda":C=Ue(C);break;case"porcentagem":C=Le(C);break;case"telefone":C=ze(C);break;case"cpfCnpj":C=qe(C);break;case"cep":C=je(C);break}_.value=C,a("update:modelValue",C),a("change",C)}function $(){m.value=!m.value}const M=t.computed(()=>(e.options||[]).map(k=>{if(k&&typeof k=="object"&&"value"in k){const C=k.value;return{label:k.label??String(C),value:C,disabled:k.disabled}}const _=k;return{label:String(_),value:_}}));return{attrs:c,value:p,isTextLike:o,inputHtmlType:s,inputMode:y,internalColor:l,showPassword:m,togglePassword:$,onInput:g,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:M}}}),He={class:"eli-input"},Ye={key:4,class:"checkbox-group"};function Re(e,a,c,u,m,p){return t.openBlock(),t.createElementBlock("div",He,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ee.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Me.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value=o),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ae.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value=o),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(we.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=o=>e.value=o),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(Se.VRadio,{key:String(o.value),label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Ye,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(Ce.VCheckbox,{key:String(o.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=s=>e.value=s),label:o.label,value:o.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const le=N(Fe,[["render",Re],["__scopeId","data-v-756cb549"]]),We=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:ne,EliBadge:Q,EliInput:le},setup(){const e=t.ref(""),a=t.ref([]),c=t.ref(""),u=t.ref(""),m=t.ref(""),p=t.ref(""),o=t.ref(""),s=t.ref(""),y=t.ref(""),l=t.ref(""),g=t.ref(""),$=t.ref(null),M=t.ref([]);return{nome:e,email:s,documento:g,estado:a,telefone:u,mensagem:y,senha:l,cor:$,habilidades:M,idade:m,altura:p,cep:c,valor:o}}}),ve={class:"grid-example"};function Ge(e,a,c,u,m,p){const o=t.resolveComponent("EliBadge"),s=t.resolveComponent("EliInput"),y=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(_e.VContainer,null,{default:t.withCtx(()=>[t.createVNode(Y.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(o,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(Y.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",ve,[t.createVNode(s,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=l=>e.nome=l),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=l=>e.idade=l),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=l=>e.altura=l),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=l=>e.valor=l),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=l=>e.telefone=l),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=l=>e.cep=l),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(s,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=l=>e.estado=l),multiple:""},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=l=>e.documento=l),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=l=>e.email=l),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=l=>e.senha=l),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(s,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=l=>e.mensagem=l),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(s,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=l=>e.cor=l),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(s,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=l=>e.habilidades=l),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=l=>e.nome=l),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(Y.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(y,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ue=N(We,[["render",Ge]]),Je=t.defineComponent({name:"EliCartao",components:{EliBadge:Q},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const c=t.computed(()=>e.status),u=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),m=t.computed(()=>`eli-cartao--${e.status}`);function p(){a("clicar",e.status)}return{rotuloStatus:c,corStatus:u,classeStatus:m,onClick:p}}}),Ze={class:"eli-cartao__titulo-texto"},Xe={class:"eli-cartao__status"};function Ke(e,a,c,u,m,p){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(Y.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Ze,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Xe,[t.createVNode(o,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(Y.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(Y.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const me=N(Je,[["render",Ke],["__scopeId","data-v-6c492bd9"]]);function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}},xe=x.exports,pe;function et(){return pe||(pe=1,(function(e,a){(function(c,u){e.exports=u()})(xe,(function(){var c=1e3,u=6e4,m=36e5,p="millisecond",o="second",s="minute",y="hour",l="day",g="week",$="month",M="quarter",k="year",_="date",C="Invalid Date",F=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,H=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(f){var n=["th","st","nd","rd"],r=f%100;return"["+f+(n[(r-20)%10]||n[r]||n[0])+"]"}},v=function(f,n,r){var d=String(f);return!d||d.length>=n?f:""+Array(n+1-d.length).join(r)+f},ie={s:v,z:function(f){var n=-f.utcOffset(),r=Math.abs(n),d=Math.floor(r/60),i=r%60;return(n<=0?"+":"-")+v(d,2,"0")+":"+v(i,2,"0")},m:function f(n,r){if(n.date()1)return f(b[0])}else{var B=n.name;U[B]=n,i=B}return!d&&i&&(L=i),i||!d&&L},D=function(f,n){if(X(f))return f.clone();var r=typeof n=="object"?n:{};return r.date=f,r.args=arguments,new R(r)},V=ie;V.l=G,V.i=X,V.w=function(f,n){return D(f,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var R=(function(){function f(r){this.$L=G(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[Z]=!0}var n=f.prototype;return n.parse=function(r){this.$d=(function(d){var i=d.date,h=d.utc;if(i===null)return new Date(NaN);if(V.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var b=i.match(F);if(b){var B=b[2]-1||0,E=(b[7]||"0").substring(0,3);return h?new Date(Date.UTC(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)):new Date(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)}}return new Date(i)})(r),this.init()},n.init=function(){var r=this.$d;this.$y=r.getFullYear(),this.$M=r.getMonth(),this.$D=r.getDate(),this.$W=r.getDay(),this.$H=r.getHours(),this.$m=r.getMinutes(),this.$s=r.getSeconds(),this.$ms=r.getMilliseconds()},n.$utils=function(){return V},n.isValid=function(){return this.$d.toString()!==C},n.isSame=function(r,d){var i=D(r);return this.startOf(d)<=i&&i<=this.endOf(d)},n.isAfter=function(r,d){return D(r)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:c}){const u=t.computed(()=>e.modo==="data"?"date":"datetime-local");function m(l){return e.modo==="data"?ee(l).format("YYYY-MM-DD"):ee(l).format("YYYY-MM-DDTHH:mm")}function p(l){return e.modo==="data"?ee(`${l}T00:00`).format():ee(l).format()}const o=t.computed({get:()=>e.modelValue?m(e.modelValue):"",set:l=>{const g=l&&l.length>0?l:null;if(!g){a("update:modelValue",null),a("alterar",null);return}const $=p(g);a("update:modelValue",$),a("alterar",$)}}),s=t.computed(()=>{if(e.min)return m(e.min)}),y=t.computed(()=>{if(e.max)return m(e.max)});return{attrs:c,valor:o,emit:a,minLocal:s,maxLocal:y,tipoInput:u}}}),ot={class:"eli-data-hora"};function nt(e,a,c,u,m,p){return t.openBlock(),t.createElementBlock("div",ot,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=o=>e.emit("foco")),onBlur:a[2]||(a[2]=o=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const fe=N(at,[["render",nt],["__scopeId","data-v-71afabb6"]]);var be=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(be||{});/** +(function(w,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(w=typeof globalThis<"u"?globalThis:w||self,t(w.eli_vue={},w.Vue,w.VBtn,w.VBadge,w.VCheckbox,w.VIcon,w.VRadio,w.VRadioGroup,w.VSelect,w.VTextField,w.VTextarea,w.VCard,w.VGrid))})(this,(function(w,t,Be,Ve,Ce,Ee,Se,we,Ae,se,Me,Y,_e){"use strict";const De=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),T=(e,a)=>{const d=e.__vccOpts||e;for(const[s,m]of a)d[s]=m;return d};function Ne(e,a,d,s,m,p){return t.openBlock(),t.createBlock(Be.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const ne=T(De,[["render",Ne]]),ce={suave:"4px",pill:"10px"},Te=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ce?ce[e.radius]:e.radius),d=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),s=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:d,badgeStyle:s}}});function Pe(e,a,d,s,m,p){return e.showBadge?(t.openBlock(),t.createBlock(Ve.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const Q=T(Te,[["render",Pe],["__scopeId","data-v-de2fbf2f"]]);function Oe(e){return e.replace(/\D+/g,"")}function qe(e){const a=Oe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function Ie(e){return e.replace(/\D+/g,"")}function ze(e){const a=Ie(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function re(e){return e.replace(/\D+/g,"")}function de(e){const a=e.replace(/[^\d,]/g,""),d=a.split(",");return d.length>2?d[0]+","+d.slice(1).join(""):a}function Le(e){return de(e.replace(/%/g,""))}function Fe(e){const a=re(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function Ue(e){const a=re(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const je=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:d}){const s=t.ref(!1),m=t.ref(!1),p=t.computed({get:()=>e.modelValue,set:$=>{a("update:modelValue",$),a("change",$)}}),l=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),c=t.computed(()=>e.type==="password"?m.value?"text":"password":"text"),k=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),r=t.computed(()=>e.error?"error":s.value?e.color:void 0);function y($){const D=$.target;let C=D.value;switch(e.type){case"numericoInteiro":C=re(C);break;case"numericoDecimal":C=de(C);break;case"numericoMoeda":C=Fe(C);break;case"porcentagem":C=Le(C);break;case"telefone":C=ze(C);break;case"cpfCnpj":C=qe(C);break;case"cep":C=Ue(C);break}D.value=C,a("update:modelValue",C),a("change",C)}function g(){m.value=!m.value}const M=t.computed(()=>(e.options||[]).map($=>{if($&&typeof $=="object"&&"value"in $){const C=$.value;return{label:$.label??String(C),value:C,disabled:$.disabled}}const D=$;return{label:String(D),value:D}}));return{attrs:d,value:p,isTextLike:l,inputHtmlType:c,inputMode:k,internalColor:r,showPassword:m,togglePassword:g,onInput:y,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:M}}}),He={class:"eli-input"},Ye={key:4,class:"checkbox-group"};function Re(e,a,d,s,m,p){return t.openBlock(),t.createElementBlock("div",He,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ee.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Me.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=l=>e.value=l),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ae.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=l=>e.value=l),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(we.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=l=>e.value=l),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Se.VRadio,{key:String(l.value),label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Ye,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Ce.VCheckbox,{key:String(l.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=c=>e.value=c),label:l.label,value:l.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const le=T(je,[["render",Re],["__scopeId","data-v-756cb549"]]),We=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:ne,EliBadge:Q,EliInput:le},setup(){const e=t.ref(""),a=t.ref([]),d=t.ref(""),s=t.ref(""),m=t.ref(""),p=t.ref(""),l=t.ref(""),c=t.ref(""),k=t.ref(""),r=t.ref(""),y=t.ref(""),g=t.ref(null),M=t.ref([]);return{nome:e,email:c,documento:y,estado:a,telefone:s,mensagem:k,senha:r,cor:g,habilidades:M,idade:m,altura:p,cep:d,valor:l}}}),ve={class:"grid-example"};function Ge(e,a,d,s,m,p){const l=t.resolveComponent("EliBadge"),c=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(_e.VContainer,null,{default:t.withCtx(()=>[t.createVNode(Y.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(l,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(Y.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",ve,[t.createVNode(c,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=r=>e.nome=r),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=r=>e.idade=r),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=r=>e.altura=r),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=r=>e.valor=r),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=r=>e.telefone=r),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=r=>e.cep=r),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(c,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=r=>e.estado=r),multiple:""},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=r=>e.documento=r),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=r=>e.email=r),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=r=>e.senha=r),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(c,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=r=>e.mensagem=r),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(c,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=r=>e.cor=r),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(c,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=r=>e.habilidades=r),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=r=>e.nome=r),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(Y.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(k,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ue=T(We,[["render",Ge]]),Je=t.defineComponent({name:"EliCartao",components:{EliBadge:Q},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const d=t.computed(()=>e.status),s=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),m=t.computed(()=>`eli-cartao--${e.status}`);function p(){a("clicar",e.status)}return{rotuloStatus:d,corStatus:s,classeStatus:m,onClick:p}}}),Ze={class:"eli-cartao__titulo-texto"},Xe={class:"eli-cartao__status"};function Ke(e,a,d,s,m,p){const l=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(Y.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Ze,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Xe,[t.createVNode(l,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(Y.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(Y.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const me=T(Je,[["render",Ke],["__scopeId","data-v-6c492bd9"]]);function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}},xe=x.exports,pe;function et(){return pe||(pe=1,(function(e,a){(function(d,s){e.exports=s()})(xe,(function(){var d=1e3,s=6e4,m=36e5,p="millisecond",l="second",c="minute",k="hour",r="day",y="week",g="month",M="quarter",$="year",D="date",C="Invalid Date",j=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,H=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(f){var o=["th","st","nd","rd"],n=f%100;return"["+f+(o[(n-20)%10]||o[n]||o[0])+"]"}},v=function(f,o,n){var u=String(f);return!u||u.length>=o?f:""+Array(o+1-u.length).join(n)+f},ie={s:v,z:function(f){var o=-f.utcOffset(),n=Math.abs(o),u=Math.floor(n/60),i=n%60;return(o<=0?"+":"-")+v(u,2,"0")+":"+v(i,2,"0")},m:function f(o,n){if(o.date()1)return f(b[0])}else{var B=o.name;F[B]=o,i=B}return!u&&i&&(L=i),i||!u&&L},_=function(f,o){if(X(f))return f.clone();var n=typeof o=="object"?o:{};return n.date=f,n.args=arguments,new R(n)},V=ie;V.l=G,V.i=X,V.w=function(f,o){return _(f,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var R=(function(){function f(n){this.$L=G(n.locale,null,!0),this.parse(n),this.$x=this.$x||n.x||{},this[Z]=!0}var o=f.prototype;return o.parse=function(n){this.$d=(function(u){var i=u.date,h=u.utc;if(i===null)return new Date(NaN);if(V.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var b=i.match(j);if(b){var B=b[2]-1||0,E=(b[7]||"0").substring(0,3);return h?new Date(Date.UTC(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)):new Date(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)}}return new Date(i)})(n),this.init()},o.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},o.$utils=function(){return V},o.isValid=function(){return this.$d.toString()!==C},o.isSame=function(n,u){var i=_(n);return this.startOf(u)<=i&&i<=this.endOf(u)},o.isAfter=function(n,u){return _(n)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:d}){const s=t.computed(()=>e.modo==="data"?"date":"datetime-local");function m(r){return e.modo==="data"?ee(r).format("YYYY-MM-DD"):ee(r).format("YYYY-MM-DDTHH:mm")}function p(r){return e.modo==="data"?ee(`${r}T00:00`).format():ee(r).format()}const l=t.computed({get:()=>e.modelValue?m(e.modelValue):"",set:r=>{const y=r&&r.length>0?r:null;if(!y){a("update:modelValue",null),a("alterar",null);return}const g=p(y);a("update:modelValue",g),a("alterar",g)}}),c=t.computed(()=>{if(e.min)return m(e.min)}),k=t.computed(()=>{if(e.max)return m(e.max)});return{attrs:d,valor:l,emit:a,minLocal:c,maxLocal:k,tipoInput:s}}}),ot={class:"eli-data-hora"};function nt(e,a,d,s,m,p){return t.openBlock(),t.createElementBlock("div",ot,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=l=>e.valor=l),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=l=>e.emit("foco")),onBlur:a[2]||(a[2]=l=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const fe=T(at,[["render",nt],["__scopeId","data-v-71afabb6"]]);var be=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(be||{});/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. @@ -13,7 +13,7 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lt=(...e)=>e.filter((a,c,u)=>!!a&&a.trim()!==""&&u.indexOf(a)===c).join(" ").trim();/** + */const lt=(...e)=>e.filter((a,d,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===d).join(" ").trim();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. @@ -23,7 +23,7 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const it=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,u)=>u?u.toUpperCase():c.toLowerCase());/** + */const it=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,d,s)=>s?s.toUpperCase():d.toLowerCase());/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. @@ -38,12 +38,12 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ct=({name:e,iconNode:a,absoluteStrokeWidth:c,"absolute-stroke-width":u,strokeWidth:m,"stroke-width":p,size:o=J.width,color:s=J.stroke,...y},{slots:l})=>t.h("svg",{...J,...y,width:o,height:o,stroke:s,"stroke-width":he(c)||he(u)||c===!0||u===!0?Number(m||p||J["stroke-width"])*24/Number(o):m||p||J["stroke-width"],class:lt("lucide",y.class,...e?[`lucide-${ye(st(e))}-icon`,`lucide-${ye(e)}`]:["lucide-icon"]),...!l.default&&!rt(y)&&{"aria-hidden":"true"}},[...a.map(g=>t.h(...g)),...l.default?[l.default()]:[]]);/** + */const ct=({name:e,iconNode:a,absoluteStrokeWidth:d,"absolute-stroke-width":s,strokeWidth:m,"stroke-width":p,size:l=J.width,color:c=J.stroke,...k},{slots:r})=>t.h("svg",{...J,...k,width:l,height:l,stroke:c,"stroke-width":he(d)||he(s)||d===!0||s===!0?Number(m||p||J["stroke-width"])*24/Number(l):m||p||J["stroke-width"],class:lt("lucide",k.class,...e?[`lucide-${ye(st(e))}-icon`,`lucide-${ye(e)}`]:["lucide-icon"]),...!r.default&&!rt(k)&&{"aria-hidden":"true"}},[...a.map(y=>t.h(...y)),...r.default?[r.default()]:[]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const te=(e,a)=>(c,{slots:u,attrs:m})=>t.h(ct,{...m,...c,iconNode:a,name:e},u);/** + */const te=(e,a)=>(d,{slots:s,attrs:m})=>t.h(ct,{...m,...d,iconNode:a,name:e},s);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. @@ -63,4 +63,4 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ut=te("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),mt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:ut},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const c=t.ref(e.modelo??"");t.watch(()=>e.modelo,m=>{m!==void 0&&m!==c.value&&(c.value=m)});function u(){a("buscar",c.value.trim())}return{texto:c,emitirBusca:u}}}),pt={class:"eli-tabela__busca"},ft={class:"eli-tabela__busca-input-wrapper"};function bt(e,a,c,u,m,p){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",pt,[t.createElementVNode("div",ft,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=s=>e.texto=s),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...s)=>e.emitirBusca&&e.emitirBusca(...s),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...s)=>e.emitirBusca&&e.emitirBusca(...s))},[t.createVNode(o,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const ht=N(mt,[["render",bt],["__scopeId","data-v-0fd1ad15"]]),yt=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:ht},props:{exibirBusca:{type:Boolean,required:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const c=t.computed(()=>e.acoesCabecalho.length>0);function u(m){a("buscar",m)}return{temAcoesCabecalho:c,emitBuscar:u}}}),gt={class:"eli-tabela__cabecalho"},$t={key:1,class:"eli-tabela__acoes-cabecalho"},kt=["onClick"],Bt={class:"eli-tabela__acoes-cabecalho-rotulo"};function Vt(e,a,c,u,m,p){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",gt,[e.exibirBusca?(t.openBlock(),t.createBlock(o,{key:0,modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",$t,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(s,y)=>(t.openBlock(),t.createElementBlock("button",{key:`${s.rotulo}-${y}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(s.cor?{backgroundColor:s.cor,color:"#fff"}:void 0),onClick:s.acao},[s.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",Bt,t.toDisplayString(s.rotulo),1)],12,kt))),128))])):t.createCommentVNode("",!0)])}const Ct=N(yt,[["render",Vt]]),Et=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),St={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},wt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},At={class:"eli-tabela__erro-mensagem"},Mt={key:2,class:"eli-tabela eli-tabela--vazio"};function _t(e,a,c,u,m,p){return e.carregando?(t.openBlock(),t.createElementBlock("div",St," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",wt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",At,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",Mt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Dt=N(Et,[["render",_t]]),Tt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Nt={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Pt(e,a,c,u,m,p){return e.isDev?(t.openBlock(),t.createElementBlock("div",Nt,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const Ot=N(Tt,[["render",Pt]]),qt=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:$e,ArrowDown:ge},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function c(p){return(p==null?void 0:p.coluna_ordem)!==void 0&&(p==null?void 0:p.coluna_ordem)!==null}function u(p){return p==="direita"?"eli-tabela__celula--direita":p==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function m(p){a("alternarOrdenacao",p)}return{ArrowUp:$e,ArrowDown:ge,isOrdenavel:c,obterClasseAlinhamento:u,emitAlternarOrdenacao:m}}}),It={class:"eli-tabela__thead"},zt={class:"eli-tabela__tr eli-tabela__tr--header"},Lt=["onClick"],Ut={class:"eli-tabela__th-texto"},jt={key:1,class:"eli-tabela__th-label"},Ft={key:0,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function Ht(e,a,c,u,m,p){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",It,[t.createElementVNode("tr",zt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(s,y)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${y}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(s)?"eli-tabela__th--ordenavel":void 0,e.obterClasseAlinhamento(s.alinhamento)]]),scope:"col"},[e.isOrdenavel(s)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(s.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:l=>e.emitAlternarOrdenacao(String(s.coluna_ordem))},[t.createElementVNode("span",Ut,t.toDisplayString(s.rotulo),1),e.colunaOrdenacao===String(s.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(o,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Lt)):(t.openBlock(),t.createElementBlock("span",jt,t.toDisplayString(s.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",Ft," Ações ")):t.createCommentVNode("",!0)])])}const Yt=N(qt,[["render",Ht]]),Rt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Wt(e,a,c,u,m,p){var o;return t.toDisplayString((o=e.dados)==null?void 0:o.texto)}const vt=N(Rt,[["render",Wt]]),Gt=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Jt(e,a,c,u,m,p){var o;return t.toDisplayString(String((o=e.dados)==null?void 0:o.numero).replace(".",","))}const Zt={textoSimples:vt,numero:N(Gt,[["render",Jt]])},Xt=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),c=t.computed(()=>e.celula[1]),u=t.computed(()=>Zt[a.value]),m=t.computed(()=>c.value);return{Componente:u,dadosParaComponente:m}}});function Kt(e,a,c,u,m,p){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const Qt=N(Xt,[["render",Kt]]),xt=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:Qt,MoreVertical:dt},props:{colunas:{type:Array,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0}},emits:{toggleMenu(e){return e&&typeof e.indice=="number"}},setup(e,{emit:a}){function c(o){return o==="direita"?"eli-tabela__celula--direita":o==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function u(o){if(o!=null)return typeof o=="number"?`${o}px`:String(o)}function m(o){if(!Array.isArray(o))return;const s=o[0],y=o[1];if(s==="textoSimples")return typeof(y==null?void 0:y.texto)=="string"?y.texto:void 0;if(s==="numero")return typeof(y==null?void 0:y.numero)=="number"?String(y.numero):void 0}function p(o,s){a("toggleMenu",{indice:o,evento:s})}return{obterClasseAlinhamento:c,obterMaxWidth:u,obterTooltipCelula:m,emitToggleMenu:p}}}),ea={class:"eli-tabela__tbody"},ta=["onClick"],aa=["title"],oa=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"];function na(e,a,c,u,m,p){const o=t.resolveComponent("EliTabelaCelula"),s=t.resolveComponent("MoreVertical");return t.openBlock(),t.createElementBlock("tbody",ea,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(y,l)=>(t.openBlock(),t.createElementBlock("tr",{key:`tr-${l}`,class:t.normalizeClass(["eli-tabela__tr",[l%2===1?"eli-tabela__tr--zebra":void 0]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(g,$)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${l}-${$}`,class:t.normalizeClass(["eli-tabela__td",[g.acao?"eli-tabela__td--clicavel":void 0,e.obterClasseAlinhamento(g.alinhamento)]]),onClick:M=>g.acao?()=>{var k;return(k=g.acao)==null?void 0:k.call(g)}:void 0},[g.truncar?(t.openBlock(),t.createElementBlock("span",{key:0,class:"eli-tabela__celula-conteudo",style:t.normalizeStyle(g.largura_maxima?{maxWidth:e.obterMaxWidth(g.largura_maxima)}:void 0),title:e.obterTooltipCelula(g.celula(y))},[t.createVNode(o,{celula:g.celula(y)},null,8,["celula"])],12,aa)):(t.openBlock(),t.createBlock(o,{key:1,celula:g.celula(y)},null,8,["celula"]))],10,ta))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${l}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===l?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${l}`,disabled:!e.possuiAcoes(l),"aria-haspopup":"menu","aria-expanded":e.menuAberto===l?"true":"false","aria-controls":e.possuiAcoes(l)?`eli-tabela-acoes-menu-${l}`:void 0,"aria-label":e.possuiAcoes(l)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(l)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(g=>e.emitToggleMenu(l,g),["stop"])},[t.createVNode(s,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,oa)],2)])):t.createCommentVNode("",!0)],2))),128))])}const ra=N(xt,[["render",na]]),la=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:c}){const u=t.ref(null);c({menuEl:u});const m=t.computed(()=>e.acoes.length>0);function p(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:u,possuiAcoes:m,emitExecutar:p}}}),ia=["id","aria-labelledby"],sa=["aria-label","title","onClick"],ca={class:"eli-tabela__acoes-item-texto"};function da(e,a,c,u,m,p){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,o=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${o.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:o.acao.cor}),role:"menuitem","aria-label":o.acao.rotulo,title:o.acao.rotulo,onClick:t.withModifiers(s=>e.emitExecutar(o),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ca,t.toDisplayString(o.acao.rotulo),1)],12,sa)]))),128))],12,ia)):t.createCommentVNode("",!0)])}const ua=N(la,[["render",da]]),ma=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const c=t.computed(()=>{const l=e.maximoBotoes;return typeof l=="number"&&l>=5?Math.floor(l):7}),u=t.computed(()=>{const l=e.totalPaginas,g=e.pagina,$=c.value,M=[],k=O=>{M.push({label:String(O),pagina:O,ativo:O===g})},_=()=>{M.push({label:"…",ehEllipsis:!0})};if(l<=$){for(let O=1;O<=l;O+=1)k(O);return M}const C=Math.max(3,$-2);let F=Math.max(2,g-Math.floor(C/2)),H=F+C-1;H>=l&&(H=l-1,F=H-C+1),k(1),F>2&&_();for(let O=F;O<=H;O+=1)k(O);return He.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),s=t.computed(()=>e.pagina),y=t.computed(()=>e.totalPaginas);return{botoes:u,irParaPagina:m,anteriorDesabilitado:p,proximaDesabilitada:o,paginaAtual:s,totalPaginasExibidas:y}}}),pa={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},fa=["disabled"],ba={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},ha=["disabled","aria-current","aria-label","onClick"],ya=["disabled"];function ga(e,a,c,u,m,p){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",pa,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=o=>e.irParaPagina(e.paginaAtual-1))}," << ",8,fa),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(o,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${s}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",ba,t.toDisplayString(o.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",o.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:o.ativo,"aria-current":o.ativo?"page":void 0,"aria-label":`Ir para página ${o.label}`,onClick:y=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,ha))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=o=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,ya)])):t.createCommentVNode("",!0)}const $a=N(ma,[["render",ga],["__scopeId","data-v-59d12455"]]),ka=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ct,EliTabelaEstados:Dt,EliTabelaDebug:Ot,EliTabelaHead:Yt,EliTabelaBody:ra,EliTabelaMenuAcoes:ua,EliTabelaPaginacao:$a},props:{tabela:{type:Object,required:!0}},setup(e){const c=t.ref(!1),u=t.ref(null),m=t.ref([]),p=t.ref(0),o=t.ref([]),s=t.ref(null),y=t.ref(null),l=t.ref({top:0,left:0}),g=t.ref(""),$=t.ref(1),M=t.ref(null),k=t.ref("asc"),_=t.computed(()=>e.tabela),C=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),F=t.computed(()=>e.tabela.acoesTabela??[]),H=t.computed(()=>F.value.length>0),O=t.computed(()=>{const n=e.tabela.registros_por_consulta;return typeof n=="number"&&n>0?Math.floor(n):10}),v=t.computed(()=>{const n=O.value;if(!n||n<=0)return 1;const r=p.value;return r?Math.max(1,Math.ceil(r/n)):1}),ie=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let L=0;function U(n){var E,S,A,P,q,z;const r=n.getBoundingClientRect(),d=8,i=((A=(S=(E=y.value)==null?void 0:E.menuEl)==null?void 0:S.value)==null?void 0:A.offsetHeight)??0,h=((z=(q=(P=y.value)==null?void 0:P.menuEl)==null?void 0:q.value)==null?void 0:z.offsetWidth)??180;let b=r.bottom+d;const B=r.right-h;i&&b+i>window.innerHeight-d&&(b=r.top-d-i),l.value={top:Math.max(d,Math.round(b)),left:Math.max(d,Math.round(B))}}function Z(n){var d,i;if(s.value===null)return;const r=n.target;(i=(d=y.value)==null?void 0:d.menuEl)!=null&&i.value&&y.value.menuEl.value.contains(r)||(s.value=null)}function X(n){if(n){if(M.value===n){k.value=k.value==="asc"?"desc":"asc",f();return}M.value=n,k.value="asc",$.value!==1?$.value=1:f()}}function G(n){g.value!==n&&(g.value=n,$.value!==1?$.value=1:f())}function D(n){const r=Math.min(Math.max(1,n),v.value);r!==$.value&&($.value=r)}function V(n){const r=e.tabela.acoesLinha??[],d=o.value[n]??[];return r.map((i,h)=>{const b=i.exibir===void 0?!0:typeof i.exibir=="boolean"?i.exibir:!1;return{acao:i,indice:h,visivel:d[h]??b}}).filter(i=>i.visivel)}function R(n){return V(n).length>0}function ae(n,r){if(!R(n))return;if(s.value===n){s.value=null;return}s.value=n;const d=(r==null?void 0:r.currentTarget)??null;d&&(U(d),requestAnimationFrame(()=>U(d)))}async function f(){var h,b;const n=++L;c.value=!0,u.value=null,o.value=[],s.value=null;const r=Math.max(1,O.value),i={offSet:($.value-1)*r,limit:r};g.value&&(i.texto_busca=g.value),M.value&&(i.coluna_ordem=M.value,i.direcao_ordem=k.value);try{const B=e.tabela,E=await B.consulta(i);if(n!==L)return;if(E.cod!==be.sucesso){m.value=[],p.value=0,u.value=E.mensagem;return}const S=((h=E.valor)==null?void 0:h.valores)??[],A=((b=E.valor)==null?void 0:b.quantidade)??S.length;m.value=S,p.value=A;const P=Math.max(1,Math.ceil((A||0)/r));if($.value>P){$.value=P;return}const q=B.acoesLinha??[];if(!q.length){o.value=[];return}const z=S.map(()=>q.map(I=>I.exibir===void 0?!0:typeof I.exibir=="boolean"?I.exibir:!1));o.value=z;const W=await Promise.all(S.map(async I=>Promise.all(q.map(async T=>{if(T.exibir===void 0)return!0;if(typeof T.exibir=="boolean")return T.exibir;try{const j=T.exibir(I);return!!await Promise.resolve(j)}catch{return!1}}))));n===L&&(o.value=W)}catch(B){if(n!==L)return;m.value=[],p.value=0,u.value=B instanceof Error?B.message:"Erro ao carregar dados."}finally{n===L&&(c.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Z),f()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Z)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,n=>{!n&&g.value&&(g.value="",$.value!==1?$.value=1:f())}),t.watch($,(n,r)=>{n!==r&&f()}),t.watch(()=>e.tabela,()=>{s.value=null,M.value=null,k.value="asc",g.value="",$.value!==1?$.value=1:f()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{$.value!==1?$.value=1:f()}),t.watch(m,()=>{s.value=null}),{isDev:!1,tabela:_,carregando:c,erro:u,linhas:m,quantidade:p,menuAberto:s,valorBusca:g,paginaAtual:$,colunaOrdenacao:M,direcaoOrdenacao:k,totalPaginas:v,exibirBusca:C,acoesCabecalho:F,temAcoesCabecalho:H,temAcoes:ie,alternarOrdenacao:X,atualizarBusca:G,irParaPagina:D,acoesDisponiveisPorLinha:V,possuiAcoes:R,toggleMenu:ae,menuPopup:y,menuPopupPos:l}}}),Ba={class:"eli-tabela"},Va={class:"eli-tabela__table"};function Ca(e,a,c,u,m,p){const o=t.resolveComponent("EliTabelaDebug"),s=t.resolveComponent("EliTabelaEstados"),y=t.resolveComponent("EliTabelaCabecalho"),l=t.resolveComponent("EliTabelaHead"),g=t.resolveComponent("EliTabelaBody"),$=t.resolveComponent("EliTabelaMenuAcoes"),M=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",Ba,[t.createVNode(o,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(s,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(y,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar"])):t.createCommentVNode("",!0),t.createElementVNode("table",Va,[t.createVNode(l,{colunas:e.tabela.colunas,temAcoes:e.temAcoes,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(g,{colunas:e.tabela.colunas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,onToggleMenu:a[0]||(a[0]=({indice:k,evento:_})=>e.toggleMenu(k,_))},null,8,["colunas","linhas","temAcoes","menuAberto","possuiAcoes"])]),t.createVNode($,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[1]||(a[1]=({acao:k,linha:_})=>{e.menuAberto=null,k.acao(_)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(M,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const ke=N(ka,[["render",Ca]]),Ea={install(e){e.component("EliOlaMundo",ue),e.component("EliBotao",ne),e.component("EliBadge",Q),e.component("EliInput",le),e.component("EliCartao",me),e.component("EliDataHora",fe),e.component("EliTabela",ke)}};w.EliBadge=Q,w.EliBotao=ne,w.EliCartao=me,w.EliDataHora=fe,w.EliInput=le,w.EliOlaMundo=ue,w.EliTabela=ke,w.default=Ea,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); + */const ut=te("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),mt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:ut},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.ref(e.modelo??"");t.watch(()=>e.modelo,m=>{m!==void 0&&m!==d.value&&(d.value=m)});function s(){a("buscar",d.value.trim())}return{texto:d,emitirBusca:s}}}),pt={class:"eli-tabela__busca"},ft={class:"eli-tabela__busca-input-wrapper"};function bt(e,a,d,s,m,p){const l=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",pt,[t.createElementVNode("div",ft,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=c=>e.texto=c),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...c)=>e.emitirBusca&&e.emitirBusca(...c),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...c)=>e.emitirBusca&&e.emitirBusca(...c))},[t.createVNode(l,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const ht=T(mt,[["render",bt],["__scopeId","data-v-0fd1ad15"]]),yt=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:ht},props:{exibirBusca:{type:Boolean,required:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.computed(()=>e.acoesCabecalho.length>0);function s(m){a("buscar",m)}return{temAcoesCabecalho:d,emitBuscar:s}}}),gt={class:"eli-tabela__cabecalho"},$t={key:1,class:"eli-tabela__acoes-cabecalho"},kt=["onClick"],Bt={class:"eli-tabela__acoes-cabecalho-rotulo"};function Vt(e,a,d,s,m,p){const l=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",gt,[e.exibirBusca?(t.openBlock(),t.createBlock(l,{key:0,modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",$t,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(c,k)=>(t.openBlock(),t.createElementBlock("button",{key:`${c.rotulo}-${k}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(c.cor?{backgroundColor:c.cor,color:"#fff"}:void 0),onClick:c.acao},[c.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(c.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",Bt,t.toDisplayString(c.rotulo),1)],12,kt))),128))])):t.createCommentVNode("",!0)])}const Ct=T(yt,[["render",Vt]]),Et=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),St={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},wt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},At={class:"eli-tabela__erro-mensagem"},Mt={key:2,class:"eli-tabela eli-tabela--vazio"};function _t(e,a,d,s,m,p){return e.carregando?(t.openBlock(),t.createElementBlock("div",St," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",wt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",At,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",Mt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Dt=T(Et,[["render",_t]]),Nt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Tt={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Pt(e,a,d,s,m,p){return e.isDev?(t.openBlock(),t.createElementBlock("div",Tt,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const Ot=T(Nt,[["render",Pt]]),qt=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:$e,ArrowDown:ge},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function d(p){return(p==null?void 0:p.coluna_ordem)!==void 0&&(p==null?void 0:p.coluna_ordem)!==null}function s(p){return p==="direita"?"eli-tabela__celula--direita":p==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function m(p){a("alternarOrdenacao",p)}return{ArrowUp:$e,ArrowDown:ge,isOrdenavel:d,obterClasseAlinhamento:s,emitAlternarOrdenacao:m}}}),It={class:"eli-tabela__thead"},zt={class:"eli-tabela__tr eli-tabela__tr--header"},Lt=["onClick"],Ft={class:"eli-tabela__th-texto"},Ut={key:1,class:"eli-tabela__th-label"},jt={key:0,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function Ht(e,a,d,s,m,p){const l=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",It,[t.createElementVNode("tr",zt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(c,k)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${k}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(c)?"eli-tabela__th--ordenavel":void 0,e.obterClasseAlinhamento(c.alinhamento)]]),scope:"col"},[e.isOrdenavel(c)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(c.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:r=>e.emitAlternarOrdenacao(String(c.coluna_ordem))},[t.createElementVNode("span",Ft,t.toDisplayString(c.rotulo),1),e.colunaOrdenacao===String(c.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(l,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Lt)):(t.openBlock(),t.createElementBlock("span",Ut,t.toDisplayString(c.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",jt," Ações ")):t.createCommentVNode("",!0)])])}const Yt=T(qt,[["render",Ht]]),Rt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Wt(e,a,d,s,m,p){var l;return t.toDisplayString((l=e.dados)==null?void 0:l.texto)}const vt=T(Rt,[["render",Wt]]),Gt=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Jt(e,a,d,s,m,p){var l;return t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",","))}const Zt={textoSimples:vt,numero:T(Gt,[["render",Jt]])},Xt=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),d=t.computed(()=>e.celula[1]),s=t.computed(()=>Zt[a.value]),m=t.computed(()=>d.value);return{Componente:s,dadosParaComponente:m}}});function Kt(e,a,d,s,m,p){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const Qt=T(Xt,[["render",Kt]]),xt=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:Qt,MoreVertical:dt},props:{colunas:{type:Array,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0},toggleMenu:{type:Function,required:!0}},setup(){function e(s){return s==="direita"?"eli-tabela__celula--direita":s==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function a(s){if(s!=null)return typeof s=="number"?`${s}px`:String(s)}function d(s){if(!Array.isArray(s))return;const m=s[0],p=s[1];if(m==="textoSimples")return typeof(p==null?void 0:p.texto)=="string"?p.texto:void 0;if(m==="numero")return typeof(p==null?void 0:p.numero)=="number"?String(p.numero):void 0}return{obterClasseAlinhamento:e,obterMaxWidth:a,obterTooltipCelula:d}}}),ea={class:"eli-tabela__tbody"},ta=["onClick"],aa=["title"],oa=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"];function na(e,a,d,s,m,p){const l=t.resolveComponent("EliTabelaCelula"),c=t.resolveComponent("MoreVertical");return t.openBlock(),t.createElementBlock("tbody",ea,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(k,r)=>(t.openBlock(),t.createElementBlock("tr",{key:`tr-${r}`,class:t.normalizeClass(["eli-tabela__tr",[r%2===1?"eli-tabela__tr--zebra":void 0]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(y,g)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${r}-${g}`,class:t.normalizeClass(["eli-tabela__td",[y.acao?"eli-tabela__td--clicavel":void 0,e.obterClasseAlinhamento(y.alinhamento)]]),onClick:M=>y.acao?()=>{var $;return($=y.acao)==null?void 0:$.call(y)}:void 0},[y.truncar?(t.openBlock(),t.createElementBlock("span",{key:0,class:"eli-tabela__celula-conteudo",style:t.normalizeStyle(y.largura_maxima?{maxWidth:e.obterMaxWidth(y.largura_maxima)}:void 0),title:e.obterTooltipCelula(y.celula(k))},[t.createVNode(l,{celula:y.celula(k)},null,8,["celula"])],12,aa)):(t.openBlock(),t.createBlock(l,{key:1,celula:y.celula(k)},null,8,["celula"]))],10,ta))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${r}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===r?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${r}`,disabled:!e.possuiAcoes(r),"aria-haspopup":"menu","aria-expanded":e.menuAberto===r?"true":"false","aria-controls":e.possuiAcoes(r)?`eli-tabela-acoes-menu-${r}`:void 0,"aria-label":e.possuiAcoes(r)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(r)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(y=>e.toggleMenu(r,y),["stop"])},[t.createVNode(c,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,oa)],2)])):t.createCommentVNode("",!0)],2))),128))])}const ra=T(xt,[["render",na]]),la=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:d}){const s=t.ref(null);d({menuEl:s});const m=t.computed(()=>e.acoes.length>0);function p(l){e.linha&&a("executar",{acao:l.acao,linha:e.linha})}return{menuEl:s,possuiAcoes:m,emitExecutar:p}}}),ia=["id","aria-labelledby"],sa=["aria-label","title","onClick"],ca={class:"eli-tabela__acoes-item-texto"};function da(e,a,d,s,m,p){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,l=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${l.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:l.acao.cor}),role:"menuitem","aria-label":l.acao.rotulo,title:l.acao.rotulo,onClick:t.withModifiers(c=>e.emitExecutar(l),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ca,t.toDisplayString(l.acao.rotulo),1)],12,sa)]))),128))],12,ia)):t.createCommentVNode("",!0)])}const ua=T(la,[["render",da]]),ma=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const d=t.computed(()=>{const r=e.maximoBotoes;return typeof r=="number"&&r>=5?Math.floor(r):7}),s=t.computed(()=>{const r=e.totalPaginas,y=e.pagina,g=d.value,M=[],$=O=>{M.push({label:String(O),pagina:O,ativo:O===y})},D=()=>{M.push({label:"…",ehEllipsis:!0})};if(r<=g){for(let O=1;O<=r;O+=1)$(O);return M}const C=Math.max(3,g-2);let j=Math.max(2,y-Math.floor(C/2)),H=j+C-1;H>=r&&(H=r-1,j=H-C+1),$(1),j>2&&D();for(let O=j;O<=H;O+=1)$(O);return He.pagina<=1),l=t.computed(()=>e.pagina>=e.totalPaginas),c=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:s,irParaPagina:m,anteriorDesabilitado:p,proximaDesabilitada:l,paginaAtual:c,totalPaginasExibidas:k}}}),pa={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},fa=["disabled"],ba={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},ha=["disabled","aria-current","aria-label","onClick"],ya=["disabled"];function ga(e,a,d,s,m,p){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",pa,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=l=>e.irParaPagina(e.paginaAtual-1))}," << ",8,fa),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(l,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${l.label}-${c}`},[l.ehEllipsis?(t.openBlock(),t.createElementBlock("span",ba,t.toDisplayString(l.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",l.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:l.ativo,"aria-current":l.ativo?"page":void 0,"aria-label":`Ir para página ${l.label}`,onClick:k=>e.irParaPagina(l.pagina)},t.toDisplayString(l.label),11,ha))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=l=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,ya)])):t.createCommentVNode("",!0)}const $a=T(ma,[["render",ga],["__scopeId","data-v-59d12455"]]),ka=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ct,EliTabelaEstados:Dt,EliTabelaDebug:Ot,EliTabelaHead:Yt,EliTabelaBody:ra,EliTabelaMenuAcoes:ua,EliTabelaPaginacao:$a},props:{tabela:{type:Object,required:!0}},setup(e){const d=t.ref(!1),s=t.ref(null),m=t.ref([]),p=t.ref(0),l=t.ref([]),c=t.ref(null),k=t.ref(null),r=t.ref({top:0,left:0}),y=t.ref(""),g=t.ref(1),M=t.ref(null),$=t.ref("asc"),D=t.computed(()=>e.tabela),C=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),j=t.computed(()=>e.tabela.acoesTabela??[]),H=t.computed(()=>j.value.length>0),O=t.computed(()=>{const o=e.tabela.registros_por_consulta;return typeof o=="number"&&o>0?Math.floor(o):10}),v=t.computed(()=>{const o=O.value;if(!o||o<=0)return 1;const n=p.value;return n?Math.max(1,Math.ceil(n/o)):1}),ie=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let L=0;function F(o){var E,S,A,P,q,z;const n=o.getBoundingClientRect(),u=8,i=((A=(S=(E=k.value)==null?void 0:E.menuEl)==null?void 0:S.value)==null?void 0:A.offsetHeight)??0,h=((z=(q=(P=k.value)==null?void 0:P.menuEl)==null?void 0:q.value)==null?void 0:z.offsetWidth)??180;let b=n.bottom+u;const B=n.right-h;i&&b+i>window.innerHeight-u&&(b=n.top-u-i),r.value={top:Math.max(u,Math.round(b)),left:Math.max(u,Math.round(B))}}function Z(o){var u,i;if(c.value===null)return;const n=o.target;(i=(u=k.value)==null?void 0:u.menuEl)!=null&&i.value&&k.value.menuEl.value.contains(n)||(c.value=null)}function X(o){if(o){if(M.value===o){$.value=$.value==="asc"?"desc":"asc",f();return}M.value=o,$.value="asc",g.value!==1?g.value=1:f()}}function G(o){y.value!==o&&(y.value=o,g.value!==1?g.value=1:f())}function _(o){const n=Math.min(Math.max(1,o),v.value);n!==g.value&&(g.value=n)}function V(o){const n=e.tabela.acoesLinha??[],u=l.value[o]??[];return n.map((i,h)=>{const b=i.exibir===void 0?!0:typeof i.exibir=="boolean"?i.exibir:!1;return{acao:i,indice:h,visivel:u[h]??b}}).filter(i=>i.visivel)}function R(o){return V(o).length>0}function ae(o,n){if(!R(o))return;if(c.value===o){c.value=null;return}c.value=o;const u=(n==null?void 0:n.currentTarget)??null;u&&(F(u),requestAnimationFrame(()=>F(u)))}async function f(){var h,b;const o=++L;d.value=!0,s.value=null,l.value=[],c.value=null;const n=Math.max(1,O.value),i={offSet:(g.value-1)*n,limit:n};y.value&&(i.texto_busca=y.value),M.value&&(i.coluna_ordem=M.value,i.direcao_ordem=$.value);try{const B=e.tabela,E=await B.consulta(i);if(o!==L)return;if(E.cod!==be.sucesso){m.value=[],p.value=0,s.value=E.mensagem;return}const S=((h=E.valor)==null?void 0:h.valores)??[],A=((b=E.valor)==null?void 0:b.quantidade)??S.length;m.value=S,p.value=A;const P=Math.max(1,Math.ceil((A||0)/n));if(g.value>P){g.value=P;return}const q=B.acoesLinha??[];if(!q.length){l.value=[];return}const z=S.map(()=>q.map(I=>I.exibir===void 0?!0:typeof I.exibir=="boolean"?I.exibir:!1));l.value=z;const W=await Promise.all(S.map(async I=>Promise.all(q.map(async N=>{if(N.exibir===void 0)return!0;if(typeof N.exibir=="boolean")return N.exibir;try{const U=N.exibir(I);return!!await Promise.resolve(U)}catch{return!1}}))));o===L&&(l.value=W)}catch(B){if(o!==L)return;m.value=[],p.value=0,s.value=B instanceof Error?B.message:"Erro ao carregar dados."}finally{o===L&&(d.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Z),f()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Z)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,o=>{!o&&y.value&&(y.value="",g.value!==1?g.value=1:f())}),t.watch(g,(o,n)=>{o!==n&&f()}),t.watch(()=>e.tabela,()=>{c.value=null,M.value=null,$.value="asc",y.value="",g.value!==1?g.value=1:f()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{g.value!==1?g.value=1:f()}),t.watch(m,()=>{c.value=null}),{isDev:!1,tabela:D,carregando:d,erro:s,linhas:m,quantidade:p,menuAberto:c,valorBusca:y,paginaAtual:g,colunaOrdenacao:M,direcaoOrdenacao:$,totalPaginas:v,exibirBusca:C,acoesCabecalho:j,temAcoesCabecalho:H,temAcoes:ie,alternarOrdenacao:X,atualizarBusca:G,irParaPagina:_,acoesDisponiveisPorLinha:V,possuiAcoes:R,toggleMenu:ae,menuPopup:k,menuPopupPos:r}}}),Ba={class:"eli-tabela"},Va={class:"eli-tabela__table"};function Ca(e,a,d,s,m,p){const l=t.resolveComponent("EliTabelaDebug"),c=t.resolveComponent("EliTabelaEstados"),k=t.resolveComponent("EliTabelaCabecalho"),r=t.resolveComponent("EliTabelaHead"),y=t.resolveComponent("EliTabelaBody"),g=t.resolveComponent("EliTabelaMenuAcoes"),M=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",Ba,[t.createVNode(l,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(c,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(k,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar"])):t.createCommentVNode("",!0),t.createElementVNode("table",Va,[t.createVNode(r,{colunas:e.tabela.colunas,temAcoes:e.temAcoes,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(y,{colunas:e.tabela.colunas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,toggleMenu:e.toggleMenu},null,8,["colunas","linhas","temAcoes","menuAberto","possuiAcoes","toggleMenu"])]),t.createVNode(g,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[0]||(a[0]=({acao:$,linha:D})=>{e.menuAberto=null,$.acao(D)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(M,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const ke=T(ka,[["render",Ca]]),Ea={install(e){e.component("EliOlaMundo",ue),e.component("EliBotao",ne),e.component("EliBadge",Q),e.component("EliInput",le),e.component("EliCartao",me),e.component("EliDataHora",fe),e.component("EliTabela",ke)}};w.EliBadge=Q,w.EliBotao=ne,w.EliCartao=me,w.EliDataHora=fe,w.EliInput=le,w.EliOlaMundo=ue,w.EliTabela=ke,w.default=Ea,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts index b3d4fa5..10641c8 100644 --- a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts +++ b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts @@ -300,17 +300,15 @@ declare const __VLS_export: import("vue").DefineComponent boolean>; required: true; }; + toggleMenu: { + type: PropType<(indice: number, evento: MouseEvent) => void>; + required: true; + }; }>, { obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; obterMaxWidth: (largura?: number | string) => string | undefined; obterTooltipCelula: (celula: unknown) => any; - emitToggleMenu: (indice: number, evento: MouseEvent) => void; - }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { - toggleMenu(payload: { - indice: number; - evento: MouseEvent; - }): boolean; - }, string, import("vue").PublicProps, Readonly>>; required: true; @@ -331,12 +329,11 @@ declare const __VLS_export: import("vue").DefineComponent boolean>; required: true; }; - }>> & Readonly<{ - onToggleMenu?: ((payload: { - indice: number; - evento: MouseEvent; - }) => any) | undefined; - }>, {}, {}, { + toggleMenu: { + type: PropType<(indice: number, evento: MouseEvent) => void>; + required: true; + }; + }>> & Readonly<{}>, {}, {}, { EliTabelaCelula: import("vue").DefineComponent; diff --git a/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts index 58253e8..8e232c0 100644 --- a/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts +++ b/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts @@ -21,17 +21,15 @@ declare const __VLS_export: import("vue").DefineComponent boolean>; required: true; }; + toggleMenu: { + type: PropType<(indice: number, evento: MouseEvent) => void>; + required: true; + }; }>, { obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; obterMaxWidth: (largura?: number | string) => string | undefined; obterTooltipCelula: (celula: unknown) => any; - emitToggleMenu: (indice: number, evento: MouseEvent) => void; -}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { - toggleMenu(payload: { - indice: number; - evento: MouseEvent; - }): boolean; -}, string, import("vue").PublicProps, Readonly>>; required: true; @@ -52,12 +50,11 @@ declare const __VLS_export: import("vue").DefineComponent boolean>; required: true; }; -}>> & Readonly<{ - onToggleMenu?: ((payload: { - indice: number; - evento: MouseEvent; - }) => any) | undefined; -}>, {}, {}, { + toggleMenu: { + type: PropType<(indice: number, evento: MouseEvent) => void>; + required: true; + }; +}>> & Readonly<{}>, {}, {}, { EliTabelaCelula: import("vue").DefineComponent; diff --git a/package.json b/package.json index f9121a9..c5e5a5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.40", + "version": "0.1.41", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/src/components/eli/EliTabela/EliTabela.vue b/src/components/eli/EliTabela/EliTabela.vue index 2443b16..37aec47 100644 --- a/src/components/eli/EliTabela/EliTabela.vue +++ b/src/components/eli/EliTabela/EliTabela.vue @@ -24,7 +24,7 @@ :temAcoes="temAcoes" :colunaOrdenacao="colunaOrdenacao" :direcaoOrdenacao="direcaoOrdenacao" - @alternarOrdenacao="alternarOrdenacao" + @alternar-ordenacao="alternarOrdenacao" /> diff --git a/src/components/eli/EliTabela/EliTabelaBody.vue b/src/components/eli/EliTabela/EliTabelaBody.vue index 79535af..6ee7d2b 100644 --- a/src/components/eli/EliTabela/EliTabelaBody.vue +++ b/src/components/eli/EliTabela/EliTabelaBody.vue @@ -43,7 +43,7 @@ :aria-controls="possuiAcoes(i) ? `eli-tabela-acoes-menu-${i}` : undefined" :aria-label="possuiAcoes(i) ? 'Ações da linha' : 'Nenhuma ação disponível'" :title="possuiAcoes(i) ? 'Ações' : 'Nenhuma ação disponível'" - @click.stop="emitToggleMenu(i, $event)" + @click.stop="toggleMenu(i, $event)" > @@ -86,13 +86,12 @@ export default defineComponent({ type: Function as PropType<(i: number) => boolean>, required: true, }, - }, - emits: { - toggleMenu(payload: { indice: number; evento: MouseEvent }) { - return payload && typeof payload.indice === "number"; + toggleMenu: { + type: Function as PropType<(indice: number, evento: MouseEvent) => void>, + required: true, }, }, - setup(_props, { emit }) { + setup() { function obterClasseAlinhamento(alinhamento?: string) { if (alinhamento === "direita") return "eli-tabela__celula--direita"; if (alinhamento === "centro") return "eli-tabela__celula--centro"; @@ -121,15 +120,10 @@ export default defineComponent({ return undefined; } - function emitToggleMenu(indice: number, evento: MouseEvent) { - emit("toggleMenu", { indice, evento }); - } - return { obterClasseAlinhamento, obterMaxWidth, obterTooltipCelula, - emitToggleMenu, }; }, });