@thibezer/ui-components-kit 2.28.1 → 2.29.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 +46 -0
- package/dist/camadas.cjs +87 -87
- package/dist/camadas.js +1864 -1309
- package/dist/canvas.cjs +42 -42
- package/dist/canvas.js +1713 -1609
- package/dist/components/ui-barra-ferramentas/ribbon-atualizacao.d.ts +10 -0
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +25 -5
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +11 -0
- package/dist/components/ui-camadas/camadas-atualizacao-incremental.d.ts +26 -5
- package/dist/components/ui-camadas/camadas-colecao.d.ts +15 -0
- package/dist/components/ui-camadas/camadas-host.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-janela-dom.d.ts +44 -0
- package/dist/components/ui-camadas/camadas-linha-feicao.d.ts +10 -1
- package/dist/components/ui-camadas/camadas-metricas.d.ts +2 -3
- package/dist/components/ui-camadas/camadas-render.d.ts +19 -2
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +6 -0
- package/dist/components/ui-camadas/camadas-virtual.d.ts +135 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +51 -2
- package/dist/components/ui-canvas-cad/cad-hud-coordenadas.d.ts +12 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +6 -1
- package/dist/custom-elements.json +32278 -30008
- package/dist/feature_caixa-DOchASgS.js +828 -0
- package/dist/feature_caixa-MrJEfMol.cjs +1 -0
- package/dist/{feature_desenho-CC8Mp5Gp.js → feature_desenho-Cq3H27as.js} +2 -2
- package/dist/{feature_desenho-BH-E1Q9Q.cjs → feature_desenho-eq3MIZR9.cjs} +1 -1
- package/dist/feature_metricas-CKQGG2nz.cjs +1 -0
- package/dist/feature_metricas-DGfd21VR.js +130 -0
- package/dist/geometria-px-BlB0OczX.cjs +1 -0
- package/dist/geometria-px-BxTQKrZN.js +577 -0
- package/dist/gerencigeo-canvas/dms.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_adapters.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +1 -4
- package/dist/gerencigeo-canvas/feature_indice.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_lod.d.ts +16 -0
- package/dist/gerencigeo-canvas/motor/dados-camada.d.ts +11 -1
- package/dist/gerencigeo-canvas/motor/geometria-px.d.ts +9 -0
- package/dist/gerencigeo-canvas/motor/motor-formas.d.ts +28 -5
- package/dist/gerencigeo-canvas/motor/tipos.d.ts +7 -3
- package/dist/gerencigeo-canvas/qualidade.d.ts +5 -0
- package/dist/gerencigeo-canvas/renderers/canvas_formas_leaflet.d.ts +10 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_canvas_renderer.d.ts +10 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +7 -0
- package/dist/gerencigeo-canvas/utils.d.ts +1 -3
- package/dist/index.cjs +4 -4
- package/dist/index.js +84 -82
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/motor.cjs +1 -1
- package/dist/motor.js +620 -499
- package/dist/prancha-nucleo.cjs +3 -3
- package/dist/prancha-nucleo.js +283 -282
- package/dist/prancha.cjs +1 -1
- package/dist/prancha.js +3 -3
- package/dist/tools.cjs +5 -5
- package/dist/tools.js +438 -369
- package/dist/utils-B2HuBLwz.js +108 -0
- package/dist/utils-DpPysTeU.cjs +1 -0
- package/package.json +1 -1
- package/dist/feature_caixa-4M4MkFH7.cjs +0 -1
- package/dist/feature_caixa-BVc5LenS.js +0 -824
- package/dist/geometria-px-Cyi_oPD6.cjs +0 -1
- package/dist/geometria-px-DHMPUsxC.js +0 -639
- package/dist/utils-ClVgqVyJ.cjs +0 -1
- package/dist/utils-DrHoxxmf.js +0 -83
package/dist/tools.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ct = Object.defineProperty;
|
|
2
|
+
var ht = (a, s, t) => s in a ? ct(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
|
|
3
|
+
var c = (a, s, t) => ht(a, typeof s != "symbol" ? s + "" : s, t);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { L as $, Z as
|
|
6
|
-
const g = (a) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${a}</svg>`,
|
|
5
|
+
import { L as $, Z as bt, S as et, A as it, g as O, s as rt, d as at } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
const g = (a) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${a}</svg>`, re = {
|
|
7
7
|
selecionar: g('<path d="M4 3l7 17 2.5-7.5L21 10z"/>'),
|
|
8
8
|
mover: g('<path d="M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20"/>'),
|
|
9
9
|
mao: g('<path d="M18 11V6a2 2 0 0 0-4 0M14 10V4a2 2 0 0 0-4 0v2M10 10.5V6a2 2 0 0 0-4 0v8M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.9-5.9-2.4L3.4 16a2 2 0 0 1 3.2-2.4L8 15"/>'),
|
|
@@ -25,42 +25,42 @@ const g = (a) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" str
|
|
|
25
25
|
copiar: g('<rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>'),
|
|
26
26
|
negrito: g('<path d="M6 4h8a4 4 0 0 1 0 8H6zM6 12h9a4 4 0 0 1 0 8H6z"/>'),
|
|
27
27
|
italico: g('<line x1="19" y1="4" x2="10" y2="4"/><line x1="14" y1="20" x2="5" y2="20"/><line x1="15" y1="4" x2="9" y2="20"/>')
|
|
28
|
-
}, ht = ':host{display:block;position:relative;box-sizing:border-box;min-height:122px;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}:host([recolhido]){min-height:31px}.ui-ribbon{display:flex;flex-direction:column;background:var(--ui-degrade-interno, var(--ui-ribbon-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));-webkit-user-select:none;user-select:none}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-ribbon[data-degrade]:not([data-degrade=false]){--ui-ribbon-fundo: var(--ui-gradiente-superficie)}.ui-ribbon__cabecalho{display:flex;align-items:stretch;height:30px;box-sizing:border-box;box-shadow:inset 0 -1px 0 var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__abas{display:flex;flex:1;min-width:0;align-items:flex-end;gap:2px;padding:0 8px;box-sizing:border-box;overflow-x:auto;scrollbar-width:none;background:linear-gradient(to right,var(--ui-cor-superficie, #141417) 20px,transparent) left top / 28px calc(100% - 1px) no-repeat local,linear-gradient(to left,var(--ui-cor-superficie, #141417) 20px,transparent) right top / 28px calc(100% - 1px) no-repeat local,linear-gradient(to right,rgba(0,0,0,.35),transparent) left top / 14px calc(100% - 1px) no-repeat scroll,linear-gradient(to left,rgba(0,0,0,.35),transparent) right top / 14px calc(100% - 1px) no-repeat scroll}.ui-ribbon__abas::-webkit-scrollbar{display:none}.ui-ribbon__aba{position:relative;flex-shrink:0;height:28px;margin-bottom:1px;padding:0 14px;border:0;border-radius:6px 6px 0 0;background:transparent;color:var(--ui-cor-texto-secundario, #888899);font:inherit;font-size:.75rem;font-weight:600;white-space:nowrap;cursor:pointer;transition:background-color .12s ease,color .12s ease}.ui-ribbon__aba:hover{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__aba:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-ribbon__aba--ativa,.ui-ribbon__aba--ativa:hover{height:30px;margin-bottom:0;color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-fundo-elevado, #1a1a1e);box-shadow:inset 1px 0 0 var(--ui-cor-borda, rgba(255, 255, 255, .12)),inset -1px 0 0 var(--ui-cor-borda, rgba(255, 255, 255, .12)),inset 0 1px 0 var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__aba--ativa:after{content:"";position:absolute;inset-inline:8px;bottom:1px;height:2px;border-radius:2px 2px 0 0;background:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__aba--contextual{color:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__aba--contextual:before{content:"";position:absolute;inset-inline:0;top:0;height:2px;border-radius:6px 6px 0 0;background:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__mais-abas{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;align-self:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--ui-raio-sm, 4px);background:transparent;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer}.ui-ribbon__mais-abas[hidden]{display:none}.ui-ribbon__mais-abas:hover,.ui-ribbon__mais-abas[aria-expanded=true]{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__mais-abas:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-ribbon__mais-abas:before{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-2px) rotate(45deg)}.ui-ribbon__fixar{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;align-self:center;width:28px;height:24px;margin-inline:2px 6px;padding:0;border:0;border-radius:var(--ui-raio-sm, 4px);background:transparent;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer}.ui-ribbon__fixar:hover{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__fixar:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-ribbon__fixar:before{content:"";width:6px;height:6px;border:solid currentColor;border-width:2px 0 0 2px;transform:translateY(2px) rotate(45deg)}:host([recolhido]) .ui-ribbon__fixar:before{transform:translateY(-2px) rotate(225deg)}.ui-ribbon__painel{background:var(--ui-cor-fundo-elevado, #1a1a1e);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--ui-cor-borda, rgba(255, 255, 255, .2)) transparent}.ui-ribbon__grupos{display:flex;align-items:stretch;width:max-content;min-width:100%;min-height:92px;padding:4px 8px;box-sizing:border-box}.ui-ribbon__grupo{display:flex;flex-direction:column;justify-content:center;flex-shrink:0;padding:0 var(--ui-espaco-sm, 8px);border-inline-end:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__grupo:last-child{border-inline-end:0}.ui-ribbon__grupo-itens{display:flex;flex:1;align-items:center;gap:var(--ui-espaco-xs, 4px)}.ui-ribbon__grupo-rotulo{position:relative;display:flex;align-items:center;justify-content:center;padding:3px 0 1px;color:var(--ui-cor-texto-secundario, #888899);font-size:.6875rem;line-height:1.2;text-align:center;white-space:nowrap}.ui-ribbon__grupo-rotulo:empty{display:none;padding:0}.ui-ribbon__lancador{position:absolute;right:0;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;padding:0;border:0;background:transparent;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;border-radius:2px;opacity:.7}[dir=rtl] .ui-ribbon__lancador{right:auto;left:0}.ui-ribbon__lancador:hover{opacity:1;color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__lancador:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-1px}.ui-ribbon__grupo--colapsado{padding:0 4px;justify-content:center}.ui-ribbon__btn-colapsado{height:calc(100% - 6px);margin:3px 0}.ui-ribbon__keytip{position:absolute;z-index:100;padding:1px 4px;font-size:.625rem;font-weight:700;line-height:1;color:#111;background:#fef08a;border:1px solid #ca8a04;border-radius:2px;box-shadow:0 1px 3px #0006;pointer-events:none}.ui-ribbon__coluna{display:flex;flex-direction:column;justify-content:center;gap:2px}.ui-ribbon__separador{width:1px;height:68px;align-self:center;margin:0 var(--ui-espaco-xs, 4px);background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ferr-btn--grande{flex-direction:column;min-width:52px;height:76px;padding:6px 8px;gap:3px;box-sizing:border-box;border-radius:var(--ui-raio-borda, 6px);justify-content:center;align-items:center}.ui-ferr-btn--grande .ui-ferr-btn__rotulo{max-width:72px;white-space:normal;text-align:center;line-height:1.15;overflow-wrap:anywhere}.ui-ferr-btn--pequeno{height:24px;padding:0 8px;border-radius:var(--ui-raio-sm, 4px);justify-content:flex-start;box-sizing:border-box}.ui-ferr-btn--pequeno.ui-ferr-btn--so-icone{width:24px;padding:0;justify-content:center}.ui-ferr-split--pequeno{border-radius:var(--ui-raio-sm, 4px)}.ui-ferr-split--pequeno .ui-ferr-split__acao{border-radius:var(--ui-raio-sm, 4px) 0 0 var(--ui-raio-sm, 4px);padding:0 6px 0 8px}.ui-ferr-split--pequeno .ui-ferr-split__gatilho{border-radius:0 var(--ui-raio-sm, 4px) var(--ui-raio-sm, 4px) 0}.ui-ribbon__grupos .ui-ferr-btn:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px;box-shadow:none}:host([recolhido]) .ui-ribbon__painel{display:none;position:absolute;top:100%;inset-inline:0;z-index:var(--ui-z-docked-bar, 600);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .35))}:host([recolhido]) .ui-ribbon--aberto .ui-ribbon__painel{display:block}:host([recolhido]) .ui-ribbon__aba--ativa:after{display:none}:host([compacto]) .ui-ribbon__grupos{min-height:0;padding-block:2px}:host([compacto]) .ui-ribbon__grupo-rotulo{display:none}:host([compacto]) .ui-ferr-btn--grande{min-width:44px}@media (pointer: coarse){.ui-ribbon__cabecalho{height:38px}.ui-ribbon__aba{height:36px}.ui-ribbon__aba--ativa,.ui-ribbon__aba--ativa:hover{height:38px}.ui-ferr-btn--pequeno{height:32px}.ui-ferr-btn--pequeno.ui-ferr-btn--so-icone{width:32px}.ui-ribbon__mais-abas{width:32px;height:32px}.ui-ribbon__fixar{width:36px;height:32px}}@media (prefers-reduced-motion: reduce){.ui-ribbon__aba{transition:none}}@media (forced-colors: active){.ui-ribbon__aba--ativa:after,.ui-ribbon__aba--contextual:before{background:Highlight;forced-color-adjust:none}.ui-ribbon__aba--ativa,.ui-ribbon__aba--ativa:hover{box-shadow:none;border:1px solid CanvasText;border-bottom-color:Canvas}.ui-ribbon__aba:focus-visible,.ui-ribbon__mais-abas:focus-visible,.ui-ribbon__fixar:focus-visible,.ui-ribbon__grupos .ui-ferr-btn:focus-visible{outline-color:Highlight}}', rt = '.ui-ferr-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;padding:0;border:1px solid transparent;border-radius:var(--ui-raio-borda, 6px);background:transparent;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:.75rem;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.ui-ferr-btn:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-btn:active:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent)}.ui-ferr-btn:focus-visible{outline:2px solid transparent;outline-offset:2px;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-ferr-btn:disabled{opacity:.4;cursor:not-allowed}.ui-ferr-btn--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 55%,transparent)}.ui-ferr-btn.ui-ferr-btn--ativo:hover:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 28%,transparent)}.ui-ferr-btn.ui-ferr-btn--ativo:active:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 36%,transparent)}.ui-ferr-btn.ui-ferr-btn--ativo:disabled{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));border-color:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ferr-btn__icone{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.ui-ferr-btn__rotulo{white-space:nowrap}.ui-ferr-btn__caret{width:0;height:0;flex-shrink:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid currentColor;opacity:.7}.ui-ferr-menu{position:fixed;z-index:var(--ui-z-popover, 1050);display:flex;flex-direction:column;gap:1px;min-width:180px;max-height:calc(100vh - 8px);overflow-y:auto;padding:4px;box-sizing:border-box;background:var(--ui-degrade-interno, var(--ui-ferr-menu-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-menu, #18181c))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .35));font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}.ui-ferr-menu__item{position:relative;display:flex;align-items:center;gap:8px;width:100%;height:28px;padding:0 8px;box-sizing:border-box;border:0;border-radius:var(--ui-raio-sm, 4px);background:transparent;color:inherit;font:inherit;font-size:.75rem;text-align:start;cursor:pointer}.ui-ferr-menu__item:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-menu__item:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px;background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-menu__item:disabled{opacity:.4;cursor:not-allowed}.ui-ferr-menu__item--ativo,.ui-ferr-menu__item[aria-checked=true]{color:var(--ui-cor-primaria, #00E08A);font-weight:600}.ui-ferr-menu__item--ativo:after,.ui-ferr-menu__item[aria-checked=true]:after{content:"";flex-shrink:0;width:4px;height:8px;margin-inline-start:4px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg) translateY(-1px)}.ui-ferr-menu__icone{display:inline-flex;width:16px;justify-content:center}.ui-ferr-menu__rotulo{flex:1}.ui-ferr-menu__atalho{margin-inline-start:16px;color:var(--ui-cor-texto-secundario, #888899);font-size:.6875rem;font-variant-numeric:tabular-nums}.ui-ferr-menu__sep{height:1px;margin:3px 2px;background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}@media (pointer: coarse){.ui-ferr-menu__item{height:36px}}@media (prefers-reduced-motion: reduce){.ui-ferr-btn{transition:none}}.ui-ferr-tooltip{position:fixed;z-index:var(--ui-z-tooltip, 1200);pointer-events:none;display:none;align-items:center;gap:6px;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);background:var(--ui-degrade-interno, var(--ui-ferr-tooltip-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-tooltip, #18181c))));color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:.6875rem;line-height:1.2;white-space:nowrap;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));box-shadow:var(--ui-sombra-md, 0 4px 12px rgba(0, 0, 0, .35));opacity:0;transform:translateY(-2px);transition:opacity .12s ease,transform .12s ease}.ui-ferr-tooltip--visivel{display:inline-flex;opacity:1;transform:translateY(0)}.ui-ferr-tooltip__atalho{display:inline-flex;align-items:center;padding:1px 4px;border-radius:3px;background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-size:.625rem;font-weight:600;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08))}.ui-ferr-split{display:inline-flex;align-items:stretch;border-radius:var(--ui-raio-borda, 6px);position:relative}.ui-ferr-split--grande{flex-direction:column}.ui-ferr-split--grande .ui-ferr-split__acao{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui-ferr-split--grande .ui-ferr-split__gatilho{height:16px;width:100%;border-top-left-radius:0;border-top-right-radius:0;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding:0;justify-content:center}.ui-ferr-split--pequeno{flex-direction:row}.ui-ferr-split--pequeno .ui-ferr-split__acao{border-top-right-radius:0;border-bottom-right-radius:0}.ui-ferr-split--pequeno .ui-ferr-split__gatilho{width:16px;height:24px;padding:0;border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));justify-content:center}.ui-ferr-split:hover:not(:has(:disabled)){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-ferr-menu__caret-sub{width:0;height:0;margin-inline-start:auto;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid currentColor;opacity:.7}[dir=rtl] .ui-ferr-menu__caret-sub{border-left:0;border-right:4px solid currentColor}@media (forced-colors: active){.ui-ferr-btn:focus-visible,.ui-ferr-menu__item:focus-visible{outline:2px solid Highlight}.ui-ferr-btn--ativo{background:Highlight;color:HighlightText;border-color:ButtonText;forced-color-adjust:none}.ui-ferr-btn:disabled,.ui-ferr-menu__item:disabled{opacity:1;color:GrayText}.ui-ferr-menu{border-color:CanvasText}.ui-ferr-menu__item:hover:not(:disabled){background:Highlight;color:HighlightText}}';
|
|
28
|
+
}, pt = ':host{display:block;position:relative;box-sizing:border-box;min-height:122px;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}:host([recolhido]){min-height:31px}.ui-ribbon{display:flex;flex-direction:column;background:var(--ui-degrade-interno, var(--ui-ribbon-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));-webkit-user-select:none;user-select:none}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-ribbon[data-degrade]:not([data-degrade=false]){--ui-ribbon-fundo: var(--ui-gradiente-superficie)}.ui-ribbon__cabecalho{display:flex;align-items:stretch;height:30px;box-sizing:border-box;box-shadow:inset 0 -1px 0 var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__abas{display:flex;flex:1;min-width:0;align-items:flex-end;gap:2px;padding:0 8px;box-sizing:border-box;overflow-x:auto;scrollbar-width:none;background:linear-gradient(to right,var(--ui-cor-superficie, #141417) 20px,transparent) left top / 28px calc(100% - 1px) no-repeat local,linear-gradient(to left,var(--ui-cor-superficie, #141417) 20px,transparent) right top / 28px calc(100% - 1px) no-repeat local,linear-gradient(to right,rgba(0,0,0,.35),transparent) left top / 14px calc(100% - 1px) no-repeat scroll,linear-gradient(to left,rgba(0,0,0,.35),transparent) right top / 14px calc(100% - 1px) no-repeat scroll}.ui-ribbon__abas::-webkit-scrollbar{display:none}.ui-ribbon__aba{position:relative;flex-shrink:0;height:28px;margin-bottom:1px;padding:0 14px;border:0;border-radius:6px 6px 0 0;background:transparent;color:var(--ui-cor-texto-secundario, #888899);font:inherit;font-size:.75rem;font-weight:600;white-space:nowrap;cursor:pointer;transition:background-color .12s ease,color .12s ease}.ui-ribbon__aba:hover{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__aba:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-ribbon__aba--ativa,.ui-ribbon__aba--ativa:hover{height:30px;margin-bottom:0;color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-fundo-elevado, #1a1a1e);box-shadow:inset 1px 0 0 var(--ui-cor-borda, rgba(255, 255, 255, .12)),inset -1px 0 0 var(--ui-cor-borda, rgba(255, 255, 255, .12)),inset 0 1px 0 var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__aba--ativa:after{content:"";position:absolute;inset-inline:8px;bottom:1px;height:2px;border-radius:2px 2px 0 0;background:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__aba--contextual{color:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__aba--contextual:before{content:"";position:absolute;inset-inline:0;top:0;height:2px;border-radius:6px 6px 0 0;background:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__mais-abas{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;align-self:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--ui-raio-sm, 4px);background:transparent;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer}.ui-ribbon__mais-abas[hidden]{display:none}.ui-ribbon__mais-abas:hover,.ui-ribbon__mais-abas[aria-expanded=true]{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__mais-abas:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-ribbon__mais-abas:before{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-2px) rotate(45deg)}.ui-ribbon__fixar{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;align-self:center;width:28px;height:24px;margin-inline:2px 6px;padding:0;border:0;border-radius:var(--ui-raio-sm, 4px);background:transparent;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer}.ui-ribbon__fixar:hover{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__fixar:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-ribbon__fixar:before{content:"";width:6px;height:6px;border:solid currentColor;border-width:2px 0 0 2px;transform:translateY(2px) rotate(45deg)}:host([recolhido]) .ui-ribbon__fixar:before{transform:translateY(-2px) rotate(225deg)}.ui-ribbon__painel{background:var(--ui-cor-fundo-elevado, #1a1a1e);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--ui-cor-borda, rgba(255, 255, 255, .2)) transparent}.ui-ribbon__grupos{display:flex;align-items:stretch;width:max-content;min-width:100%;min-height:92px;padding:4px 8px;box-sizing:border-box}.ui-ribbon__grupo{display:flex;flex-direction:column;justify-content:center;flex-shrink:0;padding:0 var(--ui-espaco-sm, 8px);border-inline-end:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__grupo:last-child{border-inline-end:0}.ui-ribbon__grupo-itens{display:flex;flex:1;align-items:center;gap:var(--ui-espaco-xs, 4px)}.ui-ribbon__grupo-rotulo{position:relative;display:flex;align-items:center;justify-content:center;padding:3px 0 1px;color:var(--ui-cor-texto-secundario, #888899);font-size:.6875rem;line-height:1.2;text-align:center;white-space:nowrap}.ui-ribbon__grupo-rotulo:empty{display:none;padding:0}.ui-ribbon__lancador{position:absolute;right:0;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;padding:0;border:0;background:transparent;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;border-radius:2px;opacity:.7}[dir=rtl] .ui-ribbon__lancador{right:auto;left:0}.ui-ribbon__lancador:hover{opacity:1;color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ribbon__lancador:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-1px}.ui-ribbon__grupo--colapsado{padding:0 4px;justify-content:center}.ui-ribbon__btn-colapsado{height:calc(100% - 6px);margin:3px 0}.ui-ribbon__keytip{position:absolute;z-index:100;padding:1px 4px;font-size:.625rem;font-weight:700;line-height:1;color:#111;background:#fef08a;border:1px solid #ca8a04;border-radius:2px;box-shadow:0 1px 3px #0006;pointer-events:none}.ui-ribbon__coluna{display:flex;flex-direction:column;justify-content:center;gap:2px}.ui-ribbon__separador{width:1px;height:68px;align-self:center;margin:0 var(--ui-espaco-xs, 4px);background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ferr-btn--grande{flex-direction:column;min-width:52px;height:76px;padding:6px 8px;gap:3px;box-sizing:border-box;border-radius:var(--ui-raio-borda, 6px);justify-content:center;align-items:center}.ui-ferr-btn--grande .ui-ferr-btn__rotulo{max-width:72px;white-space:normal;text-align:center;line-height:1.15;overflow-wrap:anywhere}.ui-ferr-btn--pequeno{height:24px;padding:0 8px;border-radius:var(--ui-raio-sm, 4px);justify-content:flex-start;box-sizing:border-box}.ui-ferr-btn--pequeno.ui-ferr-btn--so-icone{width:24px;padding:0;justify-content:center}.ui-ferr-split--pequeno{border-radius:var(--ui-raio-sm, 4px)}.ui-ferr-split--pequeno .ui-ferr-split__acao{border-radius:var(--ui-raio-sm, 4px) 0 0 var(--ui-raio-sm, 4px);padding:0 6px 0 8px}.ui-ferr-split--pequeno .ui-ferr-split__gatilho{border-radius:0 var(--ui-raio-sm, 4px) var(--ui-raio-sm, 4px) 0}.ui-ribbon__grupos .ui-ferr-btn:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px;box-shadow:none}:host([recolhido]) .ui-ribbon__painel{display:none;position:absolute;top:100%;inset-inline:0;z-index:var(--ui-z-docked-bar, 600);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .35))}:host([recolhido]) .ui-ribbon--aberto .ui-ribbon__painel{display:block}:host([recolhido]) .ui-ribbon__aba--ativa:after{display:none}:host([compacto]) .ui-ribbon__grupos{min-height:0;padding-block:2px}:host([compacto]) .ui-ribbon__grupo-rotulo{display:none}:host([compacto]) .ui-ferr-btn--grande{min-width:44px}@media (pointer: coarse){.ui-ribbon__cabecalho{height:38px}.ui-ribbon__aba{height:36px}.ui-ribbon__aba--ativa,.ui-ribbon__aba--ativa:hover{height:38px}.ui-ferr-btn--pequeno{height:32px}.ui-ferr-btn--pequeno.ui-ferr-btn--so-icone{width:32px}.ui-ribbon__mais-abas{width:32px;height:32px}.ui-ribbon__fixar{width:36px;height:32px}}@media (prefers-reduced-motion: reduce){.ui-ribbon__aba{transition:none}}@media (forced-colors: active){.ui-ribbon__aba--ativa:after,.ui-ribbon__aba--contextual:before{background:Highlight;forced-color-adjust:none}.ui-ribbon__aba--ativa,.ui-ribbon__aba--ativa:hover{box-shadow:none;border:1px solid CanvasText;border-bottom-color:Canvas}.ui-ribbon__aba:focus-visible,.ui-ribbon__mais-abas:focus-visible,.ui-ribbon__fixar:focus-visible,.ui-ribbon__grupos .ui-ferr-btn:focus-visible{outline-color:Highlight}}', ot = '.ui-ferr-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;padding:0;border:1px solid transparent;border-radius:var(--ui-raio-borda, 6px);background:transparent;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:.75rem;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.ui-ferr-btn:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-btn:active:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent)}.ui-ferr-btn:focus-visible{outline:2px solid transparent;outline-offset:2px;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-ferr-btn:disabled{opacity:.4;cursor:not-allowed}.ui-ferr-btn--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 55%,transparent)}.ui-ferr-btn.ui-ferr-btn--ativo:hover:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 28%,transparent)}.ui-ferr-btn.ui-ferr-btn--ativo:active:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 36%,transparent)}.ui-ferr-btn.ui-ferr-btn--ativo:disabled{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));border-color:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ferr-btn__icone{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.ui-ferr-btn__rotulo{white-space:nowrap}.ui-ferr-btn__caret{width:0;height:0;flex-shrink:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid currentColor;opacity:.7}.ui-ferr-menu{position:fixed;z-index:var(--ui-z-popover, 1050);display:flex;flex-direction:column;gap:1px;min-width:180px;max-height:calc(100vh - 8px);overflow-y:auto;padding:4px;box-sizing:border-box;background:var(--ui-degrade-interno, var(--ui-ferr-menu-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-menu, #18181c))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);box-shadow:var(--ui-sombra-lg, 0 8px 24px rgba(0, 0, 0, .35));font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}.ui-ferr-menu__item{position:relative;display:flex;align-items:center;gap:8px;width:100%;height:28px;padding:0 8px;box-sizing:border-box;border:0;border-radius:var(--ui-raio-sm, 4px);background:transparent;color:inherit;font:inherit;font-size:.75rem;text-align:start;cursor:pointer}.ui-ferr-menu__item:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-menu__item:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px;background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-menu__item:disabled{opacity:.4;cursor:not-allowed}.ui-ferr-menu__item--ativo,.ui-ferr-menu__item[aria-checked=true]{color:var(--ui-cor-primaria, #00E08A);font-weight:600}.ui-ferr-menu__item--ativo:after,.ui-ferr-menu__item[aria-checked=true]:after{content:"";flex-shrink:0;width:4px;height:8px;margin-inline-start:4px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg) translateY(-1px)}.ui-ferr-menu__icone{display:inline-flex;width:16px;justify-content:center}.ui-ferr-menu__rotulo{flex:1}.ui-ferr-menu__atalho{margin-inline-start:16px;color:var(--ui-cor-texto-secundario, #888899);font-size:.6875rem;font-variant-numeric:tabular-nums}.ui-ferr-menu__sep{height:1px;margin:3px 2px;background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}@media (pointer: coarse){.ui-ferr-menu__item{height:36px}}@media (prefers-reduced-motion: reduce){.ui-ferr-btn{transition:none}}.ui-ferr-tooltip{position:fixed;z-index:var(--ui-z-tooltip, 1200);pointer-events:none;display:none;align-items:center;gap:6px;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);background:var(--ui-degrade-interno, var(--ui-ferr-tooltip-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-tooltip, #18181c))));color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:.6875rem;line-height:1.2;white-space:nowrap;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));box-shadow:var(--ui-sombra-md, 0 4px 12px rgba(0, 0, 0, .35));opacity:0;transform:translateY(-2px);transition:opacity .12s ease,transform .12s ease}.ui-ferr-tooltip--visivel{display:inline-flex;opacity:1;transform:translateY(0)}.ui-ferr-tooltip__atalho{display:inline-flex;align-items:center;padding:1px 4px;border-radius:3px;background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-size:.625rem;font-weight:600;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08))}.ui-ferr-split{display:inline-flex;align-items:stretch;border-radius:var(--ui-raio-borda, 6px);position:relative}.ui-ferr-split--grande{flex-direction:column}.ui-ferr-split--grande .ui-ferr-split__acao{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui-ferr-split--grande .ui-ferr-split__gatilho{height:16px;width:100%;border-top-left-radius:0;border-top-right-radius:0;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding:0;justify-content:center}.ui-ferr-split--pequeno{flex-direction:row}.ui-ferr-split--pequeno .ui-ferr-split__acao{border-top-right-radius:0;border-bottom-right-radius:0}.ui-ferr-split--pequeno .ui-ferr-split__gatilho{width:16px;height:24px;padding:0;border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));justify-content:center}.ui-ferr-split:hover:not(:has(:disabled)){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-ferr-menu__caret-sub{width:0;height:0;margin-inline-start:auto;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid currentColor;opacity:.7}[dir=rtl] .ui-ferr-menu__caret-sub{border-left:0;border-right:4px solid currentColor}@media (forced-colors: active){.ui-ferr-btn:focus-visible,.ui-ferr-menu__item:focus-visible{outline:2px solid Highlight}.ui-ferr-btn--ativo{background:Highlight;color:HighlightText;border-color:ButtonText;forced-color-adjust:none}.ui-ferr-btn:disabled,.ui-ferr-menu__item:disabled{opacity:1;color:GrayText}.ui-ferr-menu{border-color:CanvasText}.ui-ferr-menu__item:hover:not(:disabled){background:Highlight;color:HighlightText}}';
|
|
29
29
|
function N(a, s) {
|
|
30
30
|
if (!a) return null;
|
|
31
31
|
const t = document.createElement("ui-icone");
|
|
32
32
|
if (t.setAttribute("tamanho", String(s)), a.trimStart().startsWith("<")) {
|
|
33
|
-
const e =
|
|
33
|
+
const e = bt(a);
|
|
34
34
|
if (!e) return null;
|
|
35
35
|
t.appendChild(e);
|
|
36
36
|
} else
|
|
37
37
|
t.setAttribute("nome", a);
|
|
38
38
|
return t;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
function
|
|
42
|
-
return a.rotuloAcessivel ? a.rotuloAcessivel : a.rotulo ? a.rotulo : a.icone && !a.icone.trimStart().startsWith("<") ? a.icone : (
|
|
40
|
+
const Z = /* @__PURE__ */ new Set();
|
|
41
|
+
function k(a) {
|
|
42
|
+
return a.rotuloAcessivel ? a.rotuloAcessivel : a.rotulo ? a.rotulo : a.icone && !a.icone.trimStart().startsWith("<") ? a.icone : (Z.has(a.id) || (Z.add(a.id), console.warn(`[ui-barra-ferramentas] O item "${a.id}" não tem "rotulo" nem "rotuloAcessivel": o id será usado como nome acessível.`)), a.id);
|
|
43
43
|
}
|
|
44
44
|
function H(a, s) {
|
|
45
45
|
const t = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Set();
|
|
46
46
|
a.forEach((i) => t.has(i) ? e.add(i) : t.add(i)), e.size && console.warn(`[ui-barra-ferramentas] ${s}: ids duplicados (${[...e].join(", ")}). Use ids únicos, senão atualizarItem() e os eventos podem atingir o item errado.`);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function W(a, s = []) {
|
|
49
49
|
for (const t of a)
|
|
50
|
-
t.tipo !== "separador" && (s.push(t.id), t.filhos &&
|
|
50
|
+
t.tipo !== "separador" && (s.push(t.id), t.filhos && W(t.filhos, s));
|
|
51
51
|
return s;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function M(a, s) {
|
|
54
54
|
a.disabled = !!s.disabled;
|
|
55
55
|
const t = s.tipo, e = t === "toggle" || t === "ferramenta";
|
|
56
56
|
e ? a.setAttribute("aria-pressed", String(!!s.ativo)) : a.removeAttribute("aria-pressed"), a.classList.toggle("ui-ferr-btn--ativo", e && !!s.ativo);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function q(a, s, t) {
|
|
59
59
|
var n;
|
|
60
60
|
const e = document.createElement("button");
|
|
61
61
|
e.type = "button", e.className = `ui-ferr-btn ui-ferr-btn--${s}`, e.dataset.id = a.id, e.tabIndex = -1;
|
|
62
62
|
const i = !!((n = a.filhos) != null && n.length), r = s !== "paleta" && !a.somenteIcone && !!a.rotulo;
|
|
63
|
-
a.rotuloAcessivel ? e.setAttribute("aria-label", a.rotuloAcessivel) : r ? e.removeAttribute("aria-label") : e.setAttribute("aria-label",
|
|
63
|
+
a.rotuloAcessivel ? e.setAttribute("aria-label", a.rotuloAcessivel) : r ? e.removeAttribute("aria-label") : e.setAttribute("aria-label", k(a)), a.atalho && e.setAttribute("aria-keyshortcuts", a.atalho), e.dataset.tooltip = k(a), a.atalho && (e.dataset.atalho = a.atalho);
|
|
64
64
|
const o = N(a.icone, t);
|
|
65
65
|
if (o) {
|
|
66
66
|
const u = document.createElement("span");
|
|
@@ -79,45 +79,45 @@ function O(a, s, t) {
|
|
|
79
79
|
}
|
|
80
80
|
e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false");
|
|
81
81
|
}
|
|
82
|
-
return
|
|
82
|
+
return M(e, a), e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function ft(a, s, t) {
|
|
85
85
|
const e = document.createElement("div");
|
|
86
86
|
e.className = `ui-ferr-split ui-ferr-split--${s}`, e.dataset.id = a.id;
|
|
87
|
-
const i =
|
|
87
|
+
const i = q({ ...a, filhos: void 0, dividido: !1 }, s, t);
|
|
88
88
|
i.classList.add("ui-ferr-split__acao"), i.dataset.split = "acao";
|
|
89
89
|
const r = document.createElement("button");
|
|
90
|
-
r.type = "button", r.className = `ui-ferr-btn ui-ferr-split__gatilho ui-ferr-btn--${s}`, r.dataset.id = a.id, r.dataset.split = "gatilho", r.tabIndex = -1, r.disabled = !!a.disabled, r.setAttribute("aria-haspopup", "menu"), r.setAttribute("aria-expanded", "false"), r.setAttribute("aria-label", `Opções de ${
|
|
90
|
+
r.type = "button", r.className = `ui-ferr-btn ui-ferr-split__gatilho ui-ferr-btn--${s}`, r.dataset.id = a.id, r.dataset.split = "gatilho", r.tabIndex = -1, r.disabled = !!a.disabled, r.setAttribute("aria-haspopup", "menu"), r.setAttribute("aria-expanded", "false"), r.setAttribute("aria-label", `Opções de ${k(a)}`), r.dataset.tooltip = `Opções de ${k(a)}`;
|
|
91
91
|
const o = document.createElement("span");
|
|
92
92
|
return o.className = "ui-ferr-btn__caret", r.appendChild(o), e.appendChild(i), e.appendChild(r), e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function y(a, s) {
|
|
95
95
|
for (const t of a) {
|
|
96
96
|
if (t.id === s) return t;
|
|
97
97
|
if (t.filhos) {
|
|
98
|
-
const e =
|
|
98
|
+
const e = y(t.filhos, s);
|
|
99
99
|
if (e) return e;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function st(a, s) {
|
|
104
104
|
if (!s || !s.trim()) return !1;
|
|
105
|
-
const t = s.split("+").map((b) => b.trim()), e = t[t.length - 1], i = t.some((b) => /^(ctrl|control|cmd|meta)$/i.test(b)), r = t.some((b) => /^alt$/i.test(b)), o = t.some((b) => /^shift$/i.test(b)), n = a.ctrlKey || a.metaKey, u = a.altKey,
|
|
106
|
-
if (i !== n || r !== u || o !==
|
|
107
|
-
const l = e.toLowerCase(),
|
|
108
|
-
return l === "esc" || l === "escape" ?
|
|
105
|
+
const t = s.split("+").map((b) => b.trim()), e = t[t.length - 1], i = t.some((b) => /^(ctrl|control|cmd|meta)$/i.test(b)), r = t.some((b) => /^alt$/i.test(b)), o = t.some((b) => /^shift$/i.test(b)), n = a.ctrlKey || a.metaKey, u = a.altKey, h = a.shiftKey;
|
|
106
|
+
if (i !== n || r !== u || o !== h) return !1;
|
|
107
|
+
const l = e.toLowerCase(), d = (a.key || "").toLowerCase();
|
|
108
|
+
return l === "esc" || l === "escape" ? d === "escape" : l === "del" || l === "delete" ? d === "delete" : l === "enter" ? d === "enter" : l === "space" || l === "espaço" ? d === " " || d === "space" : d === l;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function U(a) {
|
|
111
111
|
const s = a.filter((t) => !t.disabled);
|
|
112
112
|
a.forEach((t) => t.tabIndex = -1), s.length && (s[0].tabIndex = 0);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function nt(a) {
|
|
115
115
|
const s = a.find((t) => t.tabIndex === 0 && !t.disabled);
|
|
116
116
|
s ? a.forEach((t) => {
|
|
117
117
|
t !== s && (t.tabIndex = -1);
|
|
118
|
-
}) :
|
|
118
|
+
}) : U(a);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function lt(a, s) {
|
|
121
121
|
const t = a.find((e) => e === s || e.contains(s));
|
|
122
122
|
!t || t.disabled || a.forEach((e) => e.tabIndex = e === t ? 0 : -1);
|
|
123
123
|
}
|
|
@@ -132,7 +132,7 @@ function G(a, s, t, e) {
|
|
|
132
132
|
else return !1;
|
|
133
133
|
return a.preventDefault(), s.forEach((u) => u.tabIndex = -1), i[n].tabIndex = 0, i[n].focus(), !0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function mt(a, s, t = !1) {
|
|
136
136
|
const e = s.filter((u) => !u.disabled), i = e.length, r = e.findIndex((u) => u === a.target);
|
|
137
137
|
if (i === 0 || r < 0) return !1;
|
|
138
138
|
let o = r;
|
|
@@ -153,16 +153,16 @@ function pt(a, s, t = !1) {
|
|
|
153
153
|
return !1;
|
|
154
154
|
return a.preventDefault(), s.forEach((u) => u.tabIndex = -1), e[o].tabIndex = 0, e[o].focus(), !0;
|
|
155
155
|
}
|
|
156
|
-
let
|
|
157
|
-
class
|
|
156
|
+
let vt = 0;
|
|
157
|
+
class ut {
|
|
158
158
|
constructor(s, t) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
c(this, "el");
|
|
160
|
+
c(this, "textoEl");
|
|
161
|
+
c(this, "atalhoEl");
|
|
162
|
+
c(this, "timer");
|
|
163
|
+
c(this, "alvoAtual", null);
|
|
164
|
+
c(this, "id", `ui-ferr-tooltip-${++vt}`);
|
|
165
|
+
c(this, "listeners", new $());
|
|
166
166
|
this.raiz = s, this.el = document.createElement("div"), this.el.className = "ui-ferr-tooltip", this.el.id = this.id, this.el.setAttribute("role", "tooltip"), this.el.setAttribute("aria-hidden", "true"), this.textoEl = document.createElement("span"), this.textoEl.className = "ui-ferr-tooltip__texto", this.atalhoEl = document.createElement("kbd"), this.atalhoEl.className = "ui-ferr-tooltip__atalho", this.el.appendChild(this.textoEl), this.el.appendChild(this.atalhoEl), this.raiz.appendChild(this.el), this.listeners.add(t, "pointerover", (e) => {
|
|
167
167
|
const i = e.target.closest(".ui-ferr-btn, .ui-ribbon__fixar, .ui-ribbon__lancador");
|
|
168
168
|
if (i && i !== this.alvoAtual) {
|
|
@@ -200,101 +200,101 @@ class nt {
|
|
|
200
200
|
this.esconder(), this.listeners.cleanup(), this.el.remove();
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
let
|
|
204
|
-
function
|
|
205
|
-
var
|
|
203
|
+
let gt = 0;
|
|
204
|
+
function D(a, s, t, e, i = {}) {
|
|
205
|
+
var L;
|
|
206
206
|
const r = i.lado ?? "baixo", o = new $(), n = document.createElement("div");
|
|
207
|
-
n.className = "ui-ferr-menu", n.setAttribute("role", "menu"), n.id = `ui-ferr-menu-${++
|
|
207
|
+
n.className = "ui-ferr-menu", n.setAttribute("role", "menu"), n.id = `ui-ferr-menu-${++gt}`, n.setAttribute("aria-label", s.getAttribute("aria-label") || "Menu"), s.setAttribute("aria-controls", n.id);
|
|
208
208
|
const u = [];
|
|
209
|
-
let
|
|
210
|
-
const
|
|
209
|
+
let h = !1, l = null;
|
|
210
|
+
const d = () => {
|
|
211
211
|
l && (l.fechar(), l = null);
|
|
212
212
|
}, b = () => {
|
|
213
213
|
var p;
|
|
214
|
-
|
|
215
|
-
},
|
|
214
|
+
h || (h = !0, d(), s.removeAttribute("aria-controls"), o.cleanup(), n.remove(), (p = i.onFechar) == null || p.call(i));
|
|
215
|
+
}, v = getComputedStyle(s).direction === "rtl";
|
|
216
216
|
t.forEach((p) => {
|
|
217
|
-
var
|
|
217
|
+
var Y;
|
|
218
218
|
if (p.tipo === "separador") {
|
|
219
|
-
const
|
|
220
|
-
|
|
219
|
+
const w = document.createElement("div");
|
|
220
|
+
w.className = "ui-ferr-menu__sep", w.setAttribute("role", "separator"), n.appendChild(w);
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
223
|
const f = document.createElement("button");
|
|
224
224
|
f.type = "button", f.className = "ui-ferr-menu__item";
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
const
|
|
234
|
-
|
|
225
|
+
const z = p.tipo ?? i.tipoPadrao ?? "botao";
|
|
226
|
+
z === "toggle" ? (f.setAttribute("role", "menuitemcheckbox"), f.setAttribute("aria-checked", String(!!p.ativo))) : z === "ferramenta" ? (f.setAttribute("role", "menuitemradio"), f.setAttribute("aria-checked", String(!!p.ativo))) : f.setAttribute("role", "menuitem"), f.dataset.id = p.id, f.disabled = !!p.disabled, p.atalho && f.setAttribute("aria-keyshortcuts", p.atalho), p.ativo && f.classList.add("ui-ferr-menu__item--ativo");
|
|
227
|
+
const R = document.createElement("span");
|
|
228
|
+
R.className = "ui-ferr-menu__icone";
|
|
229
|
+
const F = N(p.icone, 14);
|
|
230
|
+
F && R.appendChild(F), f.appendChild(R);
|
|
231
|
+
const E = document.createElement("span");
|
|
232
|
+
if (E.className = "ui-ferr-menu__rotulo", E.textContent = k(p), f.appendChild(E), p.atalho) {
|
|
233
|
+
const w = document.createElement("span");
|
|
234
|
+
w.className = "ui-ferr-menu__atalho", w.textContent = p.atalho, f.appendChild(w);
|
|
235
235
|
}
|
|
236
|
-
if (!!((
|
|
236
|
+
if (!!((Y = p.filhos) != null && Y.length)) {
|
|
237
237
|
f.classList.add("ui-ferr-menu__item--has-sub"), f.setAttribute("aria-haspopup", "menu"), f.setAttribute("aria-expanded", "false");
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
(l == null ? void 0 : l.ancora) !== f && (
|
|
242
|
-
lado:
|
|
243
|
-
focar:
|
|
238
|
+
const w = document.createElement("span");
|
|
239
|
+
w.className = "ui-ferr-menu__caret-sub", f.appendChild(w);
|
|
240
|
+
const X = (B) => {
|
|
241
|
+
(l == null ? void 0 : l.ancora) !== f && (d(), f.setAttribute("aria-expanded", "true"), l = D(a, f, p.filhos, e, {
|
|
242
|
+
lado: v ? "esquerda" : "direita",
|
|
243
|
+
focar: B,
|
|
244
244
|
tipoPadrao: i.tipoPadrao,
|
|
245
245
|
onFechar: () => {
|
|
246
246
|
f.setAttribute("aria-expanded", "false"), l = null;
|
|
247
247
|
}
|
|
248
248
|
}));
|
|
249
249
|
};
|
|
250
|
-
f.addEventListener("pointerenter", () =>
|
|
251
|
-
|
|
250
|
+
f.addEventListener("pointerenter", () => X(!1)), f.addEventListener("click", (B) => {
|
|
251
|
+
B.stopPropagation(), X(!0);
|
|
252
252
|
});
|
|
253
253
|
} else
|
|
254
|
-
f.addEventListener("pointerenter",
|
|
255
|
-
|
|
254
|
+
f.addEventListener("pointerenter", d), f.addEventListener("click", (w) => {
|
|
255
|
+
w.stopPropagation(), b(), s.focus(), e(p);
|
|
256
256
|
});
|
|
257
257
|
u.push(f), n.appendChild(f);
|
|
258
258
|
}), a.appendChild(n);
|
|
259
|
-
const x = s.getBoundingClientRect(),
|
|
260
|
-
let
|
|
261
|
-
|
|
259
|
+
const x = s.getBoundingClientRect(), m = n.getBoundingClientRect();
|
|
260
|
+
let A = r === "baixo" ? x.bottom + 2 : x.top, C = r === "direita" ? x.right + 4 : r === "esquerda" ? x.left - m.width - 4 : v ? x.right - m.width : x.left;
|
|
261
|
+
m.width && C + m.width > window.innerWidth - 4 && (C = Math.max(4, window.innerWidth - m.width - 4)), C < 4 && (C = 4), m.height && A + m.height > window.innerHeight - 4 && (A = Math.max(4, window.innerHeight - m.height - 4)), n.style.top = `${A}px`, n.style.left = `${C}px`;
|
|
262
262
|
const S = () => u.filter((p) => !p.disabled);
|
|
263
263
|
return o.add(n, "keydown", (p) => {
|
|
264
|
-
const f = S(),
|
|
264
|
+
const f = S(), z = f.findIndex((E) => E === p.target), R = v ? "ArrowLeft" : "ArrowRight", F = v ? "ArrowRight" : "ArrowLeft";
|
|
265
265
|
if (p.key === "Escape")
|
|
266
266
|
p.preventDefault(), p.stopPropagation(), b(), s.focus();
|
|
267
267
|
else if (p.key === "Tab")
|
|
268
268
|
b();
|
|
269
269
|
else if (f.length && (p.key === "ArrowDown" || p.key === "ArrowUp")) {
|
|
270
|
-
p.preventDefault(),
|
|
271
|
-
const
|
|
272
|
-
f[(
|
|
273
|
-
} else if (f.length && p.key ===
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
} else p.key ===
|
|
270
|
+
p.preventDefault(), d();
|
|
271
|
+
const E = p.key === "ArrowDown" ? 1 : -1;
|
|
272
|
+
f[(z + E + f.length) % f.length].focus();
|
|
273
|
+
} else if (f.length && p.key === R) {
|
|
274
|
+
const E = f[z];
|
|
275
|
+
E != null && E.classList.contains("ui-ferr-menu__item--has-sub") && (p.preventDefault(), E.click());
|
|
276
|
+
} else p.key === F && (r === "direita" || r === "esquerda") ? (p.preventDefault(), p.stopPropagation(), b(), s.focus()) : f.length && p.key === "Home" ? (p.preventDefault(), f[0].focus()) : f.length && p.key === "End" && (p.preventDefault(), f[f.length - 1].focus());
|
|
277
277
|
}), o.add(document, "pointerdown", (p) => {
|
|
278
278
|
const f = p.composedPath();
|
|
279
279
|
!f.includes(n) && !f.includes(s) && !(l != null && l.elemento.contains(p.target)) && b();
|
|
280
280
|
}, !0), o.add(window, "resize", b), o.add(window, "scroll", (p) => {
|
|
281
281
|
p.target instanceof Node && n.contains(p.target) || b();
|
|
282
|
-
}, !0), i.focar && ((
|
|
282
|
+
}, !0), i.focar && ((L = S()[0]) == null || L.focus()), { elemento: n, ancora: s, fechar: b, focarPrimeiro: () => {
|
|
283
283
|
var p;
|
|
284
284
|
return (p = S()[0]) == null ? void 0 : p.focus();
|
|
285
285
|
} };
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
function
|
|
287
|
+
const xt = 3;
|
|
288
|
+
function _t({ aba: a, ativa: s, idBotao: t, idPainel: e }) {
|
|
289
289
|
const i = document.createElement("button");
|
|
290
290
|
return i.type = "button", i.className = "ui-ribbon__aba", i.setAttribute("role", "tab"), i.dataset.id = a.id, i.id = t, s && i.setAttribute("aria-controls", e), i.textContent = a.rotulo, i.tabIndex = s ? 0 : -1, i.setAttribute("aria-selected", String(s)), i.classList.toggle("ui-ribbon__aba--ativa", s), i.classList.toggle("ui-ribbon__aba--contextual", !!a.contextual), i;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
function
|
|
292
|
+
const At = '<svg viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16" stroke="currentColor" stroke-width="2" fill="none"/></svg>', yt = '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4 12h8V4M12 12l-7-7"/></svg>', Et = (a) => a.rotuloLancador || `Mais opções de ${a.rotulo || "ferramentas"}`;
|
|
293
|
+
function wt(a, s) {
|
|
294
294
|
s.classList.add("ui-ribbon__grupo--colapsado");
|
|
295
295
|
const t = document.createElement("button");
|
|
296
296
|
t.type = "button", t.className = "ui-ferr-btn ui-ferr-btn--grande ui-ribbon__btn-colapsado", t.dataset.grupoColapsado = a.id, t.dataset.tooltip = a.rotulo, t.setAttribute("aria-haspopup", "menu"), t.setAttribute("aria-expanded", "false");
|
|
297
|
-
const e = N(a.icone, 24) || N(
|
|
297
|
+
const e = N(a.icone, 24) || N(At, 24);
|
|
298
298
|
if (e) {
|
|
299
299
|
const o = document.createElement("span");
|
|
300
300
|
o.className = "ui-ferr-btn__icone", o.appendChild(e), t.appendChild(o);
|
|
@@ -304,138 +304,162 @@ function yt(a, s) {
|
|
|
304
304
|
const r = document.createElement("span");
|
|
305
305
|
return r.className = "ui-ferr-btn__caret", t.appendChild(r), s.appendChild(t), s;
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function Ct(a, s, t = {}) {
|
|
308
308
|
const e = document.createElement("div");
|
|
309
|
-
if (e.className = "ui-ribbon__grupo", e.setAttribute("role", "group"), e.setAttribute("aria-label", a.rotulo), e.dataset.id = a.id, t.colapsado) return
|
|
309
|
+
if (e.className = "ui-ribbon__grupo", e.setAttribute("role", "group"), e.setAttribute("aria-label", a.rotulo), e.dataset.id = a.id, t.colapsado) return wt(a, e);
|
|
310
310
|
t.reduzido && e.classList.add("ui-ribbon__grupo--reduzido");
|
|
311
|
-
const i = (
|
|
312
|
-
var
|
|
313
|
-
const b = t.reduzido && l === "pequeno" &&
|
|
314
|
-
return b.dividido && ((
|
|
311
|
+
const i = (h, l, d) => {
|
|
312
|
+
var v;
|
|
313
|
+
const b = t.reduzido && l === "pequeno" && h.icone && !h.somenteIcone ? { ...h, somenteIcone: !0 } : h;
|
|
314
|
+
return b.dividido && ((v = b.filhos) != null && v.length) && t.criarDividido ? t.criarDividido(b, l, d) : s(b, l, d);
|
|
315
315
|
}, r = document.createElement("div");
|
|
316
316
|
r.className = "ui-ribbon__grupo-itens";
|
|
317
317
|
let o = null, n = 0;
|
|
318
318
|
const u = () => {
|
|
319
319
|
o && r.appendChild(o), o = null, n = 0;
|
|
320
320
|
};
|
|
321
|
-
if (a.itens.forEach((
|
|
322
|
-
if (
|
|
321
|
+
if (a.itens.forEach((h) => {
|
|
322
|
+
if (h.tipo === "separador") {
|
|
323
323
|
u();
|
|
324
324
|
const l = document.createElement("div");
|
|
325
325
|
l.className = "ui-ribbon__separador", l.setAttribute("role", "separator"), r.appendChild(l);
|
|
326
|
-
} else
|
|
326
|
+
} else h.tamanho === "grande" ? (u(), r.appendChild(i(h, "grande", 24))) : (o || (o = document.createElement("div"), o.className = "ui-ribbon__coluna"), o.appendChild(i(h, "pequeno", 16)), ++n === xt && u());
|
|
327
327
|
}), u(), a.rotulo || a.lancadorDialogo) {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
328
|
+
const h = document.createElement("div");
|
|
329
|
+
if (h.className = "ui-ribbon__grupo-rotulo", a.rotulo && (h.textContent = a.rotulo), a.lancadorDialogo) {
|
|
330
330
|
const l = document.createElement("button");
|
|
331
331
|
l.type = "button", l.className = "ui-ribbon__lancador", l.dataset.lancador = a.id;
|
|
332
|
-
const
|
|
333
|
-
l.setAttribute("aria-label",
|
|
334
|
-
const b = N(
|
|
335
|
-
b && l.appendChild(b),
|
|
332
|
+
const d = Et(a);
|
|
333
|
+
l.setAttribute("aria-label", d), l.dataset.tooltip = d;
|
|
334
|
+
const b = N(yt, 10);
|
|
335
|
+
b && l.appendChild(b), h.appendChild(l);
|
|
336
336
|
}
|
|
337
|
-
return e.appendChild(r), e.appendChild(
|
|
337
|
+
return e.appendChild(r), e.appendChild(h), e;
|
|
338
338
|
}
|
|
339
339
|
return e.appendChild(r), e;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function Mt(a, s, t, e, i = !1) {
|
|
342
342
|
if (s < 0 || t <= 0) return null;
|
|
343
343
|
if (i && (a === "Enter" || a === " ")) return { tipo: "ativar", indice: s };
|
|
344
344
|
const [r, o] = e ? ["ArrowLeft", "ArrowRight"] : ["ArrowRight", "ArrowLeft"];
|
|
345
345
|
return a === r ? { tipo: "ir-para", indice: (s + 1) % t } : a === o ? { tipo: "ir-para", indice: (s - 1 + t) % t } : a === "Home" ? { tipo: "ir-para", indice: 0 } : a === "End" ? { tipo: "ir-para", indice: t - 1 } : a === "ArrowDown" ? { tipo: "descer" } : null;
|
|
346
346
|
}
|
|
347
|
-
const
|
|
348
|
-
function
|
|
347
|
+
const kt = /* @__PURE__ */ new Set(["ativo", "disabled"]), St = 8;
|
|
348
|
+
function V(a, s, t = 0) {
|
|
349
|
+
if (Object.is(a, s)) return !0;
|
|
350
|
+
if (t > St || typeof a != "object" || typeof s != "object" || a === null || s === null || Array.isArray(a) !== Array.isArray(s)) return !1;
|
|
351
|
+
if (Array.isArray(a) && Array.isArray(s))
|
|
352
|
+
return a.length === s.length && a.every((o, n) => V(o, s[n], t + 1));
|
|
353
|
+
const e = a, i = s, r = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(i)]);
|
|
354
|
+
for (const o of r)
|
|
355
|
+
if (!V(e[o], i[o], t + 1)) return !1;
|
|
356
|
+
return !0;
|
|
357
|
+
}
|
|
358
|
+
function Lt(a, s) {
|
|
359
|
+
return !s || typeof s != "object" ? [] : Object.keys(s).filter((t) => !V(a[t], s[t]));
|
|
360
|
+
}
|
|
361
|
+
function zt(a) {
|
|
362
|
+
return a.every((s) => kt.has(s));
|
|
363
|
+
}
|
|
364
|
+
const K = 0, P = 1, I = 2, T = (a) => typeof a == "number" && Number.isFinite(a) && a >= 0;
|
|
365
|
+
function J(a, s, t = 0) {
|
|
349
366
|
const e = /* @__PURE__ */ new Map(), i = [];
|
|
350
|
-
Array.isArray(a) && a.forEach((l,
|
|
367
|
+
Array.isArray(a) && a.forEach((l, d) => {
|
|
351
368
|
if (!l || typeof l.id != "string") return;
|
|
352
|
-
const b = Array.isArray(l.larguras) ? l.larguras.map((
|
|
353
|
-
e.set(l.id,
|
|
369
|
+
const b = Array.isArray(l.larguras) ? l.larguras.map((v) => T(v) ? v : NaN) : [];
|
|
370
|
+
e.set(l.id, K), i.push({ id: l.id, prio: Number.isFinite(l.prioridade) ? l.prioridade : 0, ordem: d, larguras: b });
|
|
354
371
|
});
|
|
355
372
|
const r = Number.isFinite(s) ? s : 0;
|
|
356
373
|
if (!i.length || r <= 0) return { niveis: e, cabe: !0 };
|
|
357
374
|
const o = /* @__PURE__ */ new Map();
|
|
358
|
-
let n =
|
|
375
|
+
let n = T(t) ? t : 0;
|
|
359
376
|
for (const l of i) {
|
|
360
|
-
const
|
|
361
|
-
o.set(l.id,
|
|
377
|
+
const d = l.larguras[K];
|
|
378
|
+
o.set(l.id, T(d) ? d : 0), n += o.get(l.id);
|
|
362
379
|
}
|
|
363
380
|
if (n <= r) return { niveis: e, cabe: !0 };
|
|
364
|
-
const u = [...i].sort((l,
|
|
365
|
-
for (let l =
|
|
366
|
-
for (const
|
|
367
|
-
const b =
|
|
368
|
-
if (!(!
|
|
381
|
+
const u = [...i].sort((l, d) => l.prio - d.prio || d.ordem - l.ordem), h = i.reduce((l, d) => Math.max(l, d.larguras.length - 1), 0);
|
|
382
|
+
for (let l = P; l <= h; l++)
|
|
383
|
+
for (const d of u) {
|
|
384
|
+
const b = d.larguras[l], v = o.get(d.id);
|
|
385
|
+
if (!(!T(b) || b >= v) && (n -= v - b, o.set(d.id, b), e.set(d.id, l), n <= r))
|
|
369
386
|
return { niveis: e, cabe: !0 };
|
|
370
387
|
}
|
|
371
388
|
return { niveis: e, cabe: !1 };
|
|
372
389
|
}
|
|
373
|
-
function
|
|
390
|
+
function Rt(a, s, t, e, i) {
|
|
374
391
|
const r = { estreito: a, acao: null };
|
|
375
392
|
if (!Number.isFinite(s) || s <= 0 || !Number.isFinite(t) || t <= 0) return r;
|
|
376
393
|
const o = s < t;
|
|
377
394
|
return o === a ? r : o ? { estreito: o, acao: e ? null : "recolher" } : { estreito: o, acao: e && i ? "restaurar" : null };
|
|
378
395
|
}
|
|
379
|
-
function
|
|
396
|
+
function Pt({ inicio: a, tamanho: s, rolagem: t, visivel: e, margem: i = 8 }) {
|
|
380
397
|
const r = Number.isFinite(t) && t > 0 ? t : 0;
|
|
381
398
|
if (!Number.isFinite(a) || !Number.isFinite(s) || !Number.isFinite(e) || e <= 0) return r;
|
|
382
399
|
const o = Number.isFinite(i) && i > 0 ? i : 0, n = Math.max(0, a - o), u = a + Math.max(0, s) + o;
|
|
383
400
|
return u - n > e || n < r ? n : u > r + e ? u - e : r;
|
|
384
401
|
}
|
|
385
|
-
let
|
|
386
|
-
class
|
|
402
|
+
let Dt = 0;
|
|
403
|
+
class Nt extends et {
|
|
387
404
|
constructor() {
|
|
388
405
|
super();
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
+
c(this, "rootElement");
|
|
407
|
+
c(this, "abasElement");
|
|
408
|
+
c(this, "gruposElement");
|
|
409
|
+
c(this, "painelElement");
|
|
410
|
+
c(this, "fixarElement");
|
|
411
|
+
c(this, "maisAbasElement");
|
|
412
|
+
c(this, "menuAbas", null);
|
|
413
|
+
c(this, "uid", `ui-ribbon-${++Dt}`);
|
|
414
|
+
c(this, "_abaPendente", "");
|
|
415
|
+
c(this, "_pronto", !1);
|
|
416
|
+
c(this, "_modoControlado", !1);
|
|
417
|
+
c(this, "_abas", []);
|
|
418
|
+
c(this, "_abaAtiva", "");
|
|
419
|
+
c(this, "menu", null);
|
|
420
|
+
c(this, "listeners", new $());
|
|
421
|
+
c(this, "tooltip", null);
|
|
422
|
+
c(this, "observerResize", null);
|
|
406
423
|
/** Grupos no nível 2 (botão único com flyout). */
|
|
407
|
-
|
|
424
|
+
c(this, "gruposColapsados", /* @__PURE__ */ new Set());
|
|
408
425
|
/** Grupos no nível 1 (botões pequenos só com ícone). */
|
|
409
|
-
|
|
410
|
-
/** Larguras medidas por nível
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
426
|
+
c(this, "gruposReduzidos", /* @__PURE__ */ new Set());
|
|
427
|
+
/** Larguras medidas por nível, por aba; todas valem só enquanto `chaveMedidas` não muda (compacto/revisão). */
|
|
428
|
+
c(this, "medidas", /* @__PURE__ */ new Map());
|
|
429
|
+
c(this, "chaveMedidas", "");
|
|
430
|
+
c(this, "revisaoLayout", 0);
|
|
431
|
+
/** Espaço do painel e folga fixa na última decisão (para decidir os níveis de uma aba já medida sem ler layout). */
|
|
432
|
+
c(this, "ultimoDisponivel", 0);
|
|
433
|
+
c(this, "ultimaFixa", 1);
|
|
434
|
+
/** Trabalho de layout pendente: lido e escrito uma vez só no próximo quadro. */
|
|
435
|
+
c(this, "pendente", { responsivo: !1, rolarAba: !1, maisAbas: !1 });
|
|
436
|
+
c(this, "rafLayout", null);
|
|
437
|
+
c(this, "keytipsAtivas", !1);
|
|
414
438
|
/** Lado do `recolher-abaixo` na última medição (`null` = ainda não medido). */
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
439
|
+
c(this, "estreito", null);
|
|
440
|
+
c(this, "aplicandoRecolhimentoAuto", !1);
|
|
441
|
+
c(this, "recolhidoPorAuto", !1);
|
|
442
|
+
c(this, "handleFocusInGrupos", (t) => lt(this.botoesPainel(), t.target));
|
|
443
|
+
c(this, "handleClickMaisAbas", (t) => {
|
|
420
444
|
this.alternarMenuAbas(t.detail === 0);
|
|
421
445
|
});
|
|
422
|
-
|
|
446
|
+
c(this, "handleKeyDownMaisAbas", (t) => {
|
|
423
447
|
t.key === "ArrowDown" && (t.preventDefault(), this.menuAbas ? this.menuAbas.focarPrimeiro() : this.alternarMenuAbas(!0));
|
|
424
448
|
});
|
|
425
449
|
/* ---------- Interação ---------- */
|
|
426
|
-
|
|
450
|
+
c(this, "handleClickAbas", (t) => {
|
|
427
451
|
const e = t.target.closest(".ui-ribbon__aba");
|
|
428
452
|
e != null && e.dataset.id && (this.selecionarAba(e.dataset.id), this.recolhido && this.rootElement.classList.toggle("ui-ribbon--aberto"));
|
|
429
453
|
});
|
|
430
|
-
|
|
454
|
+
c(this, "handleClickFixar", () => {
|
|
431
455
|
this.recolhido = !this.recolhido;
|
|
432
456
|
});
|
|
433
|
-
|
|
457
|
+
c(this, "handleDblClickAbas", (t) => {
|
|
434
458
|
t.target.closest(".ui-ribbon__aba") && (this.recolhido = !this.recolhido);
|
|
435
459
|
});
|
|
436
|
-
|
|
460
|
+
c(this, "handleKeyDownAbas", (t) => {
|
|
437
461
|
var o, n;
|
|
438
|
-
const e = Array.from(this.abasElement.querySelectorAll(".ui-ribbon__aba")), i =
|
|
462
|
+
const e = Array.from(this.abasElement.querySelectorAll(".ui-ribbon__aba")), i = Mt(t.key, e.findIndex((u) => u === t.target), e.length, this.rtl, this.ativacaoManual);
|
|
439
463
|
if (!i) return;
|
|
440
464
|
if (t.preventDefault(), i.tipo === "descer") {
|
|
441
465
|
this.recolhido && this.rootElement.classList.add("ui-ribbon--aberto"), (o = this.botoesPainel().find((u) => !u.disabled)) == null || o.focus();
|
|
@@ -453,17 +477,17 @@ class zt extends Q {
|
|
|
453
477
|
}
|
|
454
478
|
r && this.selecionarAba(r), (n = this.abasElement.querySelector(`.ui-ribbon__aba[data-id="${CSS.escape(r ?? "")}"]`)) == null || n.focus();
|
|
455
479
|
});
|
|
456
|
-
|
|
457
|
-
var
|
|
480
|
+
c(this, "handleClickGrupos", (t) => {
|
|
481
|
+
var h;
|
|
458
482
|
const e = t.target, i = this._abas.find((l) => l.id === this._abaAtiva), r = e.closest(".ui-ribbon__btn-colapsado");
|
|
459
483
|
if (r) {
|
|
460
|
-
const l = i == null ? void 0 : i.grupos.find((
|
|
484
|
+
const l = i == null ? void 0 : i.grupos.find((d) => d.id === r.dataset.grupoColapsado);
|
|
461
485
|
l && this.alternarMenuGrupoColapsado(r, l);
|
|
462
486
|
return;
|
|
463
487
|
}
|
|
464
488
|
const o = e.closest(".ui-ribbon__lancador");
|
|
465
489
|
if (o) {
|
|
466
|
-
const l = i == null ? void 0 : i.grupos.find((
|
|
490
|
+
const l = i == null ? void 0 : i.grupos.find((d) => d.id === o.dataset.lancador);
|
|
467
491
|
l && this.dispatchEvent(new CustomEvent("ui-grupo-dialogo", {
|
|
468
492
|
detail: { id: typeof l.lancadorDialogo == "string" ? l.lancadorDialogo : l.id, grupo: l },
|
|
469
493
|
bubbles: !0,
|
|
@@ -473,33 +497,33 @@ class zt extends Q {
|
|
|
473
497
|
}
|
|
474
498
|
const n = e.closest(".ui-ferr-split__gatilho");
|
|
475
499
|
if (n) {
|
|
476
|
-
const l = n.closest(".ui-ferr-split"),
|
|
477
|
-
b && ((
|
|
500
|
+
const l = n.closest(".ui-ferr-split"), d = l == null ? void 0 : l.dataset.id, b = i && y(i.grupos.flatMap((v) => v.itens), d ?? "");
|
|
501
|
+
b && ((h = b.filhos) != null && h.length) && this.alternarMenu(n, b, !1);
|
|
478
502
|
return;
|
|
479
503
|
}
|
|
480
504
|
const u = e.closest(".ui-ferr-btn");
|
|
481
505
|
u != null && u.dataset.id && this.acionar(u, t.detail === 0);
|
|
482
506
|
});
|
|
483
|
-
|
|
507
|
+
c(this, "handleKeyDownGrupos", (t) => {
|
|
484
508
|
var r;
|
|
485
509
|
const e = this.botoesPainel();
|
|
486
510
|
if (this.rtl ? G(t, e, ["ArrowRight"], ["ArrowLeft"]) : G(t, e, ["ArrowLeft"], ["ArrowRight"])) return;
|
|
487
511
|
const i = t.target instanceof HTMLButtonElement ? t.target : null;
|
|
488
512
|
(i == null ? void 0 : i.getAttribute("aria-haspopup")) === "menu" && t.key === "ArrowDown" && (t.preventDefault(), ((r = this.menu) == null ? void 0 : r.ancora) === i ? this.menu.focarPrimeiro() : this.acionar(i, !0));
|
|
489
513
|
});
|
|
490
|
-
|
|
514
|
+
c(this, "handleEscape", (t) => {
|
|
491
515
|
t.key === "Escape" && !this.menu && this.rootElement.classList.remove("ui-ribbon--aberto");
|
|
492
516
|
});
|
|
493
|
-
|
|
517
|
+
c(this, "handlePointerDownFora", (t) => {
|
|
494
518
|
!this.recolhido || !this.rootElement.classList.contains("ui-ribbon--aberto") || t.composedPath().includes(this) || this.rootElement.classList.remove("ui-ribbon--aberto");
|
|
495
519
|
});
|
|
496
|
-
|
|
520
|
+
c(this, "handleAtalho", (t) => {
|
|
497
521
|
if (!this.hasAttribute("atalhos") && !this.hasAttribute("keytips") || t.defaultPrevented) return;
|
|
498
522
|
const e = t.composedPath(), i = e[0];
|
|
499
523
|
if (i && (/^(INPUT|TEXTAREA|SELECT)$/.test(i.tagName) || i.isContentEditable) || e.some((l) => {
|
|
500
|
-
var b,
|
|
501
|
-
const
|
|
502
|
-
return ((
|
|
524
|
+
var b, v;
|
|
525
|
+
const d = (b = l.getAttribute) == null ? void 0 : b.call(l, "role");
|
|
526
|
+
return ((v = l.getAttribute) == null ? void 0 : v.call(l, "aria-modal")) === "true" || d === "textbox" || d === "searchbox" || d === "combobox" || d === "spinbutton";
|
|
503
527
|
})) return;
|
|
504
528
|
if (this.hasAttribute("keytips") && (t.key === "Alt" || t.key === "F10") && !t.ctrlKey && !t.shiftKey && !t.metaKey) {
|
|
505
529
|
t.preventDefault(), this.alternarKeyTips();
|
|
@@ -508,15 +532,15 @@ class zt extends Q {
|
|
|
508
532
|
if (!this.hasAttribute("atalhos")) return;
|
|
509
533
|
const o = this._abas.find((l) => l.id === this._abaAtiva);
|
|
510
534
|
if (!o) return;
|
|
511
|
-
const u = o.grupos.flatMap((l) => l.itens).find((l) => !l.disabled &&
|
|
535
|
+
const u = o.grupos.flatMap((l) => l.itens).find((l) => !l.disabled && st(t, l.atalho));
|
|
512
536
|
if (!u) return;
|
|
513
537
|
t.preventDefault();
|
|
514
|
-
const
|
|
515
|
-
|
|
538
|
+
const h = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(u.id)}"]`);
|
|
539
|
+
h ? this.acionar(h, !1) : this.emitir(u);
|
|
516
540
|
});
|
|
517
541
|
const t = this.attachShadow({ mode: "open" });
|
|
518
542
|
t.innerHTML = `
|
|
519
|
-
<style>${
|
|
543
|
+
<style>${ot}${pt}</style>
|
|
520
544
|
<div class="ui-ribbon" part="base">
|
|
521
545
|
<div class="ui-ribbon__cabecalho" part="cabecalho">
|
|
522
546
|
<div class="ui-ribbon__abas" part="abas" role="tablist"></div>
|
|
@@ -545,29 +569,29 @@ class zt extends Q {
|
|
|
545
569
|
"rotulo-mais-abas",
|
|
546
570
|
"rotulo-fixar",
|
|
547
571
|
"rotulo-expandir",
|
|
548
|
-
...
|
|
572
|
+
...it
|
|
549
573
|
];
|
|
550
574
|
}
|
|
551
575
|
connectedCallback() {
|
|
552
576
|
var e;
|
|
553
|
-
this.listeners.cleanup(), (e = this.tooltip) == null || e.destruir(), this.tooltip = new
|
|
577
|
+
this.listeners.cleanup(), (e = this.tooltip) == null || e.destruir(), this.tooltip = new ut(this.shadowRoot, this.rootElement), this.listeners.add(this.abasElement, "click", this.handleClickAbas), this.listeners.add(this.fixarElement, "click", this.handleClickFixar), this.listeners.add(this.maisAbasElement, "click", this.handleClickMaisAbas), this.listeners.add(this.maisAbasElement, "keydown", this.handleKeyDownMaisAbas), this.listeners.add(this.abasElement, "dblclick", this.handleDblClickAbas), this.listeners.add(this.abasElement, "keydown", this.handleKeyDownAbas), this.listeners.add(this.gruposElement, "click", this.handleClickGrupos), this.listeners.add(this.gruposElement, "keydown", this.handleKeyDownGrupos), this.listeners.add(document, "pointerdown", this.handlePointerDownFora, !0), this.listeners.add(this.rootElement, "keydown", this.handleEscape), this.listeners.add(this.gruposElement, "focusin", this.handleFocusInGrupos), this.listeners.add(document, "keydown", this.handleAtalho), this.iniciarResizeObserver();
|
|
554
578
|
const t = this.getAttribute("aba-ativa");
|
|
555
|
-
t && !this._abaAtiva && (this._abaPendente = t),
|
|
579
|
+
t && !this._abaAtiva && (this._abaPendente = t), O(this, this.rootElement), this.aplicarRotulos(), this.estreito = null, this.invalidarMedidas(), this.renderizar(), this._pronto = !0, this.avaliarRecolhimentoAuto();
|
|
556
580
|
}
|
|
557
581
|
disconnectedCallback() {
|
|
558
582
|
var t, e;
|
|
559
|
-
this._pronto = !1, this.fecharMenu(), this.fecharMenuAbas(), (t = this.observerResize) == null || t.disconnect(), this.observerResize = null, (e = this.tooltip) == null || e.destruir(), this.tooltip = null, this.listeners.cleanup();
|
|
583
|
+
this._pronto = !1, this.cancelarLayout(), this.fecharMenu(), this.fecharMenuAbas(), (t = this.observerResize) == null || t.disconnect(), this.observerResize = null, (e = this.tooltip) == null || e.destruir(), this.tooltip = null, this.listeners.cleanup();
|
|
560
584
|
}
|
|
561
585
|
attributeChangedCallback(t, e, i) {
|
|
562
586
|
if (e !== i) {
|
|
563
|
-
if (
|
|
564
|
-
|
|
587
|
+
if (rt(t)) {
|
|
588
|
+
O(this, this.rootElement);
|
|
565
589
|
return;
|
|
566
590
|
}
|
|
567
591
|
if (t === "aba-ativa") {
|
|
568
592
|
if (!i || i === this._abaAtiva) return;
|
|
569
593
|
this._abas.some((r) => r.id === i && !r.oculta) ? (this._abaPendente = "", this.selecionarAba(i, !1)) : (this._abaPendente = i, this.abasVisiveis().length && this.renderizar());
|
|
570
|
-
} else t === "compacto" ? (this.invalidarMedidas(), this.
|
|
594
|
+
} else t === "compacto" ? (this.invalidarMedidas(), this.agendarLayout({ responsivo: !0 })) : t === "recolher-abaixo" ? (this.estreito = null, this.avaliarRecolhimentoAuto()) : t === "recolhido" ? (this.aplicandoRecolhimentoAuto || (this.recolhidoPorAuto = !1), this.rootElement.classList.remove("ui-ribbon--aberto"), this.aplicarRotulos(), this._pronto && e === null != (i === null) && this.dispatchEvent(
|
|
571
595
|
new CustomEvent("ui-recolhido-change", {
|
|
572
596
|
detail: { recolhido: i !== null },
|
|
573
597
|
bubbles: !0,
|
|
@@ -620,7 +644,7 @@ class zt extends Q {
|
|
|
620
644
|
})
|
|
621
645
|
}))
|
|
622
646
|
})) : e, H(this._abas.map((i) => i.id), "<ui-ribbon> abas"), H(
|
|
623
|
-
this._abas.flatMap((i) => i.grupos.flatMap((r) =>
|
|
647
|
+
this._abas.flatMap((i) => i.grupos.flatMap((r) => W(r.itens))),
|
|
624
648
|
"<ui-ribbon> itens"
|
|
625
649
|
), this.gruposColapsados.clear(), this.gruposReduzidos.clear(), this.invalidarMedidas(), this.renderizar();
|
|
626
650
|
}
|
|
@@ -656,7 +680,7 @@ class zt extends Q {
|
|
|
656
680
|
t && this._abas.length && console.warn(`[ui-ribbon] selecionarAba("${t}"): aba inexistente ou oculta.`);
|
|
657
681
|
return;
|
|
658
682
|
}
|
|
659
|
-
i.id !== this._abaAtiva && (this._abaPendente = "", this.fecharMenu(), this.gruposColapsados.clear(), this.gruposReduzidos.clear(), this._abaAtiva = i.id, this.getAttribute("aba-ativa") !== i.id && this.setAttribute("aba-ativa", i.id), this.renderizar(), e && this.dispatchEvent(
|
|
683
|
+
i.id !== this._abaAtiva && (this._abaPendente = "", this.fecharMenu(), this.gruposColapsados.clear(), this.gruposReduzidos.clear(), this.preDecidirNiveis(i), this._abaAtiva = i.id, this.getAttribute("aba-ativa") !== i.id && this.setAttribute("aba-ativa", i.id), this.renderizar(), e && this.dispatchEvent(
|
|
660
684
|
new CustomEvent("ui-aba-change", {
|
|
661
685
|
detail: { id: i.id, aba: i },
|
|
662
686
|
bubbles: !0,
|
|
@@ -676,16 +700,18 @@ class zt extends Q {
|
|
|
676
700
|
}
|
|
677
701
|
/** Atualiza um item (estado ou aparência) sem precisar recriar as abas. */
|
|
678
702
|
atualizarItem(t, e) {
|
|
679
|
-
const i = this._abas.flatMap((
|
|
703
|
+
const i = this._abas.flatMap((l) => l.grupos.flatMap((d) => d.itens)), r = y(i, t);
|
|
680
704
|
if (!r) {
|
|
681
705
|
console.warn(`[ui-ribbon] atualizarItem("${t}"): item não encontrado.`);
|
|
682
706
|
return;
|
|
683
707
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const n =
|
|
688
|
-
n
|
|
708
|
+
const o = Lt(r, e);
|
|
709
|
+
if (!o.length) return;
|
|
710
|
+
o.forEach((l) => Object.assign(r, { [l]: e[l] }));
|
|
711
|
+
const n = zt(o), u = this._abas.find((l) => y(l.grupos.flatMap((d) => d.itens), t));
|
|
712
|
+
if (!n && u && this.medidas.delete(u.id), !u || u.id !== this._abaAtiva) return;
|
|
713
|
+
const h = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(t)}"]`);
|
|
714
|
+
n ? h && (M(h, this.efetivo(r)), nt(this.botoesPainel())) : (this.comFoco(() => this.renderizarPainel()), this.agendarLayout({ responsivo: !0 }));
|
|
689
715
|
}
|
|
690
716
|
efetivo(t) {
|
|
691
717
|
var e;
|
|
@@ -712,11 +738,11 @@ class zt extends Q {
|
|
|
712
738
|
const t = this.abasVisiveis();
|
|
713
739
|
this._abaPendente && t.length && (t.some((i) => i.id === this._abaPendente) ? (this._abaAtiva = this._abaPendente, this._abaPendente = "") : this._abas.some((i) => i.id === this._abaPendente) || (console.warn(`[ui-ribbon] aba-ativa="${this._abaPendente}" não existe em "abas".`), this._abaPendente = "")), t.some((i) => i.id === this._abaAtiva) || (this._abaAtiva = ((e = t[0]) == null ? void 0 : e.id) ?? ""), this._abaAtiva && !this._abaPendente && this.getAttribute("aba-ativa") !== this._abaAtiva && this.setAttribute("aba-ativa", this._abaAtiva), this.comFoco(() => {
|
|
714
740
|
this.renderizarAbas(), this.renderizarPainel();
|
|
715
|
-
}), this.
|
|
741
|
+
}), this.agendarLayout({ responsivo: !0, rolarAba: !0, maisAbas: !0 });
|
|
716
742
|
}
|
|
717
743
|
renderizarAbas() {
|
|
718
744
|
this.abasElement.innerHTML = "", this.abasVisiveis().forEach((t) => {
|
|
719
|
-
this.abasElement.appendChild(
|
|
745
|
+
this.abasElement.appendChild(_t({
|
|
720
746
|
aba: t,
|
|
721
747
|
ativa: t.id === this._abaAtiva,
|
|
722
748
|
idBotao: this.idAba(t.id),
|
|
@@ -725,10 +751,14 @@ class zt extends Q {
|
|
|
725
751
|
});
|
|
726
752
|
}
|
|
727
753
|
/* ---------- Menu "mais abas" (lista transborda) ---------- */
|
|
728
|
-
/**
|
|
729
|
-
|
|
730
|
-
const t = this.abasElement
|
|
731
|
-
|
|
754
|
+
/** Leitura: as abas não cabem na lista? */
|
|
755
|
+
listaTransborda() {
|
|
756
|
+
const t = this.abasElement;
|
|
757
|
+
return t.scrollWidth > t.clientWidth + 1 && this.abasVisiveis().length > 1;
|
|
758
|
+
}
|
|
759
|
+
/** Escrita: mostra o botão só quando as abas não cabem; fecha o menu se ele deixar de ser necessário. */
|
|
760
|
+
aplicarMaisAbas(t) {
|
|
761
|
+
this.maisAbasElement.hidden = !t, t || this.fecharMenuAbas();
|
|
732
762
|
}
|
|
733
763
|
fecharMenuAbas() {
|
|
734
764
|
var t;
|
|
@@ -745,7 +775,7 @@ class zt extends Q {
|
|
|
745
775
|
tipo: "ferramenta",
|
|
746
776
|
ativo: o.id === this._abaAtiva
|
|
747
777
|
}));
|
|
748
|
-
this.menuAbas =
|
|
778
|
+
this.menuAbas = D(
|
|
749
779
|
this.shadowRoot,
|
|
750
780
|
i,
|
|
751
781
|
r,
|
|
@@ -762,17 +792,20 @@ class zt extends Q {
|
|
|
762
792
|
}
|
|
763
793
|
);
|
|
764
794
|
}
|
|
765
|
-
/**
|
|
766
|
-
|
|
795
|
+
/**
|
|
796
|
+
* Leitura: rolagem da lista que mantém a aba ativa visível (sem rolar a página, só a lista).
|
|
797
|
+
* `null` = nada a fazer.
|
|
798
|
+
*/
|
|
799
|
+
rolagemDaAbaAtiva() {
|
|
767
800
|
const t = this.abasElement, e = t.querySelector(".ui-ribbon__aba--ativa");
|
|
768
|
-
if (!e || !(t.scrollWidth > t.clientWidth)) return;
|
|
769
|
-
const i = e.getBoundingClientRect(), r =
|
|
801
|
+
if (!e || !(t.scrollWidth > t.clientWidth)) return null;
|
|
802
|
+
const i = e.getBoundingClientRect(), r = Pt({
|
|
770
803
|
inicio: i.left - t.getBoundingClientRect().left + t.scrollLeft,
|
|
771
804
|
tamanho: i.width,
|
|
772
805
|
rolagem: t.scrollLeft,
|
|
773
806
|
visivel: t.clientWidth
|
|
774
807
|
});
|
|
775
|
-
r !== t.scrollLeft
|
|
808
|
+
return r !== t.scrollLeft ? r : null;
|
|
776
809
|
}
|
|
777
810
|
idAba(t) {
|
|
778
811
|
return `${this.uid}-aba-${t.replace(/\s+/g, "_")}`;
|
|
@@ -784,24 +817,61 @@ class zt extends Q {
|
|
|
784
817
|
this.painelElement.removeAttribute("aria-labelledby");
|
|
785
818
|
return;
|
|
786
819
|
}
|
|
787
|
-
this.painelElement.setAttribute("aria-labelledby", this.idAba(t.id)), t.grupos.forEach((e) => this.gruposElement.appendChild(
|
|
820
|
+
this.painelElement.setAttribute("aria-labelledby", this.idAba(t.id)), t.grupos.forEach((e) => this.gruposElement.appendChild(Ct(
|
|
788
821
|
e,
|
|
789
822
|
(i, r, o) => this.criarBotao(i, r, o),
|
|
790
823
|
{
|
|
791
824
|
colapsado: this.gruposColapsados.has(e.id),
|
|
792
825
|
reduzido: this.gruposReduzidos.has(e.id),
|
|
793
|
-
criarDividido: (i, r, o) =>
|
|
826
|
+
criarDividido: (i, r, o) => ft(this.efetivo(i), r, o)
|
|
794
827
|
}
|
|
795
|
-
))),
|
|
828
|
+
))), U(this.botoesPainel());
|
|
796
829
|
}
|
|
797
830
|
iniciarResizeObserver() {
|
|
798
831
|
typeof ResizeObserver > "u" || (this.observerResize = new ResizeObserver(() => {
|
|
799
|
-
this.avaliarRecolhimentoAuto(), this.
|
|
832
|
+
this.avaliarRecolhimentoAuto(), this.pendente.responsivo = !0, this.pendente.maisAbas = !0, this.executarLayout();
|
|
800
833
|
}), this.observerResize.observe(this.painelElement), this.observerResize.observe(this.abasElement), this.observerResize.observe(this));
|
|
801
834
|
}
|
|
802
835
|
/* ---------- Responsividade: degradê dos grupos por falta de espaço ---------- */
|
|
803
836
|
invalidarMedidas() {
|
|
804
|
-
this.revisaoLayout++, this.medidas
|
|
837
|
+
this.revisaoLayout++, this.medidas.clear();
|
|
838
|
+
}
|
|
839
|
+
/* ---------- Layout agendado: uma leitura/medida por quadro ---------- */
|
|
840
|
+
/** Marca trabalho de layout para o próximo quadro. Chamadas seguidas no mesmo quadro geram uma execução só. */
|
|
841
|
+
agendarLayout(t) {
|
|
842
|
+
if (t.responsivo && (this.pendente.responsivo = !0), t.rolarAba && (this.pendente.rolarAba = !0), t.maisAbas && (this.pendente.maisAbas = !0), !!this.isConnected) {
|
|
843
|
+
if (typeof requestAnimationFrame != "function") {
|
|
844
|
+
this.executarLayout();
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
this.rafLayout === null && (this.rafLayout = requestAnimationFrame(() => {
|
|
848
|
+
this.rafLayout = null, this.executarLayout();
|
|
849
|
+
}));
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
cancelarLayout() {
|
|
853
|
+
this.rafLayout !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(this.rafLayout), this.rafLayout = null, this.pendente = { responsivo: !1, rolarAba: !1, maisAbas: !1 };
|
|
854
|
+
}
|
|
855
|
+
/** Executa o pendente: lê todo o layout primeiro e escreve depois (a medição dos grupos, se precisar, fica no meio). */
|
|
856
|
+
executarLayout() {
|
|
857
|
+
const t = this.pendente;
|
|
858
|
+
if (this.cancelarLayout(), !(!this.isConnected || !t.responsivo && !t.rolarAba && !t.maisAbas))
|
|
859
|
+
try {
|
|
860
|
+
const e = t.responsivo ? this.painelElement.clientWidth : 0, i = t.responsivo ? this.larguraFixaGrupos() : 1, r = t.rolarAba ? this.rolagemDaAbaAtiva() : null, o = t.maisAbas ? this.listaTransborda() : null;
|
|
861
|
+
t.responsivo && this.ajustarResponsivo(e, i), r !== null && (this.abasElement.scrollLeft = r), o !== null && this.aplicarMaisAbas(o);
|
|
862
|
+
} catch (e) {
|
|
863
|
+
console.warn("[ui-ribbon] falha ao ajustar o layout:", e);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
/** Aba já medida e largura conhecida: já monta nos níveis certos (o quadro só confirma, sem medir de novo). */
|
|
867
|
+
preDecidirNiveis(t) {
|
|
868
|
+
const e = this.chaveMedidas === this.chaveAtualMedidas() ? this.medidas.get(t.id) : void 0;
|
|
869
|
+
if (!e || !(this.ultimoDisponivel > 0)) return;
|
|
870
|
+
const { niveis: i } = J(e, this.ultimoDisponivel, this.ultimaFixa), r = (o) => [...i].filter(([, n]) => n === o).map(([n]) => n);
|
|
871
|
+
this.definirNiveis(r(P), r(I));
|
|
872
|
+
}
|
|
873
|
+
chaveAtualMedidas() {
|
|
874
|
+
return `${this.compacto}|${this.revisaoLayout}`;
|
|
805
875
|
}
|
|
806
876
|
/** Largura fixa do contêiner dos grupos fora dos próprios grupos (padding) + 1px de tolerância de arredondamento. */
|
|
807
877
|
larguraFixaGrupos() {
|
|
@@ -825,29 +895,28 @@ class zt extends Q {
|
|
|
825
895
|
* Deixa o DOM no último estado medido: quem chama deve renderizar o resultado final.
|
|
826
896
|
*/
|
|
827
897
|
medirGrupos(t) {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
898
|
+
const e = this.chaveAtualMedidas();
|
|
899
|
+
this.chaveMedidas !== e && (this.medidas.clear(), this.chaveMedidas = e);
|
|
900
|
+
const i = this.medidas.get(t.id);
|
|
901
|
+
if (i) return { grupos: i, mediu: !1 };
|
|
902
|
+
const r = t.grupos.map((u) => u.id), o = r.map(() => []);
|
|
903
|
+
for (const u of [K, P, I])
|
|
904
|
+
this.definirNiveis(u === P ? r : [], u === I ? r : []), this.renderizarPainel(), r.forEach((h, l) => o[l].push(this.larguraDoGrupo(h)));
|
|
905
|
+
const n = t.grupos.map((u, h) => ({ id: u.id, prioridade: u.prioridade, larguras: o[h] }));
|
|
906
|
+
return this.medidas.set(t.id, n), { grupos: n, mediu: !0 };
|
|
836
907
|
}
|
|
837
908
|
/**
|
|
838
909
|
* Ajusta o nível de cada grupo ao espaço real do painel. Só re-renderiza quando o resultado muda, então
|
|
839
910
|
* notificações repetidas do ResizeObserver (inclusive as causadas por esta própria renderização) não fazem laço.
|
|
840
911
|
* Painel oculto (faixa recolhida) ou sem layout: não decide nada.
|
|
841
912
|
*/
|
|
842
|
-
ajustarResponsivo() {
|
|
913
|
+
ajustarResponsivo(t, e) {
|
|
843
914
|
if (!this.isConnected) return;
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
!n && b(i, l) && b(r, c) || (this.definirNiveis(l, c), this.renderizarPainel());
|
|
850
|
-
});
|
|
915
|
+
const i = this._abas.find((r) => r.id === this._abaAtiva);
|
|
916
|
+
i != null && i.grupos.length && t > 0 && (this.ultimoDisponivel = t, this.ultimaFixa = e, this.comFoco(() => {
|
|
917
|
+
const r = new Set(this.gruposReduzidos), o = new Set(this.gruposColapsados), { grupos: n, mediu: u } = this.medirGrupos(i), { niveis: h } = J(n, t, e), l = (x) => [...h].filter(([, m]) => m === x).map(([m]) => m), d = l(P), b = l(I), v = (x, m) => x.size === m.length && m.every((A) => x.has(A));
|
|
918
|
+
!u && v(r, d) && v(o, b) || (this.definirNiveis(d, b), this.renderizarPainel());
|
|
919
|
+
}));
|
|
851
920
|
}
|
|
852
921
|
/** `recolher-abaixo`: recolhe a faixa ao cruzar para estreito e restaura (só se foi automático) ao alargar. */
|
|
853
922
|
avaliarRecolhimentoAuto() {
|
|
@@ -856,7 +925,7 @@ class zt extends Q {
|
|
|
856
925
|
this.estreito = null;
|
|
857
926
|
return;
|
|
858
927
|
}
|
|
859
|
-
const e =
|
|
928
|
+
const e = Rt(this.estreito, this.offsetWidth, t, this.recolhido, this.recolhidoPorAuto);
|
|
860
929
|
if (this.estreito = e.estreito, !!e.acao) {
|
|
861
930
|
this.aplicandoRecolhimentoAuto = !0;
|
|
862
931
|
try {
|
|
@@ -870,7 +939,7 @@ class zt extends Q {
|
|
|
870
939
|
alternarMenuGrupoColapsado(t, e) {
|
|
871
940
|
var r;
|
|
872
941
|
const i = ((r = this.menu) == null ? void 0 : r.ancora) === t;
|
|
873
|
-
this.fecharMenu(), !i && (t.setAttribute("aria-expanded", "true"), this.menu =
|
|
942
|
+
this.fecharMenu(), !i && (t.setAttribute("aria-expanded", "true"), this.menu = D(
|
|
874
943
|
this.shadowRoot,
|
|
875
944
|
t,
|
|
876
945
|
e.itens,
|
|
@@ -892,7 +961,7 @@ class zt extends Q {
|
|
|
892
961
|
));
|
|
893
962
|
}
|
|
894
963
|
criarBotao(t, e, i) {
|
|
895
|
-
return
|
|
964
|
+
return q(this.efetivo(t), e, i);
|
|
896
965
|
}
|
|
897
966
|
botoesPainel() {
|
|
898
967
|
return Array.from(this.gruposElement.querySelectorAll(".ui-ferr-btn"));
|
|
@@ -909,7 +978,7 @@ class zt extends Q {
|
|
|
909
978
|
}
|
|
910
979
|
acionar(t, e) {
|
|
911
980
|
var n;
|
|
912
|
-
const i = this._abas.find((u) => u.id === this._abaAtiva), r = i == null ? void 0 : i.grupos.find((u) =>
|
|
981
|
+
const i = this._abas.find((u) => u.id === this._abaAtiva), r = i == null ? void 0 : i.grupos.find((u) => y(u.itens, t.dataset.id)), o = r && y(r.itens, t.dataset.id);
|
|
913
982
|
if (!(!o || o.disabled)) {
|
|
914
983
|
if ((n = o.filhos) != null && n.length && !o.dividido) {
|
|
915
984
|
this.alternarMenu(t, o, e);
|
|
@@ -917,17 +986,17 @@ class zt extends Q {
|
|
|
917
986
|
}
|
|
918
987
|
if (o.tipo === "toggle") {
|
|
919
988
|
const u = o.ativo;
|
|
920
|
-
o.ativo = !u,
|
|
989
|
+
o.ativo = !u, M(t, o), this.emitir(o) || (o.ativo = u, M(t, o));
|
|
921
990
|
} else if (o.tipo === "ferramenta") {
|
|
922
|
-
const u = o.ativo,
|
|
923
|
-
o.ativo = !0,
|
|
924
|
-
|
|
925
|
-
const b = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(
|
|
926
|
-
b &&
|
|
927
|
-
}), this.emitir(o) || (o.ativo = u,
|
|
928
|
-
|
|
929
|
-
const b = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(
|
|
930
|
-
b &&
|
|
991
|
+
const u = o.ativo, h = r ? r.exclusivo !== !1 : !0, l = h && r ? r.itens.filter((d) => d.tipo === "ferramenta" && d.id !== o.id && d.ativo) : [];
|
|
992
|
+
o.ativo = !0, M(t, o), h && l.forEach((d) => {
|
|
993
|
+
d.ativo = !1;
|
|
994
|
+
const b = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(d.id)}"]`);
|
|
995
|
+
b && M(b, d);
|
|
996
|
+
}), this.emitir(o) || (o.ativo = u, M(t, o), h && l.forEach((d) => {
|
|
997
|
+
d.ativo = !0;
|
|
998
|
+
const b = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(d.id)}"]`);
|
|
999
|
+
b && M(b, d);
|
|
931
1000
|
}));
|
|
932
1001
|
} else
|
|
933
1002
|
this.emitir(o);
|
|
@@ -937,7 +1006,7 @@ class zt extends Q {
|
|
|
937
1006
|
alternarMenu(t, e, i) {
|
|
938
1007
|
var o;
|
|
939
1008
|
const r = ((o = this.menu) == null ? void 0 : o.ancora) === t;
|
|
940
|
-
this.fecharMenu(), !r && (t.setAttribute("aria-expanded", "true"), this.menu =
|
|
1009
|
+
this.fecharMenu(), !r && (t.setAttribute("aria-expanded", "true"), this.menu = D(
|
|
941
1010
|
this.shadowRoot,
|
|
942
1011
|
t,
|
|
943
1012
|
e.filhos,
|
|
@@ -974,30 +1043,30 @@ class zt extends Q {
|
|
|
974
1043
|
);
|
|
975
1044
|
}
|
|
976
1045
|
}
|
|
977
|
-
|
|
978
|
-
const
|
|
979
|
-
class
|
|
1046
|
+
at("ui-ribbon", Nt);
|
|
1047
|
+
const Ft = ':host{display:inline-flex;flex-direction:column;max-width:100%;max-height:100%;vertical-align:top;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}.ui-paleta{--ui-paleta-btn: 34px;--ui-paleta-padding: 4px;--ui-paleta-raio: var(--ui-paleta-raio-borda, 10px);--ui-paleta-btn-raio: var(--ui-paleta-raio-botao, max(2px, calc(var(--ui-paleta-raio) - var(--ui-paleta-padding))));display:flex;flex-direction:column;align-items:center;gap:2px;padding:var(--ui-paleta-padding);box-sizing:border-box;background:var(--ui-degrade-interno, var(--ui-paleta-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-paleta-raio);-webkit-user-select:none;user-select:none;min-width:0;min-height:0;max-width:100%;overflow:auto;scrollbar-width:thin}.ui-paleta--horizontal{flex-direction:row}.ui-paleta--sm{--ui-paleta-btn: 28px;--ui-paleta-raio: var(--ui-paleta-raio-borda, 8px)}.ui-paleta--lg{--ui-paleta-btn: 42px;--ui-paleta-raio: var(--ui-paleta-raio-borda, 12px)}.ui-paleta--cols-2{display:grid;grid-template-columns:repeat(2,var(--ui-paleta-btn));justify-content:center}.ui-paleta--cols-2 .ui-paleta__sep{grid-column:1 / -1}.ui-paleta .ui-ferr-btn{width:var(--ui-paleta-btn);height:var(--ui-paleta-btn);border-radius:var(--ui-paleta-btn-raio)}.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo,.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:hover:not(:disabled),.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:active:not(:disabled){background:var(--ui-cor-primaria, #00E08A);border-color:transparent;color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:hover:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 86%,#fff)}.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:active:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 80%,#000)}.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:disabled{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:inherit}.ui-ferr-btn--grupo:after{content:"";position:absolute;inset-inline-end:3px;bottom:3px;width:0;height:0;border-inline-start:6px solid transparent;border-bottom:6px solid currentColor;opacity:.8;pointer-events:none;transition:opacity .12s ease,transform .12s ease}.ui-ferr-btn--grupo:hover:after,.ui-ferr-btn--grupo:focus-visible:after,.ui-ferr-btn--grupo[aria-expanded=true]:after{opacity:1;transform:scale(1.2);transform-origin:bottom right}.ui-paleta__sep{grid-column:1 / -1}.ui-paleta__sep{width:70%;height:1px;margin:3px 0;background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-paleta--horizontal .ui-paleta__sep{width:1px;height:70%;margin:0 3px}@media (pointer: coarse){.ui-paleta{--ui-paleta-btn: 40px}.ui-paleta--sm{--ui-paleta-btn: 36px}.ui-paleta--lg{--ui-paleta-btn: 48px}}@media (prefers-reduced-motion: reduce){.ui-ferr-btn--grupo:after{transition:none}}@media (forced-colors: active){.ui-paleta{border-color:CanvasText}.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo,.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:hover:not(:disabled),.ui-paleta .ui-ferr-btn.ui-ferr-btn--ativo:active:not(:disabled){background:Highlight;color:HighlightText;border-color:ButtonText;forced-color-adjust:none}.ui-paleta__sep{background:CanvasText}}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-paleta[data-degrade]:not([data-degrade=false]){--ui-paleta-fundo: var(--ui-gradiente-superficie)}', It = 380, Tt = 8, jt = 50;
|
|
1048
|
+
class Ot {
|
|
980
1049
|
constructor() {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1050
|
+
c(this, "timer");
|
|
1051
|
+
c(this, "timerSupressao");
|
|
1052
|
+
c(this, "inicio", null);
|
|
1053
|
+
c(this, "suprimir", !1);
|
|
985
1054
|
}
|
|
986
1055
|
/** Começa a contar; `aoDisparar` roda se o ponteiro ficar parado até `TEMPO_PRESSAO_LONGA_MS`. */
|
|
987
1056
|
iniciar(s, t, e) {
|
|
988
1057
|
this.cancelar(), window.clearTimeout(this.timerSupressao), this.inicio = { x: s, y: t }, this.timer = window.setTimeout(() => {
|
|
989
1058
|
this.suprimir = !0, e();
|
|
990
|
-
},
|
|
1059
|
+
}, It);
|
|
991
1060
|
}
|
|
992
1061
|
/** Arrastar/rolar com o dedo cancela o clique longo. */
|
|
993
1062
|
mover(s, t) {
|
|
994
|
-
this.timer === void 0 || !this.inicio || Math.hypot(s - this.inicio.x, t - this.inicio.y) >
|
|
1063
|
+
this.timer === void 0 || !this.inicio || Math.hypot(s - this.inicio.x, t - this.inicio.y) > Tt && this.cancelar();
|
|
995
1064
|
}
|
|
996
1065
|
/** Fim do gesto: cancela a contagem e, se o flyout abriu, descarta a supressão logo após o `click` residual. */
|
|
997
1066
|
fim() {
|
|
998
1067
|
this.cancelar(), this.suprimir && (window.clearTimeout(this.timerSupressao), this.timerSupressao = window.setTimeout(() => {
|
|
999
1068
|
this.suprimir = !1;
|
|
1000
|
-
},
|
|
1069
|
+
}, jt));
|
|
1001
1070
|
}
|
|
1002
1071
|
cancelar() {
|
|
1003
1072
|
this.timer !== void 0 && (window.clearTimeout(this.timer), this.timer = void 0), this.inicio = null;
|
|
@@ -1010,62 +1079,62 @@ class Dt {
|
|
|
1010
1079
|
this.cancelar(), window.clearTimeout(this.timerSupressao), this.suprimir = !1;
|
|
1011
1080
|
}
|
|
1012
1081
|
}
|
|
1013
|
-
function
|
|
1082
|
+
function $t(a, s) {
|
|
1014
1083
|
return a.find(s) ?? a[0];
|
|
1015
1084
|
}
|
|
1016
|
-
const
|
|
1017
|
-
function
|
|
1085
|
+
const qt = /* @__PURE__ */ new Set(["textbox", "searchbox", "combobox", "spinbutton"]);
|
|
1086
|
+
function Bt(a) {
|
|
1018
1087
|
const s = a[0];
|
|
1019
1088
|
return s && (/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName) || s.isContentEditable) ? !0 : a.some((t) => {
|
|
1020
1089
|
var r, o;
|
|
1021
1090
|
const e = t, i = (r = e.getAttribute) == null ? void 0 : r.call(e, "role");
|
|
1022
|
-
return ((o = e.getAttribute) == null ? void 0 : o.call(e, "aria-modal")) === "true" || !!i &&
|
|
1091
|
+
return ((o = e.getAttribute) == null ? void 0 : o.call(e, "aria-modal")) === "true" || !!i && qt.has(i);
|
|
1023
1092
|
});
|
|
1024
1093
|
}
|
|
1025
|
-
function
|
|
1094
|
+
function Ht(a, s, t, e) {
|
|
1026
1095
|
const i = typeof a == "string" ? { key: a, ctrlKey: !1, metaKey: !1, altKey: !1, shiftKey: !1 } : a;
|
|
1027
1096
|
if (!i || !i.key) return null;
|
|
1028
|
-
const r = s.filter((u) => !u.disabled &&
|
|
1097
|
+
const r = s.filter((u) => !u.disabled && st(i, u.atalho));
|
|
1029
1098
|
if (r.length === 0) return null;
|
|
1030
1099
|
let o = r[0];
|
|
1031
1100
|
if (r.length > 1) {
|
|
1032
|
-
const u = r.findIndex((
|
|
1101
|
+
const u = r.findIndex((h) => h.id === e);
|
|
1033
1102
|
o = r[(u + 1) % r.length];
|
|
1034
1103
|
}
|
|
1035
1104
|
const n = t.find((u) => {
|
|
1036
|
-
var
|
|
1037
|
-
return (
|
|
1105
|
+
var h;
|
|
1106
|
+
return (h = u.filhos) == null ? void 0 : h.some((l) => l.id === o.id);
|
|
1038
1107
|
});
|
|
1039
1108
|
return { alvo: o, pai: n };
|
|
1040
1109
|
}
|
|
1041
|
-
function
|
|
1110
|
+
function j(a, s) {
|
|
1042
1111
|
return Number.isFinite(a) && a >= 0 ? a : s;
|
|
1043
1112
|
}
|
|
1044
|
-
function
|
|
1045
|
-
const i =
|
|
1046
|
-
let u = 0,
|
|
1047
|
-
const l = (
|
|
1048
|
-
u += (u > 0 ? r : 0) +
|
|
1049
|
-
},
|
|
1113
|
+
function Q(a, s, t, e) {
|
|
1114
|
+
const i = j(a.botao, 0), r = j(a.gap, 0), o = j(a.separador, 0), n = a.vertical && e === 2;
|
|
1115
|
+
let u = 0, h = 0;
|
|
1116
|
+
const l = (v) => {
|
|
1117
|
+
u += (u > 0 ? r : 0) + v;
|
|
1118
|
+
}, d = () => {
|
|
1050
1119
|
if (!n) return l(i);
|
|
1051
|
-
|
|
1120
|
+
h === 0 && l(i), h = (h + 1) % 2;
|
|
1052
1121
|
}, b = Math.min(Math.max(0, Math.floor(s)), a.separadores.length);
|
|
1053
|
-
for (let
|
|
1054
|
-
a.separadores[
|
|
1055
|
-
return t &&
|
|
1122
|
+
for (let v = 0; v < b; v++)
|
|
1123
|
+
a.separadores[v] ? (l(o), h = 0) : d();
|
|
1124
|
+
return t && d(), u + j(a.moldura, 0);
|
|
1056
1125
|
}
|
|
1057
|
-
function
|
|
1126
|
+
function Gt(a) {
|
|
1058
1127
|
const s = Array.isArray(a.separadores) ? a.separadores.length : 0, t = a.vertical ? a.colunas === "auto" ? [1, 2] : [a.colunas === 2 ? 2 : 1] : [1];
|
|
1059
1128
|
if (!(a.limite > 0) || !Number.isFinite(a.limite) || s === 0) return { colunas: t[0], visiveis: s };
|
|
1060
1129
|
for (const r of t)
|
|
1061
|
-
if (
|
|
1130
|
+
if (Q(a, s, !1, r) <= a.limite) return { colunas: r, visiveis: s };
|
|
1062
1131
|
const i = t[t.length - 1];
|
|
1063
1132
|
if (!a.excessoMenu) return { colunas: i, visiveis: s };
|
|
1064
1133
|
for (let r = s - 1; r >= 1; r--)
|
|
1065
|
-
if (
|
|
1134
|
+
if (Q(a, r, !0, i) <= a.limite) return { colunas: i, visiveis: r };
|
|
1066
1135
|
return { colunas: i, visiveis: 1 };
|
|
1067
1136
|
}
|
|
1068
|
-
function
|
|
1137
|
+
function Vt(a, s, t) {
|
|
1069
1138
|
const e = Math.min(Math.max(0, Math.floor(s)), a.length);
|
|
1070
1139
|
let i = a.slice(0, e), r = a.slice(e);
|
|
1071
1140
|
for (; r.length && t(r[0]); ) r = r.slice(1);
|
|
@@ -1074,8 +1143,8 @@ function Ot(a, s, t) {
|
|
|
1074
1143
|
for (; i.length && t(i[i.length - 1]); ) i = i.slice(0, -1);
|
|
1075
1144
|
return { visiveis: i, excesso: r };
|
|
1076
1145
|
}
|
|
1077
|
-
const
|
|
1078
|
-
function
|
|
1146
|
+
const Kt = '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="5" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="19" cy="12" r="2"/></svg>', Wt = "Mais ferramentas";
|
|
1147
|
+
function dt(a, s) {
|
|
1079
1148
|
var t;
|
|
1080
1149
|
if (s)
|
|
1081
1150
|
for (const e of a) {
|
|
@@ -1084,51 +1153,51 @@ function lt(a, s) {
|
|
|
1084
1153
|
if (i) return i;
|
|
1085
1154
|
}
|
|
1086
1155
|
}
|
|
1087
|
-
function
|
|
1156
|
+
function Ut(a) {
|
|
1088
1157
|
return a.filter((s) => s.tipo !== "separador").map((s) => s.id);
|
|
1089
1158
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const i =
|
|
1159
|
+
function Yt(a, s, t, e = Wt) {
|
|
1160
|
+
const i = dt(a, s), r = a.some((n) => n.tipo !== "separador" && !n.disabled), o = q(
|
|
1092
1161
|
{
|
|
1093
1162
|
id: "__mais",
|
|
1094
1163
|
rotulo: e,
|
|
1095
|
-
rotuloAcessivel: i ? `${e}: ${
|
|
1096
|
-
icone: (i == null ? void 0 : i.icone) ??
|
|
1164
|
+
rotuloAcessivel: i ? `${e}: ${k(i)} ativa` : e,
|
|
1165
|
+
icone: (i == null ? void 0 : i.icone) ?? Kt,
|
|
1097
1166
|
tipo: "botao",
|
|
1098
1167
|
disabled: !r
|
|
1099
1168
|
},
|
|
1100
1169
|
"paleta",
|
|
1101
1170
|
t
|
|
1102
1171
|
);
|
|
1103
|
-
return o.removeAttribute("data-id"), o.dataset.mais = "", o.dataset.tooltip = i ? `${e} — ${
|
|
1172
|
+
return o.removeAttribute("data-id"), o.dataset.mais = "", o.dataset.tooltip = i ? `${e} — ${k(i)}` : e, o.classList.add("ui-ferr-btn--mais", "ui-ferr-btn--grupo"), o.classList.toggle("ui-ferr-btn--ativo", !!i), o.setAttribute("aria-haspopup", "menu"), o.setAttribute("aria-expanded", "false"), o;
|
|
1104
1173
|
}
|
|
1105
|
-
const
|
|
1174
|
+
const Xt = { sm: 16, md: 18, lg: 22 }, tt = { sm: [28, 36], md: [34, 40], lg: [42, 48] }, Zt = 7, _ = (a, s) => {
|
|
1106
1175
|
const t = parseFloat(a ?? "");
|
|
1107
1176
|
return Number.isFinite(t) ? t : s;
|
|
1108
1177
|
};
|
|
1109
|
-
class
|
|
1178
|
+
class Jt extends et {
|
|
1110
1179
|
constructor() {
|
|
1111
1180
|
super();
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1181
|
+
c(this, "rootElement");
|
|
1182
|
+
c(this, "_ferramentas", []);
|
|
1183
|
+
c(this, "_ativo", "");
|
|
1184
|
+
c(this, "_pendente", "");
|
|
1185
|
+
c(this, "visiveis", /* @__PURE__ */ new Map());
|
|
1117
1186
|
// id do grupo → id do filho exibido
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1187
|
+
c(this, "menu", null);
|
|
1188
|
+
c(this, "pressao", new Ot());
|
|
1189
|
+
c(this, "listeners", new $());
|
|
1190
|
+
c(this, "tooltip", null);
|
|
1191
|
+
c(this, "_modoControlado", !1);
|
|
1123
1192
|
/** Ajuste ao espaço atual (null até a primeira renderização). */
|
|
1124
|
-
|
|
1193
|
+
c(this, "_ajuste", null);
|
|
1125
1194
|
/** Quantidade de itens da lista para a qual `_ajuste` foi calculado. */
|
|
1126
|
-
|
|
1195
|
+
c(this, "_totalAjustado", 0);
|
|
1127
1196
|
/** Itens de topo que não couberam (menu "Mais ferramentas"). */
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1197
|
+
c(this, "_excesso", []);
|
|
1198
|
+
c(this, "observador", null);
|
|
1199
|
+
c(this, "rafAjuste", null);
|
|
1200
|
+
c(this, "handleClick", (t) => {
|
|
1132
1201
|
var o;
|
|
1133
1202
|
if (this.pressao.consumirSupressao()) return;
|
|
1134
1203
|
const e = t.target.closest(".ui-ferr-btn");
|
|
@@ -1137,58 +1206,58 @@ class Wt extends Q {
|
|
|
1137
1206
|
((o = this.menu) == null ? void 0 : o.ancora) === e ? this.fecharMenu() : this.abrirFlyout(e, !1);
|
|
1138
1207
|
return;
|
|
1139
1208
|
}
|
|
1140
|
-
const i = e != null && e.dataset.id ?
|
|
1209
|
+
const i = e != null && e.dataset.id ? y(this._ferramentas, e.dataset.id) : void 0;
|
|
1141
1210
|
if (!e || !i) return;
|
|
1142
|
-
const r = e.dataset.grupo ?
|
|
1211
|
+
const r = e.dataset.grupo ? y(this._ferramentas, e.dataset.grupo) : void 0;
|
|
1143
1212
|
this.acionar(i, r);
|
|
1144
1213
|
});
|
|
1145
|
-
|
|
1146
|
-
|
|
1214
|
+
c(this, "handleFocusIn", (t) => lt(this.botoes(), t.target));
|
|
1215
|
+
c(this, "handlePointerDown", (t) => {
|
|
1147
1216
|
const e = t;
|
|
1148
1217
|
if (e.pointerType === "mouse" && e.button !== 0) return;
|
|
1149
1218
|
const i = t.target.closest(".ui-ferr-btn--grupo");
|
|
1150
1219
|
!i || i.disabled || this.pressao.iniciar(e.clientX ?? 0, e.clientY ?? 0, () => this.abrirFlyout(i, !1));
|
|
1151
1220
|
});
|
|
1152
|
-
|
|
1221
|
+
c(this, "handlePointerMove", (t) => {
|
|
1153
1222
|
const e = t;
|
|
1154
1223
|
this.pressao.mover(e.clientX ?? 0, e.clientY ?? 0);
|
|
1155
1224
|
});
|
|
1156
|
-
|
|
1157
|
-
|
|
1225
|
+
c(this, "handlePointerFim", () => this.pressao.fim());
|
|
1226
|
+
c(this, "handleContextMenu", (t) => {
|
|
1158
1227
|
const e = t.target.closest(".ui-ferr-btn--grupo");
|
|
1159
1228
|
e && (t.preventDefault(), this.pressao.cancelar(), this.abrirFlyout(e, !1));
|
|
1160
1229
|
});
|
|
1161
|
-
|
|
1230
|
+
c(this, "handleKeyDown", (t) => {
|
|
1162
1231
|
var u;
|
|
1163
1232
|
const e = this.getAttribute("orientacao") === "horizontal", i = getComputedStyle(this).direction === "rtl", r = this.colunas;
|
|
1164
1233
|
if (!e && r === 2) {
|
|
1165
|
-
if (
|
|
1234
|
+
if (mt(t, this.botoes(), i)) return;
|
|
1166
1235
|
} else {
|
|
1167
|
-
const
|
|
1168
|
-
if (G(t, this.botoes(),
|
|
1236
|
+
const h = e ? [i ? "ArrowRight" : "ArrowLeft"] : ["ArrowUp"], l = e ? [i ? "ArrowLeft" : "ArrowRight"] : ["ArrowDown"];
|
|
1237
|
+
if (G(t, this.botoes(), h, l)) return;
|
|
1169
1238
|
}
|
|
1170
1239
|
const o = e ? "ArrowDown" : i ? "ArrowLeft" : "ArrowRight", n = t.target instanceof HTMLButtonElement ? t.target : null;
|
|
1171
1240
|
n && (n.dataset.grupo || n.dataset.mais !== void 0) && t.key === o && (t.preventDefault(), ((u = this.menu) == null ? void 0 : u.ancora) === n ? this.menu.focarPrimeiro() : this.abrirFlyout(n, !0));
|
|
1172
1241
|
});
|
|
1173
|
-
|
|
1174
|
-
if (!this.hasAttribute("atalhos") || t.defaultPrevented ||
|
|
1175
|
-
const e =
|
|
1242
|
+
c(this, "handleAtalho", (t) => {
|
|
1243
|
+
if (!this.hasAttribute("atalhos") || t.defaultPrevented || Bt(t.composedPath()) || !this.donaDosAtalhos()) return;
|
|
1244
|
+
const e = Ht(t, this.todasFerramentas(), this._ferramentas, this._ativo);
|
|
1176
1245
|
e && (t.preventDefault(), this.acionar(e.alvo, e.pai));
|
|
1177
1246
|
});
|
|
1178
1247
|
const t = this.attachShadow({ mode: "open" });
|
|
1179
1248
|
t.innerHTML = `
|
|
1180
|
-
<style>${
|
|
1249
|
+
<style>${ot}${Ft}</style>
|
|
1181
1250
|
<div class="ui-paleta ui-paleta--vertical" part="base" role="toolbar" aria-orientation="vertical" aria-label="Ferramentas"></div>
|
|
1182
1251
|
`, this.rootElement = t.querySelector(".ui-paleta");
|
|
1183
1252
|
}
|
|
1184
1253
|
static get observedAttributes() {
|
|
1185
|
-
return ["valor", "value", "orientacao", "colunas", "tamanho", "size", "excesso", "aria-label", "copiar-dados", "modo-controlado", ...
|
|
1254
|
+
return ["valor", "value", "orientacao", "colunas", "tamanho", "size", "excesso", "aria-label", "copiar-dados", "modo-controlado", ...it];
|
|
1186
1255
|
}
|
|
1187
1256
|
connectedCallback() {
|
|
1188
1257
|
var e;
|
|
1189
|
-
this.listeners.cleanup(), (e = this.tooltip) == null || e.destruir(), this.tooltip = new
|
|
1258
|
+
this.listeners.cleanup(), (e = this.tooltip) == null || e.destruir(), this.tooltip = new ut(this.shadowRoot, this.rootElement), this.listeners.add(this.rootElement, "click", this.handleClick), this.listeners.add(this.rootElement, "pointerdown", this.handlePointerDown), this.listeners.add(this.rootElement, "pointermove", this.handlePointerMove), this.listeners.add(this.rootElement, "pointerup", this.handlePointerFim), this.listeners.add(this.rootElement, "pointerleave", this.handlePointerFim), this.listeners.add(this.rootElement, "pointercancel", this.handlePointerFim), this.listeners.add(this.rootElement, "contextmenu", this.handleContextMenu), this.listeners.add(this.rootElement, "keydown", this.handleKeyDown), this.listeners.add(this.rootElement, "focusin", this.handleFocusIn), this.listeners.add(document, "keydown", this.handleAtalho);
|
|
1190
1259
|
const t = this.getAttribute("valor") || this.getAttribute("value");
|
|
1191
|
-
t && !this._ativo && (this._pendente = t),
|
|
1260
|
+
t && !this._ativo && (this._pendente = t), O(this, this.rootElement), this.aplicarPendente(), this.renderizar(), this.iniciarObservador();
|
|
1192
1261
|
}
|
|
1193
1262
|
disconnectedCallback() {
|
|
1194
1263
|
var t;
|
|
@@ -1196,8 +1265,8 @@ class Wt extends Q {
|
|
|
1196
1265
|
}
|
|
1197
1266
|
attributeChangedCallback(t, e, i) {
|
|
1198
1267
|
if (e !== i) {
|
|
1199
|
-
if (
|
|
1200
|
-
|
|
1268
|
+
if (rt(t)) {
|
|
1269
|
+
O(this, this.rootElement);
|
|
1201
1270
|
return;
|
|
1202
1271
|
}
|
|
1203
1272
|
if (t === "valor" || t === "value") {
|
|
@@ -1232,7 +1301,7 @@ class Wt extends Q {
|
|
|
1232
1301
|
this._ferramentas = this.modoControlado ? e.map((i) => {
|
|
1233
1302
|
var r;
|
|
1234
1303
|
return { ...i, filhos: (r = i.filhos) == null ? void 0 : r.map((o) => ({ ...o })) };
|
|
1235
|
-
}) : e, H(
|
|
1304
|
+
}) : e, H(W(this._ferramentas), "<ui-paleta-ferramentas> ferramentas"), this.visiveis.clear(), this._pendente ? this.aplicarPendente() : this._ativo && this.definirAtivoInterno(this._ativo), this.renderizar();
|
|
1236
1305
|
}
|
|
1237
1306
|
get valor() {
|
|
1238
1307
|
return this._ativo;
|
|
@@ -1288,7 +1357,7 @@ class Wt extends Q {
|
|
|
1288
1357
|
this.limpar(e);
|
|
1289
1358
|
return;
|
|
1290
1359
|
}
|
|
1291
|
-
const i =
|
|
1360
|
+
const i = y(this._ferramentas, t);
|
|
1292
1361
|
if (!i) {
|
|
1293
1362
|
this._ferramentas.length ? console.warn(`[ui-paleta-ferramentas] ativar("${t}"): ferramenta não encontrada.`) : this._pendente = t;
|
|
1294
1363
|
return;
|
|
@@ -1308,20 +1377,20 @@ class Wt extends Q {
|
|
|
1308
1377
|
}
|
|
1309
1378
|
atualizarItem(t, e) {
|
|
1310
1379
|
var u;
|
|
1311
|
-
const i =
|
|
1380
|
+
const i = y(this._ferramentas, t);
|
|
1312
1381
|
if (!i) {
|
|
1313
1382
|
console.warn(`[ui-paleta-ferramentas] atualizarItem("${t}"): item não encontrado.`);
|
|
1314
1383
|
return;
|
|
1315
1384
|
}
|
|
1316
1385
|
Object.assign(i, e);
|
|
1317
|
-
const r = Object.keys(e).every((
|
|
1386
|
+
const r = Object.keys(e).every((h) => h === "ativo" || h === "disabled"), o = this._ferramentas.find((h) => {
|
|
1318
1387
|
var l;
|
|
1319
|
-
return (l =
|
|
1320
|
-
}), n = this._excesso.some((
|
|
1388
|
+
return (l = h.filhos) == null ? void 0 : l.some((d) => d.id === t);
|
|
1389
|
+
}), n = this._excesso.some((h) => h.id === ((o == null ? void 0 : o.id) ?? t));
|
|
1321
1390
|
if (r && !n && !(o && "disabled" in e)) {
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
|
|
1391
|
+
const h = this.botoes().find((l) => l.dataset.id === t || l.dataset.grupo === t);
|
|
1392
|
+
if (h) {
|
|
1393
|
+
M(h, this.itemParaBotao(o ?? i)), nt(this.botoes());
|
|
1325
1394
|
return;
|
|
1326
1395
|
}
|
|
1327
1396
|
if (o || (u = i.filhos) != null && u.length) return;
|
|
@@ -1354,8 +1423,8 @@ class Wt extends Q {
|
|
|
1354
1423
|
const o = this._ajuste;
|
|
1355
1424
|
if (!(!!o && (o.visiveis < this._totalAjustado || i && e === "auto" && o.colunas === 2)) && !this.transbordando(i)) return r;
|
|
1356
1425
|
const u = this.medirPaleta(i);
|
|
1357
|
-
return
|
|
1358
|
-
separadores: this._ferramentas.map((
|
|
1426
|
+
return Gt({
|
|
1427
|
+
separadores: this._ferramentas.map((h) => (h == null ? void 0 : h.tipo) === "separador"),
|
|
1359
1428
|
vertical: i,
|
|
1360
1429
|
colunas: e,
|
|
1361
1430
|
limite: this.limiteDisponivel(i),
|
|
@@ -1376,12 +1445,12 @@ class Wt extends Q {
|
|
|
1376
1445
|
}
|
|
1377
1446
|
/** Medidas reais do CSS (tamanho/toque/tema); cai em valores padrão se o navegador não as expõe. */
|
|
1378
1447
|
medirPaleta(t) {
|
|
1379
|
-
const e = getComputedStyle(this.rootElement), i = typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches, [r, o] =
|
|
1448
|
+
const e = getComputedStyle(this.rootElement), i = typeof matchMedia == "function" && matchMedia("(pointer: coarse)").matches, [r, o] = tt[this.tamanho] ?? tt.md, n = t ? _(e.paddingTop, 4) + _(e.paddingBottom, 4) + _(e.borderTopWidth, 1) + _(e.borderBottomWidth, 1) : _(e.paddingLeft, 4) + _(e.paddingRight, 4) + _(e.borderLeftWidth, 1) + _(e.borderRightWidth, 1);
|
|
1380
1449
|
return {
|
|
1381
1450
|
botao: _(e.getPropertyValue("--ui-paleta-btn"), i ? o : r),
|
|
1382
1451
|
gap: _(t ? e.rowGap : e.columnGap, 2),
|
|
1383
1452
|
moldura: n,
|
|
1384
|
-
separador:
|
|
1453
|
+
separador: Zt
|
|
1385
1454
|
};
|
|
1386
1455
|
}
|
|
1387
1456
|
iniciarObservador() {
|
|
@@ -1408,7 +1477,7 @@ class Wt extends Q {
|
|
|
1408
1477
|
}
|
|
1409
1478
|
aplicarPendente() {
|
|
1410
1479
|
if (!this._pendente) return;
|
|
1411
|
-
const t =
|
|
1480
|
+
const t = y(this._ferramentas, this._pendente);
|
|
1412
1481
|
t && !t.disabled && (t.tipo ?? "ferramenta") === "ferramenta" ? (this.definirAtivoInterno(this._pendente), this._pendente = "") : this._ferramentas.length && (console.warn(`[ui-paleta-ferramentas] valor="${this._pendente}" não é uma ferramenta ativável em "ferramentas".`), this._pendente = "");
|
|
1413
1482
|
}
|
|
1414
1483
|
definirAtivoInterno(t) {
|
|
@@ -1450,31 +1519,31 @@ class Wt extends Q {
|
|
|
1450
1519
|
var x;
|
|
1451
1520
|
const e = (x = this.shadowRoot) == null ? void 0 : x.activeElement, i = e && e.classList.contains("ui-ferr-btn") ? { id: e.dataset.id ?? "", grupo: e.dataset.grupo ?? "", mais: e.dataset.mais !== void 0 } : null;
|
|
1452
1521
|
this.fecharMenu();
|
|
1453
|
-
const r = this.orientacao, o = this.tamanho, n = t ?? this.calcularAtual(), u = this._ajuste,
|
|
1522
|
+
const r = this.orientacao, o = this.tamanho, n = t ?? this.calcularAtual(), u = this._ajuste, h = !!u && !this.mesmoAjuste(n, u);
|
|
1454
1523
|
this._ajuste = n, this._totalAjustado = this._ferramentas.length, this.rootElement.className = `ui-paleta ui-paleta--${r} ui-paleta--${o}`, n.colunas === 2 && r === "vertical" && this.rootElement.classList.add("ui-paleta--cols-2"), this.rootElement.setAttribute("aria-orientation", r), this.rootElement.setAttribute("aria-label", this.getAttribute("aria-label") || "Ferramentas"), this.rootElement.innerHTML = "";
|
|
1455
|
-
const l =
|
|
1456
|
-
this._excesso = b,
|
|
1524
|
+
const l = Xt[o] ?? 18, { visiveis: d, excesso: b } = Vt(this._ferramentas, n.visiveis, (m) => m.tipo === "separador");
|
|
1525
|
+
this._excesso = b, d.forEach((m) => {
|
|
1457
1526
|
var S;
|
|
1458
|
-
if (
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1527
|
+
if (m.tipo === "separador") {
|
|
1528
|
+
const L = document.createElement("div");
|
|
1529
|
+
L.className = "ui-paleta__sep", L.setAttribute("role", "separator"), this.rootElement.appendChild(L);
|
|
1461
1530
|
return;
|
|
1462
1531
|
}
|
|
1463
|
-
const
|
|
1464
|
-
C.dataset.id =
|
|
1465
|
-
}), b.length && this.rootElement.appendChild(
|
|
1466
|
-
const
|
|
1467
|
-
if (
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1532
|
+
const A = this.itemExibido(m), C = q(this.itemParaBotao(m), "paleta", l);
|
|
1533
|
+
C.dataset.id = A.id, (S = m.filhos) != null && S.length && (C.dataset.grupo = m.id), this.rootElement.appendChild(C);
|
|
1534
|
+
}), b.length && this.rootElement.appendChild(Yt(b, this._ativo, l)), U(this.botoes());
|
|
1535
|
+
const v = this.botoes().find((m) => m.dataset.id === this._ativo && !m.disabled) ?? (dt(b, this._ativo) ? this.botaoMais() : null);
|
|
1536
|
+
if (v && !v.disabled && (this.botoes().forEach((m) => m.tabIndex = -1), v.tabIndex = 0), i) {
|
|
1537
|
+
const m = i.mais ? this.botaoMais() : this.botoes().find((A) => i.grupo ? A.dataset.grupo === i.grupo : A.dataset.id === i.id);
|
|
1538
|
+
m && !m.disabled && m.focus();
|
|
1470
1539
|
}
|
|
1471
|
-
|
|
1540
|
+
h && this.dispatchEvent(
|
|
1472
1541
|
new CustomEvent("ui-paleta-ajuste", {
|
|
1473
1542
|
detail: {
|
|
1474
1543
|
colunas: n.colunas,
|
|
1475
|
-
visiveis:
|
|
1476
|
-
total: this._ferramentas.filter((
|
|
1477
|
-
ocultos:
|
|
1544
|
+
visiveis: d.filter((m) => m.tipo !== "separador").length,
|
|
1545
|
+
total: this._ferramentas.filter((m) => m.tipo !== "separador").length,
|
|
1546
|
+
ocultos: Ut(b)
|
|
1478
1547
|
},
|
|
1479
1548
|
bubbles: !0,
|
|
1480
1549
|
composed: !0
|
|
@@ -1490,7 +1559,7 @@ class Wt extends Q {
|
|
|
1490
1559
|
/** Reflete no botão o estado atual do item (sem recriar o DOM). */
|
|
1491
1560
|
atualizarBotaoDe(t, e) {
|
|
1492
1561
|
const i = this.botoes().find((r) => r.dataset.id === t.id);
|
|
1493
|
-
i &&
|
|
1562
|
+
i && M(i, this.itemParaBotao(e ?? t));
|
|
1494
1563
|
}
|
|
1495
1564
|
/* ---------- Interação ---------- */
|
|
1496
1565
|
acionar(t, e) {
|
|
@@ -1514,39 +1583,39 @@ class Wt extends Q {
|
|
|
1514
1583
|
/** Várias paletas com `atalhos` na página: só a que contém o foco (ou a primeira no DOM) responde. */
|
|
1515
1584
|
donaDosAtalhos() {
|
|
1516
1585
|
const t = Array.from(document.querySelectorAll("ui-paleta-ferramentas[atalhos]"));
|
|
1517
|
-
return t.length <= 1 ? !0 :
|
|
1586
|
+
return t.length <= 1 ? !0 : $t(t, (e) => {
|
|
1518
1587
|
var i;
|
|
1519
1588
|
return e.matches(":focus-within") || !!((i = e.shadowRoot) != null && i.activeElement);
|
|
1520
1589
|
}) === this;
|
|
1521
1590
|
}
|
|
1522
1591
|
abrirFlyout(t, e) {
|
|
1523
|
-
const i = t.dataset.mais !== void 0, r = !i && t.dataset.grupo ?
|
|
1592
|
+
const i = t.dataset.mais !== void 0, r = !i && t.dataset.grupo ? y(this._ferramentas, t.dataset.grupo) : void 0, o = i ? this._excesso : r == null ? void 0 : r.filhos;
|
|
1524
1593
|
if (!(o != null && o.length)) return;
|
|
1525
1594
|
this.fecharMenu();
|
|
1526
|
-
const n = (
|
|
1527
|
-
var b,
|
|
1595
|
+
const n = (d) => {
|
|
1596
|
+
var b, v;
|
|
1528
1597
|
return {
|
|
1529
|
-
...
|
|
1530
|
-
ativo: !((b =
|
|
1531
|
-
filhos: (
|
|
1598
|
+
...d,
|
|
1599
|
+
ativo: !((b = d.filhos) != null && b.length) && (d.tipo ?? "ferramenta") === "ferramenta" ? d.id === this._ativo : d.ativo,
|
|
1600
|
+
filhos: (v = d.filhos) == null ? void 0 : v.map(n)
|
|
1532
1601
|
};
|
|
1533
|
-
}, u = o.map(n),
|
|
1534
|
-
t.setAttribute("aria-expanded", "true"), this.menu =
|
|
1602
|
+
}, u = o.map(n), h = this.getAttribute("orientacao") !== "horizontal", l = getComputedStyle(this).direction === "rtl";
|
|
1603
|
+
t.setAttribute("aria-expanded", "true"), this.menu = D(
|
|
1535
1604
|
this.shadowRoot,
|
|
1536
1605
|
t,
|
|
1537
1606
|
u,
|
|
1538
|
-
(
|
|
1607
|
+
(d) => {
|
|
1539
1608
|
var x;
|
|
1540
|
-
const b =
|
|
1609
|
+
const b = y(this._ferramentas, d.id);
|
|
1541
1610
|
if (!b) return;
|
|
1542
|
-
const
|
|
1543
|
-
var
|
|
1544
|
-
return (
|
|
1611
|
+
const v = r ?? this._ferramentas.find((m) => {
|
|
1612
|
+
var A;
|
|
1613
|
+
return (A = m.filhos) == null ? void 0 : A.some((C) => C.id === b.id);
|
|
1545
1614
|
});
|
|
1546
|
-
this.acionar(b,
|
|
1615
|
+
this.acionar(b, v), (x = i ? this.botaoMais() : this.botoes().find((m) => m.dataset.grupo === (r == null ? void 0 : r.id))) == null || x.focus();
|
|
1547
1616
|
},
|
|
1548
1617
|
{
|
|
1549
|
-
lado:
|
|
1618
|
+
lado: h ? l ? "esquerda" : "direita" : "baixo",
|
|
1550
1619
|
focar: e,
|
|
1551
1620
|
tipoPadrao: "ferramenta",
|
|
1552
1621
|
onFechar: () => {
|
|
@@ -1560,9 +1629,9 @@ class Wt extends Q {
|
|
|
1560
1629
|
(t = this.menu) == null || t.fechar(), this.menu = null;
|
|
1561
1630
|
}
|
|
1562
1631
|
}
|
|
1563
|
-
|
|
1632
|
+
at("ui-paleta-ferramentas", Jt);
|
|
1564
1633
|
export {
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1634
|
+
re as ICONES_FERRAMENTAS,
|
|
1635
|
+
Jt as UIPaletaFerramentas,
|
|
1636
|
+
Nt as UIRibbon
|
|
1568
1637
|
};
|