@thibezer/ui-components-kit 2.12.2 → 2.12.4
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 +639 -584
- package/README.md +1 -1
- package/dist/camadas.cjs +60 -60
- package/dist/camadas.js +676 -579
- package/dist/canvas.cjs +20 -20
- package/dist/canvas.js +950 -940
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +6 -1
- package/dist/components/ui-camadas/camadas-sincronizacao-dom.d.ts +5 -0
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +2 -0
- package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +5 -2
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +2 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +6 -1
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +2 -2
- package/dist/custom-elements.json +5072 -4890
- package/dist/data.cjs +1 -1
- package/dist/data.js +39 -38
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +0 -6
- package/dist/gerencigeo-canvas/mapa_core.d.ts +1 -0
- package/dist/gerencigeo-canvas/renderers/tile_renderer.d.ts +2 -1
- package/dist/gerencigeo-canvas/renderers/wms_renderer.d.ts +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +100 -98
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -3
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +31 -30
- package/dist/tipos-elementos.d.ts +3 -3
- package/dist/tipos-vue.d.ts +3 -3
- package/dist/ui-controle-cores-C_cVXxCn.js +291 -0
- package/dist/ui-controle-cores-CuDFS8Y8.cjs +32 -0
- package/dist/ui-seletor-cor-DPKqf5wb.cjs +82 -0
- package/dist/ui-seletor-cor-FYtRccnK.js +396 -0
- package/dist/ui-tabela-propriedades-C5YYnod1.js +3053 -0
- package/dist/ui-tabela-propriedades-DWOKznMN.cjs +142 -0
- package/package.json +187 -187
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";var wt=Object.defineProperty;var At=(t,r,e)=>r in t?wt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var v=(t,r,e)=>At(t,typeof r!="symbol"?r+"":r,e);const U=require("./listener-bag-D5omxZ9h.cjs"),O=require("./parts-vQa2873h.cjs"),P=require("./ssr-safe-CiHD1adl.cjs"),Ct=require("./svg-seguro-J2RM1Ssf.cjs");class _e{constructor(r){v(this,"autoFetchController",null);v(this,"emVoo",null);this.ctx=r}carregar(r){if(!r)return Promise.resolve(!1);if(this.emVoo&&this.emVoo.url===r&&this.autoFetchController)return this.emVoo.promessa;this.cancelarEmVoo();const e=new AbortController;this.autoFetchController=e;const i=this.executar(r,e);return this.emVoo={url:r,promessa:i},i}emitir(r,e){this.ctx.host.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0,detail:e}))}erro(r,e,i,o){const a=e instanceof Error?e.message:String(e);console.error("[ui-tabela] Erro ao carregar dados remotos:",e);const n={url:r,erro:a,origem:i};o!==void 0&&(n.status=o),this.emitir("ui-fetch-erro",n)}async executar(r,e){var l,d,u,c;const i=()=>this.autoFetchController===e,o=()=>{this.autoFetchController===e&&(this.autoFetchController=null,this.emVoo=null)};this.ctx.onCarregandoAlterado(!0),this.emitir("ui-fetch-start",{url:r});let a="rede",n;try{const p={...((d=(l=this.ctx).getOpcoes)==null?void 0:d.call(l))??{},signal:e.signal},h=await(((c=(u=this.ctx).getFetcher)==null?void 0:c.call(u))??((b,y)=>fetch(b,y)))(r,p);if(!h.ok)throw a="http",n=h.status,new Error(`HTTP ${h.status}: ${h.statusText}`);a="json";const m=await h.json(),g=Array.isArray(m)?m:(m==null?void 0:m.dados)||(m==null?void 0:m.items)||(m==null?void 0:m.data)||(m==null?void 0:m.rows)||[],f=Array.isArray(g)?g:[];return i()?(a="render",this.ctx.onDadosRecebidos(f),o(),this.ctx.onCarregandoAlterado(!1),this.emitir("ui-fetch-sucesso",{url:r,total:f.length,dados:f}),!0):!1}catch(p){return(p==null?void 0:p.name)==="AbortError"?(i()&&(o(),this.ctx.onCarregandoAlterado(!1)),this.emitir("ui-fetch-cancelado",{url:r}),!1):(i()&&(o(),this.ctx.onCarregandoAlterado(!1),this.erro(r,p,a,n)),!1)}}abortar(){this.autoFetchController&&(this.cancelarEmVoo(),this.ctx.onCarregandoAlterado(!1))}cancelarEmVoo(){if(this.autoFetchController){const r=this.autoFetchController;this.autoFetchController=null,this.emVoo=null,r.abort()}}}const kt=["id","_id","codigo","key"];function zt(t,r){return t!=null&&(t===r||String(t)===String(r))}function ee(t,r){let e=-1;return typeof t=="number"&&Number.isInteger(t)?e=t:typeof t=="string"&&/^\d+$/.test(t.trim())&&(e=parseInt(t.trim(),10)),e>=0&&e<r?e:-1}function Ee(t,r,e="id",i=!1){if(!t||t.length===0)return-1;if(typeof r=="function")return t.findIndex(r);if(i)return ee(r,t.length);const o=[e,...kt.filter(a=>a!==e)];for(const a of o){const n=t.findIndex(l=>!!l&&typeof l=="object"&&zt(l[a],r));if(n!==-1)return n}return ee(r,t.length)}class ye{constructor(r){v(this,"itemSelecionado",null);v(this,"indiceSelecionado",null);this.ctx=r}indiceDoItem(r,e){const i=this.ctx.getChaveId(),o=r.indexOf(e);return o>=0?o:e[i]==null?-1:r.findIndex(a=>(a==null?void 0:a[i])!=null&&String(a[i])===String(e[i]))}getItemSelecionado(){return this.itemSelecionado}setItemSelecionado(r){this.itemSelecionado=r;const e=r?this.indiceDoItem(this.ctx.getDadosExibicao(),r):-1;this.indiceSelecionado=e>=0?e:null,this.atualizarLinhasSelecionadas()}getIndiceSelecionado(){return this.indiceSelecionado}setIndiceSelecionado(r){const e=this.ctx.getDadosExibicao(),i=r!==null&&r>=0&&r<e.length;this.indiceSelecionado=i?r:null,this.itemSelecionado=i?e[r]:null,this.atualizarLinhasSelecionadas()}reconciliar(){const r=this.itemSelecionado;if(!r){this.indiceSelecionado=null;return}const e=this.ctx.getDadosExibicao(),i=this.indiceDoItem(e,r);if(i>=0){this.indiceSelecionado=i,this.substituirReferencia(r,e[i]);return}this.indiceSelecionado=null;const o=this.ctx.getDadosOriginais(),a=this.indiceDoItem(o,r);if(a>=0){this.substituirReferencia(r,o[a]);return}this.itemSelecionado=null,this.ctx.host.dispatchEvent(new CustomEvent("ui-selecao-removida",{bubbles:!0,composed:!0,detail:{item:r}}))}substituirReferencia(r,e){this.itemSelecionado=e,r!==e&&this.ctx.host.dispatchEvent(new CustomEvent("ui-selecao-atualizada",{bubbles:!0,composed:!0,detail:{item:e,anterior:r}}))}limparSelecao(){this.itemSelecionado=null,this.indiceSelecionado=null,this.atualizarLinhasSelecionadas()}isItemSelecionado(r,e){if(this.itemSelecionado){if(this.itemSelecionado===r)return!0;const i=this.ctx.getChaveId();if(r[i]!=null&&this.itemSelecionado[i]!=null)return String(r[i])===String(this.itemSelecionado[i]);if(r.id!=null&&this.itemSelecionado.id!=null)return String(r.id)===String(this.itemSelecionado.id)}return this.indiceSelecionado!==null&&this.indiceSelecionado===e}atualizarLinhasSelecionadas(){const r=this.ctx.getTbody();if(!r)return;const e=this.ctx.getDadosExibicao();r.querySelectorAll("tr:not(.ui-tabela__virtual-spacer)").forEach(o=>{const a=o.getAttribute("data-index"),n=a!==null?parseInt(a,10):-1,l=n>=0?e[n]:null,d=l?this.isItemSelecionado(l,n):!1;o.classList.toggle("ui-tabela__tr--selecionada",d),O.alternarPart(o,"linha-selecionada",d),d?(o.setAttribute("data-selecionada","true"),o.setAttribute("aria-current","true"),o.setAttribute("aria-selected","true")):(o.removeAttribute("data-selecionada"),o.removeAttribute("aria-current"),o.setAttribute("aria-selected","false"))})}rolarPara(r,e){const i=this.ctx.getDadosExibicao(),o=Ee(i,r,this.ctx.getChaveId(),(e==null?void 0:e.porIndice)===!0);if(o===-1)return!1;if(e!=null&&e.selecionar){const a=i[o];this.itemSelecionado=a,this.indiceSelecionado=o,this.atualizarLinhasSelecionadas(),this.ctx.onLinhaAtiva(o),this.ctx.host.dispatchEvent(new CustomEvent("ui-linha-selecionada",{bubbles:!0,composed:!0,detail:{item:a,indice:o}}))}return this.ctx.onRolarParaIndice(o,(e==null?void 0:e.comportamento)||"smooth")}}function we(t,r,e){return t!==e?{idColuna:e,direcao:"asc"}:r==="asc"?{idColuna:e,direcao:"desc"}:r==="desc"?{idColuna:null,direcao:"original"}:{idColuna:e,direcao:"asc"}}const St=new Intl.Collator("pt-BR",{numeric:!0,sensitivity:"base"});function me(t){if(t instanceof Date)return t.getTime();if(typeof t=="number")return t;const r=String(t).trim(),e=/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2}))?$/.exec(r);return e?new Date(+e[3],+e[2]-1,+e[1],+(e[4]??0),+(e[5]??0)).getTime():Date.parse(r)}function Lt(t,r,e){if(e==="data"||!e&&(t instanceof Date||r instanceof Date)){const i=me(t),o=me(r);if(!Number.isNaN(i)&&!Number.isNaN(o))return i-o}else if(e==="numero"||!e&&typeof t=="number"&&typeof r=="number"){const i=Number(t),o=Number(r);if(!Number.isNaN(i)&&!Number.isNaN(o))return i-o}else if(e==="booleano"||!e&&typeof t=="boolean"&&typeof r=="boolean")return+!!t-+!!r;return St.compare(String(t),String(r))}function Ae(t,r,e,i){if(!r||e==="original")return[...t];const o=e==="desc"?-1:1;return[...t].sort((a,n)=>{const l=a[r],d=n[r],u=l==null,c=d==null;return u||c?u===c?0:u?1:-1:i!=null&&i.comparador?i.comparador(l,d,a,n)*o:l===d?0:Lt(l,d,i==null?void 0:i.tipo)*o})}function $(t){return t.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase()}class Ce{constructor(){v(this,"dadosOriginais",[]);v(this,"dadosExibicao",[]);v(this,"colunaOrdenada",null);v(this,"direcaoOrdenacao","original");v(this,"ultimoFiltro","");v(this,"colunasFiltro",[]);v(this,"colunas",[]);v(this,"ordenacaoRemota",!1)}setColunas(r){this.colunas=r,this.colunaOrdenada&&this.aplicarOrdenacao()}setOrdenacaoRemota(r){this.ordenacaoRemota!==r&&(this.ordenacaoRemota=r,this.aplicarOrdenacao())}restaurarOrdenacao(r,e){this.colunaOrdenada=r,this.direcaoOrdenacao=e,this.aplicarOrdenacao()}setColunasFiltro(r){this.colunasFiltro=r,this.ultimoFiltro&&this.aplicarOrdenacao()}getDadosOriginais(){return this.dadosOriginais}setDadosOriginais(r){this.dadosOriginais=Array.isArray(r)?r.filter(e=>e!=null):[],this.aplicarOrdenacao()}getDadosExibicao(){return this.dadosExibicao}getColunaOrdenada(){return this.colunaOrdenada}setColunaOrdenada(r){this.colunaOrdenada=r,r?this.direcaoOrdenacao==="original"&&(this.direcaoOrdenacao="asc"):this.direcaoOrdenacao="original",this.aplicarOrdenacao()}getDirecaoOrdenacao(){return this.direcaoOrdenacao}setDirecaoOrdenacao(r){this.direcaoOrdenacao=r||"original",this.direcaoOrdenacao==="original"&&(this.colunaOrdenada=null),this.aplicarOrdenacao()}alternarOrdenacaoColuna(r){if(!r.ordenavel)return null;const e=we(this.colunaOrdenada,this.direcaoOrdenacao,r.id);return this.colunaOrdenada=e.idColuna,this.direcaoOrdenacao=e.direcao,this.aplicarOrdenacao(),e}aplicarOrdenacao(){const r=this.ultimoFiltro,e=r?this.dadosOriginais.filter(o=>this.casaFiltro(o,r)):this.dadosOriginais,i=this.colunaOrdenada?this.colunas.find(o=>o.id===this.colunaOrdenada):null;this.dadosExibicao=this.ordenacaoRemota?[...e]:Ae(e,this.colunaOrdenada,this.direcaoOrdenacao,i)}casaFiltro(r,e){return(this.colunasFiltro.length>0?this.colunasFiltro:Object.keys(r)).some(o=>{const a=r[o],n=this.colunas.find(d=>d.id===o);if(n!=null&&n.textoFiltro)try{if($(String(n.textoFiltro(a,r)??"")).includes(e))return!0}catch{}if(a==null||typeof a=="object"&&!(a instanceof Date))return!1;const l=a instanceof Date?`${a.toISOString()} ${a.toLocaleDateString("pt-BR")}`:String(a);return $(l).includes(e)})}temFiltro(){return this.ultimoFiltro!==""}filtrar(r){this.ultimoFiltro=$((r||"").trim()),this.aplicarOrdenacao()}}const Mt=':host{display:block;width:100%;box-sizing:border-box;font-family:inherit;color:var(--ui-cor-texto, #e1e1e6);position:relative}.ui-tabela-container{width:100%;max-width:100%;max-height:var(--ui-tabela-max-height, 500px);overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-superficie, #141417);box-sizing:border-box;position:relative}.ui-tabela{width:100%;border-collapse:separate;border-spacing:0;text-align:left;font-size:14px;font-family:var(--ui-fonte-base, inherit);font-variant-numeric:tabular-nums}.ui-tabela thead{background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}.ui-tabela th{position:sticky;top:0;z-index:10;padding:10px 16px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto-secundario, #9696a6);font-size:13px;font-weight:600;letter-spacing:.02em;border-bottom:2px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box}.ui-tabela th[aria-sort=ascending],.ui-tabela th[aria-sort=descending]{color:var(--ui-cor-texto, #e1e1e6)}.ui-tabela__resizer{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;z-index:20;background:linear-gradient(var(--ui-cor-borda, rgba(255, 255, 255, .12)),var(--ui-cor-borda, rgba(255, 255, 255, .12))) center / 1px 60% no-repeat;transition:background-color .15s ease}.ui-tabela__resizer:hover,.ui-tabela__resizer:focus-visible,.ui-tabela__resizer--ativo{background:var(--ui-cor-primaria, #00E08A);outline:none}:host([densidade="compacta"]) th,:host([densidade="compacta"]) td,:host([density="compact"]) th,:host([density="compact"]) td{padding:4px 8px}:host([densidade="normal"]) th,:host([densidade="normal"]) td,:host([density="normal"]) th,:host([density="normal"]) td{padding:10px 16px}:host([densidade="relaxada"]) th,:host([densidade="relaxada"]) td,:host([density="relaxed"]) th,:host([density="relaxed"]) td{padding:16px 20px}:host([altura-linha]) td,:host([row-height]) td{height:var(--ui-tabela-altura-linha);box-sizing:border-box;padding-top:0;padding-bottom:0;overflow:hidden;white-space:nowrap}.ui-tabela__header-content{display:inline-flex;align-items:center;vertical-align:middle;width:100%;box-sizing:border-box}.ui-tabela__header-text{margin-right:var(--ui-tabela-th-gap, 6px);display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis}.ui-tabela__sort-icon{width:var(--ui-tabela-th-icone, 16px);min-width:var(--ui-tabela-th-icone, 16px);flex:none;display:inline-flex;justify-content:center;align-items:center}.ui-tabela th.ui-tabela__th--ordenavel{cursor:pointer}@media (hover: hover){.ui-tabela th.ui-tabela__th--ordenavel:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,var(--ui-cor-fundo-elevado, #1a1a1e));color:var(--ui-cor-texto, #e1e1e6)}}.ui-tabela__ordenar{all:unset;display:flex;width:100%;box-sizing:border-box;cursor:pointer;font:inherit;color:inherit;text-align:inherit}.ui-tabela__ordenar:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px;border-radius:var(--ui-raio-sm, 4px)}.ui-tabela tbody tr:focus{outline:none}.ui-tabela tbody tr:focus-visible{outline:2px solid var(--ui-tabela-cor-foco, var(--ui-cor-texto, #e1e1e6));outline-offset:-2px;background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}.ui-tabela__sort-arrow{display:inline-block;width:14px;height:14px;vertical-align:middle;shape-rendering:geometricPrecision;fill:var(--ui-cor-primaria, #00E08A)}.ui-tabela__sort-arrow path{transition:opacity .15s ease;opacity:.35}.ui-tabela__sort-arrow--asc .seta-cima,.ui-tabela__sort-arrow--desc .seta-baixo{opacity:1}.ui-tabela__sort-arrow--inativo{fill:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__sort-arrow--inativo path{opacity:.6}.ui-tabela td{padding:10px 16px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-borda, rgba(255, 255, 255, .12)) 60%,transparent);white-space:nowrap;vertical-align:middle;color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box}.ui-tabela__cell-content{display:inline-flex;align-items:center;vertical-align:middle}.ui-tabela__cell-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.ui-tabela--alinhar-esquerda{text-align:left}.ui-tabela--alinhar-esquerda .ui-tabela__header-content,.ui-tabela--alinhar-esquerda .ui-tabela__cell-content{justify-content:flex-start}.ui-tabela--alinhar-centro{text-align:center}.ui-tabela--alinhar-centro .ui-tabela__header-content,.ui-tabela--alinhar-centro .ui-tabela__cell-content{justify-content:center}.ui-tabela--alinhar-direita{text-align:right}.ui-tabela--alinhar-direita .ui-tabela__header-content,.ui-tabela--alinhar-direita .ui-tabela__cell-content{justify-content:flex-end}.ui-tabela tbody tr[data-index]{cursor:pointer}.ui-tabela tbody tr.ui-tabela__tr--par{background-color:var(--ui-tabela-zebra, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 4%, transparent))}@media (hover: hover){.ui-tabela tbody tr[data-index]:hover{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}}.ui-tabela tbody tr[data-index]:active{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 12%, transparent))}:host(:not([selecionar-texto])) .ui-tabela tbody td{-webkit-user-select:none;user-select:none}.ui-tabela tbody tr.ui-tabela__tr--selecionada,.ui-tabela tbody tr[data-selecionada=true]{background-color:var(--ui-tabela-selecionada, var(--ui-cor-linha-selecionada, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 14%, transparent)))}.ui-tabela tbody tr.ui-tabela__tr--selecionada td:first-child,.ui-tabela tbody tr[data-selecionada=true] td:first-child{box-shadow:inset 3px 0 0 var(--ui-cor-primaria, #00E08A)}@media (hover: hover){.ui-tabela tbody tr.ui-tabela__tr--selecionada:hover,.ui-tabela tbody tr[data-selecionada=true]:hover{background-color:var(--ui-tabela-selecionada-hover, var(--ui-cor-linha-selecionada-hover, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 22%, transparent)))}}.ui-tabela__virtual-spacer td{padding:0!important;border:none!important;height:inherit;background:transparent!important}.ui-tabela__empty{padding:40px 24px;text-align:center;color:var(--ui-cor-texto-secundario, #9696a6);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-sizing:border-box}.ui-tabela__empty-icon{width:32px;height:32px;opacity:.5;fill:currentColor}.ui-tabela__empty-text{font-size:14px;font-weight:500;color:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__erro{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px;padding:10px 14px;border:1px solid var(--ui-cor-texto-erro, #ff5555);border-left-width:4px;border-radius:var(--ui-raio-borda, 6px);background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);color:var(--ui-cor-texto, #e1e1e6);font-size:14px;box-sizing:border-box}.ui-tabela__erro-texto{flex:1 1 200px;min-width:0}.ui-tabela__erro-detalhe{display:block;margin-top:2px;font-size:12px;color:var(--ui-cor-texto-secundario, #9696a6);overflow-wrap:anywhere}.ui-tabela__erro-acao,.ui-tabela__prompt-actions button{background:var(--ui-cor-botao-secundario-fundo, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));padding:6px 12px;border-radius:var(--ui-raio-sm, 4px);font:inherit;cursor:pointer}.ui-tabela__erro-acao:hover,.ui-tabela__prompt-actions button:hover{background:var(--ui-cor-botao-secundario-hover, rgba(255, 255, 255, .2))}.ui-tabela__erro-acao:focus-visible,.ui-tabela__prompt-actions button:focus-visible,.ui-tabela__prompt-dialog input:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px}.ui-tabela__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.ui-tabela__loading{position:absolute;top:0;left:0;right:0;bottom:0;background-color:color-mix(in srgb,var(--ui-cor-superficie, #141417) 72%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;z-index:50;color:var(--ui-cor-texto, #e1e1e6);font-size:14px}.ui-tabela__spinner{width:32px;height:32px;border:3px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A);border-radius:50%;animation:ui-tabela-spin .8s linear infinite}@keyframes ui-tabela-spin{to{transform:rotate(360deg)}}.ui-tabela__prompt-dialog{margin:0;max-width:calc(100vw - 16px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);padding:12px;box-shadow:var(--ui-sombra-lg, 0 8px 32px rgba(0, 0, 0, .8));font-family:inherit;font-size:14px}.ui-tabela__prompt-dialog::backdrop{background:#0000004d}.ui-tabela__prompt-title{display:block;margin-bottom:8px;font-weight:500}.ui-tabela__prompt-dialog input{width:100%;padding:6px 8px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));background:var(--ui-cor-superficie, #141417);color:var(--ui-cor-texto, #e1e1e6);margin-bottom:8px;box-sizing:border-box;font:inherit}.ui-tabela__prompt-dialog input[aria-invalid=true]{border-color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-erro{min-height:1.2em;margin-bottom:8px;font-size:12px;color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-actions{display:flex;justify-content:flex-end;gap:8px}.ui-tabela__prompt-actions button:last-child{background:var(--ui-cor-primaria, #00E08A);border-color:transparent;color:var(--ui-cor-texto-sobre-primaria, #000000);font-weight:600}.ui-tabela__prompt-actions button:last-child:hover{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 85%,var(--ui-cor-texto, #e1e1e6))}@media (pointer: coarse){.ui-tabela__resizer{width:16px}:host(:not([altura-linha]):not([row-height])) .ui-tabela tbody tr[data-index]{height:44px}}@media (max-width: 640px){.ui-tabela th{padding:8px 10px;font-size:12px}.ui-tabela td{padding:8px 10px;font-size:13px}}@media (prefers-reduced-motion: reduce){.ui-tabela__resizer,.ui-tabela__sort-arrow path{transition:none}.ui-tabela__spinner{animation-duration:2.4s}}';function oe(t){return t==null||t===""?"":typeof t=="number"?`${t}px`:t}function ae(t){return t==="centro"||t==="center"?"ui-tabela--alinhar-centro":t==="direita"||t==="right"?"ui-tabela--alinhar-direita":"ui-tabela--alinhar-esquerda"}function ne(t){return t==="centro"||t==="center"?"center":t==="direita"||t==="right"?"right":"left"}function te(t){return t==="compacta"?30:t==="relaxada"?56:42}function ke(t,r,e,i){t.innerHTML=`<style>${Mt}</style>`;const o=document.createElement("div");o.className="ui-tabela-container",o.setAttribute("part","base"),e&&(o.style.maxHeight=e);const a=document.createElement("div");a.className="ui-tabela__empty",a.setAttribute("part","vazio"),a.style.display="none",a.setAttribute("role","status");const n=document.createElement("div");n.innerHTML=`
|
|
2
|
+
<svg class="ui-tabela__empty-icon" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
|
|
3
|
+
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"/>
|
|
4
|
+
</svg>`;const l=document.createElement("span");l.className="ui-tabela__empty-text",l.textContent=r,a.appendChild(n),a.appendChild(l);const d=document.createElement("table");d.className="ui-tabela",d.setAttribute("part","tabela"),d.setAttribute("role","grid");const u=document.createElement("colgroup"),c=document.createElement("thead"),p=document.createElement("tbody");d.appendChild(u),d.appendChild(c),d.appendChild(p);const s=document.createElement("div");s.className="ui-tabela__erro",s.setAttribute("part","erro"),s.setAttribute("role","alert"),s.style.display="none";const h=document.createElement("div");h.className="ui-tabela__erro-texto";const m=document.createElement("span");m.className="ui-tabela__erro-mensagem";const g=document.createElement("span");g.className="ui-tabela__erro-detalhe",h.appendChild(m),h.appendChild(g);const f=document.createElement("button");f.type="button",f.className="ui-tabela__erro-acao",f.setAttribute("part","erro-acao"),f.textContent="Tentar novamente",s.appendChild(h),s.appendChild(f);const b=document.createElement("div");b.className="ui-tabela__sr",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),o.appendChild(s),o.appendChild(d),o.appendChild(a),o.appendChild(b);const y=document.createElement("div");return y.className="ui-tabela__loading",y.setAttribute("part","carregando"),y.setAttribute("role","status"),y.setAttribute("aria-live","polite"),y.style.display=i?"flex":"none",y.innerHTML=`
|
|
5
|
+
<div class="ui-tabela__spinner" aria-hidden="true"></div>
|
|
6
|
+
<span class="ui-tabela__loading-texto">Carregando dados...</span>
|
|
7
|
+
`,o.appendChild(y),t.appendChild(o),{containerElement:o,tableElement:d,theadElement:c,tbodyElement:p,colgroupElement:u,emptyElement:a,loadingElement:y,erroElement:s,anuncioElement:b}}function ze(t){var a,n;if(!t.theadElement||!t.colgroupElement)return;t.headerListeners.cleanup();const e=t.theadElement.getRootNode().activeElement,i=e&&t.theadElement.contains(e)?((a=e.closest("th"))==null?void 0:a.getAttribute("data-coluna"))??null:null;t.theadElement.innerHTML="",t.colgroupElement.innerHTML="";const o=document.createElement("tr");if(o.setAttribute("aria-rowindex","1"),t.colunas.forEach((l,d)=>{const u=document.createElement("col");l.largura!==void 0&&(u.style.width=t.formatWidth(l.largura)),t.colgroupElement.appendChild(u);const c=document.createElement("th"),p=t.getAlignmentClass(l.alinhamento);if(c.className=p,c.setAttribute("part","celula-cabecalho"),c.scope="col",c.setAttribute("data-coluna",l.id),c.style.textAlign=t.getTextAlign(l.alinhamento),l.largura!==void 0&&(c.style.width=t.formatWidth(l.largura)),l.larguraMinima!==void 0&&(c.style.minWidth=t.formatWidth(l.larguraMinima)),l.larguraMaxima!==void 0){const E=t.formatWidth(l.larguraMaxima);c.style.maxWidth=E,c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.whiteSpace="nowrap"}l.tooltip&&(c.title=l.tooltip);const s=!!l.ordenavel&&t.colunaOrdenada===l.id&&t.direcaoOrdenacao!=="original",h=s&&t.direcaoOrdenacao==="desc";if(l.ordenavel){c.classList.add("ui-tabela__th--ordenavel");const E=()=>t.onHeaderClick(l);t.headerListeners.add(c,"click",E),c.setAttribute("aria-sort",s?h?"descending":"ascending":"none")}const m=E=>t.onHeaderContextMenu(E,l,d,c);t.headerListeners.add(c,"contextmenu",m);const g=document.createElement("div");g.className="ui-tabela__header-content";const f=document.createElement("span");if(f.className="ui-tabela__header-text",f.textContent=l.rotulo,g.appendChild(f),l.ordenavel){const E=document.createElement("span");E.className="ui-tabela__sort-icon";const x=s?h?"ui-tabela__sort-arrow--desc":"ui-tabela__sort-arrow--asc":"ui-tabela__sort-arrow--inativo";E.setAttribute("aria-hidden","true"),E.innerHTML=`<svg class="ui-tabela__sort-arrow ${x}" viewBox="0 0 24 24" focusable="false"><path class="seta-cima" d="M7 11l5-5 5 5H7z"/><path class="seta-baixo" d="M7 13l5 5 5-5H7z"/></svg>`,g.appendChild(E)}if(l.ordenavel){const E=document.createElement("button");E.type="button",E.className="ui-tabela__ordenar",E.setAttribute("part","ordenar"),E.appendChild(g),c.appendChild(E)}else c.appendChild(g);const b=document.createElement("div");b.className="ui-tabela__resizer",b.setAttribute("part","redimensionador"),b.title="Arrastar para redimensionar largura (duplo-clique para auto-ajuste)",b.tabIndex=0,b.setAttribute("role","separator"),b.setAttribute("aria-orientation","vertical"),b.setAttribute("aria-label",`Redimensionar coluna ${l.rotulo}`);const y=E=>t.onInitColumnResize(E,l,d,c,b);t.headerListeners.add(b,"mousedown",y);const _=E=>{const x=E;x.pointerType==="mouse"||!x.pointerType||t.onInitColumnResize(x,l,d,c,b)};t.headerListeners.add(b,"pointerdown",_);const w=E=>{var A,L;const x=E,k=x.shiftKey?50:10;if(x.key==="ArrowRight")x.preventDefault(),(A=t.onResizeTeclado)==null||A.call(t,k,l,d,c,u);else if(x.key==="ArrowLeft")x.preventDefault(),(L=t.onResizeTeclado)==null||L.call(t,-k,l,d,c,u);else if(x.key==="Enter"||x.key==="F2"){x.preventDefault();const S=c.getBoundingClientRect();t.onHeaderContextMenu(new MouseEvent("contextmenu",{clientX:S.left,clientY:S.bottom}),l,d,c)}};t.headerListeners.add(b,"keydown",w);const C=E=>{E.stopPropagation(),t.onColumnAutoFit(l,c,u)};t.headerListeners.add(b,"dblclick",C),t.headerListeners.add(b,"click",E=>E.stopPropagation()),c.appendChild(b),o.appendChild(c)}),t.theadElement.appendChild(o),i!==null){const l=Array.from(o.children).find(d=>d.getAttribute("data-coluna")===i);(n=l==null?void 0:l.querySelector(".ui-tabela__ordenar"))==null||n.focus()}}const Nt='button, input, select, textarea, a, summary, [role="button"], [data-prevent-select]';function Tt(t,r){for(const e of t.composedPath()){if(e===r)return!1;if(e instanceof Element&&e.matches(Nt))return!0}return!1}function Se(t){if(!t.tbodyElement||!t.tableElement||!t.emptyElement||!t.containerElement)return;if(t.tableElement.setAttribute("aria-colcount",String(t.colunas.length)),!t.dadosExibicao||t.dadosExibicao.length===0){t.tbodyElement.innerHTML="",t.tableElement.setAttribute("aria-rowcount","1"),t.tableElement.style.display=t.colunas.length>0?"table":"none",t.emptyElement.style.display="flex";const s=t.emptyElement.querySelector(".ui-tabela__empty-text"),h=t.filtroAtivo?t.textoSemResultados:t.textoVazio;s&&h!==void 0&&(s.textContent=h);return}t.emptyElement.style.display="none",t.tableElement.style.display="table",t.tableElement.setAttribute("aria-rowcount",String(t.dadosExibicao.length+1));const r=t.dadosExibicao.length,e=t.rowHeight,i=t.virtualizar&&r>30;let o=0,a=r;if(i){const s=t.containerElement.scrollTop,h=t.containerElement.clientHeight||400,m=5;o=Math.max(0,Math.floor(s/e)-m),a=Math.min(r,Math.ceil((s+h)/e)+m)}const l=t.tbodyElement.getRootNode().activeElement,d=l&&l.parentElement===t.tbodyElement?l.getAttribute("data-index"):null,u=t.indiceAtivo??null,c=u!==null&&u>=o&&u<a?u:o;t.tbodyElement.innerHTML="";const p=document.createDocumentFragment();if(i&&o>0){const s=document.createElement("tr");s.className="ui-tabela__virtual-spacer",s.setAttribute("aria-hidden","true"),s.style.height=`${o*e}px`;const h=document.createElement("td");h.colSpan=t.colunas.length||1,s.appendChild(h),p.appendChild(s)}for(let s=o;s<a;s++){const h=t.dadosExibicao[s],m=document.createElement("tr");m.setAttribute("data-index",String(s)),m.setAttribute("part","linha"),m.setAttribute("aria-rowindex",String(s+2)),m.setAttribute("aria-selected","false"),m.tabIndex=s===c?0:-1,s%2===1&&m.classList.add("ui-tabela__tr--par");const g=t.chaveId;h[g]!==void 0?m.setAttribute("data-id",String(h[g])):h.id!==void 0?m.setAttribute("data-id",String(h.id)):h._id!==void 0&&m.setAttribute("data-id",String(h._id)),t.isItemSelecionado(h,s)&&(m.classList.add("ui-tabela__tr--selecionada"),m.setAttribute("part","linha linha-selecionada"),m.setAttribute("aria-current","true"),m.setAttribute("aria-selected","true"),m.setAttribute("data-selecionada","true")),m.addEventListener("click",f=>{Tt(f,m)||t.onLinhaClique(h,s)}),t.colunas.forEach(f=>{const b=document.createElement("td"),y=t.getAlignmentClass(f.alinhamento);if(b.className=y,b.setAttribute("part","celula"),b.style.textAlign=t.getTextAlign(f.alinhamento),f.larguraMaxima!==void 0){const C=t.formatWidth(f.larguraMaxima);b.style.maxWidth=C,b.style.overflow="hidden",b.style.textOverflow="ellipsis",b.style.whiteSpace="nowrap"}const _=document.createElement("div");_.className="ui-tabela__cell-content",f.larguraMaxima!==void 0&&_.classList.add("ui-tabela__cell-truncate");const w=h[f.id];if(typeof f.render=="function")try{const C=f.render(w,h,s);C instanceof Node?_.appendChild(C):_.textContent=String(C??"")}catch(C){console.error(`[ui-tabela] Erro no render da coluna "${f.id}" (linha ${s}):`,C),_.textContent=""}else if(w instanceof Node)_.appendChild(w);else{const C=w!=null?String(w):"";_.textContent=C,f.larguraMaxima!==void 0&&!f.tooltip&&(b.title=C)}b.appendChild(_),m.appendChild(b)}),p.appendChild(m)}if(i&&a<r){const s=document.createElement("tr");s.className="ui-tabela__virtual-spacer",s.setAttribute("aria-hidden","true"),s.style.height=`${(r-a)*e}px`;const h=document.createElement("td");h.colSpan=t.colunas.length||1,s.appendChild(h),p.appendChild(s)}if(t.tbodyElement.appendChild(p),d!==null){const s=t.tbodyElement.querySelector(`tr[data-index="${d}"]`);s==null||s.focus({preventScroll:!0})}}function fe(t){if(t===void 0)return null;const r=typeof t=="number"?t:parseInt(t,10);return isNaN(r)?null:r}function X(t,r){const e=fe(t.larguraMinima);let i=Math.max(e??60,r);const o=fe(t.larguraMaxima);return o!==null&&(i=Math.min(o,i)),i}function Le(t,r,e,i){const o=X(t,r.offsetWidth+i);return t.largura=`${o}px`,r.style.width=`${o}px`,e&&(e.style.width=`${o}px`),`${o}px`}function Me(t){const{evento:r,coluna:e,colIndex:i,thElement:o,resizer:a,colgroupElement:n,onResizeStart:l,onResizeEnd:d,onResizeCancel:u}=t;r.stopPropagation(),r.preventDefault(),l(),a.classList.add("ui-tabela__resizer--ativo");const c=r.pageX,p=o.offsetWidth,s=n==null?void 0:n.children[i],h=r.type==="pointerdown",m=h?r.pointerId:null,g=h?"pointermove":"mousemove",f=h?"pointerup":"mouseup";let b=!1;const y=C=>{const E=C;if(m!==null&&E.pointerId!==m)return;b=!0;const x=X(e,p+(E.pageX-c));e.largura=`${x}px`,o.style.width=`${x}px`,s&&(s.style.width=`${x}px`)},_=()=>{w(),b?d(String(e.largura)):u==null||u()},w=()=>{a.classList.remove("ui-tabela__resizer--ativo"),window.removeEventListener(g,y),window.removeEventListener(f,_),h&&window.removeEventListener("pointercancel",_)};return window.addEventListener(g,y),window.addEventListener(f,_),h&&window.addEventListener("pointercancel",_),w}const H=20;let Rt=0;function Ne(t){var L;const{evento:r,coluna:e,colIndex:i,thElement:o,colgroupElement:a,shadow:n,onResizeEnd:l}=t,d=`ui-tabela-dlg-${++Rt}`,u=document.createElement("dialog");u.className="ui-tabela__prompt-dialog",u.setAttribute("part","dialogo"),u.setAttribute("aria-labelledby",`${d}-titulo`);const c=document.createElement("label");c.className="ui-tabela__prompt-title",c.id=`${d}-titulo`,c.htmlFor=`${d}-campo`,c.textContent=`Largura de "${e.rotulo}" (px; vazio = automática)`;const p=document.createElement("input");p.id=`${d}-campo`,p.type="number",p.min=String(H),p.step="1",p.setAttribute("inputmode","numeric"),p.placeholder="auto";const s=e.largura?parseInt(String(e.largura),10):NaN;p.value=Number.isFinite(s)?String(s):"";const h=document.createElement("div");h.className="ui-tabela__prompt-erro",h.id=`${d}-erro`,h.setAttribute("role","alert");const m=document.createElement("div");m.className="ui-tabela__prompt-actions";const g=document.createElement("button");g.type="button",g.textContent="Aplicar";const f=document.createElement("button");f.type="button",f.textContent="Cancelar",m.appendChild(f),m.appendChild(g),u.appendChild(c),u.appendChild(p),u.appendChild(h),u.appendChild(m),n.appendChild(u),typeof u.showModal=="function"?u.showModal():u.setAttribute("open",""),u.style.position="fixed";const b=u.getBoundingClientRect(),y=b.width||240,_=b.height||140,w=Math.max(8,Math.min(r.clientX||0,window.innerWidth-y-8)),C=Math.max(8,Math.min(r.clientY||0,window.innerHeight-_-8));u.style.left=`${w}px`,u.style.top=`${C}px`;let E=!1;const x=()=>{var S;E||(E=!0,u.open&&typeof u.close=="function"&&u.close(),u.remove(),(S=o.querySelector(".ui-tabela__ordenar, .ui-tabela__resizer"))==null||S.focus())},k=S=>{h.textContent=S,p.setAttribute("aria-invalid","true"),p.setAttribute("aria-describedby",h.id),p.focus()},A=()=>{const S=e.largura,he=p.value.trim();if(he==="")e.largura=void 0,o.style.width="",a!=null&&a.children[i]&&(a.children[i].style.width="");else{const Z=Number(he);if(!Number.isFinite(Z)||Z<H){k(`Informe um valor de pelo menos ${H} px, ou deixe vazio para automática.`);return}const J=Math.round(X({...e,larguraMinima:e.larguraMinima??H},Z));e.largura=`${J}px`,o.style.width=`${J}px`,a!=null&&a.children[i]&&(a.children[i].style.width=`${J}px`)}x(),e.largura!==S&&l(e.largura?String(e.largura):"auto")};g.addEventListener("click",S=>{S.stopPropagation(),A()}),f.addEventListener("click",S=>{S.stopPropagation(),x()}),u.addEventListener("close",x),p.addEventListener("input",()=>{h.textContent="",p.removeAttribute("aria-invalid"),p.removeAttribute("aria-describedby")}),p.addEventListener("keydown",S=>{S.key==="Enter"?(S.preventDefault(),A()):S.key==="Escape"&&(S.preventDefault(),x())}),p.focus(),(L=p.select)==null||L.call(p)}function Te(t,r,e,i,o,a){return Me({evento:t,coluna:r,colIndex:e,thElement:i,resizer:o,colgroupElement:a.colgroupElement,onResizeStart:()=>a.onSetIsResizing(!0),onResizeCancel:()=>{setTimeout(()=>a.onSetIsResizing(!1),50)},onResizeEnd:n=>{setTimeout(()=>a.onSetIsResizing(!1),50),a.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:r.id,largura:n},bubbles:!0,composed:!0}))}})}function Re(t,r,e,i,o){t.preventDefault(),t.stopPropagation(),Ne({evento:t,coluna:r,colIndex:e,thElement:i,colgroupElement:o.colgroupElement,shadow:o.shadow,onResizeEnd:a=>{o.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:r.id,largura:a},bubbles:!0,composed:!0}))}})}function De(t,r,e,i,o){const a=Le(r,e,i,t);o.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:r.id,largura:a},bubbles:!0,composed:!0}))}function Oe(t){ze({theadElement:t.theadElement,colgroupElement:t.colgroupElement,colunas:t.colunas,colunaOrdenada:t.dadosController.getColunaOrdenada(),direcaoOrdenacao:t.dadosController.getDirecaoOrdenacao(),headerListeners:t.headerListeners,formatWidth:oe,getAlignmentClass:ae,getTextAlign:ne,onHeaderClick:r=>t.onHeaderClick(r),onHeaderContextMenu:(r,e,i,o)=>{Re(r,e,i,o,{host:t.host,colgroupElement:t.colgroupElement,shadow:t.shadow,onSetIsResizing:t.onSetIsResizing})},onInitColumnResize:(r,e,i,o,a)=>{const n=Te(r,e,i,o,a,{host:t.host,colgroupElement:t.colgroupElement,shadow:t.shadow,onSetIsResizing:t.onSetIsResizing});t.onActiveResizeCleanup(n)},onResizeTeclado:(r,e,i,o,a)=>{De(r,e,o,a,{host:t.host,colgroupElement:t.colgroupElement,shadow:t.shadow,onSetIsResizing:t.onSetIsResizing})},onColumnAutoFit:(r,e,i)=>{r.largura=void 0,e.style.width="",i.style.width="",t.host.dispatchEvent(new CustomEvent("ui-column-resize",{bubbles:!0,composed:!0,detail:{idColuna:r.id,largura:"auto"}}))}})}function Ie(t){Se({tbodyElement:t.tbodyElement,tableElement:t.tableElement,emptyElement:t.emptyElement,containerElement:t.containerElement,dadosExibicao:t.dadosController.getDadosExibicao(),colunas:t.colunas,chaveId:t.chaveId,virtualizar:t.virtualizar,rowHeight:t.rowHeight,indiceAtivo:t.indiceAtivo,filtroAtivo:t.dadosController.temFiltro(),textoVazio:t.textoVazio,textoSemResultados:t.textoSemResultados,isItemSelecionado:(r,e)=>t.selecaoController.isItemSelecionado(r,e),onLinhaClique:(r,e)=>{t.selecaoController.setItemSelecionado(r),t.host.dispatchEvent(new CustomEvent("ui-linha-clique",{bubbles:!0,composed:!0,detail:{item:r,indice:e}}))},formatWidth:oe,getAlignmentClass:ae,getTextAlign:ne})}function Pe(t,r){let e=!1;const i=()=>{e||(window.requestAnimationFrame(()=>{try{r()}finally{e=!1}}),e=!0)};return t.addEventListener("scroll",i),i}function Be(t,r,e,i){return ke(t,r,e,i)}function se(t){const r=t.host.getAttribute("texto-vazio")||t.host.getAttribute("empty-text");r&&t.onTextoVazioAlterado(r);const e=t.host.getAttribute("virtualizar")||t.host.getAttribute("virtualize");e!==null&&t.onVirtualizarAlterado(e!=="false"),t.onSrcLido(t.host.getAttribute("src"));const i=t.host.hasAttribute("carregando")||t.host.hasAttribute("loading");t.onCarregandoAlterado(i),t.loadingElement&&(t.loadingElement.style.display=i?"flex":"none")}function Fe(t,r,e){if(se(e),t==="src"){r&&e.host.isConnected&&e.onCarregarSrc(r);return}if(t==="max-height"&&e.containerElement){e.containerElement.style.maxHeight=r||"";return}if((t==="texto-vazio"||t==="empty-text")&&e.emptyElement){const i=e.emptyElement.querySelector(".ui-tabela__empty-text");i&&r&&(i.textContent=r),e.onRenderBody();return}if(t==="carregando"||t==="loading"){e.loadingElement&&(e.loadingElement.style.display=r!==null?"flex":"none");return}if(t==="densidade"||t==="density"){e.onRenderBody();return}e.onRenderTotal()}function Dt(t,r,e,i){if(t==="Enter"||t===" ")return{tipo:"ativar"};if(!Number.isInteger(r)||!Number.isInteger(e)||e<0)return null;const o=Math.max(1,Math.floor(Number.isFinite(i)?i:1)),a=n=>Math.min(e,Math.max(0,n));switch(t){case"ArrowDown":return{tipo:"mover",indice:a(r+1)};case"ArrowUp":return{tipo:"mover",indice:a(r-1)};case"Home":return{tipo:"mover",indice:0};case"End":return{tipo:"mover",indice:e};case"PageDown":return{tipo:"mover",indice:a(r+o)};case"PageUp":return{tipo:"mover",indice:a(r-o)};default:return null}}const Ot="Não foi possível carregar os dados.",It="Nenhum resultado para o filtro";function Pt(t,r,e,i){if(!t)return;if(!r){t.style.display="none";return}const o=t.querySelector(".ui-tabela__erro-mensagem"),a=t.querySelector(".ui-tabela__erro-detalhe");o&&(o.textContent=e||Ot),a&&(a.textContent=r.erro||"");const n=t.querySelector(".ui-tabela__erro-acao");n&&(n.style.display=i?"":"none"),t.style.display="flex"}function Bt(t,r,e,i){t&&(t.textContent=e?r===0?i:`${r} ${r===1?"registro encontrado":"registros encontrados"}`:"")}function Ft({tabela:t,container:r},e,i){t&&(e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label"),t.setAttribute("aria-busy",String(i)),r&&(e?(r.setAttribute("role","region"),r.setAttribute("aria-label",e)):(r.removeAttribute("role"),r.removeAttribute("aria-label"))))}const Vt=800;function be(t,r,e){const i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),a=i.top+t.clientTop+e,n=i.top+t.clientTop+t.clientHeight;return o.top<a?o.top-a:o.bottom>n?Math.min(o.bottom-n,o.top-a):0}function ge(t,r,e){e==="smooth"&&typeof t.scrollTo=="function"?t.scrollTo({top:r,behavior:"smooth"}):t.scrollTop=r}class Ht{constructor(r){v(this,"cancelarCorrecao",null);this.p=r}alturaCabecalho(){var r;return((r=this.p.cabecalho())==null?void 0:r.offsetHeight)??0}linhasPorPagina(){var e;const r=(((e=this.p.container())==null?void 0:e.clientHeight)??0)-this.alturaCabecalho();return Math.max(1,Math.floor(r/this.p.alturaLinha()))}focar(r){const e=this.p.container(),i=this.p.tbody();if(!e||!i)return;this.p.aoLinhaAtiva(r);const o=`tr[data-index="${r}"]`;let a=i.querySelector(o);if(a||(e.scrollTop=Math.max(0,r*this.p.alturaLinha()-e.clientHeight/2),this.p.renderizarCorpo(),a=i.querySelector(o)),!a)return;a.focus({preventScroll:!0});const n=be(e,a,this.alturaCabecalho());n&&(e.scrollTop+=n)}posicionar(r,e){const i=this.p.container(),o=this.p.tbody();if(!i||!o)return!1;this.cancelar();const a=()=>o.querySelector(`tr[data-index="${r}"]`),n=p=>{const s=a();if(!s)return;const h=be(i,s,this.alturaCabecalho());h&&ge(i,i.scrollTop+h,p)};if(a())return n(e),!0;const l=()=>{i.scrollTop=Math.max(0,r*this.p.alturaLinha()),this.p.renderizarCorpo(),n("auto"),this.p.renderizarCorpo()};if(e==="auto")return l(),!0;ge(i,Math.max(0,r*this.p.alturaLinha()),"smooth");let d=!0;const u=()=>{d&&(this.cancelar(),this.p.renderizarCorpo(),a()?n("smooth"):l())},c=window.setTimeout(u,Vt);return i.addEventListener("scrollend",u,{once:!0}),this.cancelarCorrecao=()=>{d=!1,window.clearTimeout(c),i.removeEventListener("scrollend",u),this.cancelarCorrecao=null},!0}cancelar(){var r;(r=this.cancelarCorrecao)==null||r.call(this)}}class Ve extends P.SafeHTMLElement{constructor(){super();v(this,"shadow");v(this,"_colunas",[]);v(this,"_textoVazio","Nenhum registro encontrado");v(this,"_virtualizar",!0);v(this,"_isResizing",!1);v(this,"_carregando",!1);v(this,"_src",null);v(this,"_fetchOpcoes",null);v(this,"_fetcher",null);v(this,"_containerElement",null);v(this,"_tableElement",null);v(this,"_theadElement",null);v(this,"_tbodyElement",null);v(this,"_colgroupElement",null);v(this,"_emptyElement",null);v(this,"_loadingElement",null);v(this,"_erroElement",null);v(this,"_anuncioElement",null);v(this,"_erro",null);v(this,"_scrollHandler",null);v(this,"_activeResizeCleanup",null);v(this,"_headerListeners",new U.ListenerBag);v(this,"_corpoListeners",new U.ListenerBag);v(this,"_indiceAtivo",null);v(this,"_alturaLinhaMedida",null);v(this,"rolagem",new Ht({container:()=>this._containerElement,tbody:()=>this._tbodyElement,cabecalho:()=>this._theadElement,alturaLinha:()=>this.getRowHeight(),renderizarCorpo:()=>this.renderBody(),aoLinhaAtiva:e=>{this._indiceAtivo=e}}));v(this,"remotaController");v(this,"selecaoController");v(this,"dadosController",new Ce);v(this,"handleFocoLinha",e=>{const i=e.target;i.parentElement!==this._tbodyElement||!i.hasAttribute("data-index")||this.definirLinhaAtiva(Number(i.getAttribute("data-index")))});v(this,"handleTecladoCorpo",e=>{const i=e.target;if(i.parentElement!==this._tbodyElement||!i.hasAttribute("data-index"))return;const o=this.dadosController.getDadosExibicao().length-1,a=Dt(e.key,Number(i.getAttribute("data-index")),o,this.rolagem.linhasPorPagina());a&&(e.preventDefault(),a.tipo==="ativar"?i.click():this.rolagem.focar(a.indice))});this.shadow=this.attachShadow({mode:"open"}),this.remotaController=new _e({host:this,onCarregandoAlterado:e=>{this.carregando=e},onDadosRecebidos:e=>{this.dados=e},getOpcoes:()=>this._fetchOpcoes,getFetcher:()=>this._fetcher}),this.selecaoController=new ye({host:this,getTbody:()=>this._tbodyElement,getDadosExibicao:()=>this.dadosController.getDadosExibicao(),getDadosOriginais:()=>this.dadosController.getDadosOriginais(),getChaveId:()=>this.chaveId,onRolarParaIndice:(e,i)=>this.rolagem.posicionar(e,i),onLinhaAtiva:e=>this.definirLinhaAtiva(e)}),this.addEventListener("ui-fetch-erro",e=>this.mostrarErro(e.detail)),this.addEventListener("ui-fetch-start",()=>this.mostrarErro(null)),this.addEventListener("ui-fetch-sucesso",()=>this.mostrarErro(null))}static get observedAttributes(){return["texto-vazio","empty-text","max-height","densidade","density","altura-linha","row-height","virtualizar","virtualize","src","carregando","loading","chave-id","id-key","aria-label","ordenacao-remota","texto-erro","texto-sem-resultados","texto-carregando"]}connectedCallback(){this.syncAttributes(),this.alturaLinha&&this.style.setProperty("--ui-tabela-altura-linha",`${this.alturaLinha}px`),!this.hasAttribute("densidade")&&!this.hasAttribute("density")&&this.setAttribute("densidade","normal"),this.renderTotal(),this._src&&this.remotaController.carregar(this._src)}disconnectedCallback(){this.cleanupEventListeners()}attributeChangedCallback(e,i,o){e==="ordenacao-remota"&&(this.dadosController.setOrdenacaoRemota(o!==null),this.atualizarContextoSelecao()),(e==="densidade"||e==="density"||e==="altura-linha"||e==="row-height")&&(this._alturaLinhaMedida=null),(e==="altura-linha"||e==="row-height")&&this.aplicarAlturaLinha(),(e==="chave-id"||e==="id-key")&&this.atualizarContextoSelecao(),Fe(e,o,this.obterContextoAtributos()),this.sincronizarAria()}sincronizarAria(){this._tableElement&&(Ft({tabela:this._tableElement,container:this._containerElement},this.getAttribute("aria-label"),this._carregando),this.atualizarTextosEstado())}atualizarTextosEstado(){var i;const e=(i=this._loadingElement)==null?void 0:i.querySelector(".ui-tabela__loading-texto");e&&(e.textContent=this.getAttribute("texto-carregando")||"Carregando dados..."),this.renderizarErro()}mostrarErro(e){this._erro=e,this.renderizarErro()}renderizarErro(){Pt(this._erroElement,this._erro,this.getAttribute("texto-erro"),!!this._src)}anunciarResultado(){Bt(this._anuncioElement,this.dadosController.getDadosExibicao().length,this.dadosController.temFiltro(),this._textoSemResultados())}_textoSemResultados(){return this.getAttribute("texto-sem-resultados")||It}syncAttributes(){se(this.obterContextoAtributos())}obterContextoAtributos(){return{host:this,containerElement:this._containerElement,emptyElement:this._emptyElement,loadingElement:this._loadingElement,onTextoVazioAlterado:e=>{this._textoVazio=e},onVirtualizarAlterado:e=>{this._virtualizar=e},onSrcLido:e=>{this._src=e},onCarregarSrc:e=>{this.remotaController.carregar(e)},onCarregandoAlterado:e=>{this._carregando=e},onRenderBody:()=>this.renderBody(),onRenderTotal:()=>this.renderTotal()}}get src(){return this._src}set src(e){this._src=e,e?this.setAttribute("src",e):this.removeAttribute("src")}get carregando(){return this._carregando}set carregando(e){this._carregando=!!e,this._carregando?this.setAttribute("carregando",""):(this.removeAttribute("carregando"),this.removeAttribute("loading")),this._loadingElement&&(this._loadingElement.style.display=this._carregando?"flex":"none"),this.sincronizarAria()}get fetchOpcoes(){return this._fetchOpcoes}set fetchOpcoes(e){this._fetchOpcoes=e??null}get fetcher(){return this._fetcher}set fetcher(e){this._fetcher=typeof e=="function"?e:null}get ordenacaoRemota(){return this.hasAttribute("ordenacao-remota")}set ordenacaoRemota(e){this.toggleAttribute("ordenacao-remota",!!e)}async carregarDoEndpoint(e){return e&&e!==this._src&&(this.src=e),this.remotaController.carregar(e||this._src||"")}async recarregar(){return this._src?this.remotaController.carregar(this._src):(this.dadosController.aplicarOrdenacao(),this.atualizarContextoSelecao(),this.renderBody(),!0)}filtrar(e){this.dadosController.filtrar(e),this.atualizarContextoSelecao(),this.renderBody()}cleanupEventListeners(){this._containerElement&&this._scrollHandler&&(this._containerElement.removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._activeResizeCleanup&&(this._activeResizeCleanup(),this._activeResizeCleanup=null,this._isResizing=!1),this.rolagem.cancelar(),this.remotaController.abortar(),this._headerListeners.cleanup(),this._corpoListeners.cleanup()}get colunas(){return this._colunas}set colunas(e){this._colunas=Array.isArray(e)?e.filter(i=>i!=null).map(i=>({...i})):[],this.dadosController.setColunas(this._colunas),this.dadosController.setColunasFiltro(this._colunas.map(i=>i.id)),this._alturaLinhaMedida=null,this.renderTotal()}get dados(){return this.dadosController.getDadosOriginais()}set dados(e){this.dadosController.setDadosOriginais(e),this.atualizarContextoSelecao(),this.renderBody()}get itens(){return this.dados}set itens(e){this.dados=e}get chaveId(){return this.getAttribute("chave-id")||this.getAttribute("id-key")||"id"}set chaveId(e){e?this.setAttribute("chave-id",e):(this.removeAttribute("chave-id"),this.removeAttribute("id-key")),this.atualizarContextoSelecao()}get itemSelecionado(){return this.selecaoController.getItemSelecionado()}set itemSelecionado(e){this.selecaoController.setItemSelecionado(e)}get indiceSelecionado(){return this.selecaoController.getIndiceSelecionado()}set indiceSelecionado(e){this.selecaoController.setIndiceSelecionado(e)}limparSelecao(){this.selecaoController.limparSelecao()}get densidade(){const e=this.getAttribute("densidade")||this.getAttribute("density");return e==="compacta"||e==="compact"?"compacta":e==="relaxada"||e==="relaxed"?"relaxada":"normal"}set densidade(e){e?this.setAttribute("densidade",e):(this.removeAttribute("densidade"),this.removeAttribute("density")),this.renderBody()}get virtualizar(){return this._virtualizar}set virtualizar(e){this._virtualizar=!!e,e?this.setAttribute("virtualizar","true"):this.removeAttribute("virtualizar"),this.renderTotal()}get colunaOrdenada(){return this.dadosController.getColunaOrdenada()}set colunaOrdenada(e){this.dadosController.setColunaOrdenada(e),this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody()}get direcaoOrdenacao(){return this.dadosController.getDirecaoOrdenacao()}set direcaoOrdenacao(e){this.dadosController.setDirecaoOrdenacao(e),this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody()}get textoVazio(){return this._textoVazio}set textoVazio(e){this._textoVazio=e||"Nenhum registro encontrado",this.renderTotal()}handleHeaderClick(e){if(!e.ordenavel||this._isResizing)return;const i=this.dadosController.getColunaOrdenada(),o=this.dadosController.getDirecaoOrdenacao(),a=this.dadosController.alternarOrdenacaoColuna(e);if(!a)return;this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody();const n=new CustomEvent("ui-sort",{detail:a,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(n),n.defaultPrevented&&(this.dadosController.restaurarOrdenacao(i,o),this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody())}get alturaLinha(){const e=this.getAttribute("altura-linha")??this.getAttribute("row-height"),i=e===null?NaN:parseFloat(e);return Number.isFinite(i)&&i>0?i:null}set alturaLinha(e){e&&e>0?this.setAttribute("altura-linha",String(e)):(this.removeAttribute("altura-linha"),this.removeAttribute("row-height"))}aplicarAlturaLinha(){const e=this.alturaLinha;e?this.style.setProperty("--ui-tabela-altura-linha",`${e}px`):this.style.removeProperty("--ui-tabela-altura-linha"),this.renderBody()}getRowHeight(){return this.alturaLinha??this._alturaLinhaMedida??te(this.densidade)}medirAlturaLinha(){if(this._alturaLinhaMedida!==null||!this._tbodyElement)return;const e=this._tbodyElement.querySelectorAll("tr[data-index]");if(e.length===0)return;let i=0;e.forEach(a=>{i+=a.getBoundingClientRect().height});const o=i/e.length;o<=0||(this._alturaLinhaMedida=o,Math.abs(o-te(this.densidade))>.5&&this.renderBody())}atualizarContextoSelecao(){this.selecaoController.reconciliar(),this._indiceAtivo=this.selecaoController.getIndiceSelecionado()}renderTotal(){var e;if(this.shadow){if(this._containerElement){if(this._containerElement.style.maxHeight=this.getAttribute("max-height")||"",this._emptyElement){const i=this._emptyElement.querySelector(".ui-tabela__empty-text");i&&(i.textContent=this._textoVazio)}}else{this.cleanupEventListeners();const i=Be(this.shadow,this._textoVazio,this.getAttribute("max-height"),this._carregando);this._containerElement=i.containerElement,this._tableElement=i.tableElement,this._colgroupElement=i.colgroupElement,this._theadElement=i.theadElement,this._tbodyElement=i.tbodyElement,this._emptyElement=i.emptyElement,this._loadingElement=i.loadingElement,this._erroElement=i.erroElement,this._anuncioElement=i.anuncioElement,(e=i.erroElement.querySelector(".ui-tabela__erro-acao"))==null||e.addEventListener("click",()=>{this.recarregar()})}this.renderHeader(),this.renderBody(),this._virtualizar&&this._containerElement&&!this._scrollHandler&&(this._scrollHandler=Pe(this._containerElement,()=>this.renderBody())),this._tbodyElement&&this._corpoListeners.size===0&&(this._corpoListeners.add(this._tbodyElement,"keydown",this.handleTecladoCorpo),this._corpoListeners.add(this._tbodyElement,"focusin",this.handleFocoLinha)),this.sincronizarAria()}}definirLinhaAtiva(e){this._indiceAtivo=e;const i=this._tbodyElement,o=i==null?void 0:i.querySelector(`tr[data-index="${e}"]`);!i||!o||(i.querySelectorAll('tr[tabindex="0"]').forEach(a=>{a!==o&&(a.tabIndex=-1)}),o.tabIndex=0)}obterContextoRenderizador(){return{host:this,shadow:this.shadow,theadElement:this._theadElement,colgroupElement:this._colgroupElement,tbodyElement:this._tbodyElement,tableElement:this._tableElement,emptyElement:this._emptyElement,containerElement:this._containerElement,colunas:this._colunas,dadosController:this.dadosController,selecaoController:this.selecaoController,chaveId:this.chaveId,virtualizar:this._virtualizar,rowHeight:this.getRowHeight(),indiceAtivo:this._indiceAtivo,textoVazio:this._textoVazio,textoSemResultados:this._textoSemResultados(),headerListeners:this._headerListeners,onSetIsResizing:e=>{this._isResizing=e},onActiveResizeCleanup:e=>{this._activeResizeCleanup=e},onHeaderClick:e=>this.handleHeaderClick(e)}}renderHeader(){Oe(this.obterContextoRenderizador())}renderBody(){Ie(this.obterContextoRenderizador()),this.anunciarResultado(),this.medirAlturaLinha()}rolarPara(e,i){return this.selecaoController.rolarPara(e,i)}rolarParaIndice(e,i){return this.selecaoController.rolarPara(e,{...i,porIndice:!0})}}P.definirCustomElement("ui-tabela",Ve);const T=Math.PI/180,ve=64;function R(t){return Math.abs(t)<1e-12?0:Number(t.toPrecision(15))}const qt={sqrt:Math.sqrt,abs:Math.abs,round:Math.round,floor:Math.floor,ceil:Math.ceil,trunc:Math.trunc,sign:Math.sign,log:Math.log10,ln:Math.log,deg:t=>R(t/T),rad:t=>R(t*T),sin:t=>R(Math.sin(t*T)),cos:t=>R(Math.cos(t*T)),tan:t=>R(Math.tan(t*T)),asin:t=>R(Math.asin(t)/T),acos:t=>R(Math.acos(t)/T),atan:t=>R(Math.atan(t)/T)},$t={min:t=>t.length>0?Math.min(...t):NaN,max:t=>t.length>0?Math.max(...t):NaN,pow:t=>t.length===2?Math.pow(t[0],t[1]):NaN,hypot:t=>t.length>=2?Math.hypot(...t):NaN,atan2:t=>t.length===2?R(Math.atan2(t[0],t[1])/T):NaN,mod:t=>t.length===2&&t[1]!==0?t[0]%t[1]:NaN};function He(t){if(!t||typeof t!="string")return null;let r=t.trim();if(r.startsWith("=")&&(r=r.slice(1).trim()),!r)return null;r=r.replace(/(\d),(\d)/g,"$1.$2");let e=0,i=0,o=!1;function a(){return r[e]||""}function n(){return r[e++]||""}function l(){for(;e<r.length&&/\s/.test(r[e]);)e++}function d(){if(++i>ve)throw new Error("Profundidade máxima excedida");try{l();let s=u();for(l();e<r.length;){const h=a();if(h==="+"||h==="-"){n(),l();const m=u(),g=o;l(),g?s=h==="+"?s+s*m:s-s*m:s=h==="+"?s+m:s-m,o=!1}else break}return s}finally{i--}}function u(){l();let s=c(),h=o;for(l();e<r.length;){const m=a();if(m==="*"||m==="/"||m==="x"||m==="X"){n(),l();const g=c();if(h=!1,m==="/"&&g===0)throw new Error("Divisão por zero");s=m==="/"?s/g:s*g,l()}else break}return o=h,s}function c(){if(++i>ve)throw new Error("Profundidade máxima excedida");try{l();const s=a();if(s==="+"||s==="-"){n();const g=c();return s==="-"?-g:g}let h=p();const m=o;if(l(),a()==="^"){n();const g=c();h=Math.pow(h,g),o=!1}else if(r.slice(e,e+2)==="**"){e+=2;const g=c();h=Math.pow(h,g),o=!1}else o=m;return h}finally{i--}}function p(){l(),o=!1;const s=a();if(s==="+"||s==="-"){n();const f=p();return s==="-"?-f:f}if(s==="("){n();const f=d();if(l(),n()!==")")throw new Error("Parêntese sem fechamento");return l(),a()==="%"?(n(),o=!0,f/100):(o=!1,f)}const h=r.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);if(h){const f=h[1].toLowerCase(),b=qt[f],y=$t[f];if(!b&&!y)throw new Error("Função desconhecida: "+h[1]);e+=h[0].length;const _=[d()];for(l();a()===";"||a()===",";)n(),l(),_.push(d()),l();if(n()!==")")throw new Error("Parêntese sem fechamento");const w=y?y(_):_.length===1&&b?b(_[0]):NaN;if(isNaN(w))throw new Error("Resultado inválido de função");return l(),a()==="%"?(n(),o=!0,w/100):(o=!1,w)}const m=r.slice(e).match(/^(pi|π|e)\b/i);if(m){e+=m[0].length;let b=m[1].toLowerCase()==="e"?Math.E:Math.PI;return l(),a()==="%"&&(n(),o=!0,b=b/100),b}const g=r.slice(e).match(/^(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|,[0-9]+)(?:[eE][+-]?[0-9]+)?/);if(g){e+=g[0].length;let f=parseFloat(g[0].replace(",","."));return l(),a()==="%"&&(n(),o=!0,f=f/100),f}throw new Error("Caractere inválido: "+s)}try{const s=d();return l(),e<r.length?null:typeof s=="number"&&isFinite(s)?s:null}catch{return null}}const le='.ui-prop__categoria--aberta .ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__categoria--aberta .ui-prop__linha select:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-cor-container';function de(t,r){if(!t)return null;const e=String(r);return Array.from(t.querySelectorAll("[data-prop-id]")).find(i=>i.getAttribute("data-prop-id")===e)??null}const qe=new WeakMap;function M(t,r){qe.set(t,r)}function re(t,r,e){var a,n;const i=de(t,r),o=(a=i==null?void 0:i.querySelector(".ui-prop__col-valor"))==null?void 0:a.firstElementChild;o&&((n=qe.get(o))==null||n(e))}function B(t,r,e=(o,a)=>o===String(a),i=o=>o==null||o===""?"—":String(o)){var n;(n=t.querySelector("option[data-externa]"))==null||n.remove();const o=Array.from(t.options).find(l=>!l.hasAttribute("data-acao")&&e(l.value,r));if(o){o.selected=!0;return}const a=document.createElement("option");a.value=r==null?"":String(r),a.textContent=i(r),a.setAttribute("data-externa",""),a.hidden=!0,t.insertBefore(a,t.firstChild),a.selected=!0}function F(t,r){var i;(i=t.querySelector("option[data-externa]"))==null||i.remove();const e=document.createElement("option");e.value="",e.textContent=r,e.setAttribute("data-externa",""),e.setAttribute("data-misto",""),e.hidden=!0,e.disabled=!0,t.insertBefore(e,t.firstChild),e.selected=!0}function $e(t,r){const e=Array.from(t.querySelectorAll(le)),i=e.indexOf(r);if(i!==-1&&i+1<e.length){const o=e[i+1];o.focus(),o instanceof HTMLInputElement&&o.select()}}function je(t,r){const e=Array.from(t.querySelectorAll(le)),i=e.indexOf(r);if(i>0){const o=e[i-1];o.focus(),o instanceof HTMLInputElement&&o.select()}}function Ue(t){const r=t.querySelector(le);r&&(r.focus(),r instanceof HTMLInputElement&&r.select())}function ce(t,r){var e;t.classList.toggle("ui-prop__categoria--aberta",r),O.alternarPart(t,"categoria-aberta",r),(e=t.querySelector(".ui-prop__categoria-header"))==null||e.setAttribute("aria-expanded",String(r))}function We(t,r){r.forEach(e=>{!e||typeof e!="object"||(e.aberto=!0,"aberta"in e&&(e.aberta=!0))}),t.querySelectorAll(".ui-prop__categoria").forEach(e=>ce(e,!0))}function Xe(t,r){r.forEach(e=>{!e||typeof e!="object"||(e.aberto=!1,"aberta"in e&&(e.aberta=!1))}),t.querySelectorAll(".ui-prop__categoria").forEach(e=>ce(e,!1))}function Ke(t,r,e,i){const o=e.find(a=>a&&String(a.id)===String(i));if(o){const a=Array.from(t.querySelectorAll("[data-cat-id]")).find(d=>d.getAttribute("data-cat-id")===String(i)),l=!(a?a.classList.contains("ui-prop__categoria--aberta"):o.aberto!==void 0?o.aberto!==!1:o.aberta!==!1);o.aberto=l,"aberta"in o&&(o.aberta=l),a&&ce(a,l),r.dispatchEvent(new CustomEvent("ui-categoria-toggle",{bubbles:!0,composed:!0,detail:{id:i,aberto:l}}))}}const K=Symbol.for("ui-tabela-propriedades:misto"),Y="Varia";function z(t){return t===K}function N(t){var e;let r;try{r=(e=t.obterTextoMisto)==null?void 0:e.call(t)}catch{}return typeof r=="string"&&r.trim()?r:Y}function I(t,r){return t==null&&r==null?!0:Object.is(t,r)}function W(t){return t.misto?K:t.valor}function Ye(t){if(!Array.isArray(t)||t.length===0)return;const r=t[0];for(let e=1;e<t.length;e++)if(!I(r,t[e]))return K;return r}function jt(t){if(!Array.isArray(t))return{};const r=t.filter(o=>o!==null&&typeof o=="object"&&!Array.isArray(o)),e=new Set;r.forEach(o=>Object.keys(o).forEach(a=>e.add(a)));const i={};return e.forEach(o=>{i[o]=Ye(r.map(a=>o in a?a[o]:void 0))}),i}function V(t){if(typeof t.casasDecimais=="number"&&t.casasDecimais>=0)return t.casasDecimais;if(typeof t.precisao=="number"&&t.precisao>=0)return t.precisao}function Ge(t,r){return typeof t.passo=="number"&&t.passo>0?t.passo:typeof t.step=="number"&&t.step>0?t.step:r!==void 0?Math.pow(10,-r):1}function G(t,r){let e=t;return typeof r.min=="number"&&Number.isFinite(r.min)&&(e=Math.max(r.min,e)),typeof r.max=="number"&&Number.isFinite(r.max)&&(e=Math.min(r.max,e)),e}function j(t,r){if(typeof t!="string")return null;let e=t.trim();const i=typeof r.unidade=="string"?r.unidade.trim():"";if(i&&e.length>i.length&&e.toLowerCase().endsWith(i.toLowerCase())&&(e=e.slice(0,e.length-i.length).trim()),!e)return null;const o=He(e);if(o===null||!Number.isFinite(o))return null;const a=V(r),n=G(o,r);return Number(a!==void 0?n.toFixed(a):n.toPrecision(15))}function Qe(t,r,e,i){t.classList.toggle("ui-prop__editor--misto",e),e?t.placeholder=i:r.placeholder?t.placeholder=r.placeholder:t.removeAttribute("placeholder")}function Ze(t,r,e){const i=document.createElement("span"),o=e?V(e):void 0,a=n=>{if(z(n)){i.className="ui-prop__valor-readonly ui-prop__editor--misto",i.textContent=r?N({obterTextoMisto:r}):Y;return}if(n==null){i.className="ui-prop__valor-readonly",i.textContent="—";return}if((e==null?void 0:e.tipo)==="booleano"&&typeof n=="boolean"){i.className="ui-prop__valor-readonly",i.textContent=n?"Sim":"Não";return}if(e!=null&&e.opcoes&&e.opcoes.length>0){const d=e.opcoes.find(u=>u&&String(u.id)===String(n));if(d){i.className="ui-prop__valor-readonly",i.textContent=d.rotulo;return}}const l=typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim());if(i.className=`ui-prop__valor-readonly ${l?"ui-prop__valor-readonly--numero":""}`.trim(),l&&o!==void 0){const d=Number(n);i.textContent=Number.isFinite(d)?d.toFixed(o):String(n)}else i.textContent=String(n)};return a(t),M(i,a),i}function Je(t,r,e,i){const o=document.createElement("label");o.className="ui-prop__editor-booleano",o.setAttribute("role","checkbox"),o.tabIndex=0,o.setAttribute("aria-label",String(r.rotulo??r.id));const a=document.createElement("div");a.className="ui-prop__checkbox-custom";const n=document.createElement("span");n.className="ui-prop__booleano-rotulo";const l=u=>{const c=z(u),p=!c&&!!u;o.classList.toggle("ui-prop__editor--misto",c),a.classList.toggle("ui-prop__checkbox-custom--marcado",p),a.classList.toggle("ui-prop__checkbox-custom--misto",c),a.textContent=c?"–":p?"✓":"",n.textContent=c?N(i):p?"Sim":"Não",o.setAttribute("aria-checked",c?"mixed":String(p))};l(e),M(o,l),o.appendChild(a),o.appendChild(n);const d=()=>{const u=i.obterValorAtual(r.id),c=z(u)?!0:!u;i.registrarAlteracao(t,r.id,c),l(c)};return o.addEventListener("click",u=>{u.preventDefault(),d()}),o.addEventListener("keydown",u=>{u.key===" "?(u.preventDefault(),d()):u.key==="Enter"&&(u.preventDefault(),u.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o))}),o}function et(t,r,e,i){const o=document.createElement("select");o.className="ui-prop__editor-select",o.setAttribute("aria-label",String(r.rotulo??r.id)),(Array.isArray(r.opcoes)?r.opcoes:[]).forEach(n=>{if(!n||typeof n!="object")return;const l=document.createElement("option");l.value=String(n.id),l.textContent=String(n.rotulo??n.id),o.appendChild(l)});const a=n=>{o.classList.toggle("ui-prop__editor--misto",z(n)),z(n)?F(o,N(i)):B(o,n)};return a(e),M(o,a),o.addEventListener("change",()=>{const n=(r.opcoes||[]).find(l=>l&&String(l.id)===o.value);i.registrarAlteracao(t,r.id,n?n.id:o.value),a(i.obterValorAtual(r.id))}),o.addEventListener("keydown",n=>{n.key==="Enter"&&(n.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o))}),o}function tt(t,r,e){const i=document.createElement("button");return i.type="button",i.className="ui-prop__btn-acao-inline",i.textContent=r.rotuloAcao||"Editar...",i.addEventListener("click",()=>{typeof r.onClickAcao=="function"&&r.onClickAcao(r),e.despacharEventoAcao(r,t)}),i}function rt(t,r,e,i){const o=document.createElement("input");o.type="text",o.inputMode="decimal",o.autocomplete="off",o.spellcheck=!1,o.className="ui-prop__editor-input ui-prop__editor-input--numero",o.setAttribute("aria-label",String(r.rotulo??r.id)),r.placeholder&&(o.placeholder=r.placeholder);const a=V(r),n=s=>{if(s==null||s===""||z(s))return"";const h=Number(s);return isNaN(h)?String(s):a!==void 0?h.toFixed(a):String(h)},l=s=>{o.value=n(s),Qe(o,r,z(s),N(i))};l(e),M(o,l);let d=null;const u=()=>{o.classList.remove("ui-prop__editor-input--calculando"),o.title="",d&&(d.hidden=!0)},c=s=>{if(!d){if(!o.parentElement)return;d=document.createElement("span"),d.className="ui-prop__previa-calculo",d.setAttribute("aria-hidden","true"),o.parentElement.appendChild(d)}d.textContent=s,d.hidden=!1};o.addEventListener("focus",()=>{o.classList.remove("ui-prop__editor-input--invalido"),o.select()}),o.addEventListener("animationend",()=>o.classList.remove("ui-prop__editor-input--invalido")),o.addEventListener("input",()=>{o.classList.remove("ui-prop__editor-input--invalido");const s=o.value.trim(),m=!/^[+-]?[0-9]*[.,]?[0-9]*$/.test(s)&&(s.startsWith("=")||/[\+\-\*\/\^\%\(\);]|^[a-zA-Z_π]/.test(s));if(o.classList.toggle("ui-prop__editor-input--calculando",m),m){const g=j(s,r),f=g!==null?`= ${n(g)}`:"= ?";o.title=g!==null?f:"",c(f)}else u()});const p=()=>{u();const s=o.value.trim(),h=i.obterValorAtual(r.id);if(s===n(h))return;if(s===""){if(z(h))return;i.registrarAlteracao(t,r.id,null);return}const m=j(s,r);m!==null?(i.registrarAlteracao(t,r.id,m),l(i.obterValorAtual(r.id))):(l(h),o.classList.add("ui-prop__editor-input--invalido"))};return o.addEventListener("change",p),o.addEventListener("blur",p),o.addEventListener("keydown",s=>{if(s.key==="Enter")p(),s.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o);else if(s.key==="Escape")s.preventDefault(),s.stopPropagation(),u(),l(i.obterValorAtual(r.id)),o.blur();else if(s.key==="ArrowUp"||s.key==="ArrowDown"){s.preventDefault(),u();const h=j(o.value,r),m=i.obterValorAtual(r.id);if(h===null&&z(m))return;const g=h??(Number(m)||0);let f=Ge(r,a);s.shiftKey?f*=10:s.altKey&&a===void 0&&(f*=.1);let b=s.key==="ArrowUp"?g+f:g-f;b=G(b,r),a!==void 0?b=Number(b.toFixed(a)):b=Math.round(b*1e4)/1e4,i.registrarAlteracao(t,r.id,b),l(b)}}),o}function it(t,r,e,i){const o=document.createElement("input");o.type="text",o.className="ui-prop__editor-input",o.setAttribute("aria-label",String(r.rotulo??r.id)),r.placeholder&&(o.placeholder=r.placeholder);const a=l=>{const d=z(l);o.value=d||l==null?"":String(l),Qe(o,r,d,N(i))};a(e),M(o,a),o.addEventListener("focus",()=>{o.select()});const n=()=>{o.value===""&&z(i.obterValorAtual(r.id))||(i.registrarAlteracao(t,r.id,o.value),a(i.obterValorAtual(r.id)))};return o.addEventListener("change",n),o.addEventListener("blur",n),o.addEventListener("keydown",l=>{l.key==="Enter"?(n(),l.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o)):l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),a(i.obterValorAtual(r.id)),o.blur())}),o}const ot=(t,r)=>t.toLowerCase()===String(r??"").toLowerCase();function ue(t,r){(Array.isArray(r)?r:[]).forEach(e=>{if(!e||typeof e!="object")return;const i=document.createElement("option");i.value=String(e.id),i.textContent=String(e.rotulo??e.id),t.appendChild(i)})}function at(t,r,e,i){const o=document.createElement("div");o.className="ui-prop__editor-linha-container";const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("class","ui-prop__linha-amostra-svg"),a.setAttribute("viewBox","0 0 44 12"),a.setAttribute("aria-hidden","true");const n=document.createElementNS("http://www.w3.org/2000/svg","line");n.setAttribute("x1","0"),n.setAttribute("y1","6"),n.setAttribute("x2","44"),n.setAttribute("y2","6");const l=p=>{const s=String(p||"").toLowerCase();s.includes("center")||s.includes("eixo")||s.includes("dashdot")||s.includes("traço-ponto")?n.setAttribute("stroke-dasharray","8,3,2,3"):s.includes("dash")||s.includes("tracej")||s.includes("hidden")?n.setAttribute("stroke-dasharray","6,3"):s.includes("dot")||s.includes("ponto")||s.includes("pontilh")?n.setAttribute("stroke-dasharray","2,3"):n.setAttribute("stroke-dasharray","none")};a.appendChild(n);const d=document.createElement("select");d.className="ui-prop__linha-select",d.setAttribute("aria-label",String(r.rotulo??r.id));const u=r.opcoes&&r.opcoes.length>0?r.opcoes:[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},{id:"Continuous",rotulo:"Continuous"},{id:"Dashed",rotulo:"Dashed"},{id:"Hidden",rotulo:"Hidden"},{id:"Center",rotulo:"Center"},{id:"Dotted",rotulo:"Dotted"}];ue(d,u);const c=p=>{const s=z(p);if(o.classList.toggle("ui-prop__editor--misto",s),s){l(""),F(d,N(i));return}l(p),B(d,p,ot)};return c(e),M(o,c),d.addEventListener("change",()=>{const p=u.find(s=>s&&String(s.id)===d.value);i.registrarAlteracao(t,r.id,p?p.id:d.value),c(i.obterValorAtual(r.id))}),d.addEventListener("keydown",p=>{p.key==="Enter"&&(p.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(d):i.focarProximoEditor(d))}),o.appendChild(a),o.appendChild(d),o}function nt(t,r,e,i){const o=document.createElement("div");o.className="ui-prop__editor-espessura-container";const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("class","ui-prop__espessura-amostra-svg"),a.setAttribute("viewBox","0 0 38 12"),a.setAttribute("aria-hidden","true");const n=document.createElementNS("http://www.w3.org/2000/svg","line");n.setAttribute("x1","0"),n.setAttribute("y1","6"),n.setAttribute("x2","38"),n.setAttribute("y2","6");const l=p=>{const s=parseFloat(String(p).replace(/[^0-9.]/g,""));return isNaN(s)||s<=0?1.5:Math.min(8,Math.max(1,s*8))};a.appendChild(n);const d=document.createElement("select");d.className="ui-prop__espessura-select",d.setAttribute("aria-label",String(r.rotulo??r.id));const u=r.opcoes&&r.opcoes.length>0?r.opcoes:[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},{id:"0.00 mm",rotulo:"0.00 mm"},{id:"0.05 mm",rotulo:"0.05 mm"},{id:"0.09 mm",rotulo:"0.09 mm"},{id:"0.13 mm",rotulo:"0.13 mm"},{id:"0.15 mm",rotulo:"0.15 mm"},{id:"0.18 mm",rotulo:"0.18 mm"},{id:"0.20 mm",rotulo:"0.20 mm"},{id:"0.25 mm",rotulo:"0.25 mm"},{id:"0.30 mm",rotulo:"0.30 mm"},{id:"0.35 mm",rotulo:"0.35 mm"},{id:"0.40 mm",rotulo:"0.40 mm"},{id:"0.50 mm",rotulo:"0.50 mm"},{id:"0.60 mm",rotulo:"0.60 mm"},{id:"0.70 mm",rotulo:"0.70 mm"},{id:"1.00 mm",rotulo:"1.00 mm"},{id:"1.40 mm",rotulo:"1.40 mm"},{id:"2.00 mm",rotulo:"2.00 mm"}];ue(d,u);const c=p=>{const s=z(p);o.classList.toggle("ui-prop__editor--misto",s),n.setAttribute("stroke-width",String(l(s?"":p))),s?F(d,N(i)):B(d,p,ot)};return c(e),M(o,c),d.addEventListener("change",()=>{const p=u.find(s=>s&&String(s.id)===d.value);i.registrarAlteracao(t,r.id,p?p.id:d.value),c(i.obterValorAtual(r.id))}),d.addEventListener("keydown",p=>{p.key==="Enter"&&(p.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(d):i.focarProximoEditor(d))}),o.appendChild(a),o.appendChild(d),o}const pe=[{nome:"Red",indice:1,hex:"#ff0000"},{nome:"Yellow",indice:2,hex:"#ffff00"},{nome:"Green",indice:3,hex:"#00ff00"},{nome:"Cyan",indice:4,hex:"#00ffff"},{nome:"Blue",indice:5,hex:"#0000ff"},{nome:"Magenta",indice:6,hex:"#ff00ff"},{nome:"White",indice:7,hex:"#ffffff"}],st=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function ie(t){const r=String(t??"").trim().toLowerCase(),e=pe.find(i=>String(i.indice)===r||i.nome.toLowerCase()===r);return e?e.nome.toLowerCase():r}function Ut(t){const r=ie(t),e=pe.find(i=>i.nome.toLowerCase()===r);return e?e.hex:st.test(r)?r:"#ffffff"}function lt(t){return t.length===4?"#"+t.slice(1).split("").map(r=>r+r).join(""):t}function dt(t,r,e,i){const o=document.createElement("div");o.className="ui-prop__editor-cor-cad-container";const a=document.createElement("div");a.className="ui-prop__cor-amostra";const n=document.createElement("select");n.className="ui-prop__cor-cad-select",n.setAttribute("aria-label",String(r.rotulo??r.id)),ue(n,[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},...pe.map(c=>({id:c.nome,rotulo:`${c.nome} (${c.indice})`}))]);const l=document.createElement("option");l.value="__escolher",l.textContent="Selecionar cor...",l.setAttribute("data-acao",""),n.appendChild(l);const d=document.createElement("input");d.type="color",d.className="ui-prop__cor-picker-oculto",d.tabIndex=-1,d.setAttribute("aria-hidden","true");const u=c=>{const p=z(c);if(o.classList.toggle("ui-prop__editor--misto",p),a.classList.toggle("ui-prop__cor-amostra--misto",p),p){a.style.backgroundColor="",d.value="#ffffff",F(n,N(i));return}const s=Ut(c);a.style.backgroundColor=s,d.value=lt(s),B(n,c,(h,m)=>ie(h)===ie(m),h=>h==null||h===""?"—":String(h))};return u(e),M(o,u),d.addEventListener("input",()=>{a.style.backgroundColor=d.value}),d.addEventListener("change",()=>{i.registrarAlteracao(t,r.id,d.value),u(i.obterValorAtual(r.id))}),n.addEventListener("change",()=>{if(n.value==="__escolher"){u(i.obterValorAtual(r.id)),d.click();return}i.registrarAlteracao(t,r.id,n.value),u(i.obterValorAtual(r.id))}),n.addEventListener("keydown",c=>{c.key==="Enter"&&(c.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(n):i.focarProximoEditor(n))}),o.appendChild(a),o.appendChild(n),o.appendChild(d),o}function ct(t,r,e,i){const o=document.createElement("div");o.className="ui-prop__editor-cor-container",o.setAttribute("role","button"),o.tabIndex=0;const a=document.createElement("div");a.className="ui-prop__cor-amostra";const n=document.createElement("span");n.className="ui-prop__cor-texto";const l=document.createElement("input");l.type="color",l.className="ui-prop__cor-picker-oculto",l.tabIndex=-1,l.setAttribute("aria-hidden","true");const d=u=>{const c=z(u);if(o.classList.toggle("ui-prop__editor--misto",c),a.classList.toggle("ui-prop__cor-amostra--misto",c),c){const s=N(i);a.style.backgroundColor="",n.textContent=s,l.value="#ffffff",o.setAttribute("aria-label",`${r.rotulo??r.id}: ${s}`);return}const p=typeof u=="string"&&st.test(u)?lt(u):null;a.style.backgroundColor=u||"#ffffff",n.textContent=r.textoAmostra||String(u||"ByLayer"),l.value=p??"#ffffff",o.setAttribute("aria-label",`${r.rotulo??r.id}: ${u||"ByLayer"}`)};return d(e),M(o,d),l.addEventListener("input",()=>{a.style.backgroundColor=l.value,n.textContent=r.textoAmostra||l.value}),l.addEventListener("change",()=>{i.registrarAlteracao(t,r.id,l.value),d(i.obterValorAtual(r.id))}),o.addEventListener("click",u=>{u.target!==l&&l.click()}),o.addEventListener("keydown",u=>{(u.key===" "||u.key==="Enter")&&(u.preventDefault(),l.click())}),o.appendChild(a),o.appendChild(n),o.appendChild(l),o}function ut(t,r,e,i){let o;return r.somenteLeitura||r.tipo==="readonly"?o=Ze(e,i.obterTextoMisto,r):r.tipo==="booleano"?o=Je(t,r,e,i):r.tipo==="linha"||r.tipo==="linetype"?o=at(t,r,e,i):r.tipo==="espessura"||r.tipo==="lineweight"?o=nt(t,r,e,i):r.tipo==="cor-cad"?o=dt(t,r,e,i):r.tipo==="selecao"?o=et(t,r,e,i):r.tipo==="cor"?o=ct(t,r,e,i):r.tipo==="acao"?o=tt(t,r,i):r.tipo==="numero"?o=rt(t,r,e,i):o=it(t,r,e,i),o.setAttribute("part","editor"),r.dica&&o.setAttribute("aria-description",r.dica),o}function pt(t){if(!t.tipoContainerElement)return;const r=(Array.isArray(t.tipos)?t.tipos:[]).filter(i=>!!(i&&typeof i=="object"&&i.id!==void 0&&i.id!==null));if(r.length===0){t.tipoContainerElement.style.display="none",t.tipoContainerElement.innerHTML="";return}t.tipoContainerElement.style.display="flex",t.tipoContainerElement.innerHTML="";const e=r.find(i=>String(i.id)===String(t.tipoSelecionadoId))||r[0];if(t.estiloVisual==="revit"){const i=document.createElement("div");i.className="ui-prop__tipo-revit-card",i.title="Editar tipo de família",i.addEventListener("click",()=>t.onEditarTipo(e));const o=document.createElement("div");o.className="ui-prop__tipo-miniatura";const a=e.iconeSvg?Ct.higienizarSvg(e.iconeSvg):null;a?o.appendChild(a):o.innerHTML=`
|
|
8
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
9
|
+
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
|
|
10
|
+
<path d="M3 9h18M9 21V9"></path>
|
|
11
|
+
</svg>
|
|
12
|
+
`;const n=document.createElement("div");n.className="ui-prop__tipo-info";const l=document.createElement("div");l.className="ui-prop__tipo-nome",l.textContent=String(e.rotulo??e.id);const d=document.createElement("div");d.className="ui-prop__tipo-subtexto",d.textContent=e.subtipo||"Tipo de Família",n.appendChild(l),n.appendChild(d),i.appendChild(o),i.appendChild(n);const u=document.createElement("div");u.className="ui-prop__tipo-revit-subbarra";const c=document.createElement("select");c.className="ui-prop__tipo-select",c.setAttribute("aria-label","Selecionar tipo de família"),r.forEach(s=>{const h=document.createElement("option");h.value=String(s.id),h.textContent=`${s.rotulo??s.id}${s.subtipo?` : ${s.subtipo}`:""}`,String(s.id)===String(e.id)&&(h.selected=!0),c.appendChild(h)}),c.addEventListener("change",()=>{t.onSelecionarTipo(c.value)});const p=document.createElement("button");p.type="button",p.className="ui-prop__btn-editar-tipo",p.innerHTML=`
|
|
13
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;" aria-hidden="true">
|
|
14
|
+
<rect x="3" y="3" width="12" height="12" rx="1"></rect>
|
|
15
|
+
<rect x="9" y="9" width="12" height="12" rx="1"></rect>
|
|
16
|
+
</svg>
|
|
17
|
+
<span>Editar tipo</span>
|
|
18
|
+
`,p.addEventListener("click",()=>{t.onEditarTipo(e)}),u.appendChild(c),u.appendChild(p),t.tipoContainerElement.appendChild(i),t.tipoContainerElement.appendChild(u)}else{const i=document.createElement("div");i.className="ui-prop__tipo-autocad-bar";const o=document.createElement("select");o.className="ui-prop__tipo-select",o.setAttribute("aria-label","Selecionar tipo de objeto"),r.forEach(u=>{const c=document.createElement("option");c.value=String(u.id),c.textContent=String(u.rotulo??u.id),String(u.id)===String(e.id)&&(c.selected=!0),o.appendChild(c)}),o.addEventListener("change",()=>{t.onSelecionarTipo(o.value)});const a=document.createElement("div");a.className="ui-prop__tipo-autocad-acoes";const n=document.createElement("button");n.type="button",n.className="ui-prop__btn-autocad",n.title="Seleção rápida",n.setAttribute("aria-label","Seleção rápida"),n.innerHTML=`
|
|
19
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
20
|
+
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
|
|
21
|
+
</svg>
|
|
22
|
+
`,n.addEventListener("click",()=>{t.onQuickSelect(e)});const l=document.createElement("button");l.type="button",l.className="ui-prop__btn-autocad",l.title="Selecionar objetos",l.setAttribute("aria-label","Selecionar objetos"),l.innerHTML=`
|
|
23
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
24
|
+
<circle cx="12" cy="12" r="7"></circle>
|
|
25
|
+
<line x1="12" y1="2" x2="12" y2="7"></line>
|
|
26
|
+
<line x1="12" y1="17" x2="12" y2="22"></line>
|
|
27
|
+
<line x1="2" y1="12" x2="7" y2="12"></line>
|
|
28
|
+
<line x1="17" y1="12" x2="22" y2="12"></line>
|
|
29
|
+
<line x1="12" y1="9" x2="12" y2="15" stroke-width="2.5"></line>
|
|
30
|
+
<line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
|
|
31
|
+
</svg>
|
|
32
|
+
`,l.addEventListener("click",()=>{t.onSelectObjects(e)});const d=document.createElement("button");d.type="button",d.className="ui-prop__btn-autocad",d.title="Calculadora rápida",d.setAttribute("aria-label","Calculadora rápida"),d.innerHTML=`
|
|
33
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
34
|
+
<rect x="4" y="2" width="16" height="20" rx="2"></rect>
|
|
35
|
+
<line x1="8" y1="6" x2="16" y2="6"></line>
|
|
36
|
+
<circle cx="8" cy="11" r="1" fill="currentColor"></circle>
|
|
37
|
+
<circle cx="12" cy="11" r="1" fill="currentColor"></circle>
|
|
38
|
+
<circle cx="16" cy="11" r="1" fill="currentColor"></circle>
|
|
39
|
+
<circle cx="8" cy="15" r="1" fill="currentColor"></circle>
|
|
40
|
+
<circle cx="12" cy="15" r="1" fill="currentColor"></circle>
|
|
41
|
+
<circle cx="16" cy="15" r="1" fill="currentColor"></circle>
|
|
42
|
+
</svg>
|
|
43
|
+
`,d.addEventListener("click",()=>{t.onCalculadora(e)}),a.appendChild(n),a.appendChild(l),a.appendChild(d),i.appendChild(o),i.appendChild(a),t.tipoContainerElement.appendChild(i)}}function ht(t){let r=45;function e(a){if(!Number.isFinite(a))return r;const n=Math.max(20,Math.min(65,a));return r=n,t.hostElement.style.setProperty("--ui-prop-rotulo-largura",`${n}%`),t.splitterElement&&(t.splitterElement.style.left=`calc(${n}% - 4px)`,t.splitterElement.setAttribute("aria-valuenow",String(Math.round(n)))),n}function i(a){t.onLarguraAlterada(a),t.hostElement.dispatchEvent(new CustomEvent("ui-splitter-resize",{bubbles:!0,composed:!0,detail:{larguraPorcentagem:a}}))}function o(){if(!t.splitterElement||!t.corpoElement)return;t.splitterListeners.cleanup();let a=!1;const n=l=>{if(l.button!==0)return;l.preventDefault(),l.stopPropagation(),a=!0,t.splitterElement.classList.add("ui-prop__splitter--ativo");try{t.splitterElement.setPointerCapture(l.pointerId)}catch{}const d=t.corpoElement.getBoundingClientRect(),u=p=>{if(!a)return;const s=d.width;if(s<=0)return;const h=p.clientX-d.left;let b=Math.max(80,Math.min(s-130,h))/s*100;b=Math.max(20,Math.min(65,b)),e(b)},c=p=>{if(a){a=!1,t.splitterElement.classList.remove("ui-prop__splitter--ativo");try{t.splitterElement.hasPointerCapture(p.pointerId)&&t.splitterElement.releasePointerCapture(p.pointerId)}catch{}t.splitterElement.removeEventListener("pointermove",u),t.splitterElement.removeEventListener("pointerup",c),t.splitterElement.removeEventListener("pointercancel",c),i(r)}};t.splitterElement.addEventListener("pointermove",u),t.splitterElement.addEventListener("pointerup",c),t.splitterElement.addEventListener("pointercancel",c)};t.splitterListeners.add(t.splitterElement,"pointerdown",n),t.splitterListeners.add(t.splitterElement,"dblclick",()=>{const l=e(45);i(l)}),t.splitterListeners.add(t.splitterElement,"keydown",l=>{const d=l.shiftKey?5:2;let u=null;if(l.key==="ArrowLeft"?u=r-d:l.key==="ArrowRight"?u=r+d:l.key==="Home"?u=20:l.key==="End"?u=65:l.key==="Enter"&&(u=45),u!==null){l.preventDefault(),l.stopPropagation();const c=e(u);i(c)}})}return{init:o,definirLarguraRotulo:e}}const Wt=`:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 12px);color:var(--ui-cor-texto, #e1e1e6);background-color:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);overflow:hidden;width:100%;max-width:100%;height:100%;min-height:200px;-webkit-user-select:none;user-select:none;--ui-prop-altura-linha: 22px;--ui-prop-rotulo-largura: 45%}:host([densidade="compacta"]){--ui-prop-altura-linha: 19px;font-size:10.5px}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:10px}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:12px}:host([colapsado]){width:32px!important;min-width:32px!important;max-width:32px!important;height:100%!important;cursor:pointer;transition:width .2s cubic-bezier(.4,0,.2,1)}:host([colapsado]) .ui-prop__header,:host([colapsado]) .ui-prop__tipo-seletor-container,:host([colapsado]) .ui-prop__filtro-container,:host([colapsado]) .ui-prop__corpo-wrapper,:host([colapsado]) .ui-prop__footer,:host([colapsado]) .ui-prop__resizer-canto{display:none!important}:host([colapsado]) .ui-prop__faixa-estreita{display:flex!important;flex-direction:column;align-items:center;width:100%;height:100%;padding:8px 0;gap:10px;box-sizing:border-box;background-color:var(--ui-cor-fundo-elevado, #18181d);-webkit-user-select:none;user-select:none;cursor:pointer}.ui-prop__faixa-estreita{display:none}.ui-prop__faixa-icone{display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__faixa-btn-expandir{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;color:var(--ui-cor-texto, #e1e1e6);cursor:pointer;padding:0;transition:all .15s ease;flex-shrink:0}.ui-prop__faixa-btn-expandir:hover{background-color:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-z-docked-bar, 600)!important;box-shadow:var(--ui-sombra-lg, 0 16px 48px rgba(0, 0, 0, .75)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 14%,transparent),0 6px 14px #00000080!important;border-radius:6px!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);resize:both;overflow:hidden;max-width:95vw;max-height:95vh;min-width:220px;min-height:200px}:host([flutuante]) .ui-prop__header{cursor:grab;-webkit-user-select:none;user-select:none}:host([flutuante].arrastando) .ui-prop__header{cursor:grabbing!important}.ui-prop__resizer-canto{display:none}:host([flutuante]) .ui-prop__resizer-canto{display:block;position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;z-index:50;background:linear-gradient(135deg,transparent 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 65%,transparent 65%,transparent 80%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 80%);pointer-events:auto}.ui-prop__btn-icone--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)!important;color:var(--ui-cor-destaque, #00E08A)!important}.ui-prop__container{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;flex:1;overflow:hidden;box-sizing:border-box}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__header{height:20px;min-height:20px;padding:0 6px}:host([densidade="ultracompacta"]) .ui-prop__header{height:18px;min-height:18px;padding:0 5px}.ui-prop__header-titulo{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--ui-cor-texto, #ffffff);text-transform:uppercase;letter-spacing:.4px}:host([densidade="compacta"]) .ui-prop__header-titulo{font-size:10px;gap:4px}:host([densidade="ultracompacta"]) .ui-prop__header-titulo{font-size:9.5px;gap:3px}.ui-prop__header-icone{display:flex;align-items:center;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__header-icone svg{width:12px;height:12px}:host([densidade="ultracompacta"]) .ui-prop__header-icone svg{width:10px;height:10px}.ui-prop__header-acoes{display:flex;align-items:center;gap:2px}.ui-prop__btn-icone{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;transition:all .15s ease;padding:0}.ui-prop__btn-icone:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}:host([densidade="compacta"]) .ui-prop__btn-icone{width:17px;height:17px}:host([densidade="ultracompacta"]) .ui-prop__btn-icone{width:16px;height:16px}.ui-prop__tipo-seletor-container{padding:3px 6px;background-color:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;flex-direction:column;gap:3px;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__tipo-seletor-container{padding:2px 5px;gap:2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-seletor-container{padding:1px 4px;gap:1px}.ui-prop__tipo-revit-card{display:flex;align-items:center;gap:10px;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-sm, 4px);padding:6px 8px;cursor:pointer;transition:border-color .15s ease}.ui-prop__tipo-revit-card:hover{border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-miniatura{width:32px;height:32px;border-radius:3px;background-color:var(--ui-cor-fundo-elevado, #24242a);display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__tipo-info{display:flex;flex-direction:column;flex:1;min-width:0}.ui-prop__tipo-nome{font-weight:600;font-size:12px;color:var(--ui-cor-texto, #ffffff);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-subtexto{font-size:11px;color:var(--ui-cor-texto-secundario, #888899);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-revit-subbarra{display:flex;align-items:center;gap:6px}.ui-prop__tipo-select{flex:1;min-width:0;width:0;height:20px;background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:2px;padding:0 16px 0 2px;font-size:10.5px;font-weight:500;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,color .15s ease}.ui-prop__tipo-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:var(--ui-cor-texto, #ffffff)}.ui-prop__tipo-select:focus{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent);color:var(--ui-cor-destaque, #00E08A)}:host([densidade="compacta"]) .ui-prop__tipo-select{height:18px;font-size:10px;padding:0 14px 0 2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-select{height:16px;font-size:9.5px;padding:0 12px 0 2px}.ui-prop__btn-editar-tipo{height:20px;padding:0 6px;background-color:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:2px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-editar-tipo{height:18px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__btn-editar-tipo{height:16px;font-size:9.5px}.ui-prop__btn-editar-tipo:hover{background-color:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-autocad-bar{display:flex;align-items:center;gap:2px;width:100%;min-width:0;box-sizing:border-box;background:transparent}.ui-prop__tipo-autocad-acoes{display:flex;align-items:center;gap:1px;flex-shrink:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding-left:3px;margin-left:1px}.ui-prop__btn-autocad{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;padding:0;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-autocad{width:18px;height:18px}:host([densidade="ultracompacta"]) .ui-prop__btn-autocad{width:16px;height:16px}.ui-prop__btn-autocad:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .1));color:var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-autocad:active{transform:scale(.92);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background-color:var(--ui-cor-fundo, #0b0b0d);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-limpar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;font-size:11px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:2px}.ui-prop__filtro-limpar:hover{color:var(--ui-cor-texto, #ffffff);background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background-color:var(--ui-cor-superficie, #141417);position:relative;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent) var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar{width:8px}.ui-prop__corpo::-webkit-scrollbar-track{background:var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-prop__corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-prop__categoria{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1))}.ui-prop__categoria-header{position:relative;z-index:25;display:flex;align-items:center;justify-content:space-between;height:21px;padding:0 6px;background-color:var(--ui-cor-fundo-elevado, #18181d);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:focus-visible{outline:1.5px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1.5px}.ui-prop__categoria-header:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06))}.ui-prop__categoria-titulo-bloco{display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__categoria-seta{display:inline-flex;align-items:center;justify-content:center;font-size:9px;width:12px;height:12px;color:var(--ui-cor-texto-secundario, #888899);transition:transform .15s ease}.ui-prop__categoria--aberta .ui-prop__categoria-seta{transform:rotate(90deg)}.ui-prop__categoria-contador{font-size:10px;font-weight:400;color:var(--ui-cor-texto-secundario, #888899)}.ui-prop__categoria-conteudo{display:none}.ui-prop__categoria--aberta .ui-prop__categoria-conteudo{display:block}.ui-prop__linha{display:flex;align-items:stretch;min-height:var(--ui-prop-altura-linha, 24px);border-bottom:1px dotted var(--ui-cor-borda, rgba(255, 255, 255, .08));box-sizing:border-box;position:relative;z-index:1;transition:background-color .1s ease}.ui-prop__linha:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__linha:focus-within .ui-prop__col-rotulo{color:var(--ui-cor-texto, #ffffff);font-weight:500}.ui-prop__linha--modificada{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo{width:var(--ui-prop-rotulo-largura, 45%);padding:1px 4px 1px 8px;display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #9999aa);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;position:relative;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__col-rotulo{padding:0 4px 0 6px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__col-rotulo{padding:0 3px 0 5px;font-size:9.5px}.ui-prop__col-rotulo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__col-rotulo--scrub{cursor:ew-resize;-webkit-user-select:none;user-select:none;transition:color .15s ease,background-color .15s ease}.ui-prop__col-rotulo--scrub:hover{color:var(--ui-cor-destaque, #00E08A);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:var(--ui-cor-texto-sobre-primaria, #000000)!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:var(--ui-cor-texto-sobre-primaria, #000000)!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background-color:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter:focus-visible{outline:none}.ui-prop__splitter:focus-visible:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__col-valor{width:calc(100% - var(--ui-prop-rotulo-largura, 45%));flex:1 1 0px;min-width:0!important;display:flex;align-items:stretch;padding:0;overflow:hidden;box-sizing:border-box;position:relative;transition:background-color .1s ease,box-shadow .1s ease}.ui-prop__col-valor:focus-within{background-color:var(--ui-cor-fundo, #0b0b0d);box-shadow:inset 0 0 0 1px var(--ui-cor-destaque, #00E08A)}.ui-prop__editor-input{width:100%;min-width:0;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-family:inherit;font-size:11px;padding:0 8px;outline:none;box-sizing:border-box;transition:background-color .1s ease}.ui-prop__editor-input:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-input--numero{text-align:right;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__editor-input--calculando{color:var(--ui-cor-destaque, #00E08A)!important;font-weight:500}.ui-prop__col-valor:has(.ui-prop__editor-input--calculando){background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)!important;box-shadow:inset 0 0 0 1.5px var(--ui-cor-destaque, #00E08A)!important}.ui-prop__editor-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 8px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 20px 0 8px;box-sizing:border-box;position:relative;border:none;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent)}.ui-prop__cor-amostra{width:13px;height:13px;border-radius:2px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);flex-shrink:0;box-sizing:border-box}.ui-prop__cor-texto{flex:1 1 0px;min-width:0!important;width:0!important;font-size:11px;color:var(--ui-cor-texto, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__cor-picker-oculto{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.ui-prop__editor-linha-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__linha-amostra-svg{width:24px;height:10px;flex-shrink:0}.ui-prop__linha-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6);stroke-width:1.5}.ui-prop__linha-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-espessura-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__espessura-amostra-svg{width:20px;height:10px;flex-shrink:0}.ui-prop__espessura-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6)}.ui-prop__espessura-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-cad-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__cor-cad-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-booleano{display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.ui-prop__editor-booleano:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__checkbox-custom{width:13px;height:13px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .25));border-radius:2px;background-color:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background-color:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background-color:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-size:11px;font-weight:500;cursor:pointer;white-space:nowrap;text-align:left;transition:all .15s ease;box-sizing:border-box}.ui-prop__btn-acao-inline:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);color:var(--ui-cor-destaque, #00E08A)}.ui-prop__valor-readonly{display:flex;align-items:center;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);font-size:11px;color:var(--ui-cor-texto-secundario, #777788);padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;-webkit-user-select:text;user-select:text}.ui-prop__valor-readonly--numero{justify-content:flex-end;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__unidade-sufixo{display:flex;align-items:center;font-size:10px;color:var(--ui-cor-texto-secundario, #777788);padding-right:8px;flex-shrink:0;-webkit-user-select:none;user-select:none}.ui-prop__vazio{padding:24px 16px;text-align:center;color:var(--ui-cor-texto-secundario, #888899);font-size:12px}.ui-prop__footer{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background-color:var(--ui-cor-fundo-elevado, #18181c);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));flex-shrink:0}.ui-prop__link-ajuda{font-size:11px;color:var(--ui-cor-destaque, #00E08A);text-decoration:none;cursor:pointer}.ui-prop__link-ajuda:hover{text-decoration:underline}.ui-prop__footer-botoes{display:flex;gap:6px}.ui-prop__btn-aplicar{height:24px;padding:0 12px;background-color:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);cursor:not-allowed}.ui-prop__btn-desfazer{height:24px;padding:0 8px;background:transparent;color:var(--ui-cor-texto-secundario, #888899);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;font-size:11px;cursor:pointer;transition:all .15s ease}.ui-prop__btn-desfazer:hover:not(:disabled){background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}.ui-prop__editor--misto,.ui-prop__editor--misto .ui-prop__booleano-rotulo,.ui-prop__editor--misto .ui-prop__cor-texto,.ui-prop__editor--misto select,select.ui-prop__editor--misto{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab))}.ui-prop__editor-input.ui-prop__editor--misto::placeholder{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));opacity:1}.ui-prop__editor--misto option:not([data-misto]),select.ui-prop__editor--misto option:not([data-misto]){font-style:normal;color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor--misto svg{opacity:.35}.ui-prop__checkbox-custom--misto{border-color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));font-style:normal}.ui-prop__cor-amostra--misto{background:linear-gradient(to top right,transparent calc(50% - 1px),var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab)) 50%,transparent calc(50% + 1px))}.ui-prop__linha--modificada .ui-prop__col-rotulo{box-shadow:inset 2px 0 0 var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-reverter{display:none;margin-left:auto;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:var(--ui-raio-sm, 3px);background:transparent;color:var(--ui-cor-destaque, #00E08A);font-size:11px;line-height:1;cursor:pointer}.ui-prop__linha--modificada .ui-prop__btn-reverter{display:inline-flex}.ui-prop__btn-reverter:hover{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__btn-reverter:focus-visible{outline:1px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1px}.ui-prop__previa-calculo{position:absolute;left:6px;top:50%;transform:translateY(-50%);pointer-events:none;font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #9696a6);white-space:nowrap}.ui-prop__previa-calculo[hidden]{display:none}.ui-prop__editor-input--invalido{animation:ui-prop-invalido .6s ease}.ui-prop__col-valor:has(.ui-prop__editor-input--invalido){box-shadow:inset 0 0 0 1px var(--ui-cor-texto-erro, #ff5555)}@keyframes ui-prop-invalido{0%,60%{color:var(--ui-cor-texto-erro, #ff5555)}to{color:inherit}}@media (prefers-reduced-motion: reduce){.ui-prop__editor-input--invalido{animation-duration:.01ms}}`;function Xt(){return`
|
|
44
|
+
<style>${Wt}</style>
|
|
45
|
+
<div class="ui-prop__container" id="container" part="base">
|
|
46
|
+
<!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
|
|
47
|
+
<div class="ui-prop__faixa-estreita" id="faixa-estreita" part="faixa-estreita" title="Clique para expandir painel">
|
|
48
|
+
<span class="ui-prop__faixa-icone" aria-hidden="true">
|
|
49
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
50
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
51
|
+
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
52
|
+
<line x1="9" y1="21" x2="9" y2="9"></line>
|
|
53
|
+
</svg>
|
|
54
|
+
</span>
|
|
55
|
+
<button type="button" class="ui-prop__faixa-btn-expandir" id="btn-expandir-faixa" title="Expandir painel de propriedades" aria-label="Expandir painel de propriedades">
|
|
56
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2">
|
|
57
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
58
|
+
<line x1="5" y1="5" x2="5" y2="19"></line>
|
|
59
|
+
</svg>
|
|
60
|
+
</button>
|
|
61
|
+
<span class="ui-prop__faixa-texto">PROPRIEDADES</span>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- 1. Header Superior -->
|
|
65
|
+
<header class="ui-prop__header" id="header" part="cabecalho">
|
|
66
|
+
<div class="ui-prop__header-titulo">
|
|
67
|
+
<span class="ui-prop__header-icone" aria-hidden="true">
|
|
68
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
69
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
70
|
+
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
71
|
+
<line x1="9" y1="21" x2="9" y2="9"></line>
|
|
72
|
+
</svg>
|
|
73
|
+
</span>
|
|
74
|
+
<span id="header-titulo-texto" part="titulo">Propriedades</span>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="ui-prop__header-acoes" part="acoes-cabecalho">
|
|
77
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-flutuante" title="Desacoplar / Modo flutuante (CAD)" aria-label="Modo flutuante">
|
|
78
|
+
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
79
|
+
<rect x="3" y="3" width="14" height="14" rx="2"></rect>
|
|
80
|
+
<polyline points="15 3 21 3 21 9"></polyline>
|
|
81
|
+
<line x1="10" y1="14" x2="21" y2="3"></line>
|
|
82
|
+
</svg>
|
|
83
|
+
</button>
|
|
84
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-colapsar-horizontal" title="Recolher para coluna estreita" aria-label="Recolher para coluna estreita">
|
|
85
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
86
|
+
<polyline points="11 17 6 12 11 7"></polyline>
|
|
87
|
+
<line x1="18" y1="5" x2="18" y2="19"></line>
|
|
88
|
+
</svg>
|
|
89
|
+
</button>
|
|
90
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-densidade" title="Alternar compressão vertical" aria-label="Alternar densidade vertical">
|
|
91
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
92
|
+
<polyline points="4 7 12 11 20 7"></polyline>
|
|
93
|
+
<polyline points="4 17 12 13 20 17"></polyline>
|
|
94
|
+
<line x1="4" y1="12" x2="20" y2="12"></line>
|
|
95
|
+
</svg>
|
|
96
|
+
</button>
|
|
97
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-expandir-tudo" title="Expandir/Recolher Tudo" aria-label="Expandir ou recolher tudo">
|
|
98
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
99
|
+
<polyline points="7 13 12 18 17 13"></polyline>
|
|
100
|
+
<polyline points="7 6 12 11 17 6"></polyline>
|
|
101
|
+
</svg>
|
|
102
|
+
</button>
|
|
103
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-fechar" title="Fechar" aria-label="Fechar" style="display: none;">
|
|
104
|
+
✕
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
</header>
|
|
108
|
+
|
|
109
|
+
<!-- 2. Seletor de Tipo (AutoCAD / Revit) -->
|
|
110
|
+
<div class="ui-prop__tipo-seletor-container" id="tipo-container" part="seletor-tipo" style="display: none;"></div>
|
|
111
|
+
|
|
112
|
+
<!-- 3. Busca Rápida de Propriedades -->
|
|
113
|
+
<div class="ui-prop__filtro-container" id="filtro-container" part="filtro" style="display: none;">
|
|
114
|
+
<svg class="ui-prop__filtro-icone" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
115
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
116
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
117
|
+
</svg>
|
|
118
|
+
<input type="text" class="ui-prop__filtro-input" id="filtro-input" part="filtro-input" placeholder="Filtrar propriedades..." aria-label="Filtrar propriedades" autocomplete="off" spellcheck="false" />
|
|
119
|
+
<button type="button" class="ui-prop__filtro-limpar" id="btn-limpar-filtro" title="Limpar filtro (Esc)" aria-label="Limpar filtro" style="display: none;">✕</button>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- 4. Corpo Rolável com Grade de Categorias -->
|
|
123
|
+
<div class="ui-prop__corpo-wrapper" id="corpo-wrapper">
|
|
124
|
+
<div class="ui-prop__splitter" id="splitter" part="splitter" role="separator" tabindex="0" aria-orientation="vertical" aria-valuemin="20" aria-valuemax="65" aria-valuenow="45" aria-label="Redimensionar coluna de rótulos" title="Arraste para redimensionar colunas (duplo-clique reseta para 45%)"></div>
|
|
125
|
+
<div class="ui-prop__corpo" id="corpo" part="corpo">
|
|
126
|
+
<div class="ui-prop__lista-categorias" id="lista-categorias" part="lista-categorias"></div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<!-- 5. Rodapé com Ações (Aplicar / Desfazer) -->
|
|
131
|
+
<footer class="ui-prop__footer" id="footer" part="rodape" style="display: none;">
|
|
132
|
+
<a class="ui-prop__link-ajuda" id="link-ajuda" part="ajuda" href="#" role="button">Ajuda de propriedades</a>
|
|
133
|
+
<div class="ui-prop__footer-botoes">
|
|
134
|
+
<button type="button" class="ui-prop__btn-desfazer" id="btn-desfazer" part="desfazer" disabled>Desfazer</button>
|
|
135
|
+
<button type="button" class="ui-prop__btn-aplicar" id="btn-aplicar" part="aplicar" disabled>Aplicar</button>
|
|
136
|
+
</div>
|
|
137
|
+
</footer>
|
|
138
|
+
|
|
139
|
+
<!-- 6. Grip para redimensionar no modo flutuante -->
|
|
140
|
+
<div class="ui-prop__resizer-canto" id="resizer-canto" title="Redimensionar"></div>
|
|
141
|
+
</div>
|
|
142
|
+
`}function mt(t){const{listaContainer:r,categorias:e,termoBusca:i,onToggleCategoria:o,linhaCtx:a}=t;r.innerHTML="";const n=(Array.isArray(e)?e:[]).filter(c=>!!(c&&typeof c=="object"));if(n.length===0){const c=document.createElement("div");c.className="ui-prop__vazio",c.setAttribute("part","vazio"),c.textContent="Nenhuma propriedade disponível.",r.appendChild(c);return}const l=document.createDocumentFragment(),d=(i||"").trim().toLowerCase();let u=0;if(n.forEach(c=>{const p=String(c.titulo??c.id??"").toLowerCase(),s=!!d&&p.includes(d),h=(Array.isArray(c.propriedades)?c.propriedades:[]).filter(x=>{if(!x||typeof x!="object"||x.id===void 0||x.id===null)return!1;if(!d||s)return!0;const k=String(x.rotulo??"").toLowerCase(),A=String(x.id).toLowerCase(),L=String(a.valoresAtuais[x.id]??"").toLowerCase();return k.includes(d)||A.includes(d)||L.includes(d)});if(d&&h.length===0)return;u+=h.length;const m=c.aberto!==void 0?c.aberto!==!1:c.aberta!==!1,g=!!d||m,f=document.createElement("div");f.className=`ui-prop__categoria ${g?"ui-prop__categoria--aberta":""}`,f.setAttribute("data-cat-id",String(c.id)),f.setAttribute("part","categoria"),O.alternarPart(f,"categoria-aberta",g);const b=document.createElement("div");b.className="ui-prop__categoria-header",b.setAttribute("part","categoria-cabecalho"),b.setAttribute("role","button"),b.tabIndex=0,b.setAttribute("aria-expanded",String(g));const y=document.createElement("div");y.className="ui-prop__categoria-titulo-bloco";const _=document.createElement("span");_.className="ui-prop__categoria-seta",_.setAttribute("aria-hidden","true"),_.textContent="▶";const w=document.createElement("span");w.textContent=String(c.titulo??c.id),y.appendChild(_),y.appendChild(w);const C=document.createElement("span");C.className="ui-prop__categoria-contador",C.textContent=String(h.length),b.appendChild(y),b.appendChild(C),b.addEventListener("click",()=>o(String(c.id))),b.addEventListener("keydown",x=>{if(x.key==="Enter"||x.key===" ")x.preventDefault(),o(String(c.id));else if(x.key==="ArrowRight")f.classList.contains("ui-prop__categoria--aberta")||(x.preventDefault(),o(String(c.id)));else if(x.key==="ArrowLeft")f.classList.contains("ui-prop__categoria--aberta")&&(x.preventDefault(),o(String(c.id)));else if(x.key==="ArrowDown"||x.key==="ArrowUp"){const k=Array.from(r.querySelectorAll(".ui-prop__categoria-header")),A=k.indexOf(b);if(A!==-1){const L=x.key==="ArrowDown"?A+1:A-1;L>=0&&L<k.length&&(x.preventDefault(),k[L].focus())}}else if(x.key==="Home"){const k=r.querySelector(".ui-prop__categoria-header");k&&(x.preventDefault(),k.focus())}else if(x.key==="End"){const k=r.querySelectorAll(".ui-prop__categoria-header");k.length>0&&(x.preventDefault(),k[k.length-1].focus())}});const E=document.createElement("div");E.className="ui-prop__categoria-conteudo",E.setAttribute("part","categoria-conteudo"),h.forEach(x=>{const k=ft(String(c.id),x,a);E.appendChild(k)}),f.appendChild(b),f.appendChild(E),l.appendChild(f)}),d&&u===0){const c=document.createElement("div");c.className="ui-prop__vazio",c.setAttribute("part","vazio"),c.textContent=`Nenhuma propriedade encontrada para "${i}".`,r.appendChild(c);return}r.appendChild(l)}function ft(t,r,e){const i=document.createElement("div");i.className="ui-prop__linha",i.setAttribute("data-prop-id",String(r.id)),i.setAttribute("part","linha");const o=e.valoresAtuais[r.id]!==void 0?e.valoresAtuais[r.id]:W(r),a=r.id in e.valoresOriginais?e.valoresOriginais[r.id]:W(r),n=!I(o,a),l=z(o);n&&(i.classList.add("ui-prop__linha--modificada"),O.alternarPart(i,"linha-modificada",!0)),l&&(i.classList.add("ui-prop__linha--misto"),O.alternarPart(i,"linha-mista",!0)),i.addEventListener("dblclick",()=>{const m=i.querySelector('input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline');m&&(m.focus(),m instanceof HTMLInputElement&&m.select())});const d=document.createElement("div");d.className="ui-prop__col-rotulo",d.setAttribute("part","rotulo");const u=String(r.rotulo??r.id);d.title=r.dica?`${u} — ${r.dica}`:u;const c=document.createElement("span");if(c.textContent=u,d.appendChild(c),!r.somenteLeitura&&r.tipo!=="readonly"&&r.tipo!=="acao"&&e.onRedefinir){const m=e.onRedefinir,g=document.createElement("button");g.type="button",g.className="ui-prop__btn-reverter",g.title="Restaurar valor original",g.setAttribute("aria-label",`Restaurar valor original de ${u}`),g.setAttribute("part","restaurar"),g.textContent="↺",g.addEventListener("click",f=>{f.stopPropagation(),m(String(r.id))}),g.addEventListener("dblclick",f=>f.stopPropagation()),d.appendChild(g)}r.tipo==="numero"&&!r.somenteLeitura&&Kt(d,t,r,e);const s=document.createElement("div");s.className="ui-prop__col-valor",s.setAttribute("part","valor");const h=ut(t,r,o,e.editorCtx);if(s.appendChild(h),r.unidade){const m=document.createElement("span");m.className="ui-prop__unidade-sufixo",m.setAttribute("part","unidade"),m.textContent=r.unidade,s.appendChild(m)}return i.appendChild(d),i.appendChild(s),i}function Kt(t,r,e,i){t.classList.add("ui-prop__col-rotulo--scrub");const o=String(e.rotulo??e.id),a=e.dica?`${o} — ${e.dica}`:o;t.title=`${a} (Arraste para ajustar, duplo-clique para editar)`;let n=0,l=0,d=!1;t.addEventListener("pointerdown",u=>{var h,m;if(u.button!==0||(m=(h=u.target)==null?void 0:h.closest)!=null&&m.call(h,".ui-prop__btn-reverter")||z(i.editorCtx.obterValorAtual(e.id)))return;n=u.clientX;const c=i.editorCtx.obterValorAtual(e.id);l=typeof c=="number"?c:parseFloat(String(c||0))||0,d=!1;try{t.setPointerCapture(u.pointerId)}catch{}t.classList.add("ui-prop__col-rotulo--arrastando");const p=g=>{const f=g.clientX-n;if(Math.abs(f)>2&&(d=!0),d){let b=1;g.shiftKey?b=.1:(g.ctrlKey||g.metaKey)&&(b=10);const y=V(e),_=typeof e.passo=="number"&&e.passo>0?e.passo*.01:typeof e.step=="number"&&e.step>0?e.step*.01:Math.pow(10,-Math.min(y!==void 0?y:2,2));let w=l+f*_*b;w=G(w,e),y!==void 0?w=Number(w.toFixed(y)):w=Math.round(w*100)/100,i.editorCtx.registrarAlteracao(r,e.id,w),i.onAtualizarCampoVisual(e.id,w)}},s=g=>{t.classList.remove("ui-prop__col-rotulo--arrastando");try{t.hasPointerCapture(g.pointerId)&&t.releasePointerCapture(g.pointerId)}catch{}t.removeEventListener("pointermove",p),t.removeEventListener("pointerup",s),t.removeEventListener("pointercancel",s)};t.addEventListener("pointermove",p),t.addEventListener("pointerup",s),t.addEventListener("pointercancel",s)})}const xe=300,Yt=480,q=new WeakMap;function bt(t){var i,o,a;const r=t.hasAttribute("flutuante"),e=t.style;if(r){const n=q.get(t)??{acoplado:{width:"",height:""}};n.flutuante={left:e.left,top:e.top,width:e.width,height:e.height},q.set(t,n),t.removeAttribute("flutuante"),e.left="",e.top="",e.right="",e.bottom="",e.position="",e.zIndex="",e.width=n.acoplado.width,e.height=n.acoplado.height}else{const n={acoplado:{width:e.width,height:e.height},flutuante:(i=q.get(t))==null?void 0:i.flutuante};if(q.set(t,n),t.setAttribute("flutuante",""),e.position="fixed",(o=n.flutuante)!=null&&o.left||(a=n.flutuante)!=null&&a.top)e.left=n.flutuante.left,e.top=n.flutuante.top,e.width=n.flutuante.width,e.height=n.flutuante.height;else if(!e.left&&!e.top){const l=Math.max(20,(typeof window<"u"?window.innerWidth:1024)-xe-30);e.left=`${l}px`,e.top="70px",e.width=`${xe}px`,e.height=`${Yt}px`}}return!r}function gt(t,r,e){const i=r.getElementById("header");if(i){let a=null,n=0,l=0,d=0,u=0;const c=s=>{if(a===null)return;const h=s.clientX-n,m=s.clientY-l;let g=d+h,f=u+m;const b=Math.max(0,(typeof window<"u"?window.innerWidth:1024)-t.offsetWidth),y=Math.max(0,(typeof window<"u"?window.innerHeight:768)-30);g=Math.max(0,Math.min(b,g)),f=Math.max(0,Math.min(y,f)),t.style.left=`${g}px`,t.style.top=`${f}px`,t.style.right="auto",t.style.bottom="auto"},p=s=>{if(a!==null){try{i.releasePointerCapture(s.pointerId)}catch{}i.removeEventListener("pointermove",c),i.removeEventListener("pointerup",p),i.removeEventListener("pointercancel",p),a=null,t.classList.remove("arrastando"),t.dispatchEvent(new CustomEvent("ui-mover",{bubbles:!0,composed:!0,detail:{left:t.style.left,top:t.style.top}}))}};e.add(i,"pointerdown",s=>{if(!t.hasAttribute("flutuante")||s.target.closest("button, input, select, a")||s.button!==0)return;s.preventDefault(),a=s.pointerId,n=s.clientX,l=s.clientY;const m=t.getBoundingClientRect();d=m.left,u=m.top,t.classList.add("arrastando");try{i.setPointerCapture(s.pointerId)}catch{}i.addEventListener("pointermove",c),i.addEventListener("pointerup",p),i.addEventListener("pointercancel",p)})}const o=r.getElementById("resizer-canto");if(o){let a=null,n=0,l=0,d=0,u=0;const c=s=>{if(a===null)return;const h=Math.max(200,n+(s.clientX-d)),m=Math.max(180,l+(s.clientY-u));t.style.width=`${h}px`,t.style.height=`${m}px`},p=s=>{if(a!==null){try{o.releasePointerCapture(s.pointerId)}catch{}o.removeEventListener("pointermove",c),o.removeEventListener("pointerup",p),o.removeEventListener("pointercancel",p),a=null,t.dispatchEvent(new CustomEvent("ui-redimensionar",{bubbles:!0,composed:!0,detail:{width:t.style.width,height:t.style.height}}))}};e.add(o,"pointerdown",s=>{if(!t.hasAttribute("flutuante")||s.button!==0)return;s.preventDefault(),s.stopPropagation(),a=s.pointerId,d=s.clientX,u=s.clientY;const h=t.getBoundingClientRect();n=h.width,l=h.height;try{o.setPointerCapture(s.pointerId)}catch{}o.addEventListener("pointermove",c),o.addEventListener("pointerup",p),o.addEventListener("pointercancel",p)})}}function vt(t){return t==="compacta"?"ultracompacta":t==="ultracompacta"?"padrao":"compacta"}class xt{constructor(r){v(this,"valoresOriginais",{});v(this,"valoresAtuais",{});this.ctx=r}inicializarCategorias(r){this.valoresOriginais={},this.valoresAtuais={};const e=new Set;(Array.isArray(r)?r:[]).forEach(i=>{!i||typeof i!="object"||(Array.isArray(i.propriedades)?i.propriedades:[]).forEach(o=>{if(!o||typeof o!="object"||o.id===void 0||o.id===null)return;const a=String(o.id);e.has(a)&&typeof console<"u"&&console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${a}". Os valores são indexados por id e serão compartilhados.`),e.add(a);const n=W(o);this.valoresOriginais[a]=n,this.valoresAtuais[a]=n})}),this.ctx.onAtualizarBotoesFooter(!1)}get isDirty(){return Object.keys(this.valoresAtuais).some(r=>this.isModificada(r))}isModificada(r){return!I(this.valoresAtuais[r],this.valoresOriginais[r])}getValores(){return{...this.valoresAtuais}}getValoresOriginais(){return{...this.valoresOriginais}}setValores(r){!r||typeof r!="object"||(Object.keys(r).forEach(e=>{this.valoresAtuais[e]=r[e],this.valoresOriginais[e]=r[e]}),this.ctx.onAtualizarBotoesFooter(this.isDirty))}obterValor(r){return this.valoresAtuais[r]}obterValorOriginal(r){return this.valoresOriginais[r]}definirValor(r,e,i=!0){const o=this.valoresAtuais[r];I(o,e)||(this.valoresAtuais[r]=e,this.aposAlterar(r),this.ctx.onAtualizarCampoVisual(r,e),i&&this.emitirAlteracao(r,e,o,this.categoriaDe(r)))}redefinirValor(r,e=!0){if(!(r in this.valoresOriginais)||!this.isModificada(r))return!1;const i=this.valoresOriginais[r];return this.definirValor(r,i,e&&!this.ctx.isModoManual()),!0}registrarAlteracao(r,e,i){const o=this.valoresAtuais[e];I(o,i)||(this.valoresAtuais[e]=i,this.aposAlterar(e),this.ctx.isModoManual()||this.emitirAlteracao(e,i,o,r))}aplicar(){var i;if(!this.isDirty)return;const r={};Object.keys(this.valoresAtuais).forEach(o=>{this.isModificada(o)&&(r[o]=this.valoresAtuais[o])}),this.valoresOriginais={...this.valoresAtuais},this.ctx.onAtualizarBotoesFooter(!1);const e=(i=this.ctx.hostElement.shadowRoot)==null?void 0:i.querySelectorAll(".ui-prop__linha--modificada");e==null||e.forEach(o=>{o.classList.remove("ui-prop__linha--modificada"),O.alternarPart(o,"linha-modificada",!1)}),this.ctx.hostElement.dispatchEvent(new CustomEvent("ui-aplicar",{bubbles:!0,composed:!0,detail:{valores:{...this.valoresAtuais},alterados:r}}))}desfazer(){this.isDirty&&(this.valoresAtuais={...this.valoresOriginais},this.ctx.onAtualizarBotoesFooter(!1),this.ctx.onRenderCategorias(),this.ctx.hostElement.dispatchEvent(new CustomEvent("ui-desfazer",{bubbles:!0,composed:!0,detail:{valores:{...this.valoresAtuais}}})))}aposAlterar(r){const e=de(this.ctx.hostElement.shadowRoot,r);if(e){const i=this.isModificada(r),o=z(this.valoresAtuais[r]);e.classList.toggle("ui-prop__linha--modificada",i),e.classList.toggle("ui-prop__linha--misto",o),O.alternarPart(e,"linha-modificada",i),O.alternarPart(e,"linha-mista",o)}this.ctx.onAtualizarBotoesFooter(this.isDirty)}categoriaDe(r){for(const e of this.ctx.getCategorias())if(e&&Array.isArray(e.propriedades)&&e.propriedades.some(i=>i&&String(i.id)===String(r)))return e.id;return""}emitirAlteracao(r,e,i,o=""){this.ctx.hostElement.dispatchEvent(new CustomEvent("ui-propriedade-alterada",{bubbles:!0,composed:!0,detail:{id:r,categoriaId:o,valor:e,valorAnterior:i,todosValores:{...this.valoresAtuais}}}))}}function _t(t){const{shadow:r,listeners:e,host:i,onToggleExpandirTodas:o,onFiltrar:a,onAplicar:n,onDesfazer:l,onAlternarDensidade:d,onAlternarFlutuante:u,onAlternarColapsoHorizontal:c,onFocarPrimeiroEditor:p}=t,s=r.getElementById("btn-flutuante");s&&u&&e.add(s,"click",u);const h=r.getElementById("btn-colapsar-horizontal");h&&c&&e.add(h,"click",c);const m=r.getElementById("faixa-estreita");m&&c&&e.add(m,"click",c);const g=r.getElementById("btn-expandir-faixa");g&&c&&e.add(g,"click",A=>{A.stopPropagation(),c()});const f=r.getElementById("btn-densidade");f&&d&&e.add(f,"click",d);const b=r.getElementById("btn-expandir-tudo");b&&e.add(b,"click",o);const y=r.getElementById("btn-fechar");y&&e.add(y,"click",()=>{i.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0}))});const _=r.getElementById("filtro-input"),w=r.getElementById("btn-limpar-filtro"),C=()=>{w&&_&&(w.style.display=_.value?"inline-flex":"none")};_&&(e.add(_,"input",()=>{C();const A=(_.value||"").trim().toLowerCase();a(A)}),e.add(_,"keydown",A=>{A.key==="Escape"?_.value?(A.preventDefault(),A.stopPropagation(),_.value="",C(),a("")):_.blur():(A.key==="Enter"||A.key==="ArrowDown")&&p&&(A.preventDefault(),p())})),w&&_&&e.add(w,"click",()=>{_.value="",C(),a(""),_.focus()});const E=r.getElementById("btn-aplicar");E&&e.add(E,"click",n);const x=r.getElementById("btn-desfazer");x&&e.add(x,"click",l);const k=r.getElementById("link-ajuda");k&&e.add(k,"click",A=>{A.preventDefault(),i.dispatchEvent(new CustomEvent("ui-ajuda",{bubbles:!0,composed:!0}))}),e.add(r,"keydown",A=>{const L=A;(L.ctrlKey||L.metaKey)&&L.key==="Enter"&&i.getAttribute("modo-aplicar")==="manual"&&(L.preventDefault(),n())})}function D(t,r){const e=t.getElementById("header-titulo-texto");e&&(e.textContent=r.getAttribute("titulo")||"Propriedades");const i=t.getElementById("btn-fechar");i&&(i.style.display=r.hasAttribute("fechavel")?"inline-flex":"none");const o=t.getElementById("btn-flutuante");if(o){const p=r.hasAttribute("flutuante");o.title=p?"Acoplar painel (Dock)":"Desacoplar / Modo flutuante (CAD)",o.setAttribute("aria-pressed",String(p)),o.classList.toggle("ui-prop__btn-icone--ativo",p)}const a=t.getElementById("btn-colapsar-horizontal");if(a){const p=r.hasAttribute("colapsado");a.title=p?"Expandir painel":"Recolher para coluna estreita",a.setAttribute("aria-pressed",String(p)),a.classList.toggle("ui-prop__btn-icone--ativo",p)}const n=t.getElementById("btn-densidade");if(n){const p=r.getAttribute("densidade")||"padrão";n.title=`Compressão vertical: ${p} (clique para alternar)`}const l=t.getElementById("filtro-container");l&&(l.style.display=r.hasAttribute("filtro")?"flex":"none");const d=t.getElementById("filtro-input"),u=t.getElementById("btn-limpar-filtro");u&&d&&(u.style.display=d.value?"inline-flex":"none");const c=t.getElementById("footer");c&&(c.style.display=r.getAttribute("modo-aplicar")==="manual"?"flex":"none")}class Q extends P.SafeHTMLElement{constructor(){super();v(this,"shadow");v(this,"listeners",new U.ListenerBag);v(this,"splitterListeners",new U.ListenerBag);v(this,"controladorSplitter");v(this,"gerenciadorValores");v(this,"_categorias",[]);v(this,"_tipos",[]);v(this,"_tipoSelecionadoId","");v(this,"_termoBusca","");v(this,"_larguraRotuloPorcentagem",45);v(this,"_sincronizandoFlutuante",!1);v(this,"tipoContainerElement");v(this,"corpoElement");v(this,"btnAplicarElement");v(this,"btnDesfazerElement");v(this,"splitterElement");this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=Xt(),this.tipoContainerElement=this.shadow.getElementById("tipo-container"),this.corpoElement=this.shadow.getElementById("corpo"),this.btnAplicarElement=this.shadow.getElementById("btn-aplicar"),this.btnDesfazerElement=this.shadow.getElementById("btn-desfazer"),this.splitterElement=this.shadow.getElementById("splitter"),this.gerenciadorValores=new xt({hostElement:this,getCategorias:()=>this._categorias,onAtualizarBotoesFooter:e=>{this.btnAplicarElement.disabled=!e,this.btnDesfazerElement.disabled=!e},onAtualizarCampoVisual:(e,i)=>re(this.shadow,e,i),onRenderCategorias:()=>this.renderCategorias(),isModoManual:()=>this.getAttribute("modo-aplicar")==="manual"}),this.controladorSplitter=ht({hostElement:this,corpoElement:this.corpoElement,splitterElement:this.splitterElement,splitterListeners:this.splitterListeners,onLarguraAlterada:e=>{this._larguraRotuloPorcentagem=e}})}static get observedAttributes(){return["titulo","estilo-visual","modo-aplicar","filtro","densidade","largura-rotulo","fechavel","colapsado","flutuante","texto-misto"]}get larguraRotuloPorcentagem(){return this._larguraRotuloPorcentagem}connectedCallback(){this.listeners.cleanup(),_t({shadow:this.shadow,listeners:this.listeners,host:this,onToggleExpandirTodas:()=>this.toggleExpandirTodas(),onFiltrar:e=>{this._termoBusca=e,this.renderCategorias()},onAplicar:()=>this.aplicar(),onDesfazer:()=>this.desfazer(),onAlternarDensidade:()=>this.alternarDensidade(),onAlternarFlutuante:()=>this.alternarFlutuante(),onAlternarColapsoHorizontal:()=>this.alternarColapsoHorizontal(),onFocarPrimeiroEditor:()=>Ue(this.shadow)}),gt(this,this.shadow,this.listeners),this.controladorSplitter.init(),this.syncState()}disconnectedCallback(){this.listeners.cleanup(),this.splitterListeners.cleanup()}attributeChangedCallback(e,i,o){if(i!==o)switch(e){case"largura-rotulo":{const a=parseFloat(o??"");isNaN(a)||(this._larguraRotuloPorcentagem=this.controladorSplitter.definirLarguraRotulo(a));return}case"estilo-visual":this.renderSeletorTipos();return;case"texto-misto":this.renderCategorias();return;case"filtro":if(D(this.shadow,this),o===null&&this._termoBusca){this._termoBusca="";const a=this.shadow.getElementById("filtro-input");a&&(a.value=""),this.renderCategorias()}return;case"flutuante":this._sincronizandoFlutuante||D(this.shadow,this);return;default:D(this.shadow,this)}}get titulo(){return this.getAttribute("titulo")||"Propriedades"}set titulo(e){e?this.setAttribute("titulo",e):this.removeAttribute("titulo")}get estiloVisual(){return this.getAttribute("estilo-visual")||"autocad"}set estiloVisual(e){e&&e!=="autocad"?this.setAttribute("estilo-visual",e):this.removeAttribute("estilo-visual")}get modoAplicar(){return this.getAttribute("modo-aplicar")||"imediato"}set modoAplicar(e){e==="manual"?this.setAttribute("modo-aplicar","manual"):this.removeAttribute("modo-aplicar")}get filtro(){return this.hasAttribute("filtro")}set filtro(e){e?this.setAttribute("filtro",""):this.removeAttribute("filtro")}get termoBusca(){return this._termoBusca}set termoBusca(e){this._termoBusca=(e||"").trim().toLowerCase();const i=this.shadow.getElementById("filtro-input");i&&(i.value=e||""),this.renderCategorias()}get larguraRotulo(){return this._larguraRotuloPorcentagem}set larguraRotulo(e){const i=typeof e=="number"?e:parseFloat(String(e));isNaN(i)||this.setAttribute("largura-rotulo",String(i))}get fechavel(){return this.hasAttribute("fechavel")}set fechavel(e){e?this.setAttribute("fechavel",""):this.removeAttribute("fechavel")}get categorias(){return this._categorias}set categorias(e){this._categorias=Array.isArray(e)?e:[],this.gerenciadorValores.inicializarCategorias(this._categorias),this.renderCategorias()}get textoMisto(){const e=this.getAttribute("texto-misto");return e&&e.trim()?e:Y}set textoMisto(e){typeof e=="string"&&e.trim()?this.setAttribute("texto-misto",e):this.removeAttribute("texto-misto")}get tipos(){return this._tipos}set tipos(e){this._tipos=Array.isArray(e)?e:[],this.renderSeletorTipos()}get tipoSelecionado(){const e=this._tipos.filter(o=>o&&o.id!==null&&o.id!==void 0);return!e.some(o=>String(o.id)===this._tipoSelecionadoId)&&e.length>0?String(e[0].id):this._tipoSelecionadoId}set tipoSelecionado(e){this._tipoSelecionadoId=String(e??""),this.renderSeletorTipos()}get valores(){return this.gerenciadorValores.getValores()}set valores(e){this.gerenciadorValores.setValores(e),this.renderCategorias()}get isDirty(){return this.gerenciadorValores.isDirty}get dirty(){return this.gerenciadorValores.isDirty}obterValor(e){return this.gerenciadorValores.obterValor(e)}definirValor(e,i,o=!0){this.gerenciadorValores.definirValor(e,i,o)}redefinirValor(e,i=!0){return this.gerenciadorValores.redefinirValor(e,i)}aplicar(){this.gerenciadorValores.aplicar()}desfazer(){this.gerenciadorValores.desfazer()}expandirTudo(){We(this.shadow,this._categorias)}colapsarTudo(){Xe(this.shadow,this._categorias)}toggleCategoria(e){Ke(this.shadow,this,this._categorias,e)}get densidade(){return this.getAttribute("densidade")||"padrao"}set densidade(e){!e||e==="padrao"?this.removeAttribute("densidade"):this.setAttribute("densidade",e)}alternarDensidade(){const e=vt(this.getAttribute("densidade")||"padrao");return e==="padrao"?this.removeAttribute("densidade"):this.setAttribute("densidade",e),this.dispatchEvent(new CustomEvent("ui-densidade-alterada",{bubbles:!0,composed:!0,detail:{densidade:e}})),D(this.shadow,this),e}get flutuante(){return this.hasAttribute("flutuante")}set flutuante(e){!!e!==this.hasAttribute("flutuante")&&this.alternarFlutuante()}get colapsado(){return this.hasAttribute("colapsado")}set colapsado(e){!!e!==this.hasAttribute("colapsado")&&this.alternarColapsoHorizontal()}alternarFlutuante(){this._sincronizandoFlutuante=!0;try{const e=bt(this);return D(this.shadow,this),this.dispatchEvent(new CustomEvent("ui-flutuante-alterado",{bubbles:!0,composed:!0,detail:{flutuante:e,left:this.style.left,top:this.style.top,width:this.style.width,height:this.style.height}})),e}finally{this._sincronizandoFlutuante=!1}}alternarColapsoHorizontal(){const e=this.hasAttribute("colapsado");e?this.removeAttribute("colapsado"):this.setAttribute("colapsado","");const i=!e;return D(this.shadow,this),this.dispatchEvent(new CustomEvent("ui-colapso-horizontal",{bubbles:!0,composed:!0,detail:{colapsado:i}})),i}syncState(){D(this.shadow,this);const e=this.getAttribute("largura-rotulo");if(e){const i=parseFloat(e);isNaN(i)||(this._larguraRotuloPorcentagem=this.controladorSplitter.definirLarguraRotulo(i))}this.renderSeletorTipos(),this.renderCategorias()}toggleExpandirTodas(){this._categorias.some(i=>i.aberto!==void 0?i.aberto===!1:i.aberta===!1)?this.expandirTudo():this.colapsarTudo()}renderSeletorTipos(){pt({tipoContainerElement:this.tipoContainerElement,tipos:this._tipos,tipoSelecionadoId:this._tipoSelecionadoId,estiloVisual:this.getAttribute("estilo-visual")||"autocad",onSelecionarTipo:e=>{this._tipoSelecionadoId=e,this.renderSeletorTipos();const i=this._tipos.find(o=>o&&String(o.id)===String(e));this.dispatchEvent(new CustomEvent("ui-tipo-alterado",{bubbles:!0,composed:!0,detail:{id:e,tipo:i}}))},onEditarTipo:e=>this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique",{bubbles:!0,composed:!0,detail:{tipo:e}})),onQuickSelect:e=>this.dispatchEvent(new CustomEvent("ui-quick-select",{bubbles:!0,composed:!0,detail:{tipo:e}})),onSelectObjects:e=>this.dispatchEvent(new CustomEvent("ui-selecionar-objetos",{bubbles:!0,composed:!0,detail:{tipo:e}})),onCalculadora:e=>this.dispatchEvent(new CustomEvent("ui-calculadora",{bubbles:!0,composed:!0,detail:{tipo:e}}))})}renderCategorias(){const e=this.shadow.getElementById("lista-categorias");e&&mt({listaContainer:e,categorias:this._categorias,termoBusca:this._termoBusca,onToggleCategoria:i=>this.toggleCategoria(i),linhaCtx:{valoresAtuais:this.gerenciadorValores.getValores(),valoresOriginais:this.gerenciadorValores.getValoresOriginais(),onAtualizarCampoVisual:(i,o)=>re(this.shadow,i,o),onRedefinir:i=>this.redefinirValor(i),editorCtx:{obterValorAtual:i=>this.gerenciadorValores.obterValor(i),registrarAlteracao:(i,o,a)=>{this.gerenciadorValores.registrarAlteracao(i,o,a)},focarProximoEditor:i=>$e(this.shadow,i),focarEditorAnterior:i=>je(this.shadow,i),obterTextoMisto:()=>this.textoMisto,despacharEventoAcao:(i,o)=>{this.dispatchEvent(new CustomEvent("ui-acao-clique",{bubbles:!0,composed:!0,detail:{id:i.id,categoriaId:o,propriedade:i}}))}}}})}}class Et extends Q{}class yt extends Q{}P.definirCustomElement("ui-tabela-propriedades",Q);P.definirCustomElement("ui-painel-propriedades",Et);P.definirCustomElement("ui-propriedades",yt);exports.GerenciadorValoresPropriedades=xt;exports.TEXTO_MISTO_PADRAO=Y;exports.TabelaOrquestradorDados=Ce;exports.TabelaRemotaController=_e;exports.TabelaSelecaoController=ye;exports.UIPainelPropriedades=Et;exports.UIPropriedades=yt;exports.UITabela=Ve;exports.UITabelaPropriedades=Q;exports.VALOR_MISTO=K;exports.abrirPopoverRedimensionamento=Re;exports.alternarCategoria=Ke;exports.alternarDirecaoOrdenacao=we;exports.alternarPosicionamentoFlutuante=bt;exports.aplicarLimitesNumericos=G;exports.aplicarOrdenacaoTabela=Ae;exports.atualizarCampoVisual=re;exports.avaliarExpressaoMatematica=He;exports.buscarLinhaPropriedade=de;exports.colapsarTodasCategorias=Xe;exports.combinarValores=jt;exports.conectarArrastoFlutuante=gt;exports.conectarPainelControles=_t;exports.criarControladorSplitter=ht;exports.criarEditorAcao=tt;exports.criarEditorBooleano=Je;exports.criarEditorCorCad=dt;exports.criarEditorCorSwatch=ct;exports.criarEditorLinetype=at;exports.criarEditorLineweight=nt;exports.criarEditorNumero=rt;exports.criarEditorReadonly=Ze;exports.criarEditorSelecao=et;exports.criarEditorTexto=it;exports.criarEditorValor=ut;exports.criarLinhaPropriedade=ft;exports.executarOrquestracaoCorpo=Ie;exports.executarOrquestracaoHeader=Oe;exports.executarRedimensionamentoColuna=Te;exports.executarRedimensionamentoTeclado=De;exports.exibirPromptPopoverRedimensionamento=Ne;exports.expandirTodasCategorias=We;exports.focarEditorAnterior=je;exports.focarPrimeiroEditor=Ue;exports.focarProximoEditor=$e;exports.formatWidth=oe;exports.getAlignmentClass=ae;exports.getRowHeight=te;exports.getTextAlign=ne;exports.inicializarScrollVirtualizacao=Pe;exports.iniciarRedimensionamentoColuna=Me;exports.interpretarEntradaNumerica=j;exports.interpretarIndice=ee;exports.isValorMisto=z;exports.limitarLarguraColuna=X;exports.localizarIndiceItem=Ee;exports.marcarSelectMisto=F;exports.montarEstruturaDOM=ke;exports.normalizarTexto=$;exports.obterCasasDecimais=V;exports.obterPassoNumerico=Ge;exports.orquestrarEstruturaInicial=Be;exports.proximaDensidade=vt;exports.redimensionarColunaPorDelta=Le;exports.registrarAtualizadorEditor=M;exports.renderizarCategoriasETree=mt;exports.renderizarCorpoTabela=Se;exports.renderizarHeaderTabela=ze;exports.renderizarSeletorTipos=pt;exports.sincronizarAtributosTabela=se;exports.sincronizarPainelControles=D;exports.sincronizarSelect=B;exports.textoMistoDe=N;exports.tratarMudancaAtributoTabela=Fe;exports.valorComum=Ye;exports.valorInicialDaPropriedade=W;exports.valoresIguais=I;
|