@thibezer/ui-components-kit 2.14.0 โ†’ 2.17.0

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +63 -9
  2. package/README.md +4 -2
  3. package/dist/botao.cjs +1 -1
  4. package/dist/botao.js +1 -1
  5. package/dist/camadas.cjs +50 -50
  6. package/dist/camadas.js +381 -373
  7. package/dist/campo-texto.cjs +1 -1
  8. package/dist/campo-texto.js +1 -1
  9. package/dist/canvas.cjs +24 -24
  10. package/dist/canvas.js +757 -751
  11. package/dist/card.cjs +1 -1
  12. package/dist/card.js +1 -1
  13. package/dist/components/ui-avatar/ui-avatar.d.ts +7 -0
  14. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +2 -0
  15. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +7 -0
  16. package/dist/components/ui-mapa/ui-mapa.d.ts +1 -0
  17. package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +6 -0
  18. package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
  19. package/dist/components/ui-stat/ui-stat.d.ts +12 -0
  20. package/dist/components/ui-tabela/tabela-corpo.d.ts +5 -0
  21. package/dist/components/ui-tabela/tabela-foco.d.ts +28 -0
  22. package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +3 -0
  23. package/dist/components/ui-tabela/tabela-renderizador.d.ts +3 -0
  24. package/dist/components/ui-tabela/tipos.d.ts +7 -1
  25. package/dist/components/ui-tabela/ui-tabela.d.ts +6 -1
  26. package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +2 -1
  27. package/dist/components/ui-tabela-propriedades/propriedades-persistencia.d.ts +63 -0
  28. package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +1 -0
  29. package/dist/components/ui-tabela-propriedades/tipos.d.ts +16 -0
  30. package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +40 -1
  31. package/dist/core/degrade.d.ts +34 -0
  32. package/dist/core/index.d.ts +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +33 -24
  35. package/dist/cores.cjs +1 -1
  36. package/dist/cores.js +1 -1
  37. package/dist/custom-elements.json +20309 -18611
  38. package/dist/data.cjs +1 -1
  39. package/dist/data.js +89 -79
  40. package/dist/degrade-CIxvOTUv.cjs +1 -0
  41. package/dist/degrade-gDa5sW__.js +119 -0
  42. package/dist/feedback.cjs +1 -1
  43. package/dist/feedback.js +2 -2
  44. package/dist/forms.cjs +1 -1
  45. package/dist/forms.js +2 -2
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +215 -196
  49. package/dist/mapa.cjs +1 -1
  50. package/dist/mapa.js +1 -1
  51. package/dist/modal.cjs +1 -1
  52. package/dist/modal.js +1 -1
  53. package/dist/register.cjs +1 -1
  54. package/dist/register.js +11 -11
  55. package/dist/seletor-mapa-base.cjs +10 -10
  56. package/dist/seletor-mapa-base.js +34 -28
  57. package/dist/tabela.cjs +1 -1
  58. package/dist/tabela.js +83 -73
  59. package/dist/tipos-elementos.d.ts +33 -3
  60. package/dist/tipos-vue.d.ts +30 -3
  61. package/dist/tools.cjs +1 -1
  62. package/dist/tools.js +1 -1
  63. package/dist/ui-badge-1UU8vT-b.js +198 -0
  64. package/dist/ui-badge-CKKKPdt8.cjs +28 -0
  65. package/dist/ui-badge-DE58YSBY.cjs +28 -0
  66. package/dist/ui-badge-KgmI3jOD.js +201 -0
  67. package/dist/ui-botao-Dz8YvmiA.cjs +12 -0
  68. package/dist/ui-botao-bU_bf6SU.js +166 -0
  69. package/dist/ui-botao-xTbH5mpH.cjs +12 -0
  70. package/dist/ui-botao-zLkcMMyP.js +168 -0
  71. package/dist/ui-campo-texto-DVU_sWV1.cjs +16 -0
  72. package/dist/ui-campo-texto-Dliyt9qr.cjs +16 -0
  73. package/dist/ui-campo-texto-W5M0gNE4.js +377 -0
  74. package/dist/ui-campo-texto-btevggO3.js +379 -0
  75. package/dist/ui-card-BYyYxxY1.cjs +20 -0
  76. package/dist/ui-card-CojoGXaT.js +144 -0
  77. package/dist/ui-card-DFnRp9bl.js +146 -0
  78. package/dist/ui-card-DrWVJQKw.cjs +20 -0
  79. package/dist/ui-controle-cores-Bq_XUrIQ.cjs +32 -0
  80. package/dist/ui-controle-cores-BtA6yzu3.js +291 -0
  81. package/dist/ui-kit.css +1 -1
  82. package/dist/ui-linha-2kY7TNUJ.cjs +38 -0
  83. package/dist/ui-linha-DAz6DBcl.cjs +38 -0
  84. package/dist/ui-linha-DkxwMhD-.js +749 -0
  85. package/dist/ui-linha-KFF86FW5.js +752 -0
  86. package/dist/ui-modal-4nU-tXjO.cjs +18 -0
  87. package/dist/ui-modal-BrXzVZ65.js +216 -0
  88. package/dist/ui-modal-BwB9fksp.js +214 -0
  89. package/dist/ui-modal-lARKzEVZ.cjs +18 -0
  90. package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +1245 -0
  91. package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +21 -0
  92. package/dist/ui-skeleton-BLEV6h3k.js +653 -0
  93. package/dist/ui-skeleton-B_XTaGrX.cjs +52 -0
  94. package/dist/ui-skeleton-DEHwpDqa.js +648 -0
  95. package/dist/ui-skeleton-sIphhOSx.cjs +52 -0
  96. package/dist/ui-switch-BXIDwC-Y.cjs +66 -0
  97. package/dist/ui-switch-Ctxk-jKS.js +1212 -0
  98. package/dist/ui-switch-DAIgOhqr.cjs +66 -0
  99. package/dist/ui-switch-_F8yubdX.js +1203 -0
  100. package/dist/ui-tabela-propriedades-2bq2nX-b.js +3202 -0
  101. package/dist/ui-tabela-propriedades-8IAYmk3P.cjs +142 -0
  102. package/dist/ui-tabela-propriedades-BoYXzP5Z.js +3191 -0
  103. package/dist/ui-tabela-propriedades-CJyo568n.js +3517 -0
  104. package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +142 -0
  105. package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +142 -0
  106. package/package.json +187 -187
