diff --git a/dist/eli-vue.css b/dist/eli-vue.css index da8ba4d..28530f6 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]{width:100%}.eli-tabela__busca[data-v-0fd1ad15]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-0fd1ad15]{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-0fd1ad15]{padding:6px 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-0fd1ad15]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-0fd1ad15]{display:inline-flex;align-items:center;justify-content:center;border:none;background:#2563eb1f;color:#2563ebf2;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao-icone[data-v-0fd1ad15]{display:block}.eli-tabela__busca-botao[data-v-0fd1ad15]:hover,.eli-tabela__busca-botao[data-v-0fd1ad15]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-0fd1ad15]: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-e714deaf]{width:100%}.eli-tabela__table[data-v-e714deaf]{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__tbody[data-v-e714deaf]{overflow:visible}.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td[data-v-e714deaf]{background:#0f172a05}.eli-tabela__th[data-v-e714deaf],.eli-tabela__td[data-v-e714deaf]{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th[data-v-e714deaf]{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel[data-v-e714deaf]{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao[data-v-e714deaf]{padding:10px 12px}.eli-tabela__th-botao[data-v-e714deaf]{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-e714deaf]:hover,.eli-tabela__th-botao[data-v-e714deaf]:focus-visible{color:#0f172ad9}.eli-tabela__th-botao[data-v-e714deaf]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo[data-v-e714deaf]{color:#2563ebf2}.eli-tabela__th-texto[data-v-e714deaf]{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone[data-v-e714deaf]{flex-shrink:0}.eli-tabela__th-icone--oculto[data-v-e714deaf]{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td[data-v-e714deaf]{border-bottom:none}.eli-tabela__td--clicavel[data-v-e714deaf]{cursor:pointer}.eli-tabela__td--clicavel[data-v-e714deaf]:hover{background:#00000008}.eli-tabela__celula--esquerda[data-v-e714deaf]{text-align:left}.eli-tabela__celula--centro[data-v-e714deaf]{text-align:center}.eli-tabela__celula--direita[data-v-e714deaf]{text-align:right}.eli-tabela__celula-conteudo[data-v-e714deaf]{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.eli-tabela--erro[data-v-e714deaf]{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando[data-v-e714deaf]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo[data-v-e714deaf]{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem[data-v-e714deaf]{opacity:.9}.eli-tabela--vazio[data-v-e714deaf]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes[data-v-e714deaf]{text-align:right;white-space:nowrap}.eli-tabela__td--acoes[data-v-e714deaf]{white-space:nowrap;overflow:visible}.eli-tabela__acoes-container[data-v-e714deaf]{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto[data-v-e714deaf]{z-index:200}.eli-tabela__cabecalho[data-v-e714deaf]{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-bottom:12px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho[data-v-e714deaf]{display:inline-flex;gap:8px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho-botao[data-v-e714deaf]{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-e714deaf]:hover,.eli-tabela__acoes-cabecalho-botao[data-v-e714deaf]:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao[data-v-e714deaf]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__acoes-cabecalho-icone[data-v-e714deaf]{display:inline-block}.eli-tabela__acoes-cabecalho-rotulo[data-v-e714deaf]{line-height:1}.eli-tabela__acoes-toggle[data-v-e714deaf]{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-e714deaf]{display:block}.eli-tabela__acoes-toggle[data-v-e714deaf]:hover,.eli-tabela__acoes-toggle[data-v-e714deaf]:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle[data-v-e714deaf]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle[data-v-e714deaf]:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu[data-v-e714deaf]{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-e714deaf]{margin:0}.eli-tabela__acoes-item-botao[data-v-e714deaf]{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-e714deaf]:hover,.eli-tabela__acoes-item-botao[data-v-e714deaf]:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao[data-v-e714deaf]:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone[data-v-e714deaf]{flex-shrink:0}.eli-tabela__acoes-item-texto[data-v-e714deaf]{flex:1;text-align:left} +[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-0fd1ad15]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-0fd1ad15]{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-0fd1ad15]{padding:6px 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-0fd1ad15]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-0fd1ad15]{display:inline-flex;align-items:center;justify-content:center;border:none;background:#2563eb1f;color:#2563ebf2;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao-icone[data-v-0fd1ad15]{display:block}.eli-tabela__busca-botao[data-v-0fd1ad15]:hover,.eli-tabela__busca-botao[data-v-0fd1ad15]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-0fd1ad15]: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{width:100%}.eli-tabela__table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__tbody{overflow:visible}.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td{background:#0f172a05}.eli-tabela__th,.eli-tabela__td{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao{padding:10px 12px}.eli-tabela__th-botao{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:hover,.eli-tabela__th-botao:focus-visible{color:#0f172ad9}.eli-tabela__th-botao:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo{color:#2563ebf2}.eli-tabela__th-texto{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone{flex-shrink:0}.eli-tabela__th-icone--oculto{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td{border-bottom:none}.eli-tabela__td--clicavel{cursor:pointer}.eli-tabela__td--clicavel:hover{background:#00000008}.eli-tabela__celula--esquerda{text-align:left}.eli-tabela__celula--centro{text-align:center}.eli-tabela__celula--direita{text-align:right}.eli-tabela__celula-conteudo{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.eli-tabela--erro{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem{opacity:.9}.eli-tabela--vazio{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes{text-align:right;white-space:nowrap}.eli-tabela__td--acoes{white-space:nowrap;overflow:visible}.eli-tabela__acoes-container{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto{z-index:200}.eli-tabela__cabecalho{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:flex-end;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:#2563eb1f;color:#2563ebf2;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-cabecalho-botao:hover,.eli-tabela__acoes-cabecalho-botao:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao:focus-visible{outline:2px solid rgba(37,99,235,.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;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{display:block}.eli-tabela__acoes-toggle:hover,.eli-tabela__acoes-toggle:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu{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{margin:0}.eli-tabela__acoes-item-botao{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:hover,.eli-tabela__acoes-item-botao:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone{flex-shrink:0}.eli-tabela__acoes-item-texto{flex:1;text-align:left} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index 920bf89..73ae98e 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,4 +1,4 @@ -import { defineComponent as F, createBlock as I, openBlock as c, mergeProps as re, withCtx as L, renderSlot as de, computed as V, ref as B, createElementBlock as $, createCommentVNode as R, createSlots as He, createVNode as M, createTextVNode as pe, toDisplayString as H, Fragment as X, renderList as oe, resolveComponent as G, createElementVNode as P, h as Ve, watch as se, withDirectives as Fe, withKeys as qe, vModelText as Re, normalizeClass as ue, resolveDynamicComponent as he, onMounted as We, onBeforeUnmount as Je, normalizeStyle as ke, withModifiers as Se } from "vue"; +import { defineComponent as N, createBlock as P, openBlock as m, mergeProps as oe, withCtx as z, renderSlot as ie, computed as A, ref as w, createElementBlock as k, createCommentVNode as J, createSlots as Le, createVNode as V, createTextVNode as pe, toDisplayString as Y, Fragment as K, renderList as ee, resolveComponent as H, createElementVNode as B, h as Ae, watch as le, withDirectives as He, withKeys as Ye, vModelText as Fe, normalizeStyle as ge, resolveDynamicComponent as ye, normalizeClass as se, withModifiers as De, Teleport as Re, onMounted as We, onBeforeUnmount as Je } from "vue"; import { VBtn as Ze } from "vuetify/components/VBtn"; import { VBadge as Xe } from "vuetify/components/VBadge"; import { VCheckbox as Ge } from "vuetify/components/VCheckbox"; @@ -6,11 +6,11 @@ import { VIcon as Ke } from "vuetify/components/VIcon"; import { VRadio as Qe } from "vuetify/components/VRadio"; import { VRadioGroup as xe } from "vuetify/components/VRadioGroup"; import { VSelect as ea } from "vuetify/components/VSelect"; -import { VTextField as Te } from "vuetify/components/VTextField"; +import { VTextField as Pe } from "vuetify/components/VTextField"; import { VTextarea as aa } from "vuetify/components/VTextarea"; -import { VCard as Oe, VCardTitle as Ie, VCardText as Ue, VCardActions as Le } from "vuetify/components/VCard"; +import { VCard as Te, VCardTitle as Oe, VCardText as qe, VCardActions as Ie } from "vuetify/components/VCard"; import { VContainer as ta } from "vuetify/components/VGrid"; -const oa = F({ +const oa = N({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +35,30 @@ const oa = F({ default: !1 } } -}), q = (e, a) => { +}), j = (e, a) => { const s = e.__vccOpts || e; - for (const [m, v] of a) - s[m] = v; + for (const [d, c] of a) + s[d] = c; return s; }; -function ra(e, a, s, m, v, y) { - return c(), I(Ze, re({ +function ra(e, a, s, d, c, p) { + return m(), P(Ze, oe({ color: e.color, variant: e.variant, size: e.size, disabled: e.disabled, loading: e.loading }, e.$attrs, { class: "text-none pt-1" }), { - default: L(() => [ - de(e.$slots, "default") + default: z(() => [ + ie(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const Ne = /* @__PURE__ */ q(oa, [["render", ra]]), _e = { +const Ue = /* @__PURE__ */ j(oa, [["render", ra]]), Ee = { suave: "4px", pill: "10px" -}, la = F({ +}, na = N({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +97,14 @@ const Ne = /* @__PURE__ */ q(oa, [["render", ra]]), _e = { } }, setup(e) { - const a = V(() => e.radius in _e ? _e[e.radius] : e.radius), s = V(() => e.dot || e.badge !== void 0 ? e.visible : !1), m = V(() => ({ + const a = A(() => e.radius in Ee ? Ee[e.radius] : e.radius), s = A(() => e.dot || e.badge !== void 0 ? e.visible : !1), d = A(() => ({ "--eli-badge-radius": a.value })); - return { showBadge: s, badgeStyle: m }; + return { showBadge: s, badgeStyle: d }; } }); -function na(e, a, s, m, v, y) { - return e.showBadge ? (c(), I(Xe, re({ +function la(e, a, s, d, c, p) { + return e.showBadge ? (m(), P(Xe, oe({ key: 0, color: e.color }, e.$attrs, { @@ -115,13 +115,13 @@ function na(e, a, s, m, v, y) { content: e.badge, style: e.badgeStyle }), { - default: L(() => [ - de(e.$slots, "default", {}, void 0, !0) + default: z(() => [ + ie(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : de(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : ie(e.$slots, "default", { key: 1 }, void 0, !0); } -const we = /* @__PURE__ */ q(la, [["render", na], ["__scopeId", "data-v-de2fbf2f"]]); +const Ce = /* @__PURE__ */ j(na, [["render", la], ["__scopeId", "data-v-de2fbf2f"]]); function ia(e) { return e.replace(/\D+/g, ""); } @@ -136,25 +136,25 @@ function da(e) { const a = ua(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 Ce(e) { +function Ve(e) { return e.replace(/\D+/g, ""); } -function je(e) { +function Ne(e) { const a = e.replace(/[^\d,]/g, ""), s = a.split(","); return s.length > 2 ? s[0] + "," + s.slice(1).join("") : a; } function ca(e) { - return je(e.replace(/%/g, "")); + return Ne(e.replace(/%/g, "")); } function ma(e) { - const a = Ce(e); + const a = Ve(e); return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; } -function fa(e) { - const a = Ce(e).slice(0, 8); +function pa(e) { + const a = Ve(e).slice(0, 8); return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); } -const pa = F({ +const fa = N({ name: "EliInput", inheritAttrs: !1, props: { @@ -197,12 +197,12 @@ const pa = F({ }, emits: ["update:modelValue", "change", "focus", "blur"], setup(e, { emit: a, attrs: s }) { - const m = B(!1), v = B(!1), y = V({ + const d = w(!1), c = w(!1), p = A({ get: () => e.modelValue, - set: (p) => { - a("update:modelValue", p), a("change", p); + set: ($) => { + a("update:modelValue", $), a("change", $); } - }), n = V( + }), t = A( () => [ "text", "password", @@ -217,83 +217,83 @@ const pa = F({ "porcentagem", "cep" ].includes(e.type) - ), f = V( - () => e.type === "password" ? v.value ? "text" : "password" : "text" - ), k = V(() => { + ), i = A( + () => e.type === "password" ? c.value ? "text" : "password" : "text" + ), h = A(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), r = V( - () => e.error ? "error" : m.value ? e.color : void 0 + }), n = A( + () => e.error ? "error" : d.value ? e.color : void 0 ); - function _(p) { - const T = p.target; - let C = T.value; + function g($) { + const O = $.target; + let M = O.value; switch (e.type) { case "numericoInteiro": - C = Ce(C); + M = Ve(M); break; case "numericoDecimal": - C = je(C); + M = Ne(M); break; case "numericoMoeda": - C = ma(C); + M = ma(M); break; case "porcentagem": - C = ca(C); + M = ca(M); break; case "telefone": - C = da(C); + M = da(M); break; case "cpfCnpj": - C = sa(C); + M = sa(M); break; case "cep": - C = fa(C); + M = pa(M); break; } - T.value = C, a("update:modelValue", C), a("change", C); + O.value = M, a("update:modelValue", M), a("change", M); } - function b() { - v.value = !v.value; + function y() { + c.value = !c.value; } - const g = V(() => (e.options || []).map((p) => { - if (p && typeof p == "object" && "value" in p) { - const C = p.value; + const T = A(() => (e.options || []).map(($) => { + if ($ && typeof $ == "object" && "value" in $) { + const M = $.value; return { - label: p.label ?? String(C), - value: C, - disabled: p.disabled + label: $.label ?? String(M), + value: M, + disabled: $.disabled }; } - const T = p; - return { label: String(T), value: T }; + const O = $; + return { label: String(O), value: O }; })); return { attrs: s, - value: y, - isTextLike: n, - inputHtmlType: f, - inputMode: k, - internalColor: r, - showPassword: v, - togglePassword: b, - onInput: _, + value: p, + isTextLike: t, + inputHtmlType: i, + inputMode: h, + internalColor: n, + showPassword: c, + togglePassword: y, + onInput: g, onFocus: () => a("focus"), onBlur: () => a("blur"), - computedItems: g + computedItems: T }; } }), ba = { class: "eli-input" }, va = { key: 4, class: "checkbox-group" }; -function ha(e, a, s, m, v, y) { - return c(), $("div", ba, [ - e.isTextLike ? (c(), I(Te, re({ +function ha(e, a, s, d, c, p) { + return m(), k("div", ba, [ + e.isTextLike ? (m(), P(Pe, oe({ key: 0, modelValue: e.value, - "onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n), + "onUpdate:modelValue": a[0] || (a[0] = (t) => e.value = t), type: e.inputHtmlType, label: e.label, placeholder: e.placeholder, @@ -312,34 +312,34 @@ function ha(e, a, s, m, v, y) { onFocus: e.onFocus, onBlur: e.onBlur, onInput: e.onInput - }), He({ _: 2 }, [ + }), Le({ _: 2 }, [ e.type === "password" && e.showPasswordToggle ? { name: "append-inner", - fn: L(() => [ - M(Ke, { + fn: z(() => [ + V(Ke, { class: "cursor-pointer", onClick: e.togglePassword }, { - default: L(() => [ - pe(H(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) + default: z(() => [ + pe(Y(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" ? (c(), I(aa, re({ + ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (m(), P(aa, oe({ key: 1, modelValue: e.value, - "onUpdate:modelValue": a[1] || (a[1] = (n) => e.value = n), + "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t), label: e.label, rows: e.rows, density: e.density, variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (c(), I(ea, re({ + }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (m(), P(ea, oe({ key: 2, modelValue: e.value, - "onUpdate:modelValue": a[2] || (a[2] = (n) => e.value = n), + "onUpdate:modelValue": a[2] || (a[2] = (t) => e.value = t), items: e.computedItems, label: e.label, placeholder: e.placeholder, @@ -356,75 +356,75 @@ function ha(e, a, s, m, v, y) { }, 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" ? (c(), I(xe, { + }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (m(), P(xe, { key: 3, modelValue: e.value, - "onUpdate:modelValue": a[3] || (a[3] = (n) => e.value = n), + "onUpdate:modelValue": a[3] || (a[3] = (t) => e.value = t), row: e.row }, { - default: L(() => [ - (c(!0), $(X, null, oe(e.computedItems, (n) => (c(), I(Qe, { - key: String(n.value), - label: n.label, - value: n.value + default: z(() => [ + (m(!0), k(K, null, ee(e.computedItems, (t) => (m(), P(Qe, { + key: String(t.value), + label: t.label, + value: t.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (c(), $("div", va, [ - (c(!0), $(X, null, oe(e.computedItems, (n) => (c(), I(Ge, { - key: String(n.value), + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (m(), k("div", va, [ + (m(!0), k(K, null, ee(e.computedItems, (t) => (m(), P(Ge, { + key: String(t.value), modelValue: e.value, - "onUpdate:modelValue": a[4] || (a[4] = (f) => e.value = f), - label: n.label, - value: n.value, + "onUpdate:modelValue": a[4] || (a[4] = (i) => e.value = i), + label: t.label, + value: t.value, density: e.density }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) - ])) : R("", !0) + ])) : J("", !0) ]); } -const ze = /* @__PURE__ */ q(pa, [["render", ha], ["__scopeId", "data-v-756cb549"]]), ga = F({ +const je = /* @__PURE__ */ j(fa, [["render", ha], ["__scopeId", "data-v-756cb549"]]), ga = N({ name: "EliOlaMundo", components: { - EliBotao: Ne, - EliBadge: we, - EliInput: ze + EliBotao: Ue, + EliBadge: Ce, + EliInput: je }, setup() { - const e = B(""), a = B([]), s = B(""), m = B(""), v = B(""), y = B(""), n = B(""), f = B(""), k = B(""), r = B(""), _ = B(""), b = B(null), g = B([]); + const e = w(""), a = w([]), s = w(""), d = w(""), c = w(""), p = w(""), t = w(""), i = w(""), h = w(""), n = w(""), g = w(""), y = w(null), T = w([]); return { nome: e, - email: f, - documento: _, + email: i, + documento: g, estado: a, - telefone: m, - mensagem: k, - senha: r, - cor: b, - habilidades: g, - idade: v, - altura: y, + telefone: d, + mensagem: h, + senha: n, + cor: y, + habilidades: T, + idade: c, + altura: p, cep: s, - valor: n + valor: t }; } }), ya = { class: "grid-example" }; -function $a(e, a, s, m, v, y) { - const n = G("EliBadge"), f = G("EliInput"), k = G("EliBotao"); - return c(), I(ta, null, { - default: L(() => [ - M(Oe, { +function $a(e, a, s, d, c, p) { + const t = H("EliBadge"), i = H("EliInput"), h = H("EliBotao"); + return m(), P(ta, null, { + default: z(() => [ + V(Te, { class: "mx-auto", max_width: "400" }, { - default: L(() => [ - M(Ie, null, { - default: L(() => [ - M(n, { + default: z(() => [ + V(Oe, null, { + default: z(() => [ + V(t, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: L(() => [...a[14] || (a[14] = [ + default: z(() => [...a[14] || (a[14] = [ pe(" Olá Mundo! ", -1) ])]), _: 1 @@ -432,51 +432,51 @@ function $a(e, a, s, m, v, y) { ]), _: 1 }), - M(Ue, null, { - default: L(() => [ + V(qe, null, { + default: z(() => [ a[15] || (a[15] = pe(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - P("div", ya, [ - M(f, { + B("div", ya, [ + V(i, { modelValue: e.nome, - "onUpdate:modelValue": a[0] || (a[0] = (r) => e.nome = r), + "onUpdate:modelValue": a[0] || (a[0] = (n) => e.nome = n), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.idade, - "onUpdate:modelValue": a[1] || (a[1] = (r) => e.idade = r), + "onUpdate:modelValue": a[1] || (a[1] = (n) => e.idade = n), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.altura, - "onUpdate:modelValue": a[2] || (a[2] = (r) => e.altura = r), + "onUpdate:modelValue": a[2] || (a[2] = (n) => e.altura = n), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.valor, - "onUpdate:modelValue": a[3] || (a[3] = (r) => e.valor = r), + "onUpdate:modelValue": a[3] || (a[3] = (n) => e.valor = n), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.telefone, - "onUpdate:modelValue": a[4] || (a[4] = (r) => e.telefone = r), + "onUpdate:modelValue": a[4] || (a[4] = (n) => e.telefone = n), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.cep, - "onUpdate:modelValue": a[5] || (a[5] = (r) => e.cep = r), + "onUpdate:modelValue": a[5] || (a[5] = (n) => e.cep = n), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - M(f, { + V(i, { type: "select", label: "Estado", options: [ @@ -484,58 +484,58 @@ function $a(e, a, s, m, v, y) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": a[6] || (a[6] = (r) => e.estado = r), + "onUpdate:modelValue": a[6] || (a[6] = (n) => e.estado = n), multiple: "" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.documento, - "onUpdate:modelValue": a[7] || (a[7] = (r) => e.documento = r), + "onUpdate:modelValue": a[7] || (a[7] = (n) => e.documento = n), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.email, - "onUpdate:modelValue": a[8] || (a[8] = (r) => e.email = r), + "onUpdate:modelValue": a[8] || (a[8] = (n) => e.email = n), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.senha, - "onUpdate:modelValue": a[9] || (a[9] = (r) => e.senha = r), + "onUpdate:modelValue": a[9] || (a[9] = (n) => e.senha = n), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - M(f, { + V(i, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": a[10] || (a[10] = (r) => e.mensagem = r), + "onUpdate:modelValue": a[10] || (a[10] = (n) => e.mensagem = n), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - M(f, { + V(i, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": a[11] || (a[11] = (r) => e.cor = r), + "onUpdate:modelValue": a[11] || (a[11] = (n) => e.cor = n), label: "Cor favorita", options: [ { label: "Azul", value: "azul" }, { label: "Verde", value: "verde" } ] }, null, 8, ["modelValue"]), - M(f, { + V(i, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": a[12] || (a[12] = (r) => e.habilidades = r), + "onUpdate:modelValue": a[12] || (a[12] = (n) => e.habilidades = n), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - M(f, { + V(i, { modelValue: e.nome, - "onUpdate:modelValue": a[13] || (a[13] = (r) => e.nome = r), + "onUpdate:modelValue": a[13] || (a[13] = (n) => e.nome = n), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -544,14 +544,14 @@ function $a(e, a, s, m, v, y) { ]), _: 1 }), - M(Le, null, { - default: L(() => [ - M(k, { + V(Ie, null, { + default: z(() => [ + V(h, { color: "primary", variant: "elevated", block: "" }, { - default: L(() => [...a[16] || (a[16] = [ + default: z(() => [...a[16] || (a[16] = [ pe(" Botão Vuetify ", -1) ])]), _: 1 @@ -566,9 +566,9 @@ function $a(e, a, s, m, v, y) { _: 1 }); } -const ka = /* @__PURE__ */ q(ga, [["render", $a]]), Va = F({ +const ka = /* @__PURE__ */ j(ga, [["render", $a]]), Aa = N({ name: "EliCartao", - components: { EliBadge: we }, + components: { EliBadge: Ce }, inheritAttrs: !1, props: { /** Título de fallback caso o slot `titulo` não seja usado. */ @@ -595,7 +595,7 @@ const ka = /* @__PURE__ */ q(ga, [["render", $a]]), Va = F({ clicar: (e) => !0 }, setup(e, { emit: a }) { - const s = V(() => e.status), m = V(() => { + const s = A(() => e.status), d = A(() => { switch (e.status) { case "novo": return "primary"; @@ -606,40 +606,40 @@ const ka = /* @__PURE__ */ q(ga, [["render", $a]]), Va = F({ case "cancelado": return "error"; } - }), v = V(() => `eli-cartao--${e.status}`); - function y() { + }), c = A(() => `eli-cartao--${e.status}`); + function p() { a("clicar", e.status); } return { rotuloStatus: s, - corStatus: m, - classeStatus: v, - onClick: y + corStatus: d, + classeStatus: c, + onClick: p }; } -}), wa = { class: "eli-cartao__titulo-texto" }, Ca = { class: "eli-cartao__status" }; -function Sa(e, a, s, m, v, y) { - const n = G("EliBadge"); - return c(), I(Oe, re({ +}), Ca = { class: "eli-cartao__titulo-texto" }, Va = { class: "eli-cartao__status" }; +function Ea(e, a, s, d, c, p) { + const t = H("EliBadge"); + return m(), P(Te, oe({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: L(() => [ - M(Ie, { class: "eli-cartao__titulo" }, { - default: L(() => [ - P("div", wa, [ - de(e.$slots, "titulo", {}, () => [ - pe(H(e.titulo), 1) + default: z(() => [ + V(Oe, { class: "eli-cartao__titulo" }, { + default: z(() => [ + B("div", Ca, [ + ie(e.$slots, "titulo", {}, () => [ + pe(Y(e.titulo), 1) ], !0) ]), - P("div", Ca, [ - M(n, { + B("div", Va, [ + V(t, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: L(() => [...a[0] || (a[0] = [ - P("span", null, null, -1) + default: z(() => [...a[0] || (a[0] = [ + B("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -647,309 +647,309 @@ function Sa(e, a, s, m, v, y) { ]), _: 3 }), - M(Ue, { class: "eli-cartao__conteudo" }, { - default: L(() => [ - de(e.$slots, "default", {}, void 0, !0) + V(qe, { class: "eli-cartao__conteudo" }, { + default: z(() => [ + ie(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (c(), I(Le, { + e.$slots.acoes ? (m(), P(Ie, { key: 0, class: "eli-cartao__acoes" }, { - default: L(() => [ - de(e.$slots, "acoes", {}, void 0, !0) + default: z(() => [ + ie(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : R("", !0) + })) : J("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const _a = /* @__PURE__ */ q(Va, [["render", Sa], ["__scopeId", "data-v-6c492bd9"]]); -function Ma(e) { +const Ma = /* @__PURE__ */ j(Aa, [["render", Ea], ["__scopeId", "data-v-6c492bd9"]]); +function _a(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var ge = { exports: {} }, Da = ge.exports, Me; -function Ba() { +var he = { exports: {} }, wa = he.exports, Me; +function Sa() { return Me || (Me = 1, (function(e, a) { - (function(s, m) { - e.exports = m(); - })(Da, (function() { - var s = 1e3, m = 6e4, v = 36e5, y = "millisecond", n = "second", f = "minute", k = "hour", r = "day", _ = "week", b = "month", g = "quarter", p = "year", T = "date", C = "Invalid Date", Y = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, W = /\[([^\]]+)]|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, j = { 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(h) { - var i = ["th", "st", "nd", "rd"], l = h % 100; - return "[" + h + (i[(l - 20) % 10] || i[l] || i[0]) + "]"; - } }, K = function(h, i, l) { - var t = String(h); - return !t || t.length >= i ? h : "" + Array(i + 1 - t.length).join(l) + h; - }, $e = { s: K, z: function(h) { - var i = -h.utcOffset(), l = Math.abs(i), t = Math.floor(l / 60), o = l % 60; - return (i <= 0 ? "+" : "-") + K(t, 2, "0") + ":" + K(o, 2, "0"); - }, m: function h(i, l) { - if (i.date() < l.date()) return -h(l, i); - var t = 12 * (l.year() - i.year()) + (l.month() - i.month()), o = i.clone().add(t, b), u = l - o < 0, d = i.clone().add(t + (u ? -1 : 1), b); - return +(-(t + (l - o) / (u ? o - d : d - o)) || 0); - }, a: function(h) { - return h < 0 ? Math.ceil(h) || 0 : Math.floor(h); - }, p: function(h) { - return { M: b, y: p, w: _, d: r, D: T, h: k, m: f, s: n, ms: y, Q: g }[h] || String(h || "").toLowerCase().replace(/s$/, ""); - }, u: function(h) { - return h === void 0; - } }, te = "en", Q = {}; - Q[te] = j; - var be = "$isDayjsObject", ce = function(h) { - return h instanceof ne || !(!h || !h[be]); - }, le = function h(i, l, t) { - var o; - if (!i) return te; - if (typeof i == "string") { - var u = i.toLowerCase(); - Q[u] && (o = u), l && (Q[u] = l, o = u); - var d = i.split("-"); - if (!o && d.length > 1) return h(d[0]); + (function(s, d) { + e.exports = d(); + })(wa, (function() { + var s = 1e3, d = 6e4, c = 36e5, p = "millisecond", t = "second", i = "minute", h = "hour", n = "day", g = "week", y = "month", T = "quarter", $ = "year", O = "date", M = "Invalid Date", Q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, x = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, L = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) { + var o = ["th", "st", "nd", "rd"], r = f % 100; + return "[" + f + (o[(r - 20) % 10] || o[r] || o[0]) + "]"; + } }, re = function(f, o, r) { + var u = String(f); + return !u || u.length >= o ? f : "" + Array(o + 1 - u.length).join(r) + f; + }, ke = { s: re, z: function(f) { + var o = -f.utcOffset(), r = Math.abs(o), u = Math.floor(r / 60), l = r % 60; + return (o <= 0 ? "+" : "-") + re(u, 2, "0") + ":" + re(l, 2, "0"); + }, m: function f(o, r) { + if (o.date() < r.date()) return -f(r, o); + var u = 12 * (r.year() - o.year()) + (r.month() - o.month()), l = o.clone().add(u, y), v = r - l < 0, b = o.clone().add(u + (v ? -1 : 1), y); + return +(-(u + (r - l) / (v ? l - b : b - l)) || 0); + }, a: function(f) { + return f < 0 ? Math.ceil(f) || 0 : Math.floor(f); + }, p: function(f) { + return { M: y, y: $, w: g, d: n, D: O, h, m: i, s: t, ms: p, Q: T }[f] || String(f || "").toLowerCase().replace(/s$/, ""); + }, u: function(f) { + return f === void 0; + } }, Z = "en", X = {}; + X[Z] = L; + var ue = "$isDayjsObject", de = function(f) { + return f instanceof ae || !(!f || !f[ue]); + }, ne = function f(o, r, u) { + var l; + if (!o) return Z; + if (typeof o == "string") { + var v = o.toLowerCase(); + X[v] && (l = v), r && (X[v] = r, l = v); + var b = o.split("-"); + if (!l && b.length > 1) return f(b[0]); } else { - var w = i.name; - Q[w] = i, o = w; + var C = o.name; + X[C] = o, l = C; } - return !t && o && (te = o), o || !t && te; - }, O = function(h, i) { - if (ce(h)) return h.clone(); - var l = typeof i == "object" ? i : {}; - return l.date = h, l.args = arguments, new ne(l); - }, S = $e; - S.l = le, S.i = ce, S.w = function(h, i) { - return O(h, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset }); + return !u && l && (Z = l), l || !u && Z; + }, q = function(f, o) { + if (de(f)) return f.clone(); + var r = typeof o == "object" ? o : {}; + return r.date = f, r.args = arguments, new ae(r); + }, E = ke; + E.l = ne, E.i = de, E.w = function(f, o) { + return q(f, { locale: o.$L, utc: o.$u, x: o.$x, $offset: o.$offset }); }; - var ne = (function() { - function h(l) { - this.$L = le(l.locale, null, !0), this.parse(l), this.$x = this.$x || l.x || {}, this[be] = !0; + var ae = (function() { + function f(r) { + this.$L = ne(r.locale, null, !0), this.parse(r), this.$x = this.$x || r.x || {}, this[ue] = !0; } - var i = h.prototype; - return i.parse = function(l) { - this.$d = (function(t) { - var o = t.date, u = t.utc; - if (o === null) return /* @__PURE__ */ new Date(NaN); - if (S.u(o)) return /* @__PURE__ */ new Date(); - if (o instanceof Date) return new Date(o); - if (typeof o == "string" && !/Z$/i.test(o)) { - var d = o.match(Y); - if (d) { - var w = d[2] - 1 || 0, D = (d[7] || "0").substring(0, 3); - return u ? new Date(Date.UTC(d[1], w, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, D)) : new Date(d[1], w, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, D); + var o = f.prototype; + return o.parse = function(r) { + this.$d = (function(u) { + var l = u.date, v = u.utc; + if (l === null) return /* @__PURE__ */ new Date(NaN); + if (E.u(l)) return /* @__PURE__ */ new Date(); + if (l instanceof Date) return new Date(l); + if (typeof l == "string" && !/Z$/i.test(l)) { + var b = l.match(Q); + if (b) { + var C = b[2] - 1 || 0, _ = (b[7] || "0").substring(0, 3); + return v ? new Date(Date.UTC(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, _)) : new Date(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, _); } } - return new Date(o); - })(l), this.init(); - }, i.init = function() { - var l = this.$d; - this.$y = l.getFullYear(), this.$M = l.getMonth(), this.$D = l.getDate(), this.$W = l.getDay(), this.$H = l.getHours(), this.$m = l.getMinutes(), this.$s = l.getSeconds(), this.$ms = l.getMilliseconds(); - }, i.$utils = function() { - return S; - }, i.isValid = function() { - return this.$d.toString() !== C; - }, i.isSame = function(l, t) { - var o = O(l); - return this.startOf(t) <= o && o <= this.endOf(t); - }, i.isAfter = function(l, t) { - return O(l) < this.startOf(t); - }, i.isBefore = function(l, t) { - return this.endOf(t) < O(l); - }, i.$g = function(l, t, o) { - return S.u(l) ? this[t] : this.set(o, l); - }, i.unix = function() { + return new Date(l); + })(r), this.init(); + }, o.init = function() { + var r = this.$d; + this.$y = r.getFullYear(), this.$M = r.getMonth(), this.$D = r.getDate(), this.$W = r.getDay(), this.$H = r.getHours(), this.$m = r.getMinutes(), this.$s = r.getSeconds(), this.$ms = r.getMilliseconds(); + }, o.$utils = function() { + return E; + }, o.isValid = function() { + return this.$d.toString() !== M; + }, o.isSame = function(r, u) { + var l = q(r); + return this.startOf(u) <= l && l <= this.endOf(u); + }, o.isAfter = function(r, u) { + return q(r) < this.startOf(u); + }, o.isBefore = function(r, u) { + return this.endOf(u) < q(r); + }, o.$g = function(r, u, l) { + return E.u(r) ? this[u] : this.set(l, r); + }, o.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, i.valueOf = function() { + }, o.valueOf = function() { return this.$d.getTime(); - }, i.startOf = function(l, t) { - var o = this, u = !!S.u(t) || t, d = S.p(l), w = function(ae, N) { - var z = S.w(o.$u ? Date.UTC(o.$y, N, ae) : new Date(o.$y, N, ae), o); - return u ? z : z.endOf(r); - }, D = function(ae, N) { - return S.w(o.toDate()[ae].apply(o.toDate("s"), (u ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(N)), o); - }, E = this.$W, A = this.$M, U = this.$D, x = "set" + (this.$u ? "UTC" : ""); - switch (d) { - case p: - return u ? w(1, 0) : w(31, 11); - case b: - return u ? w(1, A) : w(0, A + 1); - case _: - var J = this.$locale().weekStart || 0, ee = (E < J ? E + 7 : E) - J; - return w(u ? U - ee : U + (6 - ee), A); - case r: - case T: - return D(x + "Hours", 0); - case k: - return D(x + "Minutes", 1); - case f: - return D(x + "Seconds", 2); + }, o.startOf = function(r, u) { + var l = this, v = !!E.u(u) || u, b = E.p(r), C = function(R, I) { + var G = E.w(l.$u ? Date.UTC(l.$y, I, R) : new Date(l.$y, I, R), l); + return v ? G : G.endOf(n); + }, _ = function(R, I) { + return E.w(l.toDate()[R].apply(l.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(I)), l); + }, S = this.$W, D = this.$M, U = this.$D, F = "set" + (this.$u ? "UTC" : ""); + switch (b) { + case $: + return v ? C(1, 0) : C(31, 11); + case y: + return v ? C(1, D) : C(0, D + 1); + case g: + var W = this.$locale().weekStart || 0, te = (S < W ? S + 7 : S) - W; + return C(v ? U - te : U + (6 - te), D); case n: - return D(x + "Milliseconds", 3); + case O: + return _(F + "Hours", 0); + case h: + return _(F + "Minutes", 1); + case i: + return _(F + "Seconds", 2); + case t: + return _(F + "Milliseconds", 3); default: return this.clone(); } - }, i.endOf = function(l) { - return this.startOf(l, !1); - }, i.$set = function(l, t) { - var o, u = S.p(l), d = "set" + (this.$u ? "UTC" : ""), w = (o = {}, o[r] = d + "Date", o[T] = d + "Date", o[b] = d + "Month", o[p] = d + "FullYear", o[k] = d + "Hours", o[f] = d + "Minutes", o[n] = d + "Seconds", o[y] = d + "Milliseconds", o)[u], D = u === r ? this.$D + (t - this.$W) : t; - if (u === b || u === p) { - var E = this.clone().set(T, 1); - E.$d[w](D), E.init(), this.$d = E.set(T, Math.min(this.$D, E.daysInMonth())).$d; - } else w && this.$d[w](D); + }, o.endOf = function(r) { + return this.startOf(r, !1); + }, o.$set = function(r, u) { + var l, v = E.p(r), b = "set" + (this.$u ? "UTC" : ""), C = (l = {}, l[n] = b + "Date", l[O] = b + "Date", l[y] = b + "Month", l[$] = b + "FullYear", l[h] = b + "Hours", l[i] = b + "Minutes", l[t] = b + "Seconds", l[p] = b + "Milliseconds", l)[v], _ = v === n ? this.$D + (u - this.$W) : u; + if (v === y || v === $) { + var S = this.clone().set(O, 1); + S.$d[C](_), S.init(), this.$d = S.set(O, Math.min(this.$D, S.daysInMonth())).$d; + } else C && this.$d[C](_); return this.init(), this; - }, i.set = function(l, t) { - return this.clone().$set(l, t); - }, i.get = function(l) { - return this[S.p(l)](); - }, i.add = function(l, t) { - var o, u = this; - l = Number(l); - var d = S.p(t), w = function(A) { - var U = O(u); - return S.w(U.date(U.date() + Math.round(A * l)), u); + }, o.set = function(r, u) { + return this.clone().$set(r, u); + }, o.get = function(r) { + return this[E.p(r)](); + }, o.add = function(r, u) { + var l, v = this; + r = Number(r); + var b = E.p(u), C = function(D) { + var U = q(v); + return E.w(U.date(U.date() + Math.round(D * r)), v); }; - if (d === b) return this.set(b, this.$M + l); - if (d === p) return this.set(p, this.$y + l); - if (d === r) return w(1); - if (d === _) return w(7); - var D = (o = {}, o[f] = m, o[k] = v, o[n] = s, o)[d] || 1, E = this.$d.getTime() + l * D; - return S.w(E, this); - }, i.subtract = function(l, t) { - return this.add(-1 * l, t); - }, i.format = function(l) { - var t = this, o = this.$locale(); - if (!this.isValid()) return o.invalidDate || C; - var u = l || "YYYY-MM-DDTHH:mm:ssZ", d = S.z(this), w = this.$H, D = this.$m, E = this.$M, A = o.weekdays, U = o.months, x = o.meridiem, J = function(N, z, Z, ie) { - return N && (N[z] || N(t, u)) || Z[z].slice(0, ie); - }, ee = function(N) { - return S.s(w % 12 || 12, N, "0"); - }, ae = x || function(N, z, Z) { - var ie = N < 12 ? "AM" : "PM"; - return Z ? ie.toLowerCase() : ie; + if (b === y) return this.set(y, this.$M + r); + if (b === $) return this.set($, this.$y + r); + if (b === n) return C(1); + if (b === g) return C(7); + var _ = (l = {}, l[i] = d, l[h] = c, l[t] = s, l)[b] || 1, S = this.$d.getTime() + r * _; + return E.w(S, this); + }, o.subtract = function(r, u) { + return this.add(-1 * r, u); + }, o.format = function(r) { + var u = this, l = this.$locale(); + if (!this.isValid()) return l.invalidDate || M; + var v = r || "YYYY-MM-DDTHH:mm:ssZ", b = E.z(this), C = this.$H, _ = this.$m, S = this.$M, D = l.weekdays, U = l.months, F = l.meridiem, W = function(I, G, ce, be) { + return I && (I[G] || I(u, v)) || ce[G].slice(0, be); + }, te = function(I) { + return E.s(C % 12 || 12, I, "0"); + }, R = F || function(I, G, ce) { + var be = I < 12 ? "AM" : "PM"; + return ce ? be.toLowerCase() : be; }; - return u.replace(W, (function(N, z) { - return z || (function(Z) { - switch (Z) { + return v.replace(x, (function(I, G) { + return G || (function(ce) { + switch (ce) { case "YY": - return String(t.$y).slice(-2); + return String(u.$y).slice(-2); case "YYYY": - return S.s(t.$y, 4, "0"); + return E.s(u.$y, 4, "0"); case "M": - return E + 1; + return S + 1; case "MM": - return S.s(E + 1, 2, "0"); + return E.s(S + 1, 2, "0"); case "MMM": - return J(o.monthsShort, E, U, 3); + return W(l.monthsShort, S, U, 3); case "MMMM": - return J(U, E); + return W(U, S); case "D": - return t.$D; + return u.$D; case "DD": - return S.s(t.$D, 2, "0"); + return E.s(u.$D, 2, "0"); case "d": - return String(t.$W); + return String(u.$W); case "dd": - return J(o.weekdaysMin, t.$W, A, 2); + return W(l.weekdaysMin, u.$W, D, 2); case "ddd": - return J(o.weekdaysShort, t.$W, A, 3); + return W(l.weekdaysShort, u.$W, D, 3); case "dddd": - return A[t.$W]; + return D[u.$W]; case "H": - return String(w); + return String(C); case "HH": - return S.s(w, 2, "0"); + return E.s(C, 2, "0"); case "h": - return ee(1); + return te(1); case "hh": - return ee(2); + return te(2); case "a": - return ae(w, D, !0); + return R(C, _, !0); case "A": - return ae(w, D, !1); + return R(C, _, !1); case "m": - return String(D); + return String(_); case "mm": - return S.s(D, 2, "0"); + return E.s(_, 2, "0"); case "s": - return String(t.$s); + return String(u.$s); case "ss": - return S.s(t.$s, 2, "0"); + return E.s(u.$s, 2, "0"); case "SSS": - return S.s(t.$ms, 3, "0"); + return E.s(u.$ms, 3, "0"); case "Z": - return d; + return b; } return null; - })(N) || d.replace(":", ""); + })(I) || b.replace(":", ""); })); - }, i.utcOffset = function() { + }, o.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, i.diff = function(l, t, o) { - var u, d = this, w = S.p(t), D = O(l), E = (D.utcOffset() - this.utcOffset()) * m, A = this - D, U = function() { - return S.m(d, D); + }, o.diff = function(r, u, l) { + var v, b = this, C = E.p(u), _ = q(r), S = (_.utcOffset() - this.utcOffset()) * d, D = this - _, U = function() { + return E.m(b, _); }; - switch (w) { - case p: - u = U() / 12; + switch (C) { + case $: + v = U() / 12; break; - case b: - u = U(); + case y: + v = U(); + break; + case T: + v = U() / 3; break; case g: - u = U() / 3; - break; - case _: - u = (A - E) / 6048e5; - break; - case r: - u = (A - E) / 864e5; - break; - case k: - u = A / v; - break; - case f: - u = A / m; + v = (D - S) / 6048e5; break; case n: - u = A / s; + v = (D - S) / 864e5; + break; + case h: + v = D / c; + break; + case i: + v = D / d; + break; + case t: + v = D / s; break; default: - u = A; + v = D; } - return o ? u : S.a(u); - }, i.daysInMonth = function() { - return this.endOf(b).$D; - }, i.$locale = function() { - return Q[this.$L]; - }, i.locale = function(l, t) { - if (!l) return this.$L; - var o = this.clone(), u = le(l, t, !0); - return u && (o.$L = u), o; - }, i.clone = function() { - return S.w(this.$d, this); - }, i.toDate = function() { + return l ? v : E.a(v); + }, o.daysInMonth = function() { + return this.endOf(y).$D; + }, o.$locale = function() { + return X[this.$L]; + }, o.locale = function(r, u) { + if (!r) return this.$L; + var l = this.clone(), v = ne(r, u, !0); + return v && (l.$L = v), l; + }, o.clone = function() { + return E.w(this.$d, this); + }, o.toDate = function() { return new Date(this.valueOf()); - }, i.toJSON = function() { + }, o.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, i.toISOString = function() { + }, o.toISOString = function() { return this.$d.toISOString(); - }, i.toString = function() { + }, o.toString = function() { return this.$d.toUTCString(); - }, h; - })(), me = ne.prototype; - return O.prototype = me, [["$ms", y], ["$s", n], ["$m", f], ["$H", k], ["$W", r], ["$M", b], ["$y", p], ["$D", T]].forEach((function(h) { - me[h[1]] = function(i) { - return this.$g(i, h[0], h[1]); + }, f; + })(), fe = ae.prototype; + return q.prototype = fe, [["$ms", p], ["$s", t], ["$m", i], ["$H", h], ["$W", n], ["$M", y], ["$y", $], ["$D", O]].forEach((function(f) { + fe[f[1]] = function(o) { + return this.$g(o, f[0], f[1]); }; - })), O.extend = function(h, i) { - return h.$i || (h(i, ne, O), h.$i = !0), O; - }, O.locale = le, O.isDayjs = ce, O.unix = function(h) { - return O(1e3 * h); - }, O.en = Q[te], O.Ls = Q, O.p = {}, O; + })), q.extend = function(f, o) { + return f.$i || (f(o, ae, q), f.$i = !0), q; + }, q.locale = ne, q.isDayjs = de, q.unix = function(f) { + return q(1e3 * f); + }, q.en = X[Z], q.Ls = X, q.p = {}, q; })); - })(ge)), ge.exports; + })(he)), he.exports; } -var Ea = Ba(); -const ve = /* @__PURE__ */ Ma(Ea), Aa = F({ +var Ba = Sa(); +const ve = /* @__PURE__ */ _a(Ba), Da = N({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1049,41 +1049,41 @@ const ve = /* @__PURE__ */ Ma(Ea), Aa = F({ desfoco: () => !0 }, setup(e, { emit: a, attrs: s }) { - const m = V( + const d = A( () => e.modo === "data" ? "date" : "datetime-local" ); - function v(r) { - return e.modo === "data" ? ve(r).format("YYYY-MM-DD") : ve(r).format("YYYY-MM-DDTHH:mm"); + function c(n) { + return e.modo === "data" ? ve(n).format("YYYY-MM-DD") : ve(n).format("YYYY-MM-DDTHH:mm"); } - function y(r) { - return e.modo === "data" ? ve(`${r}T00:00`).format() : ve(r).format(); + function p(n) { + return e.modo === "data" ? ve(`${n}T00:00`).format() : ve(n).format(); } - const n = V({ - get: () => e.modelValue ? v(e.modelValue) : "", - set: (r) => { - const _ = r && r.length > 0 ? r : null; - if (!_) { + const t = A({ + get: () => e.modelValue ? c(e.modelValue) : "", + set: (n) => { + const g = n && n.length > 0 ? n : null; + if (!g) { a("update:modelValue", null), a("alterar", null); return; } - const b = y(_); - a("update:modelValue", b), a("alterar", b); + const y = p(g); + a("update:modelValue", y), a("alterar", y); } - }), f = V(() => { + }), i = A(() => { if (e.min) - return v(e.min); - }), k = V(() => { + return c(e.min); + }), h = A(() => { if (e.max) - return v(e.max); + return c(e.max); }); - return { attrs: s, valor: n, emit: a, minLocal: f, maxLocal: k, tipoInput: m }; + return { attrs: s, valor: t, emit: a, minLocal: i, maxLocal: h, tipoInput: d }; } }), Pa = { class: "eli-data-hora" }; -function Ta(e, a, s, m, v, y) { - return c(), $("div", Pa, [ - M(Te, re({ +function Ta(e, a, s, d, c, p) { + return m(), k("div", Pa, [ + V(Pe, oe({ modelValue: e.valor, - "onUpdate:modelValue": a[0] || (a[0] = (n) => e.valor = n), + "onUpdate:modelValue": a[0] || (a[0] = (t) => e.valor = t), type: e.tipoInput, label: e.rotulo, placeholder: e.placeholder, @@ -1098,19 +1098,20 @@ function Ta(e, a, s, m, v, y) { min: e.minLocal, max: e.maxLocal }, e.attrs, { - onFocus: a[1] || (a[1] = (n) => e.emit("foco")), - onBlur: a[2] || (a[2] = (n) => e.emit("desfoco")) + onFocus: a[1] || (a[1] = (t) => e.emit("foco")), + onBlur: a[2] || (a[2] = (t) => e.emit("desfoco")) }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } -const Oa = /* @__PURE__ */ q(Aa, [["render", Ta], ["__scopeId", "data-v-71afabb6"]]); +const Oa = /* @__PURE__ */ j(Da, [["render", Ta], ["__scopeId", "data-v-71afabb6"]]); +var ze = ((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))(ze || {}); /** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ia = (e) => { +const qa = (e) => { for (const a in e) if (a.startsWith("aria-") || a === "role" || a === "title") return !0; @@ -1122,30 +1123,30 @@ const Ia = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const De = (e) => e === ""; +const _e = (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 Ua = (...e) => e.filter((a, s, m) => !!a && a.trim() !== "" && m.indexOf(a) === s).join(" ").trim(); +const Ia = (...e) => e.filter((a, s, d) => !!a && a.trim() !== "" && d.indexOf(a) === s).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(); +const we = (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 La = (e) => e.replace( +const Ua = (e) => e.replace( /^([A-Z])|[\s-_]+(\w)/g, - (a, s, m) => m ? m.toUpperCase() : s.toLowerCase() + (a, s, d) => d ? d.toUpperCase() : s.toLowerCase() ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1154,7 +1155,7 @@ const La = (e) => e.replace( * See the LICENSE file in the root directory of this source tree. */ const Na = (e) => { - const a = La(e); + const a = Ua(e); return a.charAt(0).toUpperCase() + a.slice(1); }; /** @@ -1163,7 +1164,7 @@ const Na = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -var fe = { +var me = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, @@ -1184,29 +1185,29 @@ const ja = ({ name: e, iconNode: a, absoluteStrokeWidth: s, - "absolute-stroke-width": m, - strokeWidth: v, - "stroke-width": y, - size: n = fe.width, - color: f = fe.stroke, - ...k -}, { slots: r }) => Ve( + "absolute-stroke-width": d, + strokeWidth: c, + "stroke-width": p, + size: t = me.width, + color: i = me.stroke, + ...h +}, { slots: n }) => Ae( "svg", { - ...fe, - ...k, - width: n, - height: n, - stroke: f, - "stroke-width": De(s) || De(m) || s === !0 || m === !0 ? Number(v || y || fe["stroke-width"]) * 24 / Number(n) : v || y || fe["stroke-width"], - class: Ua( + ...me, + ...h, + width: t, + height: t, + stroke: i, + "stroke-width": _e(s) || _e(d) || s === !0 || d === !0 ? Number(c || p || me["stroke-width"]) * 24 / Number(t) : c || p || me["stroke-width"], + class: Ia( "lucide", - k.class, - ...e ? [`lucide-${Be(Na(e))}-icon`, `lucide-${Be(e)}`] : ["lucide-icon"] + h.class, + ...e ? [`lucide-${we(Na(e))}-icon`, `lucide-${we(e)}`] : ["lucide-icon"] ), - ...!r.default && !Ia(k) && { "aria-hidden": "true" } + ...!n.default && !qa(h) && { "aria-hidden": "true" } }, - [...a.map((_) => Ve(..._)), ...r.default ? [r.default()] : []] + [...a.map((g) => Ae(...g)), ...n.default ? [n.default()] : []] ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1214,15 +1215,15 @@ const ja = ({ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const ye = (e, a) => (s, { slots: m, attrs: v }) => Ve( +const $e = (e, a) => (s, { slots: d, attrs: c }) => Ae( ja, { - ...v, + ...c, ...s, iconNode: a, name: e }, - m + d ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1230,7 +1231,7 @@ const ye = (e, a) => (s, { slots: m, attrs: v }) => Ve( * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ee = ye("arrow-down", [ +const Se = $e("arrow-down", [ ["path", { d: "M12 5v14", key: "s699le" }], ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }] ]); @@ -1240,7 +1241,7 @@ const Ee = ye("arrow-down", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ae = ye("arrow-up", [ +const Be = $e("arrow-up", [ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }], ["path", { d: "M12 19V5", key: "x0mq9r" }] ]); @@ -1250,7 +1251,7 @@ const Ae = ye("arrow-up", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Pe = ye("ellipsis-vertical", [ +const za = $e("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" }] @@ -1261,14 +1262,12 @@ const Pe = ye("ellipsis-vertical", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const za = ye("search", [ +const La = $e("search", [ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }], ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }] -]); -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 Ya = F({ +]), Ha = N({ name: "EliTabelaCaixaDeBusca", - components: { Search: za }, + components: { Search: La }, props: { modelo: { type: String, @@ -1282,41 +1281,41 @@ const Ya = F({ } }, setup(e, { emit: a }) { - const s = B(e.modelo ?? ""); - se( + const s = w(e.modelo ?? ""); + le( () => e.modelo, - (v) => { - v !== void 0 && v !== s.value && (s.value = v); + (c) => { + c !== void 0 && c !== s.value && (s.value = c); } ); - function m() { + function d() { a("buscar", s.value.trim()); } - return { texto: s, emitirBusca: m }; + return { texto: s, emitirBusca: d }; } -}), Ha = { class: "eli-tabela__busca" }, Fa = { class: "eli-tabela__busca-input-wrapper" }; -function qa(e, a, s, m, v, y) { - const n = G("Search"); - return c(), $("div", Ha, [ - P("div", Fa, [ - Fe(P("input", { +}), Ya = { class: "eli-tabela__busca" }, Fa = { class: "eli-tabela__busca-input-wrapper" }; +function Ra(e, a, s, d, c, p) { + const t = H("Search"); + return m(), k("div", Ya, [ + B("div", Fa, [ + He(B("input", { id: "eli-tabela-busca", - "onUpdate:modelValue": a[0] || (a[0] = (f) => e.texto = f), + "onUpdate:modelValue": a[0] || (a[0] = (i) => e.texto = i), type: "search", class: "eli-tabela__busca-input", placeholder: "Digite termos para filtrar", - onKeyup: a[1] || (a[1] = qe((...f) => e.emitirBusca && e.emitirBusca(...f), ["enter"])) + onKeyup: a[1] || (a[1] = Ye((...i) => e.emitirBusca && e.emitirBusca(...i), ["enter"])) }, null, 544), [ - [Re, e.texto] + [Fe, e.texto] ]), - P("button", { + B("button", { type: "button", class: "eli-tabela__busca-botao", "aria-label": "Buscar", title: "Buscar", - onClick: a[2] || (a[2] = (...f) => e.emitirBusca && e.emitirBusca(...f)) + onClick: a[2] || (a[2] = (...i) => e.emitirBusca && e.emitirBusca(...i)) }, [ - M(n, { + V(t, { class: "eli-tabela__busca-botao-icone", size: 16, "stroke-width": 2, @@ -1326,7 +1325,482 @@ function qa(e, a, s, m, v, y) { ]) ]); } -const Ra = /* @__PURE__ */ q(Ya, [["render", qa], ["__scopeId", "data-v-0fd1ad15"]]), Wa = F({ +const Wa = /* @__PURE__ */ j(Ha, [["render", Ra], ["__scopeId", "data-v-0fd1ad15"]]), Ja = N({ + name: "EliTabelaCabecalho", + components: { EliTabelaCaixaDeBusca: Wa }, + props: { + exibirBusca: { + type: Boolean, + required: !0 + }, + valorBusca: { + type: String, + required: !0 + }, + acoesCabecalho: { + type: Array, + required: !0 + } + }, + emits: { + buscar(e) { + return typeof e == "string"; + } + }, + setup(e, { emit: a }) { + const s = A(() => e.acoesCabecalho.length > 0); + function d(c) { + a("buscar", c); + } + return { temAcoesCabecalho: s, emitBuscar: d }; + } +}), Za = { class: "eli-tabela__cabecalho" }, Xa = { + key: 1, + class: "eli-tabela__acoes-cabecalho" +}, Ga = ["onClick"], Ka = { class: "eli-tabela__acoes-cabecalho-rotulo" }; +function Qa(e, a, s, d, c, p) { + const t = H("EliTabelaCaixaDeBusca"); + return m(), k("div", Za, [ + e.exibirBusca ? (m(), P(t, { + key: 0, + modelo: e.valorBusca, + onBuscar: e.emitBuscar + }, null, 8, ["modelo", "onBuscar"])) : J("", !0), + e.temAcoesCabecalho ? (m(), k("div", Xa, [ + (m(!0), k(K, null, ee(e.acoesCabecalho, (i, h) => (m(), k("button", { + key: `${i.rotulo}-${h}`, + type: "button", + class: "eli-tabela__acoes-cabecalho-botao", + style: ge(i.cor ? { backgroundColor: i.cor, color: "#fff" } : void 0), + onClick: i.acao + }, [ + i.icone ? (m(), P(ye(i.icone), { + key: 0, + class: "eli-tabela__acoes-cabecalho-icone", + size: 16, + "stroke-width": 2 + })) : J("", !0), + B("span", Ka, Y(i.rotulo), 1) + ], 12, Ga))), 128)) + ])) : J("", !0) + ]); +} +const xa = /* @__PURE__ */ j(Ja, [["render", Qa]]), et = N({ + name: "EliTabelaEstados", + props: { + carregando: { + type: Boolean, + required: !0 + }, + erro: { + type: String, + required: !0 + }, + mensagemVazio: { + type: String, + required: !1, + default: void 0 + } + } +}), at = { + key: 0, + class: "eli-tabela eli-tabela--carregando", + "aria-busy": "true" +}, tt = { + key: 1, + class: "eli-tabela eli-tabela--erro", + role: "alert" +}, ot = { class: "eli-tabela__erro-mensagem" }, rt = { + key: 2, + class: "eli-tabela eli-tabela--vazio" +}; +function nt(e, a, s, d, c, p) { + return e.carregando ? (m(), k("div", at, " Carregando... ")) : e.erro ? (m(), k("div", tt, [ + a[0] || (a[0] = B("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), + B("div", ot, Y(e.erro), 1) + ])) : (m(), k("div", rt, Y(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); +} +const lt = /* @__PURE__ */ j(et, [["render", nt]]), it = N({ + name: "EliTabelaDebug", + props: { + isDev: { + type: Boolean, + required: !0 + }, + menuAberto: { + type: Number, + required: !0 + }, + menuPopupPos: { + type: Object, + required: !0 + } + } +}), st = { + key: 0, + style: { position: "fixed", left: "8px", bottom: "8px", "z-index": "999999", background: "rgba(185,28,28,0.9)", color: "#fff", padding: "6px 10px", "border-radius": "8px", "font-size": "12px", "max-width": "500px" } +}; +function ut(e, a, s, d, c, p) { + return e.isDev ? (m(), k("div", st, [ + a[0] || (a[0] = B("div", null, [ + B("b", null, "EliTabela debug") + ], -1)), + B("div", null, "menuAberto: " + Y(e.menuAberto), 1), + B("div", null, "menuPos: top=" + Y(e.menuPopupPos.top) + ", left=" + Y(e.menuPopupPos.left), 1) + ])) : J("", !0); +} +const dt = /* @__PURE__ */ j(it, [["render", ut]]), ct = N({ + name: "EliTabelaHead", + components: { ArrowUp: Be, ArrowDown: Se }, + props: { + colunas: { + type: Array, + required: !0 + }, + temAcoes: { + type: Boolean, + required: !0 + }, + colunaOrdenacao: { + type: String, + required: !0 + }, + direcaoOrdenacao: { + type: String, + required: !0 + } + }, + emits: { + alternarOrdenacao(e) { + return typeof e == "string" && e.length > 0; + } + }, + setup(e, { emit: a }) { + function s(p) { + return (p == null ? void 0 : p.coluna_ordem) !== void 0 && (p == null ? void 0 : p.coluna_ordem) !== null; + } + function d(p) { + return p === "direita" ? "eli-tabela__celula--direita" : p === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; + } + function c(p) { + a("alternarOrdenacao", p); + } + return { + ArrowUp: Be, + ArrowDown: Se, + isOrdenavel: s, + obterClasseAlinhamento: d, + emitAlternarOrdenacao: c + }; + } +}), mt = { class: "eli-tabela__thead" }, pt = { class: "eli-tabela__tr eli-tabela__tr--header" }, ft = ["onClick"], bt = { class: "eli-tabela__th-texto" }, vt = { + key: 1, + class: "eli-tabela__th-label" +}, ht = { + key: 0, + class: "eli-tabela__th eli-tabela__th--acoes", + scope: "col" +}; +function gt(e, a, s, d, c, p) { + const t = H("ArrowUp"); + return m(), k("thead", mt, [ + B("tr", pt, [ + (m(!0), k(K, null, ee(e.colunas, (i, h) => (m(), k("th", { + key: `th-${h}`, + class: se(["eli-tabela__th", [ + e.isOrdenavel(i) ? "eli-tabela__th--ordenavel" : void 0, + e.obterClasseAlinhamento(i.alinhamento) + ]]), + scope: "col" + }, [ + e.isOrdenavel(i) ? (m(), k("button", { + key: 0, + type: "button", + class: se(["eli-tabela__th-botao", [ + e.colunaOrdenacao === String(i.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 + ]]), + onClick: (n) => e.emitAlternarOrdenacao(String(i.coluna_ordem)) + }, [ + B("span", bt, Y(i.rotulo), 1), + e.colunaOrdenacao === String(i.coluna_ordem) ? (m(), P(ye(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { + key: 0, + class: "eli-tabela__th-icone", + size: 16, + "stroke-width": 2, + "aria-hidden": "true" + })) : (m(), P(t, { + key: 1, + class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", + size: 16, + "stroke-width": 2, + "aria-hidden": "true" + })) + ], 10, ft)) : (m(), k("span", vt, Y(i.rotulo), 1)) + ], 2))), 128)), + e.temAcoes ? (m(), k("th", ht, " Ações ")) : J("", !0) + ]) + ]); +} +const yt = /* @__PURE__ */ j(ct, [["render", gt]]), $t = N({ + name: "EliTabelaCelulaTextoSimples", + components: {}, + props: { + dados: { + type: Object + } + }, + data() { + return {}; + }, + methods: {}, + setup({ dados: e }) { + return { dados: e }; + } +}); +function kt(e, a, s, d, c, p) { + var t; + return Y((t = e.dados) == null ? void 0 : t.texto); +} +const At = /* @__PURE__ */ j($t, [["render", kt]]), Ct = N({ + name: "EliTabelaCelulaNumero", + components: {}, + props: { + dados: { + type: Object + } + }, + data() { + return {}; + }, + methods: {}, + setup({ dados: e }) { + return { dados: e }; + } +}); +function Vt(e, a, s, d, c, p) { + var t; + return Y(String((t = e.dados) == null ? void 0 : t.numero).replace(".", ",")); +} +const Et = /* @__PURE__ */ j(Ct, [["render", Vt]]), Mt = { + textoSimples: At, + numero: Et +}, _t = N({ + name: "EliTabelaCelula", + props: { + celula: { + // `ComponenteCelula` é uma tupla `readonly [tipo, dados]`. + type: Array, + required: !0 + } + }, + setup(e) { + const a = A(() => e.celula[0]), s = A(() => e.celula[1]), d = A(() => Mt[a.value]), c = A(() => s.value); + return { Componente: d, dadosParaComponente: c }; + } +}); +function wt(e, a, s, d, c, p) { + return m(), P(ye(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); +} +const St = /* @__PURE__ */ j(_t, [["render", wt]]), Bt = N({ + name: "EliTabelaBody", + components: { + EliTabelaCelula: St, + MoreVertical: za + }, + props: { + colunas: { + type: Array, + required: !0 + }, + linhas: { + type: Array, + required: !0 + }, + temAcoes: { + type: Boolean, + required: !0 + }, + menuAberto: { + type: Number, + required: !0 + }, + possuiAcoes: { + type: Function, + required: !0 + } + }, + emits: { + toggleMenu(e) { + return e && typeof e.indice == "number"; + } + }, + setup(e, { emit: a }) { + function s(t) { + return t === "direita" ? "eli-tabela__celula--direita" : t === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; + } + function d(t) { + if (t != null) + return typeof t == "number" ? `${t}px` : String(t); + } + function c(t) { + if (!Array.isArray(t)) return; + const i = t[0], h = t[1]; + if (i === "textoSimples") + return typeof (h == null ? void 0 : h.texto) == "string" ? h.texto : void 0; + if (i === "numero") + return typeof (h == null ? void 0 : h.numero) == "number" ? String(h.numero) : void 0; + } + function p(t, i) { + a("toggleMenu", { indice: t, evento: i }); + } + return { + obterClasseAlinhamento: s, + obterMaxWidth: d, + obterTooltipCelula: c, + emitToggleMenu: p + }; + } +}), Dt = { class: "eli-tabela__tbody" }, Pt = ["onClick"], Tt = ["title"], Ot = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"]; +function qt(e, a, s, d, c, p) { + const t = H("EliTabelaCelula"), i = H("MoreVertical"); + return m(), k("tbody", Dt, [ + (m(!0), k(K, null, ee(e.linhas, (h, n) => (m(), k("tr", { + key: `tr-${n}`, + class: se(["eli-tabela__tr", [n % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) + }, [ + (m(!0), k(K, null, ee(e.colunas, (g, y) => (m(), k("td", { + key: `td-${n}-${y}`, + class: se(["eli-tabela__td", [ + g.acao ? "eli-tabela__td--clicavel" : void 0, + e.obterClasseAlinhamento(g.alinhamento) + ]]), + onClick: (T) => g.acao ? () => { + var $; + return ($ = g.acao) == null ? void 0 : $.call(g); + } : void 0 + }, [ + g.truncar ? (m(), k("span", { + key: 0, + class: "eli-tabela__celula-conteudo", + style: ge(g.largura_maxima ? { maxWidth: e.obterMaxWidth(g.largura_maxima) } : void 0), + title: e.obterTooltipCelula(g.celula(h)) + }, [ + V(t, { + celula: g.celula(h) + }, null, 8, ["celula"]) + ], 12, Tt)) : (m(), P(t, { + key: 1, + celula: g.celula(h) + }, null, 8, ["celula"])) + ], 10, Pt))), 128)), + e.temAcoes ? (m(), k("td", { + class: "eli-tabela__td eli-tabela__td--acoes", + key: `td-${n}-acoes` + }, [ + B("div", { + class: se(["eli-tabela__acoes-container", [e.menuAberto === n ? "eli-tabela__acoes-container--aberto" : void 0]]) + }, [ + B("button", { + class: "eli-tabela__acoes-toggle", + type: "button", + id: `eli-tabela-acoes-toggle-${n}`, + disabled: !e.possuiAcoes(n), + "aria-haspopup": "menu", + "aria-expanded": e.menuAberto === n ? "true" : "false", + "aria-controls": e.possuiAcoes(n) ? `eli-tabela-acoes-menu-${n}` : void 0, + "aria-label": e.possuiAcoes(n) ? "Ações da linha" : "Nenhuma ação disponível", + title: e.possuiAcoes(n) ? "Ações" : "Nenhuma ação disponível", + onClick: De((g) => e.emitToggleMenu(n, g), ["stop"]) + }, [ + V(i, { + class: "eli-tabela__acoes-toggle-icone", + size: 18, + "stroke-width": 2 + }) + ], 8, Ot) + ], 2) + ])) : J("", !0) + ], 2))), 128)) + ]); +} +const It = /* @__PURE__ */ j(Bt, [["render", qt]]), Ut = N({ + name: "EliTabelaMenuAcoes", + props: { + menuAberto: { + type: Number, + required: !0 + }, + posicao: { + type: Object, + required: !0 + }, + acoes: { + type: Array, + required: !0 + }, + linha: { + // Aceita qualquer tipo de linha (objeto, string, etc.) sem validação runtime. + type: null, + required: !0 + } + }, + emits: { + executar(e) { + return e !== null && typeof e == "object"; + } + }, + setup(e, { emit: a, expose: s }) { + const d = w(null); + s({ menuEl: d }); + const c = A(() => e.acoes.length > 0); + function p(t) { + e.linha && a("executar", { acao: t.acao, linha: e.linha }); + } + return { menuEl: d, possuiAcoes: c, emitExecutar: p }; + } +}), Nt = ["id", "aria-labelledby"], jt = ["aria-label", "title", "onClick"], zt = { class: "eli-tabela__acoes-item-texto" }; +function Lt(e, a, s, d, c, p) { + return m(), P(Re, { to: "body" }, [ + e.menuAberto !== null && e.possuiAcoes ? (m(), k("ul", { + key: 0, + id: `eli-tabela-acoes-menu-${e.menuAberto}`, + ref: "menuEl", + class: "eli-tabela__acoes-menu", + role: "menu", + "aria-labelledby": `eli-tabela-acoes-toggle-${e.menuAberto}`, + style: ge({ + position: "fixed", + top: `${e.posicao.top}px`, + left: `${e.posicao.left}px`, + zIndex: 999999 + }) + }, [ + (m(!0), k(K, null, ee(e.acoes, (t) => (m(), k("li", { + key: `acao-${e.menuAberto}-${t.indice}`, + class: "eli-tabela__acoes-item", + role: "none" + }, [ + B("button", { + type: "button", + class: "eli-tabela__acoes-item-botao", + style: ge({ color: t.acao.cor }), + role: "menuitem", + "aria-label": t.acao.rotulo, + title: t.acao.rotulo, + onClick: De((i) => e.emitExecutar(t), ["stop"]) + }, [ + (m(), P(ye(t.acao.icone), { + class: "eli-tabela__acoes-item-icone", + size: 16, + "stroke-width": 2 + })), + B("span", zt, Y(t.acao.rotulo), 1) + ], 12, jt) + ]))), 128)) + ], 12, Nt)) : J("", !0) + ]); +} +const Ht = /* @__PURE__ */ j(Ut, [["render", Lt]]), Yt = N({ name: "EliTabelaPaginacao", props: { pagina: { @@ -1348,276 +1822,215 @@ const Ra = /* @__PURE__ */ q(Ya, [["render", qa], ["__scopeId", "data-v-0fd1ad15 } }, setup(e, { emit: a }) { - const s = V(() => { - const r = e.maximoBotoes; - return typeof r == "number" && r >= 5 ? Math.floor(r) : 7; - }), m = V(() => { - const r = e.totalPaginas, _ = e.pagina, b = s.value, g = [], p = (j) => { - g.push({ - label: String(j), - pagina: j, - ativo: j === _ + const s = A(() => { + const n = e.maximoBotoes; + return typeof n == "number" && n >= 5 ? Math.floor(n) : 7; + }), d = A(() => { + const n = e.totalPaginas, g = e.pagina, y = s.value, T = [], $ = (L) => { + T.push({ + label: String(L), + pagina: L, + ativo: L === g }); - }, T = () => { - g.push({ label: "…", ehEllipsis: !0 }); + }, O = () => { + T.push({ label: "…", ehEllipsis: !0 }); }; - if (r <= b) { - for (let j = 1; j <= r; j += 1) - p(j); - return g; + if (n <= y) { + for (let L = 1; L <= n; L += 1) + $(L); + return T; } - const C = Math.max(3, b - 2); - let Y = Math.max(2, _ - Math.floor(C / 2)), W = Y + C - 1; - W >= r && (W = r - 1, Y = W - C + 1), p(1), Y > 2 && T(); - for (let j = Y; j <= W; j += 1) - p(j); - return W < r - 1 && T(), p(r), g; + const M = Math.max(3, y - 2); + let Q = Math.max(2, g - Math.floor(M / 2)), x = Q + M - 1; + x >= n && (x = n - 1, Q = x - M + 1), $(1), Q > 2 && O(); + for (let L = Q; L <= x; L += 1) + $(L); + return x < n - 1 && O(), $(n), T; }); - function v(r) { - if (!r) + function c(n) { + if (!n) return; - const _ = Math.min(Math.max(1, r), e.totalPaginas); - _ !== e.pagina && a("alterar", _); + const g = Math.min(Math.max(1, n), e.totalPaginas); + g !== e.pagina && a("alterar", g); } - const y = V(() => e.pagina <= 1), n = V(() => e.pagina >= e.totalPaginas), f = V(() => e.pagina), k = V(() => e.totalPaginas); + const p = A(() => e.pagina <= 1), t = A(() => e.pagina >= e.totalPaginas), i = A(() => e.pagina), h = A(() => e.totalPaginas); return { - botoes: m, - irParaPagina: v, - anteriorDesabilitado: y, - proximaDesabilitada: n, - paginaAtual: f, - totalPaginasExibidas: k + botoes: d, + irParaPagina: c, + anteriorDesabilitado: p, + proximaDesabilitada: t, + paginaAtual: i, + totalPaginasExibidas: h }; } -}), Ja = { +}), Ft = { key: 0, class: "eli-tabela__paginacao", role: "navigation", "aria-label": "Paginação de resultados" -}, Za = ["disabled"], Xa = { +}, Rt = ["disabled"], Wt = { key: 0, class: "eli-tabela__pagina-ellipsis", "aria-hidden": "true" -}, Ga = ["disabled", "aria-current", "aria-label", "onClick"], Ka = ["disabled"]; -function Qa(e, a, s, m, v, y) { - return e.totalPaginasExibidas > 1 ? (c(), $("nav", Ja, [ - P("button", { +}, Jt = ["disabled", "aria-current", "aria-label", "onClick"], Zt = ["disabled"]; +function Xt(e, a, s, d, c, p) { + return e.totalPaginasExibidas > 1 ? (m(), k("nav", Ft, [ + B("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.anteriorDesabilitado, "aria-label": "Página anterior", - onClick: a[0] || (a[0] = (n) => e.irParaPagina(e.paginaAtual - 1)) - }, " << ", 8, Za), - (c(!0), $(X, null, oe(e.botoes, (n, f) => (c(), $(X, { - key: `${n.label}-${f}` + onClick: a[0] || (a[0] = (t) => e.irParaPagina(e.paginaAtual - 1)) + }, " << ", 8, Rt), + (m(!0), k(K, null, ee(e.botoes, (t, i) => (m(), k(K, { + key: `${t.label}-${i}` }, [ - n.ehEllipsis ? (c(), $("span", Xa, H(n.label), 1)) : (c(), $("button", { + t.ehEllipsis ? (m(), k("span", Wt, Y(t.label), 1)) : (m(), k("button", { key: 1, type: "button", - class: ue(["eli-tabela__pagina-botao", n.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), - disabled: n.ativo, - "aria-current": n.ativo ? "page" : void 0, - "aria-label": `Ir para página ${n.label}`, - onClick: (k) => e.irParaPagina(n.pagina) - }, H(n.label), 11, Ga)) + class: se(["eli-tabela__pagina-botao", t.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + disabled: t.ativo, + "aria-current": t.ativo ? "page" : void 0, + "aria-label": `Ir para página ${t.label}`, + onClick: (h) => e.irParaPagina(t.pagina) + }, Y(t.label), 11, Jt)) ], 64))), 128)), - P("button", { + B("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.proximaDesabilitada, "aria-label": "Próxima página", - onClick: a[1] || (a[1] = (n) => e.irParaPagina(e.paginaAtual + 1)) - }, " >> ", 8, Ka) - ])) : R("", !0); + onClick: a[1] || (a[1] = (t) => e.irParaPagina(e.paginaAtual + 1)) + }, " >> ", 8, Zt) + ])) : J("", !0); } -const xa = /* @__PURE__ */ q(Wa, [["render", Qa], ["__scopeId", "data-v-59d12455"]]), et = F({ - name: "EliTabelaCelulaTextoSimples", - components: {}, - props: { - dados: { - type: Object - } - }, - data() { - return {}; - }, - methods: {}, - setup({ dados: e }) { - return { dados: e }; - } -}); -function at(e, a, s, m, v, y) { - var n; - return H((n = e.dados) == null ? void 0 : n.texto); -} -const tt = /* @__PURE__ */ q(et, [["render", at]]), ot = F({ - name: "EliTabelaCelulaNumero", - components: {}, - props: { - dados: { - type: Object - } - }, - data() { - return {}; - }, - methods: {}, - setup({ dados: e }) { - return { dados: e }; - } -}); -function rt(e, a, s, m, v, y) { - var n; - return H(String((n = e.dados) == null ? void 0 : n.numero).replace(".", ",")); -} -const lt = /* @__PURE__ */ q(ot, [["render", rt]]), nt = { - textoSimples: tt, - numero: lt -}, it = F({ - name: "EliTabelaCelula", - props: { - celula: { - // `ComponenteCelula` é uma tupla `readonly [tipo, dados]`. - type: Array, - required: !0 - } - }, - setup(e) { - const a = V(() => e.celula[0]), s = V(() => e.celula[1]), m = V(() => nt[a.value]), v = V(() => s.value); - return { Componente: m, dadosParaComponente: v }; - } -}); -function st(e, a, s, m, v, y) { - return c(), I(he(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); -} -const ut = /* @__PURE__ */ q(it, [["render", st]]), dt = F({ +const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455"]]), Kt = N({ name: "EliTabela", inheritAttrs: !1, components: { - EliTabelaCaixaDeBusca: Ra, - EliTabelaPaginacao: xa, - EliTabelaCelula: ut, - ArrowUp: Ae, - ArrowDown: Ee, - MoreVertical: Pe + EliTabelaCabecalho: xa, + EliTabelaEstados: lt, + EliTabelaDebug: dt, + EliTabelaHead: yt, + EliTabelaBody: It, + EliTabelaMenuAcoes: Ht, + EliTabelaPaginacao: Gt }, props: { + /** Configuração principal da tabela (colunas, consulta e ações) */ tabela: { type: Object, required: !0 } }, setup(e) { - const a = B(!1), s = B(null), m = B([]), v = B(0), y = B([]), n = B(null), f = /* @__PURE__ */ new Map(), k = B(""), r = B(1), _ = B(null), b = B("asc"), g = V(() => e.tabela), p = V(() => !!e.tabela.mostrarCaixaDeBusca), T = V(() => e.tabela.acoesTabela ?? []), C = V(() => T.value.length > 0), Y = V(() => { - const t = e.tabela.registros_por_consulta; - return typeof t == "number" && t > 0 ? Math.floor(t) : 10; - }), W = V(() => { - const t = Y.value; - if (!t || t <= 0) return 1; - const o = v.value; - return o ? Math.max(1, Math.ceil(o / t)) : 1; - }), j = V(() => (e.tabela.acoesLinha ?? []).length > 0); - let K = 0; - function $e(t, o) { - o ? f.set(t, o) : f.delete(t); + const s = w(!1), d = w(null), c = w([]), p = w(0), t = w([]), i = w(null), h = w(null), n = w({ top: 0, left: 0 }), g = w(""), y = w(1), T = w(null), $ = w("asc"), O = A(() => e.tabela), M = A(() => !!e.tabela.mostrarCaixaDeBusca), Q = A(() => e.tabela.acoesTabela ?? []), x = A(() => Q.value.length > 0), L = A(() => { + const o = e.tabela.registros_por_consulta; + return typeof o == "number" && o > 0 ? Math.floor(o) : 10; + }), re = A(() => { + const o = L.value; + if (!o || o <= 0) return 1; + const r = p.value; + return r ? Math.max(1, Math.ceil(r / o)) : 1; + }), ke = A(() => (e.tabela.acoesLinha ?? []).length > 0); + let Z = 0; + function X(o) { + var _, S, D, U, F, W; + const r = o.getBoundingClientRect(), u = 8, l = ((D = (S = (_ = h.value) == null ? void 0 : _.menuEl) == null ? void 0 : S.value) == null ? void 0 : D.offsetHeight) ?? 0, v = ((W = (F = (U = h.value) == null ? void 0 : U.menuEl) == null ? void 0 : F.value) == null ? void 0 : W.offsetWidth) ?? 180; + let b = r.bottom + u; + const C = r.right - v; + l && b + l > window.innerHeight - u && (b = r.top - u - l), n.value = { + top: Math.max(u, Math.round(b)), + left: Math.max(u, Math.round(C)) + }; } - function te(t) { - if (n.value === null) return; - const o = f.get(n.value); - o && o.contains(t.target) || (n.value = null); + function ue(o) { + var u, l; + if (i.value === null) return; + const r = o.target; + (l = (u = h.value) == null ? void 0 : u.menuEl) != null && l.value && h.value.menuEl.value.contains(r) || (i.value = null); } - function Q(t) { - return (t == null ? void 0 : t.coluna_ordem) !== void 0 && (t == null ? void 0 : t.coluna_ordem) !== null; - } - function be(t) { - if (t) { - if (_.value === t) { - b.value = b.value === "asc" ? "desc" : "asc", l(); + function de(o) { + if (o) { + if (T.value === o) { + $.value = $.value === "asc" ? "desc" : "asc", f(); return; } - _.value = t, b.value = "asc", r.value !== 1 ? r.value = 1 : l(); + T.value = o, $.value = "asc", y.value !== 1 ? y.value = 1 : f(); } } - function ce(t) { - k.value !== t && (k.value = t, r.value !== 1 ? r.value = 1 : l()); + function ne(o) { + g.value !== o && (g.value = o, y.value !== 1 ? y.value = 1 : f()); } - function le(t) { - const o = Math.min(Math.max(1, t), W.value); - o !== r.value && (r.value = o); + function q(o) { + const r = Math.min(Math.max(1, o), re.value); + r !== y.value && (y.value = r); } - function O(t) { - return t === "direita" ? "eli-tabela__celula--direita" : t === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; - } - function S(t) { - if (t != null) - return typeof t == "number" ? `${t}px` : String(t); - } - function ne(t) { - if (!Array.isArray(t)) return; - const o = t[0], u = t[1]; - if (o === "textoSimples") - return typeof (u == null ? void 0 : u.texto) == "string" ? u.texto : void 0; - if (o === "numero") - return typeof (u == null ? void 0 : u.numero) == "number" ? String(u.numero) : void 0; - } - function me(t) { - const o = e.tabela.acoesLinha ?? [], u = y.value[t] ?? []; - return o.map((d, w) => { - const D = d.exibir === void 0 ? !0 : typeof d.exibir == "boolean" ? d.exibir : !1; + function E(o) { + const r = e.tabela.acoesLinha ?? [], u = t.value[o] ?? []; + return r.map((l, v) => { + const b = l.exibir === void 0 ? !0 : typeof l.exibir == "boolean" ? l.exibir : !1; return { - acao: d, - indice: w, - visivel: u[w] ?? D + acao: l, + indice: v, + visivel: u[v] ?? b }; - }).filter((d) => d.visivel); + }).filter((l) => l.visivel); } - function h(t) { - return me(t).length > 0; + function ae(o) { + return E(o).length > 0; } - function i(t) { - h(t) && (n.value = n.value === t ? null : t); + function fe(o, r) { + if (!ae(o)) return; + if (i.value === o) { + i.value = null; + return; + } + i.value = o; + const u = (r == null ? void 0 : r.currentTarget) ?? null; + u && (X(u), requestAnimationFrame(() => X(u))); } - async function l() { - var w, D; - const t = ++K; - a.value = !0, s.value = null, y.value = [], n.value = null, f.clear(); - const o = Math.max(1, Y.value), d = { - offSet: (r.value - 1) * o, - limit: o + async function f() { + var v, b; + const o = ++Z; + s.value = !0, d.value = null, t.value = [], i.value = null; + const r = Math.max(1, L.value), l = { + offSet: (y.value - 1) * r, + limit: r }; - k.value && (d.texto_busca = k.value), _.value && (d.coluna_ordem = _.value, d.direcao_ordem = b.value); + g.value && (l.texto_busca = g.value), T.value && (l.coluna_ordem = T.value, l.direcao_ordem = $.value); try { - const E = e.tabela, A = await E.consulta(d); - if (t !== K) return; - if (A.cod !== Ye.sucesso) { - m.value = [], v.value = 0, s.value = A.mensagem; + const C = e.tabela, _ = await C.consulta(l); + if (o !== Z) return; + if (_.cod !== ze.sucesso) { + c.value = [], p.value = 0, d.value = _.mensagem; return; } - const U = ((w = A.valor) == null ? void 0 : w.valores) ?? [], x = ((D = A.valor) == null ? void 0 : D.quantidade) ?? U.length; - m.value = U, v.value = x; - const J = Math.max(1, Math.ceil((x || 0) / o)); - if (r.value > J) { - r.value = J; + const S = ((v = _.valor) == null ? void 0 : v.valores) ?? [], D = ((b = _.valor) == null ? void 0 : b.quantidade) ?? S.length; + c.value = S, p.value = D; + const U = Math.max(1, Math.ceil((D || 0) / r)); + if (y.value > U) { + y.value = U; return; } - const ee = E.acoesLinha ?? []; - if (!ee.length) { - y.value = []; + const F = C.acoesLinha ?? []; + if (!F.length) { + t.value = []; return; } - const ae = U.map( - () => ee.map((z) => z.exibir === void 0 ? !0 : typeof z.exibir == "boolean" ? z.exibir : !1) + const W = S.map( + () => F.map((R) => R.exibir === void 0 ? !0 : typeof R.exibir == "boolean" ? R.exibir : !1) ); - y.value = ae; - const N = await Promise.all( - U.map( - async (z) => Promise.all( - ee.map(async (Z) => { - if (Z.exibir === void 0) return !0; - if (typeof Z.exibir == "boolean") return Z.exibir; + t.value = W; + const te = await Promise.all( + S.map( + async (R) => Promise.all( + F.map(async (I) => { + if (I.exibir === void 0) return !0; + if (typeof I.exibir == "boolean") return I.exibir; try { - const ie = Z.exibir(z); - return !!await Promise.resolve(ie); + const G = I.exibir(R); + return !!await Promise.resolve(G); } catch { return !1; } @@ -1625,285 +2038,139 @@ const ut = /* @__PURE__ */ q(it, [["render", st]]), dt = F({ ) ) ); - t === K && (y.value = N); - } catch (E) { - if (t !== K) return; - m.value = [], v.value = 0, s.value = E instanceof Error ? E.message : "Erro ao carregar dados."; + o === Z && (t.value = te); + } catch (C) { + if (o !== Z) return; + c.value = [], p.value = 0, d.value = C instanceof Error ? C.message : "Erro ao carregar dados."; } finally { - t === K && (a.value = !1); + o === Z && (s.value = !1); } } return We(() => { - document.addEventListener("click", te), l(); + document.addEventListener("click", ue), f(); }), Je(() => { - document.removeEventListener("click", te), f.clear(); - }), se( + document.removeEventListener("click", ue); + }), le( () => e.tabela.mostrarCaixaDeBusca, - (t) => { - !t && k.value && (k.value = "", r.value !== 1 ? r.value = 1 : l()); + (o) => { + !o && g.value && (g.value = "", y.value !== 1 ? y.value = 1 : f()); } - ), se(r, (t, o) => { - t !== o && l(); - }), se( + ), le(y, (o, r) => { + o !== r && f(); + }), le( () => e.tabela, () => { - n.value = null, f.clear(), _.value = null, b.value = "asc", k.value = "", r.value !== 1 ? r.value = 1 : l(); + i.value = null, T.value = null, $.value = "asc", g.value = "", y.value !== 1 ? y.value = 1 : f(); } - ), se( + ), le( () => e.tabela.registros_por_consulta, () => { - r.value !== 1 ? r.value = 1 : l(); + y.value !== 1 ? y.value = 1 : f(); } - ), se(m, () => { - n.value = null, f.clear(); + ), le(c, () => { + i.value = null; }), { // state - tabela: g, - carregando: a, - erro: s, - linhas: m, - quantidade: v, - menuAberto: n, - valorBusca: k, - paginaAtual: r, - colunaOrdenacao: _, - direcaoOrdenacao: b, - totalPaginas: W, + isDev: !1, + tabela: O, + carregando: s, + erro: d, + linhas: c, + quantidade: p, + menuAberto: i, + valorBusca: g, + paginaAtual: y, + colunaOrdenacao: T, + direcaoOrdenacao: $, + totalPaginas: re, // computed - exibirBusca: p, - acoesCabecalho: T, - temAcoesCabecalho: C, - temAcoes: j, - // icons - ArrowUp: Ae, - ArrowDown: Ee, - MoreVertical: Pe, - // helpers - isOrdenavel: Q, - obterClasseAlinhamento: O, - obterMaxWidth: S, - obterTooltipCelula: ne, + exibirBusca: M, + acoesCabecalho: Q, + temAcoesCabecalho: x, + temAcoes: ke, // actions - alternarOrdenacao: be, - atualizarBusca: ce, - irParaPagina: le, - registrarMenuElemento: $e, - acoesDisponiveisPorLinha: me, - possuiAcoes: h, - toggleMenu: i + alternarOrdenacao: de, + atualizarBusca: ne, + irParaPagina: q, + acoesDisponiveisPorLinha: E, + possuiAcoes: ae, + toggleMenu: fe, + // popup + menuPopup: h, + menuPopupPos: n }; } -}), ct = { class: "eli-tabela" }, mt = { - key: 0, - class: "eli-tabela eli-tabela--carregando", - "aria-busy": "true" -}, ft = { - key: 1, - class: "eli-tabela eli-tabela--erro", - role: "alert" -}, pt = { class: "eli-tabela__erro-mensagem" }, bt = { - key: 2, - class: "eli-tabela eli-tabela--vazio" -}, vt = { - key: 0, - class: "eli-tabela__cabecalho" -}, ht = { - key: 1, - class: "eli-tabela__acoes-cabecalho" -}, gt = ["onClick"], yt = { class: "eli-tabela__acoes-cabecalho-rotulo" }, $t = { class: "eli-tabela__table" }, kt = { class: "eli-tabela__thead" }, Vt = { class: "eli-tabela__tr eli-tabela__tr--header" }, wt = ["onClick"], Ct = { class: "eli-tabela__th-texto" }, St = { - key: 1, - class: "eli-tabela__th-label" -}, _t = { - key: 0, - class: "eli-tabela__th eli-tabela__th--acoes", - scope: "col" -}, Mt = { class: "eli-tabela__tbody" }, Dt = ["onClick"], Bt = ["title"], Et = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"], At = ["id", "aria-labelledby"], Pt = ["aria-label", "title", "onClick"], Tt = { class: "eli-tabela__acoes-item-texto" }; -function Ot(e, a, s, m, v, y) { - const n = G("EliTabelaCaixaDeBusca"), f = G("ArrowUp"), k = G("EliTabelaCelula"), r = G("MoreVertical"), _ = G("EliTabelaPaginacao"); - return c(), $("div", ct, [ - e.carregando ? (c(), $("div", mt, " Carregando... ")) : e.erro ? (c(), $("div", ft, [ - a[0] || (a[0] = P("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), - P("div", pt, H(e.erro), 1) - ])) : e.linhas.length ? (c(), $(X, { key: 3 }, [ - e.exibirBusca || e.temAcoesCabecalho ? (c(), $("div", vt, [ - e.exibirBusca ? (c(), I(n, { - key: 0, - modelo: e.valorBusca, - onBuscar: e.atualizarBusca - }, null, 8, ["modelo", "onBuscar"])) : R("", !0), - e.temAcoesCabecalho ? (c(), $("div", ht, [ - (c(!0), $(X, null, oe(e.acoesCabecalho, (b, g) => (c(), $("button", { - key: `${b.rotulo}-${g}`, - type: "button", - class: "eli-tabela__acoes-cabecalho-botao", - style: ke(b.cor ? { backgroundColor: b.cor, color: "#fff" } : void 0), - onClick: b.acao - }, [ - b.icone ? (c(), I(he(b.icone), { - key: 0, - class: "eli-tabela__acoes-cabecalho-icone", - size: 16, - "stroke-width": 2 - })) : R("", !0), - P("span", yt, H(b.rotulo), 1) - ], 12, gt))), 128)) - ])) : R("", !0) - ])) : R("", !0), - P("table", $t, [ - P("thead", kt, [ - P("tr", Vt, [ - (c(!0), $(X, null, oe(e.tabela.colunas, (b, g) => (c(), $("th", { - key: `th-${g}`, - class: ue(["eli-tabela__th", [ - e.isOrdenavel(b) ? "eli-tabela__th--ordenavel" : void 0, - e.obterClasseAlinhamento(b.alinhamento) - ]]), - scope: "col" - }, [ - e.isOrdenavel(b) ? (c(), $("button", { - key: 0, - type: "button", - class: ue(["eli-tabela__th-botao", [ - e.colunaOrdenacao === String(b.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 - ]]), - onClick: (p) => e.alternarOrdenacao(String(b.coluna_ordem)) - }, [ - P("span", Ct, H(b.rotulo), 1), - e.colunaOrdenacao === String(b.coluna_ordem) ? (c(), I(he(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { - key: 0, - class: "eli-tabela__th-icone", - size: 16, - "stroke-width": 2, - "aria-hidden": "true" - })) : (c(), I(f, { - key: 1, - class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", - size: 16, - "stroke-width": 2, - "aria-hidden": "true" - })) - ], 10, wt)) : (c(), $("span", St, H(b.rotulo), 1)) - ], 2))), 128)), - e.temAcoes ? (c(), $("th", _t, " Ações ")) : R("", !0) - ]) - ]), - P("tbody", Mt, [ - (c(!0), $(X, null, oe(e.linhas, (b, g) => (c(), $("tr", { - key: `tr-${g}`, - class: ue(["eli-tabela__tr", [g % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) - }, [ - (c(!0), $(X, null, oe(e.tabela.colunas, (p, T) => (c(), $("td", { - key: `td-${g}-${T}`, - class: ue(["eli-tabela__td", [ - p.acao ? "eli-tabela__td--clicavel" : void 0, - e.obterClasseAlinhamento(p.alinhamento) - ]]), - onClick: (C) => p.acao ? () => { - var Y; - return (Y = p.acao) == null ? void 0 : Y.call(p); - } : void 0 - }, [ - p.truncar ? (c(), $("span", { - key: 0, - class: "eli-tabela__celula-conteudo", - style: ke(p.largura_maxima ? { maxWidth: e.obterMaxWidth(p.largura_maxima) } : void 0), - title: e.obterTooltipCelula(p.celula(b)) - }, [ - M(k, { - celula: p.celula(b) - }, null, 8, ["celula"]) - ], 12, Bt)) : (c(), I(k, { - key: 1, - celula: p.celula(b) - }, null, 8, ["celula"])) - ], 10, Dt))), 128)), - e.temAcoes ? (c(), $("td", { - class: "eli-tabela__td eli-tabela__td--acoes", - key: `td-${g}-acoes` - }, [ - P("div", { - class: ue(["eli-tabela__acoes-container", [e.menuAberto === g ? "eli-tabela__acoes-container--aberto" : void 0]]) - }, [ - P("button", { - class: "eli-tabela__acoes-toggle", - type: "button", - id: `eli-tabela-acoes-toggle-${g}`, - disabled: !e.possuiAcoes(g), - "aria-haspopup": "menu", - "aria-expanded": e.menuAberto === g ? "true" : "false", - "aria-controls": e.possuiAcoes(g) ? `eli-tabela-acoes-menu-${g}` : void 0, - "aria-label": e.possuiAcoes(g) ? "Ações da linha" : "Nenhuma ação disponível", - title: e.possuiAcoes(g) ? "Ações" : "Nenhuma ação disponível", - onClick: Se((p) => e.toggleMenu(g), ["stop"]) - }, [ - M(r, { - class: "eli-tabela__acoes-toggle-icone", - size: 18, - "stroke-width": 2 - }) - ], 8, Et), - e.menuAberto === g && e.possuiAcoes(g) ? (c(), $("ul", { - key: 0, - id: `eli-tabela-acoes-menu-${g}`, - class: "eli-tabela__acoes-menu", - role: "menu", - "aria-labelledby": `eli-tabela-acoes-toggle-${g}` - }, [ - (c(!0), $(X, null, oe(e.acoesDisponiveisPorLinha(g), (p) => (c(), $("li", { - key: `acao-${g}-${p.indice}`, - class: "eli-tabela__acoes-item", - role: "none" - }, [ - P("button", { - type: "button", - class: "eli-tabela__acoes-item-botao", - style: ke({ color: p.acao.cor }), - role: "menuitem", - "aria-label": p.acao.rotulo, - title: p.acao.rotulo, - onClick: Se( - () => { - e.menuAberto = null, p.acao.acao(b); - }, - ["stop"] - ) - }, [ - (c(), I(he(p.acao.icone), { - class: "eli-tabela__acoes-item-icone", - size: 16, - "stroke-width": 2 - })), - P("span", Tt, H(p.acao.rotulo), 1) - ], 12, Pt) - ]))), 128)) - ], 8, At)) : R("", !0) - ], 2) - ])) : R("", !0) - ], 2))), 128)) - ]) +}), Qt = { class: "eli-tabela" }, xt = { class: "eli-tabela__table" }; +function eo(e, a, s, d, c, p) { + const t = H("EliTabelaDebug"), i = H("EliTabelaEstados"), h = H("EliTabelaCabecalho"), n = H("EliTabelaHead"), g = H("EliTabelaBody"), y = H("EliTabelaMenuAcoes"), T = H("EliTabelaPaginacao"); + return m(), k("div", Qt, [ + V(t, { + isDev: e.isDev, + menuAberto: e.menuAberto, + menuPopupPos: e.menuPopupPos + }, null, 8, ["isDev", "menuAberto", "menuPopupPos"]), + e.carregando || e.erro || !e.linhas.length ? (m(), P(i, { + key: 0, + carregando: e.carregando, + erro: e.erro, + mensagemVazio: e.tabela.mensagemVazio + }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (m(), k(K, { key: 1 }, [ + e.exibirBusca || e.temAcoesCabecalho ? (m(), P(h, { + key: 0, + exibirBusca: e.exibirBusca, + valorBusca: e.valorBusca, + acoesCabecalho: e.acoesCabecalho, + onBuscar: e.atualizarBusca + }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar"])) : J("", !0), + B("table", xt, [ + V(n, { + colunas: e.tabela.colunas, + temAcoes: e.temAcoes, + colunaOrdenacao: e.colunaOrdenacao, + direcaoOrdenacao: e.direcaoOrdenacao, + onAlternarOrdenacao: e.alternarOrdenacao + }, null, 8, ["colunas", "temAcoes", "colunaOrdenacao", "direcaoOrdenacao", "onAlternarOrdenacao"]), + V(g, { + colunas: e.tabela.colunas, + linhas: e.linhas, + temAcoes: e.temAcoes, + menuAberto: e.menuAberto, + possuiAcoes: e.possuiAcoes, + onToggleMenu: a[0] || (a[0] = ({ indice: $, evento: O }) => e.toggleMenu($, O)) + }, null, 8, ["colunas", "linhas", "temAcoes", "menuAberto", "possuiAcoes"]) ]), - e.totalPaginas > 1 && e.quantidade > 0 ? (c(), I(_, { + V(y, { + ref: "menuPopup", + menuAberto: e.menuAberto, + posicao: e.menuPopupPos, + acoes: e.menuAberto === null ? [] : e.acoesDisponiveisPorLinha(e.menuAberto), + linha: e.menuAberto === null ? null : e.linhas[e.menuAberto], + onExecutar: a[1] || (a[1] = ({ acao: $, linha: O }) => { + e.menuAberto = null, $.acao(O); + }) + }, null, 8, ["menuAberto", "posicao", "acoes", "linha"]), + e.totalPaginas > 1 && e.quantidade > 0 ? (m(), P(T, { key: 1, pagina: e.paginaAtual, totalPaginas: e.totalPaginas, maximoBotoes: e.tabela.maximo_botoes_paginacao, onAlterar: e.irParaPagina - }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : R("", !0) - ], 64)) : (c(), $("div", bt, H(e.tabela.mensagemVazio ?? "Nenhum registro encontrado."), 1)) + }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : J("", !0) + ], 64)) ]); } -const It = /* @__PURE__ */ q(dt, [["render", Ot], ["__scopeId", "data-v-e714deaf"]]), Zt = { +const ao = /* @__PURE__ */ j(Kt, [["render", eo]]), bo = { install(e) { - e.component("EliOlaMundo", ka), e.component("EliBotao", Ne), e.component("EliBadge", we), e.component("EliInput", ze), e.component("EliCartao", _a), e.component("EliDataHora", Oa), e.component("EliTabela", It); + e.component("EliOlaMundo", ka), e.component("EliBotao", Ue), e.component("EliBadge", Ce), e.component("EliInput", je), e.component("EliCartao", Ma), e.component("EliDataHora", Oa), e.component("EliTabela", ao); } }; export { - we as EliBadge, - Ne as EliBotao, - _a as EliCartao, + Ce as EliBadge, + Ue as EliBotao, + Ma as EliCartao, Oa as EliDataHora, - ze as EliInput, + je as EliInput, ka as EliOlaMundo, - It as EliTabela, - Zt as default + ao as EliTabela, + bo as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index 01d14c9..72e5461 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1,66 +1,66 @@ -(function(S,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):(S=typeof globalThis<"u"?globalThis:S||self,t(S.eli_vue={},S.Vue,S.VBtn,S.VBadge,S.VCheckbox,S.VIcon,S.VRadio,S.VRadioGroup,S.VSelect,S.VTextField,S.VTextarea,S.VCard,S.VGrid))})(this,(function(S,t,Be,Ce,Ee,we,Se,_e,Me,se,De,R,Ne){"use strict";const Pe=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}}}),I=(e,a)=>{const d=e.__vccOpts||e;for(const[m,h]of a)d[m]=h;return d};function Te(e,a,d,m,h,$){return t.openBlock(),t.createBlock(Be.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const ne=I(Pe,[["render",Te]]),de={suave:"4px",pill:"10px"},Ae=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),d=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),m=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:d,badgeStyle:m}}});function Oe(e,a,d,m,h,$){return e.showBadge?(t.openBlock(),t.createBlock(Ce.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 x=I(Ae,[["render",Oe],["__scopeId","data-v-de2fbf2f"]]);function Ie(e){return e.replace(/\D+/g,"")}function Le(e){const a=Ie(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 Ue(e){return e.replace(/\D+/g,"")}function Fe(e){const a=Ue(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function re(e){return e.replace(/\D+/g,"")}function ce(e){const a=e.replace(/[^\d,]/g,""),d=a.split(",");return d.length>2?d[0]+","+d.slice(1).join(""):a}function je(e){return ce(e.replace(/%/g,""))}function ze(e){const a=re(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function qe(e){const a=re(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const ve=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:d}){const m=t.ref(!1),h=t.ref(!1),$=t.computed({get:()=>e.modelValue,set:f=>{a("update:modelValue",f),a("change",f)}}),i=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),p=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"}),r=t.computed(()=>e.error?"error":m.value?e.color:void 0);function E(f){const D=f.target;let B=D.value;switch(e.type){case"numericoInteiro":B=re(B);break;case"numericoDecimal":B=ce(B);break;case"numericoMoeda":B=ze(B);break;case"porcentagem":B=je(B);break;case"telefone":B=Fe(B);break;case"cpfCnpj":B=Le(B);break;case"cep":B=qe(B);break}D.value=B,a("update:modelValue",B),a("change",B)}function b(){h.value=!h.value}const g=t.computed(()=>(e.options||[]).map(f=>{if(f&&typeof f=="object"&&"value"in f){const B=f.value;return{label:f.label??String(B),value:B,disabled:f.disabled}}const D=f;return{label:String(D),value:D}}));return{attrs:d,value:$,isTextLike:i,inputHtmlType:p,inputMode:k,internalColor:r,showPassword:h,togglePassword:b,onInput:E,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:g}}}),He={class:"eli-input"},Ye={key:4,class:"checkbox-group"};function Re(e,a,d,m,h,$){return t.openBlock(),t.createElementBlock("div",He,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),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(we.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(De.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=i=>e.value=i),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(Me.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=i=>e.value=i),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]=i=>e.value=i),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,i=>(t.openBlock(),t.createBlock(Se.VRadio,{key:String(i.value),label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Ye,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,i=>(t.openBlock(),t.createBlock(Ee.VCheckbox,{key:String(i.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=p=>e.value=p),label:i.label,value:i.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const le=I(ve,[["render",Re],["__scopeId","data-v-756cb549"]]),We=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:ne,EliBadge:x,EliInput:le},setup(){const e=t.ref(""),a=t.ref([]),d=t.ref(""),m=t.ref(""),h=t.ref(""),$=t.ref(""),i=t.ref(""),p=t.ref(""),k=t.ref(""),r=t.ref(""),E=t.ref(""),b=t.ref(null),g=t.ref([]);return{nome:e,email:p,documento:E,estado:a,telefone:m,mensagem:k,senha:r,cor:b,habilidades:g,idade:h,altura:$,cep:d,valor:i}}}),Ge={class:"grid-example"};function Je(e,a,d,m,h,$){const i=t.resolveComponent("EliBadge"),p=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ne.VContainer,null,{default:t.withCtx(()=>[t.createVNode(R.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(R.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(i,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(R.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Ge,[t.createVNode(p,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=r=>e.nome=r),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=r=>e.idade=r),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=r=>e.altura=r),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=r=>e.valor=r),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=r=>e.telefone=r),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=r=>e.cep=r),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(p,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=r=>e.estado=r),multiple:""},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=r=>e.documento=r),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=r=>e.email=r),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=r=>e.senha=r),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(p,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=r=>e.mensagem=r),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(p,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=r=>e.cor=r),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(p,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=r=>e.habilidades=r),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(p,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=r=>e.nome=r),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(R.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(k,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ue=I(We,[["render",Je]]),Ze=t.defineComponent({name:"EliCartao",components:{EliBadge:x},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const d=t.computed(()=>e.status),m=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 $(){a("clicar",e.status)}return{rotuloStatus:d,corStatus:m,classeStatus:h,onClick:$}}}),Xe={class:"eli-cartao__titulo-texto"},Ke={class:"eli-cartao__status"};function Qe(e,a,d,m,h,$){const i=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(R.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(R.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Xe,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Ke,[t.createVNode(i,{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(R.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(R.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const me=I(Ze,[["render",Qe],["__scopeId","data-v-6c492bd9"]]);function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ee={exports:{}},et=ee.exports,pe;function tt(){return pe||(pe=1,(function(e,a){(function(d,m){e.exports=m()})(et,(function(){var d=1e3,m=6e4,h=36e5,$="millisecond",i="second",p="minute",k="hour",r="day",E="week",b="month",g="quarter",f="year",D="date",B="Invalid Date",L=/^(\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,A={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(y){var s=["th","st","nd","rd"],l=y%100;return"["+y+(s[(l-20)%10]||s[l]||s[0])+"]"}},z=function(y,s,l){var o=String(y);return!o||o.length>=s?y:""+Array(s+1-o.length).join(l)+y},ie={s:z,z:function(y){var s=-y.utcOffset(),l=Math.abs(s),o=Math.floor(l/60),n=l%60;return(s<=0?"+":"-")+z(o,2,"0")+":"+z(n,2,"0")},m:function y(s,l){if(s.date()1)return y(u[0])}else{var V=s.name;q[V]=s,n=V}return!o&&n&&(W=n),n||!o&&W},N=function(y,s){if(K(y))return y.clone();var l=typeof s=="object"?s:{};return l.date=y,l.args=arguments,new J(l)},C=ie;C.l=G,C.i=K,C.w=function(y,s){return N(y,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var J=(function(){function y(l){this.$L=G(l.locale,null,!0),this.parse(l),this.$x=this.$x||l.x||{},this[oe]=!0}var s=y.prototype;return s.parse=function(l){this.$d=(function(o){var n=o.date,c=o.utc;if(n===null)return new Date(NaN);if(C.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var u=n.match(L);if(u){var V=u[2]-1||0,w=(u[7]||"0").substring(0,3);return c?new Date(Date.UTC(u[1],V,u[3]||1,u[4]||0,u[5]||0,u[6]||0,w)):new Date(u[1],V,u[3]||1,u[4]||0,u[5]||0,u[6]||0,w)}}return new Date(n)})(l),this.init()},s.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},s.$utils=function(){return C},s.isValid=function(){return this.$d.toString()!==B},s.isSame=function(l,o){var n=N(l);return this.startOf(o)<=n&&n<=this.endOf(o)},s.isAfter=function(l,o){return N(l)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:d}){const m=t.computed(()=>e.modo==="data"?"date":"datetime-local");function h(r){return e.modo==="data"?te(r).format("YYYY-MM-DD"):te(r).format("YYYY-MM-DDTHH:mm")}function $(r){return e.modo==="data"?te(`${r}T00:00`).format():te(r).format()}const i=t.computed({get:()=>e.modelValue?h(e.modelValue):"",set:r=>{const E=r&&r.length>0?r:null;if(!E){a("update:modelValue",null),a("alterar",null);return}const b=$(E);a("update:modelValue",b),a("alterar",b)}}),p=t.computed(()=>{if(e.min)return h(e.min)}),k=t.computed(()=>{if(e.max)return h(e.max)});return{attrs:d,valor:i,emit:a,minLocal:p,maxLocal:k,tipoInput:m}}}),nt={class:"eli-data-hora"};function rt(e,a,d,m,h,$){return t.openBlock(),t.createElementBlock("div",nt,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=i=>e.valor=i),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]=i=>e.emit("foco")),onBlur:a[2]||(a[2]=i=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const fe=I(ot,[["render",rt],["__scopeId","data-v-71afabb6"]]);/** +(function(w,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(w=typeof globalThis<"u"?globalThis:w||self,t(w.eli_vue={},w.Vue,w.VBtn,w.VBadge,w.VCheckbox,w.VIcon,w.VRadio,w.VRadioGroup,w.VSelect,w.VTextField,w.VTextarea,w.VCard,w.VGrid))})(this,(function(w,t,Be,Ve,Ce,Ee,Se,we,Ae,se,Me,Y,_e){"use strict";const De=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),N=(e,a)=>{const c=e.__vccOpts||e;for(const[u,m]of a)c[u]=m;return c};function Te(e,a,c,u,m,p){return t.openBlock(),t.createBlock(Be.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const ne=N(De,[["render",Te]]),ce={suave:"4px",pill:"10px"},Ne=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ce?ce[e.radius]:e.radius),c=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),u=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:c,badgeStyle:u}}});function Pe(e,a,c,u,m,p){return e.showBadge?(t.openBlock(),t.createBlock(Ve.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const Q=N(Ne,[["render",Pe],["__scopeId","data-v-de2fbf2f"]]);function Oe(e){return e.replace(/\D+/g,"")}function qe(e){const a=Oe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function Ie(e){return e.replace(/\D+/g,"")}function ze(e){const a=Ie(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function re(e){return e.replace(/\D+/g,"")}function de(e){const a=e.replace(/[^\d,]/g,""),c=a.split(",");return c.length>2?c[0]+","+c.slice(1).join(""):a}function Le(e){return de(e.replace(/%/g,""))}function Ue(e){const a=re(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function je(e){const a=re(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Fe=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:c}){const u=t.ref(!1),m=t.ref(!1),p=t.computed({get:()=>e.modelValue,set:k=>{a("update:modelValue",k),a("change",k)}}),o=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),s=t.computed(()=>e.type==="password"?m.value?"text":"password":"text"),y=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),l=t.computed(()=>e.error?"error":u.value?e.color:void 0);function g(k){const _=k.target;let C=_.value;switch(e.type){case"numericoInteiro":C=re(C);break;case"numericoDecimal":C=de(C);break;case"numericoMoeda":C=Ue(C);break;case"porcentagem":C=Le(C);break;case"telefone":C=ze(C);break;case"cpfCnpj":C=qe(C);break;case"cep":C=je(C);break}_.value=C,a("update:modelValue",C),a("change",C)}function $(){m.value=!m.value}const M=t.computed(()=>(e.options||[]).map(k=>{if(k&&typeof k=="object"&&"value"in k){const C=k.value;return{label:k.label??String(C),value:C,disabled:k.disabled}}const _=k;return{label:String(_),value:_}}));return{attrs:c,value:p,isTextLike:o,inputHtmlType:s,inputMode:y,internalColor:l,showPassword:m,togglePassword:$,onInput:g,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:M}}}),He={class:"eli-input"},Ye={key:4,class:"checkbox-group"};function Re(e,a,c,u,m,p){return t.openBlock(),t.createElementBlock("div",He,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ee.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Me.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value=o),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ae.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value=o),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(we.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=o=>e.value=o),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(Se.VRadio,{key:String(o.value),label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Ye,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(Ce.VCheckbox,{key:String(o.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=s=>e.value=s),label:o.label,value:o.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const le=N(Fe,[["render",Re],["__scopeId","data-v-756cb549"]]),We=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:ne,EliBadge:Q,EliInput:le},setup(){const e=t.ref(""),a=t.ref([]),c=t.ref(""),u=t.ref(""),m=t.ref(""),p=t.ref(""),o=t.ref(""),s=t.ref(""),y=t.ref(""),l=t.ref(""),g=t.ref(""),$=t.ref(null),M=t.ref([]);return{nome:e,email:s,documento:g,estado:a,telefone:u,mensagem:y,senha:l,cor:$,habilidades:M,idade:m,altura:p,cep:c,valor:o}}}),ve={class:"grid-example"};function Ge(e,a,c,u,m,p){const o=t.resolveComponent("EliBadge"),s=t.resolveComponent("EliInput"),y=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(_e.VContainer,null,{default:t.withCtx(()=>[t.createVNode(Y.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(o,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(Y.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",ve,[t.createVNode(s,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=l=>e.nome=l),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=l=>e.idade=l),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=l=>e.altura=l),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=l=>e.valor=l),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=l=>e.telefone=l),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=l=>e.cep=l),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(s,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=l=>e.estado=l),multiple:""},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=l=>e.documento=l),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=l=>e.email=l),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=l=>e.senha=l),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(s,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=l=>e.mensagem=l),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(s,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=l=>e.cor=l),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(s,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=l=>e.habilidades=l),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(s,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=l=>e.nome=l),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(Y.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(y,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ue=N(We,[["render",Ge]]),Je=t.defineComponent({name:"EliCartao",components:{EliBadge:Q},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const c=t.computed(()=>e.status),u=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),m=t.computed(()=>`eli-cartao--${e.status}`);function p(){a("clicar",e.status)}return{rotuloStatus:c,corStatus:u,classeStatus:m,onClick:p}}}),Ze={class:"eli-cartao__titulo-texto"},Xe={class:"eli-cartao__status"};function Ke(e,a,c,u,m,p){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(Y.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Ze,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Xe,[t.createVNode(o,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(Y.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(Y.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const me=N(Je,[["render",Ke],["__scopeId","data-v-6c492bd9"]]);function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}},xe=x.exports,pe;function et(){return pe||(pe=1,(function(e,a){(function(c,u){e.exports=u()})(xe,(function(){var c=1e3,u=6e4,m=36e5,p="millisecond",o="second",s="minute",y="hour",l="day",g="week",$="month",M="quarter",k="year",_="date",C="Invalid Date",F=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,H=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(f){var n=["th","st","nd","rd"],r=f%100;return"["+f+(n[(r-20)%10]||n[r]||n[0])+"]"}},v=function(f,n,r){var d=String(f);return!d||d.length>=n?f:""+Array(n+1-d.length).join(r)+f},ie={s:v,z:function(f){var n=-f.utcOffset(),r=Math.abs(n),d=Math.floor(r/60),i=r%60;return(n<=0?"+":"-")+v(d,2,"0")+":"+v(i,2,"0")},m:function f(n,r){if(n.date()1)return f(b[0])}else{var B=n.name;U[B]=n,i=B}return!d&&i&&(L=i),i||!d&&L},D=function(f,n){if(X(f))return f.clone();var r=typeof n=="object"?n:{};return r.date=f,r.args=arguments,new R(r)},V=ie;V.l=G,V.i=X,V.w=function(f,n){return D(f,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var R=(function(){function f(r){this.$L=G(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[Z]=!0}var n=f.prototype;return n.parse=function(r){this.$d=(function(d){var i=d.date,h=d.utc;if(i===null)return new Date(NaN);if(V.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var b=i.match(F);if(b){var B=b[2]-1||0,E=(b[7]||"0").substring(0,3);return h?new Date(Date.UTC(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)):new Date(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)}}return new Date(i)})(r),this.init()},n.init=function(){var r=this.$d;this.$y=r.getFullYear(),this.$M=r.getMonth(),this.$D=r.getDate(),this.$W=r.getDay(),this.$H=r.getHours(),this.$m=r.getMinutes(),this.$s=r.getSeconds(),this.$ms=r.getMilliseconds()},n.$utils=function(){return V},n.isValid=function(){return this.$d.toString()!==C},n.isSame=function(r,d){var i=D(r);return this.startOf(d)<=i&&i<=this.endOf(d)},n.isAfter=function(r,d){return D(r)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:c}){const u=t.computed(()=>e.modo==="data"?"date":"datetime-local");function m(l){return e.modo==="data"?ee(l).format("YYYY-MM-DD"):ee(l).format("YYYY-MM-DDTHH:mm")}function p(l){return e.modo==="data"?ee(`${l}T00:00`).format():ee(l).format()}const o=t.computed({get:()=>e.modelValue?m(e.modelValue):"",set:l=>{const g=l&&l.length>0?l:null;if(!g){a("update:modelValue",null),a("alterar",null);return}const $=p(g);a("update:modelValue",$),a("alterar",$)}}),s=t.computed(()=>{if(e.min)return m(e.min)}),y=t.computed(()=>{if(e.max)return m(e.max)});return{attrs:c,valor:o,emit:a,minLocal:s,maxLocal:y,tipoInput:u}}}),ot={class:"eli-data-hora"};function nt(e,a,c,u,m,p){return t.openBlock(),t.createElementBlock("div",ot,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=o=>e.emit("foco")),onBlur:a[2]||(a[2]=o=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const fe=N(at,[["render",nt],["__scopeId","data-v-71afabb6"]]);var be=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(be||{});/** * @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=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** + */const rt=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 be=e=>e==="";/** + */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 it=(...e)=>e.filter((a,d,m)=>!!a&&a.trim()!==""&&m.indexOf(a)===d).join(" ").trim();/** + */const lt=(...e)=>e.filter((a,c,u)=>!!a&&a.trim()!==""&&u.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 he=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const ye=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 st=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,d,m)=>m?m.toUpperCase():d.toLowerCase());/** + */const it=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,u)=>u?u.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 dt=e=>{const a=st(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** + */const st=e=>{const a=it(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"};/** + */var J={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 ct=({name:e,iconNode:a,absoluteStrokeWidth:d,"absolute-stroke-width":m,strokeWidth:h,"stroke-width":$,size:i=X.width,color:p=X.stroke,...k},{slots:r})=>t.h("svg",{...X,...k,width:i,height:i,stroke:p,"stroke-width":be(d)||be(m)||d===!0||m===!0?Number(h||$||X["stroke-width"])*24/Number(i):h||$||X["stroke-width"],class:it("lucide",k.class,...e?[`lucide-${he(dt(e))}-icon`,`lucide-${he(e)}`]:["lucide-icon"]),...!r.default&&!lt(k)&&{"aria-hidden":"true"}},[...a.map(E=>t.h(...E)),...r.default?[r.default()]:[]]);/** + */const ct=({name:e,iconNode:a,absoluteStrokeWidth:c,"absolute-stroke-width":u,strokeWidth:m,"stroke-width":p,size:o=J.width,color:s=J.stroke,...y},{slots:l})=>t.h("svg",{...J,...y,width:o,height:o,stroke:s,"stroke-width":he(c)||he(u)||c===!0||u===!0?Number(m||p||J["stroke-width"])*24/Number(o):m||p||J["stroke-width"],class:lt("lucide",y.class,...e?[`lucide-${ye(st(e))}-icon`,`lucide-${ye(e)}`]:["lucide-icon"]),...!l.default&&!rt(y)&&{"aria-hidden":"true"}},[...a.map(g=>t.h(...g)),...l.default?[l.default()]:[]]);/** * @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 ae=(e,a)=>(d,{slots:m,attrs:h})=>t.h(ct,{...h,...d,iconNode:a,name:e},m);/** + */const te=(e,a)=>(c,{slots:u,attrs:m})=>t.h(ct,{...m,...c,iconNode:a,name:e},u);/** * @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 ye=ae("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const ge=te("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=ae("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const $e=te("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 $e=ae("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"}]]);/** + */const dt=te("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"}]]);/** * @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=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);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 mt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:ut},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.ref(e.modelo??"");t.watch(()=>e.modelo,h=>{h!==void 0&&h!==d.value&&(d.value=h)});function m(){a("buscar",d.value.trim())}return{texto:d,emitirBusca:m}}}),pt={class:"eli-tabela__busca"},ft={class:"eli-tabela__busca-input-wrapper"};function bt(e,a,d,m,h,$){const i=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",pt,[t.createElementVNode("div",ft,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=p=>e.texto=p),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...p)=>e.emitirBusca&&e.emitirBusca(...p),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...p)=>e.emitirBusca&&e.emitirBusca(...p))},[t.createVNode(i,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const ht=I(mt,[["render",bt],["__scopeId","data-v-0fd1ad15"]]),yt=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const d=t.computed(()=>{const r=e.maximoBotoes;return typeof r=="number"&&r>=5?Math.floor(r):7}),m=t.computed(()=>{const r=e.totalPaginas,E=e.pagina,b=d.value,g=[],f=A=>{g.push({label:String(A),pagina:A,ativo:A===E})},D=()=>{g.push({label:"…",ehEllipsis:!0})};if(r<=b){for(let A=1;A<=r;A+=1)f(A);return g}const B=Math.max(3,b-2);let L=Math.max(2,E-Math.floor(B/2)),U=L+B-1;U>=r&&(U=r-1,L=U-B+1),f(1),L>2&&D();for(let A=L;A<=U;A+=1)f(A);return Ue.pagina<=1),i=t.computed(()=>e.pagina>=e.totalPaginas),p=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:m,irParaPagina:h,anteriorDesabilitado:$,proximaDesabilitada:i,paginaAtual:p,totalPaginasExibidas:k}}}),gt={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},$t=["disabled"],kt={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Vt=["disabled","aria-current","aria-label","onClick"],Bt=["disabled"];function Ct(e,a,d,m,h,$){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]=i=>e.irParaPagina(e.paginaAtual-1))}," << ",8,$t),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(i,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${i.label}-${p}`},[i.ehEllipsis?(t.openBlock(),t.createElementBlock("span",kt,t.toDisplayString(i.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",i.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:i.ativo,"aria-current":i.ativo?"page":void 0,"aria-label":`Ir para página ${i.label}`,onClick:k=>e.irParaPagina(i.pagina)},t.toDisplayString(i.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]=i=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,Bt)])):t.createCommentVNode("",!0)}const Et=I(yt,[["render",Ct],["__scopeId","data-v-59d12455"]]),wt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function St(e,a,d,m,h,$){var i;return t.toDisplayString((i=e.dados)==null?void 0:i.texto)}const _t=I(wt,[["render",St]]),Mt=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Dt(e,a,d,m,h,$){var i;return t.toDisplayString(String((i=e.dados)==null?void 0:i.numero).replace(".",","))}const Nt={textoSimples:_t,numero:I(Mt,[["render",Dt]])},Pt=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),d=t.computed(()=>e.celula[1]),m=t.computed(()=>Nt[a.value]),h=t.computed(()=>d.value);return{Componente:m,dadosParaComponente:h}}});function Tt(e,a,d,m,h,$){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const At=I(Pt,[["render",Tt]]),Ot=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCaixaDeBusca:ht,EliTabelaPaginacao:Et,EliTabelaCelula:At,ArrowUp:ge,ArrowDown:ye,MoreVertical:$e},props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),d=t.ref(null),m=t.ref([]),h=t.ref(0),$=t.ref([]),i=t.ref(null),p=new Map,k=t.ref(""),r=t.ref(1),E=t.ref(null),b=t.ref("asc"),g=t.computed(()=>e.tabela),f=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),D=t.computed(()=>e.tabela.acoesTabela??[]),B=t.computed(()=>D.value.length>0),L=t.computed(()=>{const o=e.tabela.registros_por_consulta;return typeof o=="number"&&o>0?Math.floor(o):10}),U=t.computed(()=>{const o=L.value;if(!o||o<=0)return 1;const n=h.value;return n?Math.max(1,Math.ceil(n/o)):1}),A=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let z=0;function ie(o,n){n?p.set(o,n):p.delete(o)}function W(o){if(i.value===null)return;const n=p.get(i.value);n&&n.contains(o.target)||(i.value=null)}function q(o){return(o==null?void 0:o.coluna_ordem)!==void 0&&(o==null?void 0:o.coluna_ordem)!==null}function oe(o){if(o){if(E.value===o){b.value=b.value==="asc"?"desc":"asc",l();return}E.value=o,b.value="asc",r.value!==1?r.value=1:l()}}function K(o){k.value!==o&&(k.value=o,r.value!==1?r.value=1:l())}function G(o){const n=Math.min(Math.max(1,o),U.value);n!==r.value&&(r.value=n)}function N(o){return o==="direita"?"eli-tabela__celula--direita":o==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function C(o){if(o!=null)return typeof o=="number"?`${o}px`:String(o)}function J(o){if(!Array.isArray(o))return;const n=o[0],c=o[1];if(n==="textoSimples")return typeof(c==null?void 0:c.texto)=="string"?c.texto:void 0;if(n==="numero")return typeof(c==null?void 0:c.numero)=="number"?String(c.numero):void 0}function Q(o){const n=e.tabela.acoesLinha??[],c=$.value[o]??[];return n.map((u,V)=>{const w=u.exibir===void 0?!0:typeof u.exibir=="boolean"?u.exibir:!1;return{acao:u,indice:V,visivel:c[V]??w}}).filter(u=>u.visivel)}function y(o){return Q(o).length>0}function s(o){y(o)&&(i.value=i.value===o?null:o)}async function l(){var V,w;const o=++z;a.value=!0,d.value=null,$.value=[],i.value=null,p.clear();const n=Math.max(1,L.value),u={offSet:(r.value-1)*n,limit:n};k.value&&(u.texto_busca=k.value),E.value&&(u.coluna_ordem=E.value,u.direcao_ordem=b.value);try{const _=e.tabela,M=await _.consulta(u);if(o!==z)return;if(M.cod!==ke.sucesso){m.value=[],h.value=0,d.value=M.mensagem;return}const P=((V=M.valor)==null?void 0:V.valores)??[],v=((w=M.valor)==null?void 0:w.quantidade)??P.length;m.value=P,h.value=v;const F=Math.max(1,Math.ceil((v||0)/n));if(r.value>F){r.value=F;return}const H=_.acoesLinha??[];if(!H.length){$.value=[];return}const Y=P.map(()=>H.map(O=>O.exibir===void 0?!0:typeof O.exibir=="boolean"?O.exibir:!1));$.value=Y;const T=await Promise.all(P.map(async O=>Promise.all(H.map(async j=>{if(j.exibir===void 0)return!0;if(typeof j.exibir=="boolean")return j.exibir;try{const Z=j.exibir(O);return!!await Promise.resolve(Z)}catch{return!1}}))));o===z&&($.value=T)}catch(_){if(o!==z)return;m.value=[],h.value=0,d.value=_ instanceof Error?_.message:"Erro ao carregar dados."}finally{o===z&&(a.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",W),l()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",W),p.clear()}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,o=>{!o&&k.value&&(k.value="",r.value!==1?r.value=1:l())}),t.watch(r,(o,n)=>{o!==n&&l()}),t.watch(()=>e.tabela,()=>{i.value=null,p.clear(),E.value=null,b.value="asc",k.value="",r.value!==1?r.value=1:l()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{r.value!==1?r.value=1:l()}),t.watch(m,()=>{i.value=null,p.clear()}),{tabela:g,carregando:a,erro:d,linhas:m,quantidade:h,menuAberto:i,valorBusca:k,paginaAtual:r,colunaOrdenacao:E,direcaoOrdenacao:b,totalPaginas:U,exibirBusca:f,acoesCabecalho:D,temAcoesCabecalho:B,temAcoes:A,ArrowUp:ge,ArrowDown:ye,MoreVertical:$e,isOrdenavel:q,obterClasseAlinhamento:N,obterMaxWidth:C,obterTooltipCelula:J,alternarOrdenacao:oe,atualizarBusca:K,irParaPagina:G,registrarMenuElemento:ie,acoesDisponiveisPorLinha:Q,possuiAcoes:y,toggleMenu:s}}}),It={class:"eli-tabela"},Lt={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},Ut={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Ft={class:"eli-tabela__erro-mensagem"},jt={key:2,class:"eli-tabela eli-tabela--vazio"},zt={key:0,class:"eli-tabela__cabecalho"},qt={key:1,class:"eli-tabela__acoes-cabecalho"},vt=["onClick"],Ht={class:"eli-tabela__acoes-cabecalho-rotulo"},Yt={class:"eli-tabela__table"},Rt={class:"eli-tabela__thead"},Wt={class:"eli-tabela__tr eli-tabela__tr--header"},Gt=["onClick"],Jt={class:"eli-tabela__th-texto"},Zt={key:1,class:"eli-tabela__th-label"},Xt={key:0,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"},Kt={class:"eli-tabela__tbody"},Qt=["onClick"],xt=["title"],ea=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"],ta=["id","aria-labelledby"],aa=["aria-label","title","onClick"],oa={class:"eli-tabela__acoes-item-texto"};function na(e,a,d,m,h,$){const i=t.resolveComponent("EliTabelaCaixaDeBusca"),p=t.resolveComponent("ArrowUp"),k=t.resolveComponent("EliTabelaCelula"),r=t.resolveComponent("MoreVertical"),E=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",It,[e.carregando?(t.openBlock(),t.createElementBlock("div",Lt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Ut,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Ft,t.toDisplayString(e.erro),1)])):e.linhas.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",zt,[e.exibirBusca?(t.openBlock(),t.createBlock(i,{key:0,modelo:e.valorBusca,onBuscar:e.atualizarBusca},null,8,["modelo","onBuscar"])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",qt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(b,g)=>(t.openBlock(),t.createElementBlock("button",{key:`${b.rotulo}-${g}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(b.cor?{backgroundColor:b.cor,color:"#fff"}:void 0),onClick:b.acao},[b.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(b.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",Ht,t.toDisplayString(b.rotulo),1)],12,vt))),128))])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("table",Yt,[t.createElementVNode("thead",Rt,[t.createElementVNode("tr",Wt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tabela.colunas,(b,g)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${g}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(b)?"eli-tabela__th--ordenavel":void 0,e.obterClasseAlinhamento(b.alinhamento)]]),scope:"col"},[e.isOrdenavel(b)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(b.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:f=>e.alternarOrdenacao(String(b.coluna_ordem))},[t.createElementVNode("span",Jt,t.toDisplayString(b.rotulo),1),e.colunaOrdenacao===String(b.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(p,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Gt)):(t.openBlock(),t.createElementBlock("span",Zt,t.toDisplayString(b.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",Xt," Ações ")):t.createCommentVNode("",!0)])]),t.createElementVNode("tbody",Kt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(b,g)=>(t.openBlock(),t.createElementBlock("tr",{key:`tr-${g}`,class:t.normalizeClass(["eli-tabela__tr",[g%2===1?"eli-tabela__tr--zebra":void 0]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tabela.colunas,(f,D)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${g}-${D}`,class:t.normalizeClass(["eli-tabela__td",[f.acao?"eli-tabela__td--clicavel":void 0,e.obterClasseAlinhamento(f.alinhamento)]]),onClick:B=>f.acao?()=>{var L;return(L=f.acao)==null?void 0:L.call(f)}:void 0},[f.truncar?(t.openBlock(),t.createElementBlock("span",{key:0,class:"eli-tabela__celula-conteudo",style:t.normalizeStyle(f.largura_maxima?{maxWidth:e.obterMaxWidth(f.largura_maxima)}:void 0),title:e.obterTooltipCelula(f.celula(b))},[t.createVNode(k,{celula:f.celula(b)},null,8,["celula"])],12,xt)):(t.openBlock(),t.createBlock(k,{key:1,celula:f.celula(b)},null,8,["celula"]))],10,Qt))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${g}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===g?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${g}`,disabled:!e.possuiAcoes(g),"aria-haspopup":"menu","aria-expanded":e.menuAberto===g?"true":"false","aria-controls":e.possuiAcoes(g)?`eli-tabela-acoes-menu-${g}`:void 0,"aria-label":e.possuiAcoes(g)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(g)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(f=>e.toggleMenu(g),["stop"])},[t.createVNode(r,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,ea),e.menuAberto===g&&e.possuiAcoes(g)?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${g}`,class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${g}`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesDisponiveisPorLinha(g),f=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${g}-${f.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:f.acao.cor}),role:"menuitem","aria-label":f.acao.rotulo,title:f.acao.rotulo,onClick:t.withModifiers(()=>{e.menuAberto=null,f.acao.acao(b)},["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",oa,t.toDisplayString(f.acao.rotulo),1)],12,aa)]))),128))],8,ta)):t.createCommentVNode("",!0)],2)])):t.createCommentVNode("",!0)],2))),128))])]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(E,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock("div",jt,t.toDisplayString(e.tabela.mensagemVazio??"Nenhum registro encontrado."),1))])}const Ve=I(Ot,[["render",na],["__scopeId","data-v-e714deaf"]]),ra={install(e){e.component("EliOlaMundo",ue),e.component("EliBotao",ne),e.component("EliBadge",x),e.component("EliInput",le),e.component("EliCartao",me),e.component("EliDataHora",fe),e.component("EliTabela",Ve)}};S.EliBadge=x,S.EliBotao=ne,S.EliCartao=me,S.EliDataHora=fe,S.EliInput=le,S.EliOlaMundo=ue,S.EliTabela=Ve,S.default=ra,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); + */const ut=te("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),mt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:ut},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const c=t.ref(e.modelo??"");t.watch(()=>e.modelo,m=>{m!==void 0&&m!==c.value&&(c.value=m)});function u(){a("buscar",c.value.trim())}return{texto:c,emitirBusca:u}}}),pt={class:"eli-tabela__busca"},ft={class:"eli-tabela__busca-input-wrapper"};function bt(e,a,c,u,m,p){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",pt,[t.createElementVNode("div",ft,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=s=>e.texto=s),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...s)=>e.emitirBusca&&e.emitirBusca(...s),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...s)=>e.emitirBusca&&e.emitirBusca(...s))},[t.createVNode(o,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const ht=N(mt,[["render",bt],["__scopeId","data-v-0fd1ad15"]]),yt=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:ht},props:{exibirBusca:{type:Boolean,required:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const c=t.computed(()=>e.acoesCabecalho.length>0);function u(m){a("buscar",m)}return{temAcoesCabecalho:c,emitBuscar:u}}}),gt={class:"eli-tabela__cabecalho"},$t={key:1,class:"eli-tabela__acoes-cabecalho"},kt=["onClick"],Bt={class:"eli-tabela__acoes-cabecalho-rotulo"};function Vt(e,a,c,u,m,p){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",gt,[e.exibirBusca?(t.openBlock(),t.createBlock(o,{key:0,modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",$t,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(s,y)=>(t.openBlock(),t.createElementBlock("button",{key:`${s.rotulo}-${y}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(s.cor?{backgroundColor:s.cor,color:"#fff"}:void 0),onClick:s.acao},[s.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",Bt,t.toDisplayString(s.rotulo),1)],12,kt))),128))])):t.createCommentVNode("",!0)])}const Ct=N(yt,[["render",Vt]]),Et=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),St={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},wt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},At={class:"eli-tabela__erro-mensagem"},Mt={key:2,class:"eli-tabela eli-tabela--vazio"};function _t(e,a,c,u,m,p){return e.carregando?(t.openBlock(),t.createElementBlock("div",St," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",wt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",At,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",Mt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Dt=N(Et,[["render",_t]]),Tt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Nt={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Pt(e,a,c,u,m,p){return e.isDev?(t.openBlock(),t.createElementBlock("div",Nt,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const Ot=N(Tt,[["render",Pt]]),qt=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:$e,ArrowDown:ge},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function c(p){return(p==null?void 0:p.coluna_ordem)!==void 0&&(p==null?void 0:p.coluna_ordem)!==null}function u(p){return p==="direita"?"eli-tabela__celula--direita":p==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function m(p){a("alternarOrdenacao",p)}return{ArrowUp:$e,ArrowDown:ge,isOrdenavel:c,obterClasseAlinhamento:u,emitAlternarOrdenacao:m}}}),It={class:"eli-tabela__thead"},zt={class:"eli-tabela__tr eli-tabela__tr--header"},Lt=["onClick"],Ut={class:"eli-tabela__th-texto"},jt={key:1,class:"eli-tabela__th-label"},Ft={key:0,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function Ht(e,a,c,u,m,p){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",It,[t.createElementVNode("tr",zt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(s,y)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${y}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(s)?"eli-tabela__th--ordenavel":void 0,e.obterClasseAlinhamento(s.alinhamento)]]),scope:"col"},[e.isOrdenavel(s)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(s.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:l=>e.emitAlternarOrdenacao(String(s.coluna_ordem))},[t.createElementVNode("span",Ut,t.toDisplayString(s.rotulo),1),e.colunaOrdenacao===String(s.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(o,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Lt)):(t.openBlock(),t.createElementBlock("span",jt,t.toDisplayString(s.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",Ft," Ações ")):t.createCommentVNode("",!0)])])}const Yt=N(qt,[["render",Ht]]),Rt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Wt(e,a,c,u,m,p){var o;return t.toDisplayString((o=e.dados)==null?void 0:o.texto)}const vt=N(Rt,[["render",Wt]]),Gt=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Jt(e,a,c,u,m,p){var o;return t.toDisplayString(String((o=e.dados)==null?void 0:o.numero).replace(".",","))}const Zt={textoSimples:vt,numero:N(Gt,[["render",Jt]])},Xt=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),c=t.computed(()=>e.celula[1]),u=t.computed(()=>Zt[a.value]),m=t.computed(()=>c.value);return{Componente:u,dadosParaComponente:m}}});function Kt(e,a,c,u,m,p){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const Qt=N(Xt,[["render",Kt]]),xt=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:Qt,MoreVertical:dt},props:{colunas:{type:Array,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0}},emits:{toggleMenu(e){return e&&typeof e.indice=="number"}},setup(e,{emit:a}){function c(o){return o==="direita"?"eli-tabela__celula--direita":o==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function u(o){if(o!=null)return typeof o=="number"?`${o}px`:String(o)}function m(o){if(!Array.isArray(o))return;const s=o[0],y=o[1];if(s==="textoSimples")return typeof(y==null?void 0:y.texto)=="string"?y.texto:void 0;if(s==="numero")return typeof(y==null?void 0:y.numero)=="number"?String(y.numero):void 0}function p(o,s){a("toggleMenu",{indice:o,evento:s})}return{obterClasseAlinhamento:c,obterMaxWidth:u,obterTooltipCelula:m,emitToggleMenu:p}}}),ea={class:"eli-tabela__tbody"},ta=["onClick"],aa=["title"],oa=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"];function na(e,a,c,u,m,p){const o=t.resolveComponent("EliTabelaCelula"),s=t.resolveComponent("MoreVertical");return t.openBlock(),t.createElementBlock("tbody",ea,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(y,l)=>(t.openBlock(),t.createElementBlock("tr",{key:`tr-${l}`,class:t.normalizeClass(["eli-tabela__tr",[l%2===1?"eli-tabela__tr--zebra":void 0]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(g,$)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${l}-${$}`,class:t.normalizeClass(["eli-tabela__td",[g.acao?"eli-tabela__td--clicavel":void 0,e.obterClasseAlinhamento(g.alinhamento)]]),onClick:M=>g.acao?()=>{var k;return(k=g.acao)==null?void 0:k.call(g)}:void 0},[g.truncar?(t.openBlock(),t.createElementBlock("span",{key:0,class:"eli-tabela__celula-conteudo",style:t.normalizeStyle(g.largura_maxima?{maxWidth:e.obterMaxWidth(g.largura_maxima)}:void 0),title:e.obterTooltipCelula(g.celula(y))},[t.createVNode(o,{celula:g.celula(y)},null,8,["celula"])],12,aa)):(t.openBlock(),t.createBlock(o,{key:1,celula:g.celula(y)},null,8,["celula"]))],10,ta))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${l}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===l?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${l}`,disabled:!e.possuiAcoes(l),"aria-haspopup":"menu","aria-expanded":e.menuAberto===l?"true":"false","aria-controls":e.possuiAcoes(l)?`eli-tabela-acoes-menu-${l}`:void 0,"aria-label":e.possuiAcoes(l)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(l)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(g=>e.emitToggleMenu(l,g),["stop"])},[t.createVNode(s,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,oa)],2)])):t.createCommentVNode("",!0)],2))),128))])}const ra=N(xt,[["render",na]]),la=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:c}){const u=t.ref(null);c({menuEl:u});const m=t.computed(()=>e.acoes.length>0);function p(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:u,possuiAcoes:m,emitExecutar:p}}}),ia=["id","aria-labelledby"],sa=["aria-label","title","onClick"],ca={class:"eli-tabela__acoes-item-texto"};function da(e,a,c,u,m,p){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,o=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${o.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:o.acao.cor}),role:"menuitem","aria-label":o.acao.rotulo,title:o.acao.rotulo,onClick:t.withModifiers(s=>e.emitExecutar(o),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ca,t.toDisplayString(o.acao.rotulo),1)],12,sa)]))),128))],12,ia)):t.createCommentVNode("",!0)])}const ua=N(la,[["render",da]]),ma=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const c=t.computed(()=>{const l=e.maximoBotoes;return typeof l=="number"&&l>=5?Math.floor(l):7}),u=t.computed(()=>{const l=e.totalPaginas,g=e.pagina,$=c.value,M=[],k=O=>{M.push({label:String(O),pagina:O,ativo:O===g})},_=()=>{M.push({label:"…",ehEllipsis:!0})};if(l<=$){for(let O=1;O<=l;O+=1)k(O);return M}const C=Math.max(3,$-2);let F=Math.max(2,g-Math.floor(C/2)),H=F+C-1;H>=l&&(H=l-1,F=H-C+1),k(1),F>2&&_();for(let O=F;O<=H;O+=1)k(O);return He.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),s=t.computed(()=>e.pagina),y=t.computed(()=>e.totalPaginas);return{botoes:u,irParaPagina:m,anteriorDesabilitado:p,proximaDesabilitada:o,paginaAtual:s,totalPaginasExibidas:y}}}),pa={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},fa=["disabled"],ba={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},ha=["disabled","aria-current","aria-label","onClick"],ya=["disabled"];function ga(e,a,c,u,m,p){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",pa,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=o=>e.irParaPagina(e.paginaAtual-1))}," << ",8,fa),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(o,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${s}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",ba,t.toDisplayString(o.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",o.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:o.ativo,"aria-current":o.ativo?"page":void 0,"aria-label":`Ir para página ${o.label}`,onClick:y=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,ha))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=o=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,ya)])):t.createCommentVNode("",!0)}const $a=N(ma,[["render",ga],["__scopeId","data-v-59d12455"]]),ka=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ct,EliTabelaEstados:Dt,EliTabelaDebug:Ot,EliTabelaHead:Yt,EliTabelaBody:ra,EliTabelaMenuAcoes:ua,EliTabelaPaginacao:$a},props:{tabela:{type:Object,required:!0}},setup(e){const c=t.ref(!1),u=t.ref(null),m=t.ref([]),p=t.ref(0),o=t.ref([]),s=t.ref(null),y=t.ref(null),l=t.ref({top:0,left:0}),g=t.ref(""),$=t.ref(1),M=t.ref(null),k=t.ref("asc"),_=t.computed(()=>e.tabela),C=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),F=t.computed(()=>e.tabela.acoesTabela??[]),H=t.computed(()=>F.value.length>0),O=t.computed(()=>{const n=e.tabela.registros_por_consulta;return typeof n=="number"&&n>0?Math.floor(n):10}),v=t.computed(()=>{const n=O.value;if(!n||n<=0)return 1;const r=p.value;return r?Math.max(1,Math.ceil(r/n)):1}),ie=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let L=0;function U(n){var E,S,A,P,q,z;const r=n.getBoundingClientRect(),d=8,i=((A=(S=(E=y.value)==null?void 0:E.menuEl)==null?void 0:S.value)==null?void 0:A.offsetHeight)??0,h=((z=(q=(P=y.value)==null?void 0:P.menuEl)==null?void 0:q.value)==null?void 0:z.offsetWidth)??180;let b=r.bottom+d;const B=r.right-h;i&&b+i>window.innerHeight-d&&(b=r.top-d-i),l.value={top:Math.max(d,Math.round(b)),left:Math.max(d,Math.round(B))}}function Z(n){var d,i;if(s.value===null)return;const r=n.target;(i=(d=y.value)==null?void 0:d.menuEl)!=null&&i.value&&y.value.menuEl.value.contains(r)||(s.value=null)}function X(n){if(n){if(M.value===n){k.value=k.value==="asc"?"desc":"asc",f();return}M.value=n,k.value="asc",$.value!==1?$.value=1:f()}}function G(n){g.value!==n&&(g.value=n,$.value!==1?$.value=1:f())}function D(n){const r=Math.min(Math.max(1,n),v.value);r!==$.value&&($.value=r)}function V(n){const r=e.tabela.acoesLinha??[],d=o.value[n]??[];return r.map((i,h)=>{const b=i.exibir===void 0?!0:typeof i.exibir=="boolean"?i.exibir:!1;return{acao:i,indice:h,visivel:d[h]??b}}).filter(i=>i.visivel)}function R(n){return V(n).length>0}function ae(n,r){if(!R(n))return;if(s.value===n){s.value=null;return}s.value=n;const d=(r==null?void 0:r.currentTarget)??null;d&&(U(d),requestAnimationFrame(()=>U(d)))}async function f(){var h,b;const n=++L;c.value=!0,u.value=null,o.value=[],s.value=null;const r=Math.max(1,O.value),i={offSet:($.value-1)*r,limit:r};g.value&&(i.texto_busca=g.value),M.value&&(i.coluna_ordem=M.value,i.direcao_ordem=k.value);try{const B=e.tabela,E=await B.consulta(i);if(n!==L)return;if(E.cod!==be.sucesso){m.value=[],p.value=0,u.value=E.mensagem;return}const S=((h=E.valor)==null?void 0:h.valores)??[],A=((b=E.valor)==null?void 0:b.quantidade)??S.length;m.value=S,p.value=A;const P=Math.max(1,Math.ceil((A||0)/r));if($.value>P){$.value=P;return}const q=B.acoesLinha??[];if(!q.length){o.value=[];return}const z=S.map(()=>q.map(I=>I.exibir===void 0?!0:typeof I.exibir=="boolean"?I.exibir:!1));o.value=z;const W=await Promise.all(S.map(async I=>Promise.all(q.map(async T=>{if(T.exibir===void 0)return!0;if(typeof T.exibir=="boolean")return T.exibir;try{const j=T.exibir(I);return!!await Promise.resolve(j)}catch{return!1}}))));n===L&&(o.value=W)}catch(B){if(n!==L)return;m.value=[],p.value=0,u.value=B instanceof Error?B.message:"Erro ao carregar dados."}finally{n===L&&(c.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Z),f()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Z)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,n=>{!n&&g.value&&(g.value="",$.value!==1?$.value=1:f())}),t.watch($,(n,r)=>{n!==r&&f()}),t.watch(()=>e.tabela,()=>{s.value=null,M.value=null,k.value="asc",g.value="",$.value!==1?$.value=1:f()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{$.value!==1?$.value=1:f()}),t.watch(m,()=>{s.value=null}),{isDev:!1,tabela:_,carregando:c,erro:u,linhas:m,quantidade:p,menuAberto:s,valorBusca:g,paginaAtual:$,colunaOrdenacao:M,direcaoOrdenacao:k,totalPaginas:v,exibirBusca:C,acoesCabecalho:F,temAcoesCabecalho:H,temAcoes:ie,alternarOrdenacao:X,atualizarBusca:G,irParaPagina:D,acoesDisponiveisPorLinha:V,possuiAcoes:R,toggleMenu:ae,menuPopup:y,menuPopupPos:l}}}),Ba={class:"eli-tabela"},Va={class:"eli-tabela__table"};function Ca(e,a,c,u,m,p){const o=t.resolveComponent("EliTabelaDebug"),s=t.resolveComponent("EliTabelaEstados"),y=t.resolveComponent("EliTabelaCabecalho"),l=t.resolveComponent("EliTabelaHead"),g=t.resolveComponent("EliTabelaBody"),$=t.resolveComponent("EliTabelaMenuAcoes"),M=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",Ba,[t.createVNode(o,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(s,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(y,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar"])):t.createCommentVNode("",!0),t.createElementVNode("table",Va,[t.createVNode(l,{colunas:e.tabela.colunas,temAcoes:e.temAcoes,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(g,{colunas:e.tabela.colunas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,onToggleMenu:a[0]||(a[0]=({indice:k,evento:_})=>e.toggleMenu(k,_))},null,8,["colunas","linhas","temAcoes","menuAberto","possuiAcoes"])]),t.createVNode($,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[1]||(a[1]=({acao:k,linha:_})=>{e.menuAberto=null,k.acao(_)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(M,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const ke=N(ka,[["render",Ca]]),Ea={install(e){e.component("EliOlaMundo",ue),e.component("EliBotao",ne),e.component("EliBadge",Q),e.component("EliInput",le),e.component("EliCartao",me),e.component("EliDataHora",fe),e.component("EliTabela",ke)}};w.EliBadge=Q,w.EliBotao=ne,w.EliCartao=me,w.EliDataHora=fe,w.EliInput=le,w.EliOlaMundo=ue,w.EliTabela=ke,w.default=Ea,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts index c0039ec..b3d4fa5 100644 --- a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts +++ b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts @@ -1,11 +1,19 @@ +/** + * EliTabela + * Componente de tabela consultável com busca, paginação, ordenação e ações por linha. + */ +/** Dependências do Vue (Composition API) */ import { PropType } from "vue"; +/** Tipos da configuração/contrato da tabela */ import type { EliTabelaConsulta } from "./types-eli-tabela"; declare const __VLS_export: import("vue").DefineComponent>; required: true; }; }>, { + isDev: boolean; tabela: import("vue").ComputedRef>; carregando: import("vue").Ref; erro: import("vue").Ref; @@ -26,54 +34,396 @@ declare const __VLS_export: import("vue").DefineComponent; temAcoesCabecalho: import("vue").ComputedRef; temAcoes: import("vue").ComputedRef; - ArrowUp: import("vue").FunctionalComponent; - ArrowDown: import("vue").FunctionalComponent; - MoreVertical: import("vue").FunctionalComponent; - isOrdenavel: (coluna: any) => boolean; - obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; - obterMaxWidth: (largura?: number | string) => string | undefined; - obterTooltipCelula: (celula: unknown) => any; alternarOrdenacao: (chave?: string) => void; atualizarBusca: (texto: string) => void; irParaPagina: (pagina: number) => void; - registrarMenuElemento: (indice: number, elemento: HTMLElement | null) => void; acoesDisponiveisPorLinha: (i: number) => { acao: import("./types-eli-tabela").EliTabelaAcao; indice: number; visivel: boolean; }[]; possuiAcoes: (i: number) => boolean; - toggleMenu: (i: number) => void; + toggleMenu: (i: number, evento?: MouseEvent) => void; + menuPopup: import("vue").Ref<{ + menuEl: { + value: HTMLElement | null; + }; + } | null, { + menuEl: { + value: HTMLElement | null; + }; + } | { + menuEl: { + value: HTMLElement | null; + }; + } | null>; + menuPopupPos: import("vue").Ref<{ + top: number; + left: number; + }, { + top: number; + left: number; + } | { + top: number; + left: number; + }>; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>; required: true; }; }>> & Readonly<{}>, {}, {}, { - EliTabelaCaixaDeBusca: import("vue").DefineComponent void; + }>>; + required: true; }; }>, { - texto: import("vue").Ref; - emitirBusca: () => void; + temAcoesCabecalho: import("vue").ComputedRef; + emitBuscar: (texto: string) => void; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { buscar(valor: string): boolean; }, string, import("vue").PublicProps, Readonly void; + }>>; + required: true; }; }>> & Readonly<{ onBuscar?: ((valor: string) => any) | undefined; - }>, { - modelo: string; - }, {}, { - Search: import("vue").FunctionalComponent; + }>, {}, {}, { + EliTabelaCaixaDeBusca: 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; + }, {}, { + Search: import("vue").FunctionalComponent; + }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + EliTabelaEstados: import("vue").DefineComponent; + required: true; + }; + mensagemVazio: { + type: PropType; + required: false; + default: undefined; + }; + }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; + mensagemVazio: { + type: PropType; + required: false; + default: undefined; + }; + }>> & Readonly<{}>, { + mensagemVazio: string | undefined; + }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + EliTabelaDebug: import("vue").DefineComponent; + required: true; + }; + menuPopupPos: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; + }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; + menuPopupPos: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; + }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + EliTabelaHead: import("vue").DefineComponent>>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + colunaOrdenacao: { + type: PropType; + required: true; + }; + direcaoOrdenacao: { + type: PropType<"asc" | "desc">; + required: true; + }; + }>, { + ArrowUp: import("vue").FunctionalComponent; + ArrowDown: import("vue").FunctionalComponent; + isOrdenavel: (coluna: any) => boolean; + obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; + emitAlternarOrdenacao: (chave: string) => void; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + alternarOrdenacao(chave: string): boolean; + }, string, import("vue").PublicProps, Readonly>>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + colunaOrdenacao: { + type: PropType; + required: true; + }; + direcaoOrdenacao: { + type: PropType<"asc" | "desc">; + required: true; + }; + }>> & Readonly<{ + onAlternarOrdenacao?: ((chave: string) => any) | undefined; + }>, {}, {}, { + ArrowUp: import("vue").FunctionalComponent; + ArrowDown: import("vue").FunctionalComponent; + }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + EliTabelaBody: import("vue").DefineComponent>>; + required: true; + }; + linhas: { + type: PropType>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + menuAberto: { + type: PropType; + required: true; + }; + possuiAcoes: { + type: PropType<(i: number) => boolean>; + required: true; + }; + }>, { + obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; + obterMaxWidth: (largura?: number | string) => string | undefined; + obterTooltipCelula: (celula: unknown) => any; + emitToggleMenu: (indice: number, evento: MouseEvent) => void; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + toggleMenu(payload: { + indice: number; + evento: MouseEvent; + }): boolean; + }, string, import("vue").PublicProps, Readonly>>; + required: true; + }; + linhas: { + type: PropType>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + menuAberto: { + type: PropType; + required: true; + }; + possuiAcoes: { + type: PropType<(i: number) => boolean>; + required: true; + }; + }>> & Readonly<{ + onToggleMenu?: ((payload: { + indice: number; + evento: MouseEvent; + }) => any) | undefined; + }>, {}, {}, { + EliTabelaCelula: import("vue").DefineComponent; + required: true; + }; + }>, { + Componente: import("vue").ComputedRef; + dadosParaComponente: import("vue").ComputedRef<{ + texto: string; + acao?: () => void; + } | { + numero: number; + acao?: () => void; + }>; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; + }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + MoreVertical: import("vue").FunctionalComponent; + }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + EliTabelaMenuAcoes: import("vue").DefineComponent; + required: true; + }; + posicao: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; + acoes: { + type: PropType; + indice: number; + visivel: boolean; + }>>; + required: true; + }; + linha: { + type: PropType; + required: true; + }; + }>, { + menuEl: import("vue").Ref; + possuiAcoes: import("vue").ComputedRef; + emitExecutar: (item: { + acao: import("./types-eli-tabela").EliTabelaAcao; + }) => void; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + executar(payload: { + acao: import("./types-eli-tabela").EliTabelaAcao; + linha: unknown; + }): boolean; + }, string, import("vue").PublicProps, Readonly; + required: true; + }; + posicao: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; + acoes: { + type: PropType; + indice: number; + visivel: boolean; + }>>; + required: true; + }; + linha: { + type: PropType; + required: true; + }; + }>> & Readonly<{ + onExecutar?: ((payload: { + acao: import("./types-eli-tabela").EliTabelaAcao; + linha: unknown; + }) => any) | undefined; + }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; EliTabelaPaginacao: import("vue").DefineComponent> & Readonly<{ onAlterar?: ((pagina: number) => any) | undefined; }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; - EliTabelaCelula: import("vue").DefineComponent; - required: true; - }; - }>, { - Componente: import("vue").ComputedRef; - dadosParaComponente: import("vue").ComputedRef<{ - texto: string; - acao?: () => void; - } | { - numero: number; - acao?: () => void; - }>; - }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; - required: true; - }; - }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; - ArrowUp: import("vue").FunctionalComponent; - ArrowDown: import("vue").FunctionalComponent; - MoreVertical: import("vue").FunctionalComponent; }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: typeof __VLS_export; export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts new file mode 100644 index 0000000..58253e8 --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts @@ -0,0 +1,84 @@ +import { PropType } from "vue"; +import type { EliColuna } from "./types-eli-tabela"; +declare const __VLS_export: import("vue").DefineComponent>>; + required: true; + }; + linhas: { + type: PropType>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + menuAberto: { + type: PropType; + required: true; + }; + possuiAcoes: { + type: PropType<(i: number) => boolean>; + required: true; + }; +}>, { + obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; + obterMaxWidth: (largura?: number | string) => string | undefined; + obterTooltipCelula: (celula: unknown) => any; + emitToggleMenu: (indice: number, evento: MouseEvent) => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + toggleMenu(payload: { + indice: number; + evento: MouseEvent; + }): boolean; +}, string, import("vue").PublicProps, Readonly>>; + required: true; + }; + linhas: { + type: PropType>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + menuAberto: { + type: PropType; + required: true; + }; + possuiAcoes: { + type: PropType<(i: number) => boolean>; + required: true; + }; +}>> & Readonly<{ + onToggleMenu?: ((payload: { + indice: number; + evento: MouseEvent; + }) => any) | undefined; +}>, {}, {}, { + EliTabelaCelula: import("vue").DefineComponent; + required: true; + }; + }>, { + Componente: import("vue").ComputedRef; + dadosParaComponente: import("vue").ComputedRef<{ + texto: string; + acao?: () => void; + } | { + numero: number; + acao?: () => void; + }>; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; + }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + MoreVertical: import("vue").FunctionalComponent; +}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts new file mode 100644 index 0000000..320cf4e --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts @@ -0,0 +1,72 @@ +import { PropType } from "vue"; +declare const __VLS_export: import("vue").DefineComponent void; + }>>; + required: true; + }; +}>, { + temAcoesCabecalho: import("vue").ComputedRef; + emitBuscar: (texto: string) => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + buscar(valor: string): boolean; +}, string, import("vue").PublicProps, Readonly void; + }>>; + required: true; + }; +}>> & Readonly<{ + onBuscar?: ((valor: string) => any) | undefined; +}>, {}, {}, { + EliTabelaCaixaDeBusca: 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; + }, {}, { + Search: import("vue").FunctionalComponent; + }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaDebug.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaDebug.vue.d.ts new file mode 100644 index 0000000..4406443 --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaDebug.vue.d.ts @@ -0,0 +1,36 @@ +import { PropType } from "vue"; +declare const __VLS_export: import("vue").DefineComponent; + required: true; + }; + menuPopupPos: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; +}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; + menuPopupPos: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; +}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaEstados.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaEstados.vue.d.ts new file mode 100644 index 0000000..562600e --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaEstados.vue.d.ts @@ -0,0 +1,34 @@ +import { PropType } from "vue"; +declare const __VLS_export: import("vue").DefineComponent; + required: true; + }; + mensagemVazio: { + type: PropType; + required: false; + default: undefined; + }; +}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; + mensagemVazio: { + type: PropType; + required: false; + default: undefined; + }; +}>> & Readonly<{}>, { + mensagemVazio: string | undefined; +}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaHead.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaHead.vue.d.ts new file mode 100644 index 0000000..cf8bcb2 --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaHead.vue.d.ts @@ -0,0 +1,52 @@ +import { PropType } from "vue"; +import type { EliColuna } from "./types-eli-tabela"; +declare const __VLS_export: import("vue").DefineComponent>>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + colunaOrdenacao: { + type: PropType; + required: true; + }; + direcaoOrdenacao: { + type: PropType<"asc" | "desc">; + required: true; + }; +}>, { + ArrowUp: import("vue").FunctionalComponent; + ArrowDown: import("vue").FunctionalComponent; + isOrdenavel: (coluna: any) => boolean; + obterClasseAlinhamento: (alinhamento?: string) => "eli-tabela__celula--direita" | "eli-tabela__celula--centro" | "eli-tabela__celula--esquerda"; + emitAlternarOrdenacao: (chave: string) => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + alternarOrdenacao(chave: string): boolean; +}, string, import("vue").PublicProps, Readonly>>; + required: true; + }; + temAcoes: { + type: BooleanConstructor; + required: true; + }; + colunaOrdenacao: { + type: PropType; + required: true; + }; + direcaoOrdenacao: { + type: PropType<"asc" | "desc">; + required: true; + }; +}>> & Readonly<{ + onAlternarOrdenacao?: ((chave: string) => any) | undefined; +}>, {}, {}, { + ArrowUp: import("vue").FunctionalComponent; + ArrowDown: import("vue").FunctionalComponent; +}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaMenuAcoes.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaMenuAcoes.vue.d.ts new file mode 100644 index 0000000..75ed8ab --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabelaMenuAcoes.vue.d.ts @@ -0,0 +1,66 @@ +import { PropType } from "vue"; +import type { EliTabelaAcao } from "./types-eli-tabela"; +type ItemAcao = { + acao: EliTabelaAcao; + indice: number; + visivel: boolean; +}; +declare const __VLS_export: import("vue").DefineComponent; + required: true; + }; + posicao: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; + acoes: { + type: PropType>>; + required: true; + }; + linha: { + type: PropType; + required: true; + }; +}>, { + menuEl: import("vue").Ref; + possuiAcoes: import("vue").ComputedRef; + emitExecutar: (item: { + acao: EliTabelaAcao; + }) => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + executar(payload: { + acao: EliTabelaAcao; + linha: unknown; + }): boolean; +}, string, import("vue").PublicProps, Readonly; + required: true; + }; + posicao: { + type: PropType<{ + top: number; + left: number; + }>; + required: true; + }; + acoes: { + type: PropType>>; + required: true; + }; + linha: { + type: PropType; + required: true; + }; +}>> & Readonly<{ + onExecutar?: ((payload: { + acao: EliTabelaAcao; + linha: unknown; + }) => any) | undefined; +}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/package.json b/package.json index 52f333f..f9121a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.39", + "version": "0.1.40", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/src/components/eli/EliTabela/EliTabela.css b/src/components/eli/EliTabela/EliTabela.css new file mode 100644 index 0000000..eed5b1f --- /dev/null +++ b/src/components/eli/EliTabela/EliTabela.css @@ -0,0 +1,300 @@ +.eli-tabela { + width: 100%; +} + +.eli-tabela__table { + width: 100%; + border-collapse: separate; + border-spacing: 0; + border: 1px solid rgba(0, 0, 0, 0.12); + border-radius: 12px; + overflow: visible; +} + +.eli-tabela__tbody { + overflow: visible; +} + +.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td { + background: rgba(15, 23, 42, 0.02); +} + +.eli-tabela__th, +.eli-tabela__td { + padding: 10px 12px; + border-bottom: 1px solid rgba(0, 0, 0, 0.08); + vertical-align: top; +} + +.eli-tabela__th { + text-align: left; + font-weight: 600; + background: rgba(0, 0, 0, 0.03); +} + +.eli-tabela__th--ordenavel { + padding: 0; +} + +.eli-tabela__th--ordenavel .eli-tabela__th-botao { + padding: 10px 12px; +} + +.eli-tabela__th-botao { + 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 0.2s ease; +} + +.eli-tabela__th-botao:hover, +.eli-tabela__th-botao:focus-visible { + color: rgba(15, 23, 42, 0.85); +} + +.eli-tabela__th-botao:focus-visible { + outline: 2px solid rgba(37, 99, 235, 0.45); + outline-offset: 2px; +} + +.eli-tabela__th-botao--ativo { + color: rgba(37, 99, 235, 0.95); +} + +.eli-tabela__th-texto { + flex: 1; + min-width: 0; + white-space: nowrap; +} + +.eli-tabela__th-icone { + flex-shrink: 0; +} + +.eli-tabela__th-icone--oculto { + opacity: 0; +} + +.eli-tabela__tr:last-child .eli-tabela__td { + border-bottom: none; +} + +.eli-tabela__td--clicavel { + cursor: pointer; +} + +.eli-tabela__td--clicavel:hover { + background: rgba(0, 0, 0, 0.03); +} + +.eli-tabela__celula--esquerda { + text-align: left; +} + +.eli-tabela__celula--centro { + text-align: center; +} + +.eli-tabela__celula--direita { + text-align: right; +} + +.eli-tabela__celula-conteudo { + display: inline-block; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: top; +} + +.eli-tabela--erro { + border: 1px solid rgba(220, 53, 69, 0.35); + border-radius: 12px; + padding: 12px; +} + +.eli-tabela--carregando { + border: 1px dashed rgba(0, 0, 0, 0.25); + border-radius: 12px; + padding: 12px; + opacity: 0.8; +} + +.eli-tabela__erro-titulo { + font-weight: 700; + margin-bottom: 4px; +} + +.eli-tabela__erro-mensagem { + opacity: 0.9; +} + +.eli-tabela--vazio { + border: 1px dashed rgba(0, 0, 0, 0.25); + border-radius: 12px; + padding: 12px; + opacity: 0.8; +} + +.eli-tabela__th--acoes { + text-align: right; + white-space: nowrap; +} + +.eli-tabela__td--acoes { + white-space: nowrap; + overflow: visible; +} + +.eli-tabela__acoes-container { + display: flex; + justify-content: flex-end; + position: relative; + z-index: 1; +} + +.eli-tabela__acoes-container--aberto { + z-index: 200; +} + +.eli-tabela__cabecalho { + width: 100%; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-end; + 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; + justify-content: center; + width: 32px; + height: 32px; + border-radius: 9999px; + border: none; + background: transparent; + color: rgba(15, 23, 42, 0.72); + cursor: pointer; + transition: background-color 0.2s ease, color 0.2s ease; +} + +.eli-tabela__acoes-toggle-icone { + display: block; +} + +.eli-tabela__acoes-toggle:hover, +.eli-tabela__acoes-toggle:focus-visible { + background-color: rgba(15, 23, 42, 0.08); + color: rgba(15, 23, 42, 0.95); +} + +.eli-tabela__acoes-toggle:focus-visible { + outline: 2px solid rgba(37, 99, 235, 0.45); + outline-offset: 2px; +} + +.eli-tabela__acoes-toggle:disabled { + cursor: default; + color: rgba(148, 163, 184, 0.8); + background: transparent; +} + +.eli-tabela__acoes-menu { + min-width: 180px; + padding: 6px 0; + margin: 0; + list-style: none; + background: #ffffff; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 10px; + box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18); + z-index: 1000; +} + +.eli-tabela__acoes-item { + margin: 0; +} + +.eli-tabela__acoes-item-botao { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + padding: 8px 12px; + border: none; + background: transparent; + font-size: 0.9rem; + cursor: pointer; + transition: background-color 0.2s ease; +} + +.eli-tabela__acoes-item-botao:hover, +.eli-tabela__acoes-item-botao:focus-visible { + background-color: rgba(15, 23, 42, 0.06); +} + +.eli-tabela__acoes-item-botao:focus-visible { + outline: 2px solid currentColor; + outline-offset: -2px; +} + +.eli-tabela__acoes-item-icone { + flex-shrink: 0; +} + +.eli-tabela__acoes-item-texto { + flex: 1; + text-align: left; +} diff --git a/src/components/eli/EliTabela/EliTabela.vue b/src/components/eli/EliTabela/EliTabela.vue index 871d352..2443b16 100644 --- a/src/components/eli/EliTabela/EliTabela.vue +++ b/src/components/eli/EliTabela/EliTabela.vue @@ -1,222 +1,50 @@