From 24c07da6f86206b9646f85af3ffb9fd4712a0520 Mon Sep 17 00:00:00 2001 From: Luiz Silva Date: Tue, 27 Jan 2026 12:07:22 -0300 Subject: [PATCH] bkp --- dist/eli-vue.css | 2 +- dist/eli-vue.es.js | 867 ++++++++++-------- dist/eli-vue.umd.js | 2 +- .../eli/EliTabela/EliTabela.vue.d.ts | 17 + .../celulas/EliCelulaTextoSimples.d.ts | 6 + .../types/components/eli/EliTabela/index.d.ts | 3 + .../types/components/eli/EliTabela/types.d.ts | 24 + dist/types/index.d.ts | 2 + package.json | 6 +- pnpm-lock.yaml | 96 ++ src/components/eli/EliTabela/EliTabela.vue | 616 +++++++++++++ .../celulas/EliCelulaTextoSimples.ts | 7 + src/components/eli/EliTabela/index.ts | 4 + src/components/eli/EliTabela/types.ts | 38 + src/index.ts | 3 + src/playground/App.vue | 5 + src/playground/tabela.playground.vue | 131 +++ 17 files changed, 1458 insertions(+), 371 deletions(-) create mode 100644 dist/types/components/eli/EliTabela/EliTabela.vue.d.ts create mode 100644 dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts create mode 100644 dist/types/components/eli/EliTabela/index.d.ts create mode 100644 dist/types/components/eli/EliTabela/types.d.ts create mode 100644 src/components/eli/EliTabela/EliTabela.vue create mode 100644 src/components/eli/EliTabela/celulas/EliCelulaTextoSimples.ts create mode 100644 src/components/eli/EliTabela/index.ts create mode 100644 src/components/eli/EliTabela/types.ts create mode 100644 src/playground/tabela.playground.vue diff --git a/dist/eli-vue.css b/dist/eli-vue.css index 3034f98..9af3411 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%} +[data-v-de2fbf2f] .v-badge__badge,[data-v-de2fbf2f] .v-badge__content{border-radius:var(--eli-badge-radius)!important}.eli-input[data-v-756cb549]{width:100%}.checkbox-group[data-v-756cb549]{display:flex;gap:8px;flex-wrap:wrap}.cursor-pointer[data-v-756cb549]{cursor:pointer}.eli-cartao[data-v-6c492bd9]{border-radius:12px}.eli-cartao__titulo[data-v-6c492bd9]{display:flex;align-items:center;justify-content:space-between;gap:12px}.eli-cartao__titulo-texto[data-v-6c492bd9]{min-width:0}.eli-cartao__conteudo[data-v-6c492bd9]{padding-top:8px}.eli-cartao__acoes[data-v-6c492bd9]{padding-top:0}.eli-cartao--cancelado[data-v-6c492bd9]{opacity:.85}.eli-data-hora[data-v-71afabb6],.eli-tabela[data-v-cc67b529]{width:100%}.eli-tabela__table[data-v-cc67b529]{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:hidden}.eli-tabela__th[data-v-cc67b529],.eli-tabela__td[data-v-cc67b529]{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th[data-v-cc67b529]{text-align:left;font-weight:600;background:#00000008}.eli-tabela__tr:last-child .eli-tabela__td[data-v-cc67b529]{border-bottom:none}.eli-tabela__td--clicavel[data-v-cc67b529]{cursor:pointer}.eli-tabela__td--clicavel[data-v-cc67b529]:hover{background:#00000008}.eli-tabela--erro[data-v-cc67b529]{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando[data-v-cc67b529]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo[data-v-cc67b529]{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem[data-v-cc67b529]{opacity:.9}.eli-tabela--vazio[data-v-cc67b529]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index e3e66f0..c1662bf 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,16 +1,16 @@ -import { defineComponent as R, createBlock as H, openBlock as B, mergeProps as F, withCtx as D, renderSlot as W, computed as E, ref as C, createElementBlock as G, createCommentVNode as pe, createSlots as Ee, createVNode as y, createTextVNode as Q, toDisplayString as ye, Fragment as de, renderList as fe, resolveComponent as te, createElementVNode as ae } from "vue"; -import { VBtn as Ce } from "vuetify/components/VBtn"; -import { VBadge as Ie } from "vuetify/components/VBadge"; -import { VCheckbox as Oe } from "vuetify/components/VCheckbox"; -import { VIcon as Te } from "vuetify/components/VIcon"; -import { VRadio as Ue } from "vuetify/components/VRadio"; -import { VRadioGroup as Ye } from "vuetify/components/VRadioGroup"; -import { VSelect as He } from "vuetify/components/VSelect"; -import { VTextField as $e } from "vuetify/components/VTextField"; -import { VTextarea as Ae } from "vuetify/components/VTextarea"; -import { VCard as ge, VCardTitle as ve, VCardText as he, VCardActions as be } from "vuetify/components/VCard"; -import { VContainer as Pe } from "vuetify/components/VGrid"; -const je = R({ +import { defineComponent as W, createBlock as A, openBlock as B, mergeProps as z, withCtx as C, renderSlot as Z, computed as T, ref as D, createElementBlock as J, createCommentVNode as ye, createSlots as Ie, createVNode as b, createTextVNode as K, toDisplayString as $e, Fragment as fe, renderList as me, resolveComponent as re, createElementVNode as ne, onMounted as Oe, watch as Te, h as P } from "vue"; +import { VBtn as Ue } from "vuetify/components/VBtn"; +import { VBadge as Pe } from "vuetify/components/VBadge"; +import { VCheckbox as Ye } from "vuetify/components/VCheckbox"; +import { VIcon as Ae } from "vuetify/components/VIcon"; +import { VRadio as He } from "vuetify/components/VRadio"; +import { VRadioGroup as Ne } from "vuetify/components/VRadioGroup"; +import { VSelect as je } from "vuetify/components/VSelect"; +import { VTextField as ge } from "vuetify/components/VTextField"; +import { VTextarea as Fe } from "vuetify/components/VTextarea"; +import { VCard as be, VCardTitle as he, VCardText as Ve, VCardActions as Se } from "vuetify/components/VCard"; +import { VContainer as Le } from "vuetify/components/VGrid"; +const ze = W({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +35,30 @@ const je = R({ default: !1 } } -}), J = (e, t) => { +}), R = (e, t) => { const c = e.__vccOpts || e; - for (const [$, g] of t) - c[$] = g; + for (const [p, v] of t) + c[p] = v; return c; }; -function Ne(e, t, c, $, g, w) { - return B(), H(Ce, F({ +function We(e, t, c, p, v, M) { + return B(), A(Ue, z({ color: e.color, variant: e.variant, size: e.size, disabled: e.disabled, loading: e.loading }, e.$attrs, { class: "text-none pt-1" }), { - default: D(() => [ - W(e.$slots, "default") + default: C(() => [ + Z(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const Ve = /* @__PURE__ */ J(je, [["render", Ne]]), me = { +const Me = /* @__PURE__ */ R(ze, [["render", We]]), pe = { suave: "4px", pill: "10px" -}, Fe = R({ +}, Re = W({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +97,14 @@ const Ve = /* @__PURE__ */ J(je, [["render", Ne]]), me = { } }, setup(e) { - const t = E(() => e.radius in me ? me[e.radius] : e.radius), c = E(() => e.dot || e.badge !== void 0 ? e.visible : !1), $ = E(() => ({ + const t = T(() => e.radius in pe ? pe[e.radius] : e.radius), c = T(() => e.dot || e.badge !== void 0 ? e.visible : !1), p = T(() => ({ "--eli-badge-radius": t.value })); - return { showBadge: c, badgeStyle: $ }; + return { showBadge: c, badgeStyle: p }; } }); -function Le(e, t, c, $, g, w) { - return e.showBadge ? (B(), H(Ie, F({ +function qe(e, t, c, p, v, M) { + return e.showBadge ? (B(), A(Pe, z({ key: 0, color: e.color }, e.$attrs, { @@ -115,46 +115,46 @@ function Le(e, t, c, $, g, w) { content: e.badge, style: e.badgeStyle }), { - default: D(() => [ - W(e.$slots, "default", {}, void 0, !0) + default: C(() => [ + Z(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : W(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : Z(e.$slots, "default", { key: 1 }, void 0, !0); } -const le = /* @__PURE__ */ J(Fe, [["render", Le], ["__scopeId", "data-v-de2fbf2f"]]); -function ze(e) { +const ie = /* @__PURE__ */ R(Re, [["render", qe], ["__scopeId", "data-v-de2fbf2f"]]); +function Je(e) { return e.replace(/\D+/g, ""); } -function We(e) { - const t = ze(e); +function Ze(e) { + const t = Je(e); return t.length <= 11 ? t.replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d{1,2})$/, "$1-$2").slice(0, 14) : t.replace(/^(\d{2})(\d)/, "$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/, "$1.$2.$3").replace(/\.(\d{3})(\d)/, ".$1/$2").replace(/(\d{4})(\d)/, "$1-$2").slice(0, 18); } -function Re(e) { +function Xe(e) { return e.replace(/\D+/g, ""); } -function Je(e) { - const t = Re(e); +function Ge(e) { + const t = Xe(e); return t ? t.length <= 10 ? t.replace(/^(\d{2})(\d)/, "($1) $2").replace(/(\d{4})(\d)/, "$1-$2").slice(0, 14) : t.replace(/^(\d{2})(\d)/, "($1) $2").replace(/(\d{5})(\d)/, "$1-$2").slice(0, 15) : ""; } -function se(e) { +function ue(e) { return e.replace(/\D+/g, ""); } -function Se(e) { +function we(e) { const t = e.replace(/[^\d,]/g, ""), c = t.split(","); return c.length > 2 ? c[0] + "," + c.slice(1).join("") : t; } -function qe(e) { - return Se(e.replace(/%/g, "")); +function Qe(e) { + return we(e.replace(/%/g, "")); } -function Ze(e) { - const t = se(e); +function Ke(e) { + const t = ue(e); return t ? (parseInt(t, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; } -function Xe(e) { - const t = se(e).slice(0, 8); +function _e(e) { + const t = ue(e).slice(0, 8); return t.length <= 5 ? t : t.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); } -const Ge = R({ +const xe = W({ name: "EliInput", inheritAttrs: !1, props: { @@ -197,12 +197,12 @@ const Ge = R({ }, emits: ["update:modelValue", "change", "focus", "blur"], setup(e, { emit: t, attrs: c }) { - const $ = C(!1), g = C(!1), w = E({ + const p = D(!1), v = D(!1), M = T({ get: () => e.modelValue, set: (h) => { t("update:modelValue", h), t("change", h); } - }), d = E( + }), d = T( () => [ "text", "password", @@ -217,80 +217,80 @@ const Ge = R({ "porcentagem", "cep" ].includes(e.type) - ), f = E( - () => e.type === "password" ? g.value ? "text" : "password" : "text" - ), I = E(() => { + ), f = T( + () => e.type === "password" ? v.value ? "text" : "password" : "text" + ), I = T(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), l = E( - () => e.error ? "error" : $.value ? e.color : void 0 + }), o = T( + () => e.error ? "error" : p.value ? e.color : void 0 ); - function Y(h) { - const T = h.target; - let v = T.value; + function m(h) { + const w = h.target; + let g = w.value; switch (e.type) { case "numericoInteiro": - v = se(v); + g = ue(g); break; case "numericoDecimal": - v = Se(v); + g = we(g); break; case "numericoMoeda": - v = Ze(v); + g = Ke(g); break; case "porcentagem": - v = qe(v); + g = Qe(g); break; case "telefone": - v = Je(v); + g = Ge(g); break; case "cpfCnpj": - v = We(v); + g = Ze(g); break; case "cep": - v = Xe(v); + g = _e(g); break; } - T.value = v, t("update:modelValue", v), t("change", v); + w.value = g, t("update:modelValue", g), t("change", g); } function V() { - g.value = !g.value; + v.value = !v.value; } - const L = E(() => (e.options || []).map((h) => { + const H = T(() => (e.options || []).map((h) => { if (h && typeof h == "object" && "value" in h) { - const v = h.value; + const g = h.value; return { - label: h.label ?? String(v), - value: v, + label: h.label ?? String(g), + value: g, disabled: h.disabled }; } - const T = h; - return { label: String(T), value: T }; + const w = h; + return { label: String(w), value: w }; })); return { attrs: c, - value: w, + value: M, isTextLike: d, inputHtmlType: f, inputMode: I, - internalColor: l, - showPassword: g, + internalColor: o, + showPassword: v, togglePassword: V, - onInput: Y, + onInput: m, onFocus: () => t("focus"), onBlur: () => t("blur"), - computedItems: L + computedItems: H }; } -}), Qe = { class: "eli-input" }, Ke = { +}), et = { class: "eli-input" }, tt = { key: 4, class: "checkbox-group" }; -function _e(e, t, c, $, g, w) { - return B(), G("div", Qe, [ - e.isTextLike ? (B(), H($e, F({ +function at(e, t, c, p, v, M) { + return B(), J("div", et, [ + e.isTextLike ? (B(), A(ge, z({ key: 0, modelValue: e.value, "onUpdate:modelValue": t[0] || (t[0] = (d) => e.value = d), @@ -312,23 +312,23 @@ function _e(e, t, c, $, g, w) { onFocus: e.onFocus, onBlur: e.onBlur, onInput: e.onInput - }), Ee({ _: 2 }, [ + }), Ie({ _: 2 }, [ e.type === "password" && e.showPasswordToggle ? { name: "append-inner", - fn: D(() => [ - y(Te, { + fn: C(() => [ + b(Ae, { class: "cursor-pointer", onClick: e.togglePassword }, { - default: D(() => [ - Q(ye(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) + default: C(() => [ + K($e(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) ]), _: 1 }, 8, ["onClick"]) ]), key: "0" } : void 0 - ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (B(), H(Ae, F({ + ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (B(), A(Fe, z({ key: 1, modelValue: e.value, "onUpdate:modelValue": t[1] || (t[1] = (d) => e.value = d), @@ -336,7 +336,7 @@ function _e(e, t, c, $, g, w) { rows: e.rows, density: e.density, variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (B(), H(He, F({ + }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (B(), A(je, z({ key: 2, modelValue: e.value, "onUpdate:modelValue": t[2] || (t[2] = (d) => e.value = d), @@ -356,22 +356,22 @@ function _e(e, t, c, $, g, w) { }, e.attrs, { onFocus: e.onFocus, onBlur: e.onBlur - }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (B(), H(Ye, { + }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (B(), A(Ne, { key: 3, modelValue: e.value, "onUpdate:modelValue": t[3] || (t[3] = (d) => e.value = d), row: e.row }, { - default: D(() => [ - (B(!0), G(de, null, fe(e.computedItems, (d) => (B(), H(Ue, { + default: C(() => [ + (B(!0), J(fe, null, me(e.computedItems, (d) => (B(), A(He, { key: String(d.value), label: d.label, value: d.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (B(), G("div", Ke, [ - (B(!0), G(de, null, fe(e.computedItems, (d) => (B(), H(Oe, { + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (B(), J("div", tt, [ + (B(!0), J(fe, null, me(e.computedItems, (d) => (B(), A(Ye, { key: String(d.value), modelValue: e.value, "onUpdate:modelValue": t[4] || (t[4] = (f) => e.value = f), @@ -379,104 +379,104 @@ function _e(e, t, c, $, g, w) { value: d.value, density: e.density }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) - ])) : pe("", !0) + ])) : ye("", !0) ]); } -const Me = /* @__PURE__ */ J(Ge, [["render", _e], ["__scopeId", "data-v-756cb549"]]), xe = R({ +const De = /* @__PURE__ */ R(xe, [["render", at], ["__scopeId", "data-v-756cb549"]]), rt = W({ name: "EliOlaMundo", components: { - EliBotao: Ve, - EliBadge: le, - EliInput: Me + EliBotao: Me, + EliBadge: ie, + EliInput: De }, setup() { - const e = C(""), t = C([]), c = C(""), $ = C(""), g = C(""), w = C(""), d = C(""), f = C(""), I = C(""), l = C(""), Y = C(""), V = C(null), L = C([]); + const e = D(""), t = D([]), c = D(""), p = D(""), v = D(""), M = D(""), d = D(""), f = D(""), I = D(""), o = D(""), m = D(""), V = D(null), H = D([]); return { nome: e, email: f, - documento: Y, + documento: m, estado: t, - telefone: $, + telefone: p, mensagem: I, - senha: l, + senha: o, cor: V, - habilidades: L, - idade: g, - altura: w, + habilidades: H, + idade: v, + altura: M, cep: c, valor: d }; } -}), et = { class: "grid-example" }; -function tt(e, t, c, $, g, w) { - const d = te("EliBadge"), f = te("EliInput"), I = te("EliBotao"); - return B(), H(Pe, null, { - default: D(() => [ - y(ge, { +}), nt = { class: "grid-example" }; +function ot(e, t, c, p, v, M) { + const d = re("EliBadge"), f = re("EliInput"), I = re("EliBotao"); + return B(), A(Le, null, { + default: C(() => [ + b(be, { class: "mx-auto", max_width: "400" }, { - default: D(() => [ - y(ve, null, { - default: D(() => [ - y(d, { + default: C(() => [ + b(he, null, { + default: C(() => [ + b(d, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: D(() => [...t[14] || (t[14] = [ - Q(" Olá Mundo! ", -1) + default: C(() => [...t[14] || (t[14] = [ + K(" Olá Mundo! ", -1) ])]), _: 1 }) ]), _: 1 }), - y(he, null, { - default: D(() => [ - t[15] || (t[15] = Q(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - ae("div", et, [ - y(f, { + b(Ve, null, { + default: C(() => [ + t[15] || (t[15] = K(" Este é um componente de exemplo integrado com Vuetify. ", -1)), + ne("div", nt, [ + b(f, { modelValue: e.nome, - "onUpdate:modelValue": t[0] || (t[0] = (l) => e.nome = l), + "onUpdate:modelValue": t[0] || (t[0] = (o) => e.nome = o), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.idade, - "onUpdate:modelValue": t[1] || (t[1] = (l) => e.idade = l), + "onUpdate:modelValue": t[1] || (t[1] = (o) => e.idade = o), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.altura, - "onUpdate:modelValue": t[2] || (t[2] = (l) => e.altura = l), + "onUpdate:modelValue": t[2] || (t[2] = (o) => e.altura = o), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.valor, - "onUpdate:modelValue": t[3] || (t[3] = (l) => e.valor = l), + "onUpdate:modelValue": t[3] || (t[3] = (o) => e.valor = o), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.telefone, - "onUpdate:modelValue": t[4] || (t[4] = (l) => e.telefone = l), + "onUpdate:modelValue": t[4] || (t[4] = (o) => e.telefone = o), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.cep, - "onUpdate:modelValue": t[5] || (t[5] = (l) => e.cep = l), + "onUpdate:modelValue": t[5] || (t[5] = (o) => e.cep = o), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - y(f, { + b(f, { type: "select", label: "Estado", options: [ @@ -484,58 +484,58 @@ function tt(e, t, c, $, g, w) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": t[6] || (t[6] = (l) => e.estado = l), + "onUpdate:modelValue": t[6] || (t[6] = (o) => e.estado = o), multiple: "" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.documento, - "onUpdate:modelValue": t[7] || (t[7] = (l) => e.documento = l), + "onUpdate:modelValue": t[7] || (t[7] = (o) => e.documento = o), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.email, - "onUpdate:modelValue": t[8] || (t[8] = (l) => e.email = l), + "onUpdate:modelValue": t[8] || (t[8] = (o) => e.email = o), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.senha, - "onUpdate:modelValue": t[9] || (t[9] = (l) => e.senha = l), + "onUpdate:modelValue": t[9] || (t[9] = (o) => e.senha = o), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - y(f, { + b(f, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": t[10] || (t[10] = (l) => e.mensagem = l), + "onUpdate:modelValue": t[10] || (t[10] = (o) => e.mensagem = o), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - y(f, { + b(f, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": t[11] || (t[11] = (l) => e.cor = l), + "onUpdate:modelValue": t[11] || (t[11] = (o) => e.cor = o), label: "Cor favorita", options: [ { label: "Azul", value: "azul" }, { label: "Verde", value: "verde" } ] }, null, 8, ["modelValue"]), - y(f, { + b(f, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": t[12] || (t[12] = (l) => e.habilidades = l), + "onUpdate:modelValue": t[12] || (t[12] = (o) => e.habilidades = o), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - y(f, { + b(f, { modelValue: e.nome, - "onUpdate:modelValue": t[13] || (t[13] = (l) => e.nome = l), + "onUpdate:modelValue": t[13] || (t[13] = (o) => e.nome = o), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -544,15 +544,15 @@ function tt(e, t, c, $, g, w) { ]), _: 1 }), - y(be, null, { - default: D(() => [ - y(I, { + b(Se, null, { + default: C(() => [ + b(I, { color: "primary", variant: "elevated", block: "" }, { - default: D(() => [...t[16] || (t[16] = [ - Q(" Botão Vuetify ", -1) + default: C(() => [...t[16] || (t[16] = [ + K(" Botão Vuetify ", -1) ])]), _: 1 }) @@ -566,9 +566,9 @@ function tt(e, t, c, $, g, w) { _: 1 }); } -const at = /* @__PURE__ */ J(xe, [["render", tt]]), rt = R({ +const lt = /* @__PURE__ */ R(rt, [["render", ot]]), st = W({ name: "EliCartao", - components: { EliBadge: le }, + components: { EliBadge: ie }, inheritAttrs: !1, props: { /** Título de fallback caso o slot `titulo` não seja usado. */ @@ -595,7 +595,7 @@ const at = /* @__PURE__ */ J(xe, [["render", tt]]), rt = R({ clicar: (e) => !0 }, setup(e, { emit: t }) { - const c = E(() => e.status), $ = E(() => { + const c = T(() => e.status), p = T(() => { switch (e.status) { case "novo": return "primary"; @@ -606,40 +606,40 @@ const at = /* @__PURE__ */ J(xe, [["render", tt]]), rt = R({ case "cancelado": return "error"; } - }), g = E(() => `eli-cartao--${e.status}`); - function w() { + }), v = T(() => `eli-cartao--${e.status}`); + function M() { t("clicar", e.status); } return { rotuloStatus: c, - corStatus: $, - classeStatus: g, - onClick: w + corStatus: p, + classeStatus: v, + onClick: M }; } -}), nt = { class: "eli-cartao__titulo-texto" }, ot = { class: "eli-cartao__status" }; -function lt(e, t, c, $, g, w) { - const d = te("EliBadge"); - return B(), H(ge, F({ +}), it = { class: "eli-cartao__titulo-texto" }, ut = { class: "eli-cartao__status" }; +function dt(e, t, c, p, v, M) { + const d = re("EliBadge"); + return B(), A(be, z({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: D(() => [ - y(ve, { class: "eli-cartao__titulo" }, { - default: D(() => [ - ae("div", nt, [ - W(e.$slots, "titulo", {}, () => [ - Q(ye(e.titulo), 1) + default: C(() => [ + b(he, { class: "eli-cartao__titulo" }, { + default: C(() => [ + ne("div", it, [ + Z(e.$slots, "titulo", {}, () => [ + K($e(e.titulo), 1) ], !0) ]), - ae("div", ot, [ - y(d, { + ne("div", ut, [ + b(d, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: D(() => [...t[0] || (t[0] = [ - ae("span", null, null, -1) + default: C(() => [...t[0] || (t[0] = [ + ne("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -647,95 +647,95 @@ function lt(e, t, c, $, g, w) { ]), _: 3 }), - y(he, { class: "eli-cartao__conteudo" }, { - default: D(() => [ - W(e.$slots, "default", {}, void 0, !0) + b(Ve, { class: "eli-cartao__conteudo" }, { + default: C(() => [ + Z(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (B(), H(be, { + e.$slots.acoes ? (B(), A(Se, { key: 0, class: "eli-cartao__acoes" }, { - default: D(() => [ - W(e.$slots, "acoes", {}, void 0, !0) + default: C(() => [ + Z(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : pe("", !0) + })) : ye("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const st = /* @__PURE__ */ J(rt, [["render", lt], ["__scopeId", "data-v-6c492bd9"]]); -function it(e) { +const ct = /* @__PURE__ */ R(st, [["render", dt], ["__scopeId", "data-v-6c492bd9"]]); +function ft(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var re = { exports: {} }, ut = re.exports, ce; -function dt() { - return ce || (ce = 1, (function(e, t) { - (function(c, $) { - e.exports = $(); - })(ut, (function() { - var c = 1e3, $ = 6e4, g = 36e5, w = "millisecond", d = "second", f = "minute", I = "hour", l = "day", Y = "week", V = "month", L = "quarter", h = "year", T = "date", v = "Invalid Date", we = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, De = /\[([^\]]+)]|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, ke = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) { +var oe = { exports: {} }, mt = oe.exports, ve; +function pt() { + return ve || (ve = 1, (function(e, t) { + (function(c, p) { + e.exports = p(); + })(mt, (function() { + var c = 1e3, p = 6e4, v = 36e5, M = "millisecond", d = "second", f = "minute", I = "hour", o = "day", m = "week", V = "month", H = "quarter", h = "year", w = "date", g = "Invalid Date", _ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Ee = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, Be = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) { var n = ["th", "st", "nd", "rd"], a = s % 100; return "[" + s + (n[(a - 20) % 10] || n[a] || n[0]) + "]"; - } }, ne = function(s, n, a) { - var o = String(s); - return !o || o.length >= n ? s : "" + Array(n + 1 - o.length).join(a) + s; - }, Be = { s: ne, z: function(s) { - var n = -s.utcOffset(), a = Math.abs(n), o = Math.floor(a / 60), r = a % 60; - return (n <= 0 ? "+" : "-") + ne(o, 2, "0") + ":" + ne(r, 2, "0"); + } }, le = function(s, n, a) { + var l = String(s); + return !l || l.length >= n ? s : "" + Array(n + 1 - l.length).join(a) + s; + }, Ce = { s: le, z: function(s) { + var n = -s.utcOffset(), a = Math.abs(n), l = Math.floor(a / 60), r = a % 60; + return (n <= 0 ? "+" : "-") + le(l, 2, "0") + ":" + le(r, 2, "0"); }, m: function s(n, a) { if (n.date() < a.date()) return -s(a, n); - var o = 12 * (a.year() - n.year()) + (a.month() - n.month()), r = n.clone().add(o, V), i = a - r < 0, u = n.clone().add(o + (i ? -1 : 1), V); - return +(-(o + (a - r) / (i ? r - u : u - r)) || 0); + var l = 12 * (a.year() - n.year()) + (a.month() - n.month()), r = n.clone().add(l, V), i = a - r < 0, u = n.clone().add(l + (i ? -1 : 1), V); + return +(-(l + (a - r) / (i ? r - u : u - r)) || 0); }, a: function(s) { return s < 0 ? Math.ceil(s) || 0 : Math.floor(s); }, p: function(s) { - return { M: V, y: h, w: Y, d: l, D: T, h: I, m: f, s: d, ms: w, Q: L }[s] || String(s || "").toLowerCase().replace(/s$/, ""); + return { M: V, y: h, w: m, d: o, D: w, h: I, m: f, s: d, ms: M, Q: H }[s] || String(s || "").toLowerCase().replace(/s$/, ""); }, u: function(s) { return s === void 0; - } }, q = "en", P = {}; - P[q] = ke; - var ie = "$isDayjsObject", oe = function(s) { - return s instanceof _ || !(!s || !s[ie]); - }, K = function s(n, a, o) { + } }, X = "en", j = {}; + j[X] = Be; + var de = "$isDayjsObject", se = function(s) { + return s instanceof ee || !(!s || !s[de]); + }, x = function s(n, a, l) { var r; - if (!n) return q; + if (!n) return X; if (typeof n == "string") { var i = n.toLowerCase(); - P[i] && (r = i), a && (P[i] = a, r = i); + j[i] && (r = i), a && (j[i] = a, r = i); var u = n.split("-"); if (!r && u.length > 1) return s(u[0]); } else { - var p = n.name; - P[p] = n, r = p; + var $ = n.name; + j[$] = n, r = $; } - return !o && r && (q = r), r || !o && q; - }, S = function(s, n) { - if (oe(s)) return s.clone(); + return !l && r && (X = r), r || !l && X; + }, k = function(s, n) { + if (se(s)) return s.clone(); var a = typeof n == "object" ? n : {}; - return a.date = s, a.args = arguments, new _(a); - }, m = Be; - m.l = K, m.i = oe, m.w = function(s, n) { - return S(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset }); + return a.date = s, a.args = arguments, new ee(a); + }, y = Ce; + y.l = x, y.i = se, y.w = function(s, n) { + return k(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset }); }; - var _ = (function() { + var ee = (function() { function s(a) { - this.$L = K(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[ie] = !0; + this.$L = x(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[de] = !0; } var n = s.prototype; return n.parse = function(a) { - this.$d = (function(o) { - var r = o.date, i = o.utc; + this.$d = (function(l) { + var r = l.date, i = l.utc; if (r === null) return /* @__PURE__ */ new Date(NaN); - if (m.u(r)) return /* @__PURE__ */ new Date(); + if (y.u(r)) return /* @__PURE__ */ new Date(); if (r instanceof Date) return new Date(r); if (typeof r == "string" && !/Z$/i.test(r)) { - var u = r.match(we); + var u = r.match(_); if (u) { - var p = u[2] - 1 || 0, b = (u[7] || "0").substring(0, 3); - return i ? new Date(Date.UTC(u[1], p, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, b)) : new Date(u[1], p, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, b); + var $ = u[2] - 1 || 0, S = (u[7] || "0").substring(0, 3); + return i ? new Date(Date.UTC(u[1], $, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, S)) : new Date(u[1], $, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, S); } } return new Date(r); @@ -744,188 +744,188 @@ function dt() { var a = this.$d; this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds(); }, n.$utils = function() { - return m; + return y; }, n.isValid = function() { - return this.$d.toString() !== v; - }, n.isSame = function(a, o) { - var r = S(a); - return this.startOf(o) <= r && r <= this.endOf(o); - }, n.isAfter = function(a, o) { - return S(a) < this.startOf(o); - }, n.isBefore = function(a, o) { - return this.endOf(o) < S(a); - }, n.$g = function(a, o, r) { - return m.u(a) ? this[o] : this.set(r, a); + return this.$d.toString() !== g; + }, n.isSame = function(a, l) { + var r = k(a); + return this.startOf(l) <= r && r <= this.endOf(l); + }, n.isAfter = function(a, l) { + return k(a) < this.startOf(l); + }, n.isBefore = function(a, l) { + return this.endOf(l) < k(a); + }, n.$g = function(a, l, r) { + return y.u(a) ? this[l] : this.set(r, a); }, n.unix = function() { return Math.floor(this.valueOf() / 1e3); }, n.valueOf = function() { return this.$d.getTime(); - }, n.startOf = function(a, o) { - var r = this, i = !!m.u(o) || o, u = m.p(a), p = function(N, O) { - var A = m.w(r.$u ? Date.UTC(r.$y, O, N) : new Date(r.$y, O, N), r); - return i ? A : A.endOf(l); - }, b = function(N, O) { - return m.w(r.toDate()[N].apply(r.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), r); - }, M = this.$W, k = this.$M, U = this.$D, z = "set" + (this.$u ? "UTC" : ""); + }, n.startOf = function(a, l) { + var r = this, i = !!y.u(l) || l, u = y.p(a), $ = function(L, U) { + var N = y.w(r.$u ? Date.UTC(r.$y, U, L) : new Date(r.$y, U, L), r); + return i ? N : N.endOf(o); + }, S = function(L, U) { + return y.w(r.toDate()[L].apply(r.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), r); + }, E = this.$W, O = this.$M, Y = this.$D, q = "set" + (this.$u ? "UTC" : ""); switch (u) { case h: - return i ? p(1, 0) : p(31, 11); + return i ? $(1, 0) : $(31, 11); case V: - return i ? p(1, k) : p(0, k + 1); - case Y: - var j = this.$locale().weekStart || 0, Z = (M < j ? M + 7 : M) - j; - return p(i ? U - Z : U + (6 - Z), k); - case l: - case T: - return b(z + "Hours", 0); + return i ? $(1, O) : $(0, O + 1); + case m: + var F = this.$locale().weekStart || 0, G = (E < F ? E + 7 : E) - F; + return $(i ? Y - G : Y + (6 - G), O); + case o: + case w: + return S(q + "Hours", 0); case I: - return b(z + "Minutes", 1); + return S(q + "Minutes", 1); case f: - return b(z + "Seconds", 2); + return S(q + "Seconds", 2); case d: - return b(z + "Milliseconds", 3); + return S(q + "Milliseconds", 3); default: return this.clone(); } }, n.endOf = function(a) { return this.startOf(a, !1); - }, n.$set = function(a, o) { - var r, i = m.p(a), u = "set" + (this.$u ? "UTC" : ""), p = (r = {}, r[l] = u + "Date", r[T] = u + "Date", r[V] = u + "Month", r[h] = u + "FullYear", r[I] = u + "Hours", r[f] = u + "Minutes", r[d] = u + "Seconds", r[w] = u + "Milliseconds", r)[i], b = i === l ? this.$D + (o - this.$W) : o; + }, n.$set = function(a, l) { + var r, i = y.p(a), u = "set" + (this.$u ? "UTC" : ""), $ = (r = {}, r[o] = u + "Date", r[w] = u + "Date", r[V] = u + "Month", r[h] = u + "FullYear", r[I] = u + "Hours", r[f] = u + "Minutes", r[d] = u + "Seconds", r[M] = u + "Milliseconds", r)[i], S = i === o ? this.$D + (l - this.$W) : l; if (i === V || i === h) { - var M = this.clone().set(T, 1); - M.$d[p](b), M.init(), this.$d = M.set(T, Math.min(this.$D, M.daysInMonth())).$d; - } else p && this.$d[p](b); + var E = this.clone().set(w, 1); + E.$d[$](S), E.init(), this.$d = E.set(w, Math.min(this.$D, E.daysInMonth())).$d; + } else $ && this.$d[$](S); return this.init(), this; - }, n.set = function(a, o) { - return this.clone().$set(a, o); + }, n.set = function(a, l) { + return this.clone().$set(a, l); }, n.get = function(a) { - return this[m.p(a)](); - }, n.add = function(a, o) { + return this[y.p(a)](); + }, n.add = function(a, l) { var r, i = this; a = Number(a); - var u = m.p(o), p = function(k) { - var U = S(i); - return m.w(U.date(U.date() + Math.round(k * a)), i); + var u = y.p(l), $ = function(O) { + var Y = k(i); + return y.w(Y.date(Y.date() + Math.round(O * a)), i); }; if (u === V) return this.set(V, this.$M + a); if (u === h) return this.set(h, this.$y + a); - if (u === l) return p(1); - if (u === Y) return p(7); - var b = (r = {}, r[f] = $, r[I] = g, r[d] = c, r)[u] || 1, M = this.$d.getTime() + a * b; - return m.w(M, this); - }, n.subtract = function(a, o) { - return this.add(-1 * a, o); + if (u === o) return $(1); + if (u === m) return $(7); + var S = (r = {}, r[f] = p, r[I] = v, r[d] = c, r)[u] || 1, E = this.$d.getTime() + a * S; + return y.w(E, this); + }, n.subtract = function(a, l) { + return this.add(-1 * a, l); }, n.format = function(a) { - var o = this, r = this.$locale(); - if (!this.isValid()) return r.invalidDate || v; - var i = a || "YYYY-MM-DDTHH:mm:ssZ", u = m.z(this), p = this.$H, b = this.$m, M = this.$M, k = r.weekdays, U = r.months, z = r.meridiem, j = function(O, A, X, x) { - return O && (O[A] || O(o, i)) || X[A].slice(0, x); - }, Z = function(O) { - return m.s(p % 12 || 12, O, "0"); - }, N = z || function(O, A, X) { - var x = O < 12 ? "AM" : "PM"; - return X ? x.toLowerCase() : x; + var l = this, r = this.$locale(); + if (!this.isValid()) return r.invalidDate || g; + var i = a || "YYYY-MM-DDTHH:mm:ssZ", u = y.z(this), $ = this.$H, S = this.$m, E = this.$M, O = r.weekdays, Y = r.months, q = r.meridiem, F = function(U, N, Q, te) { + return U && (U[N] || U(l, i)) || Q[N].slice(0, te); + }, G = function(U) { + return y.s($ % 12 || 12, U, "0"); + }, L = q || function(U, N, Q) { + var te = U < 12 ? "AM" : "PM"; + return Q ? te.toLowerCase() : te; }; - return i.replace(De, (function(O, A) { - return A || (function(X) { - switch (X) { + return i.replace(Ee, (function(U, N) { + return N || (function(Q) { + switch (Q) { case "YY": - return String(o.$y).slice(-2); + return String(l.$y).slice(-2); case "YYYY": - return m.s(o.$y, 4, "0"); + return y.s(l.$y, 4, "0"); case "M": - return M + 1; + return E + 1; case "MM": - return m.s(M + 1, 2, "0"); + return y.s(E + 1, 2, "0"); case "MMM": - return j(r.monthsShort, M, U, 3); + return F(r.monthsShort, E, Y, 3); case "MMMM": - return j(U, M); + return F(Y, E); case "D": - return o.$D; + return l.$D; case "DD": - return m.s(o.$D, 2, "0"); + return y.s(l.$D, 2, "0"); case "d": - return String(o.$W); + return String(l.$W); case "dd": - return j(r.weekdaysMin, o.$W, k, 2); + return F(r.weekdaysMin, l.$W, O, 2); case "ddd": - return j(r.weekdaysShort, o.$W, k, 3); + return F(r.weekdaysShort, l.$W, O, 3); case "dddd": - return k[o.$W]; + return O[l.$W]; case "H": - return String(p); + return String($); case "HH": - return m.s(p, 2, "0"); + return y.s($, 2, "0"); case "h": - return Z(1); + return G(1); case "hh": - return Z(2); + return G(2); case "a": - return N(p, b, !0); + return L($, S, !0); case "A": - return N(p, b, !1); + return L($, S, !1); case "m": - return String(b); + return String(S); case "mm": - return m.s(b, 2, "0"); + return y.s(S, 2, "0"); case "s": - return String(o.$s); + return String(l.$s); case "ss": - return m.s(o.$s, 2, "0"); + return y.s(l.$s, 2, "0"); case "SSS": - return m.s(o.$ms, 3, "0"); + return y.s(l.$ms, 3, "0"); case "Z": return u; } return null; - })(O) || u.replace(":", ""); + })(U) || u.replace(":", ""); })); }, n.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, n.diff = function(a, o, r) { - var i, u = this, p = m.p(o), b = S(a), M = (b.utcOffset() - this.utcOffset()) * $, k = this - b, U = function() { - return m.m(u, b); + }, n.diff = function(a, l, r) { + var i, u = this, $ = y.p(l), S = k(a), E = (S.utcOffset() - this.utcOffset()) * p, O = this - S, Y = function() { + return y.m(u, S); }; - switch (p) { + switch ($) { case h: - i = U() / 12; + i = Y() / 12; break; case V: - i = U(); + i = Y(); break; - case L: - i = U() / 3; + case H: + i = Y() / 3; break; - case Y: - i = (k - M) / 6048e5; + case m: + i = (O - E) / 6048e5; break; - case l: - i = (k - M) / 864e5; + case o: + i = (O - E) / 864e5; break; case I: - i = k / g; + i = O / v; break; case f: - i = k / $; + i = O / p; break; case d: - i = k / c; + i = O / c; break; default: - i = k; + i = O; } - return r ? i : m.a(i); + return r ? i : y.a(i); }, n.daysInMonth = function() { return this.endOf(V).$D; }, n.$locale = function() { - return P[this.$L]; - }, n.locale = function(a, o) { + return j[this.$L]; + }, n.locale = function(a, l) { if (!a) return this.$L; - var r = this.clone(), i = K(a, o, !0); + var r = this.clone(), i = x(a, l, !0); return i && (r.$L = i), r; }, n.clone = function() { - return m.w(this.$d, this); + return y.w(this.$d, this); }, n.toDate = function() { return new Date(this.valueOf()); }, n.toJSON = function() { @@ -935,21 +935,21 @@ function dt() { }, n.toString = function() { return this.$d.toUTCString(); }, s; - })(), ue = _.prototype; - return S.prototype = ue, [["$ms", w], ["$s", d], ["$m", f], ["$H", I], ["$W", l], ["$M", V], ["$y", h], ["$D", T]].forEach((function(s) { - ue[s[1]] = function(n) { + })(), ce = ee.prototype; + return k.prototype = ce, [["$ms", M], ["$s", d], ["$m", f], ["$H", I], ["$W", o], ["$M", V], ["$y", h], ["$D", w]].forEach((function(s) { + ce[s[1]] = function(n) { return this.$g(n, s[0], s[1]); }; - })), S.extend = function(s, n) { - return s.$i || (s(n, _, S), s.$i = !0), S; - }, S.locale = K, S.isDayjs = oe, S.unix = function(s) { - return S(1e3 * s); - }, S.en = P[q], S.Ls = P, S.p = {}, S; + })), k.extend = function(s, n) { + return s.$i || (s(n, ee, k), s.$i = !0), k; + }, k.locale = x, k.isDayjs = se, k.unix = function(s) { + return k(1e3 * s); + }, k.en = j[X], k.Ls = j, k.p = {}, k; })); - })(re)), re.exports; + })(oe)), oe.exports; } -var ft = dt(); -const ee = /* @__PURE__ */ it(ft), mt = R({ +var vt = pt(); +const ae = /* @__PURE__ */ ft(vt), yt = W({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1049,39 +1049,39 @@ const ee = /* @__PURE__ */ it(ft), mt = R({ desfoco: () => !0 }, setup(e, { emit: t, attrs: c }) { - const $ = E( + const p = T( () => e.modo === "data" ? "date" : "datetime-local" ); - function g(l) { - return e.modo === "data" ? ee(l).format("YYYY-MM-DD") : ee(l).format("YYYY-MM-DDTHH:mm"); + function v(o) { + return e.modo === "data" ? ae(o).format("YYYY-MM-DD") : ae(o).format("YYYY-MM-DDTHH:mm"); } - function w(l) { - return e.modo === "data" ? ee(`${l}T00:00`).format() : ee(l).format(); + function M(o) { + return e.modo === "data" ? ae(`${o}T00:00`).format() : ae(o).format(); } - const d = E({ - get: () => e.modelValue ? g(e.modelValue) : "", - set: (l) => { - const Y = l && l.length > 0 ? l : null; - if (!Y) { + const d = T({ + get: () => e.modelValue ? v(e.modelValue) : "", + set: (o) => { + const m = o && o.length > 0 ? o : null; + if (!m) { t("update:modelValue", null), t("alterar", null); return; } - const V = w(Y); + const V = M(m); t("update:modelValue", V), t("alterar", V); } - }), f = E(() => { + }), f = T(() => { if (e.min) - return g(e.min); - }), I = E(() => { + return v(e.min); + }), I = T(() => { if (e.max) - return g(e.max); + return v(e.max); }); - return { attrs: c, valor: d, emit: t, minLocal: f, maxLocal: I, tipoInput: $ }; + return { attrs: c, valor: d, emit: t, minLocal: f, maxLocal: I, tipoInput: p }; } -}), ct = { class: "eli-data-hora" }; -function pt(e, t, c, $, g, w) { - return B(), G("div", ct, [ - y($e, F({ +}), $t = { class: "eli-data-hora" }; +function gt(e, t, c, p, v, M) { + return B(), J("div", $t, [ + b(ge, z({ modelValue: e.valor, "onUpdate:modelValue": t[0] || (t[0] = (d) => e.valor = d), type: e.tipoInput, @@ -1103,17 +1103,150 @@ function pt(e, t, c, $, g, w) { }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } -const yt = /* @__PURE__ */ J(mt, [["render", pt], ["__scopeId", "data-v-71afabb6"]]), Et = { +const bt = /* @__PURE__ */ R(yt, [["render", gt], ["__scopeId", "data-v-71afabb6"]]); +var ke = ((e) => (e[e.sucesso = 200] = "sucesso", e[e.erroConhecido = 400] = "erroConhecido", e[e.erroPermissao = 401] = "erroPermissao", e[e.erroNaoEncontrado = 404] = "erroNaoEncontrado", e[e.erroDesconhecido = 500] = "erroDesconhecido", e[e.tempoEsgotado = 504] = "tempoEsgotado", e))(ke || {}); +const ht = W({ + name: "EliTabela", + inheritAttrs: !1, + props: { + tabela: { + // Observação: este componente é “generic-friendly”. + // Usamos `any` aqui para permitir passar `EliTabelaConsulta` de qualquer T + // sem brigar com invariância do TS (por causa do callback `celula(linha: T)`). + type: Object, + required: !0 + } + }, + setup(e) { + const t = D(!1), c = D(null), p = D([]), v = D(0); + function M(m) { + return m == null || m === !1 ? "" : m; + } + function d(m) { + return P( + "div", + { + class: "eli-tabela eli-tabela--erro", + role: "alert" + }, + [ + P("div", { class: "eli-tabela__erro-titulo" }, "Erro"), + P("div", { class: "eli-tabela__erro-mensagem" }, m) + ] + ); + } + function f(m) { + return P( + "div", + { + class: "eli-tabela eli-tabela--vazio" + }, + m ?? "Nenhum registro encontrado." + ); + } + function I() { + return P( + "div", + { + class: "eli-tabela eli-tabela--carregando", + "aria-busy": "true" + }, + "Carregando..." + ); + } + async function o() { + t.value = !0, c.value = null; + try { + const m = await e.tabela.resposta(); + if (m.cod !== ke.sucesso) { + p.value = [], v.value = 0, c.value = m.mensagem; + return; + } + p.value = m.valor.valores, v.value = m.valor.quantidade; + } catch (m) { + p.value = [], v.value = 0, c.value = m instanceof Error ? m.message : "Erro ao carregar dados."; + } finally { + t.value = !1; + } + } + return Oe(o), Te( + () => e.tabela, + () => { + o(); + } + ), () => { + const m = e.tabela; + if (t.value) + return I(); + if (c.value) + return d(c.value); + const V = m.colunas; + return p.value.length ? P( + "div", + { + class: "eli-tabela" + }, + [ + P("table", { class: "eli-tabela__table" }, [ + P( + "thead", + { class: "eli-tabela__thead" }, + P( + "tr", + { class: "eli-tabela__tr eli-tabela__tr--header" }, + V.map( + (H) => P("th", { class: "eli-tabela__th", scope: "col" }, H.rotulo) + ) + ) + ), + P( + "tbody", + { class: "eli-tabela__tbody" }, + p.value.map( + (H, h) => P( + "tr", + { class: "eli-tabela__tr", key: h }, + V.map( + (w, g) => P( + "td", + { + class: [ + "eli-tabela__td", + w.acao ? "eli-tabela__td--clicavel" : void 0 + ], + key: `${h}-${g}`, + onClick: w.acao ? () => { + var _; + return (_ = w.acao) == null ? void 0 : _.call(w); + } : void 0 + }, + M(w.celula(H)) + ) + ) + ) + ) + ) + ]) + ] + ) : f(m.mensagemVazio); + }; + } +}); +function Vt(e, t, c, p, v, M) { + return B(), J("div"); +} +const St = /* @__PURE__ */ R(ht, [["render", Vt], ["__scopeId", "data-v-cc67b529"]]), Yt = { install(e) { - e.component("EliOlaMundo", at), e.component("EliBotao", Ve), e.component("EliBadge", le), e.component("EliInput", Me), e.component("EliCartao", st), e.component("EliDataHora", yt); + e.component("EliOlaMundo", lt), e.component("EliBotao", Me), e.component("EliBadge", ie), e.component("EliInput", De), e.component("EliCartao", ct), e.component("EliDataHora", bt), e.component("EliTabela", St); } }; export { - le as EliBadge, - Ve as EliBotao, - st as EliCartao, - yt as EliDataHora, - Me as EliInput, - at as EliOlaMundo, - Et as default + ie as EliBadge, + Me as EliBotao, + ct as EliCartao, + bt as EliDataHora, + De as EliInput, + lt as EliOlaMundo, + St as EliTabela, + Yt as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index 76c4df5..a271f74 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1 +1 @@ -(function(h,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):(h=typeof globalThis<"u"?globalThis:h||self,t(h.eli_vue={},h.Vue,h.VBtn,h.VBadge,h.VCheckbox,h.VIcon,h.VRadio,h.VRadioGroup,h.VSelect,h.VTextField,h.VTextarea,h.VCard,h.VGrid))})(this,(function(h,t,de,ue,ce,fe,me,pe,ye,ee,he,I,$e){"use strict";const ge=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}}}),Y=(e,o)=>{const p=e.__vccOpts||e;for(const[$,g]of o)p[$]=g;return p};function Ve(e,o,p,$,g,M){return t.openBlock(),t.createBlock(de.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 X=Y(ge,[["render",Ve]]),te={suave:"4px",pill:"10px"},be=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 o=t.computed(()=>e.radius in te?te[e.radius]:e.radius),p=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),$=t.computed(()=>({"--eli-badge-radius":o.value}));return{showBadge:p,badgeStyle:$}}});function Se(e,o,p,$,g,M){return e.showBadge?(t.openBlock(),t.createBlock(ue.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 R=Y(be,[["render",Se],["__scopeId","data-v-de2fbf2f"]]);function Be(e){return e.replace(/\D+/g,"")}function ke(e){const o=Be(e);return o.length<=11?o.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):o.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 we(e){return e.replace(/\D+/g,"")}function Me(e){const o=we(e);return o?o.length<=10?o.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):o.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function Q(e){return e.replace(/\D+/g,"")}function oe(e){const o=e.replace(/[^\d,]/g,""),p=o.split(",");return p.length>2?p[0]+","+p.slice(1).join(""):o}function Ce(e){return oe(e.replace(/%/g,""))}function De(e){const o=Q(e);return o?(parseInt(o,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function Ee(e){const o=Q(e).slice(0,8);return o.length<=5?o:o.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Ne=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:o,attrs:p}){const $=t.ref(!1),g=t.ref(!1),M=t.computed({get:()=>e.modelValue,set:b=>{o("update:modelValue",b),o("change",b)}}),c=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),f=t.computed(()=>e.type==="password"?g.value?"text":"password":"text"),D=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),i=t.computed(()=>e.error?"error":$.value?e.color:void 0);function v(b){const N=b.target;let V=N.value;switch(e.type){case"numericoInteiro":V=Q(V);break;case"numericoDecimal":V=oe(V);break;case"numericoMoeda":V=De(V);break;case"porcentagem":V=Ce(V);break;case"telefone":V=Me(V);break;case"cpfCnpj":V=ke(V);break;case"cep":V=Ee(V);break}N.value=V,o("update:modelValue",V),o("change",V)}function B(){g.value=!g.value}const A=t.computed(()=>(e.options||[]).map(b=>{if(b&&typeof b=="object"&&"value"in b){const V=b.value;return{label:b.label??String(V),value:V,disabled:b.disabled}}const N=b;return{label:String(N),value:N}}));return{attrs:p,value:M,isTextLike:c,inputHtmlType:f,inputMode:D,internalColor:i,showPassword:g,togglePassword:B,onInput:v,onFocus:()=>o("focus"),onBlur:()=>o("blur"),computedItems:A}}}),Te={class:"eli-input"},ve={key:4,class:"checkbox-group"};function Ie(e,o,p,$,g,M){return t.openBlock(),t.createElementBlock("div",Te,[e.isTextLike?(t.openBlock(),t.createBlock(ee.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=c=>e.value=c),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(fe.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(he.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":o[1]||(o[1]=c=>e.value=c),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(ye.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":o[2]||(o[2]=c=>e.value=c),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(pe.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":o[3]||(o[3]=c=>e.value=c),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,c=>(t.openBlock(),t.createBlock(me.VRadio,{key:String(c.value),label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",ve,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,c=>(t.openBlock(),t.createBlock(ce.VCheckbox,{key:String(c.value),modelValue:e.value,"onUpdate:modelValue":o[4]||(o[4]=f=>e.value=f),label:c.label,value:c.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const K=Y(Ne,[["render",Ie],["__scopeId","data-v-756cb549"]]),Oe=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:X,EliBadge:R,EliInput:K},setup(){const e=t.ref(""),o=t.ref([]),p=t.ref(""),$=t.ref(""),g=t.ref(""),M=t.ref(""),c=t.ref(""),f=t.ref(""),D=t.ref(""),i=t.ref(""),v=t.ref(""),B=t.ref(null),A=t.ref([]);return{nome:e,email:f,documento:v,estado:o,telefone:$,mensagem:D,senha:i,cor:B,habilidades:A,idade:g,altura:M,cep:p,valor:c}}}),Pe={class:"grid-example"};function Ue(e,o,p,$,g,M){const c=t.resolveComponent("EliBadge"),f=t.resolveComponent("EliInput"),D=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock($e.VContainer,null,{default:t.withCtx(()=>[t.createVNode(I.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(I.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(c,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...o[14]||(o[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(I.VCardText,null,{default:t.withCtx(()=>[o[15]||(o[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Pe,[t.createVNode(f,{modelValue:e.nome,"onUpdate:modelValue":o[0]||(o[0]=i=>e.nome=i),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.idade,"onUpdate:modelValue":o[1]||(o[1]=i=>e.idade=i),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.altura,"onUpdate:modelValue":o[2]||(o[2]=i=>e.altura=i),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.valor,"onUpdate:modelValue":o[3]||(o[3]=i=>e.valor=i),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.telefone,"onUpdate:modelValue":o[4]||(o[4]=i=>e.telefone=i),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.cep,"onUpdate:modelValue":o[5]||(o[5]=i=>e.cep=i),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(f,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":o[6]||(o[6]=i=>e.estado=i),multiple:""},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.documento,"onUpdate:modelValue":o[7]||(o[7]=i=>e.documento=i),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.email,"onUpdate:modelValue":o[8]||(o[8]=i=>e.email=i),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.senha,"onUpdate:modelValue":o[9]||(o[9]=i=>e.senha=i),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(f,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":o[10]||(o[10]=i=>e.mensagem=i),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(f,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":o[11]||(o[11]=i=>e.cor=i),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(f,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":o[12]||(o[12]=i=>e.habilidades=i),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.nome,"onUpdate:modelValue":o[13]||(o[13]=i=>e.nome=i),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(I.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(D,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...o[16]||(o[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ne=Y(Oe,[["render",Ue]]),He=t.defineComponent({name:"EliCartao",components:{EliBadge:R},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:o}){const p=t.computed(()=>e.status),$=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),g=t.computed(()=>`eli-cartao--${e.status}`);function M(){o("clicar",e.status)}return{rotuloStatus:p,corStatus:$,classeStatus:g,onClick:M}}}),Ye={class:"eli-cartao__titulo-texto"},Ae={class:"eli-cartao__status"};function je(e,o,p,$,g,M){const c=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(I.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(I.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Ye,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Ae,[t.createVNode(c,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...o[0]||(o[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(I.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(I.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 re=Y(He,[["render",je],["__scopeId","data-v-6c492bd9"]]);function Fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z={exports:{}},Le=z.exports,ae;function qe(){return ae||(ae=1,(function(e,o){(function(p,$){e.exports=$()})(Le,(function(){var p=1e3,$=6e4,g=36e5,M="millisecond",c="second",f="minute",D="hour",i="day",v="week",B="month",A="quarter",b="year",N="date",V="Invalid Date",Ze=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Xe=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Qe={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var a=["th","st","nd","rd"],n=s%100;return"["+s+(a[(n-20)%10]||a[n]||a[0])+"]"}},x=function(s,a,n){var l=String(s);return!l||l.length>=a?s:""+Array(a+1-l.length).join(n)+s},Ke={s:x,z:function(s){var a=-s.utcOffset(),n=Math.abs(a),l=Math.floor(n/60),r=n%60;return(a<=0?"+":"-")+x(l,2,"0")+":"+x(r,2,"0")},m:function s(a,n){if(a.date()1)return s(u[0])}else{var y=a.name;P[y]=a,r=y}return!l&&r&&(F=r),r||!l&&F},k=function(s,a){if(_(s))return s.clone();var n=typeof a=="object"?a:{};return n.date=s,n.args=arguments,new J(n)},m=Ke;m.l=G,m.i=_,m.w=function(s,a){return k(s,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var J=(function(){function s(n){this.$L=G(n.locale,null,!0),this.parse(n),this.$x=this.$x||n.x||{},this[ie]=!0}var a=s.prototype;return a.parse=function(n){this.$d=(function(l){var r=l.date,d=l.utc;if(r===null)return new Date(NaN);if(m.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var u=r.match(Ze);if(u){var y=u[2]-1||0,S=(u[7]||"0").substring(0,3);return d?new Date(Date.UTC(u[1],y,u[3]||1,u[4]||0,u[5]||0,u[6]||0,S)):new Date(u[1],y,u[3]||1,u[4]||0,u[5]||0,u[6]||0,S)}}return new Date(r)})(n),this.init()},a.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},a.$utils=function(){return m},a.isValid=function(){return this.$d.toString()!==V},a.isSame=function(n,l){var r=k(n);return this.startOf(l)<=r&&r<=this.endOf(l)},a.isAfter=function(n,l){return k(n)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:o,attrs:p}){const $=t.computed(()=>e.modo==="data"?"date":"datetime-local");function g(i){return e.modo==="data"?W(i).format("YYYY-MM-DD"):W(i).format("YYYY-MM-DDTHH:mm")}function M(i){return e.modo==="data"?W(`${i}T00:00`).format():W(i).format()}const c=t.computed({get:()=>e.modelValue?g(e.modelValue):"",set:i=>{const v=i&&i.length>0?i:null;if(!v){o("update:modelValue",null),o("alterar",null);return}const B=M(v);o("update:modelValue",B),o("alterar",B)}}),f=t.computed(()=>{if(e.min)return g(e.min)}),D=t.computed(()=>{if(e.max)return g(e.max)});return{attrs:p,valor:c,emit:o,minLocal:f,maxLocal:D,tipoInput:$}}}),We={class:"eli-data-hora"};function Ge(e,o,p,$,g,M){return t.openBlock(),t.createElementBlock("div",We,[t.createVNode(ee.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":o[0]||(o[0]=c=>e.valor=c),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:o[1]||(o[1]=c=>e.emit("foco")),onBlur:o[2]||(o[2]=c=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const le=Y(ze,[["render",Ge],["__scopeId","data-v-71afabb6"]]),Je={install(e){e.component("EliOlaMundo",ne),e.component("EliBotao",X),e.component("EliBadge",R),e.component("EliInput",K),e.component("EliCartao",re),e.component("EliDataHora",le)}};h.EliBadge=R,h.EliBotao=X,h.EliCartao=re,h.EliDataHora=le,h.EliInput=K,h.EliOlaMundo=ne,h.default=Je,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); +(function(V,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(V=typeof globalThis<"u"?globalThis:V||self,t(V.eli_vue={},V.Vue,V.VBtn,V.VBadge,V.VCheckbox,V.VIcon,V.VRadio,V.VRadioGroup,V.VSelect,V.VTextField,V.VTextarea,V.VCard,V.VGrid))})(this,(function(V,t,fe,me,pe,ye,he,$e,ge,te,Ve,O,be){"use strict";const Se=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),U=(e,a)=>{const f=e.__vccOpts||e;for(const[y,h]of a)f[y]=h;return f};function Be(e,a,f,y,h,w){return t.openBlock(),t.createBlock(fe.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const Q=U(Se,[["render",Be]]),ae={suave:"4px",pill:"10px"},ke=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ae?ae[e.radius]:e.radius),f=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),y=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:f,badgeStyle:y}}});function we(e,a,f,y,h,w){return e.showBadge?(t.openBlock(),t.createBlock(me.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const z=U(ke,[["render",we],["__scopeId","data-v-de2fbf2f"]]);function Ce(e){return e.replace(/\D+/g,"")}function Me(e){const a=Ce(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function De(e){return e.replace(/\D+/g,"")}function Ee(e){const a=De(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function K(e){return e.replace(/\D+/g,"")}function re(e){const a=e.replace(/[^\d,]/g,""),f=a.split(",");return f.length>2?f[0]+","+f.slice(1).join(""):a}function ve(e){return re(e.replace(/%/g,""))}function Ne(e){const a=K(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function Te(e){const a=K(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Ie=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:f}){const y=t.ref(!1),h=t.ref(!1),w=t.computed({get:()=>e.modelValue,set:S=>{a("update:modelValue",S),a("change",S)}}),c=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),m=t.computed(()=>e.type==="password"?h.value?"text":"password":"text"),E=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),l=t.computed(()=>e.error?"error":y.value?e.color:void 0);function p(S){const C=S.target;let b=C.value;switch(e.type){case"numericoInteiro":b=K(b);break;case"numericoDecimal":b=re(b);break;case"numericoMoeda":b=Ne(b);break;case"porcentagem":b=ve(b);break;case"telefone":b=Ee(b);break;case"cpfCnpj":b=Me(b);break;case"cep":b=Te(b);break}C.value=b,a("update:modelValue",b),a("change",b)}function B(){h.value=!h.value}const I=t.computed(()=>(e.options||[]).map(S=>{if(S&&typeof S=="object"&&"value"in S){const b=S.value;return{label:S.label??String(b),value:b,disabled:S.disabled}}const C=S;return{label:String(C),value:C}}));return{attrs:f,value:w,isTextLike:c,inputHtmlType:m,inputMode:E,internalColor:l,showPassword:h,togglePassword:B,onInput:p,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:I}}}),Oe={class:"eli-input"},Pe={key:4,class:"checkbox-group"};function Ue(e,a,f,y,h,w){return t.openBlock(),t.createElementBlock("div",Oe,[e.isTextLike?(t.openBlock(),t.createBlock(te.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=c=>e.value=c),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(ye.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Ve.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=c=>e.value=c),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(ge.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=c=>e.value=c),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock($e.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=c=>e.value=c),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,c=>(t.openBlock(),t.createBlock(he.VRadio,{key:String(c.value),label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Pe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,c=>(t.openBlock(),t.createBlock(pe.VCheckbox,{key:String(c.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=m=>e.value=m),label:c.label,value:c.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const _=U(Ie,[["render",Ue],["__scopeId","data-v-756cb549"]]),Ae=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:Q,EliBadge:z,EliInput:_},setup(){const e=t.ref(""),a=t.ref([]),f=t.ref(""),y=t.ref(""),h=t.ref(""),w=t.ref(""),c=t.ref(""),m=t.ref(""),E=t.ref(""),l=t.ref(""),p=t.ref(""),B=t.ref(null),I=t.ref([]);return{nome:e,email:m,documento:p,estado:a,telefone:y,mensagem:E,senha:l,cor:B,habilidades:I,idade:h,altura:w,cep:f,valor:c}}}),He={class:"grid-example"};function Ye(e,a,f,y,h,w){const c=t.resolveComponent("EliBadge"),m=t.resolveComponent("EliInput"),E=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(be.VContainer,null,{default:t.withCtx(()=>[t.createVNode(O.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(O.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(c,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(O.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",He,[t.createVNode(m,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=l=>e.nome=l),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=l=>e.idade=l),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=l=>e.altura=l),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=l=>e.valor=l),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=l=>e.telefone=l),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=l=>e.cep=l),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(m,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=l=>e.estado=l),multiple:""},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=l=>e.documento=l),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=l=>e.email=l),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=l=>e.senha=l),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(m,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=l=>e.mensagem=l),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(m,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=l=>e.cor=l),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(m,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=l=>e.habilidades=l),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(m,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=l=>e.nome=l),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(O.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(E,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const oe=U(Ae,[["render",Ye]]),je=t.defineComponent({name:"EliCartao",components:{EliBadge:z},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const f=t.computed(()=>e.status),y=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),h=t.computed(()=>`eli-cartao--${e.status}`);function w(){a("clicar",e.status)}return{rotuloStatus:f,corStatus:y,classeStatus:h,onClick:w}}}),Fe={class:"eli-cartao__titulo-texto"},qe={class:"eli-cartao__status"};function Le(e,a,f,y,h,w){const c=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(O.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(O.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Fe,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",qe,[t.createVNode(c,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(O.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(O.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const ne=U(je,[["render",Le],["__scopeId","data-v-6c492bd9"]]);function ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R={exports:{}},Re=R.exports,le;function We(){return le||(le=1,(function(e,a){(function(f,y){e.exports=y()})(Re,(function(){var f=1e3,y=6e4,h=36e5,w="millisecond",c="second",m="minute",E="hour",l="day",p="week",B="month",I="quarter",S="year",C="date",b="Invalid Date",G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,xe=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,et={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],r=s%100;return"["+s+(n[(r-20)%10]||n[r]||n[0])+"]"}},x=function(s,n,r){var i=String(s);return!i||i.length>=n?s:""+Array(n+1-i.length).join(r)+s},tt={s:x,z:function(s){var n=-s.utcOffset(),r=Math.abs(n),i=Math.floor(r/60),o=r%60;return(n<=0?"+":"-")+x(i,2,"0")+":"+x(o,2,"0")},m:function s(n,r){if(n.date()1)return s(u[0])}else{var g=n.name;A[g]=n,o=g}return!i&&o&&(F=o),o||!i&&F},M=function(s,n){if(ee(s))return s.clone();var r=typeof n=="object"?n:{};return r.date=s,r.args=arguments,new Z(r)},$=tt;$.l=J,$.i=ee,$.w=function(s,n){return M(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var Z=(function(){function s(r){this.$L=J(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[ue]=!0}var n=s.prototype;return n.parse=function(r){this.$d=(function(i){var o=i.date,d=i.utc;if(o===null)return new Date(NaN);if($.u(o))return new Date;if(o instanceof Date)return new Date(o);if(typeof o=="string"&&!/Z$/i.test(o)){var u=o.match(G);if(u){var g=u[2]-1||0,k=(u[7]||"0").substring(0,3);return d?new Date(Date.UTC(u[1],g,u[3]||1,u[4]||0,u[5]||0,u[6]||0,k)):new Date(u[1],g,u[3]||1,u[4]||0,u[5]||0,u[6]||0,k)}}return new Date(o)})(r),this.init()},n.init=function(){var r=this.$d;this.$y=r.getFullYear(),this.$M=r.getMonth(),this.$D=r.getDate(),this.$W=r.getDay(),this.$H=r.getHours(),this.$m=r.getMinutes(),this.$s=r.getSeconds(),this.$ms=r.getMilliseconds()},n.$utils=function(){return $},n.isValid=function(){return this.$d.toString()!==b},n.isSame=function(r,i){var o=M(r);return this.startOf(i)<=o&&o<=this.endOf(i)},n.isAfter=function(r,i){return M(r)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:f}){const y=t.computed(()=>e.modo==="data"?"date":"datetime-local");function h(l){return e.modo==="data"?W(l).format("YYYY-MM-DD"):W(l).format("YYYY-MM-DDTHH:mm")}function w(l){return e.modo==="data"?W(`${l}T00:00`).format():W(l).format()}const c=t.computed({get:()=>e.modelValue?h(e.modelValue):"",set:l=>{const p=l&&l.length>0?l:null;if(!p){a("update:modelValue",null),a("alterar",null);return}const B=w(p);a("update:modelValue",B),a("alterar",B)}}),m=t.computed(()=>{if(e.min)return h(e.min)}),E=t.computed(()=>{if(e.max)return h(e.max)});return{attrs:f,valor:c,emit:a,minLocal:m,maxLocal:E,tipoInput:y}}}),Ze={class:"eli-data-hora"};function Xe(e,a,f,y,h,w){return t.openBlock(),t.createElementBlock("div",Ze,[t.createVNode(te.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=c=>e.valor=c),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=c=>e.emit("foco")),onBlur:a[2]||(a[2]=c=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const ie=U(Je,[["render",Xe],["__scopeId","data-v-71afabb6"]]);var se=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(se||{});const Qe=t.defineComponent({name:"EliTabela",inheritAttrs:!1,props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),f=t.ref(null),y=t.ref([]),h=t.ref(0);function w(p){return p==null||p===!1?"":p}function c(p){return t.h("div",{class:"eli-tabela eli-tabela--erro",role:"alert"},[t.h("div",{class:"eli-tabela__erro-titulo"},"Erro"),t.h("div",{class:"eli-tabela__erro-mensagem"},p)])}function m(p){return t.h("div",{class:"eli-tabela eli-tabela--vazio"},p??"Nenhum registro encontrado.")}function E(){return t.h("div",{class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},"Carregando...")}async function l(){a.value=!0,f.value=null;try{const p=await e.tabela.resposta();if(p.cod!==se.sucesso){y.value=[],h.value=0,f.value=p.mensagem;return}y.value=p.valor.valores,h.value=p.valor.quantidade}catch(p){y.value=[],h.value=0,f.value=p instanceof Error?p.message:"Erro ao carregar dados."}finally{a.value=!1}}return t.onMounted(l),t.watch(()=>e.tabela,()=>{l()}),()=>{const p=e.tabela;if(a.value)return E();if(f.value)return c(f.value);const B=p.colunas;return y.value.length?t.h("div",{class:"eli-tabela"},[t.h("table",{class:"eli-tabela__table"},[t.h("thead",{class:"eli-tabela__thead"},t.h("tr",{class:"eli-tabela__tr eli-tabela__tr--header"},B.map(I=>t.h("th",{class:"eli-tabela__th",scope:"col"},I.rotulo)))),t.h("tbody",{class:"eli-tabela__tbody"},y.value.map((I,S)=>t.h("tr",{class:"eli-tabela__tr",key:S},B.map((C,b)=>t.h("td",{class:["eli-tabela__td",C.acao?"eli-tabela__td--clicavel":void 0],key:`${S}-${b}`,onClick:C.acao?()=>{var G;return(G=C.acao)==null?void 0:G.call(C)}:void 0},w(C.celula(I)))))))])]):m(p.mensagemVazio)}}});function Ke(e,a,f,y,h,w){return t.openBlock(),t.createElementBlock("div")}const de=U(Qe,[["render",Ke],["__scopeId","data-v-cc67b529"]]),_e={install(e){e.component("EliOlaMundo",oe),e.component("EliBotao",Q),e.component("EliBadge",z),e.component("EliInput",_),e.component("EliCartao",ne),e.component("EliDataHora",ie),e.component("EliTabela",de)}};V.EliBadge=z,V.EliBotao=Q,V.EliCartao=ne,V.EliDataHora=ie,V.EliInput=_,V.EliOlaMundo=oe,V.EliTabela=de,V.default=_e,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts new file mode 100644 index 0000000..a8d5162 --- /dev/null +++ b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts @@ -0,0 +1,17 @@ +import { PropType } from "vue"; +import type { EliTabelaConsulta } from "./types"; +declare const __VLS_export: import("vue").DefineComponent>; + required: true; + }; +}>, () => import("vue").VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>; + 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/celulas/EliCelulaTextoSimples.d.ts b/dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts new file mode 100644 index 0000000..6bcdeaa --- /dev/null +++ b/dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts @@ -0,0 +1,6 @@ +import type { VNodeChild } from "vue"; +export type EliCelulaTextoSimples = { + tipo: "texto-simples"; + texto: string; +}; +export declare const renderEliCelulaTextoSimples: (celula: EliCelulaTextoSimples) => VNodeChild; diff --git a/dist/types/components/eli/EliTabela/index.d.ts b/dist/types/components/eli/EliTabela/index.d.ts new file mode 100644 index 0000000..2befee2 --- /dev/null +++ b/dist/types/components/eli/EliTabela/index.d.ts @@ -0,0 +1,3 @@ +export { default as EliTabela } from "./EliTabela.vue"; +export * from "./types"; +export * from "./celulas/EliCelulaTextoSimples"; diff --git a/dist/types/components/eli/EliTabela/types.d.ts b/dist/types/components/eli/EliTabela/types.d.ts new file mode 100644 index 0000000..80cc67d --- /dev/null +++ b/dist/types/components/eli/EliTabela/types.d.ts @@ -0,0 +1,24 @@ +import type { tipoResposta } from "p-respostas"; +import type { VNodeChild } from "vue"; +export type ComponenteCelula = VNodeChild; +export type EliColuna = { + rotulo: string; + celula: (linha: T) => ComponenteCelula; + acao?: () => void; +}; +export type EliConsultaPaginada = { + valores: T[]; + quantidade: number; +}; +/** + * Estrutura de dados para uma tabela alimentada por uma consulta. + * + * - `colunas`: definição de colunas e como renderizar cada célula + * - `resposta`: função assíncrona que retorna uma resposta padronizada + */ +export type EliTabelaConsulta = { + colunas: EliColuna[]; + resposta: () => Promise>>; + /** Mensagem exibida quando a consulta retorna ok porém sem dados. */ + mensagemVazio?: string; +}; diff --git a/dist/types/index.d.ts b/dist/types/index.d.ts index 4f78cdc..e156cd6 100644 --- a/dist/types/index.d.ts +++ b/dist/types/index.d.ts @@ -5,11 +5,13 @@ import { EliBadge } from "./componentes/indicador"; import { EliInput } from "./componentes/campo"; import { EliCartao } from "./componentes/cartao"; import { EliDataHora } from "./componentes/data_hora"; +import { EliTabela } from "./components/eli/EliTabela"; export { EliOlaMundo }; export { EliBotao }; export { EliBadge }; export { EliInput }; export { EliCartao }; export { EliDataHora }; +export { EliTabela }; declare const EliVue: Plugin; export default EliVue; diff --git a/package.json b/package.json index 5277513..deef5a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.19", + "version": "0.1.22", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", @@ -35,6 +35,8 @@ "vuetify": "^3.11.2" }, "dependencies": { - "dayjs": "^1.11.19" + "dayjs": "^1.11.19", + "lucide-vue-next": "^0.563.0", + "p-respostas": "git+https://git2.idz.one/publico/_respostas.git" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d52d64d..d45f9c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,12 @@ importers: dayjs: specifier: ^1.11.19 version: 1.11.19 + lucide-vue-next: + specifier: ^0.563.0 + version: 0.563.0(vue@3.5.25(typescript@5.9.3)) + p-respostas: + specifier: git+https://git2.idz.one/publico/_respostas.git + version: git+https://git2.idz.one/publico/_respostas.git#8c24d790ace7255404745dcbdf12c5396e8b9843(cross-fetch@4.1.0)(dayjs@1.11.19)(uuid@11.1.0) devDependencies: '@mdi/font': specifier: ^7.4.47 @@ -489,6 +495,9 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} + cross-fetch@4.1.0: + resolution: {integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==} + csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -554,6 +563,11 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + lucide-vue-next@0.563.0: + resolution: {integrity: sha512-zsE/lCKtmaa7bGfhSpN84br1K9YoQ5pCN+2oKWjQQG3Lo6ufUUKBuHSjNFI6RvUevxaajNXb8XwFUKeTXG3sIA==} + peerDependencies: + vue: '>=3.0.1' + magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -575,6 +589,29 @@ packages: node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + p-comuns@git+https://git2.idz.one/publico/_comuns.git#d783fa12940a5b1bcafa5038bd1c49c3f5f9b7fc: + resolution: {commit: d783fa12940a5b1bcafa5038bd1c49c3f5f9b7fc, repo: https://git2.idz.one/publico/_comuns.git, type: git} + version: 0.298.0 + peerDependencies: + cross-fetch: 4.1.0 + dayjs: ^1.11.18 + uuid: ^11.1.0 + zod: 4.1.4 + + p-respostas@git+https://git2.idz.one/publico/_respostas.git#8c24d790ace7255404745dcbdf12c5396e8b9843: + resolution: {commit: 8c24d790ace7255404745dcbdf12c5396e8b9843, repo: https://git2.idz.one/publico/_respostas.git, type: git} + version: 0.56.0 + engines: {node: '>=20'} + path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} @@ -619,6 +656,9 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -631,6 +671,10 @@ packages: resolution: {integrity: sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==} engines: {node: '>=4'} + uuid@11.1.0: + resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} + hasBin: true + vite-plugin-vuetify@2.1.2: resolution: {integrity: sha512-I/wd6QS+DO6lHmuGoi1UTyvvBTQ2KDzQZ9oowJQEJ6OcjWfJnscYXx2ptm6S7fJSASuZT8jGRBL3LV4oS3LpaA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -711,6 +755,15 @@ packages: webpack-plugin-vuetify: optional: true + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + zod@4.1.4: + resolution: {integrity: sha512-2YqJuWkU6IIK9qcE4k1lLLhyZ6zFw7XVRdQGpV97jEIZwTrscUw+DY31Xczd8nwaoksyJUIxCojZXwckJovWxA==} + snapshots: '@babel/helper-string-parser@7.27.1': {} @@ -1042,6 +1095,12 @@ snapshots: dependencies: readdirp: 4.1.2 + cross-fetch@4.1.0: + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + csstype@3.2.3: {} dayjs@1.11.19: {} @@ -1111,6 +1170,10 @@ snapshots: is-number@7.0.0: optional: true + lucide-vue-next@0.563.0(vue@3.5.25(typescript@5.9.3)): + dependencies: + vue: 3.5.25(typescript@5.9.3) + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -1130,6 +1193,26 @@ snapshots: node-addon-api@7.1.1: optional: true + node-fetch@2.7.0: + dependencies: + whatwg-url: 5.0.0 + + p-comuns@git+https://git2.idz.one/publico/_comuns.git#d783fa12940a5b1bcafa5038bd1c49c3f5f9b7fc(cross-fetch@4.1.0)(dayjs@1.11.19)(uuid@11.1.0)(zod@4.1.4): + dependencies: + cross-fetch: 4.1.0 + dayjs: 1.11.19 + uuid: 11.1.0 + zod: 4.1.4 + + p-respostas@git+https://git2.idz.one/publico/_respostas.git#8c24d790ace7255404745dcbdf12c5396e8b9843(cross-fetch@4.1.0)(dayjs@1.11.19)(uuid@11.1.0): + dependencies: + p-comuns: git+https://git2.idz.one/publico/_comuns.git#d783fa12940a5b1bcafa5038bd1c49c3f5f9b7fc(cross-fetch@4.1.0)(dayjs@1.11.19)(uuid@11.1.0)(zod@4.1.4) + zod: 4.1.4 + transitivePeerDependencies: + - cross-fetch + - dayjs + - uuid + path-browserify@1.0.1: {} picocolors@1.1.1: {} @@ -1195,6 +1278,8 @@ snapshots: is-number: 7.0.0 optional: true + tr46@0.0.3: {} + typescript@5.9.3: {} undici-types@7.16.0: @@ -1202,6 +1287,8 @@ snapshots: upath@2.0.1: {} + uuid@11.1.0: {} + vite-plugin-vuetify@2.1.2(vite@6.4.1(@types/node@24.10.1)(sass@1.94.2))(vue@3.5.25(typescript@5.9.3))(vuetify@3.11.2): dependencies: '@vuetify/loader-shared': 2.1.1(vue@3.5.25(typescript@5.9.3))(vuetify@3.11.2) @@ -1250,3 +1337,12 @@ snapshots: optionalDependencies: typescript: 5.9.3 vite-plugin-vuetify: 2.1.2(vite@6.4.1(@types/node@24.10.1)(sass@1.94.2))(vue@3.5.25(typescript@5.9.3))(vuetify@3.11.2) + + webidl-conversions@3.0.1: {} + + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + + zod@4.1.4: {} diff --git a/src/components/eli/EliTabela/EliTabela.vue b/src/components/eli/EliTabela/EliTabela.vue new file mode 100644 index 0000000..8ed6e4f --- /dev/null +++ b/src/components/eli/EliTabela/EliTabela.vue @@ -0,0 +1,616 @@ + + + + + diff --git a/src/components/eli/EliTabela/celulas/EliCelulaTextoSimples.ts b/src/components/eli/EliTabela/celulas/EliCelulaTextoSimples.ts new file mode 100644 index 0000000..32097a9 --- /dev/null +++ b/src/components/eli/EliTabela/celulas/EliCelulaTextoSimples.ts @@ -0,0 +1,7 @@ +import type { VNodeChild } from "vue"; + +export type EliCelulaTextoSimples = { tipo: "texto-simples"; texto: string }; + +export const renderEliCelulaTextoSimples = ( + celula: EliCelulaTextoSimples +): VNodeChild => celula.texto; diff --git a/src/components/eli/EliTabela/index.ts b/src/components/eli/EliTabela/index.ts new file mode 100644 index 0000000..1d0f772 --- /dev/null +++ b/src/components/eli/EliTabela/index.ts @@ -0,0 +1,4 @@ +export { default as EliTabela } from "./EliTabela.vue"; + +export * from "./types"; +export * from "./celulas/EliCelulaTextoSimples"; diff --git a/src/components/eli/EliTabela/types.ts b/src/components/eli/EliTabela/types.ts new file mode 100644 index 0000000..9f0ffa9 --- /dev/null +++ b/src/components/eli/EliTabela/types.ts @@ -0,0 +1,38 @@ +import type { tipoResposta } from "p-respostas"; +import type { LucideIcon } from "lucide-vue-next"; +import type { VNodeChild } from "vue"; + +export type ComponenteCelula = VNodeChild; + +export type EliColuna = { + rotulo: string; + celula: (linha: T) => ComponenteCelula; + acao?: () => void; +}; + +export type EliConsultaPaginada = { + valores: T[]; + quantidade: number; +}; + +export type EliTabelaAcao = { + icone: LucideIcon; + cor: string; + rotulo: string; + acao: (linha: T) => void; + exibir?: boolean | ((linha: T) => Promise | boolean); +}; + +/** + * Estrutura de dados para uma tabela alimentada por uma consulta. + * + * - `colunas`: definição de colunas e como renderizar cada célula + * - `resposta`: função assíncrona que retorna uma resposta padronizada + */ +export type EliTabelaConsulta = { + colunas: EliColuna[]; + resposta: () => Promise>>; + /** Mensagem exibida quando a consulta retorna ok porém sem dados. */ + mensagemVazio?: string; + acoes?: EliTabelaAcao[]; +}; diff --git a/src/index.ts b/src/index.ts index 17cd756..c325638 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import { EliBadge } from "./componentes/indicador"; import { EliInput } from "./componentes/campo"; import { EliCartao } from "./componentes/cartao"; import { EliDataHora } from "./componentes/data_hora"; +import { EliTabela } from "./components/eli/EliTabela"; export { EliOlaMundo }; export { EliBotao }; @@ -12,6 +13,7 @@ export { EliBadge }; export { EliInput }; export { EliCartao }; export { EliDataHora }; +export { EliTabela }; const EliVue: Plugin = { install(app: App) { @@ -21,6 +23,7 @@ const EliVue: Plugin = { app.component("EliInput", EliInput); app.component("EliCartao", EliCartao); app.component("EliDataHora", EliDataHora); + app.component("EliTabela", EliTabela); }, }; diff --git a/src/playground/App.vue b/src/playground/App.vue index 81f0ced..7ece3e4 100644 --- a/src/playground/App.vue +++ b/src/playground/App.vue @@ -8,6 +8,7 @@ Cartão Campo Data e hora + Tabela Demo @@ -18,6 +19,7 @@ + @@ -29,6 +31,7 @@ import IndicadorPlayground from "./indicador.playground.vue"; import CartaoPlayground from "./cartao.playground.vue"; import CampoPlayground from "./campo.playground.vue"; import DataHoraPlayground from "./data_hora.playground.vue"; +import TabelaPlayground from "./tabela.playground.vue"; import OlaMundoPlayground from "./ola_mundo.playground.vue"; export default defineComponent({ @@ -39,6 +42,7 @@ export default defineComponent({ CartaoPlayground, CampoPlayground, DataHoraPlayground, + TabelaPlayground, OlaMundoPlayground, }, data() { @@ -49,6 +53,7 @@ export default defineComponent({ | "cartao" | "campo" | "data_hora" + | "tabela" | "ola_mundo", }; } diff --git a/src/playground/tabela.playground.vue b/src/playground/tabela.playground.vue new file mode 100644 index 0000000..29c1487 --- /dev/null +++ b/src/playground/tabela.playground.vue @@ -0,0 +1,131 @@ + + + + +