@thibezer/ui-components-kit 2.9.0 → 2.10.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.
- package/CHANGELOG.md +87 -0
- package/README.md +6 -3
- package/dist/camadas.cjs +53 -55
- package/dist/camadas.js +254 -242
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +54 -53
- package/dist/canvas.js +2074 -1907
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-area-texto/area-texto-altura.d.ts +16 -0
- package/dist/components/ui-area-texto/area-texto-contador.d.ts +6 -0
- package/dist/components/ui-area-texto/area-texto-template.d.ts +2 -0
- package/dist/components/ui-area-texto/index.d.ts +3 -0
- package/dist/components/ui-area-texto/tipos.d.ts +19 -0
- package/dist/components/ui-area-texto/ui-area-texto.d.ts +100 -0
- package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +5 -1
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +1 -0
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +7 -1
- package/dist/components/ui-canvas-cad/cad-recusas.d.ts +6 -0
- package/dist/components/ui-card/card-interacao.d.ts +17 -0
- package/dist/components/ui-card/card-secoes.d.ts +10 -0
- package/dist/components/ui-card/ui-card.d.ts +23 -0
- package/dist/components/ui-texto/ui-texto.d.ts +16 -0
- package/dist/core/alvo-digitavel.d.ts +5 -0
- package/dist/core/opcoes.d.ts +7 -0
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +9 -8
- package/dist/custom-elements.json +18133 -15664
- package/dist/data.cjs +1 -1
- package/dist/data.js +1 -1
- package/dist/forms.cjs +1 -1
- package/dist/forms.d.ts +4 -0
- package/dist/forms.js +15 -12
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +2 -0
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +13 -1
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +3 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +13 -2
- package/dist/gerencigeo-canvas/mapa_core.d.ts +4 -0
- package/dist/gerencigeo-canvas/popup_residual.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +195 -191
- package/dist/opcoes-CupvWVIm.js +24 -0
- package/dist/opcoes-vdAUY5OI.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +9 -8
- package/dist/tipos-elementos.d.ts +74 -0
- package/dist/tipos-react.d.ts +4 -0
- package/dist/tipos-vue.d.ts +74 -0
- package/dist/{ui-badge-BWhoGgo9.js → ui-badge-B5J_c5P5.js} +1 -1
- package/dist/{ui-badge-SIR81R9l.cjs → ui-badge-DC4y6Dik.cjs} +1 -1
- package/dist/{ui-campo-texto-B_OHVGiN.js → ui-campo-texto-19tIrmBK.js} +91 -93
- package/dist/ui-campo-texto-CH8mzX61.cjs +16 -0
- package/dist/ui-card-0wu4rjEX.cjs +20 -0
- package/dist/ui-card-DRtpOo3l.js +143 -0
- package/dist/ui-controle-cores-BEUKOq4n.js +275 -0
- package/dist/ui-controle-cores-BLhrZHMh.cjs +32 -0
- package/dist/{ui-linha-BYAX4W6x.cjs → ui-linha-C306zxWG.cjs} +6 -6
- package/dist/{ui-linha-aqLlaYi7.js → ui-linha-C_azWkcG.js} +103 -99
- package/dist/ui-seletor-cor-2yGryC_Z.cjs +86 -0
- package/dist/ui-seletor-cor-BuyhoDZz.js +345 -0
- package/dist/{ui-switch-DO1R0Ce7.js → ui-switch-BL-x_-SM.js} +460 -173
- package/dist/ui-switch-C0i_3QXu.cjs +66 -0
- package/package.json +1 -1
- package/dist/opcoes-CJYLi6kd.js +0 -12
- package/dist/opcoes-CkyDxBuQ.cjs +0 -1
- package/dist/ui-campo-texto-DauJCde3.cjs +0 -16
- package/dist/ui-card-BNYCQ7g-.js +0 -119
- package/dist/ui-card-BrjBL-yo.cjs +0 -20
- package/dist/ui-controle-cores-DgEza3wF.js +0 -612
- package/dist/ui-controle-cores-uY__TgwW.cjs +0 -117
- package/dist/ui-switch-D9a8XlVX.cjs +0 -53
package/dist/tipos-vue.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { DefineComponent } from 'vue';
|
|
4
4
|
import type {
|
|
5
5
|
UIAlerta,
|
|
6
|
+
UIAreaTexto,
|
|
6
7
|
UIAvatar,
|
|
7
8
|
UIBadge,
|
|
8
9
|
UIBotao,
|
|
@@ -48,6 +49,7 @@ import type {
|
|
|
48
49
|
UITabela,
|
|
49
50
|
UITabelaPropriedades,
|
|
50
51
|
UITag,
|
|
52
|
+
UITextarea,
|
|
51
53
|
UITexto,
|
|
52
54
|
UIToast,
|
|
53
55
|
UIToggle,
|
|
@@ -73,6 +75,39 @@ type PropsVueUiAlerta = {
|
|
|
73
75
|
onUiToastAcao?: (evento: CustomEvent) => void;
|
|
74
76
|
};
|
|
75
77
|
|
|
78
|
+
/**
|
|
79
|
+
* `<ui-area-texto>`
|
|
80
|
+
* Eventos: ui-input, ui-change, ui-enviar
|
|
81
|
+
* Parts (::part): ajuda, campo, contador, input, rodape, rotulo
|
|
82
|
+
*/
|
|
83
|
+
type PropsVueUiAreaTexto = {
|
|
84
|
+
label?: ValorDeAtributo;
|
|
85
|
+
placeholder?: ValorDeAtributo;
|
|
86
|
+
value?: UIAreaTexto['value'];
|
|
87
|
+
obrigatorio?: UIAreaTexto['obrigatorio'];
|
|
88
|
+
minlength?: ValorDeAtributo;
|
|
89
|
+
maxlength?: ValorDeAtributo;
|
|
90
|
+
helperText?: ValorDeAtributo;
|
|
91
|
+
erro?: ValorDeAtributo;
|
|
92
|
+
mensagemErro?: ValorDeAtributo;
|
|
93
|
+
mensagemValidacao?: ValorDeAtributo;
|
|
94
|
+
disabled?: UIAreaTexto['disabled'];
|
|
95
|
+
readonly?: ValorDeAtributo;
|
|
96
|
+
linhas?: ValorDeAtributo;
|
|
97
|
+
autoAltura?: ValorDeAtributo;
|
|
98
|
+
linhasMax?: ValorDeAtributo;
|
|
99
|
+
redimensionar?: ValorDeAtributo;
|
|
100
|
+
contador?: ValorDeAtributo;
|
|
101
|
+
name?: UIAreaTexto['name'];
|
|
102
|
+
readOnly?: UIAreaTexto['readOnly'];
|
|
103
|
+
minLength?: UIAreaTexto['minLength'];
|
|
104
|
+
maxLength?: UIAreaTexto['maxLength'];
|
|
105
|
+
required?: UIAreaTexto['required'];
|
|
106
|
+
onUiInput?: (evento: CustomEvent) => void;
|
|
107
|
+
onUiChange?: (evento: CustomEvent) => void;
|
|
108
|
+
onUiEnviar?: (evento: CustomEvent) => void;
|
|
109
|
+
};
|
|
110
|
+
|
|
76
111
|
/**
|
|
77
112
|
* `<ui-avatar>`
|
|
78
113
|
*/
|
|
@@ -272,6 +307,7 @@ type PropsVueUiCanvasCad = {
|
|
|
272
307
|
semBarraRapida?: ValorDeAtributo;
|
|
273
308
|
popups?: UICanvasCAD['popups'];
|
|
274
309
|
renderizador?: UICanvasCAD['renderizador'];
|
|
310
|
+
semAvisos?: ValorDeAtributo;
|
|
275
311
|
pontos?: UICanvasCAD['pontos'];
|
|
276
312
|
segmentos?: UICanvasCAD['segmentos'];
|
|
277
313
|
bancoPontos?: UICanvasCAD['bancoPontos'];
|
|
@@ -305,6 +341,7 @@ type PropsVueUiCard = {
|
|
|
305
341
|
compacto?: ValorDeAtributo;
|
|
306
342
|
compact?: ValorDeAtributo;
|
|
307
343
|
disabled?: UICard['disabled'];
|
|
344
|
+
ariaLabel?: ValorDeAtributo;
|
|
308
345
|
onUiClick?: (evento: CustomEvent) => void;
|
|
309
346
|
onUiClique?: (evento: CustomEvent) => void;
|
|
310
347
|
};
|
|
@@ -1164,8 +1201,42 @@ type PropsVueUiTag = {
|
|
|
1164
1201
|
onUiRemove?: (evento: CustomEvent) => void;
|
|
1165
1202
|
};
|
|
1166
1203
|
|
|
1204
|
+
/**
|
|
1205
|
+
* `<ui-textarea>`
|
|
1206
|
+
* Eventos: ui-input, ui-change, ui-enviar
|
|
1207
|
+
* Parts (::part): ajuda, campo, contador, input, rodape, rotulo
|
|
1208
|
+
*/
|
|
1209
|
+
type PropsVueUiTextarea = {
|
|
1210
|
+
label?: ValorDeAtributo;
|
|
1211
|
+
placeholder?: ValorDeAtributo;
|
|
1212
|
+
value?: UITextarea['value'];
|
|
1213
|
+
obrigatorio?: UITextarea['obrigatorio'];
|
|
1214
|
+
minlength?: ValorDeAtributo;
|
|
1215
|
+
maxlength?: ValorDeAtributo;
|
|
1216
|
+
helperText?: ValorDeAtributo;
|
|
1217
|
+
erro?: ValorDeAtributo;
|
|
1218
|
+
mensagemErro?: ValorDeAtributo;
|
|
1219
|
+
mensagemValidacao?: ValorDeAtributo;
|
|
1220
|
+
disabled?: UITextarea['disabled'];
|
|
1221
|
+
readonly?: ValorDeAtributo;
|
|
1222
|
+
linhas?: ValorDeAtributo;
|
|
1223
|
+
autoAltura?: ValorDeAtributo;
|
|
1224
|
+
linhasMax?: ValorDeAtributo;
|
|
1225
|
+
redimensionar?: ValorDeAtributo;
|
|
1226
|
+
contador?: ValorDeAtributo;
|
|
1227
|
+
name?: UITextarea['name'];
|
|
1228
|
+
readOnly?: UITextarea['readOnly'];
|
|
1229
|
+
minLength?: UITextarea['minLength'];
|
|
1230
|
+
maxLength?: UITextarea['maxLength'];
|
|
1231
|
+
required?: UITextarea['required'];
|
|
1232
|
+
onUiInput?: (evento: CustomEvent) => void;
|
|
1233
|
+
onUiChange?: (evento: CustomEvent) => void;
|
|
1234
|
+
onUiEnviar?: (evento: CustomEvent) => void;
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1167
1237
|
/**
|
|
1168
1238
|
* `<ui-texto>`
|
|
1239
|
+
* Parts (::part): base
|
|
1169
1240
|
*/
|
|
1170
1241
|
type PropsVueUiTexto = {
|
|
1171
1242
|
variante?: ValorDeAtributo;
|
|
@@ -1174,6 +1245,7 @@ type PropsVueUiTexto = {
|
|
|
1174
1245
|
peso?: ValorDeAtributo;
|
|
1175
1246
|
alinhamento?: ValorDeAtributo;
|
|
1176
1247
|
truncar?: ValorDeAtributo;
|
|
1248
|
+
linhas?: ValorDeAtributo;
|
|
1177
1249
|
};
|
|
1178
1250
|
|
|
1179
1251
|
/**
|
|
@@ -1236,6 +1308,7 @@ type PropsVueUiTooltip = {
|
|
|
1236
1308
|
declare module 'vue' {
|
|
1237
1309
|
interface GlobalComponents {
|
|
1238
1310
|
'ui-alerta': DefineComponent<PropsVueUiAlerta>;
|
|
1311
|
+
'ui-area-texto': DefineComponent<PropsVueUiAreaTexto>;
|
|
1239
1312
|
'ui-avatar': DefineComponent<PropsVueUiAvatar>;
|
|
1240
1313
|
'ui-badge': DefineComponent<PropsVueUiBadge>;
|
|
1241
1314
|
'ui-botao': DefineComponent<PropsVueUiBotao>;
|
|
@@ -1281,6 +1354,7 @@ declare module 'vue' {
|
|
|
1281
1354
|
'ui-tabela': DefineComponent<PropsVueUiTabela>;
|
|
1282
1355
|
'ui-tabela-propriedades': DefineComponent<PropsVueUiTabelaPropriedades>;
|
|
1283
1356
|
'ui-tag': DefineComponent<PropsVueUiTag>;
|
|
1357
|
+
'ui-textarea': DefineComponent<PropsVueUiTextarea>;
|
|
1284
1358
|
'ui-texto': DefineComponent<PropsVueUiTexto>;
|
|
1285
1359
|
'ui-toast': DefineComponent<PropsVueUiToast>;
|
|
1286
1360
|
'ui-toggle': DefineComponent<PropsVueUiToggle>;
|
|
@@ -2,7 +2,7 @@ var m = Object.defineProperty;
|
|
|
2
2
|
var v = (i, o, e) => o in i ? m(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
|
|
3
3
|
var t = (i, o, e) => v(i, typeof o != "symbol" ? o + "" : o, e);
|
|
4
4
|
import { d as s, S as g } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
-
import { e as d } from "./opcoes-
|
|
5
|
+
import { e as d } from "./opcoes-CupvWVIm.js";
|
|
6
6
|
import { g as p } from "./acessibilidade-CUlSXc2X.js";
|
|
7
7
|
import { L as h } from "./listener-bag-DQgv7OON.js";
|
|
8
8
|
const x = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-stat{padding:18px 20px;border-radius:var(--ui-raio-borda, 10px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));background-color:var(--ui-cor-fundo-card, #18181c);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;display:flex;flex-direction:column;position:relative;transition:border-color .15s ease,box-shadow .15s ease}.ui-stat--baixa{box-shadow:var(--ui-sombra-sm, 0 2px 6px rgba(0, 0, 0, .3))}.ui-stat--media{box-shadow:var(--ui-sombra-md, 0 4px 14px rgba(0, 0, 0, .4))}.ui-stat--alta{box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .5))}.ui-stat__cabecalho{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;gap:8px}.ui-stat__rotulo{font-size:13px;font-weight:500;color:var(--ui-cor-texto-secundario, #888899);letter-spacing:.01em}.ui-stat__icone-slot{display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #888899)}.ui-stat__icone-slot svg,.ui-stat__icone-slot ::slotted(svg),.ui-stat__icone-slot ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-stat__conteudo{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:6px}.ui-stat__valor{font-size:28px;font-weight:700;color:var(--ui-cor-texto, #ffffff);line-height:1.15;letter-spacing:-.025em}.ui-stat__indicador{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:5px;font-size:12px;font-weight:600;line-height:1}.ui-stat__indicador--positivo,.ui-stat__indicador--alta{background-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 14%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-stat__indicador--negativo,.ui-stat__indicador--baixa{background-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 14%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-stat__indicador--neutro{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);color:var(--ui-cor-texto-secundario, #888899)}.ui-stat__seta{font-size:.85em;line-height:1}.ui-stat__rodape{display:flex;flex-direction:column;gap:6px}.ui-stat__descricao{font-size:12px;color:var(--ui-cor-texto-secundario, #888899);line-height:1.3}', f = ["baixa", "media", "alta"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var x=(i,o,e)=>o in i?h(i,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[o]=e;var t=(i,o,e)=>x(i,typeof o!="symbol"?o+"":o,e);const s=require("./ssr-safe-CiHD1adl.cjs"),b=require("./opcoes-
|
|
1
|
+
"use strict";var h=Object.defineProperty;var x=(i,o,e)=>o in i?h(i,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[o]=e;var t=(i,o,e)=>x(i,typeof o!="symbol"?o+"":o,e);const s=require("./ssr-safe-CiHD1adl.cjs"),b=require("./opcoes-vdAUY5OI.cjs"),f=require("./acessibilidade-CSzX-DkG.cjs"),_=require("./listener-bag-D5omxZ9h.cjs"),E=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-stat{padding:18px 20px;border-radius:var(--ui-raio-borda, 10px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));background-color:var(--ui-cor-fundo-card, #18181c);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;display:flex;flex-direction:column;position:relative;transition:border-color .15s ease,box-shadow .15s ease}.ui-stat--baixa{box-shadow:var(--ui-sombra-sm, 0 2px 6px rgba(0, 0, 0, .3))}.ui-stat--media{box-shadow:var(--ui-sombra-md, 0 4px 14px rgba(0, 0, 0, .4))}.ui-stat--alta{box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .5))}.ui-stat__cabecalho{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;gap:8px}.ui-stat__rotulo{font-size:13px;font-weight:500;color:var(--ui-cor-texto-secundario, #888899);letter-spacing:.01em}.ui-stat__icone-slot{display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #888899)}.ui-stat__icone-slot svg,.ui-stat__icone-slot ::slotted(svg),.ui-stat__icone-slot ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-stat__conteudo{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:6px}.ui-stat__valor{font-size:28px;font-weight:700;color:var(--ui-cor-texto, #ffffff);line-height:1.15;letter-spacing:-.025em}.ui-stat__indicador{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:5px;font-size:12px;font-weight:600;line-height:1}.ui-stat__indicador--positivo,.ui-stat__indicador--alta{background-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 14%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-stat__indicador--negativo,.ui-stat__indicador--baixa{background-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 14%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-stat__indicador--neutro{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);color:var(--ui-cor-texto-secundario, #888899)}.ui-stat__seta{font-size:.85em;line-height:1}.ui-stat__rodape{display:flex;flex-direction:column;gap:6px}.ui-stat__descricao{font-size:12px;color:var(--ui-cor-texto-secundario, #888899);line-height:1.3}',y=["baixa","media","alta"];class d extends s.SafeHTMLElement{constructor(){super();t(this,"statElement");t(this,"rotuloElement");t(this,"valorElement");t(this,"indicadorElement");t(this,"setaElement");t(this,"variacaoElement");t(this,"descricaoElement");const e=this.attachShadow({mode:"open"});e.innerHTML=`
|
|
2
2
|
<style>${E}</style>
|
|
3
3
|
<div class="ui-stat" role="group">
|
|
4
4
|
<div class="ui-stat__cabecalho">
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { S as
|
|
5
|
-
import { b as
|
|
6
|
-
import {
|
|
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";
|
|
7
9
|
import { v as A, a as w } from "./form-validacao-BlQFxUVj.js";
|
|
8
10
|
import { a as S } from "./form-submissao-C-SPRKgT.js";
|
|
9
|
-
const
|
|
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 = [
|
|
10
12
|
"label",
|
|
11
13
|
"placeholder",
|
|
12
14
|
"value",
|
|
@@ -37,9 +39,9 @@ const k = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizin
|
|
|
37
39
|
"densidade",
|
|
38
40
|
"aria-label"
|
|
39
41
|
];
|
|
40
|
-
function
|
|
42
|
+
function C() {
|
|
41
43
|
return `
|
|
42
|
-
<style>${
|
|
44
|
+
<style>${V}</style>
|
|
43
45
|
<div class="ui-campo-texto__container">
|
|
44
46
|
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
45
47
|
<div class="ui-campo-texto__wrapper" part="campo">
|
|
@@ -52,36 +54,36 @@ function I() {
|
|
|
52
54
|
</span>
|
|
53
55
|
</div>
|
|
54
56
|
</div>
|
|
55
|
-
<div class="ui-campo-texto__helper" part="ajuda" style="display: none;"></div>
|
|
57
|
+
<div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
|
|
56
58
|
`;
|
|
57
59
|
}
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
|
|
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);
|
|
62
64
|
}
|
|
63
|
-
function
|
|
64
|
-
const { labelElement: s, inputElement: t, labelText: e, placeholderText:
|
|
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() !== "";
|
|
65
67
|
let h = !1;
|
|
66
68
|
try {
|
|
67
69
|
h = t.matches(":-webkit-autofill");
|
|
68
70
|
} catch {
|
|
69
71
|
h = !1;
|
|
70
72
|
}
|
|
71
|
-
e ? (
|
|
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;
|
|
72
74
|
}
|
|
73
|
-
function
|
|
74
|
-
s ? (
|
|
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"));
|
|
75
77
|
}
|
|
76
|
-
function z(
|
|
77
|
-
e ? (
|
|
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";
|
|
78
80
|
}
|
|
79
|
-
class
|
|
81
|
+
class m extends x {
|
|
80
82
|
constructor() {
|
|
81
83
|
super();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
i(this, "internals");
|
|
85
|
+
i(this, "_formDisabled", !1);
|
|
86
|
+
i(this, "_customErrorMessage", "");
|
|
85
87
|
this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : {};
|
|
86
88
|
}
|
|
87
89
|
// === Ciclo de Vida Form-Associated Custom Elements ===
|
|
@@ -129,51 +131,52 @@ class d extends f {
|
|
|
129
131
|
this._customErrorMessage = t || "", this.atualizarValidade();
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
|
|
133
|
-
class
|
|
134
|
+
i(m, "formAssociated", !0);
|
|
135
|
+
class d extends m {
|
|
134
136
|
constructor() {
|
|
135
137
|
super();
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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", () => {
|
|
148
151
|
this.syncState();
|
|
149
152
|
});
|
|
150
|
-
|
|
153
|
+
i(this, "handleHostClick", (t) => {
|
|
151
154
|
y(this, t) && !this.disabled && this.inputElement.focus();
|
|
152
155
|
});
|
|
153
|
-
|
|
156
|
+
i(this, "handleRightIconClick", (t) => {
|
|
154
157
|
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
155
158
|
});
|
|
156
|
-
|
|
159
|
+
i(this, "handleRightIconKeyDown", (t) => {
|
|
157
160
|
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
158
161
|
});
|
|
159
|
-
|
|
162
|
+
i(this, "handleFocus", () => {
|
|
160
163
|
this._focado = !0, this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"), this.syncState();
|
|
161
164
|
});
|
|
162
|
-
|
|
165
|
+
i(this, "handleBlur", () => {
|
|
163
166
|
this._focado = !1, this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"), this.syncState();
|
|
164
167
|
});
|
|
165
168
|
/**
|
|
166
169
|
* Enter submete o formulário como num <input> nativo. Aguarda um tick para que
|
|
167
170
|
* ouvintes do consumidor possam cancelar com `preventDefault()` no keydown.
|
|
168
171
|
*/
|
|
169
|
-
|
|
172
|
+
i(this, "handleKeyDown", (t) => {
|
|
170
173
|
if (t.key !== "Enter" || t.isComposing || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
171
174
|
const e = this.form;
|
|
172
175
|
e && setTimeout(() => {
|
|
173
176
|
!t.defaultPrevented && this.isConnected && S(e);
|
|
174
177
|
});
|
|
175
178
|
});
|
|
176
|
-
|
|
179
|
+
i(this, "handleInput", (t) => {
|
|
177
180
|
t.stopPropagation();
|
|
178
181
|
const e = t.target.value;
|
|
179
182
|
this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
|
|
@@ -189,7 +192,7 @@ class b extends d {
|
|
|
189
192
|
})
|
|
190
193
|
);
|
|
191
194
|
});
|
|
192
|
-
|
|
195
|
+
i(this, "handleChange", (t) => {
|
|
193
196
|
t.stopPropagation();
|
|
194
197
|
const e = t.target.value;
|
|
195
198
|
this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
|
|
@@ -206,10 +209,10 @@ class b extends d {
|
|
|
206
209
|
);
|
|
207
210
|
});
|
|
208
211
|
const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
|
|
209
|
-
t.innerHTML =
|
|
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`;
|
|
210
213
|
}
|
|
211
214
|
static get observedAttributes() {
|
|
212
|
-
return
|
|
215
|
+
return k;
|
|
213
216
|
}
|
|
214
217
|
focus(t) {
|
|
215
218
|
this.inputElement.focus(t);
|
|
@@ -218,13 +221,13 @@ class b extends d {
|
|
|
218
221
|
this.inputElement.blur();
|
|
219
222
|
}
|
|
220
223
|
connectedCallback() {
|
|
221
|
-
this.
|
|
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);
|
|
222
225
|
}
|
|
223
226
|
disconnectedCallback() {
|
|
224
|
-
this.
|
|
227
|
+
this.listeners.cleanup(), this._checkTimer && clearTimeout(this._checkTimer), this._checkTimer = null;
|
|
225
228
|
}
|
|
226
|
-
attributeChangedCallback(t, e,
|
|
227
|
-
t === "value" &&
|
|
229
|
+
attributeChangedCallback(t, e, r) {
|
|
230
|
+
t === "value" && r !== this.inputElement.value && !this._focado && (this.inputElement.value = r || ""), this.syncState();
|
|
228
231
|
}
|
|
229
232
|
get value() {
|
|
230
233
|
return this.inputElement ? this.inputElement.value : this.getAttribute("value") || "";
|
|
@@ -261,15 +264,13 @@ class b extends d {
|
|
|
261
264
|
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
262
265
|
}
|
|
263
266
|
get minLength() {
|
|
264
|
-
|
|
265
|
-
return t ? parseInt(t, 10) : -1;
|
|
267
|
+
return c(this.getAttribute("minlength") ?? this.getAttribute("min-length")) ?? -1;
|
|
266
268
|
}
|
|
267
269
|
set minLength(t) {
|
|
268
270
|
t >= 0 ? this.setAttribute("minlength", String(t)) : this.removeAttribute("minlength"), this.syncState();
|
|
269
271
|
}
|
|
270
272
|
get maxLength() {
|
|
271
|
-
|
|
272
|
-
return t ? parseInt(t, 10) : -1;
|
|
273
|
+
return c(this.getAttribute("maxlength") ?? this.getAttribute("max-length")) ?? -1;
|
|
273
274
|
}
|
|
274
275
|
set maxLength(t) {
|
|
275
276
|
t >= 0 ? this.setAttribute("maxlength", String(t)) : this.removeAttribute("maxlength"), this.syncState();
|
|
@@ -281,33 +282,33 @@ class b extends d {
|
|
|
281
282
|
t ? this.setAttribute("pattern", t) : this.removeAttribute("pattern"), this.syncState();
|
|
282
283
|
}
|
|
283
284
|
atualizarValidade() {
|
|
284
|
-
var
|
|
285
|
-
const t = this.getAttribute("
|
|
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({
|
|
286
287
|
val: r,
|
|
287
|
-
rawVal:
|
|
288
|
-
badInput:
|
|
288
|
+
rawVal: o,
|
|
289
|
+
badInput: n,
|
|
289
290
|
disabled: this.disabled,
|
|
290
291
|
required: this.required,
|
|
291
292
|
tipo: this.type,
|
|
292
|
-
minlength:
|
|
293
|
-
maxlength:
|
|
294
|
-
min:
|
|
295
|
-
max:
|
|
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,
|
|
296
297
|
step: this.getAttribute("step"),
|
|
297
298
|
pattern: this.getAttribute("pattern"),
|
|
298
299
|
customError: this._customErrorMessage,
|
|
299
300
|
mensagemValidacao: this.getAttribute("mensagem-validacao")
|
|
300
301
|
});
|
|
301
|
-
w(this.internals,
|
|
302
|
+
w(this.internals, u, this.inputElement);
|
|
302
303
|
}
|
|
303
304
|
alternarVisibilidadeSenha() {
|
|
304
|
-
var
|
|
305
|
+
var r;
|
|
305
306
|
if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
|
|
306
307
|
this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
|
|
307
|
-
const e = (
|
|
308
|
-
e && e.assignedElements().forEach((
|
|
309
|
-
var
|
|
310
|
-
(((
|
|
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 ? "🙈" : "👁️");
|
|
311
312
|
}), this.dispatchEvent(
|
|
312
313
|
new CustomEvent("ui-toggle-senha", {
|
|
313
314
|
detail: { visivel: this._senhaVisivel },
|
|
@@ -317,7 +318,7 @@ class b extends d {
|
|
|
317
318
|
);
|
|
318
319
|
}
|
|
319
320
|
syncState() {
|
|
320
|
-
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda"),
|
|
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({
|
|
321
322
|
labelElement: this.labelElement,
|
|
322
323
|
inputElement: this.inputElement,
|
|
323
324
|
labelText: this.getAttribute("label"),
|
|
@@ -333,25 +334,22 @@ class b extends d {
|
|
|
333
334
|
} catch {
|
|
334
335
|
this.inputElement.type = "text";
|
|
335
336
|
}
|
|
336
|
-
|
|
337
|
-
n !== null ? this.inputElement.minLength = parseInt(n, 10) : this.inputElement.removeAttribute("minlength");
|
|
338
|
-
const o = this.getAttribute("maxlength") ?? this.getAttribute("max-length");
|
|
339
|
-
o !== null ? this.inputElement.maxLength = parseInt(o, 10) : this.inputElement.removeAttribute("maxlength");
|
|
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");
|
|
340
338
|
const r = this.getAttribute("pattern");
|
|
341
339
|
r !== null ? this.inputElement.pattern = r : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
|
|
342
|
-
const
|
|
343
|
-
this.inputElement.disabled =
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
const
|
|
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");
|
|
347
345
|
z(
|
|
348
346
|
this.wrapperElement,
|
|
349
347
|
this.inputElement,
|
|
350
348
|
this.helperElement,
|
|
351
|
-
|
|
349
|
+
l,
|
|
352
350
|
this.getAttribute("mensagem-erro"),
|
|
353
351
|
this.getAttribute("helper-text")
|
|
354
|
-
), this.atualizarValidade();
|
|
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();
|
|
355
353
|
}
|
|
356
354
|
/**
|
|
357
355
|
* Sem o atributo `label`, o input nativo herda o nome acessível de fora do Shadow DOM
|
|
@@ -362,18 +360,18 @@ class b extends d {
|
|
|
362
360
|
t ? this.inputElement.setAttribute("aria-label", t) : this.inputElement.removeAttribute("aria-label");
|
|
363
361
|
}
|
|
364
362
|
}
|
|
365
|
-
class T extends
|
|
363
|
+
class T extends d {
|
|
366
364
|
}
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
p("ui-campo-texto", d);
|
|
366
|
+
p("ui-input", T);
|
|
369
367
|
export {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
368
|
+
k as A,
|
|
369
|
+
m as F,
|
|
370
|
+
d as U,
|
|
373
371
|
T as a,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
372
|
+
L as b,
|
|
373
|
+
C as c,
|
|
374
|
+
I as d,
|
|
375
|
+
q as r,
|
|
378
376
|
z as s
|
|
379
377
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|