@thibezer/ui-components-kit 2.17.1 → 2.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/camadas.cjs +80 -83
- package/dist/camadas.js +1131 -869
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-atualizacao-incremental.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-colecao.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +34 -0
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +2 -1
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +3 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +1 -0
- package/dist/custom-elements.json +4531 -4079
- package/dist/tipos-elementos.d.ts +3 -0
- package/dist/tipos-vue.d.ts +3 -0
- package/package.json +1 -1
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/gerencigeo-canvas/layer_defaults.d.ts +0 -3
- package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +0 -6
- package/dist/gerencigeo-canvas/layer_state_ops.d.ts +0 -6
- package/dist/leaflet-DcO7uRC-.cjs +0 -1
- package/dist/leaflet-PPDKB6Dd.js +0 -69
- package/dist/motor-BCWqlv3e.cjs +0 -1
- package/dist/motor-CXjQjVba.js +0 -1386
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-badge-1UU8vT-b.js +0 -198
- package/dist/ui-badge-B5J_c5P5.js +0 -197
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-badge-CKKKPdt8.cjs +0 -28
- package/dist/ui-badge-DC4y6Dik.cjs +0 -28
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-D24oXySA.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-botao-Dsj08jjw.js +0 -165
- package/dist/ui-botao-OGJV6Vfk.js +0 -165
- package/dist/ui-botao-bU_bf6SU.js +0 -166
- package/dist/ui-botao-psS1juof.cjs +0 -12
- package/dist/ui-botao-xTbH5mpH.cjs +0 -12
- package/dist/ui-campo-texto-19tIrmBK.js +0 -377
- package/dist/ui-campo-texto-CH8mzX61.cjs +0 -16
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-campo-texto-DVU_sWV1.cjs +0 -16
- package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
- package/dist/ui-campo-texto-W5M0gNE4.js +0 -377
- package/dist/ui-card-0wu4rjEX.cjs +0 -20
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-card-BYyYxxY1.cjs +0 -20
- package/dist/ui-card-C_o5_0cB.js +0 -111
- package/dist/ui-card-CojoGXaT.js +0 -144
- package/dist/ui-card-DRtpOo3l.js +0 -143
- package/dist/ui-controle-cores-B4R6ct4I.js +0 -291
- package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
- package/dist/ui-controle-cores-Bq_XUrIQ.cjs +0 -32
- package/dist/ui-controle-cores-BtA6yzu3.js +0 -291
- package/dist/ui-controle-cores-C8um-If9.cjs +0 -32
- package/dist/ui-controle-cores-CHMKGemo.cjs +0 -141
- package/dist/ui-controle-cores-C_cVXxCn.js +0 -291
- package/dist/ui-controle-cores-CuDFS8Y8.cjs +0 -32
- package/dist/ui-controle-cores-Dog7ERYv.js +0 -697
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
- package/dist/ui-linha-BxhEBn27.js +0 -749
- package/dist/ui-linha-C306zxWG.cjs +0 -19
- package/dist/ui-linha-C_azWkcG.js +0 -517
- package/dist/ui-linha-CcalUBDw.cjs +0 -38
- package/dist/ui-linha-DAz6DBcl.cjs +0 -38
- package/dist/ui-linha-DkxwMhD-.js +0 -749
- package/dist/ui-modal-4nU-tXjO.cjs +0 -18
- package/dist/ui-modal-BkYvNP0G.js +0 -214
- package/dist/ui-modal-BwB9fksp.js +0 -214
- package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-modal-DBOtSTbR.js +0 -238
- package/dist/ui-paleta-ferramentas-BXXrI1Y7.js +0 -1233
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
- package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
- package/dist/ui-paleta-ferramentas-DbwdWVtT.js +0 -1173
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-segmented-DyF5YLsV.js +0 -418
- package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
- package/dist/ui-segmented-wUraId2e.js +0 -412
- package/dist/ui-seletor-cor-C4U2eqxY.cjs +0 -82
- package/dist/ui-seletor-cor-D2_C6Aor.js +0 -391
- package/dist/ui-seletor-cor-DPKqf5wb.cjs +0 -82
- package/dist/ui-seletor-cor-FYtRccnK.js +0 -396
- package/dist/ui-skeleton-B2Rgrv8o.js +0 -648
- package/dist/ui-skeleton-DEHwpDqa.js +0 -648
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-DiOxTBZK.cjs +0 -52
- package/dist/ui-skeleton-SPYqku8P.cjs +0 -52
- package/dist/ui-skeleton-W9uwIceA.js +0 -585
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-skeleton-sIphhOSx.cjs +0 -52
- package/dist/ui-switch-BL-x_-SM.js +0 -1202
- package/dist/ui-switch-BcOqOkiV.js +0 -856
- package/dist/ui-switch-C0i_3QXu.cjs +0 -66
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-switch-DAIgOhqr.cjs +0 -66
- package/dist/ui-switch-_F8yubdX.js +0 -1203
- package/dist/ui-tabela-propriedades-2bq2nX-b.js +0 -3202
- package/dist/ui-tabela-propriedades-8IAYmk3P.cjs +0 -142
- package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +0 -141
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-BoYXzP5Z.js +0 -3191
- package/dist/ui-tabela-propriedades-BokvDD3b.js +0 -2648
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
- package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +0 -141
- package/dist/ui-tabela-propriedades-C5YYnod1.js +0 -3053
- package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +0 -142
- package/dist/ui-tabela-propriedades-CyPyKXtB.js +0 -3013
- package/dist/ui-tabela-propriedades-DWOKznMN.cjs +0 -142
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
- package/dist/ui-tabela-propriedades-DqvPilK_.cjs +0 -142
- package/dist/ui-tabela-propriedades-DuaC4sFX.js +0 -2767
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
var b = Object.defineProperty;
|
|
2
|
-
var g = (a, s, t) => s in a ? b(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
|
|
3
|
-
var i = (a, s, t) => g(a, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { S as x, d as p } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
-
import { b as f } from "./altura-controle-vxQiXG4q.js";
|
|
6
|
-
import { L as _ } from "./listener-bag-DQgv7OON.js";
|
|
7
|
-
import { i as c } from "./opcoes-CupvWVIm.js";
|
|
8
|
-
import { g as v, o as E, c as y } from "./acessibilidade-CUlSXc2X.js";
|
|
9
|
-
import { v as A, a as w } from "./form-validacao-BlQFxUVj.js";
|
|
10
|
-
import { a as S } from "./form-submissao-C-SPRKgT.js";
|
|
11
|
-
const V = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex;vertical-align:middle}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}', k = [
|
|
12
|
-
"label",
|
|
13
|
-
"placeholder",
|
|
14
|
-
"value",
|
|
15
|
-
"tipo",
|
|
16
|
-
"type",
|
|
17
|
-
"obrigatorio",
|
|
18
|
-
"required",
|
|
19
|
-
"minlength",
|
|
20
|
-
"min-length",
|
|
21
|
-
"maxlength",
|
|
22
|
-
"max-length",
|
|
23
|
-
"pattern",
|
|
24
|
-
"min",
|
|
25
|
-
"max",
|
|
26
|
-
"step",
|
|
27
|
-
"mensagem-validacao",
|
|
28
|
-
"helper-text",
|
|
29
|
-
"erro",
|
|
30
|
-
"mensagem-erro",
|
|
31
|
-
"disabled",
|
|
32
|
-
"readonly",
|
|
33
|
-
"label-flutuante",
|
|
34
|
-
"alternar-senha",
|
|
35
|
-
"tamanho",
|
|
36
|
-
"size",
|
|
37
|
-
"altura",
|
|
38
|
-
"height",
|
|
39
|
-
"densidade",
|
|
40
|
-
"aria-label"
|
|
41
|
-
];
|
|
42
|
-
function C() {
|
|
43
|
-
return `
|
|
44
|
-
<style>${V}</style>
|
|
45
|
-
<div class="ui-campo-texto__container">
|
|
46
|
-
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
47
|
-
<div class="ui-campo-texto__wrapper" part="campo">
|
|
48
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
|
|
49
|
-
<slot name="icone-esquerda"></slot>
|
|
50
|
-
</span>
|
|
51
|
-
<input class="ui-campo-texto__input" part="input" type="text" />
|
|
52
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
|
|
53
|
-
<slot name="icone-direita"></slot>
|
|
54
|
-
</span>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
function q(a, s, t, e) {
|
|
61
|
-
if (a.textContent = s, !t) return;
|
|
62
|
-
const r = document.createElement("span");
|
|
63
|
-
r.className = e, r.setAttribute("aria-hidden", "true"), r.textContent = "*", a.append(" ", r);
|
|
64
|
-
}
|
|
65
|
-
function I(a) {
|
|
66
|
-
const { labelElement: s, inputElement: t, labelText: e, placeholderText: r, isFlutuante: o, estaFocado: n, obrigatorio: u } = a, l = t.value.trim() !== "";
|
|
67
|
-
let h = !1;
|
|
68
|
-
try {
|
|
69
|
-
h = t.matches(":-webkit-autofill");
|
|
70
|
-
} catch {
|
|
71
|
-
h = !1;
|
|
72
|
-
}
|
|
73
|
-
e ? (q(s, e, !!u, "ui-campo-texto__asterisco"), s.style.display = "flex", o && (n || l || h) ? s.classList.add("ui-campo-texto__label--ativa") : s.classList.remove("ui-campo-texto__label--ativa")) : s.style.display = "none", o && !n && !l && !h ? t.placeholder = "" : t.placeholder = r;
|
|
74
|
-
}
|
|
75
|
-
function L(a, s, t) {
|
|
76
|
-
s ? (a.classList.add("ui-campo-texto__icone--clicavel"), a.setAttribute("role", "button"), a.setAttribute("tabindex", "0"), a.setAttribute("aria-label", t ? "Ocultar senha" : "Exibir senha")) : (a.classList.remove("ui-campo-texto__icone--clicavel"), a.removeAttribute("role"), a.removeAttribute("tabindex"), a.removeAttribute("aria-label"));
|
|
77
|
-
}
|
|
78
|
-
function z(a, s, t, e, r, o, n = "ui-campo-texto") {
|
|
79
|
-
e ? (a.classList.add(`${n}__wrapper--erro`), s.setAttribute("aria-invalid", "true")) : (a.classList.remove(`${n}__wrapper--erro`), s.removeAttribute("aria-invalid")), e && r ? (t.textContent = `⚠️ ${r}`, t.className = `${n}__helper ${n}__helper--erro`, t.style.display = "block") : o ? (t.textContent = o, t.className = `${n}__helper`, t.style.display = "block") : t.style.display = "none";
|
|
80
|
-
}
|
|
81
|
-
class m extends x {
|
|
82
|
-
constructor() {
|
|
83
|
-
super();
|
|
84
|
-
i(this, "internals");
|
|
85
|
-
i(this, "_formDisabled", !1);
|
|
86
|
-
i(this, "_customErrorMessage", "");
|
|
87
|
-
this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : {};
|
|
88
|
-
}
|
|
89
|
-
// === Ciclo de Vida Form-Associated Custom Elements ===
|
|
90
|
-
formDisabledCallback(t) {
|
|
91
|
-
this._formDisabled = t, this.syncState();
|
|
92
|
-
}
|
|
93
|
-
get form() {
|
|
94
|
-
var t;
|
|
95
|
-
return this.closest("form") ?? ((t = this.internals) == null ? void 0 : t.form) ?? null;
|
|
96
|
-
}
|
|
97
|
-
get required() {
|
|
98
|
-
return this.hasAttribute("obrigatorio") || this.hasAttribute("required");
|
|
99
|
-
}
|
|
100
|
-
set required(t) {
|
|
101
|
-
t ? this.setAttribute("obrigatorio", "") : (this.removeAttribute("obrigatorio"), this.removeAttribute("required")), this.syncState();
|
|
102
|
-
}
|
|
103
|
-
get obrigatorio() {
|
|
104
|
-
return this.required;
|
|
105
|
-
}
|
|
106
|
-
set obrigatorio(t) {
|
|
107
|
-
this.required = t;
|
|
108
|
-
}
|
|
109
|
-
// === API de Validação Nativa ===
|
|
110
|
-
get validity() {
|
|
111
|
-
var t;
|
|
112
|
-
return this.atualizarValidade(), (t = this.internals) == null ? void 0 : t.validity;
|
|
113
|
-
}
|
|
114
|
-
get validationMessage() {
|
|
115
|
-
var t;
|
|
116
|
-
return this.atualizarValidade(), ((t = this.internals) == null ? void 0 : t.validationMessage) ?? "";
|
|
117
|
-
}
|
|
118
|
-
get willValidate() {
|
|
119
|
-
var t;
|
|
120
|
-
return ((t = this.internals) == null ? void 0 : t.willValidate) ?? !1;
|
|
121
|
-
}
|
|
122
|
-
checkValidity() {
|
|
123
|
-
var t, e;
|
|
124
|
-
return this.atualizarValidade(), ((e = (t = this.internals) == null ? void 0 : t.checkValidity) == null ? void 0 : e.call(t)) ?? !0;
|
|
125
|
-
}
|
|
126
|
-
reportValidity() {
|
|
127
|
-
var t, e;
|
|
128
|
-
return this.atualizarValidade(), ((e = (t = this.internals) == null ? void 0 : t.reportValidity) == null ? void 0 : e.call(t)) ?? !0;
|
|
129
|
-
}
|
|
130
|
-
setCustomValidity(t) {
|
|
131
|
-
this._customErrorMessage = t || "", this.atualizarValidade();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
i(m, "formAssociated", !0);
|
|
135
|
-
class d extends m {
|
|
136
|
-
constructor() {
|
|
137
|
-
super();
|
|
138
|
-
i(this, "labelElement");
|
|
139
|
-
i(this, "wrapperElement");
|
|
140
|
-
i(this, "inputElement");
|
|
141
|
-
i(this, "helperElement");
|
|
142
|
-
i(this, "rightIconContainer");
|
|
143
|
-
i(this, "leftSlotElement");
|
|
144
|
-
i(this, "_senhaVisivel", !1);
|
|
145
|
-
i(this, "listeners", new _());
|
|
146
|
-
i(this, "_checkTimer", null);
|
|
147
|
-
i(this, "_focado", !1);
|
|
148
|
-
i(this, "_inputId");
|
|
149
|
-
i(this, "_defaultValue", "");
|
|
150
|
-
i(this, "handleSlotChange", () => {
|
|
151
|
-
this.syncState();
|
|
152
|
-
});
|
|
153
|
-
i(this, "handleHostClick", (t) => {
|
|
154
|
-
y(this, t) && !this.disabled && this.inputElement.focus();
|
|
155
|
-
});
|
|
156
|
-
i(this, "handleRightIconClick", (t) => {
|
|
157
|
-
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
158
|
-
});
|
|
159
|
-
i(this, "handleRightIconKeyDown", (t) => {
|
|
160
|
-
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
161
|
-
});
|
|
162
|
-
i(this, "handleFocus", () => {
|
|
163
|
-
this._focado = !0, this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"), this.syncState();
|
|
164
|
-
});
|
|
165
|
-
i(this, "handleBlur", () => {
|
|
166
|
-
this._focado = !1, this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"), this.syncState();
|
|
167
|
-
});
|
|
168
|
-
/**
|
|
169
|
-
* Enter submete o formulário como num <input> nativo. Aguarda um tick para que
|
|
170
|
-
* ouvintes do consumidor possam cancelar com `preventDefault()` no keydown.
|
|
171
|
-
*/
|
|
172
|
-
i(this, "handleKeyDown", (t) => {
|
|
173
|
-
if (t.key !== "Enter" || t.isComposing || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
174
|
-
const e = this.form;
|
|
175
|
-
e && setTimeout(() => {
|
|
176
|
-
!t.defaultPrevented && this.isConnected && S(e);
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
i(this, "handleInput", (t) => {
|
|
180
|
-
t.stopPropagation();
|
|
181
|
-
const e = t.target.value;
|
|
182
|
-
this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
|
|
183
|
-
new CustomEvent("ui-input", {
|
|
184
|
-
detail: { value: e },
|
|
185
|
-
bubbles: !0,
|
|
186
|
-
composed: !0
|
|
187
|
-
})
|
|
188
|
-
), this.dispatchEvent(
|
|
189
|
-
new Event("input", {
|
|
190
|
-
bubbles: !0,
|
|
191
|
-
composed: !0
|
|
192
|
-
})
|
|
193
|
-
);
|
|
194
|
-
});
|
|
195
|
-
i(this, "handleChange", (t) => {
|
|
196
|
-
t.stopPropagation();
|
|
197
|
-
const e = t.target.value;
|
|
198
|
-
this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
|
|
199
|
-
new CustomEvent("ui-change", {
|
|
200
|
-
detail: { value: e },
|
|
201
|
-
bubbles: !0,
|
|
202
|
-
composed: !0
|
|
203
|
-
})
|
|
204
|
-
), this.dispatchEvent(
|
|
205
|
-
new Event("change", {
|
|
206
|
-
bubbles: !0,
|
|
207
|
-
composed: !0
|
|
208
|
-
})
|
|
209
|
-
);
|
|
210
|
-
});
|
|
211
|
-
const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
|
|
212
|
-
t.innerHTML = C(), this.labelElement = t.querySelector(".ui-campo-texto__label"), this.wrapperElement = t.querySelector(".ui-campo-texto__wrapper"), this.inputElement = t.querySelector(".ui-campo-texto__input"), this.helperElement = t.querySelector(".ui-campo-texto__helper"), this.rightIconContainer = t.querySelector(".ui-campo-texto__icone--direita"), this.leftSlotElement = t.querySelector('slot[name="icone-esquerda"]'), this._inputId = v("ui-input"), this.inputElement.id = this._inputId, this.labelElement.htmlFor = this._inputId, this.helperElement.id = `${this._inputId}-helper`;
|
|
213
|
-
}
|
|
214
|
-
static get observedAttributes() {
|
|
215
|
-
return k;
|
|
216
|
-
}
|
|
217
|
-
focus(t) {
|
|
218
|
-
this.inputElement.focus(t);
|
|
219
|
-
}
|
|
220
|
-
blur() {
|
|
221
|
-
this.inputElement.blur();
|
|
222
|
-
}
|
|
223
|
-
connectedCallback() {
|
|
224
|
-
this.listeners.cleanup(), this.listeners.add(this.inputElement, "input", this.handleInput), this.listeners.add(this.inputElement, "change", this.handleChange), this.listeners.add(this.inputElement, "focus", this.handleFocus), this.listeners.add(this.inputElement, "blur", this.handleBlur), this.listeners.add(this.inputElement, "keydown", this.handleKeyDown), this.listeners.add(this.rightIconContainer, "click", this.handleRightIconClick), this.listeners.add(this.rightIconContainer, "keydown", this.handleRightIconKeyDown), this.listeners.add(this.leftSlotElement, "slotchange", this.handleSlotChange), this.listeners.add(this, "click", this.handleHostClick), this._defaultValue = this.getAttribute("value") || "", this.hasAttribute("value") && !this.inputElement.value && (this.inputElement.value = this._defaultValue), this.syncState(), this._checkTimer && clearTimeout(this._checkTimer), this._checkTimer = setTimeout(() => this.syncState(), 100);
|
|
225
|
-
}
|
|
226
|
-
disconnectedCallback() {
|
|
227
|
-
this.listeners.cleanup(), this._checkTimer && clearTimeout(this._checkTimer), this._checkTimer = null;
|
|
228
|
-
}
|
|
229
|
-
attributeChangedCallback(t, e, r) {
|
|
230
|
-
t === "value" && r !== this.inputElement.value && !this._focado && (this.inputElement.value = r || ""), this.syncState();
|
|
231
|
-
}
|
|
232
|
-
get value() {
|
|
233
|
-
return this.inputElement ? this.inputElement.value : this.getAttribute("value") || "";
|
|
234
|
-
}
|
|
235
|
-
set value(t) {
|
|
236
|
-
if (this.setAttribute("value", t), this.inputElement)
|
|
237
|
-
try {
|
|
238
|
-
this.inputElement.value = t;
|
|
239
|
-
} catch {
|
|
240
|
-
}
|
|
241
|
-
this.syncState();
|
|
242
|
-
}
|
|
243
|
-
// === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
|
|
244
|
-
formResetCallback() {
|
|
245
|
-
var t;
|
|
246
|
-
this.inputElement.value = this._defaultValue, (t = this.internals) == null || t.setFormValue(this._defaultValue), this.syncState();
|
|
247
|
-
}
|
|
248
|
-
formStateRestoreCallback(t, e) {
|
|
249
|
-
typeof t == "string" && (this.value = t);
|
|
250
|
-
}
|
|
251
|
-
get name() {
|
|
252
|
-
return this.getAttribute("name") || "";
|
|
253
|
-
}
|
|
254
|
-
set name(t) {
|
|
255
|
-
this.setAttribute("name", t);
|
|
256
|
-
}
|
|
257
|
-
get type() {
|
|
258
|
-
return this.getAttribute("tipo") || this.getAttribute("type") || "text";
|
|
259
|
-
}
|
|
260
|
-
get disabled() {
|
|
261
|
-
return this.hasAttribute("disabled") || this._formDisabled;
|
|
262
|
-
}
|
|
263
|
-
set disabled(t) {
|
|
264
|
-
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
265
|
-
}
|
|
266
|
-
get minLength() {
|
|
267
|
-
return c(this.getAttribute("minlength") ?? this.getAttribute("min-length")) ?? -1;
|
|
268
|
-
}
|
|
269
|
-
set minLength(t) {
|
|
270
|
-
t >= 0 ? this.setAttribute("minlength", String(t)) : this.removeAttribute("minlength"), this.syncState();
|
|
271
|
-
}
|
|
272
|
-
get maxLength() {
|
|
273
|
-
return c(this.getAttribute("maxlength") ?? this.getAttribute("max-length")) ?? -1;
|
|
274
|
-
}
|
|
275
|
-
set maxLength(t) {
|
|
276
|
-
t >= 0 ? this.setAttribute("maxlength", String(t)) : this.removeAttribute("maxlength"), this.syncState();
|
|
277
|
-
}
|
|
278
|
-
get pattern() {
|
|
279
|
-
return this.getAttribute("pattern") || "";
|
|
280
|
-
}
|
|
281
|
-
set pattern(t) {
|
|
282
|
-
t ? this.setAttribute("pattern", t) : this.removeAttribute("pattern"), this.syncState();
|
|
283
|
-
}
|
|
284
|
-
atualizarValidade() {
|
|
285
|
-
var l, h;
|
|
286
|
-
const t = this.getAttribute("min"), e = this.getAttribute("max"), r = this.inputElement ? this.inputElement.value : "", o = this.getAttribute("value") || r, n = !!((h = (l = this.inputElement) == null ? void 0 : l.validity) != null && h.badInput), u = A({
|
|
287
|
-
val: r,
|
|
288
|
-
rawVal: o,
|
|
289
|
-
badInput: n,
|
|
290
|
-
disabled: this.disabled,
|
|
291
|
-
required: this.required,
|
|
292
|
-
tipo: this.type,
|
|
293
|
-
minlength: this.minLength >= 0 ? this.minLength : null,
|
|
294
|
-
maxlength: this.maxLength >= 0 ? this.maxLength : null,
|
|
295
|
-
min: t !== null ? parseFloat(t) : null,
|
|
296
|
-
max: e !== null ? parseFloat(e) : null,
|
|
297
|
-
step: this.getAttribute("step"),
|
|
298
|
-
pattern: this.getAttribute("pattern"),
|
|
299
|
-
customError: this._customErrorMessage,
|
|
300
|
-
mensagemValidacao: this.getAttribute("mensagem-validacao")
|
|
301
|
-
});
|
|
302
|
-
w(this.internals, u, this.inputElement);
|
|
303
|
-
}
|
|
304
|
-
alternarVisibilidadeSenha() {
|
|
305
|
-
var r;
|
|
306
|
-
if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
|
|
307
|
-
this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
|
|
308
|
-
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector('slot[name="icone-direita"]');
|
|
309
|
-
e && e.assignedElements().forEach((n) => {
|
|
310
|
-
var u, l;
|
|
311
|
-
(((u = n.textContent) == null ? void 0 : u.trim()) === "👁️" || ((l = n.textContent) == null ? void 0 : l.trim()) === "🙈") && (n.textContent = this._senhaVisivel ? "🙈" : "👁️");
|
|
312
|
-
}), this.dispatchEvent(
|
|
313
|
-
new CustomEvent("ui-toggle-senha", {
|
|
314
|
-
detail: { visivel: this._senhaVisivel },
|
|
315
|
-
bubbles: !0,
|
|
316
|
-
composed: !0
|
|
317
|
-
})
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
syncState() {
|
|
321
|
-
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda"), f(this), I({
|
|
322
|
-
labelElement: this.labelElement,
|
|
323
|
-
inputElement: this.inputElement,
|
|
324
|
-
labelText: this.getAttribute("label"),
|
|
325
|
-
placeholderText: this.getAttribute("placeholder") || "",
|
|
326
|
-
isFlutuante: this.hasAttribute("label-flutuante"),
|
|
327
|
-
estaFocado: this._focado,
|
|
328
|
-
obrigatorio: this.required
|
|
329
|
-
}), this.sincronizarNomeAcessivel();
|
|
330
|
-
const e = this.getAttribute("tipo") || this.getAttribute("type") || "text";
|
|
331
|
-
if (!this._senhaVisivel)
|
|
332
|
-
try {
|
|
333
|
-
this.inputElement.type = e;
|
|
334
|
-
} catch {
|
|
335
|
-
this.inputElement.type = "text";
|
|
336
|
-
}
|
|
337
|
-
this.minLength >= 0 ? this.inputElement.minLength = this.minLength : this.inputElement.removeAttribute("minlength"), this.maxLength >= 0 ? this.inputElement.maxLength = this.maxLength : this.inputElement.removeAttribute("maxlength");
|
|
338
|
-
const r = this.getAttribute("pattern");
|
|
339
|
-
r !== null ? this.inputElement.pattern = r : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
|
|
340
|
-
const o = this.hasAttribute("disabled") || this._formDisabled, n = this.hasAttribute("readonly");
|
|
341
|
-
this.inputElement.disabled = o, this.inputElement.readOnly = n, o ? this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled") : this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");
|
|
342
|
-
const u = e === "password" || this.hasAttribute("alternar-senha");
|
|
343
|
-
L(this.rightIconContainer, u, this._senhaVisivel);
|
|
344
|
-
const l = this.hasAttribute("erro") || this.hasAttribute("mensagem-erro");
|
|
345
|
-
z(
|
|
346
|
-
this.wrapperElement,
|
|
347
|
-
this.inputElement,
|
|
348
|
-
this.helperElement,
|
|
349
|
-
l,
|
|
350
|
-
this.getAttribute("mensagem-erro"),
|
|
351
|
-
this.getAttribute("helper-text")
|
|
352
|
-
), this.helperElement.style.display === "none" ? this.inputElement.removeAttribute("aria-describedby") : this.inputElement.setAttribute("aria-describedby", this.helperElement.id), this.required ? this.inputElement.setAttribute("aria-required", "true") : this.inputElement.removeAttribute("aria-required"), this.atualizarValidade();
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Sem o atributo `label`, o input nativo herda o nome acessível de fora do Shadow DOM
|
|
356
|
-
* (`aria-label` no host, `<label for>` ou `<label>` envolvente).
|
|
357
|
-
*/
|
|
358
|
-
sincronizarNomeAcessivel() {
|
|
359
|
-
const t = this.getAttribute("label") ? "" : E(this, this.internals);
|
|
360
|
-
t ? this.inputElement.setAttribute("aria-label", t) : this.inputElement.removeAttribute("aria-label");
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
class T extends d {
|
|
364
|
-
}
|
|
365
|
-
p("ui-campo-texto", d);
|
|
366
|
-
p("ui-input", T);
|
|
367
|
-
export {
|
|
368
|
-
k as A,
|
|
369
|
-
m as F,
|
|
370
|
-
d as U,
|
|
371
|
-
T as a,
|
|
372
|
-
L as b,
|
|
373
|
-
C as c,
|
|
374
|
-
I as d,
|
|
375
|
-
q as r,
|
|
376
|
-
z as s
|
|
377
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";var w=Object.defineProperty;var S=(a,s,t)=>s in a?w(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var i=(a,s,t)=>S(a,typeof s!="symbol"?s+"":s,t);const p=require("./ssr-safe-CiHD1adl.cjs"),V=require("./altura-controle-ukMRPckR.cjs"),C=require("./listener-bag-D5omxZ9h.cjs"),b=require("./opcoes-vdAUY5OI.cjs"),c=require("./acessibilidade-CSzX-DkG.cjs"),g=require("./form-validacao-DIeyQVH5.cjs"),k=require("./form-submissao-DxKO5MHI.cjs"),q=':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex;vertical-align:middle}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}',x=["label","placeholder","value","tipo","type","obrigatorio","required","minlength","min-length","maxlength","max-length","pattern","min","max","step","mensagem-validacao","helper-text","erro","mensagem-erro","disabled","readonly","label-flutuante","alternar-senha","tamanho","size","altura","height","densidade","aria-label"];function f(){return`
|
|
2
|
-
<style>${q}</style>
|
|
3
|
-
<div class="ui-campo-texto__container">
|
|
4
|
-
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
5
|
-
<div class="ui-campo-texto__wrapper" part="campo">
|
|
6
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
|
|
7
|
-
<slot name="icone-esquerda"></slot>
|
|
8
|
-
</span>
|
|
9
|
-
<input class="ui-campo-texto__input" part="input" type="text" />
|
|
10
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
|
|
11
|
-
<slot name="icone-direita"></slot>
|
|
12
|
-
</span>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
|
|
16
|
-
`}function _(a,s,t,e){if(a.textContent=s,!t)return;const r=document.createElement("span");r.className=e,r.setAttribute("aria-hidden","true"),r.textContent="*",a.append(" ",r)}function v(a){const{labelElement:s,inputElement:t,labelText:e,placeholderText:r,isFlutuante:o,estaFocado:n,obrigatorio:u}=a,l=t.value.trim()!=="";let h=!1;try{h=t.matches(":-webkit-autofill")}catch{h=!1}e?(_(s,e,!!u,"ui-campo-texto__asterisco"),s.style.display="flex",o&&(n||l||h)?s.classList.add("ui-campo-texto__label--ativa"):s.classList.remove("ui-campo-texto__label--ativa")):s.style.display="none",o&&!n&&!l&&!h?t.placeholder="":t.placeholder=r}function E(a,s,t){s?(a.classList.add("ui-campo-texto__icone--clicavel"),a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",t?"Ocultar senha":"Exibir senha")):(a.classList.remove("ui-campo-texto__icone--clicavel"),a.removeAttribute("role"),a.removeAttribute("tabindex"),a.removeAttribute("aria-label"))}function y(a,s,t,e,r,o,n="ui-campo-texto"){e?(a.classList.add(`${n}__wrapper--erro`),s.setAttribute("aria-invalid","true")):(a.classList.remove(`${n}__wrapper--erro`),s.removeAttribute("aria-invalid")),e&&r?(t.textContent=`⚠️ ${r}`,t.className=`${n}__helper ${n}__helper--erro`,t.style.display="block"):o?(t.textContent=o,t.className=`${n}__helper`,t.style.display="block"):t.style.display="none"}class m extends p.SafeHTMLElement{constructor(){super();i(this,"internals");i(this,"_formDisabled",!1);i(this,"_customErrorMessage","");this.internals=typeof this.attachInternals=="function"?this.attachInternals():{}}formDisabledCallback(t){this._formDisabled=t,this.syncState()}get form(){var t;return this.closest("form")??((t=this.internals)==null?void 0:t.form)??null}get required(){return this.hasAttribute("obrigatorio")||this.hasAttribute("required")}set required(t){t?this.setAttribute("obrigatorio",""):(this.removeAttribute("obrigatorio"),this.removeAttribute("required")),this.syncState()}get obrigatorio(){return this.required}set obrigatorio(t){this.required=t}get validity(){var t;return this.atualizarValidade(),(t=this.internals)==null?void 0:t.validity}get validationMessage(){var t;return this.atualizarValidade(),((t=this.internals)==null?void 0:t.validationMessage)??""}get willValidate(){var t;return((t=this.internals)==null?void 0:t.willValidate)??!1}checkValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.checkValidity)==null?void 0:e.call(t))??!0}reportValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.reportValidity)==null?void 0:e.call(t))??!0}setCustomValidity(t){this._customErrorMessage=t||"",this.atualizarValidade()}}i(m,"formAssociated",!0);class d extends m{constructor(){super();i(this,"labelElement");i(this,"wrapperElement");i(this,"inputElement");i(this,"helperElement");i(this,"rightIconContainer");i(this,"leftSlotElement");i(this,"_senhaVisivel",!1);i(this,"listeners",new C.ListenerBag);i(this,"_checkTimer",null);i(this,"_focado",!1);i(this,"_inputId");i(this,"_defaultValue","");i(this,"handleSlotChange",()=>{this.syncState()});i(this,"handleHostClick",t=>{c.cliqueVeioDeRotuloExterno(this,t)&&!this.disabled&&this.inputElement.focus()});i(this,"handleRightIconClick",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.stopPropagation(),this.alternarVisibilidadeSenha())});i(this,"handleRightIconKeyDown",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),this.alternarVisibilidadeSenha())});i(this,"handleFocus",()=>{this._focado=!0,this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"),this.syncState()});i(this,"handleBlur",()=>{this._focado=!1,this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"),this.syncState()});i(this,"handleKeyDown",t=>{if(t.key!=="Enter"||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;const e=this.form;e&&setTimeout(()=>{!t.defaultPrevented&&this.isConnected&&k.submeterImplicitamente(e)})});i(this,"handleInput",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))});i(this,"handleChange",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-change",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))});const t=this.attachShadow({mode:"open",delegatesFocus:!0});t.innerHTML=f(),this.labelElement=t.querySelector(".ui-campo-texto__label"),this.wrapperElement=t.querySelector(".ui-campo-texto__wrapper"),this.inputElement=t.querySelector(".ui-campo-texto__input"),this.helperElement=t.querySelector(".ui-campo-texto__helper"),this.rightIconContainer=t.querySelector(".ui-campo-texto__icone--direita"),this.leftSlotElement=t.querySelector('slot[name="icone-esquerda"]'),this._inputId=c.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`}static get observedAttributes(){return x}focus(t){this.inputElement.focus(t)}blur(){this.inputElement.blur()}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.inputElement,"input",this.handleInput),this.listeners.add(this.inputElement,"change",this.handleChange),this.listeners.add(this.inputElement,"focus",this.handleFocus),this.listeners.add(this.inputElement,"blur",this.handleBlur),this.listeners.add(this.inputElement,"keydown",this.handleKeyDown),this.listeners.add(this.rightIconContainer,"click",this.handleRightIconClick),this.listeners.add(this.rightIconContainer,"keydown",this.handleRightIconKeyDown),this.listeners.add(this.leftSlotElement,"slotchange",this.handleSlotChange),this.listeners.add(this,"click",this.handleHostClick),this._defaultValue=this.getAttribute("value")||"",this.hasAttribute("value")&&!this.inputElement.value&&(this.inputElement.value=this._defaultValue),this.syncState(),this._checkTimer&&clearTimeout(this._checkTimer),this._checkTimer=setTimeout(()=>this.syncState(),100)}disconnectedCallback(){this.listeners.cleanup(),this._checkTimer&&clearTimeout(this._checkTimer),this._checkTimer=null}attributeChangedCallback(t,e,r){t==="value"&&r!==this.inputElement.value&&!this._focado&&(this.inputElement.value=r||""),this.syncState()}get value(){return this.inputElement?this.inputElement.value:this.getAttribute("value")||""}set value(t){if(this.setAttribute("value",t),this.inputElement)try{this.inputElement.value=t}catch{}this.syncState()}formResetCallback(){var t;this.inputElement.value=this._defaultValue,(t=this.internals)==null||t.setFormValue(this._defaultValue),this.syncState()}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("tipo")||this.getAttribute("type")||"text"}get disabled(){return this.hasAttribute("disabled")||this._formDisabled}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get minLength(){return b.inteiroOuNulo(this.getAttribute("minlength")??this.getAttribute("min-length"))??-1}set minLength(t){t>=0?this.setAttribute("minlength",String(t)):this.removeAttribute("minlength"),this.syncState()}get maxLength(){return b.inteiroOuNulo(this.getAttribute("maxlength")??this.getAttribute("max-length"))??-1}set maxLength(t){t>=0?this.setAttribute("maxlength",String(t)):this.removeAttribute("maxlength"),this.syncState()}get pattern(){return this.getAttribute("pattern")||""}set pattern(t){t?this.setAttribute("pattern",t):this.removeAttribute("pattern"),this.syncState()}atualizarValidade(){var l,h;const t=this.getAttribute("min"),e=this.getAttribute("max"),r=this.inputElement?this.inputElement.value:"",o=this.getAttribute("value")||r,n=!!((h=(l=this.inputElement)==null?void 0:l.validity)!=null&&h.badInput),u=g.validarRestricoesCampoTexto({val:r,rawVal:o,badInput:n,disabled:this.disabled,required:this.required,tipo:this.type,minlength:this.minLength>=0?this.minLength:null,maxlength:this.maxLength>=0?this.maxLength:null,min:t!==null?parseFloat(t):null,max:e!==null?parseFloat(e):null,step:this.getAttribute("step"),pattern:this.getAttribute("pattern"),customError:this._customErrorMessage,mensagemValidacao:this.getAttribute("mensagem-validacao")});g.aplicarValidadeInternals(this.internals,u,this.inputElement)}alternarVisibilidadeSenha(){var r;if(!(this.getAttribute("tipo")==="password"||this._senhaVisivel))return;this._senhaVisivel=!this._senhaVisivel,this.inputElement.type=this._senhaVisivel?"text":"password";const e=(r=this.shadowRoot)==null?void 0:r.querySelector('slot[name="icone-direita"]');e&&e.assignedElements().forEach(n=>{var u,l;(((u=n.textContent)==null?void 0:u.trim())==="👁️"||((l=n.textContent)==null?void 0:l.trim())==="🙈")&&(n.textContent=this._senhaVisivel?"🙈":"👁️")}),this.dispatchEvent(new CustomEvent("ui-toggle-senha",{detail:{visivel:this._senhaVisivel},bubbles:!0,composed:!0}))}syncState(){this.leftSlotElement.assignedNodes().length>0||this.querySelector('[slot="icone-esquerda"]')!==null?this.setAttribute("tem-icone-esquerda",""):this.removeAttribute("tem-icone-esquerda"),V.aplicarAlturaControle(this),v({labelElement:this.labelElement,inputElement:this.inputElement,labelText:this.getAttribute("label"),placeholderText:this.getAttribute("placeholder")||"",isFlutuante:this.hasAttribute("label-flutuante"),estaFocado:this._focado,obrigatorio:this.required}),this.sincronizarNomeAcessivel();const e=this.getAttribute("tipo")||this.getAttribute("type")||"text";if(!this._senhaVisivel)try{this.inputElement.type=e}catch{this.inputElement.type="text"}this.minLength>=0?this.inputElement.minLength=this.minLength:this.inputElement.removeAttribute("minlength"),this.maxLength>=0?this.inputElement.maxLength=this.maxLength:this.inputElement.removeAttribute("maxlength");const r=this.getAttribute("pattern");r!==null?this.inputElement.pattern=r:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const o=this.hasAttribute("disabled")||this._formDisabled,n=this.hasAttribute("readonly");this.inputElement.disabled=o,this.inputElement.readOnly=n,o?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const u=e==="password"||this.hasAttribute("alternar-senha");E(this.rightIconContainer,u,this._senhaVisivel);const l=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");y(this.wrapperElement,this.inputElement,this.helperElement,l,this.getAttribute("mensagem-erro"),this.getAttribute("helper-text")),this.helperElement.style.display==="none"?this.inputElement.removeAttribute("aria-describedby"):this.inputElement.setAttribute("aria-describedby",this.helperElement.id),this.required?this.inputElement.setAttribute("aria-required","true"):this.inputElement.removeAttribute("aria-required"),this.atualizarValidade()}sincronizarNomeAcessivel(){const t=this.getAttribute("label")?"":c.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class A extends d{}p.definirCustomElement("ui-campo-texto",d);p.definirCustomElement("ui-input",A);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=x;exports.FormAssociatedElement=m;exports.UICampoTexto=d;exports.UIInput=A;exports.criarTemplateCampoTexto=f;exports.renderizarRotulo=_;exports.sincronizarFeedbackErro=y;exports.sincronizarIconeSenha=E;exports.sincronizarLabelEPlaceholder=v;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";var w=Object.defineProperty;var S=(i,s,t)=>s in i?w(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t;var a=(i,s,t)=>S(i,typeof s!="symbol"?s+"":s,t);const d=require("./ssr-safe-CiHD1adl.cjs"),c=require("./form-validacao-ytRYSF3E.cjs"),I=require("./form-submissao-DxKO5MHI.cjs"),C=':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 100%);min-height:var(--ui-campo-altura, var(--ui-altura-minima, 15px));background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}',x=["label","placeholder","value","tipo","type","obrigatorio","required","minlength","min-length","maxlength","max-length","pattern","min","max","step","mensagem-validacao","helper-text","erro","mensagem-erro","disabled","readonly","label-flutuante","alternar-senha","tamanho","size","altura","height","densidade","aria-label"];function f(){return`
|
|
2
|
-
<style>${C}</style>
|
|
3
|
-
<div class="ui-campo-texto__container">
|
|
4
|
-
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
5
|
-
<div class="ui-campo-texto__wrapper" part="campo">
|
|
6
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
|
|
7
|
-
<slot name="icone-esquerda"></slot>
|
|
8
|
-
</span>
|
|
9
|
-
<input class="ui-campo-texto__input" part="input" type="text" />
|
|
10
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
|
|
11
|
-
<slot name="icone-direita"></slot>
|
|
12
|
-
</span>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="ui-campo-texto__helper" part="ajuda" style="display: none;"></div>
|
|
16
|
-
`}function v(i,s,t,e){if(i.textContent=s,!t)return;const n=document.createElement("span");n.className=e,n.setAttribute("aria-hidden","true"),n.textContent="*",i.append(" ",n)}function _(i){const{labelElement:s,inputElement:t,labelText:e,placeholderText:n,isFlutuante:r,estaFocado:o,obrigatorio:u}=i,l=t.value.trim()!=="";let h=!1;try{h=t.matches(":-webkit-autofill")}catch{h=!1}e?(v(s,e,!!u,"ui-campo-texto__asterisco"),s.style.display="flex",r&&(o||l||h)?s.classList.add("ui-campo-texto__label--ativa"):s.classList.remove("ui-campo-texto__label--ativa")):s.style.display="none",r&&!o&&!l&&!h?t.placeholder="":t.placeholder=n}function E(i,s,t){s?(i.classList.add("ui-campo-texto__icone--clicavel"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",t?"Ocultar senha":"Exibir senha")):(i.classList.remove("ui-campo-texto__icone--clicavel"),i.removeAttribute("role"),i.removeAttribute("tabindex"),i.removeAttribute("aria-label"))}function y(i,s,t,e,n,r){e?(i.classList.add("ui-campo-texto__wrapper--erro"),s.setAttribute("aria-invalid","true")):(i.classList.remove("ui-campo-texto__wrapper--erro"),s.removeAttribute("aria-invalid")),e&&n?(t.textContent=`⚠️ ${n}`,t.className="ui-campo-texto__helper ui-campo-texto__helper--erro",t.style.display="block"):r?(t.textContent=r,t.className="ui-campo-texto__helper",t.style.display="block"):t.style.display="none"}class b extends d.SafeHTMLElement{constructor(){super();a(this,"internals");a(this,"_formDisabled",!1);a(this,"_customErrorMessage","");this.internals=typeof this.attachInternals=="function"?this.attachInternals():{}}formDisabledCallback(t){this._formDisabled=t,this.syncState()}get form(){var t;return this.closest("form")??((t=this.internals)==null?void 0:t.form)??null}get required(){return this.hasAttribute("obrigatorio")||this.hasAttribute("required")}set required(t){t?this.setAttribute("obrigatorio",""):(this.removeAttribute("obrigatorio"),this.removeAttribute("required")),this.syncState()}get obrigatorio(){return this.required}set obrigatorio(t){this.required=t}get validity(){var t;return this.atualizarValidade(),(t=this.internals)==null?void 0:t.validity}get validationMessage(){var t;return this.atualizarValidade(),((t=this.internals)==null?void 0:t.validationMessage)??""}get willValidate(){var t;return((t=this.internals)==null?void 0:t.willValidate)??!1}checkValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.checkValidity)==null?void 0:e.call(t))??!0}reportValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.reportValidity)==null?void 0:e.call(t))??!0}setCustomValidity(t){this._customErrorMessage=t||"",this.atualizarValidade()}}a(b,"formAssociated",!0);class g extends b{constructor(){super();a(this,"labelElement");a(this,"wrapperElement");a(this,"inputElement");a(this,"helperElement");a(this,"rightIconContainer");a(this,"leftSlotElement");a(this,"_senhaVisivel",!1);a(this,"_checkTimer",null);a(this,"_focado",!1);a(this,"_inputId");a(this,"_defaultValue","");a(this,"handleSlotChange",()=>{this.syncState()});a(this,"handleHostClick",t=>{c.cliqueVeioDeRotuloExterno(this,t)&&!this.disabled&&this.inputElement.focus()});a(this,"handleRightIconClick",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.stopPropagation(),this.alternarVisibilidadeSenha())});a(this,"handleRightIconKeyDown",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),this.alternarVisibilidadeSenha())});a(this,"handleFocus",()=>{this._focado=!0,this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"),this.syncState()});a(this,"handleBlur",()=>{this._focado=!1,this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"),this.syncState()});a(this,"handleKeyDown",t=>{if(t.key!=="Enter"||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;const e=this.form;e&&setTimeout(()=>{!t.defaultPrevented&&this.isConnected&&I.submeterImplicitamente(e)})});a(this,"handleInput",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))});a(this,"handleChange",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-change",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))});const t=this.attachShadow({mode:"open",delegatesFocus:!0});t.innerHTML=f(),this.labelElement=t.querySelector(".ui-campo-texto__label"),this.wrapperElement=t.querySelector(".ui-campo-texto__wrapper"),this.inputElement=t.querySelector(".ui-campo-texto__input"),this.helperElement=t.querySelector(".ui-campo-texto__helper"),this.rightIconContainer=t.querySelector(".ui-campo-texto__icone--direita"),this.leftSlotElement=t.querySelector('slot[name="icone-esquerda"]'),this._inputId=c.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`,this.inputElement.setAttribute("aria-describedby",`${this._inputId}-helper`)}static get observedAttributes(){return x}focus(t){this.inputElement.focus(t)}blur(){this.inputElement.blur()}connectedCallback(){this.inputElement.addEventListener("input",this.handleInput),this.inputElement.addEventListener("change",this.handleChange),this.inputElement.addEventListener("focus",this.handleFocus),this.inputElement.addEventListener("blur",this.handleBlur),this.inputElement.addEventListener("keydown",this.handleKeyDown),this.rightIconContainer.addEventListener("click",this.handleRightIconClick),this.rightIconContainer.addEventListener("keydown",this.handleRightIconKeyDown),this.leftSlotElement.addEventListener("slotchange",this.handleSlotChange),this.addEventListener("click",this.handleHostClick),this._defaultValue=this.getAttribute("value")||"",this.hasAttribute("value")&&!this.inputElement.value&&(this.inputElement.value=this._defaultValue),this.syncState(),this._checkTimer=setTimeout(()=>this.syncState(),100)}disconnectedCallback(){this.inputElement.removeEventListener("input",this.handleInput),this.inputElement.removeEventListener("change",this.handleChange),this.inputElement.removeEventListener("focus",this.handleFocus),this.inputElement.removeEventListener("blur",this.handleBlur),this.inputElement.removeEventListener("keydown",this.handleKeyDown),this.rightIconContainer.removeEventListener("click",this.handleRightIconClick),this.rightIconContainer.removeEventListener("keydown",this.handleRightIconKeyDown),this.leftSlotElement.removeEventListener("slotchange",this.handleSlotChange),this.removeEventListener("click",this.handleHostClick),this._checkTimer&&clearTimeout(this._checkTimer)}attributeChangedCallback(t,e,n){t==="value"&&n!==this.inputElement.value&&!this._focado&&(this.inputElement.value=n||""),this.syncState()}get value(){return this.inputElement?this.inputElement.value:this.getAttribute("value")||""}set value(t){if(this.setAttribute("value",t),this.inputElement)try{this.inputElement.value=t}catch{}this.syncState()}formResetCallback(){var t;this.inputElement.value=this._defaultValue,(t=this.internals)==null||t.setFormValue(this._defaultValue),this.syncState()}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("tipo")||this.getAttribute("type")||"text"}get disabled(){return this.hasAttribute("disabled")||this._formDisabled}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get minLength(){const t=this.getAttribute("minlength")??this.getAttribute("min-length");return t?parseInt(t,10):-1}set minLength(t){t>=0?this.setAttribute("minlength",String(t)):this.removeAttribute("minlength"),this.syncState()}get maxLength(){const t=this.getAttribute("maxlength")??this.getAttribute("max-length");return t?parseInt(t,10):-1}set maxLength(t){t>=0?this.setAttribute("maxlength",String(t)):this.removeAttribute("maxlength"),this.syncState()}get pattern(){return this.getAttribute("pattern")||""}set pattern(t){t?this.setAttribute("pattern",t):this.removeAttribute("pattern"),this.syncState()}atualizarValidade(){var p,m;const t=this.getAttribute("minlength")??this.getAttribute("min-length"),e=this.getAttribute("maxlength")??this.getAttribute("max-length"),n=this.getAttribute("min"),r=this.getAttribute("max"),o=this.inputElement?this.inputElement.value:"",u=this.getAttribute("value")||o,l=!!((m=(p=this.inputElement)==null?void 0:p.validity)!=null&&m.badInput),h=c.validarRestricoesCampoTexto({val:o,rawVal:u,badInput:l,disabled:this.disabled,required:this.required,tipo:this.type,minlength:t!==null?parseInt(t,10):null,maxlength:e!==null?parseInt(e,10):null,min:n!==null?parseFloat(n):null,max:r!==null?parseFloat(r):null,step:this.getAttribute("step"),pattern:this.getAttribute("pattern"),customError:this._customErrorMessage,mensagemValidacao:this.getAttribute("mensagem-validacao")});c.aplicarValidadeInternals(this.internals,h,this.inputElement)}alternarVisibilidadeSenha(){var n;if(!(this.getAttribute("tipo")==="password"||this._senhaVisivel))return;this._senhaVisivel=!this._senhaVisivel,this.inputElement.type=this._senhaVisivel?"text":"password";const e=(n=this.shadowRoot)==null?void 0:n.querySelector('slot[name="icone-direita"]');e&&e.assignedElements().forEach(o=>{var u,l;(((u=o.textContent)==null?void 0:u.trim())==="👁️"||((l=o.textContent)==null?void 0:l.trim())==="🙈")&&(o.textContent=this._senhaVisivel?"🙈":"👁️")}),this.dispatchEvent(new CustomEvent("ui-toggle-senha",{detail:{visivel:this._senhaVisivel},bubbles:!0,composed:!0}))}syncState(){this.leftSlotElement.assignedNodes().length>0||this.querySelector('[slot="icone-esquerda"]')!==null?this.setAttribute("tem-icone-esquerda",""):this.removeAttribute("tem-icone-esquerda");const e=this.getAttribute("altura")||this.getAttribute("height");e?this.style.setProperty("--ui-campo-altura",isNaN(Number(e))?e:`${e}px`):this.style.removeProperty("--ui-campo-altura"),_({labelElement:this.labelElement,inputElement:this.inputElement,labelText:this.getAttribute("label"),placeholderText:this.getAttribute("placeholder")||"",isFlutuante:this.hasAttribute("label-flutuante"),estaFocado:this._focado,obrigatorio:this.required}),this.sincronizarNomeAcessivel();const n=this.getAttribute("tipo")||this.getAttribute("type")||"text";if(!this._senhaVisivel)try{this.inputElement.type=n}catch{this.inputElement.type="text"}const r=this.getAttribute("minlength")??this.getAttribute("min-length");r!==null?this.inputElement.minLength=parseInt(r,10):this.inputElement.removeAttribute("minlength");const o=this.getAttribute("maxlength")??this.getAttribute("max-length");o!==null?this.inputElement.maxLength=parseInt(o,10):this.inputElement.removeAttribute("maxlength");const u=this.getAttribute("pattern");u!==null?this.inputElement.pattern=u:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const l=this.hasAttribute("disabled")||this._formDisabled,h=this.hasAttribute("readonly");this.inputElement.disabled=l,this.inputElement.readOnly=h,l?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const p=n==="password"||this.hasAttribute("alternar-senha");E(this.rightIconContainer,p,this._senhaVisivel);const m=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");y(this.wrapperElement,this.inputElement,this.helperElement,m,this.getAttribute("mensagem-erro"),this.getAttribute("helper-text")),this.atualizarValidade()}sincronizarNomeAcessivel(){const t=this.getAttribute("label")?"":c.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class A extends g{}d.definirCustomElement("ui-campo-texto",g);d.definirCustomElement("ui-input",A);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=x;exports.FormAssociatedElement=b;exports.UICampoTexto=g;exports.UIInput=A;exports.criarTemplateCampoTexto=f;exports.renderizarRotulo=v;exports.sincronizarFeedbackErro=y;exports.sincronizarIconeSenha=E;exports.sincronizarLabelEPlaceholder=_;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";var w=Object.defineProperty;var S=(a,s,t)=>s in a?w(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var i=(a,s,t)=>S(a,typeof s!="symbol"?s+"":s,t);const p=require("./ssr-safe-CiHD1adl.cjs"),q=require("./altura-controle-ukMRPckR.cjs"),V=require("./listener-bag-D5omxZ9h.cjs"),b=require("./opcoes-vdAUY5OI.cjs"),h=require("./acessibilidade-CSzX-DkG.cjs"),x=require("./form-validacao-DIeyQVH5.cjs"),C=require("./form-submissao-DxKO5MHI.cjs"),k=':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex;vertical-align:middle}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}:host(.squarecircle) .ui-campo-texto__container,:host(.squarecircles) .ui-campo-texto__container,:host(.ui-squarecircle) .ui-campo-texto__container,:host(.ui-squarecircles) .ui-campo-texto__container,:host([formato="squarecircle"]) .ui-campo-texto__container,:host([formato="squarecircles"]) .ui-campo-texto__container,:host([formato="squircle"]) .ui-campo-texto__container{border-radius:var(--ui-raio-lg, 10px)}',g=["label","placeholder","value","tipo","type","obrigatorio","required","minlength","min-length","maxlength","max-length","pattern","min","max","step","mensagem-validacao","helper-text","erro","mensagem-erro","disabled","readonly","label-flutuante","alternar-senha","tamanho","size","altura","height","densidade","aria-label"];function _(){return`
|
|
2
|
-
<style>${k}</style>
|
|
3
|
-
<div class="ui-campo-texto__container">
|
|
4
|
-
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
5
|
-
<div class="ui-campo-texto__wrapper" part="campo">
|
|
6
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
|
|
7
|
-
<slot name="icone-esquerda"></slot>
|
|
8
|
-
</span>
|
|
9
|
-
<input class="ui-campo-texto__input" part="input" type="text" />
|
|
10
|
-
<span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
|
|
11
|
-
<slot name="icone-direita"></slot>
|
|
12
|
-
</span>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
|
|
16
|
-
`}function f(a,s,t,e){if(a.textContent=s,!t)return;const r=document.createElement("span");r.className=e,r.setAttribute("aria-hidden","true"),r.textContent="*",a.append(" ",r)}function v(a){const{labelElement:s,inputElement:t,labelText:e,placeholderText:r,isFlutuante:n,estaFocado:o,obrigatorio:u}=a,l=t.value.trim()!=="";let c=!1;try{c=t.matches(":-webkit-autofill")}catch{c=!1}e?(f(s,e,!!u,"ui-campo-texto__asterisco"),s.style.display="flex",n&&(o||l||c)?s.classList.add("ui-campo-texto__label--ativa"):s.classList.remove("ui-campo-texto__label--ativa")):s.style.display="none",n&&!o&&!l&&!c?t.placeholder="":t.placeholder=r}function E(a,s,t){s?(a.classList.add("ui-campo-texto__icone--clicavel"),a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",t?"Ocultar senha":"Exibir senha")):(a.classList.remove("ui-campo-texto__icone--clicavel"),a.removeAttribute("role"),a.removeAttribute("tabindex"),a.removeAttribute("aria-label"))}function y(a,s,t,e,r,n,o="ui-campo-texto"){e?(a.classList.add(`${o}__wrapper--erro`),s.setAttribute("aria-invalid","true")):(a.classList.remove(`${o}__wrapper--erro`),s.removeAttribute("aria-invalid")),e&&r?(t.textContent=`⚠️ ${r}`,t.className=`${o}__helper ${o}__helper--erro`,t.style.display="block"):n?(t.textContent=n,t.className=`${o}__helper`,t.style.display="block"):t.style.display="none"}class m extends p.SafeHTMLElement{constructor(){super();i(this,"internals");i(this,"_formDisabled",!1);i(this,"_customErrorMessage","");this.internals=typeof this.attachInternals=="function"?this.attachInternals():{}}formDisabledCallback(t){this._formDisabled=t,this.syncState()}get form(){var t;return this.closest("form")??((t=this.internals)==null?void 0:t.form)??null}get required(){return this.hasAttribute("obrigatorio")||this.hasAttribute("required")}set required(t){t?this.setAttribute("obrigatorio",""):(this.removeAttribute("obrigatorio"),this.removeAttribute("required")),this.syncState()}get obrigatorio(){return this.required}set obrigatorio(t){this.required=t}get validity(){var t;return this.atualizarValidade(),(t=this.internals)==null?void 0:t.validity}get validationMessage(){var t;return this.atualizarValidade(),((t=this.internals)==null?void 0:t.validationMessage)??""}get willValidate(){var t;return((t=this.internals)==null?void 0:t.willValidate)??!1}checkValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.checkValidity)==null?void 0:e.call(t))??!0}reportValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.reportValidity)==null?void 0:e.call(t))??!0}setCustomValidity(t){this._customErrorMessage=t||"",this.atualizarValidade()}}i(m,"formAssociated",!0);class d extends m{constructor(){super();i(this,"labelElement");i(this,"wrapperElement");i(this,"inputElement");i(this,"helperElement");i(this,"rightIconContainer");i(this,"leftSlotElement");i(this,"_senhaVisivel",!1);i(this,"listeners",new V.ListenerBag);i(this,"_checkTimer",null);i(this,"_focado",!1);i(this,"_inputId");i(this,"_defaultValue","");i(this,"handleSlotChange",()=>{this.syncState()});i(this,"handleHostClick",t=>{h.cliqueVeioDeRotuloExterno(this,t)&&!this.disabled&&this.inputElement.focus()});i(this,"handleRightIconClick",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.stopPropagation(),this.alternarVisibilidadeSenha())});i(this,"handleRightIconKeyDown",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),this.alternarVisibilidadeSenha())});i(this,"handleFocus",()=>{this._focado=!0,this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"),this.syncState()});i(this,"handleBlur",()=>{this._focado=!1,this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"),this.syncState()});i(this,"handleKeyDown",t=>{if(t.key!=="Enter"||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;const e=this.form;e&&setTimeout(()=>{!t.defaultPrevented&&this.isConnected&&C.submeterImplicitamente(e)})});i(this,"handleInput",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))});i(this,"handleChange",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-change",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))});const t=this.attachShadow({mode:"open",delegatesFocus:!0});t.innerHTML=_(),this.labelElement=t.querySelector(".ui-campo-texto__label"),this.wrapperElement=t.querySelector(".ui-campo-texto__wrapper"),this.inputElement=t.querySelector(".ui-campo-texto__input"),this.helperElement=t.querySelector(".ui-campo-texto__helper"),this.rightIconContainer=t.querySelector(".ui-campo-texto__icone--direita"),this.leftSlotElement=t.querySelector('slot[name="icone-esquerda"]'),this._inputId=h.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`}static get observedAttributes(){return g}focus(t){this.inputElement.focus(t)}blur(){this.inputElement.blur()}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.inputElement,"input",this.handleInput),this.listeners.add(this.inputElement,"change",this.handleChange),this.listeners.add(this.inputElement,"focus",this.handleFocus),this.listeners.add(this.inputElement,"blur",this.handleBlur),this.listeners.add(this.inputElement,"keydown",this.handleKeyDown),this.listeners.add(this.rightIconContainer,"click",this.handleRightIconClick),this.listeners.add(this.rightIconContainer,"keydown",this.handleRightIconKeyDown),this.listeners.add(this.leftSlotElement,"slotchange",this.handleSlotChange),this.listeners.add(this,"click",this.handleHostClick),this._defaultValue=this.getAttribute("value")||"",this.hasAttribute("value")&&!this.inputElement.value&&(this.inputElement.value=this._defaultValue),this.syncState(),this._checkTimer&&clearTimeout(this._checkTimer),this._checkTimer=setTimeout(()=>this.syncState(),100)}disconnectedCallback(){this.listeners.cleanup(),this._checkTimer&&clearTimeout(this._checkTimer),this._checkTimer=null}attributeChangedCallback(t,e,r){t==="value"&&r!==this.inputElement.value&&!this._focado&&(this.inputElement.value=r||""),this.syncState()}get value(){return this.inputElement?this.inputElement.value:this.getAttribute("value")||""}set value(t){if(this.setAttribute("value",t),this.inputElement)try{this.inputElement.value=t}catch{}this.syncState()}formResetCallback(){var t;this.inputElement.value=this._defaultValue,(t=this.internals)==null||t.setFormValue(this._defaultValue),this.syncState()}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("tipo")||this.getAttribute("type")||"text"}get disabled(){return this.hasAttribute("disabled")||this._formDisabled}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get minLength(){return b.inteiroOuNulo(this.getAttribute("minlength")??this.getAttribute("min-length"))??-1}set minLength(t){t>=0?this.setAttribute("minlength",String(t)):this.removeAttribute("minlength"),this.syncState()}get maxLength(){return b.inteiroOuNulo(this.getAttribute("maxlength")??this.getAttribute("max-length"))??-1}set maxLength(t){t>=0?this.setAttribute("maxlength",String(t)):this.removeAttribute("maxlength"),this.syncState()}get pattern(){return this.getAttribute("pattern")||""}set pattern(t){t?this.setAttribute("pattern",t):this.removeAttribute("pattern"),this.syncState()}atualizarValidade(){var l,c;const t=this.getAttribute("min"),e=this.getAttribute("max"),r=this.inputElement?this.inputElement.value:"",n=this.getAttribute("value")||r,o=!!((c=(l=this.inputElement)==null?void 0:l.validity)!=null&&c.badInput),u=x.validarRestricoesCampoTexto({val:r,rawVal:n,badInput:o,disabled:this.disabled,required:this.required,tipo:this.type,minlength:this.minLength>=0?this.minLength:null,maxlength:this.maxLength>=0?this.maxLength:null,min:t!==null?parseFloat(t):null,max:e!==null?parseFloat(e):null,step:this.getAttribute("step"),pattern:this.getAttribute("pattern"),customError:this._customErrorMessage,mensagemValidacao:this.getAttribute("mensagem-validacao")});x.aplicarValidadeInternals(this.internals,u,this.inputElement)}alternarVisibilidadeSenha(){var r;if(!(this.getAttribute("tipo")==="password"||this._senhaVisivel))return;this._senhaVisivel=!this._senhaVisivel,this.inputElement.type=this._senhaVisivel?"text":"password";const e=(r=this.shadowRoot)==null?void 0:r.querySelector('slot[name="icone-direita"]');e&&e.assignedElements().forEach(o=>{var u,l;(((u=o.textContent)==null?void 0:u.trim())==="👁️"||((l=o.textContent)==null?void 0:l.trim())==="🙈")&&(o.textContent=this._senhaVisivel?"🙈":"👁️")}),this.dispatchEvent(new CustomEvent("ui-toggle-senha",{detail:{visivel:this._senhaVisivel},bubbles:!0,composed:!0}))}syncState(){this.leftSlotElement.assignedNodes().length>0||this.querySelector('[slot="icone-esquerda"]')!==null?this.setAttribute("tem-icone-esquerda",""):this.removeAttribute("tem-icone-esquerda"),q.aplicarAlturaControle(this),v({labelElement:this.labelElement,inputElement:this.inputElement,labelText:this.getAttribute("label"),placeholderText:this.getAttribute("placeholder")||"",isFlutuante:this.hasAttribute("label-flutuante"),estaFocado:this._focado,obrigatorio:this.required}),this.sincronizarNomeAcessivel();const e=this.getAttribute("tipo")||this.getAttribute("type")||"text";if(!this._senhaVisivel)try{this.inputElement.type=e}catch{this.inputElement.type="text"}this.minLength>=0?this.inputElement.minLength=this.minLength:this.inputElement.removeAttribute("minlength"),this.maxLength>=0?this.inputElement.maxLength=this.maxLength:this.inputElement.removeAttribute("maxlength");const r=this.getAttribute("pattern");r!==null?this.inputElement.pattern=r:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const n=this.hasAttribute("disabled")||this._formDisabled,o=this.hasAttribute("readonly");this.inputElement.disabled=n,this.inputElement.readOnly=o,n?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const u=e==="password"||this.hasAttribute("alternar-senha");E(this.rightIconContainer,u,this._senhaVisivel);const l=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");y(this.wrapperElement,this.inputElement,this.helperElement,l,this.getAttribute("mensagem-erro"),this.getAttribute("helper-text")),this.helperElement.style.display==="none"?this.inputElement.removeAttribute("aria-describedby"):this.inputElement.setAttribute("aria-describedby",this.helperElement.id),this.required?this.inputElement.setAttribute("aria-required","true"):this.inputElement.removeAttribute("aria-required"),this.atualizarValidade()}sincronizarNomeAcessivel(){const t=this.getAttribute("label")?"":h.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class A extends d{}p.definirCustomElement("ui-campo-texto",d);p.definirCustomElement("ui-input",A);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=g;exports.FormAssociatedElement=m;exports.UICampoTexto=d;exports.UIInput=A;exports.criarTemplateCampoTexto=_;exports.renderizarRotulo=f;exports.sincronizarFeedbackErro=y;exports.sincronizarIconeSenha=E;exports.sincronizarLabelEPlaceholder=v;
|