@thibezer/ui-components-kit 2.24.0 → 2.24.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/dist/botao.cjs +12 -1
  3. package/dist/botao.js +162 -3
  4. package/dist/camadas.cjs +311 -1
  5. package/dist/camadas.js +3244 -148
  6. package/dist/campo-texto.cjs +16 -1
  7. package/dist/campo-texto.js +308 -7
  8. package/dist/canvas.cjs +22 -22
  9. package/dist/canvas.js +230 -233
  10. package/dist/card.cjs +20 -1
  11. package/dist/card.js +145 -2
  12. package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
  13. package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +18 -0
  14. package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +4 -0
  15. package/dist/components/ui-card/ui-card.d.ts +4 -0
  16. package/dist/components/ui-editor-prancha/editor-modos.d.ts +10 -0
  17. package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
  18. package/dist/components/ui-editor-prancha/index.d.ts +1 -0
  19. package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +39 -6
  20. package/dist/core.cjs +1 -1
  21. package/dist/core.js +44 -55
  22. package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
  23. package/dist/cores.cjs +32 -1
  24. package/dist/cores.js +300 -13
  25. package/dist/custom-elements.json +33962 -33439
  26. package/dist/data.cjs +28 -1
  27. package/dist/data.js +286 -99
  28. package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
  29. package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
  30. package/dist/feedback.cjs +52 -1
  31. package/dist/feedback.js +655 -25
  32. package/dist/forms.cjs +66 -1
  33. package/dist/forms.js +1216 -39
  34. package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
  35. package/dist/index.cjs +67 -1
  36. package/dist/index.js +1476 -274
  37. package/dist/kit-base-CGqj9aiD.cjs +2 -0
  38. package/dist/kit-base-_THn4w3u.js +1079 -0
  39. package/dist/mapa.cjs +5 -5
  40. package/dist/mapa.js +16 -17
  41. package/dist/modal.cjs +18 -1
  42. package/dist/modal.js +235 -29
  43. package/dist/motor.js +49 -49
  44. package/dist/prancha-nucleo.cjs +3 -1
  45. package/dist/prancha-nucleo.js +3120 -277
  46. package/dist/prancha.cjs +38 -1
  47. package/dist/prancha.js +3233 -228
  48. package/dist/register.cjs +1 -1
  49. package/dist/register.js +3 -20
  50. package/dist/seletor-mapa-base.cjs +13 -13
  51. package/dist/seletor-mapa-base.js +3 -5
  52. package/dist/tabela.cjs +142 -1
  53. package/dist/tabela.js +3773 -92
  54. package/dist/tipos-elementos.d.ts +5 -1
  55. package/dist/tipos-vue.d.ts +4 -1
  56. package/dist/tools.cjs +16 -1
  57. package/dist/tools.js +1564 -26
  58. package/dist/ui-seletor-cor-BGw8SBPm.cjs +83 -0
  59. package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-B_twSm-V.js} +8 -9
  60. package/dist/utils-ClVgqVyJ.cjs +1 -0
  61. package/dist/utils-DrHoxxmf.js +83 -0
  62. package/package.json +43 -2
  63. package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
  64. package/dist/acessibilidade-CUlSXc2X.js +0 -38
  65. package/dist/altura-controle-ukMRPckR.cjs +0 -1
  66. package/dist/altura-controle-vxQiXG4q.js +0 -62
  67. package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
  68. package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
  69. package/dist/degrade-CIxvOTUv.cjs +0 -1
  70. package/dist/degrade-gDa5sW__.js +0 -119
  71. package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
  72. package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
  73. package/dist/feature_historico-BAIYk1Me.cjs +0 -3
  74. package/dist/feature_historico-C4h9y5fu.js +0 -3039
  75. package/dist/form-atalhos-7JTYvumA.cjs +0 -1
  76. package/dist/form-atalhos-DDTlpgaB.js +0 -203
  77. package/dist/form-erros-CwPz7Jr4.cjs +0 -1
  78. package/dist/form-erros-DT5HklfD.js +0 -184
  79. package/dist/form-submissao-C-SPRKgT.js +0 -61
  80. package/dist/form-submissao-DxKO5MHI.cjs +0 -1
  81. package/dist/form-validacao-BlQFxUVj.js +0 -104
  82. package/dist/form-validacao-DIeyQVH5.cjs +0 -1
  83. package/dist/geometria-px-DKrWq_XY.js +0 -639
  84. package/dist/leaflet-CEPcxGWV.cjs +0 -1
  85. package/dist/leaflet-DOq10gfg.js +0 -84
  86. package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
  87. package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
  88. package/dist/listener-bag-D5omxZ9h.cjs +0 -1
  89. package/dist/listener-bag-DQgv7OON.js +0 -34
  90. package/dist/motor-By2te6PZ.js +0 -1400
  91. package/dist/motor-CkMxd378.cjs +0 -1
  92. package/dist/opcoes-CupvWVIm.js +0 -24
  93. package/dist/opcoes-vdAUY5OI.cjs +0 -1
  94. package/dist/parts-CaoQiCfI.js +0 -7
  95. package/dist/parts-vQa2873h.cjs +0 -1
  96. package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
  97. package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
  98. package/dist/ssr-safe-5cWfJP-s.js +0 -10
  99. package/dist/ssr-safe-CiHD1adl.cjs +0 -1
  100. package/dist/svg-seguro-ChVJ2L2z.js +0 -74
  101. package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
  102. package/dist/ui-badge-DE58YSBY.cjs +0 -28
  103. package/dist/ui-badge-KgmI3jOD.js +0 -201
  104. package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
  105. package/dist/ui-botao-zLkcMMyP.js +0 -168
  106. package/dist/ui-bus-CUd99VJi.js +0 -177
  107. package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
  108. package/dist/ui-camadas-DoHPnbQm.js +0 -3133
  109. package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
  110. package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
  111. package/dist/ui-campo-texto-btevggO3.js +0 -379
  112. package/dist/ui-card-7IEYbCN0.js +0 -150
  113. package/dist/ui-card-Bx8EyzYY.cjs +0 -20
  114. package/dist/ui-card-DFnRp9bl.js +0 -146
  115. package/dist/ui-card-DrWVJQKw.cjs +0 -20
  116. package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
  117. package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
  118. package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
  119. package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
  120. package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
  121. package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
  122. package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
  123. package/dist/ui-linha-B4mBRm1x.cjs +0 -61
  124. package/dist/ui-linha-DTEIIww4.js +0 -1167
  125. package/dist/ui-linha-KFF86FW5.js +0 -752
  126. package/dist/ui-modal-BrXzVZ65.js +0 -216
  127. package/dist/ui-modal-lARKzEVZ.cjs +0 -18
  128. package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
  129. package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
  130. package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
  131. package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
  132. package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
  133. package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
  134. package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
  135. package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
  136. package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
  137. package/dist/ui-skeleton-BLEV6h3k.js +0 -653
  138. package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
  139. package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
  140. package/dist/ui-switch-Ctxk-jKS.js +0 -1212
  141. package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
  142. package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
  143. package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
  144. package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
  145. package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
  146. package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
  147. package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
  148. package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
  149. package/dist/zero-js-triggers-CJT988bR.js +0 -83
  150. package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
