vue-componentes/dist/eli-vue.es.js

1119 lines
36 KiB
JavaScript

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({
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
}
}
}), J = (e, t) => {
const c = e.__vccOpts || e;
for (const [$, g] of t)
c[$] = g;
return c;
};
function Ne(e, t, c, $, g, w) {
return B(), H(Ce, F({
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")
]),
_: 3
}, 16, ["color", "variant", "size", "disabled", "loading"]);
}
const Ve = /* @__PURE__ */ J(je, [["render", Ne]]), me = {
suave: "4px",
pill: "10px"
}, Fe = R({
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 t = E(() => e.radius in me ? me[e.radius] : e.radius), c = E(() => e.dot || e.badge !== void 0 ? e.visible : !1), $ = E(() => ({
"--eli-badge-radius": t.value
}));
return { showBadge: c, badgeStyle: $ };
}
});
function Le(e, t, c, $, g, w) {
return e.showBadge ? (B(), H(Ie, F({
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: D(() => [
W(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);
}
const le = /* @__PURE__ */ J(Fe, [["render", Le], ["__scopeId", "data-v-de2fbf2f"]]);
function ze(e) {
return e.replace(/\D+/g, "");
}
function We(e) {
const t = ze(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) {
return e.replace(/\D+/g, "");
}
function Je(e) {
const t = Re(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) {
return e.replace(/\D+/g, "");
}
function Se(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 Ze(e) {
const t = se(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);
return t.length <= 5 ? t : t.replace(/^(\d{5})(\d{1,3})$/, "$1-$2");
}
const Ge = R({
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: t, attrs: c }) {
const $ = C(!1), g = C(!1), w = E({
get: () => e.modelValue,
set: (h) => {
t("update:modelValue", h), t("change", h);
}
}), d = E(
() => [
"text",
"password",
"email",
"search",
"url",
"telefone",
"cpfCnpj",
"numericoInteiro",
"numericoDecimal",
"numericoMoeda",
"porcentagem",
"cep"
].includes(e.type)
), f = E(
() => e.type === "password" ? g.value ? "text" : "password" : "text"
), I = E(() => {
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
);
function Y(h) {
const T = h.target;
let v = T.value;
switch (e.type) {
case "numericoInteiro":
v = se(v);
break;
case "numericoDecimal":
v = Se(v);
break;
case "numericoMoeda":
v = Ze(v);
break;
case "porcentagem":
v = qe(v);
break;
case "telefone":
v = Je(v);
break;
case "cpfCnpj":
v = We(v);
break;
case "cep":
v = Xe(v);
break;
}
T.value = v, t("update:modelValue", v), t("change", v);
}
function V() {
g.value = !g.value;
}
const L = E(() => (e.options || []).map((h) => {
if (h && typeof h == "object" && "value" in h) {
const v = h.value;
return {
label: h.label ?? String(v),
value: v,
disabled: h.disabled
};
}
const T = h;
return { label: String(T), value: T };
}));
return {
attrs: c,
value: w,
isTextLike: d,
inputHtmlType: f,
inputMode: I,
internalColor: l,
showPassword: g,
togglePassword: V,
onInput: Y,
onFocus: () => t("focus"),
onBlur: () => t("blur"),
computedItems: L
};
}
}), Qe = { class: "eli-input" }, Ke = {
key: 4,
class: "checkbox-group"
};
function _e(e, t, c, $, g, w) {
return B(), G("div", Qe, [
e.isTextLike ? (B(), H($e, F({
key: 0,
modelValue: e.value,
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.value = d),
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
}), Ee({ _: 2 }, [
e.type === "password" && e.showPasswordToggle ? {
name: "append-inner",
fn: D(() => [
y(Te, {
class: "cursor-pointer",
onClick: e.togglePassword
}, {
default: D(() => [
Q(ye(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({
key: 1,
modelValue: e.value,
"onUpdate:modelValue": t[1] || (t[1] = (d) => e.value = d),
label: e.label,
rows: e.rows,
density: e.density,
variant: e.variant
}, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (B(), H(He, F({
key: 2,
modelValue: e.value,
"onUpdate:modelValue": t[2] || (t[2] = (d) => e.value = d),
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" ? (B(), H(Ye, {
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, {
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, {
key: String(d.value),
modelValue: e.value,
"onUpdate:modelValue": t[4] || (t[4] = (f) => e.value = f),
label: d.label,
value: d.value,
density: e.density
}, null, 8, ["modelValue", "label", "value", "density"]))), 128))
])) : pe("", !0)
]);
}
const Me = /* @__PURE__ */ J(Ge, [["render", _e], ["__scopeId", "data-v-756cb549"]]), xe = R({
name: "EliOlaMundo",
components: {
EliBotao: Ve,
EliBadge: le,
EliInput: Me
},
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([]);
return {
nome: e,
email: f,
documento: Y,
estado: t,
telefone: $,
mensagem: I,
senha: l,
cor: V,
habilidades: L,
idade: g,
altura: w,
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, {
class: "mx-auto",
max_width: "400"
}, {
default: D(() => [
y(ve, null, {
default: D(() => [
y(d, {
badge: "Novo",
"offset-x": "-15",
location: "right center"
}, {
default: D(() => [...t[14] || (t[14] = [
Q(" 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, {
modelValue: e.nome,
"onUpdate:modelValue": t[0] || (t[0] = (l) => e.nome = l),
label: "Nome",
placeholder: "Digite o nome",
density: "compact"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.idade,
"onUpdate:modelValue": t[1] || (t[1] = (l) => e.idade = l),
type: "numericoInteiro",
label: "Idade",
density: "default"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.altura,
"onUpdate:modelValue": t[2] || (t[2] = (l) => e.altura = l),
type: "numericoDecimal",
label: "Altura",
density: "comfortable"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.valor,
"onUpdate:modelValue": t[3] || (t[3] = (l) => e.valor = l),
type: "numericoMoeda",
label: "Valor"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.telefone,
"onUpdate:modelValue": t[4] || (t[4] = (l) => e.telefone = l),
type: "telefone",
label: "Telefone"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.cep,
"onUpdate:modelValue": t[5] || (t[5] = (l) => e.cep = l),
type: "cep",
label: "CEP",
placeholder: "00000-000"
}, null, 8, ["modelValue"]),
y(f, {
type: "select",
label: "Estado",
options: [
{ label: "São Paulo", value: "SP" },
{ label: "Rio de Janeiro", value: "RJ" }
],
modelValue: e.estado,
"onUpdate:modelValue": t[6] || (t[6] = (l) => e.estado = l),
multiple: ""
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.documento,
"onUpdate:modelValue": t[7] || (t[7] = (l) => e.documento = l),
type: "cpfCnpj",
label: "CPF / CNPJ"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.email,
"onUpdate:modelValue": t[8] || (t[8] = (l) => e.email = l),
label: "Email",
placeholder: "email@exemplo.com"
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.senha,
"onUpdate:modelValue": t[9] || (t[9] = (l) => e.senha = l),
label: "Senha",
type: "password",
showPasswordToggle: !0,
placeholder: "Digite sua senha"
}, null, 8, ["modelValue"]),
y(f, {
type: "textarea",
modelValue: e.mensagem,
"onUpdate:modelValue": t[10] || (t[10] = (l) => e.mensagem = l),
label: "Mensagem",
rows: 5
}, null, 8, ["modelValue"]),
y(f, {
type: "radio",
modelValue: e.cor,
"onUpdate:modelValue": t[11] || (t[11] = (l) => e.cor = l),
label: "Cor favorita",
options: [
{ label: "Azul", value: "azul" },
{ label: "Verde", value: "verde" }
]
}, null, 8, ["modelValue"]),
y(f, {
type: "checkbox",
modelValue: e.habilidades,
"onUpdate:modelValue": t[12] || (t[12] = (l) => e.habilidades = l),
options: [
{ label: "Vue", value: "vue" },
{ label: "React", value: "react" }
]
}, null, 8, ["modelValue"]),
y(f, {
modelValue: e.nome,
"onUpdate:modelValue": t[13] || (t[13] = (l) => e.nome = l),
label: "Nome",
error: !0,
"error-messages": ["Obrigatório"]
}, null, 8, ["modelValue"])
])
]),
_: 1
}),
y(be, null, {
default: D(() => [
y(I, {
color: "primary",
variant: "elevated",
block: ""
}, {
default: D(() => [...t[16] || (t[16] = [
Q(" Botão Vuetify ", -1)
])]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
});
}
const at = /* @__PURE__ */ J(xe, [["render", tt]]), rt = R({
name: "EliCartao",
components: { EliBadge: le },
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: t }) {
const c = E(() => e.status), $ = E(() => {
switch (e.status) {
case "novo":
return "primary";
case "rascunho":
return "secondary";
case "vendido":
return "success";
case "cancelado":
return "error";
}
}), g = E(() => `eli-cartao--${e.status}`);
function w() {
t("clicar", e.status);
}
return {
rotuloStatus: c,
corStatus: $,
classeStatus: g,
onClick: w
};
}
}), 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({
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)
], !0)
]),
ae("div", ot, [
y(d, {
badge: e.rotuloStatus,
radius: "pill",
color: e.corStatus
}, {
default: D(() => [...t[0] || (t[0] = [
ae("span", null, null, -1)
])]),
_: 1
}, 8, ["badge", "color"])
])
]),
_: 3
}),
y(he, { class: "eli-cartao__conteudo" }, {
default: D(() => [
W(e.$slots, "default", {}, void 0, !0)
]),
_: 3
}),
e.$slots.acoes ? (B(), H(be, {
key: 0,
class: "eli-cartao__acoes"
}, {
default: D(() => [
W(e.$slots, "acoes", {}, void 0, !0)
]),
_: 3
})) : pe("", !0)
]),
_: 3
}, 16, ["variant", "class"]);
}
const st = /* @__PURE__ */ J(rt, [["render", lt], ["__scopeId", "data-v-6c492bd9"]]);
function it(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 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");
}, 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);
}, 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$/, "");
}, 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) {
var r;
if (!n) return q;
if (typeof n == "string") {
var i = n.toLowerCase();
P[i] && (r = i), a && (P[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;
}
return !o && r && (q = r), r || !o && q;
}, S = function(s, n) {
if (oe(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 });
};
var _ = (function() {
function s(a) {
this.$L = K(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[ie] = !0;
}
var n = s.prototype;
return n.parse = function(a) {
this.$d = (function(o) {
var r = o.date, i = o.utc;
if (r === null) return /* @__PURE__ */ new Date(NaN);
if (m.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);
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);
}
}
return new Date(r);
})(a), this.init();
}, n.init = function() {
var a = this.$d;
this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds();
}, n.$utils = function() {
return m;
}, 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);
}, 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" : "");
switch (u) {
case h:
return i ? p(1, 0) : p(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);
case I:
return b(z + "Minutes", 1);
case f:
return b(z + "Seconds", 2);
case d:
return b(z + "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;
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);
return this.init(), this;
}, n.set = function(a, o) {
return this.clone().$set(a, o);
}, n.get = function(a) {
return this[m.p(a)]();
}, n.add = function(a, o) {
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);
};
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);
}, 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;
};
return i.replace(De, (function(O, A) {
return A || (function(X) {
switch (X) {
case "YY":
return String(o.$y).slice(-2);
case "YYYY":
return m.s(o.$y, 4, "0");
case "M":
return M + 1;
case "MM":
return m.s(M + 1, 2, "0");
case "MMM":
return j(r.monthsShort, M, U, 3);
case "MMMM":
return j(U, M);
case "D":
return o.$D;
case "DD":
return m.s(o.$D, 2, "0");
case "d":
return String(o.$W);
case "dd":
return j(r.weekdaysMin, o.$W, k, 2);
case "ddd":
return j(r.weekdaysShort, o.$W, k, 3);
case "dddd":
return k[o.$W];
case "H":
return String(p);
case "HH":
return m.s(p, 2, "0");
case "h":
return Z(1);
case "hh":
return Z(2);
case "a":
return N(p, b, !0);
case "A":
return N(p, b, !1);
case "m":
return String(b);
case "mm":
return m.s(b, 2, "0");
case "s":
return String(o.$s);
case "ss":
return m.s(o.$s, 2, "0");
case "SSS":
return m.s(o.$ms, 3, "0");
case "Z":
return u;
}
return null;
})(O) || 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);
};
switch (p) {
case h:
i = U() / 12;
break;
case V:
i = U();
break;
case L:
i = U() / 3;
break;
case Y:
i = (k - M) / 6048e5;
break;
case l:
i = (k - M) / 864e5;
break;
case I:
i = k / g;
break;
case f:
i = k / $;
break;
case d:
i = k / c;
break;
default:
i = k;
}
return r ? i : m.a(i);
}, n.daysInMonth = function() {
return this.endOf(V).$D;
}, n.$locale = function() {
return P[this.$L];
}, n.locale = function(a, o) {
if (!a) return this.$L;
var r = this.clone(), i = K(a, o, !0);
return i && (r.$L = i), r;
}, n.clone = function() {
return m.w(this.$d, this);
}, n.toDate = function() {
return new Date(this.valueOf());
}, n.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, n.toISOString = function() {
return this.$d.toISOString();
}, 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) {
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;
}));
})(re)), re.exports;
}
var ft = dt();
const ee = /* @__PURE__ */ it(ft), mt = R({
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: t, attrs: c }) {
const $ = E(
() => 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 w(l) {
return e.modo === "data" ? ee(`${l}T00:00`).format() : ee(l).format();
}
const d = E({
get: () => e.modelValue ? g(e.modelValue) : "",
set: (l) => {
const Y = l && l.length > 0 ? l : null;
if (!Y) {
t("update:modelValue", null), t("alterar", null);
return;
}
const V = w(Y);
t("update:modelValue", V), t("alterar", V);
}
}), f = E(() => {
if (e.min)
return g(e.min);
}), I = E(() => {
if (e.max)
return g(e.max);
});
return { attrs: c, valor: d, emit: t, minLocal: f, maxLocal: I, tipoInput: $ };
}
}), ct = { class: "eli-data-hora" };
function pt(e, t, c, $, g, w) {
return B(), G("div", ct, [
y($e, F({
modelValue: e.valor,
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.valor = d),
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: t[1] || (t[1] = (d) => e.emit("foco")),
onBlur: t[2] || (t[2] = (d) => e.emit("desfoco"))
}), 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 = {
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);
}
};
export {
le as EliBadge,
Ve as EliBotao,
st as EliCartao,
yt as EliDataHora,
Me as EliInput,
at as EliOlaMundo,
Et as default
};