@thibezer/ui-components-kit 2.24.1 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -1
- package/dist/botao.cjs +12 -1
- package/dist/botao.js +162 -3
- package/dist/camadas.cjs +311 -1
- package/dist/camadas.js +3244 -148
- package/dist/campo-texto.cjs +16 -1
- package/dist/campo-texto.js +308 -7
- package/dist/canvas.cjs +22 -22
- package/dist/canvas.js +230 -233
- package/dist/card.cjs +20 -1
- package/dist/card.js +145 -2
- package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
- package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +26 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +9 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha.d.ts +2 -2
- package/dist/components/ui-editor-prancha/editor-barra.d.ts +19 -0
- package/dist/components/ui-editor-prancha/editor-modos.d.ts +35 -0
- package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
- package/dist/components/ui-editor-prancha/index.d.ts +1 -0
- package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +63 -7
- package/dist/core/alvo-digitavel.d.ts +3 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +43 -54
- package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
- package/dist/cores.cjs +32 -1
- package/dist/cores.js +300 -13
- package/dist/custom-elements.json +11945 -11071
- package/dist/data.cjs +28 -1
- package/dist/data.js +286 -99
- package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
- package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
- package/dist/feedback.cjs +52 -1
- package/dist/feedback.js +655 -25
- package/dist/forms.cjs +66 -1
- package/dist/forms.js +1216 -39
- package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
- package/dist/index.cjs +67 -1
- package/dist/index.js +1476 -274
- package/dist/kit-base-BmkPi5Rz.cjs +2 -0
- package/dist/kit-base-CBXA66aM.js +1084 -0
- package/dist/mapa.cjs +5 -5
- package/dist/mapa.js +16 -17
- package/dist/modal.cjs +18 -1
- package/dist/modal.js +235 -29
- package/dist/motor.js +49 -49
- package/dist/prancha-nucleo.cjs +3 -1
- package/dist/prancha-nucleo.js +3120 -277
- package/dist/prancha.cjs +38 -1
- package/dist/prancha.js +3470 -228
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -20
- package/dist/seletor-mapa-base.cjs +13 -13
- package/dist/seletor-mapa-base.js +3 -5
- package/dist/tabela.cjs +142 -1
- package/dist/tabela.js +3773 -92
- package/dist/tipos-elementos.d.ts +7 -3
- package/dist/tipos-vue.d.ts +6 -3
- package/dist/tools.cjs +16 -1
- package/dist/tools.js +1564 -26
- package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-CPjA9vhZ.js} +8 -9
- package/dist/ui-seletor-cor-D_ifitEN.cjs +83 -0
- package/dist/utils-ClVgqVyJ.cjs +1 -0
- package/dist/utils-DrHoxxmf.js +83 -0
- package/package.json +43 -2
- package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
- package/dist/acessibilidade-CUlSXc2X.js +0 -38
- package/dist/altura-controle-ukMRPckR.cjs +0 -1
- package/dist/altura-controle-vxQiXG4q.js +0 -62
- package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
- package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
- package/dist/degrade-CIxvOTUv.cjs +0 -1
- package/dist/degrade-gDa5sW__.js +0 -119
- package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
- package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
- package/dist/feature_historico-BAIYk1Me.cjs +0 -3
- package/dist/feature_historico-C4h9y5fu.js +0 -3039
- package/dist/form-atalhos-7JTYvumA.cjs +0 -1
- package/dist/form-atalhos-DDTlpgaB.js +0 -203
- package/dist/form-erros-CwPz7Jr4.cjs +0 -1
- package/dist/form-erros-DT5HklfD.js +0 -184
- package/dist/form-submissao-C-SPRKgT.js +0 -61
- package/dist/form-submissao-DxKO5MHI.cjs +0 -1
- package/dist/form-validacao-BlQFxUVj.js +0 -104
- package/dist/form-validacao-DIeyQVH5.cjs +0 -1
- package/dist/geometria-px-DKrWq_XY.js +0 -639
- package/dist/leaflet-CEPcxGWV.cjs +0 -1
- package/dist/leaflet-DOq10gfg.js +0 -84
- package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
- package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
- package/dist/listener-bag-D5omxZ9h.cjs +0 -1
- package/dist/listener-bag-DQgv7OON.js +0 -34
- package/dist/motor-By2te6PZ.js +0 -1400
- package/dist/motor-CkMxd378.cjs +0 -1
- package/dist/opcoes-CupvWVIm.js +0 -24
- package/dist/opcoes-vdAUY5OI.cjs +0 -1
- package/dist/parts-CaoQiCfI.js +0 -7
- package/dist/parts-vQa2873h.cjs +0 -1
- package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
- package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
- package/dist/ssr-safe-5cWfJP-s.js +0 -10
- package/dist/ssr-safe-CiHD1adl.cjs +0 -1
- package/dist/svg-seguro-ChVJ2L2z.js +0 -74
- package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
- package/dist/ui-badge-DE58YSBY.cjs +0 -28
- package/dist/ui-badge-KgmI3jOD.js +0 -201
- package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
- package/dist/ui-botao-zLkcMMyP.js +0 -168
- package/dist/ui-bus-CUd99VJi.js +0 -177
- package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
- package/dist/ui-camadas-DoHPnbQm.js +0 -3133
- package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
- package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
- package/dist/ui-campo-texto-btevggO3.js +0 -379
- package/dist/ui-card-7IEYbCN0.js +0 -150
- package/dist/ui-card-Bx8EyzYY.cjs +0 -20
- package/dist/ui-card-C-EJoKnm.js +0 -150
- package/dist/ui-card-DFnRp9bl.js +0 -146
- package/dist/ui-card-DrWVJQKw.cjs +0 -20
- package/dist/ui-card-DsIjHMmG.cjs +0 -20
- package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
- package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
- package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
- package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
- package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
- package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
- package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
- package/dist/ui-linha-B4mBRm1x.cjs +0 -61
- package/dist/ui-linha-DTEIIww4.js +0 -1167
- package/dist/ui-linha-KFF86FW5.js +0 -752
- package/dist/ui-modal-BrXzVZ65.js +0 -216
- package/dist/ui-modal-lARKzEVZ.cjs +0 -18
- package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
- package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
- package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
- package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
- package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
- package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
- package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
- package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
- package/dist/ui-skeleton-BLEV6h3k.js +0 -653
- package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
- package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
- package/dist/ui-switch-Ctxk-jKS.js +0 -1212
- package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
- package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
- package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
- package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
- package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
- package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
- package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
- package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
- package/dist/zero-js-triggers-CJT988bR.js +0 -83
- package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
package/dist/card.cjs
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const
|
|
1
|
+
"use strict";var y=Object.defineProperty;var E=(a,t,e)=>t in a?y(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var d=(a,t,e)=>E(a,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const i=require("./kit-base-BmkPi5Rz.cjs"),A=':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);font-weight:var(--ui-peso-normal, 400);overflow-wrap:break-word}: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;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;box-sizing:border-box;font-size:var(--ui-card-fonte-cabecalho, var(--ui-tamanho-corpo, 14px));font-weight:var(--ui-card-peso-cabecalho, var(--ui-peso-seminegrito, 600));line-height:var(--ui-altura-linha-titulo, 1.25);text-wrap:balance}.ui-card__body{padding:12px 16px;flex:1;box-sizing:border-box;font-size:var(--ui-card-fonte-corpo, var(--ui-tamanho-corpo, 14px));line-height:var(--ui-altura-linha-corpo, 1.5);text-wrap:pretty}.ui-card__footer{padding:10px 16px 14px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;box-sizing:border-box;font-size:var(--ui-card-fonte-rodape, var(--ui-tamanho-corpo-sm, 13px));line-height:var(--ui-altura-linha-corpo, 1.5);color:var(--ui-cor-texto-secundario, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 70%, transparent))}.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))}',w=["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 k(a,t){if(typeof Element>"u"||!(a instanceof Element))return!1;const e=a.closest(w);return e!==null&&e!==t&&t.contains(e)}function S(a,t){return a.key!=="Enter"&&a.key!==" "||a.repeat||a.ctrlKey||a.altKey||a.metaKey?!1:a.target===t}function C(a,t,e){return Array.from(t.children).some(o=>e.includes(o.getAttribute("slot")??""))?!0:a?Array.from(a.querySelectorAll("slot")).filter(o=>e.includes(o.name)).some(o=>o.assignedNodes({flatten:!0}).some(s=>s.nodeType===1||s.nodeType===3&&(s.textContent??"").trim()!=="")):!1}const x=["plano","elevado","destaque"],q=["nenhum","sm","md","lg","xl"];class _ extends i.SafeHTMLElement{constructor(){super();d(this,"cardElement");d(this,"listeners",new i.ListenerBag);d(this,"handleSlotChange",()=>{this.syncState()});d(this,"handleClick",e=>{this.disabled||!this.clicavel||e&&k(e.target,this)||this.emitirClique()});d(this,"handleKeyDown",e=>{!this.clicavel||this.disabled||!S(e,this.cardElement)||(e.preventDefault(),this.emitirClique())});const e=this.attachShadow({mode:"open"});e.innerHTML=`
|
|
2
|
+
<style>${A}</style>
|
|
3
|
+
<div class="ui-card" part="base">
|
|
4
|
+
<div class="ui-card__media" part="midia">
|
|
5
|
+
<slot name="midia"></slot>
|
|
6
|
+
<slot name="media"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="ui-card__header" part="cabecalho">
|
|
9
|
+
<slot name="cabecalho"></slot>
|
|
10
|
+
<slot name="header"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="ui-card__body" part="corpo">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="ui-card__footer" part="rodape">
|
|
16
|
+
<slot name="rodape"></slot>
|
|
17
|
+
<slot name="footer"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`,this.cardElement=e.querySelector(".ui-card")}static get observedAttributes(){return["elevacao","elevation","variante","variant","formato","raio","radius","clicavel","clickable","compacto","compact","disabled","aria-label",...i.ATRIBUTOS_DEGRADE]}connectedCallback(){var r;this.listeners.cleanup(),this.listeners.add(this.cardElement,"click",this.handleClick),this.listeners.add(this.cardElement,"keydown",this.handleKeyDown);const e=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("slot");e==null||e.forEach(c=>this.listeners.add(c,"slotchange",this.handleSlotChange)),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(e,r,c){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 m,v,f,g;const e=i.escolherOpcao(this.getAttribute("elevacao")||this.getAttribute("elevation"),x,"plano"),r=i.escolherOpcaoOpcional(this.getAttribute("variante")||this.getAttribute("variant"),x),c=this.clicavel,o=this.hasAttribute("compacto")||this.hasAttribute("compact"),s=this.disabled;this.cardElement.className="ui-card",this.cardElement.classList.add(`ui-card--${e}`),r&&this.cardElement.classList.add(`ui-card--${r}`);const u=i.escolherOpcaoOpcional(this.getAttribute("raio")||this.getAttribute("radius"),q);if(u&&this.cardElement.classList.add(`ui-card--raio-${u}`),c){this.cardElement.classList.add("ui-card--clicavel"),this.cardElement.setAttribute("role","button"),this.cardElement.setAttribute("tabindex",s?"-1":"0");const n=(m=this.getAttribute("aria-label"))==null?void 0:m.trim();n?this.cardElement.setAttribute("aria-label",n):this.cardElement.removeAttribute("aria-label")}else this.cardElement.removeAttribute("role"),this.cardElement.removeAttribute("tabindex"),this.cardElement.removeAttribute("aria-label");s?this.cardElement.setAttribute("aria-disabled","true"):this.cardElement.removeAttribute("aria-disabled"),o&&this.cardElement.classList.add("ui-card--compacto"),s&&this.cardElement.classList.add("ui-card--disabled"),i.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"),p=(g=this.shadowRoot)==null?void 0:g.querySelector(".ui-card__media"),l=n=>C(this.shadowRoot,this,n);p&&(p.style.display=l(["midia","media"])?"block":"none"),h&&(h.style.display=l(["cabecalho","header"])?"flex":"none"),b&&(b.style.display=l(["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}))}}i.definirCustomElement("ui-card",_);exports.UICard=_;
|
package/dist/card.js
CHANGED
|
@@ -1,5 +1,148 @@
|
|
|
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);
|
|
1
4
|
/* empty css */
|
|
2
|
-
import {
|
|
5
|
+
import { S as E, A, L as w, e as k, b as x, g as S, d as C } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
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);font-weight:var(--ui-peso-normal, 400);overflow-wrap:break-word}: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;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;box-sizing:border-box;font-size:var(--ui-card-fonte-cabecalho, var(--ui-tamanho-corpo, 14px));font-weight:var(--ui-card-peso-cabecalho, var(--ui-peso-seminegrito, 600));line-height:var(--ui-altura-linha-titulo, 1.25);text-wrap:balance}.ui-card__body{padding:12px 16px;flex:1;box-sizing:border-box;font-size:var(--ui-card-fonte-corpo, var(--ui-tamanho-corpo, 14px));line-height:var(--ui-altura-linha-corpo, 1.5);text-wrap:pretty}.ui-card__footer{padding:10px 16px 14px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;box-sizing:border-box;font-size:var(--ui-card-fonte-rodape, var(--ui-tamanho-corpo-sm, 13px));line-height:var(--ui-altura-linha-corpo, 1.5);color:var(--ui-cor-texto-secundario, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 70%, transparent))}.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 = [
|
|
7
|
+
"button",
|
|
8
|
+
"a",
|
|
9
|
+
"input",
|
|
10
|
+
"select",
|
|
11
|
+
"textarea",
|
|
12
|
+
"label",
|
|
13
|
+
"summary",
|
|
14
|
+
"ui-botao",
|
|
15
|
+
"ui-switch",
|
|
16
|
+
"ui-checkbox",
|
|
17
|
+
"ui-radio",
|
|
18
|
+
"ui-campo-texto",
|
|
19
|
+
"ui-segmented",
|
|
20
|
+
'[contenteditable]:not([contenteditable="false"])',
|
|
21
|
+
'[role="button"]',
|
|
22
|
+
'[role="link"]',
|
|
23
|
+
'[role="checkbox"]',
|
|
24
|
+
'[role="switch"]',
|
|
25
|
+
'[role="menuitem"]'
|
|
26
|
+
].join(", ");
|
|
27
|
+
function R(a, t) {
|
|
28
|
+
if (typeof Element > "u" || !(a instanceof Element)) return !1;
|
|
29
|
+
const e = a.closest(L);
|
|
30
|
+
return e !== null && e !== t && t.contains(e);
|
|
31
|
+
}
|
|
32
|
+
function O(a, t) {
|
|
33
|
+
return a.key !== "Enter" && a.key !== " " || a.repeat || a.ctrlKey || a.altKey || a.metaKey ? !1 : a.target === t;
|
|
34
|
+
}
|
|
35
|
+
function T(a, t, e) {
|
|
36
|
+
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(
|
|
37
|
+
(r) => r.assignedNodes({ flatten: !0 }).some(
|
|
38
|
+
(o) => o.nodeType === 1 || o.nodeType === 3 && (o.textContent ?? "").trim() !== ""
|
|
39
|
+
)
|
|
40
|
+
) : !1;
|
|
41
|
+
}
|
|
42
|
+
const g = ["plano", "elevado", "destaque"], D = ["nenhum", "sm", "md", "lg", "xl"];
|
|
43
|
+
class z extends E {
|
|
44
|
+
constructor() {
|
|
45
|
+
super();
|
|
46
|
+
s(this, "cardElement");
|
|
47
|
+
s(this, "listeners", new w());
|
|
48
|
+
s(this, "handleSlotChange", () => {
|
|
49
|
+
this.syncState();
|
|
50
|
+
});
|
|
51
|
+
s(this, "handleClick", (e) => {
|
|
52
|
+
this.disabled || !this.clicavel || e && R(e.target, this) || this.emitirClique();
|
|
53
|
+
});
|
|
54
|
+
s(this, "handleKeyDown", (e) => {
|
|
55
|
+
!this.clicavel || this.disabled || !O(e, this.cardElement) || (e.preventDefault(), this.emitirClique());
|
|
56
|
+
});
|
|
57
|
+
const e = this.attachShadow({ mode: "open" });
|
|
58
|
+
e.innerHTML = `
|
|
59
|
+
<style>${q}</style>
|
|
60
|
+
<div class="ui-card" part="base">
|
|
61
|
+
<div class="ui-card__media" part="midia">
|
|
62
|
+
<slot name="midia"></slot>
|
|
63
|
+
<slot name="media"></slot>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="ui-card__header" part="cabecalho">
|
|
66
|
+
<slot name="cabecalho"></slot>
|
|
67
|
+
<slot name="header"></slot>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="ui-card__body" part="corpo">
|
|
70
|
+
<slot></slot>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="ui-card__footer" part="rodape">
|
|
73
|
+
<slot name="rodape"></slot>
|
|
74
|
+
<slot name="footer"></slot>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`, this.cardElement = e.querySelector(".ui-card");
|
|
78
|
+
}
|
|
79
|
+
static get observedAttributes() {
|
|
80
|
+
return [
|
|
81
|
+
"elevacao",
|
|
82
|
+
"elevation",
|
|
83
|
+
"variante",
|
|
84
|
+
"variant",
|
|
85
|
+
"formato",
|
|
86
|
+
"raio",
|
|
87
|
+
"radius",
|
|
88
|
+
"clicavel",
|
|
89
|
+
"clickable",
|
|
90
|
+
"compacto",
|
|
91
|
+
"compact",
|
|
92
|
+
"disabled",
|
|
93
|
+
"aria-label",
|
|
94
|
+
...A
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
connectedCallback() {
|
|
98
|
+
var i;
|
|
99
|
+
this.listeners.cleanup(), this.listeners.add(this.cardElement, "click", this.handleClick), this.listeners.add(this.cardElement, "keydown", this.handleKeyDown);
|
|
100
|
+
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelectorAll("slot");
|
|
101
|
+
e == null || e.forEach((d) => this.listeners.add(d, "slotchange", this.handleSlotChange)), this.syncState();
|
|
102
|
+
}
|
|
103
|
+
disconnectedCallback() {
|
|
104
|
+
this.listeners.cleanup();
|
|
105
|
+
}
|
|
106
|
+
attributeChangedCallback(e, i, d) {
|
|
107
|
+
this.syncState();
|
|
108
|
+
}
|
|
109
|
+
/** Leva o foco ao card clicável e habilitado; nos demais casos mantém o comportamento nativo do host. */
|
|
110
|
+
focus(e) {
|
|
111
|
+
this.clicavel && !this.disabled ? this.cardElement.focus(e) : super.focus(e);
|
|
112
|
+
}
|
|
113
|
+
get clicavel() {
|
|
114
|
+
return this.hasAttribute("clicavel") || this.hasAttribute("clickable");
|
|
115
|
+
}
|
|
116
|
+
set clicavel(e) {
|
|
117
|
+
e ? this.setAttribute("clicavel", "") : (this.removeAttribute("clicavel"), this.removeAttribute("clickable")), this.syncState();
|
|
118
|
+
}
|
|
119
|
+
get disabled() {
|
|
120
|
+
return this.hasAttribute("disabled");
|
|
121
|
+
}
|
|
122
|
+
set disabled(e) {
|
|
123
|
+
e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
|
|
124
|
+
}
|
|
125
|
+
syncState() {
|
|
126
|
+
var p, m, v, f;
|
|
127
|
+
const e = k(this.getAttribute("elevacao") || this.getAttribute("elevation"), g, "plano"), i = x(this.getAttribute("variante") || this.getAttribute("variant"), g), d = this.clicavel, r = this.hasAttribute("compacto") || this.hasAttribute("compact"), o = this.disabled;
|
|
128
|
+
this.cardElement.className = "ui-card", this.cardElement.classList.add(`ui-card--${e}`), i && this.cardElement.classList.add(`ui-card--${i}`);
|
|
129
|
+
const l = x(this.getAttribute("raio") || this.getAttribute("radius"), D);
|
|
130
|
+
if (l && this.cardElement.classList.add(`ui-card--raio-${l}`), d) {
|
|
131
|
+
this.cardElement.classList.add("ui-card--clicavel"), this.cardElement.setAttribute("role", "button"), this.cardElement.setAttribute("tabindex", o ? "-1" : "0");
|
|
132
|
+
const c = (p = this.getAttribute("aria-label")) == null ? void 0 : p.trim();
|
|
133
|
+
c ? this.cardElement.setAttribute("aria-label", c) : this.cardElement.removeAttribute("aria-label");
|
|
134
|
+
} else
|
|
135
|
+
this.cardElement.removeAttribute("role"), this.cardElement.removeAttribute("tabindex"), this.cardElement.removeAttribute("aria-label");
|
|
136
|
+
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"), S(this, this.cardElement);
|
|
137
|
+
const u = (m = this.shadowRoot) == null ? void 0 : m.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);
|
|
138
|
+
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");
|
|
139
|
+
}
|
|
140
|
+
emitirClique() {
|
|
141
|
+
const e = { id: this.id || "sem-id" };
|
|
142
|
+
this.dispatchEvent(new CustomEvent("ui-click", { detail: e, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("ui-clique", { detail: { ...e }, bubbles: !0, composed: !0 }));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
C("ui-card", z);
|
|
3
146
|
export {
|
|
4
|
-
|
|
147
|
+
z as UICard
|
|
5
148
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './ui-canvas-prancha';
|
|
2
2
|
export { UICanvasPranchaBase } from './ui-canvas-prancha-base';
|
|
3
|
-
export { eventoTratadoPelaPrancha } from './prancha-teclado';
|
|
3
|
+
export { eventoTratadoPelaPrancha, teclaReservadaDoNavegador, instalarIsolamentoDeTeclas, instalarTecladoModal, lerModoTeclado, type ModoTecladoPrancha } from './prancha-teclado';
|
|
4
4
|
export * from './prancha-paineis';
|
|
5
5
|
export * from './tipos';
|
|
6
6
|
export { COMANDOS_PRANCHA, type ComandoPublicoPrancha } from './prancha-bus';
|
|
@@ -1,7 +1,33 @@
|
|
|
1
|
+
import { ListenerBag } from '../../core/listener-bag';
|
|
1
2
|
import { ControladorPrancha } from './prancha-controlador';
|
|
2
3
|
import { InteracaoPrancha } from './prancha-interacao';
|
|
3
4
|
export declare const eventoTratadoPelaPrancha: (e: Event) => boolean;
|
|
4
5
|
export declare function marcarTratadoPelaPrancha(e: Event): void;
|
|
6
|
+
export type ModoTecladoPrancha = 'local' | 'exclusivo' | 'isolado' | 'modal';
|
|
7
|
+
/** Valor do atributo `teclado`: desconhecido ou ausente = `local`. */
|
|
8
|
+
export declare const lerModoTeclado: (v: string | null | undefined) => ModoTecladoPrancha;
|
|
9
|
+
/**
|
|
10
|
+
* Teclas que o isolamento NUNCA retém (atalhos do navegador/sistema): F5, F11, F12, Ctrl/Cmd+R, L, W, T, Ctrl/Cmd+Shift+I e J,
|
|
11
|
+
* o zoom do navegador (Ctrl/Cmd com +, =, -, 0) e o Tab (foco). Conflito do zoom: a prancha usa Ctrl+=, Ctrl+- e Ctrl+0 no
|
|
12
|
+
* canvas; quando ela trata a tecla o evento já vem com `defaultPrevented` e NÃO é reservado (a prancha vence dentro do
|
|
13
|
+
* canvas); quando não trata (foco num campo, por exemplo), é o zoom do navegador e passa.
|
|
14
|
+
*/
|
|
15
|
+
export declare function teclaReservadaDoNavegador(e: KeyboardEvent): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Isolamento do teclado (`teclado="isolado"` e `teclado="modal"`): todo `keydown`/`keyup`/`keypress` que chega ao `alvo`
|
|
18
|
+
* (o editor ou a prancha, ou seja, com o foco dentro dele) leva `stopPropagation()` na fase de BOLHA, então os ouvintes de
|
|
19
|
+
* `window`/`document` do hospedeiro não o veem, tratado ou não. As teclas reservadas do navegador passam. Fora do alvo, no
|
|
20
|
+
* modo `isolado` nada muda (no `modal`, `instalarTecladoModal` bloqueia na captura da janela). Os ouvintes vão no `ListenerBag`
|
|
21
|
+
* (Regra #2).
|
|
22
|
+
*/
|
|
23
|
+
export declare function instalarIsolamentoDeTeclas(bag: ListenerBag, alvo: EventTarget, ativo: () => boolean): void;
|
|
24
|
+
/**
|
|
25
|
+
* Bloqueio modal (`teclado="modal"`): enquanto o componente está montado e ativo, todo `keydown`/`keyup`/`keypress` da página
|
|
26
|
+
* cujo alvo não passe por `alvo` recebe `stopPropagation()` na fase de captura em `window`. Continuam passando as teclas
|
|
27
|
+
* reservadas do navegador (`teclaReservadaDoNavegador`) e as teclas de campos de texto fora de `alvo` quando o foco está num
|
|
28
|
+
* deles. Os ouvintes vão no `ListenerBag` (Regra #2) e respeitam SSR (Regra #1).
|
|
29
|
+
*/
|
|
30
|
+
export declare function instalarTecladoModal(bag: ListenerBag, alvo: EventTarget, ativo: () => boolean): void;
|
|
5
31
|
export interface AcoesDeVista {
|
|
6
32
|
ajustarFolha(): void;
|
|
7
33
|
definirZoomPercentual(p: number): void;
|
|
@@ -10,6 +10,7 @@ import { CaixaMm, ElementoGrafico, RaiosCantos } from '../../gerencigeo-canvas/p
|
|
|
10
10
|
import { ControladorPrancha } from './prancha-controlador';
|
|
11
11
|
import { InteracaoPrancha } from './prancha-interacao';
|
|
12
12
|
import { RenderizadorPrancha, FabricaContextoPrancha } from './prancha-render';
|
|
13
|
+
import { ModoTecladoPrancha } from './prancha-teclado';
|
|
13
14
|
import { DetalheVistaPrancha, FerramentaPrancha, LotePrancha, OpcoesAjustarElementos, OpcoesDadosPrancha, OpcoesFerramentasPrancha, OpcoesInserirPredefinicao, ResultadoLotePrancha } from './tipos';
|
|
14
15
|
/**
|
|
15
16
|
* Base do `<ui-canvas-prancha>`: ciclo de vida, atributos, dados, seleção, ferramentas, vista, guias, exportação e os
|
|
@@ -48,7 +49,12 @@ export declare class UICanvasPranchaBase extends SafeHTMLElement {
|
|
|
48
49
|
private atualizarRotulo;
|
|
49
50
|
private atualizarCores;
|
|
50
51
|
private redimensionar;
|
|
52
|
+
/** Modo do atributo `teclado`: `local` (padrão), `exclusivo`, `isolado` ou `modal`. */
|
|
53
|
+
private modoTeclado;
|
|
54
|
+
private hospedadaNoEditor;
|
|
51
55
|
private tecladoExclusivo;
|
|
56
|
+
/** O evento veio de dentro desta prancha ou do editor (outro componente) que a contém? */
|
|
57
|
+
private noEscopoDoTeclado;
|
|
52
58
|
private tecla;
|
|
53
59
|
/** O documento mudou desde a carga (`definirElementos`) ou desde `marcarComoSalvo()`. */
|
|
54
60
|
get modificado(): boolean;
|
|
@@ -64,6 +70,9 @@ export declare class UICanvasPranchaBase extends SafeHTMLElement {
|
|
|
64
70
|
get pronto(): Promise<void>;
|
|
65
71
|
/** Dá o foco à área de desenho (o `focus()` do host entrega o foco ao viewport, onde o teclado da prancha escuta). */
|
|
66
72
|
focus(opcoes?: FocusOptions): void;
|
|
73
|
+
/** Modo do teclado: `local` (padrão), `exclusivo`, `isolado` ou `modal`. */
|
|
74
|
+
get teclado(): ModoTecladoPrancha;
|
|
75
|
+
set teclado(v: ModoTecladoPrancha);
|
|
67
76
|
/** Ferramenta ativa. */
|
|
68
77
|
get ferramenta(): FerramentaPrancha;
|
|
69
78
|
set ferramenta(f: FerramentaPrancha);
|
|
@@ -12,8 +12,8 @@ import { OperacaoPathfinder } from '../../gerencigeo-canvas/prancha/pathfinder';
|
|
|
12
12
|
* camadas, ordem, grupos (com isolamento), alinhar e distribuir, duplicar, copiar e colar, conta-gotas, máscara de recorte,
|
|
13
13
|
* operações de caminho, Pathfinder, mesclagem e sombra, teclado e histórico. O componente não grava nada: devolve as mudanças em eventos e o app decide id,
|
|
14
14
|
* nome e persistência. Atributos novos (lista em `ATRIBUTOS_PRANCHA`): `margens="e d s i"` (guia tracejada e quadro de
|
|
15
|
-
* `inserirPredefinicao(tipo, undefined, { quadro: 'margens' })`), `teclado="exclusivo"` (captura
|
|
16
|
-
* modal) e `ajustar-ao-abrir="folha|conteudo|nenhum"`.
|
|
15
|
+
* `inserirPredefinicao(tipo, undefined, { quadro: 'margens' })`), `teclado="local|exclusivo|isolado|modal"` (isolamento/captura
|
|
16
|
+
* de teclado, uso em modal) e `ajustar-ao-abrir="folha|conteudo|nenhum"`.
|
|
17
17
|
*
|
|
18
18
|
* @fires prancha-elemento-criado - `{ elementos, motivo }`: elementos criados pelo usuário (ferramenta, texto, predefinição, colar, duplicar).
|
|
19
19
|
* @fires prancha-elemento-atualizado - `{ elementos, motivo }`: elementos alterados por um gesto ou comando.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface EntradaMedicaoBarra {
|
|
2
|
+
barra: HTMLElement;
|
|
3
|
+
botoesFormas: HTMLElement;
|
|
4
|
+
botaoLateral: HTMLElement;
|
|
5
|
+
lateralVisivel: boolean;
|
|
6
|
+
colapsadaAtual: boolean;
|
|
7
|
+
/** Largura (px) observada pelo ResizeObserver como fallback quando `barra.clientWidth` é 0 (ex.: happy-dom). */
|
|
8
|
+
larguraObservada: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MedicaoBarraFormas {
|
|
11
|
+
larguraDisponivel: number;
|
|
12
|
+
larguraNecessaria: number;
|
|
13
|
+
transbordouNoDom: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Mede no DOM a largura disponível para os botões de pré-definições e a largura necessária para exibi-los em uma
|
|
17
|
+
* única linha (mesmo quando `.botoes-formas` está oculto por já ter colapsado em `"Formas ▾"`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function medirBarraFormas(entrada: EntradaMedicaoBarra): MedicaoBarraFormas;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BarraFormasEditorPrancha, LateralEditorPrancha } from './editor-tipos';
|
|
2
|
+
/**
|
|
3
|
+
* Largura (px do próprio editor) abaixo da qual `lateral="auto"` vira gaveta. É a mesma do
|
|
4
|
+
* `@container editor (max-width: 719.98px)` do CSS (o CSS não lê variáveis em condições de container).
|
|
5
|
+
*/
|
|
6
|
+
export declare const LARGURA_ESTREITA_PX = 720;
|
|
7
|
+
/**
|
|
8
|
+
* Folga mínima (px) acima da largura necessária para `barra-formas="auto"` voltar de `"Formas ▾"` para os botões,
|
|
9
|
+
* evitando oscilação na fronteira por arredondamentos de subpixel ou pequenas variações de largura.
|
|
10
|
+
*/
|
|
11
|
+
export declare const HISTERESE_BARRA_FORMAS_PX = 24;
|
|
12
|
+
/** Tolerância de subpixel (px) antes de declarar transbordo ao comparar largura necessária e disponível. */
|
|
13
|
+
export declare const TOLERANCIA_TRANSBORDO_PX = 0.5;
|
|
14
|
+
export interface EntradaDecisaoBarraFormas {
|
|
15
|
+
/** Estado atual no modo `auto` (`false` = botões visíveis, `true` = menu `"Formas ▾"`). */
|
|
16
|
+
colapsadaAtual: boolean;
|
|
17
|
+
/** Largura (px) necessária para exibir todos os botões em uma única linha. */
|
|
18
|
+
larguraNecessaria: number;
|
|
19
|
+
/** Largura (px) disponível para `.botoes-formas` dentro da barra. */
|
|
20
|
+
larguraDisponivel: number;
|
|
21
|
+
/** Quando os botões estão visíveis no DOM, indica se houve quebra para segunda linha ou transbordo horizontal. */
|
|
22
|
+
transbordouNoDom?: boolean;
|
|
23
|
+
/** Histerese (px) exigida para expandir de `"Formas ▾"` de volta para os botões. */
|
|
24
|
+
histerese?: number;
|
|
25
|
+
}
|
|
26
|
+
/** `barra-formas`: desconhecido ou ausente = `auto`. */
|
|
27
|
+
export declare const lerBarraFormas: (v: unknown) => BarraFormasEditorPrancha;
|
|
28
|
+
/** `lateral`: desconhecido ou ausente = `auto`. */
|
|
29
|
+
export declare const lerLateral: (v: unknown) => LateralEditorPrancha;
|
|
30
|
+
/**
|
|
31
|
+
* Decide se a barra de formas no modo `auto` deve colapsar para `"Formas ▾"` (`true`) ou exibir os botões (`false`).
|
|
32
|
+
* Função pura (sem DOM): aplica histerese assimétrica para evitar "pisca-pisca" na fronteira e preserva o estado
|
|
33
|
+
* atual quando ainda não há medidas válidas de layout.
|
|
34
|
+
*/
|
|
35
|
+
export declare function decidirBarraColapsada(entrada: EntradaDecisaoBarraFormas): boolean;
|
|
@@ -10,3 +10,7 @@ export interface DetalheEditorConcluirPrancha {
|
|
|
10
10
|
export interface DetalheEditorCancelarPrancha {
|
|
11
11
|
modificado: boolean;
|
|
12
12
|
}
|
|
13
|
+
/** Barra de pré-definições: botões, menu "Formas" ou automático (pela largura do editor). */
|
|
14
|
+
export type BarraFormasEditorPrancha = 'auto' | 'botoes' | 'menu';
|
|
15
|
+
/** Coluna de camadas e propriedades: fixa, gaveta ou automático (pela largura do editor). */
|
|
16
|
+
export type LateralEditorPrancha = 'auto' | 'fixa' | 'gaveta';
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { SafeHTMLElement } from '../../core/ssr-safe';
|
|
2
2
|
import { CamadaPrancha, ElementoGrafico } from '../../gerencigeo-canvas/prancha/tipos';
|
|
3
|
+
import { ModoTecladoPrancha } from '../ui-canvas-prancha/prancha-teclado';
|
|
3
4
|
import { UICanvasPrancha } from '../ui-canvas-prancha/ui-canvas-prancha';
|
|
5
|
+
import { LateralEditorPrancha, BarraFormasEditorPrancha } from './editor-tipos';
|
|
4
6
|
/**
|
|
5
7
|
* Editor de prancha completo: a `<ui-canvas-prancha>` com a paleta de ferramentas, o painel de camadas, o painel de
|
|
6
|
-
* propriedades e um menu de pré-definições, já ligados entre si. Pensado para um modal
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
8
|
+
* propriedades e um menu de pré-definições, já ligados entre si. Pensado para um modal: **responsivo ao contêiner**
|
|
9
|
+
* (a largura do próprio editor, não da janela): no modo `barra-formas="auto"`, os botões viram `"Formas ▾"` com menu
|
|
10
|
+
* sempre que transbordariam para uma segunda linha (medido via `ResizeObserver`, um reajuste por quadro e histerese
|
|
11
|
+
* para evitar oscilação); a coluna lateral em `lateral="auto"` vira gaveta abaixo de 720 px (botão "Propriedades" ou
|
|
12
|
+
* Alt+P). O teclado é `isolado` por padrão (nenhuma tecla do editor chega aos atalhos globais do hospedeiro, salvo as
|
|
13
|
+
* do navegador) e o Esc sem nada a cancelar vira `editor-cancelar`. Não grava nada: devolve os dados em
|
|
14
|
+
* `editor-concluir`. Os componentes internos (`ui-paleta-ferramentas`, `ui-camadas`, `ui-tabela-propriedades`) são
|
|
15
|
+
* registrados pelo entrypoint `@thibezer/ui-components-kit/prancha`.
|
|
10
16
|
*
|
|
11
17
|
* @attr {number} largura - Largura da folha em mm (padrão 210).
|
|
12
18
|
* @attr {number} altura - Altura da folha em mm (padrão 297).
|
|
@@ -14,7 +20,9 @@ import { UICanvasPrancha } from '../ui-canvas-prancha/ui-canvas-prancha';
|
|
|
14
20
|
* @attr {number} grade - Passo da grade em mm.
|
|
15
21
|
* @attr {boolean} mostrar-grade - Mostra a grade.
|
|
16
22
|
* @attr {string} ajustar-ao-abrir - `folha` (padrão), `conteudo` ou `nenhum`.
|
|
17
|
-
* @attr {string} teclado - `
|
|
23
|
+
* @attr {string} teclado - `isolado` (padrão), `exclusivo`, `local` ou `modal` (ver `docs/canvas-prancha-eventos.md`).
|
|
24
|
+
* @attr {string} barra-formas - `auto` (padrão: botões em uma linha quando cabem, menu `"Formas ▾"` ao transbordar), `botoes` ou `menu`.
|
|
25
|
+
* @attr {string} lateral - `auto` (padrão: fixa em editor largo >= 720 px, gaveta abaixo), `fixa` ou `gaveta`.
|
|
18
26
|
* @attr {boolean} somente-leitura - Sem edição.
|
|
19
27
|
*
|
|
20
28
|
* @fires editor-concluir - `{ elementos, camadas, modificado }`: o usuário confirmou.
|
|
@@ -22,25 +30,73 @@ import { UICanvasPrancha } from '../ui-canvas-prancha/ui-canvas-prancha';
|
|
|
22
30
|
* @fires prancha-modificado - `{ modificado, revisao }`: sobe da prancha interna (só nas transições).
|
|
23
31
|
*
|
|
24
32
|
* @csspart base - Contêiner raiz.
|
|
25
|
-
* @csspart barra - Barra de pré-definições.
|
|
26
|
-
* @csspart
|
|
33
|
+
* @csspart barra - Barra de pré-definições e do botão da lateral.
|
|
34
|
+
* @csspart menu-formas - O menu "Formas".
|
|
35
|
+
* @csspart lateral - Coluna (ou gaveta) de camadas e propriedades.
|
|
27
36
|
* @csspart acoes - Rodapé com Cancelar e Concluir.
|
|
37
|
+
*
|
|
38
|
+
* @cssprop --ui-editor-prancha-lateral - Largura da lateral (padrão 300px).
|
|
28
39
|
*/
|
|
29
40
|
export declare class UIEditorPrancha extends SafeHTMLElement {
|
|
30
41
|
static get observedAttributes(): string[];
|
|
31
42
|
private readonly shadow;
|
|
32
43
|
private readonly bag;
|
|
33
44
|
private desligarPaineis;
|
|
45
|
+
private observador;
|
|
46
|
+
private rafBarra;
|
|
34
47
|
private readonly _prancha;
|
|
35
48
|
private readonly paleta;
|
|
36
49
|
private readonly painelCamadas;
|
|
37
50
|
private readonly painelPropriedades;
|
|
51
|
+
private readonly raiz;
|
|
52
|
+
private readonly barra;
|
|
53
|
+
private readonly botoesFormas;
|
|
54
|
+
private readonly botaoLateral;
|
|
55
|
+
private readonly botaoFormas;
|
|
56
|
+
private readonly menuFormas;
|
|
57
|
+
private _lateralAberta;
|
|
58
|
+
private estreito;
|
|
59
|
+
private barraColapsada;
|
|
60
|
+
private ultimaLarguraObservada;
|
|
38
61
|
constructor();
|
|
39
62
|
connectedCallback(): void;
|
|
40
63
|
disconnectedCallback(): void;
|
|
41
64
|
attributeChangedCallback(nome: string, _antigo: string | null, valor: string | null): void;
|
|
42
65
|
private repassar;
|
|
43
66
|
private sincronizarAtributos;
|
|
67
|
+
private inserir;
|
|
68
|
+
private itensDoMenu;
|
|
69
|
+
private abrirMenuFormas;
|
|
70
|
+
private fecharMenuFormas;
|
|
71
|
+
private alternarMenuFormas;
|
|
72
|
+
private tecladoDoMenu;
|
|
73
|
+
private iniciarObservador;
|
|
74
|
+
private pararObservador;
|
|
75
|
+
private aoRedimensionar;
|
|
76
|
+
/** Agrupa rajadas de redimensionamento em um único reajuste por quadro (evita loops de ResizeObserver e pisca-pisca). */
|
|
77
|
+
private agendarAjusteBarra;
|
|
78
|
+
/**
|
|
79
|
+
* Reavalia se a barra de formas no modo `auto` cabe em uma linha ou deve colapsar para `"Formas ▾"`.
|
|
80
|
+
* Executado no máximo uma vez por quadro via `ResizeObserver`; pode ser chamado após alterações manuais de rótulos/layout.
|
|
81
|
+
*/
|
|
82
|
+
reajustarBarra(): void;
|
|
83
|
+
private definirBarraColapsada;
|
|
84
|
+
private sincronizarModoBarra;
|
|
85
|
+
private emGaveta;
|
|
86
|
+
private definirLargura;
|
|
87
|
+
private atualizarLateral;
|
|
88
|
+
/** A lateral (camadas e propriedades) está visível? Em modo fixo é sempre `true`; em gaveta, é o estado aberto/fechado. */
|
|
89
|
+
get lateralAberta(): boolean;
|
|
90
|
+
set lateralAberta(v: boolean);
|
|
91
|
+
/** `auto`, `fixa` ou `gaveta`. */
|
|
92
|
+
get lateral(): LateralEditorPrancha;
|
|
93
|
+
set lateral(v: LateralEditorPrancha);
|
|
94
|
+
/** `auto`, `botoes` ou `menu`. */
|
|
95
|
+
get barraFormas(): BarraFormasEditorPrancha;
|
|
96
|
+
set barraFormas(v: BarraFormasEditorPrancha);
|
|
97
|
+
/** `isolado` (padrão), `exclusivo`, `local` ou `modal`. */
|
|
98
|
+
get teclado(): ModoTecladoPrancha;
|
|
99
|
+
set teclado(v: ModoTecladoPrancha);
|
|
44
100
|
/** A prancha interna (para usar a API completa: ferramentas, vista, exportação). */
|
|
45
101
|
get prancha(): UICanvasPrancha;
|
|
46
102
|
/** Elementos do desenho. Ao atribuir, carrega (normaliza) e marca como salvo. */
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare function ehCampoDeTexto(el: Element | null | undefined): boolean;
|
|
2
|
+
/** Elemento atualmente focado, atravessando shadow roots. */
|
|
3
|
+
export declare function elementoFocadoReal(): Element | null;
|
|
1
4
|
/**
|
|
2
5
|
* O alvo real do evento (atravessando shadow roots) é um botão, link ou outro controle acionável?
|
|
3
6
|
* Serve para atalhos globais de Enter: com o foco num botão, o Enter pertence ao botão.
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./kit-base-BmkPi5Rz.cjs");exports.ATRIBUTOS_DEGRADE=r.ATRIBUTOS_DEGRADE;exports.CLASSES_DEGRADE=r.CLASSES_DEGRADE;exports.ListenerBag=r.ListenerBag;exports.PRESETS_DEGRADE=r.PRESETS_DEGRADE;exports.SELETOR_CAMPOS_PADRAO=r.SELETOR_CAMPOS_PADRAO;exports.SafeHTMLElement=r.SafeHTMLElement;exports.TAMANHOS_CONTROLE=r.TAMANHOS_CONTROLE;exports.UIBus=r.UIBus;exports.VARIAVEL_ALTURA_CONTROLE=r.VARIAVEL_ALTURA_CONTROLE;exports.alturaDoTamanho=r.alturaDoTamanho;exports.aplicarAlturaControle=r.aplicarAlturaControle;exports.aplicarDegradeNoElemento=r.aplicarDegradeNoElemento;exports.aplicarValidadeInternals=r.aplicarValidadeInternals;exports.carregarLeaflet=r.carregarLeaflet;exports.chaveDoCampo=r.chaveDoCampo;exports.cliqueVeioDeRotuloExterno=r.cliqueVeioDeRotuloExterno;exports.criarRascunhoFormulario=r.criarRascunhoFormulario;exports.definirCustomElement=r.definirCustomElement;exports.definirValorCampo=r.definirValorCampo;exports.ehAtributoDegrade=r.ehAtributoDegrade;exports.ehCampoMarcavel=r.ehCampoMarcavel;exports.gerarIdUnico=r.gerarIdUnico;exports.gradienteSeguro=r.gradienteSeguro;exports.higienizarSvg=r.higienizarSvg;exports.initZeroJSTriggers=r.initZeroJSTriggers;exports.isBrowser=r.isBrowser;exports.lerEntradaAltura=r.lerEntradaAltura;exports.lerValorCampo=r.lerValorCampo;exports.ligarAtalhosFormulario=r.ligarAtalhosFormulario;exports.limparErros=r.limparErros;exports.listarCampos=r.listarCampos;exports.localizarCampo=r.localizarCampo;exports.normalizarAltura=r.normalizarAltura;exports.normalizarTamanhoControle=r.normalizarTamanhoControle;exports.observarLimpezaDeErros=r.observarLimpezaDeErros;exports.obterLeafletSincrono=r.obterLeafletSincrono;exports.obterRotuloExterno=r.obterRotuloExterno;exports.obterValorAtributoDegrade=r.obterValorAtributoDegrade;exports.preencherCampos=r.preencherCampos;exports.resolverAlturaControle=r.resolverAlturaControle;exports.resolverDegrade=r.resolverDegrade;exports.validarCampos=r.validarCampos;exports.validarRestricoesCampoTexto=r.validarRestricoesCampoTexto;
|
package/dist/core.js
CHANGED
|
@@ -1,57 +1,46 @@
|
|
|
1
|
-
import { U as s } from "./
|
|
2
|
-
import { i as a } from "./zero-js-triggers-CJT988bR.js";
|
|
3
|
-
import { L as l } from "./listener-bag-DQgv7OON.js";
|
|
4
|
-
import { c as m, o as n } from "./leaflet-loader-Cjcdgj5R.js";
|
|
5
|
-
import { S as A, d as E, i as f } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
-
import { a as d, v as u } from "./form-validacao-BlQFxUVj.js";
|
|
7
|
-
import { c as g, g as S, o as D } from "./acessibilidade-CUlSXc2X.js";
|
|
8
|
-
import { T as x, V as T, a as L, b as h, l as v, n as O, c as b, r as V } from "./altura-controle-vxQiXG4q.js";
|
|
9
|
-
import { h as z } from "./svg-seguro-ChVJ2L2z.js";
|
|
10
|
-
import { A as U, C as B, P as M, a as N, e as P, g as G, o as F, r as H } from "./degrade-gDa5sW__.js";
|
|
11
|
-
import { S as w, c as y, a as J, d as Z, e as j, l as k, b as K, f as Q, g as W, h as X, o as Y, p as $, v as aa } from "./form-atalhos-DDTlpgaB.js";
|
|
12
|
-
typeof document < "u" && a();
|
|
1
|
+
import { A as e, C as s, L as o, P as l, k as i, S as t, _ as n, U as m, $ as E, a0 as A, j as C, g as p, W as u, c as D, m as c, p as g, q as R, d as S, r as d, s as T, t as L, u as h, v, Z as O, a as _, i as V, a1 as b, w as f, x as z, y as I, z as x, B, a2 as U, n as G, D as M, o as N, E as P, G as H, H as q, a3 as w, I as F, J, V as Z } from "./kit-base-CBXA66aM.js";
|
|
13
2
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
e as ATRIBUTOS_DEGRADE,
|
|
4
|
+
s as CLASSES_DEGRADE,
|
|
5
|
+
o as ListenerBag,
|
|
6
|
+
l as PRESETS_DEGRADE,
|
|
7
|
+
i as SELETOR_CAMPOS_PADRAO,
|
|
8
|
+
t as SafeHTMLElement,
|
|
9
|
+
n as TAMANHOS_CONTROLE,
|
|
10
|
+
m as UIBus,
|
|
11
|
+
E as VARIAVEL_ALTURA_CONTROLE,
|
|
12
|
+
A as alturaDoTamanho,
|
|
13
|
+
C as aplicarAlturaControle,
|
|
14
|
+
p as aplicarDegradeNoElemento,
|
|
15
|
+
u as aplicarValidadeInternals,
|
|
16
|
+
D as carregarLeaflet,
|
|
17
|
+
c as chaveDoCampo,
|
|
29
18
|
g as cliqueVeioDeRotuloExterno,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
19
|
+
R as criarRascunhoFormulario,
|
|
20
|
+
S as definirCustomElement,
|
|
21
|
+
d as definirValorCampo,
|
|
22
|
+
T as ehAtributoDegrade,
|
|
23
|
+
L as ehCampoMarcavel,
|
|
24
|
+
h as gerarIdUnico,
|
|
25
|
+
v as gradienteSeguro,
|
|
26
|
+
O as higienizarSvg,
|
|
27
|
+
_ as initZeroJSTriggers,
|
|
28
|
+
V as isBrowser,
|
|
29
|
+
b as lerEntradaAltura,
|
|
30
|
+
f as lerValorCampo,
|
|
31
|
+
z as ligarAtalhosFormulario,
|
|
32
|
+
I as limparErros,
|
|
33
|
+
x as listarCampos,
|
|
34
|
+
B as localizarCampo,
|
|
35
|
+
U as normalizarAltura,
|
|
36
|
+
G as normalizarTamanhoControle,
|
|
37
|
+
M as observarLimpezaDeErros,
|
|
38
|
+
N as obterLeafletSincrono,
|
|
39
|
+
P as obterRotuloExterno,
|
|
40
|
+
H as obterValorAtributoDegrade,
|
|
41
|
+
q as preencherCampos,
|
|
42
|
+
w as resolverAlturaControle,
|
|
43
|
+
F as resolverDegrade,
|
|
44
|
+
J as validarCampos,
|
|
45
|
+
Z as validarRestricoesCampoTexto
|
|
57
46
|
};
|