@thibezer/ui-components-kit 2.8.1 → 2.8.2
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 +22 -103
- package/README.md +8 -32
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +110 -114
- package/dist/camadas.js +1177 -1343
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +63 -64
- package/dist/canvas.js +3544 -4025
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-avatar/ui-avatar.d.ts +0 -11
- package/dist/components/ui-badge/ui-badge.d.ts +0 -2
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -1
- package/dist/components/ui-barra-ferramentas/tipos.d.ts +31 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +17 -1
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +0 -2
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +11 -4
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +1 -13
- package/dist/components/ui-camadas/camadas-host.d.ts +0 -1
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +1 -3
- package/dist/components/ui-camadas/camadas-selecao.d.ts +0 -12
- package/dist/components/ui-camadas/ui-camadas.d.ts +5 -8
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +1 -2
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +8 -3
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +106 -39
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +1 -3
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +1 -15
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +1 -4
- package/dist/components/ui-cores/tipos.d.ts +0 -2
- package/dist/components/ui-cores/ui-controle-cores.d.ts +3 -8
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +1 -3
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +5 -12
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +6 -15
- package/dist/components/ui-mapa/ui-mapa.d.ts +1 -14
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
- package/dist/components/ui-modal/ui-modal.d.ts +11 -1
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +0 -10
- package/dist/components/ui-radio/ui-radio.d.ts +2 -9
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +0 -9
- package/dist/components/ui-switch/ui-switch.d.ts +1 -3
- package/dist/components/ui-tabela/ui-tabela.d.ts +19 -1
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +1 -24
- package/dist/core/index.d.ts +0 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +18 -28
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +1 -1
- package/dist/custom-elements.json +13585 -18764
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +2 -2
- package/dist/form-validacao-BIOXxt-1.js +140 -0
- package/dist/form-validacao-ytRYSF3E.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +1 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +9 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +0 -2
- package/dist/gerencigeo-canvas/mapa_core.d.ts +0 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +176 -179
- package/dist/mapa.cjs +16 -11
- package/dist/mapa.js +170 -242
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/register.cjs +1 -1
- package/dist/register.js +11 -11
- package/dist/svg-seguro-ChVJ2L2z.js +74 -0
- package/dist/svg-seguro-J2RM1Ssf.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +20 -48
- package/dist/tipos-react.d.ts +0 -2
- package/dist/tipos-vue.d.ts +15 -44
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BxT-sDmV.cjs +28 -0
- package/dist/ui-badge-C0eKBI8E.js +183 -0
- package/dist/ui-botao-BOOnP8ds.cjs +12 -0
- package/dist/ui-botao-DfqSivHl.js +165 -0
- package/dist/ui-botao-OGJV6Vfk.js +165 -0
- package/dist/ui-botao-psS1juof.cjs +12 -0
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
- package/dist/{ui-campo-texto-B_OHVGiN.js → ui-campo-texto-Uu2dJE_0.js} +51 -51
- package/dist/ui-card-B86lJXTP.cjs +20 -0
- package/dist/{ui-card-BNYCQ7g-.js → ui-card-C_o5_0cB.js} +42 -50
- package/dist/ui-controle-cores-BS0WYPdi.js +572 -0
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +111 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-modal-CvGFGh1h.cjs +18 -0
- package/dist/{ui-modal-BkYvNP0G.js → ui-modal-DBOtSTbR.js} +140 -116
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +624 -0
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +1171 -0
- package/dist/{ui-paleta-ferramentas-bDLPbiGA.cjs → ui-paleta-ferramentas-Ccmo-rB5.cjs} +7 -7
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +21 -0
- package/dist/{ui-paleta-ferramentas-Ksh6gMW3.js → ui-paleta-ferramentas-DNN5i6nL.js} +329 -359
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +18 -0
- package/dist/ui-paleta-ferramentas-DbwdWVtT.js +1173 -0
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +21 -0
- package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
- package/dist/ui-segmented-DyF5YLsV.js +418 -0
- package/dist/ui-segmented-rn9RxRGM.cjs +19 -0
- package/dist/{ui-linha-nCDh2wPm.js → ui-segmented-wUraId2e.js} +105 -200
- package/dist/ui-skeleton-DI4_9WOX.js +428 -0
- package/dist/{ui-skeleton-DiOxTBZK.cjs → ui-skeleton-SPYqku8P.cjs} +10 -10
- package/dist/{ui-skeleton-B2Rgrv8o.js → ui-skeleton-W9uwIceA.js} +191 -254
- package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
- package/dist/{ui-switch-DO1R0Ce7.js → ui-switch-BcOqOkiV.js} +128 -187
- package/dist/ui-switch-D7iPKDj-.cjs +53 -0
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
- package/dist/{ui-tabela-propriedades-DzZlyNZ_.cjs → ui-tabela-propriedades-BecPqC-e.cjs} +10 -10
- package/dist/{ui-tabela-propriedades-D9Echt2X.js → ui-tabela-propriedades-BokvDD3b.js} +826 -845
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
- package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +141 -0
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +2648 -0
- package/dist/ui-toast-Bp_NlM5G.js +156 -0
- package/dist/ui-toast-DGTZKne5.cjs +20 -0
- package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
- package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
- package/package.json +3 -3
- package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
- package/dist/acessibilidade-CUlSXc2X.js +0 -38
- package/dist/altura-controle-ukMRPckR.cjs +0 -1
- package/dist/altura-controle-vxQiXG4q.js +0 -62
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +0 -16
- package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +0 -24
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +0 -14
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +0 -17
- package/dist/components/ui-camadas/camadas-colecao.d.ts +0 -27
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +0 -31
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +0 -10
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +0 -34
- package/dist/components/ui-camadas/camadas-render.d.ts +0 -15
- package/dist/components/ui-camadas/camadas-renomear.d.ts +0 -12
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +0 -17
- package/dist/components/ui-camadas/camadas-thumb.d.ts +0 -1
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +0 -15
- package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +0 -22
- package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +0 -26
- package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +0 -21
- package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +0 -39
- package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +0 -68
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +0 -37
- package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +0 -48
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +0 -28
- package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +0 -22
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +0 -53
- package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +0 -33
- package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +0 -5
- package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +0 -5
- package/dist/components/ui-canvas-cad/tipos.d.ts +0 -37
- package/dist/components/ui-linha/index.d.ts +0 -1
- package/dist/components/ui-linha/ui-linha.d.ts +0 -48
- package/dist/components/ui-mapa/mapa-atributos.d.ts +0 -14
- package/dist/components/ui-mapa/mapa-basemaps.d.ts +0 -7
- package/dist/components/ui-mapa/mapa-icones.d.ts +0 -4
- package/dist/components/ui-mapa/mapa-leaflet.d.ts +0 -5
- package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +0 -22
- package/dist/components/ui-mapa/tipos.d.ts +0 -13
- package/dist/components/ui-modal/modal-foco.d.ts +0 -28
- package/dist/components/ui-tabela/tabela-estados.d.ts +0 -16
- package/dist/components/ui-tabela/tabela-rolagem.d.ts +0 -44
- package/dist/components/ui-tabela/tabela-teclado.d.ts +0 -16
- package/dist/components/ui-tooltip/tooltip-popover.d.ts +0 -7
- package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +0 -29
- package/dist/core/altura-controle.d.ts +0 -34
- package/dist/core/opcoes.d.ts +0 -9
- package/dist/core/rotulo-controle.d.ts +0 -13
- package/dist/form-validacao-BlQFxUVj.js +0 -104
- package/dist/form-validacao-DIeyQVH5.cjs +0 -1
- package/dist/gerencigeo-canvas/popup_gate.d.ts +0 -30
- package/dist/gerencigeo-canvas/zoom_opcoes.d.ts +0 -10
- package/dist/opcoes-CJYLi6kd.js +0 -12
- package/dist/opcoes-CkyDxBuQ.cjs +0 -1
- package/dist/ui-badge-BWhoGgo9.js +0 -197
- package/dist/ui-badge-SIR81R9l.cjs +0 -28
- package/dist/ui-botao-D24oXySA.cjs +0 -12
- package/dist/ui-botao-Dsj08jjw.js +0 -165
- package/dist/ui-campo-texto-DauJCde3.cjs +0 -16
- 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-linha-C6HBnsaw.cjs +0 -19
- package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
- package/dist/ui-switch-D9a8XlVX.cjs +0 -53
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var S=(i,s,t)=>s in i?w(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t;var a=(i,s,t)=>S(i,typeof s!="symbol"?s+"":s,t);const d=require("./ssr-safe-CiHD1adl.cjs"),c=require("./form-validacao-ytRYSF3E.cjs"),I=require("./form-submissao-DxKO5MHI.cjs"),C=':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 100%);min-height:var(--ui-campo-altura, var(--ui-altura-minima, 15px));background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}',x=["label","placeholder","value","tipo","type","obrigatorio","required","minlength","min-length","maxlength","max-length","pattern","min","max","step","mensagem-validacao","helper-text","erro","mensagem-erro","disabled","readonly","label-flutuante","alternar-senha","tamanho","size","altura","height","densidade","aria-label"];function f(){return`
|
|
2
|
+
<style>${C}</style>
|
|
3
|
+
<div class="ui-campo-texto__container">
|
|
4
|
+
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
5
|
+
<div class="ui-campo-texto__wrapper" part="campo">
|
|
6
|
+
<span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
|
|
7
|
+
<slot name="icone-esquerda"></slot>
|
|
8
|
+
</span>
|
|
9
|
+
<input class="ui-campo-texto__input" part="input" type="text" />
|
|
10
|
+
<span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
|
|
11
|
+
<slot name="icone-direita"></slot>
|
|
12
|
+
</span>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="ui-campo-texto__helper" part="ajuda" style="display: none;"></div>
|
|
16
|
+
`}function v(i,s,t,e){if(i.textContent=s,!t)return;const n=document.createElement("span");n.className=e,n.setAttribute("aria-hidden","true"),n.textContent="*",i.append(" ",n)}function _(i){const{labelElement:s,inputElement:t,labelText:e,placeholderText:n,isFlutuante:r,estaFocado:o,obrigatorio:u}=i,l=t.value.trim()!=="";let h=!1;try{h=t.matches(":-webkit-autofill")}catch{h=!1}e?(v(s,e,!!u,"ui-campo-texto__asterisco"),s.style.display="flex",r&&(o||l||h)?s.classList.add("ui-campo-texto__label--ativa"):s.classList.remove("ui-campo-texto__label--ativa")):s.style.display="none",r&&!o&&!l&&!h?t.placeholder="":t.placeholder=n}function E(i,s,t){s?(i.classList.add("ui-campo-texto__icone--clicavel"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",t?"Ocultar senha":"Exibir senha")):(i.classList.remove("ui-campo-texto__icone--clicavel"),i.removeAttribute("role"),i.removeAttribute("tabindex"),i.removeAttribute("aria-label"))}function y(i,s,t,e,n,r){e?(i.classList.add("ui-campo-texto__wrapper--erro"),s.setAttribute("aria-invalid","true")):(i.classList.remove("ui-campo-texto__wrapper--erro"),s.removeAttribute("aria-invalid")),e&&n?(t.textContent=`⚠️ ${n}`,t.className="ui-campo-texto__helper ui-campo-texto__helper--erro",t.style.display="block"):r?(t.textContent=r,t.className="ui-campo-texto__helper",t.style.display="block"):t.style.display="none"}class b extends d.SafeHTMLElement{constructor(){super();a(this,"internals");a(this,"_formDisabled",!1);a(this,"_customErrorMessage","");this.internals=typeof this.attachInternals=="function"?this.attachInternals():{}}formDisabledCallback(t){this._formDisabled=t,this.syncState()}get form(){var t;return this.closest("form")??((t=this.internals)==null?void 0:t.form)??null}get required(){return this.hasAttribute("obrigatorio")||this.hasAttribute("required")}set required(t){t?this.setAttribute("obrigatorio",""):(this.removeAttribute("obrigatorio"),this.removeAttribute("required")),this.syncState()}get obrigatorio(){return this.required}set obrigatorio(t){this.required=t}get validity(){var t;return this.atualizarValidade(),(t=this.internals)==null?void 0:t.validity}get validationMessage(){var t;return this.atualizarValidade(),((t=this.internals)==null?void 0:t.validationMessage)??""}get willValidate(){var t;return((t=this.internals)==null?void 0:t.willValidate)??!1}checkValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.checkValidity)==null?void 0:e.call(t))??!0}reportValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.reportValidity)==null?void 0:e.call(t))??!0}setCustomValidity(t){this._customErrorMessage=t||"",this.atualizarValidade()}}a(b,"formAssociated",!0);class g extends b{constructor(){super();a(this,"labelElement");a(this,"wrapperElement");a(this,"inputElement");a(this,"helperElement");a(this,"rightIconContainer");a(this,"leftSlotElement");a(this,"_senhaVisivel",!1);a(this,"_checkTimer",null);a(this,"_focado",!1);a(this,"_inputId");a(this,"_defaultValue","");a(this,"handleSlotChange",()=>{this.syncState()});a(this,"handleHostClick",t=>{c.cliqueVeioDeRotuloExterno(this,t)&&!this.disabled&&this.inputElement.focus()});a(this,"handleRightIconClick",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.stopPropagation(),this.alternarVisibilidadeSenha())});a(this,"handleRightIconKeyDown",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),this.alternarVisibilidadeSenha())});a(this,"handleFocus",()=>{this._focado=!0,this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"),this.syncState()});a(this,"handleBlur",()=>{this._focado=!1,this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"),this.syncState()});a(this,"handleKeyDown",t=>{if(t.key!=="Enter"||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;const e=this.form;e&&setTimeout(()=>{!t.defaultPrevented&&this.isConnected&&I.submeterImplicitamente(e)})});a(this,"handleInput",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))});a(this,"handleChange",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-change",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))});const t=this.attachShadow({mode:"open",delegatesFocus:!0});t.innerHTML=f(),this.labelElement=t.querySelector(".ui-campo-texto__label"),this.wrapperElement=t.querySelector(".ui-campo-texto__wrapper"),this.inputElement=t.querySelector(".ui-campo-texto__input"),this.helperElement=t.querySelector(".ui-campo-texto__helper"),this.rightIconContainer=t.querySelector(".ui-campo-texto__icone--direita"),this.leftSlotElement=t.querySelector('slot[name="icone-esquerda"]'),this._inputId=c.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`,this.inputElement.setAttribute("aria-describedby",`${this._inputId}-helper`)}static get observedAttributes(){return x}focus(t){this.inputElement.focus(t)}blur(){this.inputElement.blur()}connectedCallback(){this.inputElement.addEventListener("input",this.handleInput),this.inputElement.addEventListener("change",this.handleChange),this.inputElement.addEventListener("focus",this.handleFocus),this.inputElement.addEventListener("blur",this.handleBlur),this.inputElement.addEventListener("keydown",this.handleKeyDown),this.rightIconContainer.addEventListener("click",this.handleRightIconClick),this.rightIconContainer.addEventListener("keydown",this.handleRightIconKeyDown),this.leftSlotElement.addEventListener("slotchange",this.handleSlotChange),this.addEventListener("click",this.handleHostClick),this._defaultValue=this.getAttribute("value")||"",this.hasAttribute("value")&&!this.inputElement.value&&(this.inputElement.value=this._defaultValue),this.syncState(),this._checkTimer=setTimeout(()=>this.syncState(),100)}disconnectedCallback(){this.inputElement.removeEventListener("input",this.handleInput),this.inputElement.removeEventListener("change",this.handleChange),this.inputElement.removeEventListener("focus",this.handleFocus),this.inputElement.removeEventListener("blur",this.handleBlur),this.inputElement.removeEventListener("keydown",this.handleKeyDown),this.rightIconContainer.removeEventListener("click",this.handleRightIconClick),this.rightIconContainer.removeEventListener("keydown",this.handleRightIconKeyDown),this.leftSlotElement.removeEventListener("slotchange",this.handleSlotChange),this.removeEventListener("click",this.handleHostClick),this._checkTimer&&clearTimeout(this._checkTimer)}attributeChangedCallback(t,e,n){t==="value"&&n!==this.inputElement.value&&!this._focado&&(this.inputElement.value=n||""),this.syncState()}get value(){return this.inputElement?this.inputElement.value:this.getAttribute("value")||""}set value(t){if(this.setAttribute("value",t),this.inputElement)try{this.inputElement.value=t}catch{}this.syncState()}formResetCallback(){var t;this.inputElement.value=this._defaultValue,(t=this.internals)==null||t.setFormValue(this._defaultValue),this.syncState()}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("tipo")||this.getAttribute("type")||"text"}get disabled(){return this.hasAttribute("disabled")||this._formDisabled}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get minLength(){const t=this.getAttribute("minlength")??this.getAttribute("min-length");return t?parseInt(t,10):-1}set minLength(t){t>=0?this.setAttribute("minlength",String(t)):this.removeAttribute("minlength"),this.syncState()}get maxLength(){const t=this.getAttribute("maxlength")??this.getAttribute("max-length");return t?parseInt(t,10):-1}set maxLength(t){t>=0?this.setAttribute("maxlength",String(t)):this.removeAttribute("maxlength"),this.syncState()}get pattern(){return this.getAttribute("pattern")||""}set pattern(t){t?this.setAttribute("pattern",t):this.removeAttribute("pattern"),this.syncState()}atualizarValidade(){var p,m;const t=this.getAttribute("minlength")??this.getAttribute("min-length"),e=this.getAttribute("maxlength")??this.getAttribute("max-length"),n=this.getAttribute("min"),r=this.getAttribute("max"),o=this.inputElement?this.inputElement.value:"",u=this.getAttribute("value")||o,l=!!((m=(p=this.inputElement)==null?void 0:p.validity)!=null&&m.badInput),h=c.validarRestricoesCampoTexto({val:o,rawVal:u,badInput:l,disabled:this.disabled,required:this.required,tipo:this.type,minlength:t!==null?parseInt(t,10):null,maxlength:e!==null?parseInt(e,10):null,min:n!==null?parseFloat(n):null,max:r!==null?parseFloat(r):null,step:this.getAttribute("step"),pattern:this.getAttribute("pattern"),customError:this._customErrorMessage,mensagemValidacao:this.getAttribute("mensagem-validacao")});c.aplicarValidadeInternals(this.internals,h,this.inputElement)}alternarVisibilidadeSenha(){var n;if(!(this.getAttribute("tipo")==="password"||this._senhaVisivel))return;this._senhaVisivel=!this._senhaVisivel,this.inputElement.type=this._senhaVisivel?"text":"password";const e=(n=this.shadowRoot)==null?void 0:n.querySelector('slot[name="icone-direita"]');e&&e.assignedElements().forEach(o=>{var u,l;(((u=o.textContent)==null?void 0:u.trim())==="👁️"||((l=o.textContent)==null?void 0:l.trim())==="🙈")&&(o.textContent=this._senhaVisivel?"🙈":"👁️")}),this.dispatchEvent(new CustomEvent("ui-toggle-senha",{detail:{visivel:this._senhaVisivel},bubbles:!0,composed:!0}))}syncState(){this.leftSlotElement.assignedNodes().length>0||this.querySelector('[slot="icone-esquerda"]')!==null?this.setAttribute("tem-icone-esquerda",""):this.removeAttribute("tem-icone-esquerda");const e=this.getAttribute("altura")||this.getAttribute("height");e?this.style.setProperty("--ui-campo-altura",isNaN(Number(e))?e:`${e}px`):this.style.removeProperty("--ui-campo-altura"),_({labelElement:this.labelElement,inputElement:this.inputElement,labelText:this.getAttribute("label"),placeholderText:this.getAttribute("placeholder")||"",isFlutuante:this.hasAttribute("label-flutuante"),estaFocado:this._focado,obrigatorio:this.required}),this.sincronizarNomeAcessivel();const n=this.getAttribute("tipo")||this.getAttribute("type")||"text";if(!this._senhaVisivel)try{this.inputElement.type=n}catch{this.inputElement.type="text"}const r=this.getAttribute("minlength")??this.getAttribute("min-length");r!==null?this.inputElement.minLength=parseInt(r,10):this.inputElement.removeAttribute("minlength");const o=this.getAttribute("maxlength")??this.getAttribute("max-length");o!==null?this.inputElement.maxLength=parseInt(o,10):this.inputElement.removeAttribute("maxlength");const u=this.getAttribute("pattern");u!==null?this.inputElement.pattern=u:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const l=this.hasAttribute("disabled")||this._formDisabled,h=this.hasAttribute("readonly");this.inputElement.disabled=l,this.inputElement.readOnly=h,l?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const p=n==="password"||this.hasAttribute("alternar-senha");E(this.rightIconContainer,p,this._senhaVisivel);const m=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");y(this.wrapperElement,this.inputElement,this.helperElement,m,this.getAttribute("mensagem-erro"),this.getAttribute("helper-text")),this.atualizarValidade()}sincronizarNomeAcessivel(){const t=this.getAttribute("label")?"":c.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class A extends g{}d.definirCustomElement("ui-campo-texto",g);d.definirCustomElement("ui-input",A);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=x;exports.FormAssociatedElement=b;exports.UICampoTexto=g;exports.UIInput=A;exports.criarTemplateCampoTexto=f;exports.renderizarRotulo=v;exports.sincronizarFeedbackErro=y;exports.sincronizarIconeSenha=E;exports.sincronizarLabelEPlaceholder=_;
|
|
@@ -2,11 +2,9 @@ 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
|
-
|
|
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 = [
|
|
5
|
+
import { g as v, v as _, a as E, o as y, c as A } from "./form-validacao-BIOXxt-1.js";
|
|
6
|
+
import { a as w } from "./form-submissao-C-SPRKgT.js";
|
|
7
|
+
const S = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 100%);min-height:var(--ui-campo-altura, var(--ui-altura-minima, 15px));background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}', k = [
|
|
10
8
|
"label",
|
|
11
9
|
"placeholder",
|
|
12
10
|
"value",
|
|
@@ -37,9 +35,9 @@ const k = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizin
|
|
|
37
35
|
"densidade",
|
|
38
36
|
"aria-label"
|
|
39
37
|
];
|
|
40
|
-
function
|
|
38
|
+
function C() {
|
|
41
39
|
return `
|
|
42
|
-
<style>${
|
|
40
|
+
<style>${S}</style>
|
|
43
41
|
<div class="ui-campo-texto__container">
|
|
44
42
|
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
45
43
|
<div class="ui-campo-texto__wrapper" part="campo">
|
|
@@ -55,26 +53,26 @@ function I() {
|
|
|
55
53
|
<div class="ui-campo-texto__helper" part="ajuda" style="display: none;"></div>
|
|
56
54
|
`;
|
|
57
55
|
}
|
|
58
|
-
function
|
|
56
|
+
function I(i, s, t, e) {
|
|
59
57
|
if (i.textContent = s, !t) return;
|
|
60
58
|
const n = document.createElement("span");
|
|
61
59
|
n.className = e, n.setAttribute("aria-hidden", "true"), n.textContent = "*", i.append(" ", n);
|
|
62
60
|
}
|
|
63
|
-
function
|
|
64
|
-
const { labelElement: s, inputElement: t, labelText: e, placeholderText: n, isFlutuante:
|
|
61
|
+
function V(i) {
|
|
62
|
+
const { labelElement: s, inputElement: t, labelText: e, placeholderText: n, isFlutuante: r, estaFocado: o, obrigatorio: u } = i, l = t.value.trim() !== "";
|
|
65
63
|
let h = !1;
|
|
66
64
|
try {
|
|
67
65
|
h = t.matches(":-webkit-autofill");
|
|
68
66
|
} catch {
|
|
69
67
|
h = !1;
|
|
70
68
|
}
|
|
71
|
-
e ? (
|
|
69
|
+
e ? (I(s, e, !!u, "ui-campo-texto__asterisco"), s.style.display = "flex", r && (o || l || h) ? s.classList.add("ui-campo-texto__label--ativa") : s.classList.remove("ui-campo-texto__label--ativa")) : s.style.display = "none", r && !o && !l && !h ? t.placeholder = "" : t.placeholder = n;
|
|
72
70
|
}
|
|
73
|
-
function
|
|
71
|
+
function L(i, s, t) {
|
|
74
72
|
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"));
|
|
75
73
|
}
|
|
76
|
-
function
|
|
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") :
|
|
74
|
+
function q(i, s, t, e, n, r) {
|
|
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") : r ? (t.textContent = r, t.className = "ui-campo-texto__helper", t.style.display = "block") : t.style.display = "none";
|
|
78
76
|
}
|
|
79
77
|
class d extends f {
|
|
80
78
|
constructor() {
|
|
@@ -148,7 +146,7 @@ class b extends d {
|
|
|
148
146
|
this.syncState();
|
|
149
147
|
});
|
|
150
148
|
a(this, "handleHostClick", (t) => {
|
|
151
|
-
|
|
149
|
+
A(this, t) && !this.disabled && this.inputElement.focus();
|
|
152
150
|
});
|
|
153
151
|
a(this, "handleRightIconClick", (t) => {
|
|
154
152
|
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
@@ -170,7 +168,7 @@ class b extends d {
|
|
|
170
168
|
if (t.key !== "Enter" || t.isComposing || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
171
169
|
const e = this.form;
|
|
172
170
|
e && setTimeout(() => {
|
|
173
|
-
!t.defaultPrevented && this.isConnected &&
|
|
171
|
+
!t.defaultPrevented && this.isConnected && w(e);
|
|
174
172
|
});
|
|
175
173
|
});
|
|
176
174
|
a(this, "handleInput", (t) => {
|
|
@@ -206,10 +204,10 @@ class b extends d {
|
|
|
206
204
|
);
|
|
207
205
|
});
|
|
208
206
|
const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
|
|
209
|
-
t.innerHTML =
|
|
207
|
+
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`, this.inputElement.setAttribute("aria-describedby", `${this._inputId}-helper`);
|
|
210
208
|
}
|
|
211
209
|
static get observedAttributes() {
|
|
212
|
-
return
|
|
210
|
+
return k;
|
|
213
211
|
}
|
|
214
212
|
focus(t) {
|
|
215
213
|
this.inputElement.focus(t);
|
|
@@ -282,32 +280,32 @@ class b extends d {
|
|
|
282
280
|
}
|
|
283
281
|
atualizarValidade() {
|
|
284
282
|
var c, p;
|
|
285
|
-
const t = this.getAttribute("minlength") ?? this.getAttribute("min-length"), e = this.getAttribute("maxlength") ?? this.getAttribute("max-length"), n = this.getAttribute("min"),
|
|
286
|
-
val:
|
|
287
|
-
rawVal:
|
|
288
|
-
badInput:
|
|
283
|
+
const t = this.getAttribute("minlength") ?? this.getAttribute("min-length"), e = this.getAttribute("maxlength") ?? this.getAttribute("max-length"), n = this.getAttribute("min"), r = this.getAttribute("max"), o = this.inputElement ? this.inputElement.value : "", u = this.getAttribute("value") || o, l = !!((p = (c = this.inputElement) == null ? void 0 : c.validity) != null && p.badInput), h = _({
|
|
284
|
+
val: o,
|
|
285
|
+
rawVal: u,
|
|
286
|
+
badInput: l,
|
|
289
287
|
disabled: this.disabled,
|
|
290
288
|
required: this.required,
|
|
291
289
|
tipo: this.type,
|
|
292
290
|
minlength: t !== null ? parseInt(t, 10) : null,
|
|
293
291
|
maxlength: e !== null ? parseInt(e, 10) : null,
|
|
294
292
|
min: n !== null ? parseFloat(n) : null,
|
|
295
|
-
max:
|
|
293
|
+
max: r !== null ? parseFloat(r) : null,
|
|
296
294
|
step: this.getAttribute("step"),
|
|
297
295
|
pattern: this.getAttribute("pattern"),
|
|
298
296
|
customError: this._customErrorMessage,
|
|
299
297
|
mensagemValidacao: this.getAttribute("mensagem-validacao")
|
|
300
298
|
});
|
|
301
|
-
|
|
299
|
+
E(this.internals, h, this.inputElement);
|
|
302
300
|
}
|
|
303
301
|
alternarVisibilidadeSenha() {
|
|
304
302
|
var n;
|
|
305
303
|
if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
|
|
306
304
|
this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
|
|
307
305
|
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector('slot[name="icone-direita"]');
|
|
308
|
-
e && e.assignedElements().forEach((
|
|
309
|
-
var
|
|
310
|
-
(((
|
|
306
|
+
e && e.assignedElements().forEach((o) => {
|
|
307
|
+
var u, l;
|
|
308
|
+
(((u = o.textContent) == null ? void 0 : u.trim()) === "👁️" || ((l = o.textContent) == null ? void 0 : l.trim()) === "🙈") && (o.textContent = this._senhaVisivel ? "🙈" : "👁️");
|
|
311
309
|
}), this.dispatchEvent(
|
|
312
310
|
new CustomEvent("ui-toggle-senha", {
|
|
313
311
|
detail: { visivel: this._senhaVisivel },
|
|
@@ -317,7 +315,9 @@ class b extends d {
|
|
|
317
315
|
);
|
|
318
316
|
}
|
|
319
317
|
syncState() {
|
|
320
|
-
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda")
|
|
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({
|
|
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 n = this.getAttribute("tipo") || this.getAttribute("type") || "text";
|
|
330
330
|
if (!this._senhaVisivel)
|
|
331
331
|
try {
|
|
332
|
-
this.inputElement.type =
|
|
332
|
+
this.inputElement.type = n;
|
|
333
333
|
} catch {
|
|
334
334
|
this.inputElement.type = "text";
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
|
|
336
|
+
const r = this.getAttribute("minlength") ?? this.getAttribute("min-length");
|
|
337
|
+
r !== null ? this.inputElement.minLength = parseInt(r, 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 u = this.getAttribute("pattern");
|
|
341
|
+
u !== null ? this.inputElement.pattern = u : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
|
|
342
|
+
const l = this.hasAttribute("disabled") || this._formDisabled, h = this.hasAttribute("readonly");
|
|
343
|
+
this.inputElement.disabled = l, this.inputElement.readOnly = h, l ? this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled") : this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");
|
|
344
|
+
const c = n === "password" || this.hasAttribute("alternar-senha");
|
|
345
|
+
L(this.rightIconContainer, c, this._senhaVisivel);
|
|
346
|
+
const p = this.hasAttribute("erro") || this.hasAttribute("mensagem-erro");
|
|
347
|
+
q(
|
|
348
348
|
this.wrapperElement,
|
|
349
349
|
this.inputElement,
|
|
350
350
|
this.helperElement,
|
|
351
|
-
|
|
351
|
+
p,
|
|
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") ? "" : y(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 z extends b {
|
|
366
366
|
}
|
|
367
367
|
m("ui-campo-texto", b);
|
|
368
|
-
m("ui-input",
|
|
368
|
+
m("ui-input", z);
|
|
369
369
|
export {
|
|
370
|
-
|
|
370
|
+
k as A,
|
|
371
371
|
d as F,
|
|
372
372
|
b as U,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
373
|
+
z as a,
|
|
374
|
+
L as b,
|
|
375
|
+
C as c,
|
|
376
|
+
V as d,
|
|
377
|
+
I as r,
|
|
378
|
+
q as s
|
|
379
379
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var E=(i,t,e)=>t in i?w(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>E(i,typeof t!="symbol"?t+"":t,e);const k=require("./listener-bag-D5omxZ9h.cjs"),x=require("./ssr-safe-CiHD1adl.cjs"),A=':host{display:block;width:100%;box-sizing:border-box}:host(.h-full),:host([style*="height: 100%"]){height:100%}.ui-card{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-card--plano{background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:none}.ui-card--elevado{background-color:var(--ui-cor-fundo-elevado, #1e1e24);box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .4));border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent)}.ui-card--destaque{border-color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:0 0 0 1px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-card--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none}.ui-card--clicavel:hover{transform:translateY(-3px);border-color:var(--ui-cor-primaria, #00E08A);box-shadow:var(--ui-sombra-lg, 0 10px 30px rgba(0, 0, 0, .5)),0 0 15px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-card--clicavel:active{transform:translateY(-1px)}.ui-card--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-card__media{width:100%;overflow:hidden;display:block;line-height:0}::slotted([slot="midia"]),::slotted([slot="media"]){width:100%;height:auto;display:block;object-fit:cover}.ui-card__header{padding:14px 16px 8px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card__body{padding:12px 16px;flex:1;box-sizing:border-box}.ui-card__footer{padding:10px 16px 14px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card--compacto .ui-card__header{padding:10px 12px 6px}.ui-card--compacto .ui-card__body{padding:8px 12px}.ui-card--compacto .ui-card__footer{padding:8px 12px 10px}';class f extends x.SafeHTMLElement{constructor(){super();r(this,"cardElement");r(this,"listeners",new k.ListenerBag);r(this,"handleSlotChange",()=>{this.syncState()});r(this,"handleClick",e=>{this.disabled||e&&e.target&&e.target instanceof HTMLElement&&e.target.closest('button, a, input, select, textarea, ui-botao, ui-switch, ui-checkbox, ui-radio, [role="button"]')||this.clicavel&&(this.dispatchEvent(new CustomEvent("ui-click",{detail:{id:this.id||"sem-id"},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-clique",{detail:{id:this.id||"sem-id"},bubbles:!0,composed:!0})))});r(this,"handleKeyDown",e=>{!this.clicavel||this.disabled||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleClick())});const e=this.attachShadow({mode:"open"});e.innerHTML=`
|
|
2
|
+
<style>${A}</style>
|
|
3
|
+
<div class="ui-card" part="base">
|
|
4
|
+
<div class="ui-card__media" part="midia">
|
|
5
|
+
<slot name="midia"></slot>
|
|
6
|
+
<slot name="media"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="ui-card__header" part="cabecalho">
|
|
9
|
+
<slot name="cabecalho"></slot>
|
|
10
|
+
<slot name="header"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="ui-card__body" part="corpo">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="ui-card__footer" part="rodape">
|
|
16
|
+
<slot name="rodape"></slot>
|
|
17
|
+
<slot name="footer"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`,this.cardElement=e.querySelector(".ui-card")}static get observedAttributes(){return["elevacao","elevation","variante","variant","clicavel","clickable","compacto","compact","disabled"]}connectedCallback(){var a;this.listeners.cleanup(),this.listeners.add(this.cardElement,"click",this.handleClick),this.listeners.add(this.cardElement,"keydown",this.handleKeyDown);const e=(a=this.shadowRoot)==null?void 0:a.querySelectorAll("slot");e==null||e.forEach(s=>this.listeners.add(s,"slotchange",this.handleSlotChange)),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(e,a,s){this.syncState()}get clicavel(){return this.hasAttribute("clicavel")||this.hasAttribute("clickable")}set clicavel(e){e?this.setAttribute("clicavel",""):(this.removeAttribute("clicavel"),this.removeAttribute("clickable")),this.syncState()}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.syncState()}syncState(){var h,b,p;const e=this.getAttribute("elevacao")||this.getAttribute("elevation")||"plano",a=this.getAttribute("variante")||this.getAttribute("variant"),s=this.clicavel,g=this.hasAttribute("compacto")||this.hasAttribute("compact"),y=this.disabled;this.cardElement.className="ui-card",this.cardElement.classList.add(`ui-card--${e}`),a&&this.cardElement.classList.add(`ui-card--${a}`),s?(this.cardElement.classList.add("ui-card--clicavel"),this.cardElement.setAttribute("tabindex","0")):this.cardElement.removeAttribute("tabindex"),g&&this.cardElement.classList.add("ui-card--compacto"),y&&this.cardElement.classList.add("ui-card--disabled");const l=(h=this.shadowRoot)==null?void 0:h.querySelector(".ui-card__header"),n=(b=this.shadowRoot)==null?void 0:b.querySelector(".ui-card__footer"),u=(p=this.shadowRoot)==null?void 0:p.querySelector(".ui-card__media"),c=m=>{var v;const _=m.map(o=>`slot[name="${o}"]`).join(", ");return Array.from(((v=this.shadowRoot)==null?void 0:v.querySelectorAll(_))||[]).some(o=>o.assignedNodes({flatten:!0}).some(d=>d.nodeType===Node.ELEMENT_NODE||d.textContent&&d.textContent.trim()!==""))||m.some(o=>this.querySelector(`[slot="${o}"]`)!==null)};u&&(u.style.display=c(["midia","media"])?"block":"none"),l&&(l.style.display=c(["cabecalho","header"])?"flex":"none"),n&&(n.style.display=c(["rodape","footer"])?"flex":"none")}}x.definirCustomElement("ui-card",f);exports.UICard=f;
|
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
var
|
|
2
|
-
var _ = (
|
|
3
|
-
var
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var _ = (i, t, e) => t in i ? y(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var o = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { L as w } from "./listener-bag-DQgv7OON.js";
|
|
5
|
-
import { d as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class q extends k {
|
|
5
|
+
import { d as E, S as k } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
+
const A = ':host{display:block;width:100%;box-sizing:border-box}:host(.h-full),:host([style*="height: 100%"]){height:100%}.ui-card{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-card--plano{background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:none}.ui-card--elevado{background-color:var(--ui-cor-fundo-elevado, #1e1e24);box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .4));border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent)}.ui-card--destaque{border-color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:0 0 0 1px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-card--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none}.ui-card--clicavel:hover{transform:translateY(-3px);border-color:var(--ui-cor-primaria, #00E08A);box-shadow:var(--ui-sombra-lg, 0 10px 30px rgba(0, 0, 0, .5)),0 0 15px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-card--clicavel:active{transform:translateY(-1px)}.ui-card--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-card__media{width:100%;overflow:hidden;display:block;line-height:0}::slotted([slot="midia"]),::slotted([slot="media"]){width:100%;height:auto;display:block;object-fit:cover}.ui-card__header{padding:14px 16px 8px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card__body{padding:12px 16px;flex:1;box-sizing:border-box}.ui-card__footer{padding:10px 16px 14px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card--compacto .ui-card__header{padding:10px 12px 6px}.ui-card--compacto .ui-card__body{padding:8px 12px}.ui-card--compacto .ui-card__footer{padding:8px 12px 10px}';
|
|
7
|
+
class S extends k {
|
|
9
8
|
constructor() {
|
|
10
9
|
super();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
o(this, "cardElement");
|
|
11
|
+
o(this, "listeners", new w());
|
|
12
|
+
o(this, "handleSlotChange", () => {
|
|
14
13
|
this.syncState();
|
|
15
14
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
id: this.id || "sem-id"
|
|
35
|
-
},
|
|
36
|
-
bubbles: !0,
|
|
37
|
-
composed: !0
|
|
38
|
-
})
|
|
39
|
-
));
|
|
40
|
-
}
|
|
15
|
+
o(this, "handleClick", (e) => {
|
|
16
|
+
this.disabled || e && e.target && e.target instanceof HTMLElement && e.target.closest('button, a, input, select, textarea, ui-botao, ui-switch, ui-checkbox, ui-radio, [role="button"]') || this.clicavel && (this.dispatchEvent(
|
|
17
|
+
new CustomEvent("ui-click", {
|
|
18
|
+
detail: {
|
|
19
|
+
id: this.id || "sem-id"
|
|
20
|
+
},
|
|
21
|
+
bubbles: !0,
|
|
22
|
+
composed: !0
|
|
23
|
+
})
|
|
24
|
+
), this.dispatchEvent(
|
|
25
|
+
new CustomEvent("ui-clique", {
|
|
26
|
+
detail: {
|
|
27
|
+
id: this.id || "sem-id"
|
|
28
|
+
},
|
|
29
|
+
bubbles: !0,
|
|
30
|
+
composed: !0
|
|
31
|
+
})
|
|
32
|
+
));
|
|
41
33
|
});
|
|
42
|
-
|
|
34
|
+
o(this, "handleKeyDown", (e) => {
|
|
43
35
|
!this.clicavel || this.disabled || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleClick());
|
|
44
36
|
});
|
|
45
37
|
const e = this.attachShadow({ mode: "open" });
|
|
46
38
|
e.innerHTML = `
|
|
47
|
-
<style>${
|
|
39
|
+
<style>${A}</style>
|
|
48
40
|
<div class="ui-card" part="base">
|
|
49
41
|
<div class="ui-card__media" part="midia">
|
|
50
42
|
<slot name="midia"></slot>
|
|
@@ -78,15 +70,15 @@ class q extends k {
|
|
|
78
70
|
];
|
|
79
71
|
}
|
|
80
72
|
connectedCallback() {
|
|
81
|
-
var
|
|
73
|
+
var a;
|
|
82
74
|
this.listeners.cleanup(), this.listeners.add(this.cardElement, "click", this.handleClick), this.listeners.add(this.cardElement, "keydown", this.handleKeyDown);
|
|
83
|
-
const e = (
|
|
75
|
+
const e = (a = this.shadowRoot) == null ? void 0 : a.querySelectorAll("slot");
|
|
84
76
|
e == null || e.forEach((s) => this.listeners.add(s, "slotchange", this.handleSlotChange)), this.syncState();
|
|
85
77
|
}
|
|
86
78
|
disconnectedCallback() {
|
|
87
79
|
this.listeners.cleanup();
|
|
88
80
|
}
|
|
89
|
-
attributeChangedCallback(e,
|
|
81
|
+
attributeChangedCallback(e, a, s) {
|
|
90
82
|
this.syncState();
|
|
91
83
|
}
|
|
92
84
|
get clicavel() {
|
|
@@ -102,18 +94,18 @@ class q extends k {
|
|
|
102
94
|
e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
|
|
103
95
|
}
|
|
104
96
|
syncState() {
|
|
105
|
-
var b, p
|
|
106
|
-
const e =
|
|
107
|
-
this.cardElement.className = "ui-card", this.cardElement.classList.add(`ui-card--${e}`),
|
|
108
|
-
const
|
|
109
|
-
var
|
|
110
|
-
const
|
|
111
|
-
return Array.from(((
|
|
97
|
+
var h, b, p;
|
|
98
|
+
const e = this.getAttribute("elevacao") || this.getAttribute("elevation") || "plano", a = this.getAttribute("variante") || this.getAttribute("variant"), s = this.clicavel, x = this.hasAttribute("compacto") || this.hasAttribute("compact"), f = this.disabled;
|
|
99
|
+
this.cardElement.className = "ui-card", this.cardElement.classList.add(`ui-card--${e}`), a && this.cardElement.classList.add(`ui-card--${a}`), s ? (this.cardElement.classList.add("ui-card--clicavel"), this.cardElement.setAttribute("tabindex", "0")) : this.cardElement.removeAttribute("tabindex"), x && this.cardElement.classList.add("ui-card--compacto"), f && this.cardElement.classList.add("ui-card--disabled");
|
|
100
|
+
const l = (h = this.shadowRoot) == null ? void 0 : h.querySelector(".ui-card__header"), n = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".ui-card__footer"), u = (p = this.shadowRoot) == null ? void 0 : p.querySelector(".ui-card__media"), c = (m) => {
|
|
101
|
+
var v;
|
|
102
|
+
const g = m.map((r) => `slot[name="${r}"]`).join(", ");
|
|
103
|
+
return Array.from(((v = this.shadowRoot) == null ? void 0 : v.querySelectorAll(g)) || []).some((r) => r.assignedNodes({ flatten: !0 }).some((d) => d.nodeType === Node.ELEMENT_NODE || d.textContent && d.textContent.trim() !== "")) || m.some((r) => this.querySelector(`[slot="${r}"]`) !== null);
|
|
112
104
|
};
|
|
113
|
-
|
|
105
|
+
u && (u.style.display = c(["midia", "media"]) ? "block" : "none"), l && (l.style.display = c(["cabecalho", "header"]) ? "flex" : "none"), n && (n.style.display = c(["rodape", "footer"]) ? "flex" : "none");
|
|
114
106
|
}
|
|
115
107
|
}
|
|
116
|
-
|
|
108
|
+
E("ui-card", S);
|
|
117
109
|
export {
|
|
118
|
-
|
|
110
|
+
S as U
|
|
119
111
|
};
|