adiconado imput de porcentagem
This commit is contained in:
parent
5bfde6ee66
commit
8bb5aea15e
15 changed files with 260 additions and 184 deletions
23
IA.md
23
IA.md
|
|
@ -105,6 +105,27 @@ export default defineComponent({
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Input de porcentagem
|
||||||
|
|
||||||
|
Quando precisar de um campo numérico com sufixo `%`, use `type="porcentagem"`.
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<EliInput v-model="taxa" type="porcentagem" label="Taxa" placeholder="0,00" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, ref } from "vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
setup() {
|
||||||
|
const taxa = ref("");
|
||||||
|
return { taxa };
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
### Data e hora (entrada) com suporte a UTC/Z
|
### Data e hora (entrada) com suporte a UTC/Z
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
|
@ -173,5 +194,3 @@ Atualize este `IA.md` quando houver mudanças em qualquer um destes pontos:
|
||||||
- forma de uso do plugin/export principal
|
- forma de uso do plugin/export principal
|
||||||
- lista de exports públicos (novos componentes, renomes, remoções)
|
- lista de exports públicos (novos componentes, renomes, remoções)
|
||||||
- mudanças de comportamento relevantes para consumo
|
- mudanças de comportamento relevantes para consumo
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
21
README.md
21
README.md
|
|
@ -160,6 +160,27 @@ export default defineComponent({
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### EliInput (porcentagem)
|
||||||
|
|
||||||
|
Use `type="porcentagem"` quando precisar de um campo numérico com sufixo `%` embutido.
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<EliInput v-model="taxa" type="porcentagem" label="Taxa" placeholder="0,00" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, ref } from "vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
setup() {
|
||||||
|
const taxa = ref("");
|
||||||
|
return { taxa };
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
### EliBadge
|
### EliBadge
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
|
|
|
||||||
2
dist/eli-vue.css
vendored
2
dist/eli-vue.css
vendored
|
|
@ -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-2f57f5c8]{width:100%}.checkbox-group[data-v-2f57f5c8]{display:flex;gap:8px;flex-wrap:wrap}.cursor-pointer[data-v-2f57f5c8]{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]{width:100%}
|
||||||
|
|
|
||||||
353
dist/eli-vue.es.js
vendored
353
dist/eli-vue.es.js
vendored
|
|
@ -1,16 +1,16 @@
|
||||||
import { defineComponent as R, createBlock as H, openBlock as k, mergeProps as F, withCtx as D, renderSlot as W, computed as E, ref as C, createElementBlock as G, createCommentVNode as pe, createSlots as ke, createVNode as $, createTextVNode as Q, toDisplayString as $e, Fragment as de, renderList as fe, resolveComponent as te, createElementVNode as ae } from "vue";
|
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 Ee } from "vuetify/components/VBtn";
|
import { VBtn as Ce } from "vuetify/components/VBtn";
|
||||||
import { VBadge as Ce } from "vuetify/components/VBadge";
|
import { VBadge as Ie } from "vuetify/components/VBadge";
|
||||||
import { VCheckbox as Ie } from "vuetify/components/VCheckbox";
|
import { VCheckbox as Oe } from "vuetify/components/VCheckbox";
|
||||||
import { VIcon as Oe } from "vuetify/components/VIcon";
|
import { VIcon as Te } from "vuetify/components/VIcon";
|
||||||
import { VRadio as Te } from "vuetify/components/VRadio";
|
import { VRadio as Ue } from "vuetify/components/VRadio";
|
||||||
import { VRadioGroup as Ue } from "vuetify/components/VRadioGroup";
|
import { VRadioGroup as Ye } from "vuetify/components/VRadioGroup";
|
||||||
import { VSelect as Ye } from "vuetify/components/VSelect";
|
import { VSelect as He } from "vuetify/components/VSelect";
|
||||||
import { VTextField as ye } from "vuetify/components/VTextField";
|
import { VTextField as $e } from "vuetify/components/VTextField";
|
||||||
import { VTextarea as He } from "vuetify/components/VTextarea";
|
import { VTextarea as Ae } from "vuetify/components/VTextarea";
|
||||||
import { VCard as ve, VCardTitle as ge, VCardText as he, VCardActions as be } from "vuetify/components/VCard";
|
import { VCard as ge, VCardTitle as ve, VCardText as he, VCardActions as be } from "vuetify/components/VCard";
|
||||||
import { VContainer as Ae } from "vuetify/components/VGrid";
|
import { VContainer as Pe } from "vuetify/components/VGrid";
|
||||||
const Pe = R({
|
const je = R({
|
||||||
name: "EliBotao",
|
name: "EliBotao",
|
||||||
inheritAttrs: !1,
|
inheritAttrs: !1,
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -37,12 +37,12 @@ const Pe = R({
|
||||||
}
|
}
|
||||||
}), J = (e, t) => {
|
}), J = (e, t) => {
|
||||||
const c = e.__vccOpts || e;
|
const c = e.__vccOpts || e;
|
||||||
for (const [y, v] of t)
|
for (const [$, g] of t)
|
||||||
c[y] = v;
|
c[$] = g;
|
||||||
return c;
|
return c;
|
||||||
};
|
};
|
||||||
function je(e, t, c, y, v, w) {
|
function Ne(e, t, c, $, g, w) {
|
||||||
return k(), H(Ee, F({
|
return B(), H(Ce, F({
|
||||||
color: e.color,
|
color: e.color,
|
||||||
variant: e.variant,
|
variant: e.variant,
|
||||||
size: e.size,
|
size: e.size,
|
||||||
|
|
@ -55,10 +55,10 @@ function je(e, t, c, y, v, w) {
|
||||||
_: 3
|
_: 3
|
||||||
}, 16, ["color", "variant", "size", "disabled", "loading"]);
|
}, 16, ["color", "variant", "size", "disabled", "loading"]);
|
||||||
}
|
}
|
||||||
const Ve = /* @__PURE__ */ J(Pe, [["render", je]]), me = {
|
const Ve = /* @__PURE__ */ J(je, [["render", Ne]]), me = {
|
||||||
suave: "4px",
|
suave: "4px",
|
||||||
pill: "10px"
|
pill: "10px"
|
||||||
}, Ne = R({
|
}, Fe = R({
|
||||||
name: "EliBadge",
|
name: "EliBadge",
|
||||||
inheritAttrs: !1,
|
inheritAttrs: !1,
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -97,14 +97,14 @@ const Ve = /* @__PURE__ */ J(Pe, [["render", je]]), me = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(e) {
|
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), y = 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
|
"--eli-badge-radius": t.value
|
||||||
}));
|
}));
|
||||||
return { showBadge: c, badgeStyle: y };
|
return { showBadge: c, badgeStyle: $ };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
function Fe(e, t, c, y, v, w) {
|
function Le(e, t, c, $, g, w) {
|
||||||
return e.showBadge ? (k(), H(Ce, F({
|
return e.showBadge ? (B(), H(Ie, F({
|
||||||
key: 0,
|
key: 0,
|
||||||
color: e.color
|
color: e.color
|
||||||
}, e.$attrs, {
|
}, e.$attrs, {
|
||||||
|
|
@ -121,37 +121,40 @@ function Fe(e, t, c, y, v, w) {
|
||||||
_: 3
|
_: 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"])) : W(e.$slots, "default", { key: 1 }, void 0, !0);
|
||||||
}
|
}
|
||||||
const le = /* @__PURE__ */ J(Ne, [["render", Fe], ["__scopeId", "data-v-de2fbf2f"]]);
|
const le = /* @__PURE__ */ J(Fe, [["render", Le], ["__scopeId", "data-v-de2fbf2f"]]);
|
||||||
function Le(e) {
|
|
||||||
return e.replace(/\D+/g, "");
|
|
||||||
}
|
|
||||||
function ze(e) {
|
function ze(e) {
|
||||||
const t = Le(e);
|
return e.replace(/\D+/g, "");
|
||||||
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 We(e) {
|
function We(e) {
|
||||||
return e.replace(/\D+/g, "");
|
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) {
|
function Re(e) {
|
||||||
const t = We(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) : "";
|
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 se(e) {
|
||||||
return e.replace(/\D+/g, "");
|
return e.replace(/\D+/g, "");
|
||||||
}
|
}
|
||||||
function Je(e) {
|
function Se(e) {
|
||||||
const t = e.replace(/[^\d,]/g, ""), c = t.split(",");
|
const t = e.replace(/[^\d,]/g, ""), c = t.split(",");
|
||||||
return c.length > 2 ? c[0] + "," + c.slice(1).join("") : t;
|
return c.length > 2 ? c[0] + "," + c.slice(1).join("") : t;
|
||||||
}
|
}
|
||||||
function qe(e) {
|
function qe(e) {
|
||||||
|
return Se(e.replace(/%/g, ""));
|
||||||
|
}
|
||||||
|
function Ze(e) {
|
||||||
const t = se(e);
|
const t = se(e);
|
||||||
return t ? (parseInt(t, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : "";
|
return t ? (parseInt(t, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : "";
|
||||||
}
|
}
|
||||||
function Ze(e) {
|
function Xe(e) {
|
||||||
const t = se(e).slice(0, 8);
|
const t = se(e).slice(0, 8);
|
||||||
return t.length <= 5 ? t : t.replace(/^(\d{5})(\d{1,3})$/, "$1-$2");
|
return t.length <= 5 ? t : t.replace(/^(\d{5})(\d{1,3})$/, "$1-$2");
|
||||||
}
|
}
|
||||||
const Xe = R({
|
const Ge = R({
|
||||||
name: "EliInput",
|
name: "EliInput",
|
||||||
inheritAttrs: !1,
|
inheritAttrs: !1,
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -194,10 +197,10 @@ const Xe = R({
|
||||||
},
|
},
|
||||||
emits: ["update:modelValue", "change", "focus", "blur"],
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
||||||
setup(e, { emit: t, attrs: c }) {
|
setup(e, { emit: t, attrs: c }) {
|
||||||
const y = C(!1), v = C(!1), w = E({
|
const $ = C(!1), g = C(!1), w = E({
|
||||||
get: () => e.modelValue,
|
get: () => e.modelValue,
|
||||||
set: (g) => {
|
set: (h) => {
|
||||||
t("update:modelValue", g), t("change", g);
|
t("update:modelValue", h), t("change", h);
|
||||||
}
|
}
|
||||||
}), d = E(
|
}), d = E(
|
||||||
() => [
|
() => [
|
||||||
|
|
@ -211,54 +214,59 @@ const Xe = R({
|
||||||
"numericoInteiro",
|
"numericoInteiro",
|
||||||
"numericoDecimal",
|
"numericoDecimal",
|
||||||
"numericoMoeda",
|
"numericoMoeda",
|
||||||
|
"porcentagem",
|
||||||
"cep"
|
"cep"
|
||||||
].includes(e.type)
|
].includes(e.type)
|
||||||
), f = E(
|
), f = E(
|
||||||
() => e.type === "password" ? v.value ? "text" : "password" : "text"
|
() => e.type === "password" ? g.value ? "text" : "password" : "text"
|
||||||
), I = E(() => {
|
), I = E(() => {
|
||||||
if (e.type === "telefone") return "tel";
|
if (e.type === "telefone") return "tel";
|
||||||
|
if (e.type === "porcentagem") return "decimal";
|
||||||
if (e.type.startsWith("numerico")) return "numeric";
|
if (e.type.startsWith("numerico")) return "numeric";
|
||||||
}), l = E(
|
}), l = E(
|
||||||
() => e.error ? "error" : y.value ? e.color : void 0
|
() => e.error ? "error" : $.value ? e.color : void 0
|
||||||
);
|
);
|
||||||
function Y(g) {
|
function Y(h) {
|
||||||
const T = g.target;
|
const T = h.target;
|
||||||
let h = T.value;
|
let v = T.value;
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "numericoInteiro":
|
case "numericoInteiro":
|
||||||
h = se(h);
|
v = se(v);
|
||||||
break;
|
break;
|
||||||
case "numericoDecimal":
|
case "numericoDecimal":
|
||||||
h = Je(h);
|
v = Se(v);
|
||||||
break;
|
break;
|
||||||
case "numericoMoeda":
|
case "numericoMoeda":
|
||||||
h = qe(h);
|
v = Ze(v);
|
||||||
|
break;
|
||||||
|
case "porcentagem":
|
||||||
|
v = qe(v);
|
||||||
break;
|
break;
|
||||||
case "telefone":
|
case "telefone":
|
||||||
h = Re(h);
|
v = Je(v);
|
||||||
break;
|
break;
|
||||||
case "cpfCnpj":
|
case "cpfCnpj":
|
||||||
h = ze(h);
|
v = We(v);
|
||||||
break;
|
break;
|
||||||
case "cep":
|
case "cep":
|
||||||
h = Ze(h);
|
v = Xe(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
T.value = h, t("update:modelValue", h), t("change", h);
|
T.value = v, t("update:modelValue", v), t("change", v);
|
||||||
}
|
}
|
||||||
function V() {
|
function V() {
|
||||||
v.value = !v.value;
|
g.value = !g.value;
|
||||||
}
|
}
|
||||||
const L = E(() => (e.options || []).map((g) => {
|
const L = E(() => (e.options || []).map((h) => {
|
||||||
if (g && typeof g == "object" && "value" in g) {
|
if (h && typeof h == "object" && "value" in h) {
|
||||||
const h = g.value;
|
const v = h.value;
|
||||||
return {
|
return {
|
||||||
label: g.label ?? String(h),
|
label: h.label ?? String(v),
|
||||||
value: h,
|
value: v,
|
||||||
disabled: g.disabled
|
disabled: h.disabled
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const T = g;
|
const T = h;
|
||||||
return { label: String(T), value: T };
|
return { label: String(T), value: T };
|
||||||
}));
|
}));
|
||||||
return {
|
return {
|
||||||
|
|
@ -268,7 +276,7 @@ const Xe = R({
|
||||||
inputHtmlType: f,
|
inputHtmlType: f,
|
||||||
inputMode: I,
|
inputMode: I,
|
||||||
internalColor: l,
|
internalColor: l,
|
||||||
showPassword: v,
|
showPassword: g,
|
||||||
togglePassword: V,
|
togglePassword: V,
|
||||||
onInput: Y,
|
onInput: Y,
|
||||||
onFocus: () => t("focus"),
|
onFocus: () => t("focus"),
|
||||||
|
|
@ -276,13 +284,13 @@ const Xe = R({
|
||||||
computedItems: L
|
computedItems: L
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}), Ge = { class: "eli-input" }, Qe = {
|
}), Qe = { class: "eli-input" }, Ke = {
|
||||||
key: 4,
|
key: 4,
|
||||||
class: "checkbox-group"
|
class: "checkbox-group"
|
||||||
};
|
};
|
||||||
function Ke(e, t, c, y, v, w) {
|
function _e(e, t, c, $, g, w) {
|
||||||
return k(), G("div", Ge, [
|
return B(), G("div", Qe, [
|
||||||
e.isTextLike ? (k(), H(ye, F({
|
e.isTextLike ? (B(), H($e, F({
|
||||||
key: 0,
|
key: 0,
|
||||||
modelValue: e.value,
|
modelValue: e.value,
|
||||||
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.value = d),
|
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.value = d),
|
||||||
|
|
@ -298,28 +306,29 @@ function Ke(e, t, c, y, v, w) {
|
||||||
density: e.density,
|
density: e.density,
|
||||||
variant: e.variant,
|
variant: e.variant,
|
||||||
color: e.internalColor,
|
color: e.internalColor,
|
||||||
inputmode: e.inputMode
|
inputmode: e.inputMode,
|
||||||
|
suffix: e.type === "porcentagem" ? "%" : void 0
|
||||||
}, e.attrs, {
|
}, e.attrs, {
|
||||||
onFocus: e.onFocus,
|
onFocus: e.onFocus,
|
||||||
onBlur: e.onBlur,
|
onBlur: e.onBlur,
|
||||||
onInput: e.onInput
|
onInput: e.onInput
|
||||||
}), ke({ _: 2 }, [
|
}), Ee({ _: 2 }, [
|
||||||
e.type === "password" && e.showPasswordToggle ? {
|
e.type === "password" && e.showPasswordToggle ? {
|
||||||
name: "append-inner",
|
name: "append-inner",
|
||||||
fn: D(() => [
|
fn: D(() => [
|
||||||
$(Oe, {
|
y(Te, {
|
||||||
class: "cursor-pointer",
|
class: "cursor-pointer",
|
||||||
onClick: e.togglePassword
|
onClick: e.togglePassword
|
||||||
}, {
|
}, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
Q($e(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1)
|
Q(ye(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1)
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
}, 8, ["onClick"])
|
}, 8, ["onClick"])
|
||||||
]),
|
]),
|
||||||
key: "0"
|
key: "0"
|
||||||
} : void 0
|
} : void 0
|
||||||
]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (k(), H(He, 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(), H(Ae, F({
|
||||||
key: 1,
|
key: 1,
|
||||||
modelValue: e.value,
|
modelValue: e.value,
|
||||||
"onUpdate:modelValue": t[1] || (t[1] = (d) => e.value = d),
|
"onUpdate:modelValue": t[1] || (t[1] = (d) => e.value = d),
|
||||||
|
|
@ -327,7 +336,7 @@ function Ke(e, t, c, y, v, w) {
|
||||||
rows: e.rows,
|
rows: e.rows,
|
||||||
density: e.density,
|
density: e.density,
|
||||||
variant: e.variant
|
variant: e.variant
|
||||||
}, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (k(), H(Ye, F({
|
}, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (B(), H(He, F({
|
||||||
key: 2,
|
key: 2,
|
||||||
modelValue: e.value,
|
modelValue: e.value,
|
||||||
"onUpdate:modelValue": t[2] || (t[2] = (d) => e.value = d),
|
"onUpdate:modelValue": t[2] || (t[2] = (d) => e.value = d),
|
||||||
|
|
@ -347,22 +356,22 @@ function Ke(e, t, c, y, v, w) {
|
||||||
}, e.attrs, {
|
}, e.attrs, {
|
||||||
onFocus: e.onFocus,
|
onFocus: e.onFocus,
|
||||||
onBlur: e.onBlur
|
onBlur: e.onBlur
|
||||||
}), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (k(), H(Ue, {
|
}), 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,
|
key: 3,
|
||||||
modelValue: e.value,
|
modelValue: e.value,
|
||||||
"onUpdate:modelValue": t[3] || (t[3] = (d) => e.value = d),
|
"onUpdate:modelValue": t[3] || (t[3] = (d) => e.value = d),
|
||||||
row: e.row
|
row: e.row
|
||||||
}, {
|
}, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
(k(!0), G(de, null, fe(e.computedItems, (d) => (k(), H(Te, {
|
(B(!0), G(de, null, fe(e.computedItems, (d) => (B(), H(Ue, {
|
||||||
key: String(d.value),
|
key: String(d.value),
|
||||||
label: d.label,
|
label: d.label,
|
||||||
value: d.value
|
value: d.value
|
||||||
}, null, 8, ["label", "value"]))), 128))
|
}, null, 8, ["label", "value"]))), 128))
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
}, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (k(), G("div", Qe, [
|
}, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (B(), G("div", Ke, [
|
||||||
(k(!0), G(de, null, fe(e.computedItems, (d) => (k(), H(Ie, {
|
(B(!0), G(de, null, fe(e.computedItems, (d) => (B(), H(Oe, {
|
||||||
key: String(d.value),
|
key: String(d.value),
|
||||||
modelValue: e.value,
|
modelValue: e.value,
|
||||||
"onUpdate:modelValue": t[4] || (t[4] = (f) => e.value = f),
|
"onUpdate:modelValue": t[4] || (t[4] = (f) => e.value = f),
|
||||||
|
|
@ -373,44 +382,44 @@ function Ke(e, t, c, y, v, w) {
|
||||||
])) : pe("", !0)
|
])) : pe("", !0)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const Se = /* @__PURE__ */ J(Xe, [["render", Ke], ["__scopeId", "data-v-2f57f5c8"]]), _e = R({
|
const Me = /* @__PURE__ */ J(Ge, [["render", _e], ["__scopeId", "data-v-756cb549"]]), xe = R({
|
||||||
name: "EliOlaMundo",
|
name: "EliOlaMundo",
|
||||||
components: {
|
components: {
|
||||||
EliBotao: Ve,
|
EliBotao: Ve,
|
||||||
EliBadge: le,
|
EliBadge: le,
|
||||||
EliInput: Se
|
EliInput: Me
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const e = C(""), t = C([]), c = C(""), y = C(""), v = C(""), w = C(""), d = C(""), f = C(""), I = C(""), l = C(""), Y = C(""), V = C(null), L = C([]);
|
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 {
|
return {
|
||||||
nome: e,
|
nome: e,
|
||||||
email: f,
|
email: f,
|
||||||
documento: Y,
|
documento: Y,
|
||||||
estado: t,
|
estado: t,
|
||||||
telefone: y,
|
telefone: $,
|
||||||
mensagem: I,
|
mensagem: I,
|
||||||
senha: l,
|
senha: l,
|
||||||
cor: V,
|
cor: V,
|
||||||
habilidades: L,
|
habilidades: L,
|
||||||
idade: v,
|
idade: g,
|
||||||
altura: w,
|
altura: w,
|
||||||
cep: c,
|
cep: c,
|
||||||
valor: d
|
valor: d
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}), xe = { class: "grid-example" };
|
}), et = { class: "grid-example" };
|
||||||
function et(e, t, c, y, v, w) {
|
function tt(e, t, c, $, g, w) {
|
||||||
const d = te("EliBadge"), f = te("EliInput"), I = te("EliBotao");
|
const d = te("EliBadge"), f = te("EliInput"), I = te("EliBotao");
|
||||||
return k(), H(Ae, null, {
|
return B(), H(Pe, null, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
$(ve, {
|
y(ge, {
|
||||||
class: "mx-auto",
|
class: "mx-auto",
|
||||||
max_width: "400"
|
max_width: "400"
|
||||||
}, {
|
}, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
$(ge, null, {
|
y(ve, null, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
$(d, {
|
y(d, {
|
||||||
badge: "Novo",
|
badge: "Novo",
|
||||||
"offset-x": "-15",
|
"offset-x": "-15",
|
||||||
location: "right center"
|
location: "right center"
|
||||||
|
|
@ -423,51 +432,51 @@ function et(e, t, c, y, v, w) {
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
}),
|
}),
|
||||||
$(he, null, {
|
y(he, null, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
t[15] || (t[15] = Q(" Este é um componente de exemplo integrado com Vuetify. ", -1)),
|
t[15] || (t[15] = Q(" Este é um componente de exemplo integrado com Vuetify. ", -1)),
|
||||||
ae("div", xe, [
|
ae("div", et, [
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.nome,
|
modelValue: e.nome,
|
||||||
"onUpdate:modelValue": t[0] || (t[0] = (l) => e.nome = l),
|
"onUpdate:modelValue": t[0] || (t[0] = (l) => e.nome = l),
|
||||||
label: "Nome",
|
label: "Nome",
|
||||||
placeholder: "Digite o nome",
|
placeholder: "Digite o nome",
|
||||||
density: "compact"
|
density: "compact"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.idade,
|
modelValue: e.idade,
|
||||||
"onUpdate:modelValue": t[1] || (t[1] = (l) => e.idade = l),
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => e.idade = l),
|
||||||
type: "numericoInteiro",
|
type: "numericoInteiro",
|
||||||
label: "Idade",
|
label: "Idade",
|
||||||
density: "default"
|
density: "default"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.altura,
|
modelValue: e.altura,
|
||||||
"onUpdate:modelValue": t[2] || (t[2] = (l) => e.altura = l),
|
"onUpdate:modelValue": t[2] || (t[2] = (l) => e.altura = l),
|
||||||
type: "numericoDecimal",
|
type: "numericoDecimal",
|
||||||
label: "Altura",
|
label: "Altura",
|
||||||
density: "comfortable"
|
density: "comfortable"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.valor,
|
modelValue: e.valor,
|
||||||
"onUpdate:modelValue": t[3] || (t[3] = (l) => e.valor = l),
|
"onUpdate:modelValue": t[3] || (t[3] = (l) => e.valor = l),
|
||||||
type: "numericoMoeda",
|
type: "numericoMoeda",
|
||||||
label: "Valor"
|
label: "Valor"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.telefone,
|
modelValue: e.telefone,
|
||||||
"onUpdate:modelValue": t[4] || (t[4] = (l) => e.telefone = l),
|
"onUpdate:modelValue": t[4] || (t[4] = (l) => e.telefone = l),
|
||||||
type: "telefone",
|
type: "telefone",
|
||||||
label: "Telefone"
|
label: "Telefone"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.cep,
|
modelValue: e.cep,
|
||||||
"onUpdate:modelValue": t[5] || (t[5] = (l) => e.cep = l),
|
"onUpdate:modelValue": t[5] || (t[5] = (l) => e.cep = l),
|
||||||
type: "cep",
|
type: "cep",
|
||||||
label: "CEP",
|
label: "CEP",
|
||||||
placeholder: "00000-000"
|
placeholder: "00000-000"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "Estado",
|
label: "Estado",
|
||||||
options: [
|
options: [
|
||||||
|
|
@ -478,19 +487,19 @@ function et(e, t, c, y, v, w) {
|
||||||
"onUpdate:modelValue": t[6] || (t[6] = (l) => e.estado = l),
|
"onUpdate:modelValue": t[6] || (t[6] = (l) => e.estado = l),
|
||||||
multiple: ""
|
multiple: ""
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.documento,
|
modelValue: e.documento,
|
||||||
"onUpdate:modelValue": t[7] || (t[7] = (l) => e.documento = l),
|
"onUpdate:modelValue": t[7] || (t[7] = (l) => e.documento = l),
|
||||||
type: "cpfCnpj",
|
type: "cpfCnpj",
|
||||||
label: "CPF / CNPJ"
|
label: "CPF / CNPJ"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.email,
|
modelValue: e.email,
|
||||||
"onUpdate:modelValue": t[8] || (t[8] = (l) => e.email = l),
|
"onUpdate:modelValue": t[8] || (t[8] = (l) => e.email = l),
|
||||||
label: "Email",
|
label: "Email",
|
||||||
placeholder: "email@exemplo.com"
|
placeholder: "email@exemplo.com"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.senha,
|
modelValue: e.senha,
|
||||||
"onUpdate:modelValue": t[9] || (t[9] = (l) => e.senha = l),
|
"onUpdate:modelValue": t[9] || (t[9] = (l) => e.senha = l),
|
||||||
label: "Senha",
|
label: "Senha",
|
||||||
|
|
@ -498,14 +507,14 @@ function et(e, t, c, y, v, w) {
|
||||||
showPasswordToggle: !0,
|
showPasswordToggle: !0,
|
||||||
placeholder: "Digite sua senha"
|
placeholder: "Digite sua senha"
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
type: "textarea",
|
type: "textarea",
|
||||||
modelValue: e.mensagem,
|
modelValue: e.mensagem,
|
||||||
"onUpdate:modelValue": t[10] || (t[10] = (l) => e.mensagem = l),
|
"onUpdate:modelValue": t[10] || (t[10] = (l) => e.mensagem = l),
|
||||||
label: "Mensagem",
|
label: "Mensagem",
|
||||||
rows: 5
|
rows: 5
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
type: "radio",
|
type: "radio",
|
||||||
modelValue: e.cor,
|
modelValue: e.cor,
|
||||||
"onUpdate:modelValue": t[11] || (t[11] = (l) => e.cor = l),
|
"onUpdate:modelValue": t[11] || (t[11] = (l) => e.cor = l),
|
||||||
|
|
@ -515,7 +524,7 @@ function et(e, t, c, y, v, w) {
|
||||||
{ label: "Verde", value: "verde" }
|
{ label: "Verde", value: "verde" }
|
||||||
]
|
]
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
modelValue: e.habilidades,
|
modelValue: e.habilidades,
|
||||||
"onUpdate:modelValue": t[12] || (t[12] = (l) => e.habilidades = l),
|
"onUpdate:modelValue": t[12] || (t[12] = (l) => e.habilidades = l),
|
||||||
|
|
@ -524,7 +533,7 @@ function et(e, t, c, y, v, w) {
|
||||||
{ label: "React", value: "react" }
|
{ label: "React", value: "react" }
|
||||||
]
|
]
|
||||||
}, null, 8, ["modelValue"]),
|
}, null, 8, ["modelValue"]),
|
||||||
$(f, {
|
y(f, {
|
||||||
modelValue: e.nome,
|
modelValue: e.nome,
|
||||||
"onUpdate:modelValue": t[13] || (t[13] = (l) => e.nome = l),
|
"onUpdate:modelValue": t[13] || (t[13] = (l) => e.nome = l),
|
||||||
label: "Nome",
|
label: "Nome",
|
||||||
|
|
@ -535,9 +544,9 @@ function et(e, t, c, y, v, w) {
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
}),
|
}),
|
||||||
$(be, null, {
|
y(be, null, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
$(I, {
|
y(I, {
|
||||||
color: "primary",
|
color: "primary",
|
||||||
variant: "elevated",
|
variant: "elevated",
|
||||||
block: ""
|
block: ""
|
||||||
|
|
@ -557,7 +566,7 @@ function et(e, t, c, y, v, w) {
|
||||||
_: 1
|
_: 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const tt = /* @__PURE__ */ J(_e, [["render", et]]), at = R({
|
const at = /* @__PURE__ */ J(xe, [["render", tt]]), rt = R({
|
||||||
name: "EliCartao",
|
name: "EliCartao",
|
||||||
components: { EliBadge: le },
|
components: { EliBadge: le },
|
||||||
inheritAttrs: !1,
|
inheritAttrs: !1,
|
||||||
|
|
@ -586,7 +595,7 @@ const tt = /* @__PURE__ */ J(_e, [["render", et]]), at = R({
|
||||||
clicar: (e) => !0
|
clicar: (e) => !0
|
||||||
},
|
},
|
||||||
setup(e, { emit: t }) {
|
setup(e, { emit: t }) {
|
||||||
const c = E(() => e.status), y = E(() => {
|
const c = E(() => e.status), $ = E(() => {
|
||||||
switch (e.status) {
|
switch (e.status) {
|
||||||
case "novo":
|
case "novo":
|
||||||
return "primary";
|
return "primary";
|
||||||
|
|
@ -597,34 +606,34 @@ const tt = /* @__PURE__ */ J(_e, [["render", et]]), at = R({
|
||||||
case "cancelado":
|
case "cancelado":
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
}), v = E(() => `eli-cartao--${e.status}`);
|
}), g = E(() => `eli-cartao--${e.status}`);
|
||||||
function w() {
|
function w() {
|
||||||
t("clicar", e.status);
|
t("clicar", e.status);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
rotuloStatus: c,
|
rotuloStatus: c,
|
||||||
corStatus: y,
|
corStatus: $,
|
||||||
classeStatus: v,
|
classeStatus: g,
|
||||||
onClick: w
|
onClick: w
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}), rt = { class: "eli-cartao__titulo-texto" }, nt = { class: "eli-cartao__status" };
|
}), nt = { class: "eli-cartao__titulo-texto" }, ot = { class: "eli-cartao__status" };
|
||||||
function ot(e, t, c, y, v, w) {
|
function lt(e, t, c, $, g, w) {
|
||||||
const d = te("EliBadge");
|
const d = te("EliBadge");
|
||||||
return k(), H(ve, F({
|
return B(), H(ge, F({
|
||||||
class: ["eli-cartao", e.classeStatus],
|
class: ["eli-cartao", e.classeStatus],
|
||||||
variant: e.variant
|
variant: e.variant
|
||||||
}, e.$attrs), {
|
}, e.$attrs), {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
$(ge, { class: "eli-cartao__titulo" }, {
|
y(ve, { class: "eli-cartao__titulo" }, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
ae("div", rt, [
|
ae("div", nt, [
|
||||||
W(e.$slots, "titulo", {}, () => [
|
W(e.$slots, "titulo", {}, () => [
|
||||||
Q($e(e.titulo), 1)
|
Q(ye(e.titulo), 1)
|
||||||
], !0)
|
], !0)
|
||||||
]),
|
]),
|
||||||
ae("div", nt, [
|
ae("div", ot, [
|
||||||
$(d, {
|
y(d, {
|
||||||
badge: e.rotuloStatus,
|
badge: e.rotuloStatus,
|
||||||
radius: "pill",
|
radius: "pill",
|
||||||
color: e.corStatus
|
color: e.corStatus
|
||||||
|
|
@ -638,13 +647,13 @@ function ot(e, t, c, y, v, w) {
|
||||||
]),
|
]),
|
||||||
_: 3
|
_: 3
|
||||||
}),
|
}),
|
||||||
$(he, { class: "eli-cartao__conteudo" }, {
|
y(he, { class: "eli-cartao__conteudo" }, {
|
||||||
default: D(() => [
|
default: D(() => [
|
||||||
W(e.$slots, "default", {}, void 0, !0)
|
W(e.$slots, "default", {}, void 0, !0)
|
||||||
]),
|
]),
|
||||||
_: 3
|
_: 3
|
||||||
}),
|
}),
|
||||||
e.$slots.acoes ? (k(), H(be, {
|
e.$slots.acoes ? (B(), H(be, {
|
||||||
key: 0,
|
key: 0,
|
||||||
class: "eli-cartao__acoes"
|
class: "eli-cartao__acoes"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -657,17 +666,17 @@ function ot(e, t, c, y, v, w) {
|
||||||
_: 3
|
_: 3
|
||||||
}, 16, ["variant", "class"]);
|
}, 16, ["variant", "class"]);
|
||||||
}
|
}
|
||||||
const lt = /* @__PURE__ */ J(at, [["render", ot], ["__scopeId", "data-v-6c492bd9"]]);
|
const st = /* @__PURE__ */ J(rt, [["render", lt], ["__scopeId", "data-v-6c492bd9"]]);
|
||||||
function st(e) {
|
function it(e) {
|
||||||
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
||||||
}
|
}
|
||||||
var re = { exports: {} }, it = re.exports, ce;
|
var re = { exports: {} }, ut = re.exports, ce;
|
||||||
function ut() {
|
function dt() {
|
||||||
return ce || (ce = 1, (function(e, t) {
|
return ce || (ce = 1, (function(e, t) {
|
||||||
(function(c, y) {
|
(function(c, $) {
|
||||||
e.exports = y();
|
e.exports = $();
|
||||||
})(it, (function() {
|
})(ut, (function() {
|
||||||
var c = 1e3, y = 6e4, v = 36e5, w = "millisecond", d = "second", f = "minute", I = "hour", l = "day", Y = "week", V = "month", L = "quarter", g = "year", T = "date", h = "Invalid Date", Me = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, we = /\[([^\]]+)]|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, De = { 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 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;
|
var n = ["th", "st", "nd", "rd"], a = s % 100;
|
||||||
return "[" + s + (n[(a - 20) % 10] || n[a] || n[0]) + "]";
|
return "[" + s + (n[(a - 20) % 10] || n[a] || n[0]) + "]";
|
||||||
} }, ne = function(s, n, a) {
|
} }, ne = function(s, n, a) {
|
||||||
|
|
@ -683,11 +692,11 @@ function ut() {
|
||||||
}, a: function(s) {
|
}, a: function(s) {
|
||||||
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
||||||
}, p: function(s) {
|
}, p: function(s) {
|
||||||
return { M: V, y: g, 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: Y, d: l, D: T, h: I, m: f, s: d, ms: w, Q: L }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
||||||
}, u: function(s) {
|
}, u: function(s) {
|
||||||
return s === void 0;
|
return s === void 0;
|
||||||
} }, q = "en", P = {};
|
} }, q = "en", P = {};
|
||||||
P[q] = De;
|
P[q] = ke;
|
||||||
var ie = "$isDayjsObject", oe = function(s) {
|
var ie = "$isDayjsObject", oe = function(s) {
|
||||||
return s instanceof _ || !(!s || !s[ie]);
|
return s instanceof _ || !(!s || !s[ie]);
|
||||||
}, K = function s(n, a, o) {
|
}, K = function s(n, a, o) {
|
||||||
|
|
@ -723,7 +732,7 @@ function ut() {
|
||||||
if (m.u(r)) return /* @__PURE__ */ new Date();
|
if (m.u(r)) return /* @__PURE__ */ new Date();
|
||||||
if (r instanceof Date) return new Date(r);
|
if (r instanceof Date) return new Date(r);
|
||||||
if (typeof r == "string" && !/Z$/i.test(r)) {
|
if (typeof r == "string" && !/Z$/i.test(r)) {
|
||||||
var u = r.match(Me);
|
var u = r.match(we);
|
||||||
if (u) {
|
if (u) {
|
||||||
var p = u[2] - 1 || 0, b = (u[7] || "0").substring(0, 3);
|
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 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);
|
||||||
|
|
@ -737,7 +746,7 @@ function ut() {
|
||||||
}, n.$utils = function() {
|
}, n.$utils = function() {
|
||||||
return m;
|
return m;
|
||||||
}, n.isValid = function() {
|
}, n.isValid = function() {
|
||||||
return this.$d.toString() !== h;
|
return this.$d.toString() !== v;
|
||||||
}, n.isSame = function(a, o) {
|
}, n.isSame = function(a, o) {
|
||||||
var r = S(a);
|
var r = S(a);
|
||||||
return this.startOf(o) <= r && r <= this.endOf(o);
|
return this.startOf(o) <= r && r <= this.endOf(o);
|
||||||
|
|
@ -757,15 +766,15 @@ function ut() {
|
||||||
return i ? A : A.endOf(l);
|
return i ? A : A.endOf(l);
|
||||||
}, b = function(N, O) {
|
}, 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);
|
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, B = this.$M, U = this.$D, z = "set" + (this.$u ? "UTC" : "");
|
}, M = this.$W, k = this.$M, U = this.$D, z = "set" + (this.$u ? "UTC" : "");
|
||||||
switch (u) {
|
switch (u) {
|
||||||
case g:
|
case h:
|
||||||
return i ? p(1, 0) : p(31, 11);
|
return i ? p(1, 0) : p(31, 11);
|
||||||
case V:
|
case V:
|
||||||
return i ? p(1, B) : p(0, B + 1);
|
return i ? p(1, k) : p(0, k + 1);
|
||||||
case Y:
|
case Y:
|
||||||
var j = this.$locale().weekStart || 0, Z = (M < j ? M + 7 : M) - j;
|
var j = this.$locale().weekStart || 0, Z = (M < j ? M + 7 : M) - j;
|
||||||
return p(i ? U - Z : U + (6 - Z), B);
|
return p(i ? U - Z : U + (6 - Z), k);
|
||||||
case l:
|
case l:
|
||||||
case T:
|
case T:
|
||||||
return b(z + "Hours", 0);
|
return b(z + "Hours", 0);
|
||||||
|
|
@ -781,8 +790,8 @@ function ut() {
|
||||||
}, n.endOf = function(a) {
|
}, n.endOf = function(a) {
|
||||||
return this.startOf(a, !1);
|
return this.startOf(a, !1);
|
||||||
}, n.$set = function(a, o) {
|
}, 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[g] = 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;
|
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 === g) {
|
if (i === V || i === h) {
|
||||||
var M = this.clone().set(T, 1);
|
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;
|
M.$d[p](b), M.init(), this.$d = M.set(T, Math.min(this.$D, M.daysInMonth())).$d;
|
||||||
} else p && this.$d[p](b);
|
} else p && this.$d[p](b);
|
||||||
|
|
@ -794,22 +803,22 @@ function ut() {
|
||||||
}, n.add = function(a, o) {
|
}, n.add = function(a, o) {
|
||||||
var r, i = this;
|
var r, i = this;
|
||||||
a = Number(a);
|
a = Number(a);
|
||||||
var u = m.p(o), p = function(B) {
|
var u = m.p(o), p = function(k) {
|
||||||
var U = S(i);
|
var U = S(i);
|
||||||
return m.w(U.date(U.date() + Math.round(B * a)), 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 === V) return this.set(V, this.$M + a);
|
||||||
if (u === g) return this.set(g, this.$y + a);
|
if (u === h) return this.set(h, this.$y + a);
|
||||||
if (u === l) return p(1);
|
if (u === l) return p(1);
|
||||||
if (u === Y) return p(7);
|
if (u === Y) return p(7);
|
||||||
var b = (r = {}, r[f] = y, r[I] = v, r[d] = c, r)[u] || 1, M = this.$d.getTime() + a * b;
|
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);
|
return m.w(M, this);
|
||||||
}, n.subtract = function(a, o) {
|
}, n.subtract = function(a, o) {
|
||||||
return this.add(-1 * a, o);
|
return this.add(-1 * a, o);
|
||||||
}, n.format = function(a) {
|
}, n.format = function(a) {
|
||||||
var o = this, r = this.$locale();
|
var o = this, r = this.$locale();
|
||||||
if (!this.isValid()) return r.invalidDate || h;
|
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, B = r.weekdays, U = r.months, z = r.meridiem, j = function(O, A, X, x) {
|
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);
|
return O && (O[A] || O(o, i)) || X[A].slice(0, x);
|
||||||
}, Z = function(O) {
|
}, Z = function(O) {
|
||||||
return m.s(p % 12 || 12, O, "0");
|
return m.s(p % 12 || 12, O, "0");
|
||||||
|
|
@ -817,7 +826,7 @@ function ut() {
|
||||||
var x = O < 12 ? "AM" : "PM";
|
var x = O < 12 ? "AM" : "PM";
|
||||||
return X ? x.toLowerCase() : x;
|
return X ? x.toLowerCase() : x;
|
||||||
};
|
};
|
||||||
return i.replace(we, (function(O, A) {
|
return i.replace(De, (function(O, A) {
|
||||||
return A || (function(X) {
|
return A || (function(X) {
|
||||||
switch (X) {
|
switch (X) {
|
||||||
case "YY":
|
case "YY":
|
||||||
|
|
@ -839,11 +848,11 @@ function ut() {
|
||||||
case "d":
|
case "d":
|
||||||
return String(o.$W);
|
return String(o.$W);
|
||||||
case "dd":
|
case "dd":
|
||||||
return j(r.weekdaysMin, o.$W, B, 2);
|
return j(r.weekdaysMin, o.$W, k, 2);
|
||||||
case "ddd":
|
case "ddd":
|
||||||
return j(r.weekdaysShort, o.$W, B, 3);
|
return j(r.weekdaysShort, o.$W, k, 3);
|
||||||
case "dddd":
|
case "dddd":
|
||||||
return B[o.$W];
|
return k[o.$W];
|
||||||
case "H":
|
case "H":
|
||||||
return String(p);
|
return String(p);
|
||||||
case "HH":
|
case "HH":
|
||||||
|
|
@ -875,11 +884,11 @@ function ut() {
|
||||||
}, n.utcOffset = function() {
|
}, n.utcOffset = function() {
|
||||||
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
||||||
}, n.diff = function(a, o, r) {
|
}, n.diff = function(a, o, r) {
|
||||||
var i, u = this, p = m.p(o), b = S(a), M = (b.utcOffset() - this.utcOffset()) * y, B = this - b, U = function() {
|
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);
|
return m.m(u, b);
|
||||||
};
|
};
|
||||||
switch (p) {
|
switch (p) {
|
||||||
case g:
|
case h:
|
||||||
i = U() / 12;
|
i = U() / 12;
|
||||||
break;
|
break;
|
||||||
case V:
|
case V:
|
||||||
|
|
@ -889,22 +898,22 @@ function ut() {
|
||||||
i = U() / 3;
|
i = U() / 3;
|
||||||
break;
|
break;
|
||||||
case Y:
|
case Y:
|
||||||
i = (B - M) / 6048e5;
|
i = (k - M) / 6048e5;
|
||||||
break;
|
break;
|
||||||
case l:
|
case l:
|
||||||
i = (B - M) / 864e5;
|
i = (k - M) / 864e5;
|
||||||
break;
|
break;
|
||||||
case I:
|
case I:
|
||||||
i = B / v;
|
i = k / g;
|
||||||
break;
|
break;
|
||||||
case f:
|
case f:
|
||||||
i = B / y;
|
i = k / $;
|
||||||
break;
|
break;
|
||||||
case d:
|
case d:
|
||||||
i = B / c;
|
i = k / c;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
i = B;
|
i = k;
|
||||||
}
|
}
|
||||||
return r ? i : m.a(i);
|
return r ? i : m.a(i);
|
||||||
}, n.daysInMonth = function() {
|
}, n.daysInMonth = function() {
|
||||||
|
|
@ -927,7 +936,7 @@ function ut() {
|
||||||
return this.$d.toUTCString();
|
return this.$d.toUTCString();
|
||||||
}, s;
|
}, s;
|
||||||
})(), ue = _.prototype;
|
})(), ue = _.prototype;
|
||||||
return S.prototype = ue, [["$ms", w], ["$s", d], ["$m", f], ["$H", I], ["$W", l], ["$M", V], ["$y", g], ["$D", T]].forEach((function(s) {
|
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) {
|
ue[s[1]] = function(n) {
|
||||||
return this.$g(n, s[0], s[1]);
|
return this.$g(n, s[0], s[1]);
|
||||||
};
|
};
|
||||||
|
|
@ -939,8 +948,8 @@ function ut() {
|
||||||
}));
|
}));
|
||||||
})(re)), re.exports;
|
})(re)), re.exports;
|
||||||
}
|
}
|
||||||
var dt = ut();
|
var ft = dt();
|
||||||
const ee = /* @__PURE__ */ st(dt), ft = R({
|
const ee = /* @__PURE__ */ it(ft), mt = R({
|
||||||
name: "EliDataHora",
|
name: "EliDataHora",
|
||||||
inheritAttrs: !1,
|
inheritAttrs: !1,
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -1040,17 +1049,17 @@ const ee = /* @__PURE__ */ st(dt), ft = R({
|
||||||
desfoco: () => !0
|
desfoco: () => !0
|
||||||
},
|
},
|
||||||
setup(e, { emit: t, attrs: c }) {
|
setup(e, { emit: t, attrs: c }) {
|
||||||
const y = E(
|
const $ = E(
|
||||||
() => e.modo === "data" ? "date" : "datetime-local"
|
() => e.modo === "data" ? "date" : "datetime-local"
|
||||||
);
|
);
|
||||||
function v(l) {
|
function g(l) {
|
||||||
return e.modo === "data" ? ee(l).format("YYYY-MM-DD") : ee(l).format("YYYY-MM-DDTHH:mm");
|
return e.modo === "data" ? ee(l).format("YYYY-MM-DD") : ee(l).format("YYYY-MM-DDTHH:mm");
|
||||||
}
|
}
|
||||||
function w(l) {
|
function w(l) {
|
||||||
return e.modo === "data" ? ee(`${l}T00:00`).format() : ee(l).format();
|
return e.modo === "data" ? ee(`${l}T00:00`).format() : ee(l).format();
|
||||||
}
|
}
|
||||||
const d = E({
|
const d = E({
|
||||||
get: () => e.modelValue ? v(e.modelValue) : "",
|
get: () => e.modelValue ? g(e.modelValue) : "",
|
||||||
set: (l) => {
|
set: (l) => {
|
||||||
const Y = l && l.length > 0 ? l : null;
|
const Y = l && l.length > 0 ? l : null;
|
||||||
if (!Y) {
|
if (!Y) {
|
||||||
|
|
@ -1062,17 +1071,17 @@ const ee = /* @__PURE__ */ st(dt), ft = R({
|
||||||
}
|
}
|
||||||
}), f = E(() => {
|
}), f = E(() => {
|
||||||
if (e.min)
|
if (e.min)
|
||||||
return v(e.min);
|
return g(e.min);
|
||||||
}), I = E(() => {
|
}), I = E(() => {
|
||||||
if (e.max)
|
if (e.max)
|
||||||
return v(e.max);
|
return g(e.max);
|
||||||
});
|
});
|
||||||
return { attrs: c, valor: d, emit: t, minLocal: f, maxLocal: I, tipoInput: y };
|
return { attrs: c, valor: d, emit: t, minLocal: f, maxLocal: I, tipoInput: $ };
|
||||||
}
|
}
|
||||||
}), mt = { class: "eli-data-hora" };
|
}), ct = { class: "eli-data-hora" };
|
||||||
function ct(e, t, c, y, v, w) {
|
function pt(e, t, c, $, g, w) {
|
||||||
return k(), G("div", mt, [
|
return B(), G("div", ct, [
|
||||||
$(ye, F({
|
y($e, F({
|
||||||
modelValue: e.valor,
|
modelValue: e.valor,
|
||||||
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.valor = d),
|
"onUpdate:modelValue": t[0] || (t[0] = (d) => e.valor = d),
|
||||||
type: e.tipoInput,
|
type: e.tipoInput,
|
||||||
|
|
@ -1094,17 +1103,17 @@ function ct(e, t, c, y, v, w) {
|
||||||
}), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"])
|
}), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const pt = /* @__PURE__ */ J(ft, [["render", ct], ["__scopeId", "data-v-71afabb6"]]), kt = {
|
const yt = /* @__PURE__ */ J(mt, [["render", pt], ["__scopeId", "data-v-71afabb6"]]), Et = {
|
||||||
install(e) {
|
install(e) {
|
||||||
e.component("EliOlaMundo", tt), e.component("EliBotao", Ve), e.component("EliBadge", le), e.component("EliInput", Se), e.component("EliCartao", lt), e.component("EliDataHora", pt);
|
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 {
|
export {
|
||||||
le as EliBadge,
|
le as EliBadge,
|
||||||
Ve as EliBotao,
|
Ve as EliBotao,
|
||||||
lt as EliCartao,
|
st as EliCartao,
|
||||||
pt as EliDataHora,
|
yt as EliDataHora,
|
||||||
Se as EliInput,
|
Me as EliInput,
|
||||||
tt as EliOlaMundo,
|
at as EliOlaMundo,
|
||||||
kt as default
|
Et as default
|
||||||
};
|
};
|
||||||
|
|
|
||||||
2
dist/eli-vue.umd.js
vendored
2
dist/eli-vue.umd.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -59,7 +59,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
||||||
value: import("vue").WritableComputedRef<CampoValor | CampoValorMultiplo, CampoValor | CampoValorMultiplo>;
|
value: import("vue").WritableComputedRef<CampoValor | CampoValorMultiplo, CampoValor | CampoValorMultiplo>;
|
||||||
isTextLike: import("vue").ComputedRef<boolean>;
|
isTextLike: import("vue").ComputedRef<boolean>;
|
||||||
inputHtmlType: import("vue").ComputedRef<"text" | "password">;
|
inputHtmlType: import("vue").ComputedRef<"text" | "password">;
|
||||||
inputMode: import("vue").ComputedRef<"tel" | "numeric" | undefined>;
|
inputMode: import("vue").ComputedRef<"tel" | "decimal" | "numeric" | undefined>;
|
||||||
internalColor: import("vue").ComputedRef<string | undefined>;
|
internalColor: import("vue").ComputedRef<string | undefined>;
|
||||||
showPassword: import("vue").Ref<boolean, boolean>;
|
showPassword: import("vue").Ref<boolean, boolean>;
|
||||||
togglePassword: () => void;
|
togglePassword: () => void;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
export declare function somenteNumeros(valor: string): string;
|
export declare function somenteNumeros(valor: string): string;
|
||||||
export declare function formatarDecimal(valor: string): string;
|
export declare function formatarDecimal(valor: string): string;
|
||||||
|
/**
|
||||||
|
* Formatação para percentual:
|
||||||
|
* - remove '%' caso venha junto (ex: colar "10%")
|
||||||
|
* - mantém apenas dígitos e vírgula (no máximo uma)
|
||||||
|
*/
|
||||||
|
export declare function formatarPorcentagem(valor: string): string;
|
||||||
export declare function formatarMoeda(valor: string): string;
|
export declare function formatarMoeda(valor: string): string;
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
|
||||||
value: import("vue").WritableComputedRef<import("../../tipos/campo.js").CampoValor | import("../../tipos/campo.js").CampoValorMultiplo, import("../../tipos/campo.js").CampoValor | import("../../tipos/campo.js").CampoValorMultiplo>;
|
value: import("vue").WritableComputedRef<import("../../tipos/campo.js").CampoValor | import("../../tipos/campo.js").CampoValorMultiplo, import("../../tipos/campo.js").CampoValor | import("../../tipos/campo.js").CampoValorMultiplo>;
|
||||||
isTextLike: import("vue").ComputedRef<boolean>;
|
isTextLike: import("vue").ComputedRef<boolean>;
|
||||||
inputHtmlType: import("vue").ComputedRef<"text" | "password">;
|
inputHtmlType: import("vue").ComputedRef<"text" | "password">;
|
||||||
inputMode: import("vue").ComputedRef<"tel" | "numeric" | undefined>;
|
inputMode: import("vue").ComputedRef<"tel" | "decimal" | "numeric" | undefined>;
|
||||||
internalColor: import("vue").ComputedRef<string | undefined>;
|
internalColor: import("vue").ComputedRef<string | undefined>;
|
||||||
showPassword: import("vue").Ref<boolean, boolean>;
|
showPassword: import("vue").Ref<boolean, boolean>;
|
||||||
togglePassword: () => void;
|
togglePassword: () => void;
|
||||||
|
|
|
||||||
2
dist/types/tipos/campo.d.ts
vendored
2
dist/types/tipos/campo.d.ts
vendored
|
|
@ -15,5 +15,5 @@ export type CampoOpcaoBruta<TValor extends CampoValor = CampoValor> = TValor | {
|
||||||
};
|
};
|
||||||
export type CampoVariante = "outlined" | "filled" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined";
|
export type CampoVariante = "outlined" | "filled" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined";
|
||||||
export type CampoDensidade = "default" | "comfortable" | "compact";
|
export type CampoDensidade = "default" | "comfortable" | "compact";
|
||||||
export type CampoTipoNumerico = "numericoInteiro" | "numericoDecimal" | "numericoMoeda";
|
export type CampoTipoNumerico = "numericoInteiro" | "numericoDecimal" | "numericoMoeda" | "porcentagem";
|
||||||
export type CampoTipo = "text" | "password" | "email" | "search" | "url" | "textarea" | "radio" | "checkbox" | "telefone" | "cpfCnpj" | "cep" | "select" | CampoTipoNumerico;
|
export type CampoTipo = "text" | "password" | "email" | "search" | "url" | "textarea" | "radio" | "checkbox" | "telefone" | "cpfCnpj" | "cep" | "select" | CampoTipoNumerico;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "eli-vue",
|
"name": "eli-vue",
|
||||||
"version": "0.1.15",
|
"version": "0.1.19",
|
||||||
"private": false,
|
"private": false,
|
||||||
"main": "./dist/eli-vue.umd.js",
|
"main": "./dist/eli-vue.umd.js",
|
||||||
"module": "./dist/eli-vue.es.js",
|
"module": "./dist/eli-vue.es.js",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
:variant="variant"
|
:variant="variant"
|
||||||
:color="internalColor"
|
:color="internalColor"
|
||||||
:inputmode="inputMode"
|
:inputmode="inputMode"
|
||||||
|
:suffix="type === 'porcentagem' ? '%' : undefined"
|
||||||
v-bind="attrs"
|
v-bind="attrs"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
|
|
@ -110,7 +111,7 @@ import type {
|
||||||
} from "../../tipos";
|
} from "../../tipos";
|
||||||
import { formatarCpfCnpj } from "./utils/cpfCnpj";
|
import { formatarCpfCnpj } from "./utils/cpfCnpj";
|
||||||
import { formatTelefone } from "./utils/telefone";
|
import { formatTelefone } from "./utils/telefone";
|
||||||
import { formatarDecimal, formatarMoeda, somenteNumeros } from "./utils/numerico"
|
import { formatarDecimal, formatarMoeda, formatarPorcentagem, somenteNumeros } from "./utils/numerico"
|
||||||
import { formatarCep } from "./utils/cep";
|
import { formatarCep } from "./utils/cep";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|
@ -182,6 +183,7 @@ export default defineComponent({
|
||||||
"numericoInteiro",
|
"numericoInteiro",
|
||||||
"numericoDecimal",
|
"numericoDecimal",
|
||||||
"numericoMoeda",
|
"numericoMoeda",
|
||||||
|
"porcentagem",
|
||||||
"cep",
|
"cep",
|
||||||
].includes(props.type)
|
].includes(props.type)
|
||||||
);
|
);
|
||||||
|
|
@ -196,6 +198,7 @@ export default defineComponent({
|
||||||
|
|
||||||
const inputMode = computed(() => {
|
const inputMode = computed(() => {
|
||||||
if (props.type === "telefone") return "tel";
|
if (props.type === "telefone") return "tel";
|
||||||
|
if (props.type === "porcentagem") return "decimal";
|
||||||
if (props.type.startsWith("numerico")) return "numeric";
|
if (props.type.startsWith("numerico")) return "numeric";
|
||||||
return undefined;
|
return undefined;
|
||||||
});
|
});
|
||||||
|
|
@ -221,6 +224,10 @@ export default defineComponent({
|
||||||
resultado = formatarMoeda(resultado);
|
resultado = formatarMoeda(resultado);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "porcentagem":
|
||||||
|
resultado = formatarPorcentagem(resultado);
|
||||||
|
break;
|
||||||
|
|
||||||
case "telefone":
|
case "telefone":
|
||||||
resultado = formatTelefone(resultado);
|
resultado = formatTelefone(resultado);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ type Option = { label: string; value: ValorCampo; disabled?: boolean };
|
||||||
|
|
||||||
type InputVariant = 'outlined' | 'filled' | 'plain' | 'solo' | 'solo-filled' | 'solo-inverted' | 'underlined';
|
type InputVariant = 'outlined' | 'filled' | 'plain' | 'solo' | 'solo-filled' | 'solo-inverted' | 'underlined';
|
||||||
type Density = 'default' | 'comfortable' | 'compact';
|
type Density = 'default' | 'comfortable' | 'compact';
|
||||||
type TipoNumerico = 'numericoInteiro' | 'numericoDecimal' | 'numericoMoeda';
|
type TipoNumerico = 'numericoInteiro' | 'numericoDecimal' | 'numericoMoeda' | 'porcentagem';
|
||||||
|
|
||||||
type InputType =
|
type InputType =
|
||||||
| 'text' | 'password' | 'email' | 'search' | 'url' | 'textarea'
|
| 'text' | 'password' | 'email' | 'search' | 'url' | 'textarea'
|
||||||
|
|
@ -103,6 +103,7 @@ type InputType =
|
||||||
* numericoInteiro — remove tudo que não for dígito.
|
* numericoInteiro — remove tudo que não for dígito.
|
||||||
* numericoDecimal — mantém separador decimal (aplica formatarDecimal).
|
* numericoDecimal — mantém separador decimal (aplica formatarDecimal).
|
||||||
* numericoMoeda — formata para moeda conforme util (formatarMoeda).
|
* numericoMoeda — formata para moeda conforme util (formatarMoeda).
|
||||||
|
* porcentagem — aplica formatação decimal e exibe sufixo `%` automaticamente.
|
||||||
* telefone — aplica máscara/format formatTelefone.
|
* telefone — aplica máscara/format formatTelefone.
|
||||||
* cpfCnpj — aplica formatarCpfCnpj.
|
* cpfCnpj — aplica formatarCpfCnpj.
|
||||||
* cep — aplica formatarCep.
|
* cep — aplica formatarCep.
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,15 @@ export function formatarDecimal(valor: string) {
|
||||||
return partes.length > 2 ? partes[0] + "," + partes.slice(1).join("") : limpo;
|
return partes.length > 2 ? partes[0] + "," + partes.slice(1).join("") : limpo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formatação para percentual:
|
||||||
|
* - remove '%' caso venha junto (ex: colar "10%")
|
||||||
|
* - mantém apenas dígitos e vírgula (no máximo uma)
|
||||||
|
*/
|
||||||
|
export function formatarPorcentagem(valor: string) {
|
||||||
|
return formatarDecimal(valor.replace(/%/g, ""));
|
||||||
|
}
|
||||||
|
|
||||||
export function formatarMoeda(valor: string) {
|
export function formatarMoeda(valor: string) {
|
||||||
const numero = somenteNumeros(valor);
|
const numero = somenteNumeros(valor);
|
||||||
if (!numero) return "";
|
if (!numero) return "";
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
<EliInput v-model="idade" type="numericoInteiro" label="Idade" />
|
<EliInput v-model="idade" type="numericoInteiro" label="Idade" />
|
||||||
<EliInput v-model="valor" type="numericoMoeda" label="Valor" />
|
<EliInput v-model="valor" type="numericoMoeda" label="Valor" />
|
||||||
|
<EliInput v-model="taxa" type="porcentagem" label="Taxa" placeholder="0,00" />
|
||||||
<EliInput v-model="cep" type="cep" label="CEP" placeholder="00000-000" />
|
<EliInput v-model="cep" type="cep" label="CEP" placeholder="00000-000" />
|
||||||
|
|
||||||
<EliInput
|
<EliInput
|
||||||
|
|
@ -63,6 +64,7 @@ export default defineComponent({
|
||||||
const documento = ref("");
|
const documento = ref("");
|
||||||
const idade = ref("");
|
const idade = ref("");
|
||||||
const valor = ref("");
|
const valor = ref("");
|
||||||
|
const taxa = ref("");
|
||||||
const cep = ref("");
|
const cep = ref("");
|
||||||
const estado = ref<string[]>([]);
|
const estado = ref<string[]>([]);
|
||||||
const cor = ref<Cor>(null);
|
const cor = ref<Cor>(null);
|
||||||
|
|
@ -76,6 +78,7 @@ export default defineComponent({
|
||||||
documento: documento.value,
|
documento: documento.value,
|
||||||
idade: idade.value,
|
idade: idade.value,
|
||||||
valor: valor.value,
|
valor: valor.value,
|
||||||
|
taxa: taxa.value,
|
||||||
cep: cep.value,
|
cep: cep.value,
|
||||||
estado: estado.value,
|
estado: estado.value,
|
||||||
cor: cor.value,
|
cor: cor.value,
|
||||||
|
|
@ -92,6 +95,7 @@ export default defineComponent({
|
||||||
documento,
|
documento,
|
||||||
idade,
|
idade,
|
||||||
valor,
|
valor,
|
||||||
|
taxa,
|
||||||
cep,
|
cep,
|
||||||
estado,
|
estado,
|
||||||
cor,
|
cor,
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ export type CampoDensidade = "default" | "comfortable" | "compact";
|
||||||
export type CampoTipoNumerico =
|
export type CampoTipoNumerico =
|
||||||
| "numericoInteiro"
|
| "numericoInteiro"
|
||||||
| "numericoDecimal"
|
| "numericoDecimal"
|
||||||
| "numericoMoeda";
|
| "numericoMoeda"
|
||||||
|
| "porcentagem";
|
||||||
|
|
||||||
export type CampoTipo =
|
export type CampoTipo =
|
||||||
| "text"
|
| "text"
|
||||||
|
|
@ -49,4 +50,3 @@ export type CampoTipo =
|
||||||
| "cep"
|
| "cep"
|
||||||
| "select"
|
| "select"
|
||||||
| CampoTipoNumerico;
|
| CampoTipoNumerico;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue