diff --git a/dist/eli-vue.css b/dist/eli-vue.css index 9af3411..645afce 100644 --- a/dist/eli-vue.css +++ b/dist/eli-vue.css @@ -1 +1 @@ -[data-v-de2fbf2f] .v-badge__badge,[data-v-de2fbf2f] .v-badge__content{border-radius:var(--eli-badge-radius)!important}.eli-input[data-v-756cb549]{width:100%}.checkbox-group[data-v-756cb549]{display:flex;gap:8px;flex-wrap:wrap}.cursor-pointer[data-v-756cb549]{cursor:pointer}.eli-cartao[data-v-6c492bd9]{border-radius:12px}.eli-cartao__titulo[data-v-6c492bd9]{display:flex;align-items:center;justify-content:space-between;gap:12px}.eli-cartao__titulo-texto[data-v-6c492bd9]{min-width:0}.eli-cartao__conteudo[data-v-6c492bd9]{padding-top:8px}.eli-cartao__acoes[data-v-6c492bd9]{padding-top:0}.eli-cartao--cancelado[data-v-6c492bd9]{opacity:.85}.eli-data-hora[data-v-71afabb6],.eli-tabela[data-v-cc67b529]{width:100%}.eli-tabela__table[data-v-cc67b529]{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:hidden}.eli-tabela__th[data-v-cc67b529],.eli-tabela__td[data-v-cc67b529]{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th[data-v-cc67b529]{text-align:left;font-weight:600;background:#00000008}.eli-tabela__tr:last-child .eli-tabela__td[data-v-cc67b529]{border-bottom:none}.eli-tabela__td--clicavel[data-v-cc67b529]{cursor:pointer}.eli-tabela__td--clicavel[data-v-cc67b529]:hover{background:#00000008}.eli-tabela--erro[data-v-cc67b529]{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando[data-v-cc67b529]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo[data-v-cc67b529]{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem[data-v-cc67b529]{opacity:.9}.eli-tabela--vazio[data-v-cc67b529]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8} +[data-v-de2fbf2f] .v-badge__badge,[data-v-de2fbf2f] .v-badge__content{border-radius:var(--eli-badge-radius)!important}.eli-input[data-v-756cb549]{width:100%}.checkbox-group[data-v-756cb549]{display:flex;gap:8px;flex-wrap:wrap}.cursor-pointer[data-v-756cb549]{cursor:pointer}.eli-cartao[data-v-6c492bd9]{border-radius:12px}.eli-cartao__titulo[data-v-6c492bd9]{display:flex;align-items:center;justify-content:space-between;gap:12px}.eli-cartao__titulo-texto[data-v-6c492bd9]{min-width:0}.eli-cartao__conteudo[data-v-6c492bd9]{padding-top:8px}.eli-cartao__acoes[data-v-6c492bd9]{padding-top:0}.eli-cartao--cancelado[data-v-6c492bd9]{opacity:.85}.eli-data-hora[data-v-71afabb6]{width:100%}.eli-tabela__busca[data-v-2aeb8274]{display:flex;align-items:flex-end;justify-content:flex-end;gap:8px;margin-bottom:12px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-2aeb8274]{display:inline-flex;align-items:stretch;border-radius:9999px;border:1px solid rgba(15,23,42,.15);overflow:hidden;background:#fff}.eli-tabela__busca-input[data-v-2aeb8274]{padding:6px 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-2aeb8274]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-2aeb8274]{border:none;background:#2563eb1f;color:#2563ebf2;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao[data-v-2aeb8274]:hover,.eli-tabela__busca-botao[data-v-2aeb8274]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-2aeb8274]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__paginacao[data-v-59d12455]{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px;flex-wrap:wrap}.eli-tabela__pagina-botao[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;border-radius:9999px;border:1px solid rgba(15,23,42,.12);background:#fff;font-size:.875rem;font-weight:500;color:#0f172ad1;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease}.eli-tabela__pagina-botao[data-v-59d12455]:hover,.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{background-color:#2563eb14;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__pagina-botao[data-v-59d12455]:disabled{cursor:default;opacity:.5;background:#94a3b814;border-color:#94a3b82e;color:#475569bf}.eli-tabela__pagina-botao--ativo[data-v-59d12455]{background:#2563eb1f;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-ellipsis[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;width:32px;color:#6b7280d9;font-size:.9rem}.eli-tabela[data-v-c6b8c95b]{width:100%}.eli-tabela__table[data-v-c6b8c95b]{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__th[data-v-c6b8c95b],.eli-tabela__td[data-v-c6b8c95b]{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th[data-v-c6b8c95b]{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel[data-v-c6b8c95b]{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao[data-v-c6b8c95b]{padding:10px 12px}.eli-tabela__th-botao[data-v-c6b8c95b]{display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;background:transparent;border:none;font:inherit;color:inherit;cursor:pointer;text-align:left;transition:color .2s ease}.eli-tabela__th-botao[data-v-c6b8c95b]:hover,.eli-tabela__th-botao[data-v-c6b8c95b]:focus-visible{color:#0f172ad9}.eli-tabela__th-botao[data-v-c6b8c95b]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo[data-v-c6b8c95b]{color:#2563ebf2}.eli-tabela__th-texto[data-v-c6b8c95b]{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone[data-v-c6b8c95b]{flex-shrink:0}.eli-tabela__th-icone--oculto[data-v-c6b8c95b]{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td[data-v-c6b8c95b]{border-bottom:none}.eli-tabela__td--clicavel[data-v-c6b8c95b]{cursor:pointer}.eli-tabela__td--clicavel[data-v-c6b8c95b]:hover{background:#00000008}.eli-tabela--erro[data-v-c6b8c95b]{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando[data-v-c6b8c95b]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo[data-v-c6b8c95b]{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem[data-v-c6b8c95b]{opacity:.9}.eli-tabela--vazio[data-v-c6b8c95b]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes[data-v-c6b8c95b]{text-align:right;white-space:nowrap}.eli-tabela__td--acoes[data-v-c6b8c95b]{white-space:nowrap}.eli-tabela__acoes-container[data-v-c6b8c95b]{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto[data-v-c6b8c95b]{z-index:200}.eli-tabela__cabecalho[data-v-c6b8c95b]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho[data-v-c6b8c95b]{display:inline-flex;gap:8px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho-botao[data-v-c6b8c95b]{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:9999px;border:none;background:#2563eb1f;color:#2563ebf2;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-cabecalho-botao[data-v-c6b8c95b]:hover,.eli-tabela__acoes-cabecalho-botao[data-v-c6b8c95b]:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao[data-v-c6b8c95b]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__acoes-cabecalho-icone[data-v-c6b8c95b]{display:inline-block}.eli-tabela__acoes-cabecalho-rotulo[data-v-c6b8c95b]{line-height:1}.eli-tabela__acoes-toggle[data-v-c6b8c95b]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9999px;border:none;background:transparent;color:#0f172ab8;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-toggle-icone[data-v-c6b8c95b]{display:block}.eli-tabela__acoes-toggle[data-v-c6b8c95b]:hover,.eli-tabela__acoes-toggle[data-v-c6b8c95b]:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle[data-v-c6b8c95b]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle[data-v-c6b8c95b]:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu[data-v-c6b8c95b]{position:absolute;top:100%;right:0;min-width:180px;padding:6px 0;margin:0;list-style:none;background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:10px;box-shadow:0 12px 30px #0f172a2e;z-index:1000}.eli-tabela__acoes-item[data-v-c6b8c95b]{margin:0}.eli-tabela__acoes-item-botao[data-v-c6b8c95b]{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;background:transparent;font-size:.9rem;cursor:pointer;transition:background-color .2s ease}.eli-tabela__acoes-item-botao[data-v-c6b8c95b]:hover,.eli-tabela__acoes-item-botao[data-v-c6b8c95b]:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao[data-v-c6b8c95b]:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone[data-v-c6b8c95b]{flex-shrink:0}.eli-tabela__acoes-item-texto[data-v-c6b8c95b]{flex:1;text-align:left} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index c1662bf..22c43d9 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,16 +1,16 @@ -import { defineComponent as W, createBlock as A, openBlock as B, mergeProps as z, withCtx as C, renderSlot as Z, computed as T, ref as D, createElementBlock as J, createCommentVNode as ye, createSlots as Ie, createVNode as b, createTextVNode as K, toDisplayString as $e, Fragment as fe, renderList as me, resolveComponent as re, createElementVNode as ne, onMounted as Oe, watch as Te, h as P } from "vue"; -import { VBtn as Ue } from "vuetify/components/VBtn"; -import { VBadge as Pe } from "vuetify/components/VBadge"; -import { VCheckbox as Ye } from "vuetify/components/VCheckbox"; -import { VIcon as Ae } from "vuetify/components/VIcon"; -import { VRadio as He } from "vuetify/components/VRadio"; -import { VRadioGroup as Ne } from "vuetify/components/VRadioGroup"; -import { VSelect as je } from "vuetify/components/VSelect"; -import { VTextField as ge } from "vuetify/components/VTextField"; -import { VTextarea as Fe } from "vuetify/components/VTextarea"; -import { VCard as be, VCardTitle as he, VCardText as Ve, VCardActions as Se } from "vuetify/components/VCard"; -import { VContainer as Le } from "vuetify/components/VGrid"; -const ze = W({ +import { defineComponent as Q, createBlock as J, openBlock as A, mergeProps as te, withCtx as L, renderSlot as re, computed as C, ref as E, createElementBlock as q, createCommentVNode as he, createSlots as Ue, createVNode as _, createTextVNode as de, toDisplayString as pe, Fragment as ve, renderList as ge, resolveComponent as fe, createElementVNode as K, h as g, watch as le, withDirectives as Le, withKeys as Ne, vModelText as je, normalizeClass as He, onMounted as Ye, onBeforeUnmount as ze } from "vue"; +import { VBtn as Fe } from "vuetify/components/VBtn"; +import { VBadge as qe } from "vuetify/components/VBadge"; +import { VCheckbox as Re } from "vuetify/components/VCheckbox"; +import { VIcon as We } from "vuetify/components/VIcon"; +import { VRadio as Je } from "vuetify/components/VRadio"; +import { VRadioGroup as Ze } from "vuetify/components/VRadioGroup"; +import { VSelect as Xe } from "vuetify/components/VSelect"; +import { VTextField as Ce } from "vuetify/components/VTextField"; +import { VTextarea as Ge } from "vuetify/components/VTextarea"; +import { VCard as Be, VCardTitle as Ee, VCardText as _e, VCardActions as Pe } from "vuetify/components/VCard"; +import { VContainer as Ke } from "vuetify/components/VGrid"; +const Qe = Q({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +35,30 @@ const ze = W({ default: !1 } } -}), R = (e, t) => { +}), x = (e, a) => { const c = e.__vccOpts || e; - for (const [p, v] of t) - c[p] = v; + for (const [m, p] of a) + c[m] = p; return c; }; -function We(e, t, c, p, v, M) { - return B(), A(Ue, z({ +function xe(e, a, c, m, p, $) { + return A(), J(Fe, te({ color: e.color, variant: e.variant, size: e.size, disabled: e.disabled, loading: e.loading }, e.$attrs, { class: "text-none pt-1" }), { - default: C(() => [ - Z(e.$slots, "default") + default: L(() => [ + re(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const Me = /* @__PURE__ */ R(ze, [["render", We]]), pe = { +const Ae = /* @__PURE__ */ x(Qe, [["render", xe]]), we = { suave: "4px", pill: "10px" -}, Re = W({ +}, ea = Q({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +97,14 @@ const Me = /* @__PURE__ */ R(ze, [["render", We]]), pe = { } }, setup(e) { - const t = T(() => e.radius in pe ? pe[e.radius] : e.radius), c = T(() => e.dot || e.badge !== void 0 ? e.visible : !1), p = T(() => ({ - "--eli-badge-radius": t.value + const a = C(() => e.radius in we ? we[e.radius] : e.radius), c = C(() => e.dot || e.badge !== void 0 ? e.visible : !1), m = C(() => ({ + "--eli-badge-radius": a.value })); - return { showBadge: c, badgeStyle: p }; + return { showBadge: c, badgeStyle: m }; } }); -function qe(e, t, c, p, v, M) { - return e.showBadge ? (B(), A(Pe, z({ +function aa(e, a, c, m, p, $) { + return e.showBadge ? (A(), J(qe, te({ key: 0, color: e.color }, e.$attrs, { @@ -115,46 +115,46 @@ function qe(e, t, c, p, v, M) { content: e.badge, style: e.badgeStyle }), { - default: C(() => [ - Z(e.$slots, "default", {}, void 0, !0) + default: L(() => [ + re(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : Z(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : re(e.$slots, "default", { key: 1 }, void 0, !0); } -const ie = /* @__PURE__ */ R(Re, [["render", qe], ["__scopeId", "data-v-de2fbf2f"]]); -function Je(e) { +const ye = /* @__PURE__ */ x(ea, [["render", aa], ["__scopeId", "data-v-de2fbf2f"]]); +function ta(e) { return e.replace(/\D+/g, ""); } -function Ze(e) { - const t = Je(e); - return t.length <= 11 ? t.replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d{1,2})$/, "$1-$2").slice(0, 14) : t.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 oa(e) { + const a = ta(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 Xe(e) { +function la(e) { return e.replace(/\D+/g, ""); } -function Ge(e) { - const t = Xe(e); - return t ? t.length <= 10 ? t.replace(/^(\d{2})(\d)/, "($1) $2").replace(/(\d{4})(\d)/, "$1-$2").slice(0, 14) : t.replace(/^(\d{2})(\d)/, "($1) $2").replace(/(\d{5})(\d)/, "$1-$2").slice(0, 15) : ""; +function ra(e) { + const a = la(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 ue(e) { +function $e(e) { return e.replace(/\D+/g, ""); } -function we(e) { - const t = e.replace(/[^\d,]/g, ""), c = t.split(","); - return c.length > 2 ? c[0] + "," + c.slice(1).join("") : t; +function Te(e) { + const a = e.replace(/[^\d,]/g, ""), c = a.split(","); + return c.length > 2 ? c[0] + "," + c.slice(1).join("") : a; } -function Qe(e) { - return we(e.replace(/%/g, "")); +function na(e) { + return Te(e.replace(/%/g, "")); } -function Ke(e) { - const t = ue(e); - return t ? (parseInt(t, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; +function ia(e) { + const a = $e(e); + return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; } -function _e(e) { - const t = ue(e).slice(0, 8); - return t.length <= 5 ? t : t.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); +function sa(e) { + const a = $e(e).slice(0, 8); + return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); } -const xe = W({ +const ua = Q({ name: "EliInput", inheritAttrs: !1, props: { @@ -196,13 +196,13 @@ const xe = W({ chips: Boolean }, emits: ["update:modelValue", "change", "focus", "blur"], - setup(e, { emit: t, attrs: c }) { - const p = D(!1), v = D(!1), M = T({ + setup(e, { emit: a, attrs: c }) { + const m = E(!1), p = E(!1), $ = C({ get: () => e.modelValue, - set: (h) => { - t("update:modelValue", h), t("change", h); + set: (M) => { + a("update:modelValue", M), a("change", M); } - }), d = T( + }), r = C( () => [ "text", "password", @@ -217,83 +217,83 @@ const xe = W({ "porcentagem", "cep" ].includes(e.type) - ), f = T( - () => e.type === "password" ? v.value ? "text" : "password" : "text" - ), I = T(() => { + ), v = C( + () => e.type === "password" ? p.value ? "text" : "password" : "text" + ), V = C(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), o = T( - () => e.error ? "error" : p.value ? e.color : void 0 + }), t = C( + () => e.error ? "error" : m.value ? e.color : void 0 ); - function m(h) { - const w = h.target; - let g = w.value; + function B(M) { + const O = M.target; + let w = O.value; switch (e.type) { case "numericoInteiro": - g = ue(g); + w = $e(w); break; case "numericoDecimal": - g = we(g); + w = Te(w); break; case "numericoMoeda": - g = Ke(g); + w = ia(w); break; case "porcentagem": - g = Qe(g); + w = na(w); break; case "telefone": - g = Ge(g); + w = ra(w); break; case "cpfCnpj": - g = Ze(g); + w = oa(w); break; case "cep": - g = _e(g); + w = sa(w); break; } - w.value = g, t("update:modelValue", g), t("change", g); + O.value = w, a("update:modelValue", w), a("change", w); } - function V() { - v.value = !v.value; + function S() { + p.value = !p.value; } - const H = T(() => (e.options || []).map((h) => { - if (h && typeof h == "object" && "value" in h) { - const g = h.value; + const H = C(() => (e.options || []).map((M) => { + if (M && typeof M == "object" && "value" in M) { + const w = M.value; return { - label: h.label ?? String(g), - value: g, - disabled: h.disabled + label: M.label ?? String(w), + value: w, + disabled: M.disabled }; } - const w = h; - return { label: String(w), value: w }; + const O = M; + return { label: String(O), value: O }; })); return { attrs: c, - value: M, - isTextLike: d, - inputHtmlType: f, - inputMode: I, - internalColor: o, - showPassword: v, - togglePassword: V, - onInput: m, - onFocus: () => t("focus"), - onBlur: () => t("blur"), + value: $, + isTextLike: r, + inputHtmlType: v, + inputMode: V, + internalColor: t, + showPassword: p, + togglePassword: S, + onInput: B, + onFocus: () => a("focus"), + onBlur: () => a("blur"), computedItems: H }; } -}), et = { class: "eli-input" }, tt = { +}), da = { class: "eli-input" }, ca = { key: 4, class: "checkbox-group" }; -function at(e, t, c, p, v, M) { - return B(), J("div", et, [ - e.isTextLike ? (B(), A(ge, z({ +function fa(e, a, c, m, p, $) { + return A(), q("div", da, [ + e.isTextLike ? (A(), J(Ce, te({ key: 0, modelValue: e.value, - "onUpdate:modelValue": t[0] || (t[0] = (d) => e.value = d), + "onUpdate:modelValue": a[0] || (a[0] = (r) => e.value = r), type: e.inputHtmlType, label: e.label, placeholder: e.placeholder, @@ -312,34 +312,34 @@ function at(e, t, c, p, v, M) { onFocus: e.onFocus, onBlur: e.onBlur, onInput: e.onInput - }), Ie({ _: 2 }, [ + }), Ue({ _: 2 }, [ e.type === "password" && e.showPasswordToggle ? { name: "append-inner", - fn: C(() => [ - b(Ae, { + fn: L(() => [ + _(We, { class: "cursor-pointer", onClick: e.togglePassword }, { - default: C(() => [ - K($e(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) + default: L(() => [ + de(pe(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" ? (B(), A(Fe, z({ + ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (A(), J(Ge, te({ key: 1, modelValue: e.value, - "onUpdate:modelValue": t[1] || (t[1] = (d) => e.value = d), + "onUpdate:modelValue": a[1] || (a[1] = (r) => e.value = r), label: e.label, rows: e.rows, density: e.density, variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (B(), A(je, z({ + }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (A(), J(Xe, te({ key: 2, modelValue: e.value, - "onUpdate:modelValue": t[2] || (t[2] = (d) => e.value = d), + "onUpdate:modelValue": a[2] || (a[2] = (r) => e.value = r), items: e.computedItems, label: e.label, placeholder: e.placeholder, @@ -356,127 +356,127 @@ function at(e, t, c, p, v, M) { }, 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" ? (B(), A(Ne, { + }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (A(), J(Ze, { key: 3, modelValue: e.value, - "onUpdate:modelValue": t[3] || (t[3] = (d) => e.value = d), + "onUpdate:modelValue": a[3] || (a[3] = (r) => e.value = r), row: e.row }, { - default: C(() => [ - (B(!0), J(fe, null, me(e.computedItems, (d) => (B(), A(He, { - key: String(d.value), - label: d.label, - value: d.value + default: L(() => [ + (A(!0), q(ve, null, ge(e.computedItems, (r) => (A(), J(Je, { + key: String(r.value), + label: r.label, + value: r.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (B(), J("div", tt, [ - (B(!0), J(fe, null, me(e.computedItems, (d) => (B(), A(Ye, { - key: String(d.value), + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (A(), q("div", ca, [ + (A(!0), q(ve, null, ge(e.computedItems, (r) => (A(), J(Re, { + key: String(r.value), modelValue: e.value, - "onUpdate:modelValue": t[4] || (t[4] = (f) => e.value = f), - label: d.label, - value: d.value, + "onUpdate:modelValue": a[4] || (a[4] = (v) => e.value = v), + label: r.label, + value: r.value, density: e.density }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) - ])) : ye("", !0) + ])) : he("", !0) ]); } -const De = /* @__PURE__ */ R(xe, [["render", at], ["__scopeId", "data-v-756cb549"]]), rt = W({ +const Ie = /* @__PURE__ */ x(ua, [["render", fa], ["__scopeId", "data-v-756cb549"]]), ma = Q({ name: "EliOlaMundo", components: { - EliBotao: Me, - EliBadge: ie, - EliInput: De + EliBotao: Ae, + EliBadge: ye, + EliInput: Ie }, setup() { - const e = D(""), t = D([]), c = D(""), p = D(""), v = D(""), M = D(""), d = D(""), f = D(""), I = D(""), o = D(""), m = D(""), V = D(null), H = D([]); + const e = E(""), a = E([]), c = E(""), m = E(""), p = E(""), $ = E(""), r = E(""), v = E(""), V = E(""), t = E(""), B = E(""), S = E(null), H = E([]); return { nome: e, - email: f, - documento: m, - estado: t, - telefone: p, - mensagem: I, - senha: o, - cor: V, + email: v, + documento: B, + estado: a, + telefone: m, + mensagem: V, + senha: t, + cor: S, habilidades: H, - idade: v, - altura: M, + idade: p, + altura: $, cep: c, - valor: d + valor: r }; } -}), nt = { class: "grid-example" }; -function ot(e, t, c, p, v, M) { - const d = re("EliBadge"), f = re("EliInput"), I = re("EliBotao"); - return B(), A(Le, null, { - default: C(() => [ - b(be, { +}), pa = { class: "grid-example" }; +function va(e, a, c, m, p, $) { + const r = fe("EliBadge"), v = fe("EliInput"), V = fe("EliBotao"); + return A(), J(Ke, null, { + default: L(() => [ + _(Be, { class: "mx-auto", max_width: "400" }, { - default: C(() => [ - b(he, null, { - default: C(() => [ - b(d, { + default: L(() => [ + _(Ee, null, { + default: L(() => [ + _(r, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: C(() => [...t[14] || (t[14] = [ - K(" Olá Mundo! ", -1) + default: L(() => [...a[14] || (a[14] = [ + de(" Olá Mundo! ", -1) ])]), _: 1 }) ]), _: 1 }), - b(Ve, null, { - default: C(() => [ - t[15] || (t[15] = K(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - ne("div", nt, [ - b(f, { + _(_e, null, { + default: L(() => [ + a[15] || (a[15] = de(" Este é um componente de exemplo integrado com Vuetify. ", -1)), + K("div", pa, [ + _(v, { modelValue: e.nome, - "onUpdate:modelValue": t[0] || (t[0] = (o) => e.nome = o), + "onUpdate:modelValue": a[0] || (a[0] = (t) => e.nome = t), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.idade, - "onUpdate:modelValue": t[1] || (t[1] = (o) => e.idade = o), + "onUpdate:modelValue": a[1] || (a[1] = (t) => e.idade = t), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.altura, - "onUpdate:modelValue": t[2] || (t[2] = (o) => e.altura = o), + "onUpdate:modelValue": a[2] || (a[2] = (t) => e.altura = t), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.valor, - "onUpdate:modelValue": t[3] || (t[3] = (o) => e.valor = o), + "onUpdate:modelValue": a[3] || (a[3] = (t) => e.valor = t), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.telefone, - "onUpdate:modelValue": t[4] || (t[4] = (o) => e.telefone = o), + "onUpdate:modelValue": a[4] || (a[4] = (t) => e.telefone = t), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.cep, - "onUpdate:modelValue": t[5] || (t[5] = (o) => e.cep = o), + "onUpdate:modelValue": a[5] || (a[5] = (t) => e.cep = t), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - b(f, { + _(v, { type: "select", label: "Estado", options: [ @@ -484,58 +484,58 @@ function ot(e, t, c, p, v, M) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": t[6] || (t[6] = (o) => e.estado = o), + "onUpdate:modelValue": a[6] || (a[6] = (t) => e.estado = t), multiple: "" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.documento, - "onUpdate:modelValue": t[7] || (t[7] = (o) => e.documento = o), + "onUpdate:modelValue": a[7] || (a[7] = (t) => e.documento = t), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.email, - "onUpdate:modelValue": t[8] || (t[8] = (o) => e.email = o), + "onUpdate:modelValue": a[8] || (a[8] = (t) => e.email = t), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.senha, - "onUpdate:modelValue": t[9] || (t[9] = (o) => e.senha = o), + "onUpdate:modelValue": a[9] || (a[9] = (t) => e.senha = t), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - b(f, { + _(v, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": t[10] || (t[10] = (o) => e.mensagem = o), + "onUpdate:modelValue": a[10] || (a[10] = (t) => e.mensagem = t), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - b(f, { + _(v, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": t[11] || (t[11] = (o) => e.cor = o), + "onUpdate:modelValue": a[11] || (a[11] = (t) => e.cor = t), label: "Cor favorita", options: [ { label: "Azul", value: "azul" }, { label: "Verde", value: "verde" } ] }, null, 8, ["modelValue"]), - b(f, { + _(v, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": t[12] || (t[12] = (o) => e.habilidades = o), + "onUpdate:modelValue": a[12] || (a[12] = (t) => e.habilidades = t), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - b(f, { + _(v, { modelValue: e.nome, - "onUpdate:modelValue": t[13] || (t[13] = (o) => e.nome = o), + "onUpdate:modelValue": a[13] || (a[13] = (t) => e.nome = t), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -544,15 +544,15 @@ function ot(e, t, c, p, v, M) { ]), _: 1 }), - b(Se, null, { - default: C(() => [ - b(I, { + _(Pe, null, { + default: L(() => [ + _(V, { color: "primary", variant: "elevated", block: "" }, { - default: C(() => [...t[16] || (t[16] = [ - K(" Botão Vuetify ", -1) + default: L(() => [...a[16] || (a[16] = [ + de(" Botão Vuetify ", -1) ])]), _: 1 }) @@ -566,9 +566,9 @@ function ot(e, t, c, p, v, M) { _: 1 }); } -const lt = /* @__PURE__ */ R(rt, [["render", ot]]), st = W({ +const ba = /* @__PURE__ */ x(ma, [["render", va]]), ga = Q({ name: "EliCartao", - components: { EliBadge: ie }, + components: { EliBadge: ye }, inheritAttrs: !1, props: { /** Título de fallback caso o slot `titulo` não seja usado. */ @@ -594,8 +594,8 @@ const lt = /* @__PURE__ */ R(rt, [["render", ot]]), st = W({ /** Emit opcional para padronizar clique no cartão. */ clicar: (e) => !0 }, - setup(e, { emit: t }) { - const c = T(() => e.status), p = T(() => { + setup(e, { emit: a }) { + const c = C(() => e.status), m = C(() => { switch (e.status) { case "novo": return "primary"; @@ -606,40 +606,40 @@ const lt = /* @__PURE__ */ R(rt, [["render", ot]]), st = W({ case "cancelado": return "error"; } - }), v = T(() => `eli-cartao--${e.status}`); - function M() { - t("clicar", e.status); + }), p = C(() => `eli-cartao--${e.status}`); + function $() { + a("clicar", e.status); } return { rotuloStatus: c, - corStatus: p, - classeStatus: v, - onClick: M + corStatus: m, + classeStatus: p, + onClick: $ }; } -}), it = { class: "eli-cartao__titulo-texto" }, ut = { class: "eli-cartao__status" }; -function dt(e, t, c, p, v, M) { - const d = re("EliBadge"); - return B(), A(be, z({ +}), ha = { class: "eli-cartao__titulo-texto" }, ya = { class: "eli-cartao__status" }; +function $a(e, a, c, m, p, $) { + const r = fe("EliBadge"); + return A(), J(Be, te({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: C(() => [ - b(he, { class: "eli-cartao__titulo" }, { - default: C(() => [ - ne("div", it, [ - Z(e.$slots, "titulo", {}, () => [ - K($e(e.titulo), 1) + default: L(() => [ + _(Ee, { class: "eli-cartao__titulo" }, { + default: L(() => [ + K("div", ha, [ + re(e.$slots, "titulo", {}, () => [ + de(pe(e.titulo), 1) ], !0) ]), - ne("div", ut, [ - b(d, { + K("div", ya, [ + _(r, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: C(() => [...t[0] || (t[0] = [ - ne("span", null, null, -1) + default: L(() => [...a[0] || (a[0] = [ + K("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -647,309 +647,309 @@ function dt(e, t, c, p, v, M) { ]), _: 3 }), - b(Ve, { class: "eli-cartao__conteudo" }, { - default: C(() => [ - Z(e.$slots, "default", {}, void 0, !0) + _(_e, { class: "eli-cartao__conteudo" }, { + default: L(() => [ + re(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (B(), A(Se, { + e.$slots.acoes ? (A(), J(Pe, { key: 0, class: "eli-cartao__acoes" }, { - default: C(() => [ - Z(e.$slots, "acoes", {}, void 0, !0) + default: L(() => [ + re(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : ye("", !0) + })) : he("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const ct = /* @__PURE__ */ R(st, [["render", dt], ["__scopeId", "data-v-6c492bd9"]]); -function ft(e) { +const Va = /* @__PURE__ */ x(ga, [["render", $a], ["__scopeId", "data-v-6c492bd9"]]); +function wa(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var oe = { exports: {} }, mt = oe.exports, ve; -function pt() { - return ve || (ve = 1, (function(e, t) { - (function(c, p) { - e.exports = p(); - })(mt, (function() { - var c = 1e3, p = 6e4, v = 36e5, M = "millisecond", d = "second", f = "minute", I = "hour", o = "day", m = "week", V = "month", H = "quarter", h = "year", w = "date", g = "Invalid Date", _ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Ee = /\[([^\]]+)]|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, Be = { 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(s) { - var n = ["th", "st", "nd", "rd"], a = s % 100; - return "[" + s + (n[(a - 20) % 10] || n[a] || n[0]) + "]"; - } }, le = function(s, n, a) { - var l = String(s); - return !l || l.length >= n ? s : "" + Array(n + 1 - l.length).join(a) + s; - }, Ce = { s: le, z: function(s) { - var n = -s.utcOffset(), a = Math.abs(n), l = Math.floor(a / 60), r = a % 60; - return (n <= 0 ? "+" : "-") + le(l, 2, "0") + ":" + le(r, 2, "0"); - }, m: function s(n, a) { - if (n.date() < a.date()) return -s(a, n); - var l = 12 * (a.year() - n.year()) + (a.month() - n.month()), r = n.clone().add(l, V), i = a - r < 0, u = n.clone().add(l + (i ? -1 : 1), V); - return +(-(l + (a - r) / (i ? r - u : u - r)) || 0); - }, a: function(s) { - return s < 0 ? Math.ceil(s) || 0 : Math.floor(s); - }, p: function(s) { - return { M: V, y: h, w: m, d: o, D: w, h: I, m: f, s: d, ms: M, Q: H }[s] || String(s || "").toLowerCase().replace(/s$/, ""); - }, u: function(s) { - return s === void 0; - } }, X = "en", j = {}; - j[X] = Be; - var de = "$isDayjsObject", se = function(s) { - return s instanceof ee || !(!s || !s[de]); - }, x = function s(n, a, l) { - var r; - if (!n) return X; - if (typeof n == "string") { - var i = n.toLowerCase(); - j[i] && (r = i), a && (j[i] = a, r = i); - var u = n.split("-"); - if (!r && u.length > 1) return s(u[0]); +var me = { exports: {} }, ka = me.exports, ke; +function Ma() { + return ke || (ke = 1, (function(e, a) { + (function(c, m) { + e.exports = m(); + })(ka, (function() { + var c = 1e3, m = 6e4, p = 36e5, $ = "millisecond", r = "second", v = "minute", V = "hour", t = "day", B = "week", S = "month", H = "quarter", M = "year", O = "date", w = "Invalid Date", Z = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Y = /\[([^\]]+)]|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, N = { 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(i) { + var s = ["th", "st", "nd", "rd"], o = i % 100; + return "[" + i + (s[(o - 20) % 10] || s[o] || s[0]) + "]"; + } }, ne = function(i, s, o) { + var u = String(i); + return !u || u.length >= s ? i : "" + Array(s + 1 - u.length).join(o) + i; + }, be = { s: ne, z: function(i) { + var s = -i.utcOffset(), o = Math.abs(s), u = Math.floor(o / 60), l = o % 60; + return (s <= 0 ? "+" : "-") + ne(u, 2, "0") + ":" + ne(l, 2, "0"); + }, m: function i(s, o) { + if (s.date() < o.date()) return -i(o, s); + var u = 12 * (o.year() - s.year()) + (o.month() - s.month()), l = s.clone().add(u, S), d = o - l < 0, n = s.clone().add(u + (d ? -1 : 1), S); + return +(-(u + (o - l) / (d ? l - n : n - l)) || 0); + }, a: function(i) { + return i < 0 ? Math.ceil(i) || 0 : Math.floor(i); + }, p: function(i) { + return { M: S, y: M, w: B, d: t, D: O, h: V, m: v, s: r, ms: $, Q: H }[i] || String(i || "").toLowerCase().replace(/s$/, ""); + }, u: function(i) { + return i === void 0; + } }, ae = "en", G = {}; + G[ae] = N; + var ie = "$isDayjsObject", se = function(i) { + return i instanceof z || !(!i || !i[ie]); + }, oe = function i(s, o, u) { + var l; + if (!s) return ae; + if (typeof s == "string") { + var d = s.toLowerCase(); + G[d] && (l = d), o && (G[d] = o, l = d); + var n = s.split("-"); + if (!l && n.length > 1) return i(n[0]); } else { - var $ = n.name; - j[$] = n, r = $; + var b = s.name; + G[b] = s, l = b; } - return !l && r && (X = r), r || !l && X; - }, k = function(s, n) { - if (se(s)) return s.clone(); - var a = typeof n == "object" ? n : {}; - return a.date = s, a.args = arguments, new ee(a); - }, y = Ce; - y.l = x, y.i = se, y.w = function(s, n) { - return k(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset }); + return !u && l && (ae = l), l || !u && ae; + }, T = function(i, s) { + if (se(i)) return i.clone(); + var o = typeof s == "object" ? s : {}; + return o.date = i, o.args = arguments, new z(o); + }, k = be; + k.l = oe, k.i = se, k.w = function(i, s) { + return T(i, { locale: s.$L, utc: s.$u, x: s.$x, $offset: s.$offset }); }; - var ee = (function() { - function s(a) { - this.$L = x(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[de] = !0; + var z = (function() { + function i(o) { + this.$L = oe(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[ie] = !0; } - var n = s.prototype; - return n.parse = function(a) { - this.$d = (function(l) { - var r = l.date, i = l.utc; - if (r === null) return /* @__PURE__ */ new Date(NaN); - if (y.u(r)) return /* @__PURE__ */ new Date(); - if (r instanceof Date) return new Date(r); - if (typeof r == "string" && !/Z$/i.test(r)) { - var u = r.match(_); - if (u) { - var $ = u[2] - 1 || 0, S = (u[7] || "0").substring(0, 3); - return i ? new Date(Date.UTC(u[1], $, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, S)) : new Date(u[1], $, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, S); + var s = i.prototype; + return s.parse = function(o) { + this.$d = (function(u) { + var l = u.date, d = u.utc; + if (l === null) return /* @__PURE__ */ new Date(NaN); + if (k.u(l)) return /* @__PURE__ */ new Date(); + if (l instanceof Date) return new Date(l); + if (typeof l == "string" && !/Z$/i.test(l)) { + var n = l.match(Z); + if (n) { + var b = n[2] - 1 || 0, h = (n[7] || "0").substring(0, 3); + return d ? new Date(Date.UTC(n[1], b, n[3] || 1, n[4] || 0, n[5] || 0, n[6] || 0, h)) : new Date(n[1], b, n[3] || 1, n[4] || 0, n[5] || 0, n[6] || 0, h); } } - return new Date(r); - })(a), this.init(); - }, n.init = function() { - var a = this.$d; - this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds(); - }, n.$utils = function() { - return y; - }, n.isValid = function() { - return this.$d.toString() !== g; - }, n.isSame = function(a, l) { - var r = k(a); - return this.startOf(l) <= r && r <= this.endOf(l); - }, n.isAfter = function(a, l) { - return k(a) < this.startOf(l); - }, n.isBefore = function(a, l) { - return this.endOf(l) < k(a); - }, n.$g = function(a, l, r) { - return y.u(a) ? this[l] : this.set(r, a); - }, n.unix = function() { + return new Date(l); + })(o), this.init(); + }, s.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(); + }, s.$utils = function() { + return k; + }, s.isValid = function() { + return this.$d.toString() !== w; + }, s.isSame = function(o, u) { + var l = T(o); + return this.startOf(u) <= l && l <= this.endOf(u); + }, s.isAfter = function(o, u) { + return T(o) < this.startOf(u); + }, s.isBefore = function(o, u) { + return this.endOf(u) < T(o); + }, s.$g = function(o, u, l) { + return k.u(o) ? this[u] : this.set(l, o); + }, s.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, n.valueOf = function() { + }, s.valueOf = function() { return this.$d.getTime(); - }, n.startOf = function(a, l) { - var r = this, i = !!y.u(l) || l, u = y.p(a), $ = function(L, U) { - var N = y.w(r.$u ? Date.UTC(r.$y, U, L) : new Date(r.$y, U, L), r); - return i ? N : N.endOf(o); - }, S = function(L, U) { - return y.w(r.toDate()[L].apply(r.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), r); - }, E = this.$W, O = this.$M, Y = this.$D, q = "set" + (this.$u ? "UTC" : ""); - switch (u) { - case h: - return i ? $(1, 0) : $(31, 11); + }, s.startOf = function(o, u) { + var l = this, d = !!k.u(u) || u, n = k.p(o), b = function(W, U) { + var P = k.w(l.$u ? Date.UTC(l.$y, U, W) : new Date(l.$y, U, W), l); + return d ? P : P.endOf(t); + }, h = function(W, U) { + return k.w(l.toDate()[W].apply(l.toDate("s"), (d ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), l); + }, D = this.$W, y = this.$M, I = this.$D, R = "set" + (this.$u ? "UTC" : ""); + switch (n) { + case M: + return d ? b(1, 0) : b(31, 11); + case S: + return d ? b(1, y) : b(0, y + 1); + case B: + var j = this.$locale().weekStart || 0, F = (D < j ? D + 7 : D) - j; + return b(d ? I - F : I + (6 - F), y); + case t: + case O: + return h(R + "Hours", 0); case V: - return i ? $(1, O) : $(0, O + 1); - case m: - var F = this.$locale().weekStart || 0, G = (E < F ? E + 7 : E) - F; - return $(i ? Y - G : Y + (6 - G), O); - case o: - case w: - return S(q + "Hours", 0); - case I: - return S(q + "Minutes", 1); - case f: - return S(q + "Seconds", 2); - case d: - return S(q + "Milliseconds", 3); + return h(R + "Minutes", 1); + case v: + return h(R + "Seconds", 2); + case r: + return h(R + "Milliseconds", 3); default: return this.clone(); } - }, n.endOf = function(a) { - return this.startOf(a, !1); - }, n.$set = function(a, l) { - var r, i = y.p(a), u = "set" + (this.$u ? "UTC" : ""), $ = (r = {}, r[o] = u + "Date", r[w] = u + "Date", r[V] = u + "Month", r[h] = u + "FullYear", r[I] = u + "Hours", r[f] = u + "Minutes", r[d] = u + "Seconds", r[M] = u + "Milliseconds", r)[i], S = i === o ? this.$D + (l - this.$W) : l; - if (i === V || i === h) { - var E = this.clone().set(w, 1); - E.$d[$](S), E.init(), this.$d = E.set(w, Math.min(this.$D, E.daysInMonth())).$d; - } else $ && this.$d[$](S); + }, s.endOf = function(o) { + return this.startOf(o, !1); + }, s.$set = function(o, u) { + var l, d = k.p(o), n = "set" + (this.$u ? "UTC" : ""), b = (l = {}, l[t] = n + "Date", l[O] = n + "Date", l[S] = n + "Month", l[M] = n + "FullYear", l[V] = n + "Hours", l[v] = n + "Minutes", l[r] = n + "Seconds", l[$] = n + "Milliseconds", l)[d], h = d === t ? this.$D + (u - this.$W) : u; + if (d === S || d === M) { + var D = this.clone().set(O, 1); + D.$d[b](h), D.init(), this.$d = D.set(O, Math.min(this.$D, D.daysInMonth())).$d; + } else b && this.$d[b](h); return this.init(), this; - }, n.set = function(a, l) { - return this.clone().$set(a, l); - }, n.get = function(a) { - return this[y.p(a)](); - }, n.add = function(a, l) { - var r, i = this; - a = Number(a); - var u = y.p(l), $ = function(O) { - var Y = k(i); - return y.w(Y.date(Y.date() + Math.round(O * a)), i); + }, s.set = function(o, u) { + return this.clone().$set(o, u); + }, s.get = function(o) { + return this[k.p(o)](); + }, s.add = function(o, u) { + var l, d = this; + o = Number(o); + var n = k.p(u), b = function(y) { + var I = T(d); + return k.w(I.date(I.date() + Math.round(y * o)), d); }; - if (u === V) return this.set(V, this.$M + a); - if (u === h) return this.set(h, this.$y + a); - if (u === o) return $(1); - if (u === m) return $(7); - var S = (r = {}, r[f] = p, r[I] = v, r[d] = c, r)[u] || 1, E = this.$d.getTime() + a * S; - return y.w(E, this); - }, n.subtract = function(a, l) { - return this.add(-1 * a, l); - }, n.format = function(a) { - var l = this, r = this.$locale(); - if (!this.isValid()) return r.invalidDate || g; - var i = a || "YYYY-MM-DDTHH:mm:ssZ", u = y.z(this), $ = this.$H, S = this.$m, E = this.$M, O = r.weekdays, Y = r.months, q = r.meridiem, F = function(U, N, Q, te) { - return U && (U[N] || U(l, i)) || Q[N].slice(0, te); - }, G = function(U) { - return y.s($ % 12 || 12, U, "0"); - }, L = q || function(U, N, Q) { - var te = U < 12 ? "AM" : "PM"; - return Q ? te.toLowerCase() : te; + if (n === S) return this.set(S, this.$M + o); + if (n === M) return this.set(M, this.$y + o); + if (n === t) return b(1); + if (n === B) return b(7); + var h = (l = {}, l[v] = m, l[V] = p, l[r] = c, l)[n] || 1, D = this.$d.getTime() + o * h; + return k.w(D, this); + }, s.subtract = function(o, u) { + return this.add(-1 * o, u); + }, s.format = function(o) { + var u = this, l = this.$locale(); + if (!this.isValid()) return l.invalidDate || w; + var d = o || "YYYY-MM-DDTHH:mm:ssZ", n = k.z(this), b = this.$H, h = this.$m, D = this.$M, y = l.weekdays, I = l.months, R = l.meridiem, j = function(U, P, X, ee) { + return U && (U[P] || U(u, d)) || X[P].slice(0, ee); + }, F = function(U) { + return k.s(b % 12 || 12, U, "0"); + }, W = R || function(U, P, X) { + var ee = U < 12 ? "AM" : "PM"; + return X ? ee.toLowerCase() : ee; }; - return i.replace(Ee, (function(U, N) { - return N || (function(Q) { - switch (Q) { + return d.replace(Y, (function(U, P) { + return P || (function(X) { + switch (X) { case "YY": - return String(l.$y).slice(-2); + return String(u.$y).slice(-2); case "YYYY": - return y.s(l.$y, 4, "0"); + return k.s(u.$y, 4, "0"); case "M": - return E + 1; + return D + 1; case "MM": - return y.s(E + 1, 2, "0"); + return k.s(D + 1, 2, "0"); case "MMM": - return F(r.monthsShort, E, Y, 3); + return j(l.monthsShort, D, I, 3); case "MMMM": - return F(Y, E); + return j(I, D); case "D": - return l.$D; + return u.$D; case "DD": - return y.s(l.$D, 2, "0"); + return k.s(u.$D, 2, "0"); case "d": - return String(l.$W); + return String(u.$W); case "dd": - return F(r.weekdaysMin, l.$W, O, 2); + return j(l.weekdaysMin, u.$W, y, 2); case "ddd": - return F(r.weekdaysShort, l.$W, O, 3); + return j(l.weekdaysShort, u.$W, y, 3); case "dddd": - return O[l.$W]; + return y[u.$W]; case "H": - return String($); + return String(b); case "HH": - return y.s($, 2, "0"); + return k.s(b, 2, "0"); case "h": - return G(1); + return F(1); case "hh": - return G(2); + return F(2); case "a": - return L($, S, !0); + return W(b, h, !0); case "A": - return L($, S, !1); + return W(b, h, !1); case "m": - return String(S); + return String(h); case "mm": - return y.s(S, 2, "0"); + return k.s(h, 2, "0"); case "s": - return String(l.$s); + return String(u.$s); case "ss": - return y.s(l.$s, 2, "0"); + return k.s(u.$s, 2, "0"); case "SSS": - return y.s(l.$ms, 3, "0"); + return k.s(u.$ms, 3, "0"); case "Z": - return u; + return n; } return null; - })(U) || u.replace(":", ""); + })(U) || n.replace(":", ""); })); - }, n.utcOffset = function() { + }, s.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, n.diff = function(a, l, r) { - var i, u = this, $ = y.p(l), S = k(a), E = (S.utcOffset() - this.utcOffset()) * p, O = this - S, Y = function() { - return y.m(u, S); + }, s.diff = function(o, u, l) { + var d, n = this, b = k.p(u), h = T(o), D = (h.utcOffset() - this.utcOffset()) * m, y = this - h, I = function() { + return k.m(n, h); }; - switch ($) { - case h: - i = Y() / 12; + switch (b) { + case M: + d = I() / 12; break; - case V: - i = Y(); + case S: + d = I(); break; case H: - i = Y() / 3; + d = I() / 3; break; - case m: - i = (O - E) / 6048e5; + case B: + d = (y - D) / 6048e5; break; - case o: - i = (O - E) / 864e5; + case t: + d = (y - D) / 864e5; break; - case I: - i = O / v; + case V: + d = y / p; break; - case f: - i = O / p; + case v: + d = y / m; break; - case d: - i = O / c; + case r: + d = y / c; break; default: - i = O; + d = y; } - return r ? i : y.a(i); - }, n.daysInMonth = function() { - return this.endOf(V).$D; - }, n.$locale = function() { - return j[this.$L]; - }, n.locale = function(a, l) { - if (!a) return this.$L; - var r = this.clone(), i = x(a, l, !0); - return i && (r.$L = i), r; - }, n.clone = function() { - return y.w(this.$d, this); - }, n.toDate = function() { + return l ? d : k.a(d); + }, s.daysInMonth = function() { + return this.endOf(S).$D; + }, s.$locale = function() { + return G[this.$L]; + }, s.locale = function(o, u) { + if (!o) return this.$L; + var l = this.clone(), d = oe(o, u, !0); + return d && (l.$L = d), l; + }, s.clone = function() { + return k.w(this.$d, this); + }, s.toDate = function() { return new Date(this.valueOf()); - }, n.toJSON = function() { + }, s.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, n.toISOString = function() { + }, s.toISOString = function() { return this.$d.toISOString(); - }, n.toString = function() { + }, s.toString = function() { return this.$d.toUTCString(); - }, s; - })(), ce = ee.prototype; - return k.prototype = ce, [["$ms", M], ["$s", d], ["$m", f], ["$H", I], ["$W", o], ["$M", V], ["$y", h], ["$D", w]].forEach((function(s) { - ce[s[1]] = function(n) { - return this.$g(n, s[0], s[1]); + }, i; + })(), f = z.prototype; + return T.prototype = f, [["$ms", $], ["$s", r], ["$m", v], ["$H", V], ["$W", t], ["$M", S], ["$y", M], ["$D", O]].forEach((function(i) { + f[i[1]] = function(s) { + return this.$g(s, i[0], i[1]); }; - })), k.extend = function(s, n) { - return s.$i || (s(n, ee, k), s.$i = !0), k; - }, k.locale = x, k.isDayjs = se, k.unix = function(s) { - return k(1e3 * s); - }, k.en = j[X], k.Ls = j, k.p = {}, k; + })), T.extend = function(i, s) { + return i.$i || (i(s, z, T), i.$i = !0), T; + }, T.locale = oe, T.isDayjs = se, T.unix = function(i) { + return T(1e3 * i); + }, T.en = G[ae], T.Ls = G, T.p = {}, T; })); - })(oe)), oe.exports; + })(me)), me.exports; } -var vt = pt(); -const ae = /* @__PURE__ */ ft(vt), yt = W({ +var Sa = Ma(); +const ce = /* @__PURE__ */ wa(Sa), Da = Q({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1048,42 +1048,42 @@ const ae = /* @__PURE__ */ ft(vt), yt = W({ foco: () => !0, desfoco: () => !0 }, - setup(e, { emit: t, attrs: c }) { - const p = T( + setup(e, { emit: a, attrs: c }) { + const m = C( () => e.modo === "data" ? "date" : "datetime-local" ); - function v(o) { - return e.modo === "data" ? ae(o).format("YYYY-MM-DD") : ae(o).format("YYYY-MM-DDTHH:mm"); + function p(t) { + return e.modo === "data" ? ce(t).format("YYYY-MM-DD") : ce(t).format("YYYY-MM-DDTHH:mm"); } - function M(o) { - return e.modo === "data" ? ae(`${o}T00:00`).format() : ae(o).format(); + function $(t) { + return e.modo === "data" ? ce(`${t}T00:00`).format() : ce(t).format(); } - const d = T({ - get: () => e.modelValue ? v(e.modelValue) : "", - set: (o) => { - const m = o && o.length > 0 ? o : null; - if (!m) { - t("update:modelValue", null), t("alterar", null); + const r = C({ + get: () => e.modelValue ? p(e.modelValue) : "", + set: (t) => { + const B = t && t.length > 0 ? t : null; + if (!B) { + a("update:modelValue", null), a("alterar", null); return; } - const V = M(m); - t("update:modelValue", V), t("alterar", V); + const S = $(B); + a("update:modelValue", S), a("alterar", S); } - }), f = T(() => { + }), v = C(() => { if (e.min) - return v(e.min); - }), I = T(() => { + return p(e.min); + }), V = C(() => { if (e.max) - return v(e.max); + return p(e.max); }); - return { attrs: c, valor: d, emit: t, minLocal: f, maxLocal: I, tipoInput: p }; + return { attrs: c, valor: r, emit: a, minLocal: v, maxLocal: V, tipoInput: m }; } -}), $t = { class: "eli-data-hora" }; -function gt(e, t, c, p, v, M) { - return B(), J("div", $t, [ - b(ge, z({ +}), Ca = { class: "eli-data-hora" }; +function Ba(e, a, c, m, p, $) { + return A(), q("div", Ca, [ + _(Ce, te({ modelValue: e.valor, - "onUpdate:modelValue": t[0] || (t[0] = (d) => e.valor = d), + "onUpdate:modelValue": a[0] || (a[0] = (r) => e.valor = r), type: e.tipoInput, label: e.rotulo, placeholder: e.placeholder, @@ -1098,14 +1098,318 @@ function gt(e, t, c, p, v, M) { min: e.minLocal, max: e.maxLocal }, e.attrs, { - onFocus: t[1] || (t[1] = (d) => e.emit("foco")), - onBlur: t[2] || (t[2] = (d) => e.emit("desfoco")) + onFocus: a[1] || (a[1] = (r) => e.emit("foco")), + onBlur: a[2] || (a[2] = (r) => e.emit("desfoco")) }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } -const bt = /* @__PURE__ */ R(yt, [["render", gt], ["__scopeId", "data-v-71afabb6"]]); -var ke = ((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))(ke || {}); -const ht = W({ +const Ea = /* @__PURE__ */ x(Da, [["render", Ba], ["__scopeId", "data-v-71afabb6"]]); +/** + * @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 _a = (e) => { + for (const a in e) + if (a.startsWith("aria-") || a === "role" || a === "title") + return !0; + return !1; +}; +/** + * @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 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 Pa = (...e) => e.filter((a, c, m) => !!a && a.trim() !== "" && m.indexOf(a) === c).join(" ").trim(); +/** + * @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 Se = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); +/** + * @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 Aa = (e) => e.replace( + /^([A-Z])|[\s-_]+(\w)/g, + (a, c, m) => m ? m.toUpperCase() : c.toLowerCase() +); +/** + * @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 Ta = (e) => { + const a = Aa(e); + return a.charAt(0).toUpperCase() + a.slice(1); +}; +/** + * @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. + */ +var ue = { + xmlns: "http://www.w3.org/2000/svg", + width: 24, + height: 24, + viewBox: "0 0 24 24", + fill: "none", + stroke: "currentColor", + "stroke-width": 2, + "stroke-linecap": "round", + "stroke-linejoin": "round" +}; +/** + * @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 = ({ + name: e, + iconNode: a, + absoluteStrokeWidth: c, + "absolute-stroke-width": m, + strokeWidth: p, + "stroke-width": $, + size: r = ue.width, + color: v = ue.stroke, + ...V +}, { slots: t }) => g( + "svg", + { + ...ue, + ...V, + width: r, + height: r, + stroke: v, + "stroke-width": Me(c) || Me(m) || c === !0 || m === !0 ? Number(p || $ || ue["stroke-width"]) * 24 / Number(r) : p || $ || ue["stroke-width"], + class: Pa( + "lucide", + V.class, + ...e ? [`lucide-${Se(Ta(e))}-icon`, `lucide-${Se(e)}`] : ["lucide-icon"] + ), + ...!t.default && !_a(V) && { "aria-hidden": "true" } + }, + [...a.map((B) => g(...B)), ...t.default ? [t.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 Ve = (e, a) => (c, { slots: m, attrs: p }) => g( + Ia, + { + ...p, + ...c, + iconNode: a, + name: e + }, + m +); +/** + * @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 Oa = Ve("arrow-down", [ + ["path", { d: "M12 5v14", key: "s699le" }], + ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }] +]); +/** + * @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 De = Ve("arrow-up", [ + ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }], + ["path", { d: "M12 19V5", key: "x0mq9r" }] +]); +/** + * @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 Ua = Ve("ellipsis-vertical", [ + ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }], + ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }], + ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }] +]); +var Oe = ((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))(Oe || {}); +const La = Q({ + name: "EliTabelaCaixaDeBusca", + props: { + modelo: { + type: String, + required: !1, + default: "" + } + }, + emits: { + buscar(e) { + return typeof e == "string"; + } + }, + setup(e, { emit: a }) { + const c = E(e.modelo ?? ""); + le( + () => e.modelo, + (p) => { + p !== void 0 && p !== c.value && (c.value = p); + } + ); + function m() { + a("buscar", c.value.trim()); + } + return { texto: c, emitirBusca: m }; + } +}), Na = { class: "eli-tabela__busca" }, ja = { class: "eli-tabela__busca-input-wrapper" }; +function Ha(e, a, c, m, p, $) { + return A(), q("div", Na, [ + K("div", ja, [ + Le(K("input", { + id: "eli-tabela-busca", + "onUpdate:modelValue": a[0] || (a[0] = (r) => e.texto = r), + type: "search", + class: "eli-tabela__busca-input", + placeholder: "Digite termos para filtrar", + onKeyup: a[1] || (a[1] = Ne((...r) => e.emitirBusca && e.emitirBusca(...r), ["enter"])) + }, null, 544), [ + [je, e.texto] + ]), + K("button", { + type: "button", + class: "eli-tabela__busca-botao", + onClick: a[2] || (a[2] = (...r) => e.emitirBusca && e.emitirBusca(...r)) + }, " Buscar ") + ]) + ]); +} +const Ya = /* @__PURE__ */ x(La, [["render", Ha], ["__scopeId", "data-v-2aeb8274"]]), za = Q({ + 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 = C(() => { + const t = e.maximoBotoes; + return typeof t == "number" && t >= 5 ? Math.floor(t) : 7; + }), m = C(() => { + const t = e.totalPaginas, B = e.pagina, S = c.value, H = [], M = (N) => { + H.push({ + label: String(N), + pagina: N, + ativo: N === B + }); + }, O = () => { + H.push({ label: "…", ehEllipsis: !0 }); + }; + if (t <= S) { + for (let N = 1; N <= t; N += 1) + M(N); + return H; + } + const w = Math.max(3, S - 2); + let Z = Math.max(2, B - Math.floor(w / 2)), Y = Z + w - 1; + Y >= t && (Y = t - 1, Z = Y - w + 1), M(1), Z > 2 && O(); + for (let N = Z; N <= Y; N += 1) + M(N); + return Y < t - 1 && O(), M(t), H; + }); + function p(t) { + if (!t) + return; + const B = Math.min(Math.max(1, t), e.totalPaginas); + B !== e.pagina && a("alterar", B); + } + const $ = C(() => e.pagina <= 1), r = C(() => e.pagina >= e.totalPaginas), v = C(() => e.pagina), V = C(() => e.totalPaginas); + return { + botoes: m, + irParaPagina: p, + anteriorDesabilitado: $, + proximaDesabilitada: r, + paginaAtual: v, + totalPaginasExibidas: V + }; + } +}), Fa = { + key: 0, + class: "eli-tabela__paginacao", + role: "navigation", + "aria-label": "Paginação de resultados" +}, qa = ["disabled"], Ra = { + key: 0, + class: "eli-tabela__pagina-ellipsis", + "aria-hidden": "true" +}, Wa = ["disabled", "aria-current", "aria-label", "onClick"], Ja = ["disabled"]; +function Za(e, a, c, m, p, $) { + return e.totalPaginasExibidas > 1 ? (A(), q("nav", Fa, [ + K("button", { + type: "button", + class: "eli-tabela__pagina-botao", + disabled: e.anteriorDesabilitado, + "aria-label": "Página anterior", + onClick: a[0] || (a[0] = (r) => e.irParaPagina(e.paginaAtual - 1)) + }, " << ", 8, qa), + (A(!0), q(ve, null, ge(e.botoes, (r, v) => (A(), q(ve, { + key: `${r.label}-${v}` + }, [ + r.ehEllipsis ? (A(), q("span", Ra, pe(r.label), 1)) : (A(), q("button", { + key: 1, + type: "button", + class: He(["eli-tabela__pagina-botao", r.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + disabled: r.ativo, + "aria-current": r.ativo ? "page" : void 0, + "aria-label": `Ir para página ${r.label}`, + onClick: (V) => e.irParaPagina(r.pagina) + }, pe(r.label), 11, Wa)) + ], 64))), 128)), + K("button", { + type: "button", + class: "eli-tabela__pagina-botao", + disabled: e.proximaDesabilitada, + "aria-label": "Próxima página", + onClick: a[1] || (a[1] = (r) => e.irParaPagina(e.paginaAtual + 1)) + }, " >> ", 8, Ja) + ])) : he("", !0); +} +const Xa = /* @__PURE__ */ x(za, [["render", Za], ["__scopeId", "data-v-59d12455"]]), Ga = Q({ name: "EliTabela", inheritAttrs: !1, props: { @@ -1118,34 +1422,68 @@ const ht = W({ } }, setup(e) { - const t = D(!1), c = D(null), p = D([]), v = D(0); - function M(m) { - return m == null || m === !1 ? "" : m; + const a = E(!1), c = E(null), m = E([]), p = E(0), $ = E([]), r = E(null), v = /* @__PURE__ */ new Map(), V = E(""), t = E(1), B = E(null), S = E("asc"), H = C(() => !!e.tabela.mostrarCaixaDeBusca), M = C(() => e.tabela.acoesTabela ?? []), O = C(() => M.value.length > 0), w = C(() => { + const f = e.tabela.registros_por_consulta; + return typeof f == "number" && f > 0 ? Math.floor(f) : 10; + }), Z = C(() => { + const f = w.value; + if (!f || f <= 0) + return 1; + const i = p.value; + return i ? Math.max(1, Math.ceil(i / f)) : 1; + }); + let Y = 0; + function N(f, i) { + i ? v.set(f, i) : v.delete(f); } - function d(m) { - return P( + function ne(f) { + return (i) => { + i instanceof HTMLElement ? N(f, i) : N(f, null); + }; + } + function be(f) { + f && (B.value === f ? (S.value = S.value === "asc" ? "desc" : "asc", z()) : (B.value = f, S.value = "asc", t.value !== 1 ? t.value = 1 : z())); + } + function ae(f) { + V.value !== f && (V.value = f, t.value !== 1 ? t.value = 1 : z()); + } + function G(f) { + const i = Math.min(Math.max(1, f), Z.value); + i !== t.value && (t.value = i); + } + function ie(f) { + if (r.value === null) + return; + const i = v.get(r.value); + i && i.contains(f.target) || (r.value = null); + } + function se(f) { + return f == null || f === !1 ? "" : f; + } + function oe(f) { + return g( "div", { class: "eli-tabela eli-tabela--erro", role: "alert" }, [ - P("div", { class: "eli-tabela__erro-titulo" }, "Erro"), - P("div", { class: "eli-tabela__erro-mensagem" }, m) + g("div", { class: "eli-tabela__erro-titulo" }, "Erro"), + g("div", { class: "eli-tabela__erro-mensagem" }, f) ] ); } - function f(m) { - return P( + function T(f) { + return g( "div", { class: "eli-tabela eli-tabela--vazio" }, - m ?? "Nenhum registro encontrado." + f ?? "Nenhum registro encontrado." ); } - function I() { - return P( + function k() { + return g( "div", { class: "eli-tabela eli-tabela--carregando", @@ -1154,99 +1492,350 @@ const ht = W({ "Carregando..." ); } - async function o() { - t.value = !0, c.value = null; + async function z() { + var u, l; + const f = ++Y; + a.value = !0, c.value = null, $.value = [], r.value = null, v.clear(); + const i = Math.max(1, w.value), o = { + offSet: (t.value - 1) * i, + limit: i + }; + V.value && (o.texto_busca = V.value), B.value && (o.coluna_ordem = B.value, o.direcao_ordem = S.value); try { - const m = await e.tabela.resposta(); - if (m.cod !== ke.sucesso) { - p.value = [], v.value = 0, c.value = m.mensagem; + const d = e.tabela, n = await d.consulta(o); + if (f !== Y) + return; + if (n.cod !== Oe.sucesso) { + m.value = [], p.value = 0, c.value = n.mensagem; return; } - p.value = m.valor.valores, v.value = m.valor.quantidade; - } catch (m) { - p.value = [], v.value = 0, c.value = m instanceof Error ? m.message : "Erro ao carregar dados."; + const b = ((u = n.valor) == null ? void 0 : u.valores) ?? [], h = ((l = n.valor) == null ? void 0 : l.quantidade) ?? b.length; + m.value = b, p.value = h; + const D = Math.max( + 1, + Math.ceil((h || 0) / i) + ); + if (t.value > D) { + t.value = D; + return; + } + const y = d.acoesLinha ?? []; + if (!y.length) { + $.value = []; + return; + } + const I = b.map( + () => y.map((j) => j.exibir === void 0 ? !0 : typeof j.exibir == "boolean" ? j.exibir : !1) + ); + $.value = I; + const R = await Promise.all( + b.map( + async (j) => Promise.all( + y.map(async (F) => { + if (F.exibir === void 0) + return !0; + if (typeof F.exibir == "boolean") + return F.exibir; + try { + const W = F.exibir(j); + return !!await Promise.resolve(W); + } catch { + return !1; + } + }) + ) + ) + ); + f === Y && ($.value = R); + } catch (d) { + if (f !== Y) + return; + m.value = [], p.value = 0, c.value = d instanceof Error ? d.message : "Erro ao carregar dados."; } finally { - t.value = !1; + f === Y && (a.value = !1); } } - return Oe(o), Te( + return Ye(() => { + document.addEventListener("click", ie), z(); + }), le( + () => e.tabela.mostrarCaixaDeBusca, + (f) => { + !f && V.value && (V.value = "", t.value !== 1 ? t.value = 1 : z()); + } + ), le(t, (f, i) => { + f !== i && z(); + }), ze(() => { + document.removeEventListener("click", ie), v.clear(); + }), le( () => e.tabela, () => { - o(); + r.value = null, v.clear(), B.value = null, S.value = "asc", V.value = "", t.value !== 1 ? t.value = 1 : z(); } - ), () => { - const m = e.tabela; - if (t.value) - return I(); + ), le( + () => e.tabela.registros_por_consulta, + () => { + t.value !== 1 ? t.value = 1 : z(); + } + ), le(m, () => { + r.value = null, v.clear(); + }), () => { + const f = e.tabela; + if (a.value) + return k(); if (c.value) - return d(c.value); - const V = m.colunas; - return p.value.length ? P( + return oe(c.value); + const i = f.colunas, s = f.acoesLinha ?? [], o = s.length > 0; + if (!m.value.length) + return T(f.mensagemVazio); + const u = i.map((d) => { + const n = d.coluna_ordem !== void 0 ? d.coluna_ordem : void 0, b = !!n, h = b && B.value === n, D = b ? h ? g(S.value === "asc" ? De : Oa, { + class: "eli-tabela__th-icone", + size: 16, + strokeWidth: 2, + "aria-hidden": "true" + }) : g(De, { + class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", + size: 16, + strokeWidth: 2, + "aria-hidden": "true" + }) : null, y = b ? g( + "button", + { + type: "button", + class: [ + "eli-tabela__th-botao", + h ? "eli-tabela__th-botao--ativo" : void 0 + ], + onClick: () => be(n) + }, + [ + g("span", { class: "eli-tabela__th-texto" }, d.rotulo), + D + ] + ) : g("span", { class: "eli-tabela__th-label" }, d.rotulo); + return g( + "th", + { + class: [ + "eli-tabela__th", + b ? "eli-tabela__th--ordenavel" : void 0 + ], + scope: "col" + }, + y + ); + }); + o && u.push( + g( + "th", + { class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" }, + "Ações" + ) + ); + const l = []; + if (H.value || O.value) { + const d = M.value.map( + (n, b) => g( + "button", + { + key: `${n.rotulo}-${b}`, + type: "button", + class: "eli-tabela__acoes-cabecalho-botao", + style: n.cor ? { backgroundColor: n.cor } : void 0, + onClick: n.acao + }, + [ + n.icone ? g(n.icone, { + class: "eli-tabela__acoes-cabecalho-icone", + size: 16, + strokeWidth: 2 + }) : null, + g("span", { class: "eli-tabela__acoes-cabecalho-rotulo" }, n.rotulo) + ] + ) + ); + l.push( + g("div", { class: "eli-tabela__cabecalho" }, [ + H.value ? g(Ya, { + modelo: V.value, + onBuscar: ae + }) : null, + O.value ? g("div", { class: "eli-tabela__acoes-cabecalho" }, d) : null + ]) + ); + } + return l.push( + g("table", { class: "eli-tabela__table" }, [ + g( + "thead", + { class: "eli-tabela__thead" }, + g( + "tr", + { class: "eli-tabela__tr eli-tabela__tr--header" }, + u + ) + ), + g( + "tbody", + { class: "eli-tabela__tbody" }, + m.value.map((d, n) => { + const b = i.map( + (h, D) => g( + "td", + { + class: [ + "eli-tabela__td", + h.acao ? "eli-tabela__td--clicavel" : void 0 + ], + key: `${n}-${D}`, + onClick: h.acao ? () => { + var y; + return (y = h.acao) == null ? void 0 : y.call(h); + } : void 0 + }, + se(h.celula(d)) + ) + ); + if (o) { + const h = $.value[n] ?? [], D = s.map((P, X) => { + const ee = P.exibir === void 0 ? !0 : typeof P.exibir == "boolean" ? P.exibir : !1; + return { + acao: P, + indice: X, + visivel: h[X] ?? ee + }; + }).filter((P) => P.visivel), y = D.length > 0; + !y && r.value === n && (r.value = null); + const I = r.value === n, R = `eli-tabela-acoes-toggle-${n}`, j = `eli-tabela-acoes-menu-${n}`, F = g( + "button", + { + id: R, + class: "eli-tabela__acoes-toggle", + type: "button", + disabled: !y, + onClick: (P) => { + P.stopPropagation(), y && (r.value = I ? null : n); + }, + "aria-haspopup": "menu", + "aria-expanded": I ? "true" : "false", + "aria-controls": y ? j : void 0, + "aria-label": y ? "Ações da linha" : "Nenhuma ação disponível", + title: y ? "Ações" : "Nenhuma ação disponível" + }, + [ + g(Ua, { + class: "eli-tabela__acoes-toggle-icone", + size: 18, + strokeWidth: 2 + }) + ] + ), W = I && y ? g( + "ul", + { + id: j, + class: "eli-tabela__acoes-menu", + role: "menu", + "aria-labelledby": R + }, + D.map( + ({ acao: P, indice: X }) => g( + "li", + { + key: `acao-${X}`, + class: "eli-tabela__acoes-item", + role: "none" + }, + g( + "button", + { + type: "button", + class: "eli-tabela__acoes-item-botao", + style: { + color: P.cor + }, + onClick: (ee) => { + ee.stopPropagation(), r.value = null, P.acao(d); + }, + role: "menuitem", + "aria-label": P.rotulo, + title: P.rotulo + }, + [ + g(P.icone, { + class: "eli-tabela__acoes-item-icone", + size: 16, + strokeWidth: 2 + }), + g( + "span", + { class: "eli-tabela__acoes-item-texto" }, + P.rotulo + ) + ] + ) + ) + ) + ) : null, U = ["eli-tabela__acoes-container"]; + I && U.push("eli-tabela__acoes-container--aberto"), b.push( + g( + "td", + { + class: ["eli-tabela__td", "eli-tabela__td--acoes"], + key: `${n}-acoes` + }, + g( + "div", + { + class: U, + ref: ne(n) + }, + [F, W] + ) + ) + ); + } + return g( + "tr", + { class: "eli-tabela__tr", key: n }, + b + ); + }) + ) + ]) + ), Z.value > 1 && p.value > 0 && l.push( + g(Xa, { + pagina: t.value, + totalPaginas: Z.value, + maximoBotoes: e.tabela.maximo_botoes_paginacao, + onAlterar: (d) => { + G(d); + } + }) + ), g( "div", { class: "eli-tabela" }, - [ - P("table", { class: "eli-tabela__table" }, [ - P( - "thead", - { class: "eli-tabela__thead" }, - P( - "tr", - { class: "eli-tabela__tr eli-tabela__tr--header" }, - V.map( - (H) => P("th", { class: "eli-tabela__th", scope: "col" }, H.rotulo) - ) - ) - ), - P( - "tbody", - { class: "eli-tabela__tbody" }, - p.value.map( - (H, h) => P( - "tr", - { class: "eli-tabela__tr", key: h }, - V.map( - (w, g) => P( - "td", - { - class: [ - "eli-tabela__td", - w.acao ? "eli-tabela__td--clicavel" : void 0 - ], - key: `${h}-${g}`, - onClick: w.acao ? () => { - var _; - return (_ = w.acao) == null ? void 0 : _.call(w); - } : void 0 - }, - M(w.celula(H)) - ) - ) - ) - ) - ) - ]) - ] - ) : f(m.mensagemVazio); + l + ); }; } }); -function Vt(e, t, c, p, v, M) { - return B(), J("div"); +function Ka(e, a, c, m, p, $) { + return A(), q("div"); } -const St = /* @__PURE__ */ R(ht, [["render", Vt], ["__scopeId", "data-v-cc67b529"]]), Yt = { +const Qa = /* @__PURE__ */ x(Ga, [["render", Ka], ["__scopeId", "data-v-c6b8c95b"]]), ct = { install(e) { - e.component("EliOlaMundo", lt), e.component("EliBotao", Me), e.component("EliBadge", ie), e.component("EliInput", De), e.component("EliCartao", ct), e.component("EliDataHora", bt), e.component("EliTabela", St); + e.component("EliOlaMundo", ba), e.component("EliBotao", Ae), e.component("EliBadge", ye), e.component("EliInput", Ie), e.component("EliCartao", Va), e.component("EliDataHora", Ea), e.component("EliTabela", Qa); } }; export { - ie as EliBadge, - Me as EliBotao, - ct as EliCartao, - bt as EliDataHora, - De as EliInput, - lt as EliOlaMundo, - St as EliTabela, - Yt as default + ye as EliBadge, + Ae as EliBotao, + Va as EliCartao, + Ea as EliDataHora, + Ie as EliInput, + ba as EliOlaMundo, + Qa as EliTabela, + ct as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index a271f74..5021b9f 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1 +1,61 @@ -(function(V,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):(V=typeof globalThis<"u"?globalThis:V||self,t(V.eli_vue={},V.Vue,V.VBtn,V.VBadge,V.VCheckbox,V.VIcon,V.VRadio,V.VRadioGroup,V.VSelect,V.VTextField,V.VTextarea,V.VCard,V.VGrid))})(this,(function(V,t,fe,me,pe,ye,he,$e,ge,te,Ve,O,be){"use strict";const Se=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}}}),U=(e,a)=>{const f=e.__vccOpts||e;for(const[y,h]of a)f[y]=h;return f};function Be(e,a,f,y,h,w){return t.openBlock(),t.createBlock(fe.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 Q=U(Se,[["render",Be]]),ae={suave:"4px",pill:"10px"},ke=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 ae?ae[e.radius]:e.radius),f=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),y=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:f,badgeStyle:y}}});function we(e,a,f,y,h,w){return e.showBadge?(t.openBlock(),t.createBlock(me.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 z=U(ke,[["render",we],["__scopeId","data-v-de2fbf2f"]]);function Ce(e){return e.replace(/\D+/g,"")}function Me(e){const a=Ce(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 De(e){return e.replace(/\D+/g,"")}function Ee(e){const a=De(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 K(e){return e.replace(/\D+/g,"")}function re(e){const a=e.replace(/[^\d,]/g,""),f=a.split(",");return f.length>2?f[0]+","+f.slice(1).join(""):a}function ve(e){return re(e.replace(/%/g,""))}function Ne(e){const a=K(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function Te(e){const a=K(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Ie=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:f}){const y=t.ref(!1),h=t.ref(!1),w=t.computed({get:()=>e.modelValue,set:S=>{a("update:modelValue",S),a("change",S)}}),c=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),m=t.computed(()=>e.type==="password"?h.value?"text":"password":"text"),E=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":y.value?e.color:void 0);function p(S){const C=S.target;let b=C.value;switch(e.type){case"numericoInteiro":b=K(b);break;case"numericoDecimal":b=re(b);break;case"numericoMoeda":b=Ne(b);break;case"porcentagem":b=ve(b);break;case"telefone":b=Ee(b);break;case"cpfCnpj":b=Me(b);break;case"cep":b=Te(b);break}C.value=b,a("update:modelValue",b),a("change",b)}function B(){h.value=!h.value}const I=t.computed(()=>(e.options||[]).map(S=>{if(S&&typeof S=="object"&&"value"in S){const b=S.value;return{label:S.label??String(b),value:b,disabled:S.disabled}}const C=S;return{label:String(C),value:C}}));return{attrs:f,value:w,isTextLike:c,inputHtmlType:m,inputMode:E,internalColor:l,showPassword:h,togglePassword:B,onInput:p,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:I}}}),Oe={class:"eli-input"},Pe={key:4,class:"checkbox-group"};function Ue(e,a,f,y,h,w){return t.openBlock(),t.createElementBlock("div",Oe,[e.isTextLike?(t.openBlock(),t.createBlock(te.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=c=>e.value=c),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(ye.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(Ve.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=c=>e.value=c),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(ge.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=c=>e.value=c),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($e.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=c=>e.value=c),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,c=>(t.openBlock(),t.createBlock(he.VRadio,{key:String(c.value),label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Pe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,c=>(t.openBlock(),t.createBlock(pe.VCheckbox,{key:String(c.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=m=>e.value=m),label:c.label,value:c.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const _=U(Ie,[["render",Ue],["__scopeId","data-v-756cb549"]]),Ae=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:Q,EliBadge:z,EliInput:_},setup(){const e=t.ref(""),a=t.ref([]),f=t.ref(""),y=t.ref(""),h=t.ref(""),w=t.ref(""),c=t.ref(""),m=t.ref(""),E=t.ref(""),l=t.ref(""),p=t.ref(""),B=t.ref(null),I=t.ref([]);return{nome:e,email:m,documento:p,estado:a,telefone:y,mensagem:E,senha:l,cor:B,habilidades:I,idade:h,altura:w,cep:f,valor:c}}}),He={class:"grid-example"};function Ye(e,a,f,y,h,w){const c=t.resolveComponent("EliBadge"),m=t.resolveComponent("EliInput"),E=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(be.VContainer,null,{default:t.withCtx(()=>[t.createVNode(O.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(O.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(c,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(O.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",He,[t.createVNode(m,{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(m,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=l=>e.idade=l),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=l=>e.altura=l),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=l=>e.valor=l),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=l=>e.telefone=l),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(m,{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(m,{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(m,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=l=>e.documento=l),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=l=>e.email=l),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(m,{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(m,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=l=>e.mensagem=l),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(m,{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(m,{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(m,{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(O.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(E,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const oe=U(Ae,[["render",Ye]]),je=t.defineComponent({name:"EliCartao",components:{EliBadge:z},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 f=t.computed(()=>e.status),y=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),h=t.computed(()=>`eli-cartao--${e.status}`);function w(){a("clicar",e.status)}return{rotuloStatus:f,corStatus:y,classeStatus:h,onClick:w}}}),Fe={class:"eli-cartao__titulo-texto"},qe={class:"eli-cartao__status"};function Le(e,a,f,y,h,w){const c=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(O.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(O.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Fe,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",qe,[t.createVNode(c,{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(O.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(O.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 ne=U(je,[["render",Le],["__scopeId","data-v-6c492bd9"]]);function ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R={exports:{}},Re=R.exports,le;function We(){return le||(le=1,(function(e,a){(function(f,y){e.exports=y()})(Re,(function(){var f=1e3,y=6e4,h=36e5,w="millisecond",c="second",m="minute",E="hour",l="day",p="week",B="month",I="quarter",S="year",C="date",b="Invalid Date",G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,xe=/\[([^\]]+)]|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,et={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(s){var n=["th","st","nd","rd"],r=s%100;return"["+s+(n[(r-20)%10]||n[r]||n[0])+"]"}},x=function(s,n,r){var i=String(s);return!i||i.length>=n?s:""+Array(n+1-i.length).join(r)+s},tt={s:x,z:function(s){var n=-s.utcOffset(),r=Math.abs(n),i=Math.floor(r/60),o=r%60;return(n<=0?"+":"-")+x(i,2,"0")+":"+x(o,2,"0")},m:function s(n,r){if(n.date()1)return s(u[0])}else{var g=n.name;A[g]=n,o=g}return!i&&o&&(F=o),o||!i&&F},M=function(s,n){if(ee(s))return s.clone();var r=typeof n=="object"?n:{};return r.date=s,r.args=arguments,new Z(r)},$=tt;$.l=J,$.i=ee,$.w=function(s,n){return M(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var Z=(function(){function s(r){this.$L=J(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[ue]=!0}var n=s.prototype;return n.parse=function(r){this.$d=(function(i){var o=i.date,d=i.utc;if(o===null)return new Date(NaN);if($.u(o))return new Date;if(o instanceof Date)return new Date(o);if(typeof o=="string"&&!/Z$/i.test(o)){var u=o.match(G);if(u){var g=u[2]-1||0,k=(u[7]||"0").substring(0,3);return d?new Date(Date.UTC(u[1],g,u[3]||1,u[4]||0,u[5]||0,u[6]||0,k)):new Date(u[1],g,u[3]||1,u[4]||0,u[5]||0,u[6]||0,k)}}return new Date(o)})(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 $},n.isValid=function(){return this.$d.toString()!==b},n.isSame=function(r,i){var o=M(r);return this.startOf(i)<=o&&o<=this.endOf(i)},n.isAfter=function(r,i){return M(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:f}){const y=t.computed(()=>e.modo==="data"?"date":"datetime-local");function h(l){return e.modo==="data"?W(l).format("YYYY-MM-DD"):W(l).format("YYYY-MM-DDTHH:mm")}function w(l){return e.modo==="data"?W(`${l}T00:00`).format():W(l).format()}const c=t.computed({get:()=>e.modelValue?h(e.modelValue):"",set:l=>{const p=l&&l.length>0?l:null;if(!p){a("update:modelValue",null),a("alterar",null);return}const B=w(p);a("update:modelValue",B),a("alterar",B)}}),m=t.computed(()=>{if(e.min)return h(e.min)}),E=t.computed(()=>{if(e.max)return h(e.max)});return{attrs:f,valor:c,emit:a,minLocal:m,maxLocal:E,tipoInput:y}}}),Ze={class:"eli-data-hora"};function Xe(e,a,f,y,h,w){return t.openBlock(),t.createElementBlock("div",Ze,[t.createVNode(te.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=c=>e.valor=c),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]=c=>e.emit("foco")),onBlur:a[2]||(a[2]=c=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const ie=U(Je,[["render",Xe],["__scopeId","data-v-71afabb6"]]);var se=(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))(se||{});const Qe=t.defineComponent({name:"EliTabela",inheritAttrs:!1,props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),f=t.ref(null),y=t.ref([]),h=t.ref(0);function w(p){return p==null||p===!1?"":p}function c(p){return t.h("div",{class:"eli-tabela eli-tabela--erro",role:"alert"},[t.h("div",{class:"eli-tabela__erro-titulo"},"Erro"),t.h("div",{class:"eli-tabela__erro-mensagem"},p)])}function m(p){return t.h("div",{class:"eli-tabela eli-tabela--vazio"},p??"Nenhum registro encontrado.")}function E(){return t.h("div",{class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},"Carregando...")}async function l(){a.value=!0,f.value=null;try{const p=await e.tabela.resposta();if(p.cod!==se.sucesso){y.value=[],h.value=0,f.value=p.mensagem;return}y.value=p.valor.valores,h.value=p.valor.quantidade}catch(p){y.value=[],h.value=0,f.value=p instanceof Error?p.message:"Erro ao carregar dados."}finally{a.value=!1}}return t.onMounted(l),t.watch(()=>e.tabela,()=>{l()}),()=>{const p=e.tabela;if(a.value)return E();if(f.value)return c(f.value);const B=p.colunas;return y.value.length?t.h("div",{class:"eli-tabela"},[t.h("table",{class:"eli-tabela__table"},[t.h("thead",{class:"eli-tabela__thead"},t.h("tr",{class:"eli-tabela__tr eli-tabela__tr--header"},B.map(I=>t.h("th",{class:"eli-tabela__th",scope:"col"},I.rotulo)))),t.h("tbody",{class:"eli-tabela__tbody"},y.value.map((I,S)=>t.h("tr",{class:"eli-tabela__tr",key:S},B.map((C,b)=>t.h("td",{class:["eli-tabela__td",C.acao?"eli-tabela__td--clicavel":void 0],key:`${S}-${b}`,onClick:C.acao?()=>{var G;return(G=C.acao)==null?void 0:G.call(C)}:void 0},w(C.celula(I)))))))])]):m(p.mensagemVazio)}}});function Ke(e,a,f,y,h,w){return t.openBlock(),t.createElementBlock("div")}const de=U(Qe,[["render",Ke],["__scopeId","data-v-cc67b529"]]),_e={install(e){e.component("EliOlaMundo",oe),e.component("EliBotao",Q),e.component("EliBadge",z),e.component("EliInput",_),e.component("EliCartao",ne),e.component("EliDataHora",ie),e.component("EliTabela",de)}};V.EliBadge=z,V.EliBotao=Q,V.EliCartao=ne,V.EliDataHora=ie,V.EliInput=_,V.EliOlaMundo=oe,V.EliTabela=de,V.default=_e,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); +(function(E,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):(E=typeof globalThis<"u"?globalThis:E||self,t(E.eli_vue={},E.Vue,E.VBtn,E.VBadge,E.VCheckbox,E.VIcon,E.VRadio,E.VRadioGroup,E.VSelect,E.VTextField,E.VTextarea,E.VCard,E.VGrid))})(this,(function(E,t,Ve,ke,Be,ve,we,Ce,Se,se,Me,W,Ee){"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}}}),z=(e,a)=>{const f=e.__vccOpts||e;for(const[p,h]of a)f[p]=h;return f};function Ne(e,a,f,p,h,V){return t.openBlock(),t.createBlock(Ve.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 oe=z(De,[["render",Ne]]),de={suave:"4px",pill:"10px"},Pe=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 de?de[e.radius]:e.radius),f=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),p=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:f,badgeStyle:p}}});function _e(e,a,f,p,h,V){return e.showBadge?(t.openBlock(),t.createBlock(ke.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 ee=z(Pe,[["render",_e],["__scopeId","data-v-de2fbf2f"]]);function Te(e){return e.replace(/\D+/g,"")}function Ie(e){const a=Te(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 Ae(e){return e.replace(/\D+/g,"")}function Oe(e){const a=Ae(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 ne(e){return e.replace(/\D+/g,"")}function ue(e){const a=e.replace(/[^\d,]/g,""),f=a.split(",");return f.length>2?f[0]+","+f.slice(1).join(""):a}function Ue(e){return ue(e.replace(/%/g,""))}function Le(e){const a=ne(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function qe(e){const a=ne(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:f}){const p=t.ref(!1),h=t.ref(!1),V=t.computed({get:()=>e.modelValue,set:w=>{a("update:modelValue",w),a("change",w)}}),l=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),b=t.computed(()=>e.type==="password"?h.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"}),o=t.computed(()=>e.error?"error":p.value?e.color:void 0);function M(w){const _=w.target;let B=_.value;switch(e.type){case"numericoInteiro":B=ne(B);break;case"numericoDecimal":B=ue(B);break;case"numericoMoeda":B=Le(B);break;case"porcentagem":B=Ue(B);break;case"telefone":B=Oe(B);break;case"cpfCnpj":B=Ie(B);break;case"cep":B=qe(B);break}_.value=B,a("update:modelValue",B),a("change",B)}function C(){h.value=!h.value}const O=t.computed(()=>(e.options||[]).map(w=>{if(w&&typeof w=="object"&&"value"in w){const B=w.value;return{label:w.label??String(B),value:B,disabled:w.disabled}}const _=w;return{label:String(_),value:_}}));return{attrs:f,value:V,isTextLike:l,inputHtmlType:b,inputMode:k,internalColor:o,showPassword:h,togglePassword:C,onInput:M,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:O}}}),je={class:"eli-input"},He={key:4,class:"checkbox-group"};function Ye(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div",je,[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(ve.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(Se.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(Ce.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(we.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",He,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Be.VCheckbox,{key:String(l.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=b=>e.value=b),label:l.label,value:l.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const re=z(Fe,[["render",Ye],["__scopeId","data-v-756cb549"]]),ze=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:oe,EliBadge:ee,EliInput:re},setup(){const e=t.ref(""),a=t.ref([]),f=t.ref(""),p=t.ref(""),h=t.ref(""),V=t.ref(""),l=t.ref(""),b=t.ref(""),k=t.ref(""),o=t.ref(""),M=t.ref(""),C=t.ref(null),O=t.ref([]);return{nome:e,email:b,documento:M,estado:a,telefone:p,mensagem:k,senha:o,cor:C,habilidades:O,idade:h,altura:V,cep:f,valor:l}}}),Re={class:"grid-example"};function We(e,a,f,p,h,V){const l=t.resolveComponent("EliBadge"),b=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ee.VContainer,null,{default:t.withCtx(()=>[t.createVNode(W.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(W.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(W.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Re,[t.createVNode(b,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=o=>e.nome=o),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=o=>e.idade=o),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=o=>e.altura=o),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=o=>e.valor=o),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=o=>e.telefone=o),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=o=>e.cep=o),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(b,{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]=o=>e.estado=o),multiple:""},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=o=>e.documento=o),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=o=>e.email=o),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=o=>e.senha=o),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(b,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=o=>e.mensagem=o),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(b,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=o=>e.cor=o),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(b,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=o=>e.habilidades=o),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=o=>e.nome=o),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(W.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 ce=z(ze,[["render",We]]),Ge=t.defineComponent({name:"EliCartao",components:{EliBadge:ee},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 f=t.computed(()=>e.status),p=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),h=t.computed(()=>`eli-cartao--${e.status}`);function V(){a("clicar",e.status)}return{rotuloStatus:f,corStatus:p,classeStatus:h,onClick:V}}}),Je={class:"eli-cartao__titulo-texto"},Ze={class:"eli-cartao__status"};function Xe(e,a,f,p,h,V){const l=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(W.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(W.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Je,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Ze,[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(W.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(W.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 fe=z(Ge,[["render",Xe],["__scopeId","data-v-6c492bd9"]]);function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}},Qe=te.exports,me;function xe(){return me||(me=1,(function(e,a){(function(f,p){e.exports=p()})(Qe,(function(){var f=1e3,p=6e4,h=36e5,V="millisecond",l="second",b="minute",k="hour",o="day",M="week",C="month",O="quarter",w="year",_="date",B="Invalid Date",H=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|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,I={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(s){var d=["th","st","nd","rd"],n=s%100;return"["+s+(d[(n-20)%10]||d[n]||d[0])+"]"}},K=function(s,d,n){var u=String(s);return!u||u.length>=d?s:""+Array(d+1-u.length).join(n)+s},ie={s:K,z:function(s){var d=-s.utcOffset(),n=Math.abs(d),u=Math.floor(n/60),r=n%60;return(d<=0?"+":"-")+K(u,2,"0")+":"+K(r,2,"0")},m:function s(d,n){if(d.date()1)return s(i[0])}else{var g=d.name;R[g]=d,r=g}return!u&&r&&(J=r),r||!u&&J},N=function(s,d){if(x(s))return s.clone();var n=typeof d=="object"?d:{};return n.date=s,n.args=arguments,new L(n)},v=ie;v.l=Z,v.i=x,v.w=function(s,d){return N(s,{locale:d.$L,utc:d.$u,x:d.$x,$offset:d.$offset})};var L=(function(){function s(n){this.$L=Z(n.locale,null,!0),this.parse(n),this.$x=this.$x||n.x||{},this[Q]=!0}var d=s.prototype;return d.parse=function(n){this.$d=(function(u){var r=u.date,c=u.utc;if(r===null)return new Date(NaN);if(v.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var i=r.match(H);if(i){var g=i[2]-1||0,y=(i[7]||"0").substring(0,3);return c?new Date(Date.UTC(i[1],g,i[3]||1,i[4]||0,i[5]||0,i[6]||0,y)):new Date(i[1],g,i[3]||1,i[4]||0,i[5]||0,i[6]||0,y)}}return new Date(r)})(n),this.init()},d.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()},d.$utils=function(){return v},d.isValid=function(){return this.$d.toString()!==B},d.isSame=function(n,u){var r=N(n);return this.startOf(u)<=r&&r<=this.endOf(u)},d.isAfter=function(n,u){return N(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:f}){const p=t.computed(()=>e.modo==="data"?"date":"datetime-local");function h(o){return e.modo==="data"?ae(o).format("YYYY-MM-DD"):ae(o).format("YYYY-MM-DDTHH:mm")}function V(o){return e.modo==="data"?ae(`${o}T00:00`).format():ae(o).format()}const l=t.computed({get:()=>e.modelValue?h(e.modelValue):"",set:o=>{const M=o&&o.length>0?o:null;if(!M){a("update:modelValue",null),a("alterar",null);return}const C=V(M);a("update:modelValue",C),a("alterar",C)}}),b=t.computed(()=>{if(e.min)return h(e.min)}),k=t.computed(()=>{if(e.max)return h(e.max)});return{attrs:f,valor:l,emit:a,minLocal:b,maxLocal:k,tipoInput:p}}}),at={class:"eli-data-hora"};function ot(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div",at,[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 pe=z(tt,[["render",ot],["__scopeId","data-v-71afabb6"]]);/** + * @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 nt=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** + * @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 he=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 rt=(...e)=>e.filter((a,f,p)=>!!a&&a.trim()!==""&&p.indexOf(a)===f).join(" ").trim();/** + * @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 be=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @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 lt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,f,p)=>p?p.toUpperCase():f.toLowerCase());/** + * @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 it=e=>{const a=lt(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** + * @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. + */var X={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** + * @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 st=({name:e,iconNode:a,absoluteStrokeWidth:f,"absolute-stroke-width":p,strokeWidth:h,"stroke-width":V,size:l=X.width,color:b=X.stroke,...k},{slots:o})=>t.h("svg",{...X,...k,width:l,height:l,stroke:b,"stroke-width":he(f)||he(p)||f===!0||p===!0?Number(h||V||X["stroke-width"])*24/Number(l):h||V||X["stroke-width"],class:rt("lucide",k.class,...e?[`lucide-${be(it(e))}-icon`,`lucide-${be(e)}`]:["lucide-icon"]),...!o.default&&!nt(k)&&{"aria-hidden":"true"}},[...a.map(M=>t.h(...M)),...o.default?[o.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 le=(e,a)=>(f,{slots:p,attrs:h})=>t.h(st,{...h,...f,iconNode:a,name:e},p);/** + * @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 dt=le("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @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 ge=le("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + * @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 ut=le("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var ye=(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))(ye||{});const ct=t.defineComponent({name:"EliTabelaCaixaDeBusca",props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const f=t.ref(e.modelo??"");t.watch(()=>e.modelo,h=>{h!==void 0&&h!==f.value&&(f.value=h)});function p(){a("buscar",f.value.trim())}return{texto:f,emitirBusca:p}}}),ft={class:"eli-tabela__busca"},mt={class:"eli-tabela__busca-input-wrapper"};function pt(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div",ft,[t.createElementVNode("div",mt,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=l=>e.texto=l),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...l)=>e.emitirBusca&&e.emitirBusca(...l),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao",onClick:a[2]||(a[2]=(...l)=>e.emitirBusca&&e.emitirBusca(...l))}," Buscar ")])])}const ht=z(ct,[["render",pt],["__scopeId","data-v-2aeb8274"]]),bt=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 f=t.computed(()=>{const o=e.maximoBotoes;return typeof o=="number"&&o>=5?Math.floor(o):7}),p=t.computed(()=>{const o=e.totalPaginas,M=e.pagina,C=f.value,O=[],w=I=>{O.push({label:String(I),pagina:I,ativo:I===M})},_=()=>{O.push({label:"…",ehEllipsis:!0})};if(o<=C){for(let I=1;I<=o;I+=1)w(I);return O}const B=Math.max(3,C-2);let H=Math.max(2,M-Math.floor(B/2)),U=H+B-1;U>=o&&(U=o-1,H=U-B+1),w(1),H>2&&_();for(let I=H;I<=U;I+=1)w(I);return Ue.pagina<=1),l=t.computed(()=>e.pagina>=e.totalPaginas),b=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:p,irParaPagina:h,anteriorDesabilitado:V,proximaDesabilitada:l,paginaAtual:b,totalPaginasExibidas:k}}}),gt={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},yt=["disabled"],$t={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Vt=["disabled","aria-current","aria-label","onClick"],kt=["disabled"];function Bt(e,a,f,p,h,V){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",gt,[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,yt),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(l,b)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${l.label}-${b}`},[l.ehEllipsis?(t.openBlock(),t.createElementBlock("span",$t,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,Vt))],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,kt)])):t.createCommentVNode("",!0)}const vt=z(bt,[["render",Bt],["__scopeId","data-v-59d12455"]]),wt=t.defineComponent({name:"EliTabela",inheritAttrs:!1,props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),f=t.ref(null),p=t.ref([]),h=t.ref(0),V=t.ref([]),l=t.ref(null),b=new Map,k=t.ref(""),o=t.ref(1),M=t.ref(null),C=t.ref("asc"),O=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),w=t.computed(()=>e.tabela.acoesTabela??[]),_=t.computed(()=>w.value.length>0),B=t.computed(()=>{const m=e.tabela.registros_por_consulta;return typeof m=="number"&&m>0?Math.floor(m):10}),H=t.computed(()=>{const m=B.value;if(!m||m<=0)return 1;const s=h.value;return s?Math.max(1,Math.ceil(s/m)):1});let U=0;function I(m,s){s?b.set(m,s):b.delete(m)}function K(m){return s=>{s instanceof HTMLElement?I(m,s):I(m,null)}}function ie(m){m&&(M.value===m?(C.value=C.value==="asc"?"desc":"asc",L()):(M.value=m,C.value="asc",o.value!==1?o.value=1:L()))}function J(m){k.value!==m&&(k.value=m,o.value!==1?o.value=1:L())}function R(m){const s=Math.min(Math.max(1,m),H.value);s!==o.value&&(o.value=s)}function Q(m){if(l.value===null)return;const s=b.get(l.value);s&&s.contains(m.target)||(l.value=null)}function x(m){return m==null||m===!1?"":m}function Z(m){return t.h("div",{class:"eli-tabela eli-tabela--erro",role:"alert"},[t.h("div",{class:"eli-tabela__erro-titulo"},"Erro"),t.h("div",{class:"eli-tabela__erro-mensagem"},m)])}function N(m){return t.h("div",{class:"eli-tabela eli-tabela--vazio"},m??"Nenhum registro encontrado.")}function v(){return t.h("div",{class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},"Carregando...")}async function L(){var u,r;const m=++U;a.value=!0,f.value=null,V.value=[],l.value=null,b.clear();const s=Math.max(1,B.value),n={offSet:(o.value-1)*s,limit:s};k.value&&(n.texto_busca=k.value),M.value&&(n.coluna_ordem=M.value,n.direcao_ordem=C.value);try{const c=e.tabela,i=await c.consulta(n);if(m!==U)return;if(i.cod!==ye.sucesso){p.value=[],h.value=0,f.value=i.mensagem;return}const g=((u=i.valor)==null?void 0:u.valores)??[],y=((r=i.valor)==null?void 0:r.quantidade)??g.length;p.value=g,h.value=y;const S=Math.max(1,Math.ceil((y||0)/s));if(o.value>S){o.value=S;return}const $=c.acoesLinha??[];if(!$.length){V.value=[];return}const P=g.map(()=>$.map(A=>A.exibir===void 0?!0:typeof A.exibir=="boolean"?A.exibir:!1));V.value=P;const F=await Promise.all(g.map(async A=>Promise.all($.map(async q=>{if(q.exibir===void 0)return!0;if(typeof q.exibir=="boolean")return q.exibir;try{const j=q.exibir(A);return!!await Promise.resolve(j)}catch{return!1}}))));m===U&&(V.value=F)}catch(c){if(m!==U)return;p.value=[],h.value=0,f.value=c instanceof Error?c.message:"Erro ao carregar dados."}finally{m===U&&(a.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Q),L()}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,m=>{!m&&k.value&&(k.value="",o.value!==1?o.value=1:L())}),t.watch(o,(m,s)=>{m!==s&&L()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Q),b.clear()}),t.watch(()=>e.tabela,()=>{l.value=null,b.clear(),M.value=null,C.value="asc",k.value="",o.value!==1?o.value=1:L()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{o.value!==1?o.value=1:L()}),t.watch(p,()=>{l.value=null,b.clear()}),()=>{const m=e.tabela;if(a.value)return v();if(f.value)return Z(f.value);const s=m.colunas,d=m.acoesLinha??[],n=d.length>0;if(!p.value.length)return N(m.mensagemVazio);const u=s.map(c=>{const i=c.coluna_ordem!==void 0?c.coluna_ordem:void 0,g=!!i,y=g&&M.value===i,S=g?y?t.h(C.value==="asc"?ge:dt,{class:"eli-tabela__th-icone",size:16,strokeWidth:2,"aria-hidden":"true"}):t.h(ge,{class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,strokeWidth:2,"aria-hidden":"true"}):null,$=g?t.h("button",{type:"button",class:["eli-tabela__th-botao",y?"eli-tabela__th-botao--ativo":void 0],onClick:()=>ie(i)},[t.h("span",{class:"eli-tabela__th-texto"},c.rotulo),S]):t.h("span",{class:"eli-tabela__th-label"},c.rotulo);return t.h("th",{class:["eli-tabela__th",g?"eli-tabela__th--ordenavel":void 0],scope:"col"},$)});n&&u.push(t.h("th",{class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"},"Ações"));const r=[];if(O.value||_.value){const c=w.value.map((i,g)=>t.h("button",{key:`${i.rotulo}-${g}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:i.cor?{backgroundColor:i.cor}:void 0,onClick:i.acao},[i.icone?t.h(i.icone,{class:"eli-tabela__acoes-cabecalho-icone",size:16,strokeWidth:2}):null,t.h("span",{class:"eli-tabela__acoes-cabecalho-rotulo"},i.rotulo)]));r.push(t.h("div",{class:"eli-tabela__cabecalho"},[O.value?t.h(ht,{modelo:k.value,onBuscar:J}):null,_.value?t.h("div",{class:"eli-tabela__acoes-cabecalho"},c):null]))}return r.push(t.h("table",{class:"eli-tabela__table"},[t.h("thead",{class:"eli-tabela__thead"},t.h("tr",{class:"eli-tabela__tr eli-tabela__tr--header"},u)),t.h("tbody",{class:"eli-tabela__tbody"},p.value.map((c,i)=>{const g=s.map((y,S)=>t.h("td",{class:["eli-tabela__td",y.acao?"eli-tabela__td--clicavel":void 0],key:`${i}-${S}`,onClick:y.acao?()=>{var $;return($=y.acao)==null?void 0:$.call(y)}:void 0},x(y.celula(c))));if(n){const y=V.value[i]??[],S=d.map((D,Y)=>{const G=D.exibir===void 0?!0:typeof D.exibir=="boolean"?D.exibir:!1;return{acao:D,indice:Y,visivel:y[Y]??G}}).filter(D=>D.visivel),$=S.length>0;!$&&l.value===i&&(l.value=null);const P=l.value===i,F=`eli-tabela-acoes-toggle-${i}`,A=`eli-tabela-acoes-menu-${i}`,q=t.h("button",{id:F,class:"eli-tabela__acoes-toggle",type:"button",disabled:!$,onClick:D=>{D.stopPropagation(),$&&(l.value=P?null:i)},"aria-haspopup":"menu","aria-expanded":P?"true":"false","aria-controls":$?A:void 0,"aria-label":$?"Ações da linha":"Nenhuma ação disponível",title:$?"Ações":"Nenhuma ação disponível"},[t.h(ut,{class:"eli-tabela__acoes-toggle-icone",size:18,strokeWidth:2})]),j=P&&$?t.h("ul",{id:A,class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":F},S.map(({acao:D,indice:Y})=>t.h("li",{key:`acao-${Y}`,class:"eli-tabela__acoes-item",role:"none"},t.h("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:{color:D.cor},onClick:G=>{G.stopPropagation(),l.value=null,D.acao(c)},role:"menuitem","aria-label":D.rotulo,title:D.rotulo},[t.h(D.icone,{class:"eli-tabela__acoes-item-icone",size:16,strokeWidth:2}),t.h("span",{class:"eli-tabela__acoes-item-texto"},D.rotulo)])))):null,T=["eli-tabela__acoes-container"];P&&T.push("eli-tabela__acoes-container--aberto"),g.push(t.h("td",{class:["eli-tabela__td","eli-tabela__td--acoes"],key:`${i}-acoes`},t.h("div",{class:T,ref:K(i)},[q,j])))}return t.h("tr",{class:"eli-tabela__tr",key:i},g)}))])),H.value>1&&h.value>0&&r.push(t.h(vt,{pagina:o.value,totalPaginas:H.value,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:c=>{R(c)}})),t.h("div",{class:"eli-tabela"},r)}}});function Ct(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div")}const $e=z(wt,[["render",Ct],["__scopeId","data-v-c6b8c95b"]]),St={install(e){e.component("EliOlaMundo",ce),e.component("EliBotao",oe),e.component("EliBadge",ee),e.component("EliInput",re),e.component("EliCartao",fe),e.component("EliDataHora",pe),e.component("EliTabela",$e)}};E.EliBadge=ee,E.EliBotao=oe,E.EliCartao=fe,E.EliDataHora=pe,E.EliInput=re,E.EliOlaMundo=ce,E.EliTabela=$e,E.default=St,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/quero-quero.gif b/dist/quero-quero.gif new file mode 100755 index 0000000..b569a66 Binary files /dev/null and b/dist/quero-quero.gif differ diff --git a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts index a8d5162..5dd81ae 100644 --- a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts +++ b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts @@ -1,5 +1,5 @@ import { PropType } from "vue"; -import type { EliTabelaConsulta } from "./types"; +import type { EliTabelaConsulta } from "./types-eli-tabela"; declare const __VLS_export: import("vue").DefineComponent>; diff --git a/dist/types/components/eli/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts new file mode 100644 index 0000000..d2094a3 --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts @@ -0,0 +1,24 @@ +declare const __VLS_export: import("vue").DefineComponent, { + texto: import("vue").Ref; + emitirBusca: () => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + buscar(valor: string): boolean; +}, string, import("vue").PublicProps, Readonly> & Readonly<{ + onBuscar?: ((valor: string) => any) | undefined; +}>, { + modelo: string; +}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaPaginacao.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaPaginacao.vue.d.ts new file mode 100644 index 0000000..89ff3db --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaPaginacao.vue.d.ts @@ -0,0 +1,45 @@ +declare const __VLS_export: import("vue").DefineComponent, { + botoes: import("vue").ComputedRef<{ + label: string; + pagina?: number; + ativo?: boolean; + ehEllipsis?: boolean; + }[]>; + irParaPagina: (pagina: number | undefined) => void; + anteriorDesabilitado: import("vue").ComputedRef; + proximaDesabilitada: import("vue").ComputedRef; + paginaAtual: import("vue").ComputedRef; + totalPaginasExibidas: import("vue").ComputedRef; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + alterar(pagina: number): boolean; +}, string, import("vue").PublicProps, Readonly> & Readonly<{ + onAlterar?: ((pagina: number) => any) | undefined; +}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/index.d.ts b/dist/types/components/eli/EliTabela/index.d.ts index 2befee2..c22de3a 100644 --- a/dist/types/components/eli/EliTabela/index.d.ts +++ b/dist/types/components/eli/EliTabela/index.d.ts @@ -1,3 +1,3 @@ export { default as EliTabela } from "./EliTabela.vue"; -export * from "./types"; +export * from "./types-eli-tabela"; export * from "./celulas/EliCelulaTextoSimples"; diff --git a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts b/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts new file mode 100644 index 0000000..0fa164a --- /dev/null +++ b/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts @@ -0,0 +1,85 @@ +import type { tipoResposta } from "p-respostas"; +import type { LucideIcon } from "lucide-vue-next"; +import type { VNodeChild } from "vue"; +export type ComponenteCelula = VNodeChild; +export type EliColuna = { + /** Texto exibido no cabeçalho da coluna. */ + rotulo: string; + /** Função responsável por renderizar o conteúdo da célula. */ + celula: (linha: T) => ComponenteCelula; + /** Ação opcional disparada ao clicar na célula. */ + acao?: () => void; + /** + * Campo de ordenação associado à coluna. Caso informado, a coluna passa a + * exibir controles de ordenação e utiliza o valor como chave para o backend. + */ + coluna_ordem?: keyof T; +}; +export type EliConsultaPaginada = { + /** Registros retornados na consulta. */ + valores: T[]; + /** Total de registros disponíveis no backend. */ + quantidade: number; +}; +export type EliTabelaAcao = { + /** Ícone (Lucide) exibido para representar a ação. */ + icone: LucideIcon; + /** Cor aplicada ao ícone e rótulo. */ + cor: string; + /** Texto descritivo da ação. */ + rotulo: string; + /** Função executada quando o usuário ativa a ação. */ + acao: (linha: T) => void; + /** + * Define se a ação deve ser exibida para a linha. Pode ser um booleano fixo + * ou uma função (sincrona/assíncrona) que recebe a linha para decisão dinâmica. + */ + exibir?: boolean | ((linha: T) => Promise | boolean); +}; +/** + * Estrutura de dados para uma tabela alimentada por uma consulta. + * + * - `colunas`: definição de colunas e como renderizar cada célula + * - `consulta`: função que recupera os dados, com suporte a ordenação/paginação + * - `mostrarCaixaDeBusca`: habilita um campo de busca textual no cabeçalho + */ +export type EliTabelaConsulta = { + /** Indica se a caixa de busca deve ser exibida acima da tabela. */ + mostrarCaixaDeBusca?: boolean; + /** Lista de colunas da tabela. */ + colunas: EliColuna[]; + /** Quantidade de registros solicitados por consulta (padrão `10`). */ + registros_por_consulta?: number; + /** + * Função responsável por buscar os dados. Recebe parâmetros opcionais de + * ordenação (`coluna_ordem`/`direcao_ordem`) e paginação (`offSet`/`limit`). + */ + consulta: (parametrosConsulta?: { + coluna_ordem?: keyof T; + direcao_ordem?: "asc" | "desc"; + offSet?: number; + limit?: number; + /** Texto digitado na caixa de busca, quando habilitada. */ + texto_busca?: string; + }) => Promise>>; + /** Quantidade máxima de botões exibidos na paginação (padrão `7`). */ + maximo_botoes_paginacao?: number; + /** Mensagem exibida quando a consulta retorna ok porém sem dados. */ + mensagemVazio?: string; + /** Ações exibidas à direita de cada linha. */ + acoesLinha?: EliTabelaAcao[]; + /** + * Configurações dos botões que serão inseridos a direita da caixa de busca. + * Seu uso mais comum será para criar novos registros, mas poderá ter outras utilidades. + */ + acoesTabela?: { + /** Ícone (Lucide) exibido no botão */ + icone?: LucideIcon; + /** Cor aplicada ao botão. */ + cor?: string; + /** Texto descritivo da ação. */ + rotulo: string; + /** Função executada ao clicar no botão. */ + acao: () => void; + }[]; +}; diff --git a/dist/types/components/eli/EliTabela/types.d.ts b/dist/types/components/eli/EliTabela/types.d.ts deleted file mode 100644 index 80cc67d..0000000 --- a/dist/types/components/eli/EliTabela/types.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { tipoResposta } from "p-respostas"; -import type { VNodeChild } from "vue"; -export type ComponenteCelula = VNodeChild; -export type EliColuna = { - rotulo: string; - celula: (linha: T) => ComponenteCelula; - acao?: () => void; -}; -export type EliConsultaPaginada = { - valores: T[]; - quantidade: number; -}; -/** - * Estrutura de dados para uma tabela alimentada por uma consulta. - * - * - `colunas`: definição de colunas e como renderizar cada célula - * - `resposta`: função assíncrona que retorna uma resposta padronizada - */ -export type EliTabelaConsulta = { - colunas: EliColuna[]; - resposta: () => Promise>>; - /** Mensagem exibida quando a consulta retorna ok porém sem dados. */ - mensagemVazio?: string; -}; diff --git a/dist/types/constantes.d.ts b/dist/types/constantes.d.ts new file mode 100644 index 0000000..3084291 --- /dev/null +++ b/dist/types/constantes.d.ts @@ -0,0 +1 @@ +export declare const gif_quero_quero = "https://paiol.idz.one/estaticos/quero-quero.gif"; diff --git a/package.json b/package.json index deef5a2..e6e7421 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.22", + "version": "0.1.23", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/public/quero-quero.gif b/public/quero-quero.gif new file mode 100755 index 0000000..b569a66 Binary files /dev/null and b/public/quero-quero.gif differ diff --git a/src/components/eli/EliTabela/EliTabela.vue b/src/components/eli/EliTabela/EliTabela.vue index f7689e7..38407ae 100644 --- a/src/components/eli/EliTabela/EliTabela.vue +++ b/src/components/eli/EliTabela/EliTabela.vue @@ -37,6 +37,8 @@ export default defineComponent({ const colunaOrdenacao = ref(null); const direcaoOrdenacao = ref<"asc" | "desc">("asc"); const exibirBusca = computed(() => Boolean(props.tabela.mostrarCaixaDeBusca)); + const acoesCabecalho = computed(() => props.tabela.acoesTabela ?? []); + const temAcoesCabecalho = computed(() => acoesCabecalho.value.length > 0); const registrosPorConsulta = computed(() => { const valor = props.tabela.registros_por_consulta; if (typeof valor === "number" && valor > 0) { @@ -235,15 +237,15 @@ export default defineComponent({ return; } - const acoes = tabelaConfig.acoesLinha ?? []; + const acoesLinhaConfiguradas = tabelaConfig.acoesLinha ?? []; - if (!acoes.length) { + if (!acoesLinhaConfiguradas.length) { acoesVisiveis.value = []; return; } const preResultado = valores.map(() => - acoes.map((acao) => { + acoesLinhaConfiguradas.map((acao) => { if (acao.exibir === undefined) { return true; } @@ -261,7 +263,7 @@ export default defineComponent({ const visibilidade = await Promise.all( valores.map(async (linha) => Promise.all( - acoes.map(async (acao) => { + acoesLinhaConfiguradas.map(async (acao) => { if (acao.exibir === undefined) { return true; } @@ -372,8 +374,8 @@ export default defineComponent({ } const colunas = tabela.colunas; - const acoes = tabela.acoesLinha ?? []; - const temAcoes = acoes.length > 0; + const acoesLinha = tabela.acoesLinha ?? []; + const temAcoes = acoesLinha.length > 0; if (!linhas.value.length) { return renderVazio(tabela.mensagemVazio); @@ -445,12 +447,49 @@ export default defineComponent({ const conteudoTabela: ReturnType[] = []; - if (exibirBusca.value) { + if (exibirBusca.value || temAcoesCabecalho.value) { + const botoes = acoesCabecalho.value.map((botao, indice) => + h( + "button", + { + key: `${botao.rotulo}-${indice}`, + type: "button", + class: "eli-tabela__acoes-cabecalho-botao", + // Quando `cor` for informada, tratamos como cor de destaque do botão. + // Também ajustamos o texto/ícone para branco para manter contraste. + style: botao.cor + ? { + backgroundColor: botao.cor, + color: "#fff", + } + : undefined, + onClick: botao.acao, + }, + [ + botao.icone + ? h(botao.icone, { + class: "eli-tabela__acoes-cabecalho-icone", + size: 16, + strokeWidth: 2, + }) + : null, + h("span", { class: "eli-tabela__acoes-cabecalho-rotulo" }, botao.rotulo), + ] + ) + ); + conteudoTabela.push( - h(EliTabelaCaixaDeBusca, { - modelo: valorBusca.value, - onBuscar: atualizarBusca, - }) + h("div", { class: "eli-tabela__cabecalho" }, [ + exibirBusca.value + ? h(EliTabelaCaixaDeBusca, { + modelo: valorBusca.value, + onBuscar: atualizarBusca, + }) + : null, + temAcoesCabecalho.value + ? h("div", { class: "eli-tabela__acoes-cabecalho" }, botoes) + : null, + ]) ); } @@ -486,7 +525,7 @@ export default defineComponent({ if (temAcoes) { const visibilidade = acoesVisiveis.value[i] ?? []; - const acoesDisponiveis = acoes + const acoesDisponiveis = acoesLinha .map((acao, indice) => { const fallbackVisivel = acao.exibir === undefined @@ -503,7 +542,7 @@ export default defineComponent({ }) .filter((item) => item.visivel); - const possuiAcoes = acoesDisponiveis.length > 0; + const possuiAcoes = acoesDisponiveis.length > 0; if (!possuiAcoes && menuAberto.value === i) { menuAberto.value = null; @@ -603,7 +642,7 @@ export default defineComponent({ classesContainer.push("eli-tabela__acoes-container--aberto"); } - celulas.push( + celulas.push( h( "td", { @@ -796,6 +835,55 @@ export default defineComponent({ z-index: 200; } +.eli-tabela__cabecalho { + display: flex; + align-items: center; + /* Ações ficam imediatamente à direita da busca (em vez de ir para a extrema direita) */ + justify-content: flex-start; + gap: 12px; + margin-bottom: 12px; + flex-wrap: wrap; +} + +.eli-tabela__acoes-cabecalho { + display: inline-flex; + gap: 8px; + flex-wrap: wrap; +} + +.eli-tabela__acoes-cabecalho-botao { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 14px; + border-radius: 9999px; + border: none; + background: rgba(37, 99, 235, 0.12); + color: rgba(37, 99, 235, 0.95); + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + transition: background-color 0.2s ease, color 0.2s ease; +} + +.eli-tabela__acoes-cabecalho-botao:hover, +.eli-tabela__acoes-cabecalho-botao:focus-visible { + background: rgba(37, 99, 235, 0.2); +} + +.eli-tabela__acoes-cabecalho-botao:focus-visible { + outline: 2px solid rgba(37, 99, 235, 0.35); + outline-offset: 2px; +} + +.eli-tabela__acoes-cabecalho-icone { + display: inline-block; +} + +.eli-tabela__acoes-cabecalho-rotulo { + line-height: 1; +} + .eli-tabela__acoes-toggle { display: inline-flex; align-items: center; diff --git a/src/components/eli/EliTabela/types-eli-tabela.ts b/src/components/eli/EliTabela/types-eli-tabela.ts index 8a88142..32da978 100644 --- a/src/components/eli/EliTabela/types-eli-tabela.ts +++ b/src/components/eli/EliTabela/types-eli-tabela.ts @@ -41,6 +41,7 @@ export type EliTabelaAcao = { exibir?: boolean | ((linha: T) => Promise | boolean); }; + /** * Estrutura de dados para uma tabela alimentada por uma consulta. * @@ -73,19 +74,19 @@ export type EliTabelaConsulta = { mensagemVazio?: string; /** Ações exibidas à direita de cada linha. */ acoesLinha?: EliTabelaAcao[]; - - - /** configurações do botões que serão inseridos a direta da caixa de busca, seu uso mais como será para criar novo regitros, mas poderá ter outras utilidades */ - - acoesTabela?: { - - /** Ícone (Lucide) exibido no botão */ - icone?: LucideIcon; - /** Cor aplicada ao botão. */ - cor?: string; - /** Texto descritivo da ação. */ - rotulo: string; - /** Função executada ao clicar no botão. */ - acao: () => void; - }[]; + /** + * Configurações dos botões que serão inseridos a direita da caixa de busca. + * Seu uso mais comum será para criar novos registros, mas poderá ter outras utilidades. + */ + acoesTabela?: { + /** Ícone (Lucide) exibido no botão */ + icone?: LucideIcon; + /** Cor aplicada ao botão. */ + cor?: string; + /** Texto descritivo da ação. */ + rotulo: string; + /** Função executada ao clicar no botão. */ + acao: () => void; + }[]; }; + diff --git a/src/constantes.ts b/src/constantes.ts new file mode 100644 index 0000000..154a501 --- /dev/null +++ b/src/constantes.ts @@ -0,0 +1 @@ +export const gif_quero_quero = 'https://paiol.idz.one/estaticos/quero-quero.gif' \ No newline at end of file diff --git a/src/playground/tabela.playground.vue b/src/playground/tabela.playground.vue index 559c922..3f0d8ac 100644 --- a/src/playground/tabela.playground.vue +++ b/src/playground/tabela.playground.vue @@ -2,7 +2,8 @@

EliTabela

- + + @@ -11,9 +12,9 @@