vue-componentes/dist/eli-vue.es.js
2026-01-27 14:48:51 -03:00

1841 lines
58 KiB
JavaScript

import { defineComponent as Q, createBlock as J, openBlock as A, mergeProps as te, withCtx as L, renderSlot as re, computed as C, ref as E, createElementBlock as q, createCommentVNode as he, createSlots as Ue, createVNode as _, createTextVNode as de, toDisplayString as pe, Fragment as ve, renderList as ge, resolveComponent as fe, createElementVNode as K, h as g, watch as le, withDirectives as Le, withKeys as Ne, vModelText as je, normalizeClass as He, onMounted as Ye, onBeforeUnmount as ze } from "vue";
import { VBtn as Fe } from "vuetify/components/VBtn";
import { VBadge as qe } from "vuetify/components/VBadge";
import { VCheckbox as Re } from "vuetify/components/VCheckbox";
import { VIcon as We } from "vuetify/components/VIcon";
import { VRadio as Je } from "vuetify/components/VRadio";
import { VRadioGroup as Ze } from "vuetify/components/VRadioGroup";
import { VSelect as Xe } from "vuetify/components/VSelect";
import { VTextField as Ce } from "vuetify/components/VTextField";
import { VTextarea as Ge } from "vuetify/components/VTextarea";
import { VCard as Be, VCardTitle as Ee, VCardText as _e, VCardActions as Pe } from "vuetify/components/VCard";
import { VContainer as Ke } from "vuetify/components/VGrid";
const Qe = Q({
name: "EliBotao",
inheritAttrs: !1,
props: {
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
}
}
}), x = (e, a) => {
const c = e.__vccOpts || e;
for (const [m, p] of a)
c[m] = p;
return c;
};
function xe(e, a, c, m, p, $) {
return A(), J(Fe, te({
color: e.color,
variant: e.variant,
size: e.size,
disabled: e.disabled,
loading: e.loading
}, e.$attrs, { class: "text-none pt-1" }), {
default: L(() => [
re(e.$slots, "default")
]),
_: 3
}, 16, ["color", "variant", "size", "disabled", "loading"]);
}
const Ae = /* @__PURE__ */ x(Qe, [["render", xe]]), we = {
suave: "4px",
pill: "10px"
}, ea = Q({
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
},
/** 🔥 NOVO: controla só o radius */
radius: {
type: String,
default: "suave"
}
},
setup(e) {
const a = C(() => e.radius in we ? we[e.radius] : e.radius), c = C(() => e.dot || e.badge !== void 0 ? e.visible : !1), m = C(() => ({
"--eli-badge-radius": a.value
}));
return { showBadge: c, badgeStyle: m };
}
});
function aa(e, a, c, m, p, $) {
return e.showBadge ? (A(), J(qe, te({
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: L(() => [
re(e.$slots, "default", {}, void 0, !0)
]),
_: 3
}, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : re(e.$slots, "default", { key: 1 }, void 0, !0);
}
const ye = /* @__PURE__ */ x(ea, [["render", aa], ["__scopeId", "data-v-de2fbf2f"]]);
function ta(e) {
return e.replace(/\D+/g, "");
}
function oa(e) {
const a = ta(e);
return a.length <= 11 ? a.replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d{1,2})$/, "$1-$2").slice(0, 14) : a.replace(/^(\d{2})(\d)/, "$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/, "$1.$2.$3").replace(/\.(\d{3})(\d)/, ".$1/$2").replace(/(\d{4})(\d)/, "$1-$2").slice(0, 18);
}
function la(e) {
return e.replace(/\D+/g, "");
}
function ra(e) {
const a = la(e);
return a ? a.length <= 10 ? a.replace(/^(\d{2})(\d)/, "($1) $2").replace(/(\d{4})(\d)/, "$1-$2").slice(0, 14) : a.replace(/^(\d{2})(\d)/, "($1) $2").replace(/(\d{5})(\d)/, "$1-$2").slice(0, 15) : "";
}
function $e(e) {
return e.replace(/\D+/g, "");
}
function Te(e) {
const a = e.replace(/[^\d,]/g, ""), c = a.split(",");
return c.length > 2 ? c[0] + "," + c.slice(1).join("") : a;
}
function na(e) {
return Te(e.replace(/%/g, ""));
}
function ia(e) {
const a = $e(e);
return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : "";
}
function sa(e) {
const a = $e(e).slice(0, 8);
return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2");
}
const ua = Q({
name: "EliInput",
inheritAttrs: !1,
props: {
/**
* Aceita valor simples (text-like) ou lista de valores (checkbox/select multiple).
* O componente não converte tipos automaticamente: mantém o que receber.
*/
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 },
/**
* Para select/radio/checkbox.
* Aceita lista já normalizada ({ label, value }) ou valores primitivos.
*/
options: {
type: Array,
default: () => []
},
clearable: Boolean,
variant: { type: String, default: "outlined" },
density: { type: String, default: "comfortable" },
color: { type: String, default: "primary" },
row: Boolean,
showPasswordToggle: Boolean,
multiple: Boolean,
chips: Boolean
},
emits: ["update:modelValue", "change", "focus", "blur"],
setup(e, { emit: a, attrs: c }) {
const m = E(!1), p = E(!1), $ = C({
get: () => e.modelValue,
set: (M) => {
a("update:modelValue", M), a("change", M);
}
}), r = C(
() => [
"text",
"password",
"email",
"search",
"url",
"telefone",
"cpfCnpj",
"numericoInteiro",
"numericoDecimal",
"numericoMoeda",
"porcentagem",
"cep"
].includes(e.type)
), v = C(
() => e.type === "password" ? p.value ? "text" : "password" : "text"
), V = C(() => {
if (e.type === "telefone") return "tel";
if (e.type === "porcentagem") return "decimal";
if (e.type.startsWith("numerico")) return "numeric";
}), t = C(
() => e.error ? "error" : m.value ? e.color : void 0
);
function B(M) {
const O = M.target;
let w = O.value;
switch (e.type) {
case "numericoInteiro":
w = $e(w);
break;
case "numericoDecimal":
w = Te(w);
break;
case "numericoMoeda":
w = ia(w);
break;
case "porcentagem":
w = na(w);
break;
case "telefone":
w = ra(w);
break;
case "cpfCnpj":
w = oa(w);
break;
case "cep":
w = sa(w);
break;
}
O.value = w, a("update:modelValue", w), a("change", w);
}
function S() {
p.value = !p.value;
}
const H = C(() => (e.options || []).map((M) => {
if (M && typeof M == "object" && "value" in M) {
const w = M.value;
return {
label: M.label ?? String(w),
value: w,
disabled: M.disabled
};
}
const O = M;
return { label: String(O), value: O };
}));
return {
attrs: c,
value: $,
isTextLike: r,
inputHtmlType: v,
inputMode: V,
internalColor: t,
showPassword: p,
togglePassword: S,
onInput: B,
onFocus: () => a("focus"),
onBlur: () => a("blur"),
computedItems: H
};
}
}), da = { class: "eli-input" }, ca = {
key: 4,
class: "checkbox-group"
};
function fa(e, a, c, m, p, $) {
return A(), q("div", da, [
e.isTextLike ? (A(), J(Ce, te({
key: 0,
modelValue: e.value,
"onUpdate:modelValue": a[0] || (a[0] = (r) => e.value = r),
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
}), Ue({ _: 2 }, [
e.type === "password" && e.showPasswordToggle ? {
name: "append-inner",
fn: L(() => [
_(We, {
class: "cursor-pointer",
onClick: e.togglePassword
}, {
default: L(() => [
de(pe(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1)
]),
_: 1
}, 8, ["onClick"])
]),
key: "0"
} : void 0
]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (A(), J(Ge, te({
key: 1,
modelValue: e.value,
"onUpdate:modelValue": a[1] || (a[1] = (r) => e.value = r),
label: e.label,
rows: e.rows,
density: e.density,
variant: e.variant
}, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (A(), J(Xe, te({
key: 2,
modelValue: e.value,
"onUpdate:modelValue": a[2] || (a[2] = (r) => e.value = r),
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" ? (A(), J(Ze, {
key: 3,
modelValue: e.value,
"onUpdate:modelValue": a[3] || (a[3] = (r) => e.value = r),
row: e.row
}, {
default: L(() => [
(A(!0), q(ve, null, ge(e.computedItems, (r) => (A(), J(Je, {
key: String(r.value),
label: r.label,
value: r.value
}, null, 8, ["label", "value"]))), 128))
]),
_: 1
}, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (A(), q("div", ca, [
(A(!0), q(ve, null, ge(e.computedItems, (r) => (A(), J(Re, {
key: String(r.value),
modelValue: e.value,
"onUpdate:modelValue": a[4] || (a[4] = (v) => e.value = v),
label: r.label,
value: r.value,
density: e.density
}, null, 8, ["modelValue", "label", "value", "density"]))), 128))
])) : he("", !0)
]);
}
const Ie = /* @__PURE__ */ x(ua, [["render", fa], ["__scopeId", "data-v-756cb549"]]), ma = Q({
name: "EliOlaMundo",
components: {
EliBotao: Ae,
EliBadge: ye,
EliInput: Ie
},
setup() {
const e = E(""), a = E([]), c = E(""), m = E(""), p = E(""), $ = E(""), r = E(""), v = E(""), V = E(""), t = E(""), B = E(""), S = E(null), H = E([]);
return {
nome: e,
email: v,
documento: B,
estado: a,
telefone: m,
mensagem: V,
senha: t,
cor: S,
habilidades: H,
idade: p,
altura: $,
cep: c,
valor: r
};
}
}), pa = { class: "grid-example" };
function va(e, a, c, m, p, $) {
const r = fe("EliBadge"), v = fe("EliInput"), V = fe("EliBotao");
return A(), J(Ke, null, {
default: L(() => [
_(Be, {
class: "mx-auto",
max_width: "400"
}, {
default: L(() => [
_(Ee, null, {
default: L(() => [
_(r, {
badge: "Novo",
"offset-x": "-15",
location: "right center"
}, {
default: L(() => [...a[14] || (a[14] = [
de(" Olá Mundo! ", -1)
])]),
_: 1
})
]),
_: 1
}),
_(_e, null, {
default: L(() => [
a[15] || (a[15] = de(" Este é um componente de exemplo integrado com Vuetify. ", -1)),
K("div", pa, [
_(v, {
modelValue: e.nome,
"onUpdate:modelValue": a[0] || (a[0] = (t) => e.nome = t),
label: "Nome",
placeholder: "Digite o nome",
density: "compact"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.idade,
"onUpdate:modelValue": a[1] || (a[1] = (t) => e.idade = t),
type: "numericoInteiro",
label: "Idade",
density: "default"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.altura,
"onUpdate:modelValue": a[2] || (a[2] = (t) => e.altura = t),
type: "numericoDecimal",
label: "Altura",
density: "comfortable"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.valor,
"onUpdate:modelValue": a[3] || (a[3] = (t) => e.valor = t),
type: "numericoMoeda",
label: "Valor"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.telefone,
"onUpdate:modelValue": a[4] || (a[4] = (t) => e.telefone = t),
type: "telefone",
label: "Telefone"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.cep,
"onUpdate:modelValue": a[5] || (a[5] = (t) => e.cep = t),
type: "cep",
label: "CEP",
placeholder: "00000-000"
}, null, 8, ["modelValue"]),
_(v, {
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] = (t) => e.estado = t),
multiple: ""
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.documento,
"onUpdate:modelValue": a[7] || (a[7] = (t) => e.documento = t),
type: "cpfCnpj",
label: "CPF / CNPJ"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.email,
"onUpdate:modelValue": a[8] || (a[8] = (t) => e.email = t),
label: "Email",
placeholder: "email@exemplo.com"
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.senha,
"onUpdate:modelValue": a[9] || (a[9] = (t) => e.senha = t),
label: "Senha",
type: "password",
showPasswordToggle: !0,
placeholder: "Digite sua senha"
}, null, 8, ["modelValue"]),
_(v, {
type: "textarea",
modelValue: e.mensagem,
"onUpdate:modelValue": a[10] || (a[10] = (t) => e.mensagem = t),
label: "Mensagem",
rows: 5
}, null, 8, ["modelValue"]),
_(v, {
type: "radio",
modelValue: e.cor,
"onUpdate:modelValue": a[11] || (a[11] = (t) => e.cor = t),
label: "Cor favorita",
options: [
{ label: "Azul", value: "azul" },
{ label: "Verde", value: "verde" }
]
}, null, 8, ["modelValue"]),
_(v, {
type: "checkbox",
modelValue: e.habilidades,
"onUpdate:modelValue": a[12] || (a[12] = (t) => e.habilidades = t),
options: [
{ label: "Vue", value: "vue" },
{ label: "React", value: "react" }
]
}, null, 8, ["modelValue"]),
_(v, {
modelValue: e.nome,
"onUpdate:modelValue": a[13] || (a[13] = (t) => e.nome = t),
label: "Nome",
error: !0,
"error-messages": ["Obrigatório"]
}, null, 8, ["modelValue"])
])
]),
_: 1
}),
_(Pe, null, {
default: L(() => [
_(V, {
color: "primary",
variant: "elevated",
block: ""
}, {
default: L(() => [...a[16] || (a[16] = [
de(" Botão Vuetify ", -1)
])]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
});
}
const ba = /* @__PURE__ */ x(ma, [["render", va]]), ga = Q({
name: "EliCartao",
components: { EliBadge: ye },
inheritAttrs: !1,
props: {
/** Título de fallback caso o slot `titulo` não seja usado. */
titulo: {
type: String,
default: ""
},
/**
* Status semântico do cartão.
* Usado para cor/label e para permitir filtros por status.
*/
status: {
type: String,
required: !0
},
/** Variante visual do v-card (Vuetify). */
variant: {
type: String,
default: "outlined"
}
},
emits: {
/** Emit opcional para padronizar clique no cartão. */
clicar: (e) => !0
},
setup(e, { emit: a }) {
const c = C(() => e.status), m = C(() => {
switch (e.status) {
case "novo":
return "primary";
case "rascunho":
return "secondary";
case "vendido":
return "success";
case "cancelado":
return "error";
}
}), p = C(() => `eli-cartao--${e.status}`);
function $() {
a("clicar", e.status);
}
return {
rotuloStatus: c,
corStatus: m,
classeStatus: p,
onClick: $
};
}
}), ha = { class: "eli-cartao__titulo-texto" }, ya = { class: "eli-cartao__status" };
function $a(e, a, c, m, p, $) {
const r = fe("EliBadge");
return A(), J(Be, te({
class: ["eli-cartao", e.classeStatus],
variant: e.variant
}, e.$attrs), {
default: L(() => [
_(Ee, { class: "eli-cartao__titulo" }, {
default: L(() => [
K("div", ha, [
re(e.$slots, "titulo", {}, () => [
de(pe(e.titulo), 1)
], !0)
]),
K("div", ya, [
_(r, {
badge: e.rotuloStatus,
radius: "pill",
color: e.corStatus
}, {
default: L(() => [...a[0] || (a[0] = [
K("span", null, null, -1)
])]),
_: 1
}, 8, ["badge", "color"])
])
]),
_: 3
}),
_(_e, { class: "eli-cartao__conteudo" }, {
default: L(() => [
re(e.$slots, "default", {}, void 0, !0)
]),
_: 3
}),
e.$slots.acoes ? (A(), J(Pe, {
key: 0,
class: "eli-cartao__acoes"
}, {
default: L(() => [
re(e.$slots, "acoes", {}, void 0, !0)
]),
_: 3
})) : he("", !0)
]),
_: 3
}, 16, ["variant", "class"]);
}
const Va = /* @__PURE__ */ x(ga, [["render", $a], ["__scopeId", "data-v-6c492bd9"]]);
function wa(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var me = { exports: {} }, ka = me.exports, ke;
function Ma() {
return ke || (ke = 1, (function(e, a) {
(function(c, m) {
e.exports = m();
})(ka, (function() {
var c = 1e3, m = 6e4, p = 36e5, $ = "millisecond", r = "second", v = "minute", V = "hour", t = "day", B = "week", S = "month", H = "quarter", M = "year", O = "date", w = "Invalid Date", Z = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, N = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(i) {
var s = ["th", "st", "nd", "rd"], o = i % 100;
return "[" + i + (s[(o - 20) % 10] || s[o] || s[0]) + "]";
} }, ne = function(i, s, o) {
var u = String(i);
return !u || u.length >= s ? i : "" + Array(s + 1 - u.length).join(o) + i;
}, be = { s: ne, z: function(i) {
var s = -i.utcOffset(), o = Math.abs(s), u = Math.floor(o / 60), l = o % 60;
return (s <= 0 ? "+" : "-") + ne(u, 2, "0") + ":" + ne(l, 2, "0");
}, m: function i(s, o) {
if (s.date() < o.date()) return -i(o, s);
var u = 12 * (o.year() - s.year()) + (o.month() - s.month()), l = s.clone().add(u, S), d = o - l < 0, n = s.clone().add(u + (d ? -1 : 1), S);
return +(-(u + (o - l) / (d ? l - n : n - l)) || 0);
}, a: function(i) {
return i < 0 ? Math.ceil(i) || 0 : Math.floor(i);
}, p: function(i) {
return { M: S, y: M, w: B, d: t, D: O, h: V, m: v, s: r, ms: $, Q: H }[i] || String(i || "").toLowerCase().replace(/s$/, "");
}, u: function(i) {
return i === void 0;
} }, ae = "en", G = {};
G[ae] = N;
var ie = "$isDayjsObject", se = function(i) {
return i instanceof z || !(!i || !i[ie]);
}, oe = function i(s, o, u) {
var l;
if (!s) return ae;
if (typeof s == "string") {
var d = s.toLowerCase();
G[d] && (l = d), o && (G[d] = o, l = d);
var n = s.split("-");
if (!l && n.length > 1) return i(n[0]);
} else {
var b = s.name;
G[b] = s, l = b;
}
return !u && l && (ae = l), l || !u && ae;
}, T = function(i, s) {
if (se(i)) return i.clone();
var o = typeof s == "object" ? s : {};
return o.date = i, o.args = arguments, new z(o);
}, k = be;
k.l = oe, k.i = se, k.w = function(i, s) {
return T(i, { locale: s.$L, utc: s.$u, x: s.$x, $offset: s.$offset });
};
var z = (function() {
function i(o) {
this.$L = oe(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[ie] = !0;
}
var s = i.prototype;
return s.parse = function(o) {
this.$d = (function(u) {
var l = u.date, d = u.utc;
if (l === null) return /* @__PURE__ */ new Date(NaN);
if (k.u(l)) return /* @__PURE__ */ new Date();
if (l instanceof Date) return new Date(l);
if (typeof l == "string" && !/Z$/i.test(l)) {
var n = l.match(Z);
if (n) {
var b = n[2] - 1 || 0, h = (n[7] || "0").substring(0, 3);
return d ? new Date(Date.UTC(n[1], b, n[3] || 1, n[4] || 0, n[5] || 0, n[6] || 0, h)) : new Date(n[1], b, n[3] || 1, n[4] || 0, n[5] || 0, n[6] || 0, h);
}
}
return new Date(l);
})(o), this.init();
}, s.init = function() {
var o = this.$d;
this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds();
}, s.$utils = function() {
return k;
}, s.isValid = function() {
return this.$d.toString() !== w;
}, s.isSame = function(o, u) {
var l = T(o);
return this.startOf(u) <= l && l <= this.endOf(u);
}, s.isAfter = function(o, u) {
return T(o) < this.startOf(u);
}, s.isBefore = function(o, u) {
return this.endOf(u) < T(o);
}, s.$g = function(o, u, l) {
return k.u(o) ? this[u] : this.set(l, o);
}, s.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, s.valueOf = function() {
return this.$d.getTime();
}, s.startOf = function(o, u) {
var l = this, d = !!k.u(u) || u, n = k.p(o), b = function(W, U) {
var P = k.w(l.$u ? Date.UTC(l.$y, U, W) : new Date(l.$y, U, W), l);
return d ? P : P.endOf(t);
}, h = function(W, U) {
return k.w(l.toDate()[W].apply(l.toDate("s"), (d ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), l);
}, D = this.$W, y = this.$M, I = this.$D, R = "set" + (this.$u ? "UTC" : "");
switch (n) {
case M:
return d ? b(1, 0) : b(31, 11);
case S:
return d ? b(1, y) : b(0, y + 1);
case B:
var j = this.$locale().weekStart || 0, F = (D < j ? D + 7 : D) - j;
return b(d ? I - F : I + (6 - F), y);
case t:
case O:
return h(R + "Hours", 0);
case V:
return h(R + "Minutes", 1);
case v:
return h(R + "Seconds", 2);
case r:
return h(R + "Milliseconds", 3);
default:
return this.clone();
}
}, s.endOf = function(o) {
return this.startOf(o, !1);
}, s.$set = function(o, u) {
var l, d = k.p(o), n = "set" + (this.$u ? "UTC" : ""), b = (l = {}, l[t] = n + "Date", l[O] = n + "Date", l[S] = n + "Month", l[M] = n + "FullYear", l[V] = n + "Hours", l[v] = n + "Minutes", l[r] = n + "Seconds", l[$] = n + "Milliseconds", l)[d], h = d === t ? this.$D + (u - this.$W) : u;
if (d === S || d === M) {
var D = this.clone().set(O, 1);
D.$d[b](h), D.init(), this.$d = D.set(O, Math.min(this.$D, D.daysInMonth())).$d;
} else b && this.$d[b](h);
return this.init(), this;
}, s.set = function(o, u) {
return this.clone().$set(o, u);
}, s.get = function(o) {
return this[k.p(o)]();
}, s.add = function(o, u) {
var l, d = this;
o = Number(o);
var n = k.p(u), b = function(y) {
var I = T(d);
return k.w(I.date(I.date() + Math.round(y * o)), d);
};
if (n === S) return this.set(S, this.$M + o);
if (n === M) return this.set(M, this.$y + o);
if (n === t) return b(1);
if (n === B) return b(7);
var h = (l = {}, l[v] = m, l[V] = p, l[r] = c, l)[n] || 1, D = this.$d.getTime() + o * h;
return k.w(D, this);
}, s.subtract = function(o, u) {
return this.add(-1 * o, u);
}, s.format = function(o) {
var u = this, l = this.$locale();
if (!this.isValid()) return l.invalidDate || w;
var d = o || "YYYY-MM-DDTHH:mm:ssZ", n = k.z(this), b = this.$H, h = this.$m, D = this.$M, y = l.weekdays, I = l.months, R = l.meridiem, j = function(U, P, X, ee) {
return U && (U[P] || U(u, d)) || X[P].slice(0, ee);
}, F = function(U) {
return k.s(b % 12 || 12, U, "0");
}, W = R || function(U, P, X) {
var ee = U < 12 ? "AM" : "PM";
return X ? ee.toLowerCase() : ee;
};
return d.replace(Y, (function(U, P) {
return P || (function(X) {
switch (X) {
case "YY":
return String(u.$y).slice(-2);
case "YYYY":
return k.s(u.$y, 4, "0");
case "M":
return D + 1;
case "MM":
return k.s(D + 1, 2, "0");
case "MMM":
return j(l.monthsShort, D, I, 3);
case "MMMM":
return j(I, D);
case "D":
return u.$D;
case "DD":
return k.s(u.$D, 2, "0");
case "d":
return String(u.$W);
case "dd":
return j(l.weekdaysMin, u.$W, y, 2);
case "ddd":
return j(l.weekdaysShort, u.$W, y, 3);
case "dddd":
return y[u.$W];
case "H":
return String(b);
case "HH":
return k.s(b, 2, "0");
case "h":
return F(1);
case "hh":
return F(2);
case "a":
return W(b, h, !0);
case "A":
return W(b, h, !1);
case "m":
return String(h);
case "mm":
return k.s(h, 2, "0");
case "s":
return String(u.$s);
case "ss":
return k.s(u.$s, 2, "0");
case "SSS":
return k.s(u.$ms, 3, "0");
case "Z":
return n;
}
return null;
})(U) || n.replace(":", "");
}));
}, s.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, s.diff = function(o, u, l) {
var d, n = this, b = k.p(u), h = T(o), D = (h.utcOffset() - this.utcOffset()) * m, y = this - h, I = function() {
return k.m(n, h);
};
switch (b) {
case M:
d = I() / 12;
break;
case S:
d = I();
break;
case H:
d = I() / 3;
break;
case B:
d = (y - D) / 6048e5;
break;
case t:
d = (y - D) / 864e5;
break;
case V:
d = y / p;
break;
case v:
d = y / m;
break;
case r:
d = y / c;
break;
default:
d = y;
}
return l ? d : k.a(d);
}, s.daysInMonth = function() {
return this.endOf(S).$D;
}, s.$locale = function() {
return G[this.$L];
}, s.locale = function(o, u) {
if (!o) return this.$L;
var l = this.clone(), d = oe(o, u, !0);
return d && (l.$L = d), l;
}, s.clone = function() {
return k.w(this.$d, this);
}, s.toDate = function() {
return new Date(this.valueOf());
}, s.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, s.toISOString = function() {
return this.$d.toISOString();
}, s.toString = function() {
return this.$d.toUTCString();
}, i;
})(), f = z.prototype;
return T.prototype = f, [["$ms", $], ["$s", r], ["$m", v], ["$H", V], ["$W", t], ["$M", S], ["$y", M], ["$D", O]].forEach((function(i) {
f[i[1]] = function(s) {
return this.$g(s, i[0], i[1]);
};
})), T.extend = function(i, s) {
return i.$i || (i(s, z, T), i.$i = !0), T;
}, T.locale = oe, T.isDayjs = se, T.unix = function(i) {
return T(1e3 * i);
}, T.en = G[ae], T.Ls = G, T.p = {}, T;
}));
})(me)), me.exports;
}
var Sa = Ma();
const ce = /* @__PURE__ */ wa(Sa), Da = Q({
name: "EliDataHora",
inheritAttrs: !1,
props: {
/**
* Valor em ISO 8601:
* - com offset (ex.: `2026-01-09T13:15:00-03:00`)
* - ou UTC absoluto (ex.: `2026-01-09T16:15:00Z`)
*/
modelValue: {
type: String,
default: null
},
/**
* Define o tipo de entrada.
* - `dataHora`: usa `datetime-local`
* - `data`: usa `date`
*/
modo: {
type: String,
default: "dataHora"
},
/** Rótulo exibido no v-text-field (Vuetify). */
rotulo: {
type: String,
default: "Data e hora"
},
/** Placeholder do input. */
placeholder: {
type: String,
default: ""
},
/** Desabilita a interação. */
desabilitado: {
type: Boolean,
default: !1
},
/** Se true, mostra ícone para limpar o valor (Vuetify clearable). */
limpavel: {
type: Boolean,
default: !1
},
/** Estado de erro (visual). */
erro: {
type: Boolean,
default: !1
},
/** Mensagens de erro. */
mensagensErro: {
type: [String, Array],
default: () => []
},
/** Texto de apoio. */
dica: {
type: String,
default: ""
},
/** Mantém a dica sempre visível. */
dicaPersistente: {
type: Boolean,
default: !1
},
/** Densidade do campo (Vuetify). */
densidade: {
type: String,
default: "comfortable"
},
/** Variante do v-text-field (Vuetify). */
variante: {
type: String,
default: "outlined"
},
/**
* Valor mínimo permitido.
* ISO 8601 (offset ou `Z`).
*/
min: {
// ISO 8601 (offset ou Z)
type: String,
default: void 0
},
/**
* Valor máximo permitido.
* ISO 8601 (offset ou `Z`).
*/
max: {
// ISO 8601 (offset ou Z)
type: String,
default: void 0
}
},
emits: {
/** v-model padrão. */
"update:modelValue": (e) => !0,
/** Alias para consumidores que querem um evento semântico. */
alterar: (e) => !0,
foco: () => !0,
desfoco: () => !0
},
setup(e, { emit: a, attrs: c }) {
const m = C(
() => e.modo === "data" ? "date" : "datetime-local"
);
function p(t) {
return e.modo === "data" ? ce(t).format("YYYY-MM-DD") : ce(t).format("YYYY-MM-DDTHH:mm");
}
function $(t) {
return e.modo === "data" ? ce(`${t}T00:00`).format() : ce(t).format();
}
const r = C({
get: () => e.modelValue ? p(e.modelValue) : "",
set: (t) => {
const B = t && t.length > 0 ? t : null;
if (!B) {
a("update:modelValue", null), a("alterar", null);
return;
}
const S = $(B);
a("update:modelValue", S), a("alterar", S);
}
}), v = C(() => {
if (e.min)
return p(e.min);
}), V = C(() => {
if (e.max)
return p(e.max);
});
return { attrs: c, valor: r, emit: a, minLocal: v, maxLocal: V, tipoInput: m };
}
}), Ca = { class: "eli-data-hora" };
function Ba(e, a, c, m, p, $) {
return A(), q("div", Ca, [
_(Ce, te({
modelValue: e.valor,
"onUpdate:modelValue": a[0] || (a[0] = (r) => e.valor = r),
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] = (r) => e.emit("foco")),
onBlur: a[2] || (a[2] = (r) => e.emit("desfoco"))
}), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"])
]);
}
const Ea = /* @__PURE__ */ x(Da, [["render", Ba], ["__scopeId", "data-v-71afabb6"]]);
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const _a = (e) => {
for (const a in e)
if (a.startsWith("aria-") || a === "role" || a === "title")
return !0;
return !1;
};
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Me = (e) => e === "";
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Pa = (...e) => e.filter((a, c, m) => !!a && a.trim() !== "" && m.indexOf(a) === c).join(" ").trim();
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Se = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Aa = (e) => e.replace(
/^([A-Z])|[\s-_]+(\w)/g,
(a, c, m) => m ? m.toUpperCase() : c.toLowerCase()
);
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ta = (e) => {
const a = Aa(e);
return a.charAt(0).toUpperCase() + a.slice(1);
};
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
var ue = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": 2,
"stroke-linecap": "round",
"stroke-linejoin": "round"
};
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ia = ({
name: e,
iconNode: a,
absoluteStrokeWidth: c,
"absolute-stroke-width": m,
strokeWidth: p,
"stroke-width": $,
size: r = ue.width,
color: v = ue.stroke,
...V
}, { slots: t }) => g(
"svg",
{
...ue,
...V,
width: r,
height: r,
stroke: v,
"stroke-width": Me(c) || Me(m) || c === !0 || m === !0 ? Number(p || $ || ue["stroke-width"]) * 24 / Number(r) : p || $ || ue["stroke-width"],
class: Pa(
"lucide",
V.class,
...e ? [`lucide-${Se(Ta(e))}-icon`, `lucide-${Se(e)}`] : ["lucide-icon"]
),
...!t.default && !_a(V) && { "aria-hidden": "true" }
},
[...a.map((B) => g(...B)), ...t.default ? [t.default()] : []]
);
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ve = (e, a) => (c, { slots: m, attrs: p }) => g(
Ia,
{
...p,
...c,
iconNode: a,
name: e
},
m
);
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Oa = Ve("arrow-down", [
["path", { d: "M12 5v14", key: "s699le" }],
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
]);
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const De = Ve("arrow-up", [
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
["path", { d: "M12 19V5", key: "x0mq9r" }]
]);
/**
* @license lucide-vue-next v0.563.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Ua = Ve("ellipsis-vertical", [
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
]);
var Oe = ((e) => (e[e.sucesso = 200] = "sucesso", e[e.erroConhecido = 400] = "erroConhecido", e[e.erroPermissao = 401] = "erroPermissao", e[e.erroNaoEncontrado = 404] = "erroNaoEncontrado", e[e.erroDesconhecido = 500] = "erroDesconhecido", e[e.tempoEsgotado = 504] = "tempoEsgotado", e))(Oe || {});
const La = Q({
name: "EliTabelaCaixaDeBusca",
props: {
modelo: {
type: String,
required: !1,
default: ""
}
},
emits: {
buscar(e) {
return typeof e == "string";
}
},
setup(e, { emit: a }) {
const c = E(e.modelo ?? "");
le(
() => e.modelo,
(p) => {
p !== void 0 && p !== c.value && (c.value = p);
}
);
function m() {
a("buscar", c.value.trim());
}
return { texto: c, emitirBusca: m };
}
}), Na = { class: "eli-tabela__busca" }, ja = { class: "eli-tabela__busca-input-wrapper" };
function Ha(e, a, c, m, p, $) {
return A(), q("div", Na, [
K("div", ja, [
Le(K("input", {
id: "eli-tabela-busca",
"onUpdate:modelValue": a[0] || (a[0] = (r) => e.texto = r),
type: "search",
class: "eli-tabela__busca-input",
placeholder: "Digite termos para filtrar",
onKeyup: a[1] || (a[1] = Ne((...r) => e.emitirBusca && e.emitirBusca(...r), ["enter"]))
}, null, 544), [
[je, e.texto]
]),
K("button", {
type: "button",
class: "eli-tabela__busca-botao",
onClick: a[2] || (a[2] = (...r) => e.emitirBusca && e.emitirBusca(...r))
}, " Buscar ")
])
]);
}
const Ya = /* @__PURE__ */ x(La, [["render", Ha], ["__scopeId", "data-v-2aeb8274"]]), za = Q({
name: "EliTabelaPaginacao",
props: {
pagina: {
type: Number,
required: !0
},
totalPaginas: {
type: Number,
required: !0
},
maximoBotoes: {
type: Number,
required: !1
}
},
emits: {
alterar(e) {
return Number.isFinite(e);
}
},
setup(e, { emit: a }) {
const c = C(() => {
const t = e.maximoBotoes;
return typeof t == "number" && t >= 5 ? Math.floor(t) : 7;
}), m = C(() => {
const t = e.totalPaginas, B = e.pagina, S = c.value, H = [], M = (N) => {
H.push({
label: String(N),
pagina: N,
ativo: N === B
});
}, O = () => {
H.push({ label: "…", ehEllipsis: !0 });
};
if (t <= S) {
for (let N = 1; N <= t; N += 1)
M(N);
return H;
}
const w = Math.max(3, S - 2);
let Z = Math.max(2, B - Math.floor(w / 2)), Y = Z + w - 1;
Y >= t && (Y = t - 1, Z = Y - w + 1), M(1), Z > 2 && O();
for (let N = Z; N <= Y; N += 1)
M(N);
return Y < t - 1 && O(), M(t), H;
});
function p(t) {
if (!t)
return;
const B = Math.min(Math.max(1, t), e.totalPaginas);
B !== e.pagina && a("alterar", B);
}
const $ = C(() => e.pagina <= 1), r = C(() => e.pagina >= e.totalPaginas), v = C(() => e.pagina), V = C(() => e.totalPaginas);
return {
botoes: m,
irParaPagina: p,
anteriorDesabilitado: $,
proximaDesabilitada: r,
paginaAtual: v,
totalPaginasExibidas: V
};
}
}), Fa = {
key: 0,
class: "eli-tabela__paginacao",
role: "navigation",
"aria-label": "Paginação de resultados"
}, qa = ["disabled"], Ra = {
key: 0,
class: "eli-tabela__pagina-ellipsis",
"aria-hidden": "true"
}, Wa = ["disabled", "aria-current", "aria-label", "onClick"], Ja = ["disabled"];
function Za(e, a, c, m, p, $) {
return e.totalPaginasExibidas > 1 ? (A(), q("nav", Fa, [
K("button", {
type: "button",
class: "eli-tabela__pagina-botao",
disabled: e.anteriorDesabilitado,
"aria-label": "Página anterior",
onClick: a[0] || (a[0] = (r) => e.irParaPagina(e.paginaAtual - 1))
}, " << ", 8, qa),
(A(!0), q(ve, null, ge(e.botoes, (r, v) => (A(), q(ve, {
key: `${r.label}-${v}`
}, [
r.ehEllipsis ? (A(), q("span", Ra, pe(r.label), 1)) : (A(), q("button", {
key: 1,
type: "button",
class: He(["eli-tabela__pagina-botao", r.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]),
disabled: r.ativo,
"aria-current": r.ativo ? "page" : void 0,
"aria-label": `Ir para página ${r.label}`,
onClick: (V) => e.irParaPagina(r.pagina)
}, pe(r.label), 11, Wa))
], 64))), 128)),
K("button", {
type: "button",
class: "eli-tabela__pagina-botao",
disabled: e.proximaDesabilitada,
"aria-label": "Próxima página",
onClick: a[1] || (a[1] = (r) => e.irParaPagina(e.paginaAtual + 1))
}, " >> ", 8, Ja)
])) : he("", !0);
}
const Xa = /* @__PURE__ */ x(za, [["render", Za], ["__scopeId", "data-v-59d12455"]]), Ga = Q({
name: "EliTabela",
inheritAttrs: !1,
props: {
tabela: {
// Observação: este componente é “generic-friendly”.
// Usamos `any` aqui para permitir passar `EliTabelaConsulta<T>` de qualquer T
// sem brigar com invariância do TS (por causa do callback `celula(linha: T)`).
type: Object,
required: !0
}
},
setup(e) {
const a = E(!1), c = E(null), m = E([]), p = E(0), $ = E([]), r = E(null), v = /* @__PURE__ */ new Map(), V = E(""), t = E(1), B = E(null), S = E("asc"), H = C(() => !!e.tabela.mostrarCaixaDeBusca), M = C(() => e.tabela.acoesTabela ?? []), O = C(() => M.value.length > 0), w = C(() => {
const f = e.tabela.registros_por_consulta;
return typeof f == "number" && f > 0 ? Math.floor(f) : 10;
}), Z = C(() => {
const f = w.value;
if (!f || f <= 0)
return 1;
const i = p.value;
return i ? Math.max(1, Math.ceil(i / f)) : 1;
});
let Y = 0;
function N(f, i) {
i ? v.set(f, i) : v.delete(f);
}
function ne(f) {
return (i) => {
i instanceof HTMLElement ? N(f, i) : N(f, null);
};
}
function be(f) {
f && (B.value === f ? (S.value = S.value === "asc" ? "desc" : "asc", z()) : (B.value = f, S.value = "asc", t.value !== 1 ? t.value = 1 : z()));
}
function ae(f) {
V.value !== f && (V.value = f, t.value !== 1 ? t.value = 1 : z());
}
function G(f) {
const i = Math.min(Math.max(1, f), Z.value);
i !== t.value && (t.value = i);
}
function ie(f) {
if (r.value === null)
return;
const i = v.get(r.value);
i && i.contains(f.target) || (r.value = null);
}
function se(f) {
return f == null || f === !1 ? "" : f;
}
function oe(f) {
return g(
"div",
{
class: "eli-tabela eli-tabela--erro",
role: "alert"
},
[
g("div", { class: "eli-tabela__erro-titulo" }, "Erro"),
g("div", { class: "eli-tabela__erro-mensagem" }, f)
]
);
}
function T(f) {
return g(
"div",
{
class: "eli-tabela eli-tabela--vazio"
},
f ?? "Nenhum registro encontrado."
);
}
function k() {
return g(
"div",
{
class: "eli-tabela eli-tabela--carregando",
"aria-busy": "true"
},
"Carregando..."
);
}
async function z() {
var u, l;
const f = ++Y;
a.value = !0, c.value = null, $.value = [], r.value = null, v.clear();
const i = Math.max(1, w.value), o = {
offSet: (t.value - 1) * i,
limit: i
};
V.value && (o.texto_busca = V.value), B.value && (o.coluna_ordem = B.value, o.direcao_ordem = S.value);
try {
const d = e.tabela, n = await d.consulta(o);
if (f !== Y)
return;
if (n.cod !== Oe.sucesso) {
m.value = [], p.value = 0, c.value = n.mensagem;
return;
}
const b = ((u = n.valor) == null ? void 0 : u.valores) ?? [], h = ((l = n.valor) == null ? void 0 : l.quantidade) ?? b.length;
m.value = b, p.value = h;
const D = Math.max(
1,
Math.ceil((h || 0) / i)
);
if (t.value > D) {
t.value = D;
return;
}
const y = d.acoesLinha ?? [];
if (!y.length) {
$.value = [];
return;
}
const I = b.map(
() => y.map((j) => j.exibir === void 0 ? !0 : typeof j.exibir == "boolean" ? j.exibir : !1)
);
$.value = I;
const R = await Promise.all(
b.map(
async (j) => Promise.all(
y.map(async (F) => {
if (F.exibir === void 0)
return !0;
if (typeof F.exibir == "boolean")
return F.exibir;
try {
const W = F.exibir(j);
return !!await Promise.resolve(W);
} catch {
return !1;
}
})
)
)
);
f === Y && ($.value = R);
} catch (d) {
if (f !== Y)
return;
m.value = [], p.value = 0, c.value = d instanceof Error ? d.message : "Erro ao carregar dados.";
} finally {
f === Y && (a.value = !1);
}
}
return Ye(() => {
document.addEventListener("click", ie), z();
}), le(
() => e.tabela.mostrarCaixaDeBusca,
(f) => {
!f && V.value && (V.value = "", t.value !== 1 ? t.value = 1 : z());
}
), le(t, (f, i) => {
f !== i && z();
}), ze(() => {
document.removeEventListener("click", ie), v.clear();
}), le(
() => e.tabela,
() => {
r.value = null, v.clear(), B.value = null, S.value = "asc", V.value = "", t.value !== 1 ? t.value = 1 : z();
}
), le(
() => e.tabela.registros_por_consulta,
() => {
t.value !== 1 ? t.value = 1 : z();
}
), le(m, () => {
r.value = null, v.clear();
}), () => {
const f = e.tabela;
if (a.value)
return k();
if (c.value)
return oe(c.value);
const i = f.colunas, s = f.acoesLinha ?? [], o = s.length > 0;
if (!m.value.length)
return T(f.mensagemVazio);
const u = i.map((d) => {
const n = d.coluna_ordem !== void 0 ? d.coluna_ordem : void 0, b = !!n, h = b && B.value === n, D = b ? h ? g(S.value === "asc" ? De : Oa, {
class: "eli-tabela__th-icone",
size: 16,
strokeWidth: 2,
"aria-hidden": "true"
}) : g(De, {
class: "eli-tabela__th-icone eli-tabela__th-icone--oculto",
size: 16,
strokeWidth: 2,
"aria-hidden": "true"
}) : null, y = b ? g(
"button",
{
type: "button",
class: [
"eli-tabela__th-botao",
h ? "eli-tabela__th-botao--ativo" : void 0
],
onClick: () => be(n)
},
[
g("span", { class: "eli-tabela__th-texto" }, d.rotulo),
D
]
) : g("span", { class: "eli-tabela__th-label" }, d.rotulo);
return g(
"th",
{
class: [
"eli-tabela__th",
b ? "eli-tabela__th--ordenavel" : void 0
],
scope: "col"
},
y
);
});
o && u.push(
g(
"th",
{ class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" },
"Ações"
)
);
const l = [];
if (H.value || O.value) {
const d = M.value.map(
(n, b) => g(
"button",
{
key: `${n.rotulo}-${b}`,
type: "button",
class: "eli-tabela__acoes-cabecalho-botao",
style: n.cor ? { backgroundColor: n.cor } : void 0,
onClick: n.acao
},
[
n.icone ? g(n.icone, {
class: "eli-tabela__acoes-cabecalho-icone",
size: 16,
strokeWidth: 2
}) : null,
g("span", { class: "eli-tabela__acoes-cabecalho-rotulo" }, n.rotulo)
]
)
);
l.push(
g("div", { class: "eli-tabela__cabecalho" }, [
H.value ? g(Ya, {
modelo: V.value,
onBuscar: ae
}) : null,
O.value ? g("div", { class: "eli-tabela__acoes-cabecalho" }, d) : null
])
);
}
return l.push(
g("table", { class: "eli-tabela__table" }, [
g(
"thead",
{ class: "eli-tabela__thead" },
g(
"tr",
{ class: "eli-tabela__tr eli-tabela__tr--header" },
u
)
),
g(
"tbody",
{ class: "eli-tabela__tbody" },
m.value.map((d, n) => {
const b = i.map(
(h, D) => g(
"td",
{
class: [
"eli-tabela__td",
h.acao ? "eli-tabela__td--clicavel" : void 0
],
key: `${n}-${D}`,
onClick: h.acao ? () => {
var y;
return (y = h.acao) == null ? void 0 : y.call(h);
} : void 0
},
se(h.celula(d))
)
);
if (o) {
const h = $.value[n] ?? [], D = s.map((P, X) => {
const ee = P.exibir === void 0 ? !0 : typeof P.exibir == "boolean" ? P.exibir : !1;
return {
acao: P,
indice: X,
visivel: h[X] ?? ee
};
}).filter((P) => P.visivel), y = D.length > 0;
!y && r.value === n && (r.value = null);
const I = r.value === n, R = `eli-tabela-acoes-toggle-${n}`, j = `eli-tabela-acoes-menu-${n}`, F = g(
"button",
{
id: R,
class: "eli-tabela__acoes-toggle",
type: "button",
disabled: !y,
onClick: (P) => {
P.stopPropagation(), y && (r.value = I ? null : n);
},
"aria-haspopup": "menu",
"aria-expanded": I ? "true" : "false",
"aria-controls": y ? j : void 0,
"aria-label": y ? "Ações da linha" : "Nenhuma ação disponível",
title: y ? "Ações" : "Nenhuma ação disponível"
},
[
g(Ua, {
class: "eli-tabela__acoes-toggle-icone",
size: 18,
strokeWidth: 2
})
]
), W = I && y ? g(
"ul",
{
id: j,
class: "eli-tabela__acoes-menu",
role: "menu",
"aria-labelledby": R
},
D.map(
({ acao: P, indice: X }) => g(
"li",
{
key: `acao-${X}`,
class: "eli-tabela__acoes-item",
role: "none"
},
g(
"button",
{
type: "button",
class: "eli-tabela__acoes-item-botao",
style: {
color: P.cor
},
onClick: (ee) => {
ee.stopPropagation(), r.value = null, P.acao(d);
},
role: "menuitem",
"aria-label": P.rotulo,
title: P.rotulo
},
[
g(P.icone, {
class: "eli-tabela__acoes-item-icone",
size: 16,
strokeWidth: 2
}),
g(
"span",
{ class: "eli-tabela__acoes-item-texto" },
P.rotulo
)
]
)
)
)
) : null, U = ["eli-tabela__acoes-container"];
I && U.push("eli-tabela__acoes-container--aberto"), b.push(
g(
"td",
{
class: ["eli-tabela__td", "eli-tabela__td--acoes"],
key: `${n}-acoes`
},
g(
"div",
{
class: U,
ref: ne(n)
},
[F, W]
)
)
);
}
return g(
"tr",
{ class: "eli-tabela__tr", key: n },
b
);
})
)
])
), Z.value > 1 && p.value > 0 && l.push(
g(Xa, {
pagina: t.value,
totalPaginas: Z.value,
maximoBotoes: e.tabela.maximo_botoes_paginacao,
onAlterar: (d) => {
G(d);
}
})
), g(
"div",
{
class: "eli-tabela"
},
l
);
};
}
});
function Ka(e, a, c, m, p, $) {
return A(), q("div");
}
const Qa = /* @__PURE__ */ x(Ga, [["render", Ka], ["__scopeId", "data-v-c6b8c95b"]]), ct = {
install(e) {
e.component("EliOlaMundo", ba), e.component("EliBotao", Ae), e.component("EliBadge", ye), e.component("EliInput", Ie), e.component("EliCartao", Va), e.component("EliDataHora", Ea), e.component("EliTabela", Qa);
}
};
export {
ye as EliBadge,
Ae as EliBotao,
Va as EliCartao,
Ea as EliDataHora,
Ie as EliInput,
ba as EliOlaMundo,
Qa as EliTabela,
ct as default
};