@thibezer/ui-components-kit 2.27.0 → 2.28.1
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 +31 -0
- package/README.md +822 -822
- package/dist/camadas.cjs +85 -85
- package/dist/camadas.js +1167 -1055
- package/dist/campo-texto.cjs +2 -2
- package/dist/campo-texto.js +29 -29
- package/dist/components/ui-area-texto/ui-area-texto.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-selecao.d.ts +17 -2
- package/dist/components/ui-camadas/camadas-sincronizacao-dom.d.ts +2 -0
- package/dist/components/ui-camadas/tipos.d.ts +2 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +2 -0
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +3 -0
- package/dist/components/ui-cores/ui-controle-cores.d.ts +5 -1
- package/dist/components/ui-tabela/tabela-corpo.d.ts +10 -0
- package/dist/components/ui-tabela/tabela-declarativa.d.ts +11 -0
- package/dist/components/ui-tabela/tabela-dom.d.ts +1 -0
- package/dist/components/ui-tabela/tabela-header.d.ts +1 -0
- package/dist/components/ui-tabela/tabela-renderizador.d.ts +4 -0
- package/dist/components/ui-tabela/tipos.d.ts +11 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +22 -2
- package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +6 -6
- package/dist/components/ui-tabela-propriedades/editores-cad.d.ts +5 -5
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +6 -4
- package/dist/components/ui-tabela-propriedades/propriedades-editores.d.ts +2 -2
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +1 -1
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +11 -11
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +4 -4
- package/dist/components/ui-tabela-propriedades/propriedades-splitter.d.ts +1 -0
- package/dist/components/ui-tabela-propriedades/propriedades-valor-misto.d.ts +9 -5
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +10 -8
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +9 -7
- package/dist/cores.cjs +2 -2
- package/dist/cores.js +80 -80
- package/dist/custom-elements.json +29165 -28550
- package/dist/data.cjs +1 -1
- package/dist/data.js +107 -100
- package/dist/forms.cjs +7 -7
- package/dist/forms.js +24 -24
- package/dist/index.cjs +7 -7
- package/dist/index.js +228 -219
- package/dist/tabela.cjs +8 -8
- package/dist/tabela.js +1367 -1136
- package/dist/tipos-elementos.d.ts +28 -8
- package/dist/tipos-vue.d.ts +30 -12
- package/package.json +1 -1
package/dist/campo-texto.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var v=(a,o,t)=>o in a?f(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t;var i=(a,o,t)=>v(a,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const
|
|
1
|
+
"use strict";var f=Object.defineProperty;var v=(a,o,t)=>o in a?f(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t;var i=(a,o,t)=>v(a,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const s=require("./kit-base-BmkPi5Rz.cjs"),E=':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)}:host([variante="linha"]) .ui-campo-texto__wrapper,:host([variante="sublinhado"]) .ui-campo-texto__wrapper,:host([variante="underline"]) .ui-campo-texto__wrapper{background:transparent!important;border:none;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:0;padding-left:0;padding-right:0;box-shadow:none}:host([variante="linha"]) .ui-campo-texto__wrapper--foco,:host([variante="sublinhado"]) .ui-campo-texto__wrapper--foco,:host([variante="underline"]) .ui-campo-texto__wrapper--foco{border-bottom-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 1px 0 0 var(--ui-cor-primaria, #00E08A)}:host([variante="linha"]) .ui-campo-texto__wrapper--erro,:host([variante="sublinhado"]) .ui-campo-texto__wrapper--erro,:host([variante="underline"]) .ui-campo-texto__wrapper--erro{border-bottom-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 1px 0 0 var(--ui-cor-texto-erro, #ff5555)!important}:host([variante="linha"]) .ui-campo-texto__wrapper--disabled,:host([variante="sublinhado"]) .ui-campo-texto__wrapper--disabled,:host([variante="underline"]) .ui-campo-texto__wrapper--disabled{background:transparent!important}:host([variante="linha"][label-flutuante]) .ui-campo-texto__label,:host([variante="sublinhado"][label-flutuante]) .ui-campo-texto__label,:host([variante="underline"][label-flutuante]) .ui-campo-texto__label,:host([variante="linha"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="sublinhado"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="underline"][label-flutuante]) .ui-campo-texto__label--ativa{background:transparent;left:0!important;padding-left:0}:host([variante="linha"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="sublinhado"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="underline"][label-flutuante]) .ui-campo-texto__label--ativa{top:-12px}:host([variante="linha"][label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label:not(.ui-campo-texto__label--ativa),:host([variante="sublinhado"][label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label:not(.ui-campo-texto__label--ativa),:host([variante="underline"][label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label:not(.ui-campo-texto__label--ativa){left:22px!important}',d=["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",...s.ATRIBUTOS_DEGRADE];function m(){return`
|
|
2
2
|
<style>${E}</style>
|
|
3
3
|
<div class="ui-campo-texto__container">
|
|
4
4
|
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div class="ui-campo-texto__helper" part="ajuda" aria-live="polite" style="display: none;"></div>
|
|
16
|
-
`}function b(a){const{labelElement:o,inputElement:t,labelText:e,placeholderText:s,isFlutuante:l,estaFocado:n,obrigatorio:c}=a,u=t.value.trim()!=="";let h=!1;try{h=t.matches(":-webkit-autofill")}catch{h=!1}e?(r.renderizarRotulo(o,e,!!c,"ui-campo-texto__asterisco"),o.style.display="flex",l&&(n||u||h)?o.classList.add("ui-campo-texto__label--ativa"):o.classList.remove("ui-campo-texto__label--ativa")):o.style.display="none",l&&!n&&!u&&!h?t.placeholder="":t.placeholder=s}function g(a,o,t){o?(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 x(a,o,t,e,s,l,n="ui-campo-texto"){e?(a.classList.add(`${n}__wrapper--erro`),o.setAttribute("aria-invalid","true")):(a.classList.remove(`${n}__wrapper--erro`),o.removeAttribute("aria-invalid")),e&&s?(t.textContent=`⚠️ ${s}`,t.className=`${n}__helper ${n}__helper--erro`,t.style.display="block"):l?(t.textContent=l,t.className=`${n}__helper`,t.style.display="block"):t.style.display="none"}class p extends r.FormAssociatedElement{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 r.ListenerBag);i(this,"_checkTimer",null);i(this,"_focado",!1);i(this,"_inputId");i(this,"_defaultValue","");i(this,"handleSlotChange",()=>{this.syncState()});i(this,"handleHostClick",t=>{r.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&&r.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=m(),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=r.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`}static get observedAttributes(){return d}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,s){t==="value"&&s!==this.inputElement.value&&!this._focado&&(this.inputElement.value=s||""),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 r.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 r.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 u,h;const t=this.getAttribute("min"),e=this.getAttribute("max"),s=this.inputElement?this.inputElement.value:"",l=this.getAttribute("value")||s,n=!!((h=(u=this.inputElement)==null?void 0:u.validity)!=null&&h.badInput),c=r.validarRestricoesCampoTexto({val:s,rawVal:l,badInput:n,disabled:this.disabled,required:this.required,tipo:this.type,minlength:this.minLength>=0?this.minLength:null,maxlength:this.maxLength>=0?this.maxLength:null,min:t!==null?parseFloat(t):null,max:e!==null?parseFloat(e):null,step:this.getAttribute("step"),pattern:this.getAttribute("pattern"),customError:this._customErrorMessage,mensagemValidacao:this.getAttribute("mensagem-validacao")});r.aplicarValidadeInternals(this.internals,c,this.inputElement)}alternarVisibilidadeSenha(){var s;if(!(this.getAttribute("tipo")==="password"||this._senhaVisivel))return;this._senhaVisivel=!this._senhaVisivel,this.inputElement.type=this._senhaVisivel?"text":"password";const e=(s=this.shadowRoot)==null?void 0:s.querySelector('slot[name="icone-direita"]');e&&e.assignedElements().forEach(n=>{var c,u;(((c=n.textContent)==null?void 0:c.trim())==="👁️"||((u=n.textContent)==null?void 0:u.trim())==="🙈")&&(n.textContent=this._senhaVisivel?"🙈":"👁️")}),this.dispatchEvent(new CustomEvent("ui-toggle-senha",{detail:{visivel:this._senhaVisivel},bubbles:!0,composed:!0}))}syncState(){this.leftSlotElement.assignedNodes().length>0||this.querySelector('[slot="icone-esquerda"]')!==null?this.setAttribute("tem-icone-esquerda",""):this.removeAttribute("tem-icone-esquerda"),r.aplicarAlturaControle(this),r.aplicarDegradeNoElemento(this,this.wrapperElement),b({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 s=this.getAttribute("pattern");s!==null?this.inputElement.pattern=s:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const l=this.hasAttribute("disabled")||this._formDisabled,n=this.hasAttribute("readonly");this.inputElement.disabled=l,this.inputElement.readOnly=n,l?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const c=e==="password"||this.hasAttribute("alternar-senha");g(this.rightIconContainer,c,this._senhaVisivel);const u=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");x(this.wrapperElement,this.inputElement,this.helperElement,u,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")?"":r.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class _ extends p{}r.definirCustomElement("ui-campo-texto",p);r.definirCustomElement("ui-input",_);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=d;exports.UICampoTexto=p;exports.UIInput=_;exports.criarTemplateCampoTexto=m;exports.sincronizarFeedbackErro=x;exports.sincronizarIconeSenha=g;exports.sincronizarLabelEPlaceholder=b;
|
|
16
|
+
`}function b(a){const{labelElement:o,inputElement:t,labelText:e,placeholderText:n,isFlutuante:l,estaFocado:r,obrigatorio:c}=a,u=t.value.trim()!=="";let h=!1;try{h=t.matches(":-webkit-autofill")}catch{h=!1}e?(s.renderizarRotulo(o,e,!!c,"ui-campo-texto__asterisco"),o.style.display="flex",l&&(r||u||h)?o.classList.add("ui-campo-texto__label--ativa"):o.classList.remove("ui-campo-texto__label--ativa")):o.style.display="none",l&&!r&&!u&&!h?t.placeholder="":t.placeholder=n}function x(a,o,t){o?(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,o,t,e,n,l,r="ui-campo-texto"){e?(a.classList.add(`${r}__wrapper--erro`),o.setAttribute("aria-invalid","true")):(a.classList.remove(`${r}__wrapper--erro`),o.removeAttribute("aria-invalid")),e&&n?(t.textContent=`⚠️ ${n}`,t.className=`${r}__helper ${r}__helper--erro`,t.style.display="block"):l?(t.textContent=l,t.className=`${r}__helper`,t.style.display="block"):t.style.display="none"}class p extends s.FormAssociatedElement{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 s.ListenerBag);i(this,"_checkTimer",null);i(this,"_focado",!1);i(this,"_inputId");i(this,"_defaultValue","");i(this,"handleSlotChange",()=>{this.syncState()});i(this,"handleHostClick",t=>{s.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&&s.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=m(),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=s.gerarIdUnico("ui-input"),this.inputElement.id=this._inputId,this.labelElement.htmlFor=this._inputId,this.helperElement.id=`${this._inputId}-helper`}static get observedAttributes(){return d}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,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(){return s.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 s.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 u,h;const t=this.getAttribute("min"),e=this.getAttribute("max"),n=this.inputElement?this.inputElement.value:"",l=this.getAttribute("value")||n,r=!!((h=(u=this.inputElement)==null?void 0:u.validity)!=null&&h.badInput),c=s.validarRestricoesCampoTexto({val:n,rawVal:l,badInput:r,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")});s.aplicarValidadeInternals(this.internals,c,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(r=>{var c,u;(((c=r.textContent)==null?void 0:c.trim())==="👁️"||((u=r.textContent)==null?void 0:u.trim())==="🙈")&&(r.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"),s.aplicarAlturaControle(this),s.aplicarDegradeNoElemento(this,this.wrapperElement),b({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 n=this.getAttribute("pattern");n!==null?this.inputElement.pattern=n:this.inputElement.removeAttribute("pattern"),this.internals.setFormValue(this.inputElement.value);const l=this.hasAttribute("disabled")||this._formDisabled,r=this.hasAttribute("readonly");this.inputElement.disabled=l,this.inputElement.readOnly=r,l?this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled"):this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");const c=e==="password"||this.hasAttribute("alternar-senha");x(this.rightIconContainer,c,this._senhaVisivel);const u=this.hasAttribute("erro")||this.hasAttribute("mensagem-erro");_(this.wrapperElement,this.inputElement,this.helperElement,u,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")?"":s.obterRotuloExterno(this,this.internals);t?this.inputElement.setAttribute("aria-label",t):this.inputElement.removeAttribute("aria-label")}}class g extends p{}s.definirCustomElement("ui-campo-texto",p);s.definirCustomElement("ui-input",g);exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=d;exports.UICampoTexto=p;exports.UIInput=g;exports.criarTemplateCampoTexto=m;exports.sincronizarFeedbackErro=_;exports.sincronizarIconeSenha=x;exports.sincronizarLabelEPlaceholder=b;
|
package/dist/campo-texto.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
|
-
var b = (a,
|
|
3
|
-
var i = (a,
|
|
2
|
+
var b = (a, o, t) => o in a ? m(a, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[o] = t;
|
|
3
|
+
var i = (a, o, t) => b(a, typeof o != "symbol" ? o + "" : o, t);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { A as
|
|
6
|
-
const
|
|
5
|
+
import { A as x, R as _, F as g, L as f, u as v, T as c, V as E, W as y, j as w, g as A, E as S, p as k, X as q, d as p } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
const 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;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)}:host([variante="linha"]) .ui-campo-texto__wrapper,:host([variante="sublinhado"]) .ui-campo-texto__wrapper,:host([variante="underline"]) .ui-campo-texto__wrapper{background:transparent!important;border:none;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:0;padding-left:0;padding-right:0;box-shadow:none}:host([variante="linha"]) .ui-campo-texto__wrapper--foco,:host([variante="sublinhado"]) .ui-campo-texto__wrapper--foco,:host([variante="underline"]) .ui-campo-texto__wrapper--foco{border-bottom-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 1px 0 0 var(--ui-cor-primaria, #00E08A)}:host([variante="linha"]) .ui-campo-texto__wrapper--erro,:host([variante="sublinhado"]) .ui-campo-texto__wrapper--erro,:host([variante="underline"]) .ui-campo-texto__wrapper--erro{border-bottom-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 1px 0 0 var(--ui-cor-texto-erro, #ff5555)!important}:host([variante="linha"]) .ui-campo-texto__wrapper--disabled,:host([variante="sublinhado"]) .ui-campo-texto__wrapper--disabled,:host([variante="underline"]) .ui-campo-texto__wrapper--disabled{background:transparent!important}:host([variante="linha"][label-flutuante]) .ui-campo-texto__label,:host([variante="sublinhado"][label-flutuante]) .ui-campo-texto__label,:host([variante="underline"][label-flutuante]) .ui-campo-texto__label,:host([variante="linha"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="sublinhado"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="underline"][label-flutuante]) .ui-campo-texto__label--ativa{background:transparent;left:0!important;padding-left:0}:host([variante="linha"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="sublinhado"][label-flutuante]) .ui-campo-texto__label--ativa,:host([variante="underline"][label-flutuante]) .ui-campo-texto__label--ativa{top:-12px}:host([variante="linha"][label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label:not(.ui-campo-texto__label--ativa),:host([variante="sublinhado"][label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label:not(.ui-campo-texto__label--ativa),:host([variante="underline"][label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label:not(.ui-campo-texto__label--ativa){left:22px!important}', V = [
|
|
7
7
|
"label",
|
|
8
8
|
"placeholder",
|
|
9
9
|
"value",
|
|
@@ -33,11 +33,11 @@ const q = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizin
|
|
|
33
33
|
"height",
|
|
34
34
|
"densidade",
|
|
35
35
|
"aria-label",
|
|
36
|
-
...
|
|
36
|
+
...x
|
|
37
37
|
];
|
|
38
38
|
function I() {
|
|
39
39
|
return `
|
|
40
|
-
<style>${
|
|
40
|
+
<style>${C}</style>
|
|
41
41
|
<div class="ui-campo-texto__container">
|
|
42
42
|
<label class="ui-campo-texto__label" part="rotulo" style="display: none;"></label>
|
|
43
43
|
<div class="ui-campo-texto__wrapper" part="campo">
|
|
@@ -54,22 +54,22 @@ function I() {
|
|
|
54
54
|
`;
|
|
55
55
|
}
|
|
56
56
|
function L(a) {
|
|
57
|
-
const { labelElement:
|
|
57
|
+
const { labelElement: o, inputElement: t, labelText: e, placeholderText: n, isFlutuante: s, estaFocado: r, obrigatorio: u } = a, l = t.value.trim() !== "";
|
|
58
58
|
let h = !1;
|
|
59
59
|
try {
|
|
60
60
|
h = t.matches(":-webkit-autofill");
|
|
61
61
|
} catch {
|
|
62
62
|
h = !1;
|
|
63
63
|
}
|
|
64
|
-
e ? (
|
|
64
|
+
e ? (_(o, e, !!u, "ui-campo-texto__asterisco"), o.style.display = "flex", s && (r || l || h) ? o.classList.add("ui-campo-texto__label--ativa") : o.classList.remove("ui-campo-texto__label--ativa")) : o.style.display = "none", s && !r && !l && !h ? t.placeholder = "" : t.placeholder = n;
|
|
65
65
|
}
|
|
66
|
-
function T(a,
|
|
67
|
-
|
|
66
|
+
function T(a, o, t) {
|
|
67
|
+
o ? (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"));
|
|
68
68
|
}
|
|
69
|
-
function z(a,
|
|
70
|
-
e ? (a.classList.add(`${
|
|
69
|
+
function z(a, o, t, e, n, s, r = "ui-campo-texto") {
|
|
70
|
+
e ? (a.classList.add(`${r}__wrapper--erro`), o.setAttribute("aria-invalid", "true")) : (a.classList.remove(`${r}__wrapper--erro`), o.removeAttribute("aria-invalid")), e && n ? (t.textContent = `⚠️ ${n}`, t.className = `${r}__helper ${r}__helper--erro`, t.style.display = "block") : s ? (t.textContent = s, t.className = `${r}__helper`, t.style.display = "block") : t.style.display = "none";
|
|
71
71
|
}
|
|
72
|
-
class d extends
|
|
72
|
+
class d extends g {
|
|
73
73
|
constructor() {
|
|
74
74
|
super();
|
|
75
75
|
i(this, "labelElement");
|
|
@@ -110,7 +110,7 @@ class d extends _ {
|
|
|
110
110
|
if (t.key !== "Enter" || t.isComposing || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
111
111
|
const e = this.form;
|
|
112
112
|
e && setTimeout(() => {
|
|
113
|
-
!t.defaultPrevented && this.isConnected &&
|
|
113
|
+
!t.defaultPrevented && this.isConnected && q(e);
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
i(this, "handleInput", (t) => {
|
|
@@ -163,8 +163,8 @@ class d extends _ {
|
|
|
163
163
|
disconnectedCallback() {
|
|
164
164
|
this.listeners.cleanup(), this._checkTimer && clearTimeout(this._checkTimer), this._checkTimer = null;
|
|
165
165
|
}
|
|
166
|
-
attributeChangedCallback(t, e,
|
|
167
|
-
t === "value" &&
|
|
166
|
+
attributeChangedCallback(t, e, n) {
|
|
167
|
+
t === "value" && n !== this.inputElement.value && !this._focado && (this.inputElement.value = n || ""), this.syncState();
|
|
168
168
|
}
|
|
169
169
|
get value() {
|
|
170
170
|
return this.inputElement ? this.inputElement.value : this.getAttribute("value") || "";
|
|
@@ -220,10 +220,10 @@ class d extends _ {
|
|
|
220
220
|
}
|
|
221
221
|
atualizarValidade() {
|
|
222
222
|
var l, h;
|
|
223
|
-
const t = this.getAttribute("min"), e = this.getAttribute("max"),
|
|
224
|
-
val:
|
|
225
|
-
rawVal:
|
|
226
|
-
badInput:
|
|
223
|
+
const t = this.getAttribute("min"), e = this.getAttribute("max"), n = this.inputElement ? this.inputElement.value : "", s = this.getAttribute("value") || n, r = !!((h = (l = this.inputElement) == null ? void 0 : l.validity) != null && h.badInput), u = E({
|
|
224
|
+
val: n,
|
|
225
|
+
rawVal: s,
|
|
226
|
+
badInput: r,
|
|
227
227
|
disabled: this.disabled,
|
|
228
228
|
required: this.required,
|
|
229
229
|
tipo: this.type,
|
|
@@ -239,13 +239,13 @@ class d extends _ {
|
|
|
239
239
|
y(this.internals, u, this.inputElement);
|
|
240
240
|
}
|
|
241
241
|
alternarVisibilidadeSenha() {
|
|
242
|
-
var
|
|
242
|
+
var n;
|
|
243
243
|
if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
|
|
244
244
|
this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
|
|
245
|
-
const e = (
|
|
246
|
-
e && e.assignedElements().forEach((
|
|
245
|
+
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector('slot[name="icone-direita"]');
|
|
246
|
+
e && e.assignedElements().forEach((r) => {
|
|
247
247
|
var u, l;
|
|
248
|
-
(((u =
|
|
248
|
+
(((u = r.textContent) == null ? void 0 : u.trim()) === "👁️" || ((l = r.textContent) == null ? void 0 : l.trim()) === "🙈") && (r.textContent = this._senhaVisivel ? "🙈" : "👁️");
|
|
249
249
|
}), this.dispatchEvent(
|
|
250
250
|
new CustomEvent("ui-toggle-senha", {
|
|
251
251
|
detail: { visivel: this._senhaVisivel },
|
|
@@ -255,7 +255,7 @@ class d extends _ {
|
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
257
|
syncState() {
|
|
258
|
-
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda"),
|
|
258
|
+
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda"), w(this), A(this, this.wrapperElement), L({
|
|
259
259
|
labelElement: this.labelElement,
|
|
260
260
|
inputElement: this.inputElement,
|
|
261
261
|
labelText: this.getAttribute("label"),
|
|
@@ -272,10 +272,10 @@ class d extends _ {
|
|
|
272
272
|
this.inputElement.type = "text";
|
|
273
273
|
}
|
|
274
274
|
this.minLength >= 0 ? this.inputElement.minLength = this.minLength : this.inputElement.removeAttribute("minlength"), this.maxLength >= 0 ? this.inputElement.maxLength = this.maxLength : this.inputElement.removeAttribute("maxlength");
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
this.inputElement.disabled =
|
|
275
|
+
const n = this.getAttribute("pattern");
|
|
276
|
+
n !== null ? this.inputElement.pattern = n : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
|
|
277
|
+
const s = this.hasAttribute("disabled") || this._formDisabled, r = this.hasAttribute("readonly");
|
|
278
|
+
this.inputElement.disabled = s, this.inputElement.readOnly = r, s ? this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled") : this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");
|
|
279
279
|
const u = e === "password" || this.hasAttribute("alternar-senha");
|
|
280
280
|
T(this.rightIconContainer, u, this._senhaVisivel);
|
|
281
281
|
const l = this.hasAttribute("erro") || this.hasAttribute("mensagem-erro");
|
|
@@ -36,6 +36,9 @@ import { FormAssociatedElement } from '../../core/form-associated-element';
|
|
|
36
36
|
* @csspart ajuda - Texto de ajuda ou erro.
|
|
37
37
|
* @csspart contador - Contador de caracteres.
|
|
38
38
|
*/
|
|
39
|
+
/**
|
|
40
|
+
* @attr {'linha'|'sublinhado'|'underline'} variante - Só a linha inferior, sem preenchimento nem borda lateral.
|
|
41
|
+
*/
|
|
39
42
|
export declare class UIAreaTexto extends FormAssociatedElement {
|
|
40
43
|
static get observedAttributes(): string[];
|
|
41
44
|
private labelElement;
|
|
@@ -5,6 +5,7 @@ export interface HostSelecao {
|
|
|
5
5
|
feicoes: FeicaoItem[];
|
|
6
6
|
expandedLayers: Set<string>;
|
|
7
7
|
expandedFeatureLimits?: ReadonlyMap<string, number>;
|
|
8
|
+
ordemFilhosPorPai?: ReadonlyMap<string, readonly string[]>;
|
|
8
9
|
selectedFeatureIds: Set<string>;
|
|
9
10
|
lastClickedFeatureId: string | null;
|
|
10
11
|
searchQuery: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CamadaItem, FeicaoItem } from './tipos';
|
|
2
|
+
import { CamadaNodoHierarquico } from './camadas-hierarquia';
|
|
2
3
|
export interface ResultadoSelecao {
|
|
3
4
|
selecionados: Set<string>;
|
|
4
5
|
ultimoClicadoId: string | null;
|
|
@@ -20,11 +21,25 @@ export interface ResultadoBuscaCamadas {
|
|
|
20
21
|
* Sem termo, retorna `null` (nada a filtrar). Tolera nomes ausentes e ciclos de `parentId`.
|
|
21
22
|
*/
|
|
22
23
|
export declare function filtrarCamadasPorBusca(camadas: CamadaItem[], feicoes: FeicaoItem[], termo: string): ResultadoBuscaCamadas | null;
|
|
24
|
+
export interface MetricaEscopoCamada {
|
|
25
|
+
total: number;
|
|
26
|
+
selecionadas: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Calcula em O(L + F) o total de feições e quantas estão selecionadas na subárvore de cada camada.
|
|
30
|
+
* Quando há busca ativa, considera somente as feições visíveis segundo `filtrarCamadasPorBusca`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function indexarMetricasEscopo(hierarquia: CamadaNodoHierarquico[], feicoesPorCamada: ReadonlyMap<string, FeicaoItem[]>, selecionadas: ReadonlySet<string>, camadasVisiveis?: ReadonlySet<string>): Map<string, MetricaEscopoCamada>;
|
|
33
|
+
/**
|
|
34
|
+
* Retorna as feições efetivamente visíveis dentro do escopo (camada + subcamadas) respeitando busca ativa
|
|
35
|
+
* (inclusive quando uma camada casa pelo próprio nome).
|
|
36
|
+
*/
|
|
37
|
+
export declare function obterFeicoesVisiveisNoEscopo(camadas: CamadaItem[], feicoes: FeicaoItem[], camadaId: string, termoBusca?: string): FeicaoItem[];
|
|
23
38
|
/**
|
|
24
39
|
* IDs de feições efetivamente exibidas na árvore, na ordem da tela:
|
|
25
|
-
* respeita hierarquia da árvore, camadas expandidas
|
|
40
|
+
* respeita hierarquia da árvore, ordenação mista, camadas expandidas, filtro de busca e limite de linhas.
|
|
26
41
|
*/
|
|
27
|
-
export declare function obterIdsVisiveisFeicoes(camadas: CamadaItem[], feicoes: FeicaoItem[], camadasExpandidas: Set<string>, termoBusca?: string, limitePorCamada?: number, limitesCustomizados?: ReadonlyMap<string, number>): string[];
|
|
42
|
+
export declare function obterIdsVisiveisFeicoes(camadas: CamadaItem[], feicoes: FeicaoItem[], camadasExpandidas: Set<string>, termoBusca?: string, limitePorCamada?: number, limitesCustomizados?: ReadonlyMap<string, number>, ordemFilhosPorPai?: ReadonlyMap<string, readonly string[]>): string[];
|
|
28
43
|
/**
|
|
29
44
|
* Calcula a nova seleção após clique (simples, Ctrl/Cmd acumulado ou Shift em intervalo).
|
|
30
45
|
* Retorna null se a feição clicada não estiver visível.
|
|
@@ -2,6 +2,8 @@ import { CamadasHostCompleto } from './camadas-host';
|
|
|
2
2
|
import { FeicaoItem } from './tipos';
|
|
3
3
|
export declare function sincronizarCamadaAtivaDOM(host: CamadasHostCompleto, shadow: ShadowRoot): void;
|
|
4
4
|
export declare function sincronizarSelecaoDOM(host: CamadasHostCompleto, shadow: ShadowRoot): void;
|
|
5
|
+
/** Estado do círculo de seleção de uma camada a partir das contagens já calculadas. */
|
|
6
|
+
export declare function aplicarContagemTarget(circle: Element | null, total: number, selecionadas: number): void;
|
|
5
7
|
/** Estado do círculo de seleção de uma camada: tudo selecionado, parte, ou nada (camada sem feições). */
|
|
6
8
|
export declare function aplicarEstadoTarget(circle: Element | null, feats: readonly FeicaoItem[], selecionadas: ReadonlySet<string>): void;
|
|
7
9
|
/** Contador, rótulo e modo (resumo × ações em massa) do rodapé, conforme a seleção atual. */
|
|
@@ -49,6 +49,7 @@ export interface MapaBaseItem {
|
|
|
49
49
|
thumbnailUrl?: string;
|
|
50
50
|
icone?: string;
|
|
51
51
|
}
|
|
52
|
+
/** @deprecated Tipo mantido apenas para compatibilidade de contrato com `UICamadasOpcoes.abaAtiva`. */
|
|
52
53
|
export type AbaPainelCamadas = 'camadas' | 'inspecao' | 'equipe';
|
|
53
54
|
export interface UICamadasOpcoes {
|
|
54
55
|
camadas?: CamadaItem[];
|
|
@@ -56,6 +57,7 @@ export interface UICamadasOpcoes {
|
|
|
56
57
|
mapasBase?: MapaBaseItem[];
|
|
57
58
|
mapaBaseAtivo?: string;
|
|
58
59
|
camadaAtivaId?: string;
|
|
60
|
+
/** @deprecated Sem efeito visual na versão atual do painel. */
|
|
59
61
|
abaAtiva?: AbaPainelCamadas;
|
|
60
62
|
colapsavel?: boolean;
|
|
61
63
|
colapsado?: boolean;
|
|
@@ -55,7 +55,9 @@ export declare class UICamadas extends SafeHTMLElement implements CamadasHostCom
|
|
|
55
55
|
set mapasBaseRecolhido(valor: boolean);
|
|
56
56
|
/** Alterna a seção de mapas base; com `emitirEvento`, dispara `ui-mapas-base-recolhimento`. */
|
|
57
57
|
alternarMapasBaseRecolhido(emitirEvento?: boolean): void;
|
|
58
|
+
/** @deprecated Propriedade mantida apenas para compatibilidade; o painel exibe diretamente a árvore de camadas. */
|
|
58
59
|
get abaAtiva(): AbaPainelCamadas;
|
|
60
|
+
/** @deprecated Propriedade mantida apenas para compatibilidade; o painel exibe diretamente a árvore de camadas. */
|
|
59
61
|
set abaAtiva(aba: AbaPainelCamadas);
|
|
60
62
|
get colapsado(): boolean;
|
|
61
63
|
set colapsado(valor: boolean);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { FormAssociatedElement } from '../../core/form-associated-element';
|
|
2
|
+
/**
|
|
3
|
+
* @attr {'linha'|'sublinhado'|'underline'} variante - Só a linha inferior, sem preenchimento nem borda lateral.
|
|
4
|
+
*/
|
|
2
5
|
export declare class UICampoTexto extends FormAssociatedElement {
|
|
3
6
|
static get observedAttributes(): string[];
|
|
4
7
|
private labelElement;
|
|
@@ -11,7 +11,11 @@ import { AlvoCor, AtalhosControleCores, ValorCor } from './tipos';
|
|
|
11
11
|
* - O kit não registra atalhos de teclado; quem usa chama `alternarAlvo()`, `inverter()`,
|
|
12
12
|
* `semCor()` e `restaurarPadrao()` e pode exibir as teclas nas dicas via `atalhos`.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* Layout (atributo `layout`): `lado` (padrão, ações em coluna ao lado), `abaixo` (ações em linha sob as amostras,
|
|
15
|
+
* para colunas estreitas), `compacto` (só as amostras; ações pela API) e `mini` (uma amostra só, a do alvo ativo;
|
|
16
|
+
* alterne o alvo por `alternarAlvo()`). `auto` ocupa a largura do contêiner sem transbordar: a amostra encolhe e as ações passam de ao lado para abaixo (< 66px) e somem (< 40px). Tamanhos: `--ui-controle-cores-amostra`, `--ui-controle-cores-acao`.
|
|
17
|
+
*
|
|
18
|
+
* Atributos: layout, preenchimento, traco, opacidade, espessura-traco, alvo (preenchimento|traco), padrao-preenchimento,
|
|
15
19
|
* padrao-traco, titulo-seletor, so-traco, desabilitado
|
|
16
20
|
* Propriedades: preenchimento, traco, opacidade, espessuraTraco, alvo, coresProjeto, atalhos, seletorAberto
|
|
17
21
|
* Métodos: definirCores(), obterCores(), definirAlvo(), alternarAlvo(), definirMisto(), inverter(),
|
|
@@ -30,3 +30,13 @@ export interface ContextoCorpoTabela {
|
|
|
30
30
|
/** O clique veio de um controle da célula (inclusive dentro do shadow DOM de um custom element)? */
|
|
31
31
|
export declare function cliqueEmControle(e: Event, tr: HTMLElement): boolean;
|
|
32
32
|
export declare function renderizarCorpoTabela(ctx: ContextoCorpoTabela): void;
|
|
33
|
+
export interface ContextoRodapeTabela {
|
|
34
|
+
tfootElement: HTMLTableSectionElement | null;
|
|
35
|
+
dadosRodape: Record<string, any>[];
|
|
36
|
+
colunas: TabelaColuna[];
|
|
37
|
+
formatWidth: (largura?: string | number) => string;
|
|
38
|
+
getAlignmentClass: (alinhamento?: string) => string;
|
|
39
|
+
getTextAlign: (alinhamento?: string) => string;
|
|
40
|
+
}
|
|
41
|
+
/** Renderiza as linhas de rodapé (`<tfoot>`) usando os mesmos alinhamentos e renderizadores das colunas. */
|
|
42
|
+
export declare function renderizarRodapeTabela(ctx: ContextoRodapeTabela): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TabelaEntradaDeclarativa } from './tipos';
|
|
2
|
+
/**
|
|
3
|
+
* Faz o parse de uma string JSON sem lançar exceções (degradação graciosa para entradas hostis).
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseJsonSeguro<T>(bruto: string | null): T | null;
|
|
6
|
+
/**
|
|
7
|
+
* Lê configurações declarativas de `<script type="application/json">` filhos e dos atributos
|
|
8
|
+
* JSON (`colunas`, `dados`, `rodape`) no elemento hospedeiro.
|
|
9
|
+
* Atributos explícitos têm prioridade sobre os `<script>` filhos.
|
|
10
|
+
*/
|
|
11
|
+
export declare function lerEntradaDeclarativa(host: HTMLElement): TabelaEntradaDeclarativa;
|
|
@@ -4,6 +4,7 @@ export interface EstruturaDOMElementos {
|
|
|
4
4
|
tableElement: HTMLTableElement;
|
|
5
5
|
theadElement: HTMLTableSectionElement;
|
|
6
6
|
tbodyElement: HTMLTableSectionElement;
|
|
7
|
+
tfootElement: HTMLTableSectionElement;
|
|
7
8
|
colgroupElement: HTMLTableColElement;
|
|
8
9
|
emptyElement: HTMLDivElement;
|
|
9
10
|
loadingElement: HTMLDivElement;
|
|
@@ -7,6 +7,7 @@ export interface ContextoHeaderTabela {
|
|
|
7
7
|
colunaOrdenada: string | null;
|
|
8
8
|
direcaoOrdenacao: 'asc' | 'desc' | 'original';
|
|
9
9
|
headerListeners: ListenerBag;
|
|
10
|
+
modoDocumento?: boolean;
|
|
10
11
|
formatWidth: (largura?: string | number) => string;
|
|
11
12
|
getAlignmentClass: (alinhamento?: string) => string;
|
|
12
13
|
getTextAlign: (alinhamento?: string) => string;
|
|
@@ -10,10 +10,13 @@ export interface ContextoOrquestradorRender {
|
|
|
10
10
|
theadElement: HTMLTableSectionElement | null;
|
|
11
11
|
colgroupElement: HTMLTableColElement | null;
|
|
12
12
|
tbodyElement: HTMLTableSectionElement | null;
|
|
13
|
+
tfootElement: HTMLTableSectionElement | null;
|
|
13
14
|
tableElement: HTMLTableElement | null;
|
|
14
15
|
emptyElement: HTMLDivElement | null;
|
|
15
16
|
containerElement: HTMLDivElement | null;
|
|
16
17
|
colunas: TabelaColuna[];
|
|
18
|
+
dadosRodape: Record<string, any>[];
|
|
19
|
+
modoDocumento?: boolean;
|
|
17
20
|
dadosController: TabelaOrquestradorDados;
|
|
18
21
|
selecaoController: TabelaSelecaoController;
|
|
19
22
|
headerListeners: ListenerBag;
|
|
@@ -31,6 +34,7 @@ export interface ContextoOrquestradorRender {
|
|
|
31
34
|
}
|
|
32
35
|
export declare function executarOrquestracaoHeader(ctx: ContextoOrquestradorRender): void;
|
|
33
36
|
export declare function executarOrquestracaoCorpo(ctx: ContextoOrquestradorRender): void;
|
|
37
|
+
export declare function executarOrquestracaoRodape(ctx: ContextoOrquestradorRender): void;
|
|
34
38
|
export declare function inicializarScrollVirtualizacao(container: HTMLElement, onRenderBody: () => void): (e: Event) => void;
|
|
35
39
|
export declare function orquestrarEstruturaInicial(shadow: ShadowRoot, textoVazio: string, maxHeight: string | null, carregando: boolean): EstruturaDOMElementos;
|
|
36
40
|
/**
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type DensidadeTabela = 'compacta' | 'normal' | 'relaxada';
|
|
5
5
|
export type ModoSelecaoTabela = 'unica' | 'multipla';
|
|
6
|
+
export type ModoTabela = 'app' | 'documento';
|
|
7
|
+
export interface TabelaEntradaDeclarativa<T = Record<string, any>> {
|
|
8
|
+
colunas?: TabelaColuna<T>[];
|
|
9
|
+
dados?: T[];
|
|
10
|
+
rodape?: Record<string, any>[];
|
|
11
|
+
}
|
|
6
12
|
export interface TabelaColuna<T = any> {
|
|
7
13
|
id: string;
|
|
8
14
|
rotulo: string;
|
|
@@ -19,6 +25,11 @@ export interface TabelaColuna<T = any> {
|
|
|
19
25
|
redimensionavel?: boolean;
|
|
20
26
|
/** Classes CSS extras aplicadas no `<th>` e nas `<td>` desta coluna. */
|
|
21
27
|
classe?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Permite quebra de linha no texto da célula (`white-space: normal`).
|
|
30
|
+
* No modo `documento` e na impressão, a quebra é ativada por padrão; defina `false` para mantê-la em linha única.
|
|
31
|
+
*/
|
|
32
|
+
quebrarLinha?: boolean;
|
|
22
33
|
tooltip?: string;
|
|
23
34
|
/** Tipo do dado, usado só na ordenação local: `data` aceita Date, ISO e dd/mm/aaaa. Padrão: inferido pelo valor. */
|
|
24
35
|
tipo?: 'texto' | 'numero' | 'data' | 'booleano';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { DensidadeTabela, ModoSelecaoTabela, TabelaColuna, TabelaFetcher, UISortDetail, UIColumnResizeDetail, UIRowScrollOptions, UISelecaoAlteradaDetail, UISelecaoRemovidaDetail, UIFetchErroDetail } from './tipos';
|
|
1
|
+
import { DensidadeTabela, ModoSelecaoTabela, ModoTabela, TabelaColuna, TabelaEntradaDeclarativa, TabelaFetcher, UISortDetail, UIColumnResizeDetail, UIRowScrollOptions, UISelecaoAlteradaDetail, UISelecaoRemovidaDetail, UIFetchErroDetail } from './tipos';
|
|
2
2
|
import { ModoRenderCorpo } from './tabela-corpo';
|
|
3
3
|
import { SafeHTMLElement } from '../../core/ssr-safe';
|
|
4
|
-
export type { DensidadeTabela, ModoSelecaoTabela, TabelaColuna, TabelaFetcher, UISortDetail, UIColumnResizeDetail, UIRowScrollOptions, UISelecaoAlteradaDetail, UISelecaoRemovidaDetail, UIFetchErroDetail };
|
|
4
|
+
export type { DensidadeTabela, ModoSelecaoTabela, ModoTabela, TabelaColuna, TabelaEntradaDeclarativa, TabelaFetcher, UISortDetail, UIColumnResizeDetail, UIRowScrollOptions, UISelecaoAlteradaDetail, UISelecaoRemovidaDetail, UIFetchErroDetail };
|
|
5
5
|
export declare class UITabela extends SafeHTMLElement {
|
|
6
6
|
static get observedAttributes(): string[];
|
|
7
7
|
private shadow;
|
|
8
8
|
private _colunas;
|
|
9
|
+
private _dadosRodape;
|
|
9
10
|
private _textoVazio;
|
|
10
11
|
private _virtualizar;
|
|
12
|
+
private _imprimindo;
|
|
11
13
|
private _isResizing;
|
|
12
14
|
private _carregando;
|
|
13
15
|
private _src;
|
|
@@ -17,6 +19,7 @@ export declare class UITabela extends SafeHTMLElement {
|
|
|
17
19
|
private _tableElement;
|
|
18
20
|
private _theadElement;
|
|
19
21
|
private _tbodyElement;
|
|
22
|
+
private _tfootElement;
|
|
20
23
|
private _colgroupElement;
|
|
21
24
|
private _emptyElement;
|
|
22
25
|
private _loadingElement;
|
|
@@ -30,6 +33,7 @@ export declare class UITabela extends SafeHTMLElement {
|
|
|
30
33
|
private _headerListeners;
|
|
31
34
|
private _corpoListeners;
|
|
32
35
|
private _erroListeners;
|
|
36
|
+
private _windowListeners;
|
|
33
37
|
/** Linha com o foco móvel (navegação por teclado); null = primeira linha visível. */
|
|
34
38
|
private _indiceAtivo;
|
|
35
39
|
/** Altura real das linhas medida no DOM; null = usa a estimativa da densidade. */
|
|
@@ -72,6 +76,20 @@ export declare class UITabela extends SafeHTMLElement {
|
|
|
72
76
|
recarregar(): Promise<boolean>;
|
|
73
77
|
filtrar(termo: string): void;
|
|
74
78
|
private cleanupEventListeners;
|
|
79
|
+
private ehModoDocumento;
|
|
80
|
+
private deveVirtualizar;
|
|
81
|
+
private sincronizarCabecalhoVisivel;
|
|
82
|
+
private registrarEventosImpressao;
|
|
83
|
+
/** Carrega colunas, dados e rodapé declarativos de `<script type="application/json">` filhos ou atributos. */
|
|
84
|
+
aplicarEntradaDeclarativa(): void;
|
|
85
|
+
get modo(): ModoTabela;
|
|
86
|
+
set modo(val: ModoTabela);
|
|
87
|
+
get semCabecalho(): boolean;
|
|
88
|
+
set semCabecalho(val: boolean);
|
|
89
|
+
get rodape(): Record<string, any>[];
|
|
90
|
+
set rodape(val: Record<string, any>[]);
|
|
91
|
+
get dadosRodape(): Record<string, any>[];
|
|
92
|
+
set dadosRodape(val: Record<string, any>[]);
|
|
75
93
|
get colunas(): TabelaColuna[];
|
|
76
94
|
set colunas(val: TabelaColuna[]);
|
|
77
95
|
get dados(): Record<string, any>[];
|
|
@@ -136,6 +154,7 @@ export declare class UITabela extends SafeHTMLElement {
|
|
|
136
154
|
* `rolagem` só ajusta a janela virtual e mantém as linhas que continuam visíveis (foco e texto digitado intactos).
|
|
137
155
|
*/
|
|
138
156
|
renderBody(modo?: ModoRenderCorpo): void;
|
|
157
|
+
renderFooter(): void;
|
|
139
158
|
/**
|
|
140
159
|
* Rola até um item e opcionalmente o seleciona. Aceita ID (pela `chave-id`, depois `id`, `_id`,
|
|
141
160
|
* `codigo`, `key`), predicado ou índice. Um número é procurado primeiro como ID; use
|
|
@@ -157,3 +176,4 @@ export * from './tabela-interacao';
|
|
|
157
176
|
export * from './tabela-dom';
|
|
158
177
|
export * from './tabela-renderizador';
|
|
159
178
|
export * from './tabela-atributos-sync';
|
|
179
|
+
export * from './tabela-declarativa';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemPropriedade, ContextoEditorPropriedade, TextosPropriedades } from './tipos';
|
|
1
|
+
import { ItemPropriedade, ContextoEditorPropriedade, TextosPropriedades, ValorPropriedade } from './tipos';
|
|
2
2
|
export declare function obterCasasDecimais(prop: ItemPropriedade): number | undefined;
|
|
3
3
|
export declare function obterPassoNumerico(prop: ItemPropriedade, casas?: number): number;
|
|
4
4
|
export declare function aplicarLimitesNumericos(valor: number, prop: ItemPropriedade): number;
|
|
@@ -8,9 +8,9 @@ export declare function aplicarLimitesNumericos(valor: number, prop: ItemProprie
|
|
|
8
8
|
* de ponto flutuante (0.1 + 0.2 = 0.3).
|
|
9
9
|
*/
|
|
10
10
|
export declare function interpretarEntradaNumerica(texto: string, prop: ItemPropriedade): number | null;
|
|
11
|
-
export declare function criarEditorReadonly(valorAtual:
|
|
12
|
-
export declare function criarEditorBooleano(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
13
|
-
export declare function criarEditorSelecao(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
11
|
+
export declare function criarEditorReadonly(valorAtual: ValorPropriedade, obterTextoMisto?: () => string, prop?: ItemPropriedade, obterTexto?: (chave: keyof TextosPropriedades) => string): HTMLElement;
|
|
12
|
+
export declare function criarEditorBooleano(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
13
|
+
export declare function criarEditorSelecao(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
14
14
|
export declare function criarEditorAcao(categoriaId: string, prop: ItemPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
15
|
-
export declare function criarEditorNumero(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
16
|
-
export declare function criarEditorTexto(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
15
|
+
export declare function criarEditorNumero(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
16
|
+
export declare function criarEditorTexto(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ItemPropriedade, ContextoEditorPropriedade } from './tipos';
|
|
1
|
+
import { ItemPropriedade, ContextoEditorPropriedade, ValorPropriedade } from './tipos';
|
|
2
2
|
/**
|
|
3
3
|
* Editor Tipo de Linha CAD (Linetype com preview SVG em tempo real)
|
|
4
4
|
*/
|
|
5
|
-
export declare function criarEditorLinetype(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
5
|
+
export declare function criarEditorLinetype(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
6
6
|
/**
|
|
7
7
|
* Editor Espessura de Linha CAD (Lineweight com espessura SVG proporcional)
|
|
8
8
|
*/
|
|
9
|
-
export declare function criarEditorLineweight(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
9
|
+
export declare function criarEditorLineweight(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
10
10
|
/**
|
|
11
11
|
* Editor Cor CAD (ByLayer, ByBlock, Cores Indexadas ACI e Hexadecimal)
|
|
12
12
|
*/
|
|
13
|
-
export declare function criarEditorCorCad(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
13
|
+
export declare function criarEditorCorCad(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|
|
14
14
|
/**
|
|
15
15
|
* Editor Cor Padrão (Swatch com Color Picker Nativo)
|
|
16
16
|
*/
|
|
17
|
-
export declare function criarEditorCorSwatch(categoriaId: string, prop: ItemPropriedade, valorAtual:
|
|
17
|
+
export declare function criarEditorCorSwatch(categoriaId: string, prop: ItemPropriedade, valorAtual: ValorPropriedade, ctx: ContextoEditorPropriedade): HTMLElement;
|