@@ -1,16 +0,0 @@
1
- "use strict";var S=Object.defineProperty;var q=(a,s,t)=>s in a?S(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var i=(a,s,t)=>q(a,typeof s!="symbol"?s+"":s,t);const x=require("./degrade-CIxvOTUv.cjs"),d=require("./ssr-safe-CiHD1adl.cjs"),V=require("./altura-controle-ukMRPckR.cjs"),C=require("./listener-bag-D5omxZ9h.cjs"),b=require("./opcoes-vdAUY5OI.cjs"),h=require("./acessibilidade-CSzX-DkG.cjs"),g=require("./form-validacao-DIeyQVH5.cjs"),k=require("./form-submissao-DxKO5MHI.cjs"),I=':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:var(--ui-degrade-interno, var(--ui-campo-texto-fundo, var(--ui-fundo-elevado, 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:var(--ui-degrade-interno, var(--ui-campo-texto-fundo, var(--ui-fundo-card, 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:var(--ui-campo-texto-desabilitado-fundo, 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:var(--ui-campo-texto-rotulo-fundo, 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:var(--ui-campo-texto-rotulo-fundo, var(--ui-cor-fundo-elevado, #1a1a1e))}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}:host(.squarecircle) .ui-campo-texto__container,:host(.squarecircles) .ui-campo-texto__container,:host(.ui-squarecircle) .ui-campo-texto__container,:host(.ui-squarecircles) .ui-campo-texto__container,:host([formato="squarecircle"]) .ui-campo-texto__container,:host([formato="squarecircles"]) .ui-campo-texto__container,:host([formato="squircle"]) .ui-campo-texto__container{border-radius:var(--ui-raio-lg, 10px)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-card: var(--ui-gradiente-card)}',f=["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",...x.ATRIBUTOS_DEGRADE];function _(){return`
2
- <style>${I}</style>
3
- <div class="ui-campo-texto__container">
4
- <label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
5
- <div class="ui-campo-texto__wrapper" part="campo">
6
- <span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
7
- <slot name="icone-esquerda"></slot>
8
- </span>
9
- <input class="ui-campo-texto__input" part="input" type="text" />
10
- <span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
11
- <slot name="icone-direita"></slot>
12
- </span>
13
- </div>
14
- </div>
15
- <div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
16
- `}function v(a,s,t,e){if(a.textContent=s,!t)return;const r=document.createElement("span");r.className=e,r.setAttribute("aria-hidden","true"),r.textContent="*",a.append(" ",r)}function E(a){const{labelElement:s,inputElement:t,labelText:e,placeholderText:r,isFlutuante:n,estaFocado:o,obrigatorio:u}=a,l=t.value.trim()!=="";let c=!1;try{c=t.matches(":-webkit-autofill")}catch{c=!1}e?(v(s,e,!!u,"ui-campo-texto__asterisco"),s.style.display="flex",n&&(o||l||c)?s.classList.add("ui-campo-texto__label--ativa"):s.classList.remove("ui-campo-texto__label--ativa")):s.style.display="none",n&&!o&&!l&&!c?t.placeholder="":t.placeholder=r}function y(a,s,t){s?(a.classList.add("ui-campo-texto__icone--clicavel"),a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",t?"Ocultar senha":"Exibir senha")):(a.classList.remove("ui-campo-texto__icone--clicavel"),a.removeAttribute("role"),a.removeAttribute("tabindex"),a.removeAttribute("aria-label"))}function A(a,s,t,e,r,n,o="ui-campo-texto"){e?(a.classList.add(`${o}__wrapper--erro`),s.setAttribute("aria-invalid","true")):(a.classList.remove(`${o}__wrapper--erro`),s.removeAttribute("aria-invalid")),e&&r?(t.textContent=`⚠️ ${r}`,t.className=`${o}__helper ${o}__helper--erro`,t.style.display="block"):n?(t.textContent=n,t.className=`${o}__helper`,t.style.display="block"):t.style.display="none"}class p extends d.SafeHTMLElement{constructor(){super();i(this,"internals");i(this,"_formDisabled",!1);i(this,"_customErrorMessage","");this.internals=typeof this.attachInternals=="function"?this.attachInternals():{}}formDisabledCallback(t){this._formDisabled=t,this.syncState()}get form(){var t;return this.closest("form")??((t=this.internals)==null?void 0:t.form)??null}get required(){return this.hasAttribute("obrigatorio")||this.hasAttribute("required")}set required(t){t?this.setAttribute("obrigatorio",""):(this.removeAttribute("obrigatorio"),this.removeAttribute("required")),this.syncState()}get obrigatorio(){return this.required}set obrigatorio(t){this.required=t}get validity(){var t;return this.atualizarValidade(),(t=this.internals)==null?void 0:t.validity}get validationMessage(){var t;return this.atualizarValidade(),((t=this.internals)==null?void 0:t.validationMessage)??""}get willValidate(){var t;return((t=this.internals)==null?void 0:t.willValidate)??!1}checkValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.checkValidity)==null?void 0:e.call(t))??!0}reportValidity(){var t,e;return this.atualizarValidade(),((e=(t=this.internals)==null?void 0:t.reportValidity)==null?void 0:e.call(t))??!0}setCustomValidity(t){this._customErrorMessage=t||"",this.atualizarValidade()}}i(p,"formAssociated",!0);class m extends p{constructor(){super();i(this,"labelElement");i(this,"wrapperElement");i(this,"inputElement");i(this,"helperElement");i(this,"rightIconContainer");i(this,"leftSlotElement");i(this,"_senhaVisivel",!1);i(this,"listeners",new C.ListenerBag);i(this,"_checkTimer",null);i(this,"_focado",!1);i(this,"_inputId");i(this,"_defaultValue","");i(this,"handleSlotChange",()=>{this.syncState()});i(this,"handleHostClick",t=>{h.cliqueVeioDeRotuloExterno(this,t)&&!this.disabled&&this.inputElement.focus()});i(this,"handleRightIconClick",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.stopPropagation(),this.alternarVisibilidadeSenha())});i(this,"handleRightIconKeyDown",t=>{(this.getAttribute("tipo")==="password"||this.hasAttribute("alternar-senha"))&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),this.alternarVisibilidadeSenha())});i(this,"handleFocus",()=>{this._focado=!0,this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"),this.syncState()});i(this,"handleBlur",()=>{this._focado=!1,this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"),this.syncState()});i(this,"handleKeyDown",t=>{if(t.key!=="Enter"||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;const e=this.form;e&&setTimeout(()=>{!t.defaultPrevented&&this.isConnected&&k.submeterImplicitamente(e)})});i(this,"handleInput",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))});i(this,"handleChange",t=>{t.stopPropagation();const e=t.target.value;this.internals.setFormValue(e),this.syncState(),this.dispatchEvent(new CustomEvent("ui-change",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))});const t=this.attachShadow({mode:"open",delegatesFocus:!0});t.innerHTML=_(),this.labelElement=t.querySelector(".ui-campo-texto__label"),this.wrapperElement=t.querySelector(".ui-campo-texto__wrapper"),this.inputElement=t.querySelector(".ui-campo-texto__input"),this.helperElement=t.querySelector(".ui-campo-texto__helper"),this.rightIconContainer=t.querySelector(".ui-campo-texto__icone--direita"),this.leftSlotElement=t.querySelector('slot[name="icone-esquerda"]'),this._inputId=h.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`}static get observedAttributes(){return f}focus(t){this.inputElement.focus(t)}blur(){this.inputElement.blur()}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.inputElement,"input",this.handleInput),this.listeners.add(this.inputElement,"change",this.handleChange),this.listeners.add(this.inputElement,"focus",this.handleFocus),this.listeners.add(this.inputElement,"blur",this.handleBlur),this.listeners.add(this.inputElement,"keydown",this.handleKeyDown),this.listeners.add(this.rightIconContainer,"click",this.handleRightIconClick),this.listeners.add(this.rightIconContainer,"keydown",this.handleRightIconKeyDown),this.listeners.add(this.leftSlotElement,"slotchange",this.handleSlotChange),this.listeners.add(this,"click",this.handleHostClick),this._defaultValue=this.getAttribute("value")||"",this.hasAttribute("value")&&!this.inputElement.value&&(this.inputElement.value=this._defaultValue),this.syncState(),this._checkTimer&&clearTimeout(this._checkTimer),this._checkTimer=setTimeout(()=>this.syncState(),100)}disconnectedCallback(){this.listeners.cleanup(),this._checkTimer&&clearTimeout(this._checkTimer),this._checkTimer=null}attributeChangedCallback(t,e,r){t==="value"&&r!==this.inputElement.value&&!this._focado&&(this.inputElement.value=r||""),this.syncState()}get value(){return this.inputElement?this.inputElement.value:this.getAttribute("value")||""}set value(t){if(this.setAttribute("value",t),this.inputElement)try{this.inputElement.value=t}catch{}this.syncState()}formResetCallback(){var t;this.inputElement.value=this._defaultValue,(t=this.internals)==null||t.setFormValue(this._defaultValue),this.syncState()}formStateRestoreCallback(t,e){typeof t=="string"&&(this.value=t)}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get type(){return this.getAttribute("tipo")||this.getAttribute("type")||"text"}get disabled(){return this.hasAttribute("disabled")||this._formDisabled}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get minLength(){return b.inteiroOuNulo(this.getAttribute("minlength")??this.getAttribute("min-length"))??-1}set minLength(t){t>=0?this.setAttribute("minlength",String(t)):this.removeAttribute("minlength"),this.syncState()}get maxLength(){return b.inteiroOuNulo(this.getAttribute("maxlength")??this.getAttribute("max-length"))??-1}set maxLength(t){t>=0?this.setAttribute("maxlength",String(t)):this.removeAttribute("maxlength"),this.syncState()}get pattern(){return this.getAttribute("pattern")||""}set pattern(t){t?this.setAttribute("pattern",t):this.removeAttribute("pattern"),this.syncState()}atualizarValidade(){var l,c;const t=this.getAttribute("min"),e=this.getAttribute("max"),r=this.inputElement?this.inputElement.value:"",n=this.getAttribute("value")||r,o=!!((c=(l=this.inputElement)==null?void 0:l.validity)!=null&&c.badInput),u=g.validarRestricoesCampoTexto({val:r,rawVal:n,badInput:o,disabled:this.disabled,required:this.required,tipo:this.type,minlength:this.minLength>=0?this.minLength:null,maxlength:this.maxLength>=0?this.maxLength:null,min:t!==null?parseFloat(t):null,max:e!==null?parseFloat(e):null,step:this.getAttribute("step"),pattern:this.getAttribute("pattern"),customError:this._customErrorMessage,mensagemValidacao:this.getAttribute("mensagem-validacao")});g.aplicarValidadeInternals(this.internals,u,this.inputElement)}alternarVisibilidadeSenha(){var r;if(!(this.getAttribute("tipo")==="password"||this._senhaVisivel))return;this._senhaVisivel=!this._senhaVisivel,this.inputElement.type=this._senhaVisivel?"text":"password";const e=(r=this.shadowRoot)==null?void 0:r.querySelector('slot[name="icone-direita"]');e&&e.assignedElements().forEach(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"),V.aplicarAlturaControle(this),x.aplicarDegradeNoElemento(this,this.wrapperElement),E({labelElement:this.labelElement,inputElement:this.inputElement,labelText:this.getAttribute("label"),placeholderText:this.getAttribute("placeholder")||"",isFlutuante:this.hasAttribute("label-flutuante"),estaFocado:this._focado,obrigatorio:this.required}),this.sincronizarNomeAcessivel();const e=this.getAttribute("tipo")||this.getAttribute("type")||"text";if(!this._senhaVisivel)try{this.inputElement.type=e}catch{this.inputElement.type="text"}this.minLength>=0?this.inputElement.minLength=this.minLength:this.inputElement.removeAttribute("minlength"),this.maxLength>=0?this.inputElement.maxLength=this.maxLength:this.inputElement.removeAttribute("maxlength");const r=this.getAttribute("pattern");r!==null?this.inputElement.pattern=r:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const n=this.hasAttribute("disabled")||this._formDisabled,o=this.hasAttribute("readonly");this.inputElement.disabled=n,this.inputElement.readOnly=o,n?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const u=e==="password"||this.hasAttribute("alternar-senha");y(this.rightIconContainer,u,this._senhaVisivel);const l=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");A(this.wrapperElement,this.inputElement,this.helperElement,l,this.getAttribute("mensagem-erro"),this.getAttribute("helper-text")),this.helperElement.style.display==="none"?this.inputElement.removeAttribute("aria-describedby"):this.inputElement.setAttribute("aria-describedby",this.helperElement.id),this.required?this.inputElement.setAttribute("aria-required","true"):this.inputElement.removeAttribute("aria-required"),this.atualizarValidade()}sincronizarNomeAcessivel(){const t=this.getAttribute("label")?"":h.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class w extends m{}d.definirCustomElement("ui-campo-texto",m);d.definirCustomElement("ui-input",w);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=f;exports.FormAssociatedElement=p;exports.UICampoTexto=m;exports.UIInput=w;exports.criarTemplateCampoTexto=_;exports.renderizarRotulo=v;exports.sincronizarFeedbackErro=A;exports.sincronizarIconeSenha=y;exports.sincronizarLabelEPlaceholder=E;
@@ -1,379 +0,0 @@
1
- var b = Object.defineProperty;
2
- var g = (a, s, t) => s in a ? b(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
- var i = (a, s, t) => g(a, typeof s != "symbol" ? s + "" : s, t);
4
- import { A as x, a as f } from "./degrade-gDa5sW__.js";
5
- import { S as _, d as p } from "./ssr-safe-5cWfJP-s.js";
6
- import { b as v } from "./altura-controle-vxQiXG4q.js";
7
- import { L as E } from "./listener-bag-DQgv7OON.js";
8
- import { i as c } from "./opcoes-CupvWVIm.js";
9
- import { g as y, o as A, c as w } from "./acessibilidade-CUlSXc2X.js";
10
- import { v as S, a as V } from "./form-validacao-BlQFxUVj.js";
11
- import { a as k } from "./form-submissao-C-SPRKgT.js";
12
- const q = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex;vertical-align:middle}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);background:var(--ui-degrade-interno, var(--ui-campo-texto-fundo, var(--ui-fundo-elevado, 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:var(--ui-degrade-interno, var(--ui-campo-texto-fundo, var(--ui-fundo-card, 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:var(--ui-campo-texto-desabilitado-fundo, 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:var(--ui-campo-texto-rotulo-fundo, 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:var(--ui-campo-texto-rotulo-fundo, var(--ui-cor-fundo-elevado, #1a1a1e))}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}:host(.squarecircle) .ui-campo-texto__container,:host(.squarecircles) .ui-campo-texto__container,:host(.ui-squarecircle) .ui-campo-texto__container,:host(.ui-squarecircles) .ui-campo-texto__container,:host([formato="squarecircle"]) .ui-campo-texto__container,:host([formato="squarecircles"]) .ui-campo-texto__container,:host([formato="squircle"]) .ui-campo-texto__container{border-radius:var(--ui-raio-lg, 10px)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-card: var(--ui-gradiente-card)}', C = [
13
- "label",
14
- "placeholder",
15
- "value",
16
- "tipo",
17
- "type",
18
- "obrigatorio",
19
- "required",
20
- "minlength",
21
- "min-length",
22
- "maxlength",
23
- "max-length",
24
- "pattern",
25
- "min",
26
- "max",
27
- "step",
28
- "mensagem-validacao",
29
- "helper-text",
30
- "erro",
31
- "mensagem-erro",
32
- "disabled",
33
- "readonly",
34
- "label-flutuante",
35
- "alternar-senha",
36
- "tamanho",
37
- "size",
38
- "altura",
39
- "height",
40
- "densidade",
41
- "aria-label",
42
- ...x
43
- ];
44
- function I() {
45
- return `
46
- <style>${q}</style>
47
- <div class="ui-campo-texto__container">
48
- <label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
49
- <div class="ui-campo-texto__wrapper" part="campo">
50
- <span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda" part="icone icone-esquerda">
51
- <slot name="icone-esquerda"></slot>
52
- </span>
53
- <input class="ui-campo-texto__input" part="input" type="text" />
54
- <span class="ui-campo-texto__icone ui-campo-texto__icone--direita" part="icone icone-direita">
55
- <slot name="icone-direita"></slot>
56
- </span>
57
- </div>
58
- </div>
59
- <div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
60
- `;
61
- }
62
- function L(a, s, t, e) {
63
- if (a.textContent = s, !t) return;
64
- const r = document.createElement("span");
65
- r.className = e, r.setAttribute("aria-hidden", "true"), r.textContent = "*", a.append(" ", r);
66
- }
67
- function z(a) {
68
- const { labelElement: s, inputElement: t, labelText: e, placeholderText: r, isFlutuante: n, estaFocado: o, obrigatorio: u } = a, l = t.value.trim() !== "";
69
- let h = !1;
70
- try {
71
- h = t.matches(":-webkit-autofill");
72
- } catch {
73
- h = !1;
74
- }
75
- e ? (L(s, e, !!u, "ui-campo-texto__asterisco"), s.style.display = "flex", n && (o || l || h) ? s.classList.add("ui-campo-texto__label--ativa") : s.classList.remove("ui-campo-texto__label--ativa")) : s.style.display = "none", n && !o && !l && !h ? t.placeholder = "" : t.placeholder = r;
76
- }
77
- function T(a, s, t) {
78
- s ? (a.classList.add("ui-campo-texto__icone--clicavel"), a.setAttribute("role", "button"), a.setAttribute("tabindex", "0"), a.setAttribute("aria-label", t ? "Ocultar senha" : "Exibir senha")) : (a.classList.remove("ui-campo-texto__icone--clicavel"), a.removeAttribute("role"), a.removeAttribute("tabindex"), a.removeAttribute("aria-label"));
79
- }
80
- function D(a, s, t, e, r, n, o = "ui-campo-texto") {
81
- e ? (a.classList.add(`${o}__wrapper--erro`), s.setAttribute("aria-invalid", "true")) : (a.classList.remove(`${o}__wrapper--erro`), s.removeAttribute("aria-invalid")), e && r ? (t.textContent = `⚠️ ${r}`, t.className = `${o}__helper ${o}__helper--erro`, t.style.display = "block") : n ? (t.textContent = n, t.className = `${o}__helper`, t.style.display = "block") : t.style.display = "none";
82
- }
83
- class d extends _ {
84
- constructor() {
85
- super();
86
- i(this, "internals");
87
- i(this, "_formDisabled", !1);
88
- i(this, "_customErrorMessage", "");
89
- this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : {};
90
- }
91
- // === Ciclo de Vida Form-Associated Custom Elements ===
92
- formDisabledCallback(t) {
93
- this._formDisabled = t, this.syncState();
94
- }
95
- get form() {
96
- var t;
97
- return this.closest("form") ?? ((t = this.internals) == null ? void 0 : t.form) ?? null;
98
- }
99
- get required() {
100
- return this.hasAttribute("obrigatorio") || this.hasAttribute("required");
101
- }
102
- set required(t) {
103
- t ? this.setAttribute("obrigatorio", "") : (this.removeAttribute("obrigatorio"), this.removeAttribute("required")), this.syncState();
104
- }
105
- get obrigatorio() {
106
- return this.required;
107
- }
108
- set obrigatorio(t) {
109
- this.required = t;
110
- }
111
- // === API de Validação Nativa ===
112
- get validity() {
113
- var t;
114
- return this.atualizarValidade(), (t = this.internals) == null ? void 0 : t.validity;
115
- }
116
- get validationMessage() {
117
- var t;
118
- return this.atualizarValidade(), ((t = this.internals) == null ? void 0 : t.validationMessage) ?? "";
119
- }
120
- get willValidate() {
121
- var t;
122
- return ((t = this.internals) == null ? void 0 : t.willValidate) ?? !1;
123
- }
124
- checkValidity() {
125
- var t, e;
126
- return this.atualizarValidade(), ((e = (t = this.internals) == null ? void 0 : t.checkValidity) == null ? void 0 : e.call(t)) ?? !0;
127
- }
128
- reportValidity() {
129
- var t, e;
130
- return this.atualizarValidade(), ((e = (t = this.internals) == null ? void 0 : t.reportValidity) == null ? void 0 : e.call(t)) ?? !0;
131
- }
132
- setCustomValidity(t) {
133
- this._customErrorMessage = t || "", this.atualizarValidade();
134
- }
135
- }
136
- i(d, "formAssociated", !0);
137
- class m extends d {
138
- constructor() {
139
- super();
140
- i(this, "labelElement");
141
- i(this, "wrapperElement");
142
- i(this, "inputElement");
143
- i(this, "helperElement");
144
- i(this, "rightIconContainer");
145
- i(this, "leftSlotElement");
146
- i(this, "_senhaVisivel", !1);
147
- i(this, "listeners", new E());
148
- i(this, "_checkTimer", null);
149
- i(this, "_focado", !1);
150
- i(this, "_inputId");
151
- i(this, "_defaultValue", "");
152
- i(this, "handleSlotChange", () => {
153
- this.syncState();
154
- });
155
- i(this, "handleHostClick", (t) => {
156
- w(this, t) && !this.disabled && this.inputElement.focus();
157
- });
158
- i(this, "handleRightIconClick", (t) => {
159
- (this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.stopPropagation(), this.alternarVisibilidadeSenha());
160
- });
161
- i(this, "handleRightIconKeyDown", (t) => {
162
- (this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), this.alternarVisibilidadeSenha());
163
- });
164
- i(this, "handleFocus", () => {
165
- this._focado = !0, this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"), this.syncState();
166
- });
167
- i(this, "handleBlur", () => {
168
- this._focado = !1, this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"), this.syncState();
169
- });
170
- /**
171
- * Enter submete o formulário como num <input> nativo. Aguarda um tick para que
172
- * ouvintes do consumidor possam cancelar com `preventDefault()` no keydown.
173
- */
174
- i(this, "handleKeyDown", (t) => {
175
- if (t.key !== "Enter" || t.isComposing || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
176
- const e = this.form;
177
- e && setTimeout(() => {
178
- !t.defaultPrevented && this.isConnected && k(e);
179
- });
180
- });
181
- i(this, "handleInput", (t) => {
182
- t.stopPropagation();
183
- const e = t.target.value;
184
- this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
185
- new CustomEvent("ui-input", {
186
- detail: { value: e },
187
- bubbles: !0,
188
- composed: !0
189
- })
190
- ), this.dispatchEvent(
191
- new Event("input", {
192
- bubbles: !0,
193
- composed: !0
194
- })
195
- );
196
- });
197
- i(this, "handleChange", (t) => {
198
- t.stopPropagation();
199
- const e = t.target.value;
200
- this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
201
- new CustomEvent("ui-change", {
202
- detail: { value: e },
203
- bubbles: !0,
204
- composed: !0
205
- })
206
- ), this.dispatchEvent(
207
- new Event("change", {
208
- bubbles: !0,
209
- composed: !0
210
- })
211
- );
212
- });
213
- const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
214
- 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 = y("ui-input"), this.inputElement.id = this._inputId, this.labelElement.htmlFor = this._inputId, this.helperElement.id = `${this._inputId}-helper`;
215
- }
216
- static get observedAttributes() {
217
- return C;
218
- }
219
- focus(t) {
220
- this.inputElement.focus(t);
221
- }
222
- blur() {
223
- this.inputElement.blur();
224
- }
225
- connectedCallback() {
226
- this.listeners.cleanup(), this.listeners.add(this.inputElement, "input", this.handleInput), this.listeners.add(this.inputElement, "change", this.handleChange), this.listeners.add(this.inputElement, "focus", this.handleFocus), this.listeners.add(this.inputElement, "blur", this.handleBlur), this.listeners.add(this.inputElement, "keydown", this.handleKeyDown), this.listeners.add(this.rightIconContainer, "click", this.handleRightIconClick), this.listeners.add(this.rightIconContainer, "keydown", this.handleRightIconKeyDown), this.listeners.add(this.leftSlotElement, "slotchange", this.handleSlotChange), this.listeners.add(this, "click", this.handleHostClick), this._defaultValue = this.getAttribute("value") || "", this.hasAttribute("value") && !this.inputElement.value && (this.inputElement.value = this._defaultValue), this.syncState(), this._checkTimer && clearTimeout(this._checkTimer), this._checkTimer = setTimeout(() => this.syncState(), 100);
227
- }
228
- disconnectedCallback() {
229
- this.listeners.cleanup(), this._checkTimer && clearTimeout(this._checkTimer), this._checkTimer = null;
230
- }
231
- attributeChangedCallback(t, e, r) {
232
- t === "value" && r !== this.inputElement.value && !this._focado && (this.inputElement.value = r || ""), this.syncState();
233
- }
234
- get value() {
235
- return this.inputElement ? this.inputElement.value : this.getAttribute("value") || "";
236
- }
237
- set value(t) {
238
- if (this.setAttribute("value", t), this.inputElement)
239
- try {
240
- this.inputElement.value = t;
241
- } catch {
242
- }
243
- this.syncState();
244
- }
245
- // === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
246
- formResetCallback() {
247
- var t;
248
- this.inputElement.value = this._defaultValue, (t = this.internals) == null || t.setFormValue(this._defaultValue), this.syncState();
249
- }
250
- formStateRestoreCallback(t, e) {
251
- typeof t == "string" && (this.value = t);
252
- }
253
- get name() {
254
- return this.getAttribute("name") || "";
255
- }
256
- set name(t) {
257
- this.setAttribute("name", t);
258
- }
259
- get type() {
260
- return this.getAttribute("tipo") || this.getAttribute("type") || "text";
261
- }
262
- get disabled() {
263
- return this.hasAttribute("disabled") || this._formDisabled;
264
- }
265
- set disabled(t) {
266
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
267
- }
268
- get minLength() {
269
- return c(this.getAttribute("minlength") ?? this.getAttribute("min-length")) ?? -1;
270
- }
271
- set minLength(t) {
272
- t >= 0 ? this.setAttribute("minlength", String(t)) : this.removeAttribute("minlength"), this.syncState();
273
- }
274
- get maxLength() {
275
- return c(this.getAttribute("maxlength") ?? this.getAttribute("max-length")) ?? -1;
276
- }
277
- set maxLength(t) {
278
- t >= 0 ? this.setAttribute("maxlength", String(t)) : this.removeAttribute("maxlength"), this.syncState();
279
- }
280
- get pattern() {
281
- return this.getAttribute("pattern") || "";
282
- }
283
- set pattern(t) {
284
- t ? this.setAttribute("pattern", t) : this.removeAttribute("pattern"), this.syncState();
285
- }
286
- atualizarValidade() {
287
- var l, h;
288
- const t = this.getAttribute("min"), e = this.getAttribute("max"), r = this.inputElement ? this.inputElement.value : "", n = this.getAttribute("value") || r, o = !!((h = (l = this.inputElement) == null ? void 0 : l.validity) != null && h.badInput), u = S({
289
- val: r,
290
- rawVal: n,
291
- badInput: o,
292
- disabled: this.disabled,
293
- required: this.required,
294
- tipo: this.type,
295
- minlength: this.minLength >= 0 ? this.minLength : null,
296
- maxlength: this.maxLength >= 0 ? this.maxLength : null,
297
- min: t !== null ? parseFloat(t) : null,
298
- max: e !== null ? parseFloat(e) : null,
299
- step: this.getAttribute("step"),
300
- pattern: this.getAttribute("pattern"),
301
- customError: this._customErrorMessage,
302
- mensagemValidacao: this.getAttribute("mensagem-validacao")
303
- });
304
- V(this.internals, u, this.inputElement);
305
- }
306
- alternarVisibilidadeSenha() {
307
- var r;
308
- if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
309
- this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
310
- const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector('slot[name="icone-direita"]');
311
- e && e.assignedElements().forEach((o) => {
312
- var u, l;
313
- (((u = o.textContent) == null ? void 0 : u.trim()) === "👁️" || ((l = o.textContent) == null ? void 0 : l.trim()) === "🙈") && (o.textContent = this._senhaVisivel ? "🙈" : "👁️");
314
- }), this.dispatchEvent(
315
- new CustomEvent("ui-toggle-senha", {
316
- detail: { visivel: this._senhaVisivel },
317
- bubbles: !0,
318
- composed: !0
319
- })
320
- );
321
- }
322
- syncState() {
323
- this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda"), v(this), f(this, this.wrapperElement), z({
324
- labelElement: this.labelElement,
325
- inputElement: this.inputElement,
326
- labelText: this.getAttribute("label"),
327
- placeholderText: this.getAttribute("placeholder") || "",
328
- isFlutuante: this.hasAttribute("label-flutuante"),
329
- estaFocado: this._focado,
330
- obrigatorio: this.required
331
- }), this.sincronizarNomeAcessivel();
332
- const e = this.getAttribute("tipo") || this.getAttribute("type") || "text";
333
- if (!this._senhaVisivel)
334
- try {
335
- this.inputElement.type = e;
336
- } catch {
337
- this.inputElement.type = "text";
338
- }
339
- this.minLength >= 0 ? this.inputElement.minLength = this.minLength : this.inputElement.removeAttribute("minlength"), this.maxLength >= 0 ? this.inputElement.maxLength = this.maxLength : this.inputElement.removeAttribute("maxlength");
340
- const r = this.getAttribute("pattern");
341
- r !== null ? this.inputElement.pattern = r : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
342
- const n = this.hasAttribute("disabled") || this._formDisabled, o = this.hasAttribute("readonly");
343
- this.inputElement.disabled = n, this.inputElement.readOnly = o, n ? this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled") : this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");
344
- const u = e === "password" || this.hasAttribute("alternar-senha");
345
- T(this.rightIconContainer, u, this._senhaVisivel);
346
- const l = this.hasAttribute("erro") || this.hasAttribute("mensagem-erro");
347
- D(
348
- this.wrapperElement,
349
- this.inputElement,
350
- this.helperElement,
351
- l,
352
- this.getAttribute("mensagem-erro"),
353
- this.getAttribute("helper-text")
354
- ), this.helperElement.style.display === "none" ? this.inputElement.removeAttribute("aria-describedby") : this.inputElement.setAttribute("aria-describedby", this.helperElement.id), this.required ? this.inputElement.setAttribute("aria-required", "true") : this.inputElement.removeAttribute("aria-required"), this.atualizarValidade();
355
- }
356
- /**
357
- * Sem o atributo `label`, o input nativo herda o nome acessível de fora do Shadow DOM
358
- * (`aria-label` no host, `<label for>` ou `<label>` envolvente).
359
- */
360
- sincronizarNomeAcessivel() {
361
- const t = this.getAttribute("label") ? "" : A(this, this.internals);
362
- t ? this.inputElement.setAttribute("aria-label", t) : this.inputElement.removeAttribute("aria-label");
363
- }
364
- }
365
- class F extends m {
366
- }
367
- p("ui-campo-texto", m);
368
- p("ui-input", F);
369
- export {
370
- C as A,
371
- d as F,
372
- m as U,
373
- F as a,
374
- T as b,
375
- I as c,
376
- z as d,
377
- L as r,
378
- D as s
379
- };
@@ -1,150 +0,0 @@
1
- var _ = Object.defineProperty;
2
- var y = (a, t, e) => t in a ? _(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var s = (a, t, e) => y(a, typeof t != "symbol" ? t + "" : t, e);
4
- import { L as E } from "./listener-bag-DQgv7OON.js";
5
- import { d as A, S as w } from "./ssr-safe-5cWfJP-s.js";
6
- import { e as k, a as g } from "./opcoes-CupvWVIm.js";
7
- import { A as S, a as C } from "./degrade-gDa5sW__.js";
8
- const q = ':host{display:block;width:100%;box-sizing:border-box}:host([hidden]){display:none}:host(.h-full),:host([style*="height: 100%"]){height:100%}.ui-card{--_borda: 1px;--_distancia: var(--ui-card-padding, 16px);--_raio: var(--ui-card-raio, var(--ui-card-raio-aninhado, var(--ui-raio-lg, 10px)));display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;background:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #18181c))));border:var(--_borda) solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--_raio);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)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-card: var(--ui-gradiente-card);--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-destaque: var(--ui-gradiente-destaque)}.ui-card--plano{background:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #18181c))));box-shadow:none}.ui-card--elevado{background:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-elevado, 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:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-destaque, 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}@media (hover: hover){.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--clicavel:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px;border-color:var(--ui-cor-primaria, #00E08A)}@media (prefers-reduced-motion: reduce){.ui-card{transition:none}.ui-card--clicavel:hover,.ui-card--clicavel:active{transform:none}}.ui-card--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-card--raio-nenhum{--_raio: 0px}.ui-card--raio-sm{--_raio: var(--ui-raio-sm, 4px)}.ui-card--raio-md{--_raio: var(--ui-raio-borda, 6px)}.ui-card--raio-lg{--_raio: var(--ui-raio-lg, 10px)}.ui-card--raio-xl{--_raio: var(--ui-raio-xl, 16px)}.ui-card__header,.ui-card__body,.ui-card__footer{--ui-card-raio-aninhado: max(0px, calc(var(--_raio) - var(--_distancia) - var(--_borda)))}.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{--_distancia: var(--ui-card-padding, 12px)}.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}:host(.squarecircle) .ui-card:not([class*=ui-card--raio-]),:host(.squarecircles) .ui-card:not([class*=ui-card--raio-]),:host(.ui-squarecircle) .ui-card:not([class*=ui-card--raio-]),:host(.ui-squarecircles) .ui-card:not([class*=ui-card--raio-]),:host([formato="squarecircle"]) .ui-card:not([class*=ui-card--raio-]),:host([formato="squarecircles"]) .ui-card:not([class*=ui-card--raio-]),:host([formato="squircle"]) .ui-card:not([class*=ui-card--raio-]){--_raio: var(--ui-card-raio, var(--ui-raio-xl, 16px))}', L = [
9
- "button",
10
- "a",
11
- "input",
12
- "select",
13
- "textarea",
14
- "label",
15
- "summary",
16
- "ui-botao",
17
- "ui-switch",
18
- "ui-checkbox",
19
- "ui-radio",
20
- "ui-campo-texto",
21
- "ui-segmented",
22
- '[contenteditable]:not([contenteditable="false"])',
23
- '[role="button"]',
24
- '[role="link"]',
25
- '[role="checkbox"]',
26
- '[role="switch"]',
27
- '[role="menuitem"]'
28
- ].join(", ");
29
- function R(a, t) {
30
- if (typeof Element > "u" || !(a instanceof Element)) return !1;
31
- const e = a.closest(L);
32
- return e !== null && e !== t && t.contains(e);
33
- }
34
- function O(a, t) {
35
- return a.key !== "Enter" && a.key !== " " || a.repeat || a.ctrlKey || a.altKey || a.metaKey ? !1 : a.target === t;
36
- }
37
- function T(a, t, e) {
38
- return Array.from(t.children).some((r) => e.includes(r.getAttribute("slot") ?? "")) ? !0 : a ? Array.from(a.querySelectorAll("slot")).filter((r) => e.includes(r.name)).some(
39
- (r) => r.assignedNodes({ flatten: !0 }).some(
40
- (o) => o.nodeType === 1 || o.nodeType === 3 && (o.textContent ?? "").trim() !== ""
41
- )
42
- ) : !1;
43
- }
44
- const x = ["plano", "elevado", "destaque"], D = ["nenhum", "sm", "md", "lg", "xl"];
45
- class I extends w {
46
- constructor() {
47
- super();
48
- s(this, "cardElement");
49
- s(this, "listeners", new E());
50
- s(this, "handleSlotChange", () => {
51
- this.syncState();
52
- });
53
- s(this, "handleClick", (e) => {
54
- this.disabled || !this.clicavel || e && R(e.target, this) || this.emitirClique();
55
- });
56
- s(this, "handleKeyDown", (e) => {
57
- !this.clicavel || this.disabled || !O(e, this.cardElement) || (e.preventDefault(), this.emitirClique());
58
- });
59
- const e = this.attachShadow({ mode: "open" });
60
- e.innerHTML = `
61
- <style>${q}</style>
62
- <div class="ui-card" part="base">
63
- <div class="ui-card__media" part="midia">
64
- <slot name="midia"></slot>
65
- <slot name="media"></slot>
66
- </div>
67
- <div class="ui-card__header" part="cabecalho">
68
- <slot name="cabecalho"></slot>
69
- <slot name="header"></slot>
70
- </div>
71
- <div class="ui-card__body" part="corpo">
72
- <slot></slot>
73
- </div>
74
- <div class="ui-card__footer" part="rodape">
75
- <slot name="rodape"></slot>
76
- <slot name="footer"></slot>
77
- </div>
78
- </div>
79
- `, this.cardElement = e.querySelector(".ui-card");
80
- }
81
- static get observedAttributes() {
82
- return [
83
- "elevacao",
84
- "elevation",
85
- "variante",
86
- "variant",
87
- "formato",
88
- "raio",
89
- "radius",
90
- "clicavel",
91
- "clickable",
92
- "compacto",
93
- "compact",
94
- "disabled",
95
- "aria-label",
96
- ...S
97
- ];
98
- }
99
- connectedCallback() {
100
- var i;
101
- this.listeners.cleanup(), this.listeners.add(this.cardElement, "click", this.handleClick), this.listeners.add(this.cardElement, "keydown", this.handleKeyDown);
102
- const e = (i = this.shadowRoot) == null ? void 0 : i.querySelectorAll("slot");
103
- e == null || e.forEach((d) => this.listeners.add(d, "slotchange", this.handleSlotChange)), this.syncState();
104
- }
105
- disconnectedCallback() {
106
- this.listeners.cleanup();
107
- }
108
- attributeChangedCallback(e, i, d) {
109
- this.syncState();
110
- }
111
- /** Leva o foco ao card clicável e habilitado; nos demais casos mantém o comportamento nativo do host. */
112
- focus(e) {
113
- this.clicavel && !this.disabled ? this.cardElement.focus(e) : super.focus(e);
114
- }
115
- get clicavel() {
116
- return this.hasAttribute("clicavel") || this.hasAttribute("clickable");
117
- }
118
- set clicavel(e) {
119
- e ? this.setAttribute("clicavel", "") : (this.removeAttribute("clicavel"), this.removeAttribute("clickable")), this.syncState();
120
- }
121
- get disabled() {
122
- return this.hasAttribute("disabled");
123
- }
124
- set disabled(e) {
125
- e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
126
- }
127
- syncState() {
128
- var m, p, v, f;
129
- const e = k(this.getAttribute("elevacao") || this.getAttribute("elevation"), x, "plano"), i = g(this.getAttribute("variante") || this.getAttribute("variant"), x), d = this.clicavel, r = this.hasAttribute("compacto") || this.hasAttribute("compact"), o = this.disabled;
130
- this.cardElement.className = "ui-card", this.cardElement.classList.add(`ui-card--${e}`), i && this.cardElement.classList.add(`ui-card--${i}`);
131
- const l = g(this.getAttribute("raio") || this.getAttribute("radius"), D);
132
- if (l && this.cardElement.classList.add(`ui-card--raio-${l}`), d) {
133
- this.cardElement.classList.add("ui-card--clicavel"), this.cardElement.setAttribute("role", "button"), this.cardElement.setAttribute("tabindex", o ? "-1" : "0");
134
- const c = (m = this.getAttribute("aria-label")) == null ? void 0 : m.trim();
135
- c ? this.cardElement.setAttribute("aria-label", c) : this.cardElement.removeAttribute("aria-label");
136
- } else
137
- this.cardElement.removeAttribute("role"), this.cardElement.removeAttribute("tabindex"), this.cardElement.removeAttribute("aria-label");
138
- o ? this.cardElement.setAttribute("aria-disabled", "true") : this.cardElement.removeAttribute("aria-disabled"), r && this.cardElement.classList.add("ui-card--compacto"), o && this.cardElement.classList.add("ui-card--disabled"), C(this, this.cardElement);
139
- const u = (p = this.shadowRoot) == null ? void 0 : p.querySelector(".ui-card__header"), h = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".ui-card__footer"), b = (f = this.shadowRoot) == null ? void 0 : f.querySelector(".ui-card__media"), n = (c) => T(this.shadowRoot, this, c);
140
- b && (b.style.display = n(["midia", "media"]) ? "block" : "none"), u && (u.style.display = n(["cabecalho", "header"]) ? "flex" : "none"), h && (h.style.display = n(["rodape", "footer"]) ? "flex" : "none");
141
- }
142
- emitirClique() {
143
- const e = { id: this.id || "sem-id" };
144
- this.dispatchEvent(new CustomEvent("ui-click", { detail: e, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("ui-clique", { detail: { ...e }, bubbles: !0, composed: !0 }));
145
- }
146
- }
147
- A("ui-card", I);
148
- export {
149
- I as U
150
- };
@@ -1,20 +0,0 @@
1
- "use strict";var A=Object.defineProperty;var w=(a,t,e)=>t in a?A(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var s=(a,t,e)=>w(a,typeof t!="symbol"?t+"":t,e);const q=require("./listener-bag-D5omxZ9h.cjs"),y=require("./ssr-safe-CiHD1adl.cjs"),l=require("./opcoes-vdAUY5OI.cjs"),x=require("./degrade-CIxvOTUv.cjs"),k=':host{display:block;width:100%;box-sizing:border-box}:host([hidden]){display:none}:host(.h-full),:host([style*="height: 100%"]){height:100%}.ui-card{--_borda: 1px;--_distancia: var(--ui-card-padding, 16px);--_raio: var(--ui-card-raio, var(--ui-card-raio-aninhado, var(--ui-raio-lg, 10px)));display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;background:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #18181c))));border:var(--_borda) solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--_raio);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)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-card: var(--ui-gradiente-card);--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-destaque: var(--ui-gradiente-destaque)}.ui-card--plano{background:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #18181c))));box-shadow:none}.ui-card--elevado{background:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-elevado, 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:var(--ui-degrade-interno, var(--ui-card-fundo, var(--ui-fundo-destaque, 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}@media (hover: hover){.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--clicavel:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px;border-color:var(--ui-cor-primaria, #00E08A)}@media (prefers-reduced-motion: reduce){.ui-card{transition:none}.ui-card--clicavel:hover,.ui-card--clicavel:active{transform:none}}.ui-card--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-card--raio-nenhum{--_raio: 0px}.ui-card--raio-sm{--_raio: var(--ui-raio-sm, 4px)}.ui-card--raio-md{--_raio: var(--ui-raio-borda, 6px)}.ui-card--raio-lg{--_raio: var(--ui-raio-lg, 10px)}.ui-card--raio-xl{--_raio: var(--ui-raio-xl, 16px)}.ui-card__header,.ui-card__body,.ui-card__footer{--ui-card-raio-aninhado: max(0px, calc(var(--_raio) - var(--_distancia) - var(--_borda)))}.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{--_distancia: var(--ui-card-padding, 12px)}.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}:host(.squarecircle) .ui-card:not([class*=ui-card--raio-]),:host(.squarecircles) .ui-card:not([class*=ui-card--raio-]),:host(.ui-squarecircle) .ui-card:not([class*=ui-card--raio-]),:host(.ui-squarecircles) .ui-card:not([class*=ui-card--raio-]),:host([formato="squarecircle"]) .ui-card:not([class*=ui-card--raio-]),:host([formato="squarecircles"]) .ui-card:not([class*=ui-card--raio-]),:host([formato="squircle"]) .ui-card:not([class*=ui-card--raio-]){--_raio: var(--ui-card-raio, var(--ui-raio-xl, 16px))}',C=["button","a","input","select","textarea","label","summary","ui-botao","ui-switch","ui-checkbox","ui-radio","ui-campo-texto","ui-segmented",'[contenteditable]:not([contenteditable="false"])','[role="button"]','[role="link"]','[role="checkbox"]','[role="switch"]','[role="menuitem"]'].join(", ");function S(a,t){if(typeof Element>"u"||!(a instanceof Element))return!1;const e=a.closest(C);return e!==null&&e!==t&&t.contains(e)}function L(a,t){return a.key!=="Enter"&&a.key!==" "||a.repeat||a.ctrlKey||a.altKey||a.metaKey?!1:a.target===t}function O(a,t,e){return Array.from(t.children).some(r=>e.includes(r.getAttribute("slot")??""))?!0:a?Array.from(a.querySelectorAll("slot")).filter(r=>e.includes(r.name)).some(r=>r.assignedNodes({flatten:!0}).some(o=>o.nodeType===1||o.nodeType===3&&(o.textContent??"").trim()!=="")):!1}const _=["plano","elevado","destaque"],R=["nenhum","sm","md","lg","xl"];class E extends y.SafeHTMLElement{constructor(){super();s(this,"cardElement");s(this,"listeners",new q.ListenerBag);s(this,"handleSlotChange",()=>{this.syncState()});s(this,"handleClick",e=>{this.disabled||!this.clicavel||e&&S(e.target,this)||this.emitirClique()});s(this,"handleKeyDown",e=>{!this.clicavel||this.disabled||!L(e,this.cardElement)||(e.preventDefault(),this.emitirClique())});const e=this.attachShadow({mode:"open"});e.innerHTML=`
2
- <style>${k}</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","formato","raio","radius","clicavel","clickable","compacto","compact","disabled","aria-label",...x.ATRIBUTOS_DEGRADE]}connectedCallback(){var i;this.listeners.cleanup(),this.listeners.add(this.cardElement,"click",this.handleClick),this.listeners.add(this.cardElement,"keydown",this.handleKeyDown);const e=(i=this.shadowRoot)==null?void 0:i.querySelectorAll("slot");e==null||e.forEach(d=>this.listeners.add(d,"slotchange",this.handleSlotChange)),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(e,i,d){this.syncState()}focus(e){this.clicavel&&!this.disabled?this.cardElement.focus(e):super.focus(e)}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 p,v,f,g;const e=l.escolherOpcao(this.getAttribute("elevacao")||this.getAttribute("elevation"),_,"plano"),i=l.escolherOpcaoOpcional(this.getAttribute("variante")||this.getAttribute("variant"),_),d=this.clicavel,r=this.hasAttribute("compacto")||this.hasAttribute("compact"),o=this.disabled;this.cardElement.className="ui-card",this.cardElement.classList.add(`ui-card--${e}`),i&&this.cardElement.classList.add(`ui-card--${i}`);const u=l.escolherOpcaoOpcional(this.getAttribute("raio")||this.getAttribute("radius"),R);if(u&&this.cardElement.classList.add(`ui-card--raio-${u}`),d){this.cardElement.classList.add("ui-card--clicavel"),this.cardElement.setAttribute("role","button"),this.cardElement.setAttribute("tabindex",o?"-1":"0");const c=(p=this.getAttribute("aria-label"))==null?void 0:p.trim();c?this.cardElement.setAttribute("aria-label",c):this.cardElement.removeAttribute("aria-label")}else this.cardElement.removeAttribute("role"),this.cardElement.removeAttribute("tabindex"),this.cardElement.removeAttribute("aria-label");o?this.cardElement.setAttribute("aria-disabled","true"):this.cardElement.removeAttribute("aria-disabled"),r&&this.cardElement.classList.add("ui-card--compacto"),o&&this.cardElement.classList.add("ui-card--disabled"),x.aplicarDegradeNoElemento(this,this.cardElement);const h=(v=this.shadowRoot)==null?void 0:v.querySelector(".ui-card__header"),b=(f=this.shadowRoot)==null?void 0:f.querySelector(".ui-card__footer"),m=(g=this.shadowRoot)==null?void 0:g.querySelector(".ui-card__media"),n=c=>O(this.shadowRoot,this,c);m&&(m.style.display=n(["midia","media"])?"block":"none"),h&&(h.style.display=n(["cabecalho","header"])?"flex":"none"),b&&(b.style.display=n(["rodape","footer"])?"flex":"none")}emitirClique(){const e={id:this.id||"sem-id"};this.dispatchEvent(new CustomEvent("ui-click",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-clique",{detail:{...e},bubbles:!0,composed:!0}))}}y.definirCustomElement("ui-card",E);exports.UICard=E;