@thibezer/ui-components-kit 2.6.1 → 2.8.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 +265 -204
- package/README.md +815 -791
- package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
- package/dist/acessibilidade-CUlSXc2X.js +38 -0
- package/dist/altura-controle-ukMRPckR.cjs +1 -0
- package/dist/altura-controle-vxQiXG4q.js +62 -0
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +94 -94
- package/dist/camadas.js +1218 -1124
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +66 -65
- package/dist/canvas.js +3769 -3389
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-alerta/ui-toast.d.ts +4 -15
- package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
- package/dist/components/ui-badge/ui-badge.d.ts +2 -0
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +16 -0
- package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +14 -0
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +17 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +1 -7
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
- package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
- package/dist/components/ui-camadas/camadas-render.d.ts +14 -0
- package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +3 -5
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
- package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +24 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +26 -106
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
- package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
- package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +4 -1
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
- package/dist/components/ui-linha/index.d.ts +1 -0
- package/dist/components/ui-linha/ui-linha.d.ts +48 -0
- package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
- package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
- package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
- package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
- package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
- package/dist/components/ui-mapa/tipos.d.ts +13 -0
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
- package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
- package/dist/components/ui-modal/modal-foco.d.ts +28 -0
- package/dist/components/ui-modal/ui-modal.d.ts +1 -11
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
- package/dist/components/ui-radio/ui-radio.d.ts +9 -2
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
- package/dist/components/ui-switch/ui-switch.d.ts +3 -1
- package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
- package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
- package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
- package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
- package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
- package/dist/core/altura-controle.d.ts +34 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/opcoes.d.ts +9 -0
- package/dist/core/rotulo-controle.d.ts +13 -0
- package/dist/core/tipos-toast.d.ts +16 -0
- package/dist/core/ui-bus.d.ts +9 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +29 -19
- package/dist/custom-elements.json +20984 -15700
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +21 -21
- package/dist/form-validacao-BlQFxUVj.js +104 -0
- package/dist/form-validacao-DIeyQVH5.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +178 -177
- package/dist/mapa.cjs +11 -16
- package/dist/mapa.js +242 -170
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/opcoes-CJYLi6kd.js +12 -0
- package/dist/opcoes-CkyDxBuQ.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +13 -14
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +33 -3
- package/dist/tipos-react.d.ts +2 -0
- package/dist/tipos-vue.d.ts +32 -3
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BWhoGgo9.js +197 -0
- package/dist/ui-badge-SIR81R9l.cjs +28 -0
- package/dist/ui-botao-D24oXySA.cjs +12 -0
- package/dist/ui-botao-Dsj08jjw.js +165 -0
- package/dist/{zero-js-triggers-C_KrvFOQ.js → ui-bus-CUd99VJi.js} +36 -103
- package/dist/ui-bus-XqBLlTYQ.cjs +1 -0
- package/dist/{ui-campo-texto-Uu2dJE_0.js → ui-campo-texto-B_OHVGiN.js} +51 -51
- package/dist/ui-campo-texto-DauJCde3.cjs +16 -0
- package/dist/{ui-card-C_o5_0cB.js → ui-card-BNYCQ7g-.js} +50 -42
- package/dist/ui-card-BrjBL-yo.cjs +20 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-linha-C6HBnsaw.cjs +19 -0
- package/dist/{ui-segmented-wUraId2e.js → ui-linha-nCDh2wPm.js} +200 -105
- package/dist/{ui-modal-DBOtSTbR.js → ui-modal-BkYvNP0G.js} +116 -140
- package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
- package/dist/{ui-paleta-ferramentas-DNN5i6nL.js → ui-paleta-ferramentas-Ksh6gMW3.js} +359 -329
- package/dist/{ui-paleta-ferramentas-Ccmo-rB5.cjs → ui-paleta-ferramentas-bDLPbiGA.cjs} +7 -7
- package/dist/ui-skeleton-B2Rgrv8o.js +648 -0
- package/dist/ui-skeleton-DiOxTBZK.cjs +52 -0
- package/dist/ui-switch-D9a8XlVX.cjs +53 -0
- package/dist/{ui-switch-BcOqOkiV.js → ui-switch-DO1R0Ce7.js} +187 -128
- package/dist/{ui-tabela-propriedades-BokvDD3b.js → ui-tabela-propriedades-D9Echt2X.js} +845 -826
- package/dist/{ui-tabela-propriedades-BecPqC-e.cjs → ui-tabela-propriedades-DzZlyNZ_.cjs} +10 -10
- package/dist/zero-js-triggers-CJT988bR.js +83 -0
- package/dist/zero-js-triggers-CgM9IIQB.cjs +1 -0
- package/package.json +9 -2
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var m = (l, s, t) => s in l ? h(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
|
|
3
|
+
var a = (l, s, t) => m(l, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { L as f } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { d as b, S as g } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
+
import { s as v } from "./form-submissao-C-SPRKgT.js";
|
|
7
|
+
import { b as x } from "./altura-controle-vxQiXG4q.js";
|
|
8
|
+
const y = ':host{display:inline-block;width:100%;box-sizing:border-box}:host([inline]){width:auto;height:auto;vertical-align:middle}.ui-botao-primario{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-espaco-sm, 6px);width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);box-sizing:border-box;padding:0 12px;border:1px solid transparent;border-radius:var(--ui-raio-borda, 6px);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:clamp(11px,.85rem,13px);font-weight:600;line-height:1;transition:background-color .15s cubic-bezier(.16,1,.3,1),border-color .15s cubic-bezier(.16,1,.3,1),color .15s cubic-bezier(.16,1,.3,1),filter .15s cubic-bezier(.16,1,.3,1),transform .12s cubic-bezier(.34,1.56,.64,1),box-shadow .15s ease;text-align:center;-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-botao-primario:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-botao-primario--has-icon-start{padding-left:8px!important;padding-right:12px!important}.ui-botao-primario--has-icon-end{padding-left:12px!important;padding-right:8px!important}::slotted(svg),::slotted(ui-icone){display:inline-flex!important;align-items:center!important;justify-content:center!important;vertical-align:middle!important;flex-shrink:0!important;line-height:1!important;width:14px!important;height:14px!important;box-sizing:content-box;shape-rendering:geometricPrecision}::slotted(span),::slotted(label),::slotted(p){display:inline-flex;align-items:center;line-height:1;transform:translateY(-.5px)}::slotted(div){display:inline-flex;align-items:center;justify-content:center;line-height:1;height:100%}.ui-botao-primario,.ui-botao-primario--primary,.ui-botao-primario--primario{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border-color:transparent}.ui-botao-primario--primary:hover:not(:disabled),.ui-botao-primario--primario:hover:not(:disabled),.ui-botao-primario:hover:not(:disabled){filter:brightness(1.1)}.ui-botao-primario--destaque{background:var(--ui-cor-destaque, var(--ui-cor-primaria, #00E08A));color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-botao-primario--secondary,.ui-botao-primario--secundario{background:var(--ui-cor-botao-secundario-fundo, #1e1e24);color:var(--ui-cor-texto, #e1e1e6);border-color:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-botao-primario--secondary:hover:not(:disabled),.ui-botao-primario--secundario:hover:not(:disabled){background:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 24%,transparent)}.ui-botao-primario--ghost,.ui-botao-primario--terciario{background:transparent;color:var(--ui-cor-texto, #e1e1e6);border-color:transparent}.ui-botao-primario--ghost:hover:not(:disabled),.ui-botao-primario--terciario:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-botao-primario--destructive,.ui-botao-primario--destrutivo,.ui-botao-primario--erro{background:var(--ui-cor-botao-destrutivo-fundo, #ff4444);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:transparent}.ui-botao-primario--destructive:hover:not(:disabled),.ui-botao-primario--destrutivo:hover:not(:disabled),.ui-botao-primario--erro:hover:not(:disabled){background:var(--ui-cor-botao-destrutivo-hover, #e03333)}.ui-botao-primario--outline,.ui-botao-primario--borda{background:transparent;color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A)}.ui-botao-primario--outline:hover:not(:disabled),.ui-botao-primario--borda:hover:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);border-color:var(--ui-cor-primaria, #00E08A);filter:brightness(1.08)}.ui-botao-primario--icon-only,.ui-botao-primario--icone{padding:0;width:var(--ui-campo-altura, 34px);min-width:var(--ui-campo-altura, 34px);height:var(--ui-campo-altura, 34px);aspect-ratio:1;border-radius:var(--ui-raio-borda, 6px)}.ui-botao-primario--hover{filter:brightness(1.15)!important}.ui-botao-primario:active:not(:disabled),.ui-botao-primario--active{transform:scale(.97)!important;filter:brightness(.9)!important}.ui-botao-primario:disabled,.ui-botao-primario--disabled{opacity:.45;cursor:not-allowed;transform:none!important;filter:none!important}.ui-botao-primario--carregando,.ui-botao-primario--loading{cursor:wait;opacity:.85;pointer-events:none}.ui-botao-primario__spinner{width:14px;height:14px;animation:ui-spin .75s linear infinite;flex-shrink:0;shape-rendering:geometricPrecision}@keyframes ui-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 640px){:host(:not([inline])) .ui-botao-primario{min-height:max(var(--ui-campo-altura, 38px),38px);font-size:14px;padding:0 14px}}', p = ["aria-label", "aria-description", "aria-pressed", "aria-expanded", "aria-haspopup"];
|
|
9
|
+
class u extends g {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
a(this, "button");
|
|
13
|
+
a(this, "spinnerContainer");
|
|
14
|
+
a(this, "slotElement");
|
|
15
|
+
a(this, "opticalState", null);
|
|
16
|
+
a(this, "listeners", new f());
|
|
17
|
+
a(this, "internals");
|
|
18
|
+
a(this, "_formDisabled", !1);
|
|
19
|
+
a(this, "handleSlotChange", () => {
|
|
20
|
+
this.sanitizeAndBalanceContent(), this.syncState();
|
|
21
|
+
});
|
|
22
|
+
a(this, "handleClick", (t) => {
|
|
23
|
+
if (this.disabled || this.carregando) {
|
|
24
|
+
t.preventDefault(), t.stopPropagation();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.dispatchEvent(new CustomEvent("ui-click", { detail: { originalEvent: t }, bubbles: !0, composed: !0 }));
|
|
28
|
+
const r = this.form;
|
|
29
|
+
r && (this.hasAttribute("tipo-reset") || this.getAttribute("type") === "reset" ? r.reset() : (this.hasAttribute("tipo-submit") || this.getAttribute("type") === "submit") && v(r, this.getAttribute("name"), this.getAttribute("value")));
|
|
30
|
+
});
|
|
31
|
+
this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : null;
|
|
32
|
+
const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
|
|
33
|
+
t.innerHTML = `
|
|
34
|
+
<style>${y}</style>
|
|
35
|
+
<button class="ui-botao-primario" part="base" type="button">
|
|
36
|
+
<span class="ui-botao-primario__spinner-container" part="spinner" style="display: none;">
|
|
37
|
+
<svg class="ui-botao-primario__spinner" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
38
|
+
<circle cx="12" cy="12" r="10" stroke-opacity="0.25"></circle>
|
|
39
|
+
<path d="M12 2 a 10 10 0 0 1 10 10"></path>
|
|
40
|
+
</svg>
|
|
41
|
+
</span>
|
|
42
|
+
<slot></slot>
|
|
43
|
+
</button>
|
|
44
|
+
`, this.button = t.querySelector("button"), this.spinnerContainer = t.querySelector(".ui-botao-primario__spinner-container"), this.slotElement = t.querySelector("slot");
|
|
45
|
+
}
|
|
46
|
+
static get observedAttributes() {
|
|
47
|
+
return [
|
|
48
|
+
"disabled",
|
|
49
|
+
"variante",
|
|
50
|
+
"carregando",
|
|
51
|
+
"loading",
|
|
52
|
+
"estado",
|
|
53
|
+
"tamanho",
|
|
54
|
+
"size",
|
|
55
|
+
"altura",
|
|
56
|
+
"height",
|
|
57
|
+
"densidade",
|
|
58
|
+
"title",
|
|
59
|
+
...p
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
connectedCallback() {
|
|
63
|
+
this.listeners.cleanup(), this.listeners.add(this.button, "click", this.handleClick), this.listeners.add(this.slotElement, "slotchange", this.handleSlotChange), this.sanitizeAndBalanceContent(), this.syncState();
|
|
64
|
+
}
|
|
65
|
+
disconnectedCallback() {
|
|
66
|
+
this.listeners.cleanup();
|
|
67
|
+
}
|
|
68
|
+
attributeChangedCallback(t, r, o) {
|
|
69
|
+
this.syncState();
|
|
70
|
+
}
|
|
71
|
+
formDisabledCallback(t) {
|
|
72
|
+
this._formDisabled = t, this.syncState();
|
|
73
|
+
}
|
|
74
|
+
get form() {
|
|
75
|
+
var t;
|
|
76
|
+
return ((t = this.internals) == null ? void 0 : t.form) ?? this.closest("form");
|
|
77
|
+
}
|
|
78
|
+
get disabled() {
|
|
79
|
+
return this.hasAttribute("disabled") || this._formDisabled;
|
|
80
|
+
}
|
|
81
|
+
set disabled(t) {
|
|
82
|
+
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
83
|
+
}
|
|
84
|
+
/** Ativa o botão como um clique real (no-op se desabilitado ou carregando), como `HTMLButtonElement.click()`. */
|
|
85
|
+
click() {
|
|
86
|
+
this.button.click();
|
|
87
|
+
}
|
|
88
|
+
get carregando() {
|
|
89
|
+
return this.hasAttribute("carregando") || this.hasAttribute("loading");
|
|
90
|
+
}
|
|
91
|
+
set carregando(t) {
|
|
92
|
+
t ? this.setAttribute("carregando", "") : (this.removeAttribute("carregando"), this.removeAttribute("loading"));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Remove espaços e quebras de linha fantasmas no slot e identifica
|
|
96
|
+
* se há ícone no início ou fim para aplicar compensação óptica de padding.
|
|
97
|
+
*/
|
|
98
|
+
sanitizeAndBalanceContent() {
|
|
99
|
+
const t = (e) => {
|
|
100
|
+
if (e.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
101
|
+
const i = e, n = i.tagName.toLowerCase();
|
|
102
|
+
if (n === "ui-icone" || n === "svg" || n === "i" || i.hasAttribute("data-icon") || i.classList.contains("icon") || i.classList.contains("icone")) return !0;
|
|
103
|
+
const c = typeof i.className == "string" ? i.className : "";
|
|
104
|
+
return !!/\b(fa[srlb]?|fa-[\w-]+|lucide|tabler)\b/i.test(c);
|
|
105
|
+
}, r = this.slotElement ? this.slotElement.assignedNodes() : Array.from(this.childNodes), o = [];
|
|
106
|
+
for (let e = 0; e < r.length; e++) {
|
|
107
|
+
const i = r[e];
|
|
108
|
+
if (i.nodeType === Node.TEXT_NODE) {
|
|
109
|
+
const n = i.textContent || "";
|
|
110
|
+
if (!n.trim())
|
|
111
|
+
r.length > 1 && (i.textContent = "");
|
|
112
|
+
else {
|
|
113
|
+
const c = r[e - 1];
|
|
114
|
+
c && t(c) && (i.textContent = n.replace(/^\s+/, ""));
|
|
115
|
+
const d = r[e + 1];
|
|
116
|
+
d && t(d) && (i.textContent = (i.textContent || "").replace(/\s+$/, "")), (i.textContent || "").trim().length > 0 && o.push(i);
|
|
117
|
+
}
|
|
118
|
+
} else i.nodeType === Node.ELEMENT_NODE && o.push(i);
|
|
119
|
+
}
|
|
120
|
+
if (o.length >= 2)
|
|
121
|
+
t(o[0]) ? this.opticalState = "icon-start" : t(o[o.length - 1]) ? this.opticalState = "icon-end" : this.opticalState = null;
|
|
122
|
+
else if (o.length === 1) {
|
|
123
|
+
const e = o[0];
|
|
124
|
+
if (t(e))
|
|
125
|
+
this.opticalState = "icon-only";
|
|
126
|
+
else if (e.nodeType === Node.ELEMENT_NODE) {
|
|
127
|
+
const i = e;
|
|
128
|
+
i.children.length >= 2 ? t(i.firstElementChild) ? this.opticalState = "icon-start" : t(i.lastElementChild) ? this.opticalState = "icon-end" : this.opticalState = null : i.children.length === 1 && t(i.firstElementChild) ? this.opticalState = "icon-only" : this.opticalState = null;
|
|
129
|
+
} else
|
|
130
|
+
this.opticalState = null;
|
|
131
|
+
} else
|
|
132
|
+
this.opticalState = null;
|
|
133
|
+
}
|
|
134
|
+
syncState() {
|
|
135
|
+
x(this);
|
|
136
|
+
const t = this.carregando, r = this.disabled || t, o = this.getAttribute("variante") || "primario", e = this.getAttribute("estado");
|
|
137
|
+
this.button.disabled = r, this.spinnerContainer.style.display = t ? "inline-flex" : "none", t ? this.button.setAttribute("aria-busy", "true") : this.button.removeAttribute("aria-busy");
|
|
138
|
+
const i = ["ui-botao-primario", `ui-botao-primario--${o}`];
|
|
139
|
+
r && !t && i.push("ui-botao-primario--disabled"), t && i.push("ui-botao-primario--carregando"), e && i.push(`ui-botao-primario--${e}`), this.opticalState === "icon-start" ? i.push("ui-botao-primario--has-icon-start") : this.opticalState === "icon-end" && i.push("ui-botao-primario--has-icon-end");
|
|
140
|
+
const n = this.opticalState === "icon-only" || o === "icon-only" || o === "icone";
|
|
141
|
+
n && i.push("ui-botao-primario--icon-only"), this.button.className = i.join(" "), this.sincronizarAria(n);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* O foco e o anúncio do leitor de tela ficam no <button> interno, então os atributos
|
|
145
|
+
* ARIA do host são copiados para ele. Botão só com ícone e sem `aria-label` usa o `title`.
|
|
146
|
+
*/
|
|
147
|
+
sincronizarAria(t) {
|
|
148
|
+
p.forEach((o) => {
|
|
149
|
+
const e = this.getAttribute(o);
|
|
150
|
+
e !== null ? this.button.setAttribute(o, e) : this.button.removeAttribute(o);
|
|
151
|
+
});
|
|
152
|
+
const r = this.getAttribute("title");
|
|
153
|
+
t && !this.hasAttribute("aria-label") && r && this.button.setAttribute("aria-label", r);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/** Form-associated: respeita `form="id"` e `<fieldset disabled>` como um <button> nativo. */
|
|
157
|
+
a(u, "formAssociated", !0);
|
|
158
|
+
class A extends u {
|
|
159
|
+
}
|
|
160
|
+
b("ui-botao", u);
|
|
161
|
+
b("ui-botao-primario", A);
|
|
162
|
+
export {
|
|
163
|
+
u as U,
|
|
164
|
+
A as a
|
|
165
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
class I {
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var c = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var a = (o, e, t) => c(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
class f {
|
|
6
5
|
constructor() {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
a(this, "provedorToast", null);
|
|
7
|
+
a(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
|
+
a(this, "_observandoSistema", !1);
|
|
9
9
|
this.observarTemaDoSistema();
|
|
10
10
|
}
|
|
11
11
|
on(e, t) {
|
|
12
12
|
return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), () => this.off(e, t);
|
|
13
13
|
}
|
|
14
14
|
once(e, t) {
|
|
15
|
-
const r = (
|
|
16
|
-
this.off(e, r), t(
|
|
15
|
+
const r = (i) => {
|
|
16
|
+
this.off(e, r), t(i);
|
|
17
17
|
};
|
|
18
18
|
this.on(e, r);
|
|
19
19
|
}
|
|
@@ -23,11 +23,11 @@ class I {
|
|
|
23
23
|
}
|
|
24
24
|
emit(e, t) {
|
|
25
25
|
const r = this.listeners.get(e);
|
|
26
|
-
r && r.forEach((
|
|
26
|
+
r && r.forEach((i) => {
|
|
27
27
|
try {
|
|
28
|
-
|
|
29
|
-
} catch (
|
|
30
|
-
console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`,
|
|
28
|
+
i(t);
|
|
29
|
+
} catch (s) {
|
|
30
|
+
console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`, s);
|
|
31
31
|
}
|
|
32
32
|
}), typeof window < "u" && window.dispatchEvent(
|
|
33
33
|
new CustomEvent(`uibus:${e}`, {
|
|
@@ -91,7 +91,20 @@ class I {
|
|
|
91
91
|
* Dispara uma notificação toast flutuante inteligente.
|
|
92
92
|
*/
|
|
93
93
|
notificar(e) {
|
|
94
|
-
|
|
94
|
+
const t = this.provedorToast;
|
|
95
|
+
if (t)
|
|
96
|
+
try {
|
|
97
|
+
t(typeof e == "string" ? { mensagem: e, tipo: "info" } : e);
|
|
98
|
+
} catch (r) {
|
|
99
|
+
console.error("Erro ao exibir toast:", r);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Registra (ou remove, com `null`) o provedor que materializa os toasts.
|
|
104
|
+
* O `ui-toast` se registra sozinho ao ser carregado; sem provedor, `notificar` é no-op.
|
|
105
|
+
*/
|
|
106
|
+
registrarProvedorToast(e) {
|
|
107
|
+
this.provedorToast = e;
|
|
95
108
|
}
|
|
96
109
|
/**
|
|
97
110
|
* Copia um texto para a área de transferência do usuário e exibe feedback opcional.
|
|
@@ -124,8 +137,8 @@ class I {
|
|
|
124
137
|
*/
|
|
125
138
|
obterTema() {
|
|
126
139
|
if (typeof document > "u") return "escuro";
|
|
127
|
-
const e =
|
|
128
|
-
return e || (
|
|
140
|
+
const e = n(document.documentElement);
|
|
141
|
+
return e || (m() ? "claro" : "escuro");
|
|
129
142
|
}
|
|
130
143
|
/**
|
|
131
144
|
* Define o tema global. Sem argumento, alterna o tema em vigor;
|
|
@@ -137,8 +150,8 @@ class I {
|
|
|
137
150
|
if (e === "auto")
|
|
138
151
|
t.removeAttribute("data-tema"), t.removeAttribute("data-theme"), t.classList.remove("dark", "light");
|
|
139
152
|
else {
|
|
140
|
-
const
|
|
141
|
-
t.setAttribute("data-tema",
|
|
153
|
+
const i = e || (this.obterTema() === "escuro" ? "claro" : "escuro");
|
|
154
|
+
t.setAttribute("data-tema", i), t.classList.toggle("dark", i === "escuro"), t.classList.toggle("light", i === "claro");
|
|
142
155
|
}
|
|
143
156
|
const r = this.obterTema();
|
|
144
157
|
return this.emit("tema:alterado", { tema: r }), r;
|
|
@@ -147,98 +160,18 @@ class I {
|
|
|
147
160
|
observarTemaDoSistema() {
|
|
148
161
|
var e, t;
|
|
149
162
|
this._observandoSistema || typeof window > "u" || typeof window.matchMedia != "function" || (this._observandoSistema = !0, (t = (e = window.matchMedia("(prefers-color-scheme: light)")).addEventListener) == null || t.call(e, "change", () => {
|
|
150
|
-
|
|
163
|
+
n(document.documentElement) || this.emit("tema:alterado", { tema: this.obterTema() });
|
|
151
164
|
}));
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
|
-
function
|
|
167
|
+
function n(o) {
|
|
155
168
|
const e = o.getAttribute("data-tema") || o.getAttribute("data-theme");
|
|
156
169
|
return e === "escuro" || e === "dark" ? "escuro" : e === "claro" || e === "light" ? "claro" : o.classList.contains("dark") ? "escuro" : o.classList.contains("light") ? "claro" : null;
|
|
157
170
|
}
|
|
158
|
-
function
|
|
171
|
+
function m() {
|
|
159
172
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
160
173
|
}
|
|
161
|
-
const
|
|
162
|
-
let y = !1;
|
|
163
|
-
function x(o) {
|
|
164
|
-
if (o.hasAttribute("disabled") || o.hasAttribute("carregando") || o.getAttribute("aria-disabled") === "true" || o.localName.startsWith("ui-") && o.hasAttribute("loading")) return !0;
|
|
165
|
-
try {
|
|
166
|
-
return o.matches(":disabled");
|
|
167
|
-
} catch {
|
|
168
|
-
return !1;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function B() {
|
|
172
|
-
y || typeof document > "u" || (y = !0, document.addEventListener("click", (o) => {
|
|
173
|
-
const e = o.composedPath ? o.composedPath() : [o.target], t = "[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";
|
|
174
|
-
let r = null;
|
|
175
|
-
for (const i of e)
|
|
176
|
-
if (i instanceof HTMLElement && i.matches(t)) {
|
|
177
|
-
r = i;
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
if (!r || x(r)) return;
|
|
181
|
-
const u = r.getAttribute("target-modal") || r.getAttribute("modal-alvo");
|
|
182
|
-
if (u && n.abrirModal(u), r.hasAttribute("dismiss-modal") || r.hasAttribute("fechar-modal")) {
|
|
183
|
-
const i = r.getAttribute("dismiss-modal") || r.getAttribute("fechar-modal");
|
|
184
|
-
if (i && i !== "")
|
|
185
|
-
n.fecharModal(i);
|
|
186
|
-
else {
|
|
187
|
-
let s = null;
|
|
188
|
-
for (const a of e)
|
|
189
|
-
if (a instanceof HTMLElement && (a.matches("ui-modal, ui-dialog") || a.tagName === "UI-MODAL" || a.tagName === "UI-DIALOG")) {
|
|
190
|
-
s = a;
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
s && (typeof s.fechar == "function" ? s.fechar() : (s.removeAttribute("aberto"), s.removeAttribute("open")));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
const f = r.getAttribute("target-drawer") || r.getAttribute("drawer-alvo");
|
|
197
|
-
if (f && n.abrirDrawer(f), r.hasAttribute("dismiss-drawer") || r.hasAttribute("fechar-drawer")) {
|
|
198
|
-
const i = r.getAttribute("dismiss-drawer") || r.getAttribute("fechar-drawer");
|
|
199
|
-
if (i && i !== "")
|
|
200
|
-
n.fecharDrawer(i);
|
|
201
|
-
else {
|
|
202
|
-
let s = null;
|
|
203
|
-
for (const a of e)
|
|
204
|
-
if (a instanceof HTMLElement && (a.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta") || a.tagName.startsWith("UI-DRAWER") || a.tagName.startsWith("UI-SHEET"))) {
|
|
205
|
-
s = a;
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
s && (typeof s.fechar == "function" ? s.fechar() : (s.removeAttribute("aberto"), s.removeAttribute("open")));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
const d = r.getAttribute("toast-sucesso");
|
|
212
|
-
d && n.notificar({ tipo: "sucesso", mensagem: d });
|
|
213
|
-
const l = r.getAttribute("toast-erro");
|
|
214
|
-
l && n.notificar({ tipo: "erro", mensagem: l });
|
|
215
|
-
const h = r.getAttribute("toast-alerta");
|
|
216
|
-
h && n.notificar({ tipo: "alerta", mensagem: h });
|
|
217
|
-
const b = r.getAttribute("toast-info");
|
|
218
|
-
b && n.notificar({ tipo: "info", mensagem: b });
|
|
219
|
-
const c = r.getAttribute("copiar-texto");
|
|
220
|
-
if (c !== null) {
|
|
221
|
-
let i = c;
|
|
222
|
-
if (c.startsWith("#") || c.startsWith(".") || c.match(/^[a-zA-Z0-9_-]+$/))
|
|
223
|
-
try {
|
|
224
|
-
let a = null;
|
|
225
|
-
c.startsWith("#") || c.startsWith(".") ? a = document.querySelector(c) : a = document.getElementById(c) || document.querySelector(`#${c}`), a && (i = a.value !== void 0 && a.value !== null ? a.value : a.textContent || "");
|
|
226
|
-
} catch {
|
|
227
|
-
}
|
|
228
|
-
const s = r.getAttribute("copiar-mensagem") || "Copiado com sucesso!";
|
|
229
|
-
n.copiar(i, s);
|
|
230
|
-
}
|
|
231
|
-
r.hasAttribute("alternar-tema") && n.definirTema();
|
|
232
|
-
const p = r.getAttribute("definir-densidade");
|
|
233
|
-
p && n.definirDensidade(p);
|
|
234
|
-
const g = r.getAttribute("limpar-form");
|
|
235
|
-
if (g) {
|
|
236
|
-
const i = document.getElementById(g);
|
|
237
|
-
i && typeof i.reset == "function" && (i.reset(), n.notificar({ tipo: "info", mensagem: "Formulário limpo." }));
|
|
238
|
-
}
|
|
239
|
-
}));
|
|
240
|
-
}
|
|
174
|
+
const l = new f();
|
|
241
175
|
export {
|
|
242
|
-
|
|
243
|
-
B as i
|
|
176
|
+
l as U
|
|
244
177
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var c=(o,e,t)=>e in o?u(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e,t)=>c(o,typeof e!="symbol"?e+"":e,t);class f{constructor(){a(this,"provedorToast",null);a(this,"listeners",new Map);a(this,"_observandoSistema",!1);this.observarTemaDoSistema()}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const r=i=>{this.off(e,r),t(i)};this.on(e,r)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}emit(e,t){const r=this.listeners.get(e);r&&r.forEach(i=>{try{i(t)}catch(s){console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`,s)}}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(`uibus:${e}`,{detail:t,bubbles:!0,composed:!0}))}abrirModal(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("modal:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("modal:aberto",{id:e}),!0):(console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`),!1)}fecharModal(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),t.hasAttribute("aberto")||t.hasAttribute("open")?!1:(this.emit("modal:fechado",{id:e}),!0)):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("modal:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("modal:fechado-todos"),!0}abrirDrawer(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("drawer:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("drawer:aberto",{id:e}),!0):(console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`),!1)}fecharDrawer(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),this.emit("drawer:fechado",{id:e}),!0):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("drawer:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("drawer:fechado-todos"),!0}notificar(e){const t=this.provedorToast;if(t)try{t(typeof e=="string"?{mensagem:e,tipo:"info"}:e)}catch(r){console.error("Erro ao exibir toast:",r)}}registrarProvedorToast(e){this.provedorToast=e}async copiar(e,t){if(typeof navigator>"u"||!navigator.clipboard)return!1;try{return await navigator.clipboard.writeText(e),t!==void 0&&this.notificar({tipo:"sucesso",mensagem:t||"Copiado para a área de transferência!"}),this.emit("clipboard:copiado",{texto:e}),!0}catch(r){return console.error("[UIBus] Falha ao copiar texto:",r),this.notificar({tipo:"erro",mensagem:"Não foi possível copiar o texto."}),!1}}definirDensidade(e){let t=34;typeof e=="number"?t=Math.max(15,e):e==="compacta"?t=26:e==="relaxada"?t=42:t=34,!(typeof document>"u")&&(document.documentElement.style.setProperty("--ui-altura-minima",`${t}px`),document.documentElement.style.setProperty("--ui-campo-altura",`${t}px`),document.documentElement.setAttribute("data-ui-densidade",typeof e=="string"?e:"custom"),this.emit("densidade:alterada",{densidade:e,alturaPx:t}))}obterTema(){if(typeof document>"u")return"escuro";const e=n(document.documentElement);return e||(m()?"claro":"escuro")}definirTema(e){if(typeof document>"u")return e==="claro"?"claro":"escuro";const t=document.documentElement;if(e==="auto")t.removeAttribute("data-tema"),t.removeAttribute("data-theme"),t.classList.remove("dark","light");else{const i=e||(this.obterTema()==="escuro"?"claro":"escuro");t.setAttribute("data-tema",i),t.classList.toggle("dark",i==="escuro"),t.classList.toggle("light",i==="claro")}const r=this.obterTema();return this.emit("tema:alterado",{tema:r}),r}observarTemaDoSistema(){var e,t;this._observandoSistema||typeof window>"u"||typeof window.matchMedia!="function"||(this._observandoSistema=!0,(t=(e=window.matchMedia("(prefers-color-scheme: light)")).addEventListener)==null||t.call(e,"change",()=>{n(document.documentElement)||this.emit("tema:alterado",{tema:this.obterTema()})}))}}function n(o){const e=o.getAttribute("data-tema")||o.getAttribute("data-theme");return e==="escuro"||e==="dark"?"escuro":e==="claro"||e==="light"?"claro":o.classList.contains("dark")?"escuro":o.classList.contains("light")?"claro":null}function m(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: light)").matches}const d=new f;exports.UIBus=d;
|
|
@@ -2,9 +2,11 @@ var g = Object.defineProperty;
|
|
|
2
2
|
var x = (i, s, t) => s in i ? g(i, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[s] = t;
|
|
3
3
|
var a = (i, s, t) => x(i, typeof s != "symbol" ? s + "" : s, t);
|
|
4
4
|
import { S as f, d as m } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { b as v } from "./altura-controle-vxQiXG4q.js";
|
|
6
|
+
import { g as _, o as E, c as y } from "./acessibilidade-CUlSXc2X.js";
|
|
7
|
+
import { v as A, a as w } from "./form-validacao-BlQFxUVj.js";
|
|
8
|
+
import { a as S } from "./form-submissao-C-SPRKgT.js";
|
|
9
|
+
const 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}}', C = [
|
|
8
10
|
"label",
|
|
9
11
|
"placeholder",
|
|
10
12
|
"value",
|
|
@@ -35,9 +37,9 @@ const S = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizin
|
|
|
35
37
|
"densidade",
|
|
36
38
|
"aria-label"
|
|
37
39
|
];
|
|
38
|
-
function
|
|
40
|
+
function I() {
|
|
39
41
|
return `
|
|
40
|
-
<style>${
|
|
42
|
+
<style>${k}</style>
|
|
41
43
|
<div class="ui-campo-texto__container">
|
|
42
44
|
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
43
45
|
<div class="ui-campo-texto__wrapper" part="campo">
|
|
@@ -53,26 +55,26 @@ function C() {
|
|
|
53
55
|
<div class="ui-campo-texto__helper" part="ajuda" style="display: none;"></div>
|
|
54
56
|
`;
|
|
55
57
|
}
|
|
56
|
-
function
|
|
58
|
+
function V(i, s, t, e) {
|
|
57
59
|
if (i.textContent = s, !t) return;
|
|
58
60
|
const n = document.createElement("span");
|
|
59
61
|
n.className = e, n.setAttribute("aria-hidden", "true"), n.textContent = "*", i.append(" ", n);
|
|
60
62
|
}
|
|
61
|
-
function
|
|
62
|
-
const { labelElement: s, inputElement: t, labelText: e, placeholderText: n, isFlutuante:
|
|
63
|
+
function L(i) {
|
|
64
|
+
const { labelElement: s, inputElement: t, labelText: e, placeholderText: n, isFlutuante: o, estaFocado: r, obrigatorio: l } = i, u = t.value.trim() !== "";
|
|
63
65
|
let h = !1;
|
|
64
66
|
try {
|
|
65
67
|
h = t.matches(":-webkit-autofill");
|
|
66
68
|
} catch {
|
|
67
69
|
h = !1;
|
|
68
70
|
}
|
|
69
|
-
e ? (
|
|
71
|
+
e ? (V(s, e, !!l, "ui-campo-texto__asterisco"), s.style.display = "flex", o && (r || u || h) ? s.classList.add("ui-campo-texto__label--ativa") : s.classList.remove("ui-campo-texto__label--ativa")) : s.style.display = "none", o && !r && !u && !h ? t.placeholder = "" : t.placeholder = n;
|
|
70
72
|
}
|
|
71
|
-
function
|
|
73
|
+
function q(i, s, t) {
|
|
72
74
|
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"));
|
|
73
75
|
}
|
|
74
|
-
function
|
|
75
|
-
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") :
|
|
76
|
+
function z(i, s, t, e, n, o) {
|
|
77
|
+
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") : o ? (t.textContent = o, t.className = "ui-campo-texto__helper", t.style.display = "block") : t.style.display = "none";
|
|
76
78
|
}
|
|
77
79
|
class d extends f {
|
|
78
80
|
constructor() {
|
|
@@ -146,7 +148,7 @@ class b extends d {
|
|
|
146
148
|
this.syncState();
|
|
147
149
|
});
|
|
148
150
|
a(this, "handleHostClick", (t) => {
|
|
149
|
-
|
|
151
|
+
y(this, t) && !this.disabled && this.inputElement.focus();
|
|
150
152
|
});
|
|
151
153
|
a(this, "handleRightIconClick", (t) => {
|
|
152
154
|
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
@@ -168,7 +170,7 @@ class b extends d {
|
|
|
168
170
|
if (t.key !== "Enter" || t.isComposing || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
169
171
|
const e = this.form;
|
|
170
172
|
e && setTimeout(() => {
|
|
171
|
-
!t.defaultPrevented && this.isConnected &&
|
|
173
|
+
!t.defaultPrevented && this.isConnected && S(e);
|
|
172
174
|
});
|
|
173
175
|
});
|
|
174
176
|
a(this, "handleInput", (t) => {
|
|
@@ -204,10 +206,10 @@ class b extends d {
|
|
|
204
206
|
);
|
|
205
207
|
});
|
|
206
208
|
const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
|
|
207
|
-
t.innerHTML =
|
|
209
|
+
t.innerHTML = I(), 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 = _("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`);
|
|
208
210
|
}
|
|
209
211
|
static get observedAttributes() {
|
|
210
|
-
return
|
|
212
|
+
return C;
|
|
211
213
|
}
|
|
212
214
|
focus(t) {
|
|
213
215
|
this.inputElement.focus(t);
|
|
@@ -280,32 +282,32 @@ class b extends d {
|
|
|
280
282
|
}
|
|
281
283
|
atualizarValidade() {
|
|
282
284
|
var c, p;
|
|
283
|
-
const t = this.getAttribute("minlength") ?? this.getAttribute("min-length"), e = this.getAttribute("maxlength") ?? this.getAttribute("max-length"), n = this.getAttribute("min"),
|
|
284
|
-
val:
|
|
285
|
-
rawVal:
|
|
286
|
-
badInput:
|
|
285
|
+
const t = this.getAttribute("minlength") ?? this.getAttribute("min-length"), e = this.getAttribute("maxlength") ?? this.getAttribute("max-length"), n = this.getAttribute("min"), o = this.getAttribute("max"), r = this.inputElement ? this.inputElement.value : "", l = this.getAttribute("value") || r, u = !!((p = (c = this.inputElement) == null ? void 0 : c.validity) != null && p.badInput), h = A({
|
|
286
|
+
val: r,
|
|
287
|
+
rawVal: l,
|
|
288
|
+
badInput: u,
|
|
287
289
|
disabled: this.disabled,
|
|
288
290
|
required: this.required,
|
|
289
291
|
tipo: this.type,
|
|
290
292
|
minlength: t !== null ? parseInt(t, 10) : null,
|
|
291
293
|
maxlength: e !== null ? parseInt(e, 10) : null,
|
|
292
294
|
min: n !== null ? parseFloat(n) : null,
|
|
293
|
-
max:
|
|
295
|
+
max: o !== null ? parseFloat(o) : null,
|
|
294
296
|
step: this.getAttribute("step"),
|
|
295
297
|
pattern: this.getAttribute("pattern"),
|
|
296
298
|
customError: this._customErrorMessage,
|
|
297
299
|
mensagemValidacao: this.getAttribute("mensagem-validacao")
|
|
298
300
|
});
|
|
299
|
-
|
|
301
|
+
w(this.internals, h, this.inputElement);
|
|
300
302
|
}
|
|
301
303
|
alternarVisibilidadeSenha() {
|
|
302
304
|
var n;
|
|
303
305
|
if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
|
|
304
306
|
this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
|
|
305
307
|
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector('slot[name="icone-direita"]');
|
|
306
|
-
e && e.assignedElements().forEach((
|
|
307
|
-
var
|
|
308
|
-
(((
|
|
308
|
+
e && e.assignedElements().forEach((r) => {
|
|
309
|
+
var l, u;
|
|
310
|
+
(((l = r.textContent) == null ? void 0 : l.trim()) === "👁️" || ((u = r.textContent) == null ? void 0 : u.trim()) === "🙈") && (r.textContent = this._senhaVisivel ? "🙈" : "👁️");
|
|
309
311
|
}), this.dispatchEvent(
|
|
310
312
|
new CustomEvent("ui-toggle-senha", {
|
|
311
313
|
detail: { visivel: this._senhaVisivel },
|
|
@@ -315,9 +317,7 @@ class b extends d {
|
|
|
315
317
|
);
|
|
316
318
|
}
|
|
317
319
|
syncState() {
|
|
318
|
-
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda")
|
|
319
|
-
const e = this.getAttribute("altura") || this.getAttribute("height");
|
|
320
|
-
e ? this.style.setProperty("--ui-campo-altura", isNaN(Number(e)) ? e : `${e}px`) : this.style.removeProperty("--ui-campo-altura"), V({
|
|
320
|
+
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda"), v(this), L({
|
|
321
321
|
labelElement: this.labelElement,
|
|
322
322
|
inputElement: this.inputElement,
|
|
323
323
|
labelText: this.getAttribute("label"),
|
|
@@ -326,29 +326,29 @@ class b extends d {
|
|
|
326
326
|
estaFocado: this._focado,
|
|
327
327
|
obrigatorio: this.required
|
|
328
328
|
}), this.sincronizarNomeAcessivel();
|
|
329
|
-
const
|
|
329
|
+
const e = this.getAttribute("tipo") || this.getAttribute("type") || "text";
|
|
330
330
|
if (!this._senhaVisivel)
|
|
331
331
|
try {
|
|
332
|
-
this.inputElement.type =
|
|
332
|
+
this.inputElement.type = e;
|
|
333
333
|
} catch {
|
|
334
334
|
this.inputElement.type = "text";
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
|
|
336
|
+
const n = this.getAttribute("minlength") ?? this.getAttribute("min-length");
|
|
337
|
+
n !== null ? this.inputElement.minLength = parseInt(n, 10) : this.inputElement.removeAttribute("minlength");
|
|
338
338
|
const o = this.getAttribute("maxlength") ?? this.getAttribute("max-length");
|
|
339
339
|
o !== null ? this.inputElement.maxLength = parseInt(o, 10) : this.inputElement.removeAttribute("maxlength");
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
const l = this.hasAttribute("disabled") || this._formDisabled,
|
|
343
|
-
this.inputElement.disabled = l, this.inputElement.readOnly =
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
|
|
340
|
+
const r = this.getAttribute("pattern");
|
|
341
|
+
r !== null ? this.inputElement.pattern = r : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
|
|
342
|
+
const l = this.hasAttribute("disabled") || this._formDisabled, u = this.hasAttribute("readonly");
|
|
343
|
+
this.inputElement.disabled = l, this.inputElement.readOnly = u, l ? this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled") : this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");
|
|
344
|
+
const h = e === "password" || this.hasAttribute("alternar-senha");
|
|
345
|
+
q(this.rightIconContainer, h, this._senhaVisivel);
|
|
346
|
+
const c = this.hasAttribute("erro") || this.hasAttribute("mensagem-erro");
|
|
347
|
+
z(
|
|
348
348
|
this.wrapperElement,
|
|
349
349
|
this.inputElement,
|
|
350
350
|
this.helperElement,
|
|
351
|
-
|
|
351
|
+
c,
|
|
352
352
|
this.getAttribute("mensagem-erro"),
|
|
353
353
|
this.getAttribute("helper-text")
|
|
354
354
|
), this.atualizarValidade();
|
|
@@ -358,22 +358,22 @@ class b extends d {
|
|
|
358
358
|
* (`aria-label` no host, `<label for>` ou `<label>` envolvente).
|
|
359
359
|
*/
|
|
360
360
|
sincronizarNomeAcessivel() {
|
|
361
|
-
const t = this.getAttribute("label") ? "" :
|
|
361
|
+
const t = this.getAttribute("label") ? "" : E(this, this.internals);
|
|
362
362
|
t ? this.inputElement.setAttribute("aria-label", t) : this.inputElement.removeAttribute("aria-label");
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
class
|
|
365
|
+
class T extends b {
|
|
366
366
|
}
|
|
367
367
|
m("ui-campo-texto", b);
|
|
368
|
-
m("ui-input",
|
|
368
|
+
m("ui-input", T);
|
|
369
369
|
export {
|
|
370
|
-
|
|
370
|
+
C as A,
|
|
371
371
|
d as F,
|
|
372
372
|
b as U,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
373
|
+
T as a,
|
|
374
|
+
q as b,
|
|
375
|
+
I as c,
|
|
376
|
+
L as d,
|
|
377
|
+
V as r,
|
|
378
|
+
z as s
|
|
379
379
|
};
|