@@ -0,0 +1,377 @@
1
+ var b = Object.defineProperty;
2
+ var x = (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) => x(a, typeof s != "symbol" ? s + "" : s, t);
4
+ import { S as g, d as p } from "./ssr-safe-5cWfJP-s.js";
5
+ import { b as _ } from "./altura-controle-vxQiXG4q.js";
6
+ import { L as f } 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}}: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)}', 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 q() {
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 C(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: n, estaFocado: o, 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 ? (C(s, e, !!u, "ui-campo-texto__asterisco"), s.style.display = "flex", n && (o || l || h) ? s.classList.add("ui-campo-texto__label--ativa") : s.classList.remove("ui-campo-texto__label--ativa")) : s.style.display = "none", n && !o && !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, n, o = "ui-campo-texto") {
79
+ 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";
80
+ }
81
+ class m extends g {
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 f());
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 = q(), 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 : "", n = this.getAttribute("value") || r, o = !!((h = (l = this.inputElement) == null ? void 0 : l.validity) != null && h.badInput), u = A({
287
+ val: r,
288
+ rawVal: n,
289
+ badInput: o,
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((o) => {
310
+ var u, l;
311
+ (((u = o.textContent) == null ? void 0 : u.trim()) === "๐Ÿ‘๏ธ" || ((l = o.textContent) == null ? void 0 : l.trim()) === "๐Ÿ™ˆ") && (o.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"), _(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 n = this.hasAttribute("disabled") || this._formDisabled, o = this.hasAttribute("readonly");
341
+ 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");
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
+ q as c,
374
+ I as d,
375
+ C as r,
376
+ z as s
377
+ };