@thibezer/ui-components-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +624 -0
  3. package/dist/botao.cjs +1 -0
  4. package/dist/botao.d.ts +8 -0
  5. package/dist/botao.js +6 -0
  6. package/dist/camadas.cjs +296 -0
  7. package/dist/camadas.d.ts +14 -0
  8. package/dist/camadas.js +1857 -0
  9. package/dist/campo-texto.cjs +1 -0
  10. package/dist/campo-texto.d.ts +8 -0
  11. package/dist/campo-texto.js +11 -0
  12. package/dist/canvas.cjs +254 -0
  13. package/dist/canvas.d.ts +8 -0
  14. package/dist/canvas.js +3082 -0
  15. package/dist/card.cjs +1 -0
  16. package/dist/card.d.ts +7 -0
  17. package/dist/card.js +5 -0
  18. package/dist/components/ui-alerta/index.d.ts +2 -0
  19. package/dist/components/ui-alerta/ui-alerta-base.d.ts +23 -0
  20. package/dist/components/ui-alerta/ui-alerta.d.ts +2 -0
  21. package/dist/components/ui-alerta/ui-toast.d.ts +34 -0
  22. package/dist/components/ui-avatar/index.d.ts +1 -0
  23. package/dist/components/ui-avatar/ui-avatar.d.ts +12 -0
  24. package/dist/components/ui-badge/index.d.ts +1 -0
  25. package/dist/components/ui-badge/ui-badge.d.ts +20 -0
  26. package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -0
  27. package/dist/components/ui-barra-ferramentas/ferramentas-icones.d.ts +24 -0
  28. package/dist/components/ui-barra-ferramentas/index.d.ts +4 -0
  29. package/dist/components/ui-barra-ferramentas/tipos.d.ts +55 -0
  30. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +54 -0
  31. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +52 -0
  32. package/dist/components/ui-botao/index.d.ts +1 -0
  33. package/dist/components/ui-botao/ui-botao.d.ts +26 -0
  34. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +18 -0
  35. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +18 -0
  36. package/dist/components/ui-camadas/camadas-eventos-arvore.d.ts +2 -0
  37. package/dist/components/ui-camadas/camadas-eventos-camadas.d.ts +2 -0
  38. package/dist/components/ui-camadas/camadas-eventos-rodape.d.ts +2 -0
  39. package/dist/components/ui-camadas/camadas-host.d.ts +23 -0
  40. package/dist/components/ui-camadas/camadas-icones.d.ts +23 -0
  41. package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -0
  42. package/dist/components/ui-camadas/camadas-metricas.d.ts +17 -0
  43. package/dist/components/ui-camadas/camadas-persistencia.d.ts +65 -0
  44. package/dist/components/ui-camadas/camadas-resizer.d.ts +16 -0
  45. package/dist/components/ui-camadas/camadas-rodape.d.ts +2 -0
  46. package/dist/components/ui-camadas/camadas-selecao.d.ts +24 -0
  47. package/dist/components/ui-camadas/camadas-sincronizacao-dom.d.ts +3 -0
  48. package/dist/components/ui-camadas/camadas-teclado.d.ts +3 -0
  49. package/dist/components/ui-camadas/camadas-utils.d.ts +26 -0
  50. package/dist/components/ui-camadas/index.d.ts +11 -0
  51. package/dist/components/ui-camadas/tipos.d.ts +116 -0
  52. package/dist/components/ui-camadas/ui-camadas.d.ts +112 -0
  53. package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +12 -0
  54. package/dist/components/ui-campo-texto/campo-texto-template.d.ts +2 -0
  55. package/dist/components/ui-campo-texto/index.d.ts +1 -0
  56. package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +57 -0
  57. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +13 -0
  58. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +19 -0
  59. package/dist/components/ui-canvas-cad/cad-colecoes-dados.d.ts +46 -0
  60. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +26 -0
  61. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +19 -0
  62. package/dist/components/ui-canvas-cad/cad-painel-camadas.d.ts +9 -0
  63. package/dist/components/ui-canvas-cad/cad-tamanho-observer.d.ts +7 -0
  64. package/dist/components/ui-canvas-cad/cad-template.d.ts +1 -0
  65. package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +29 -0
  66. package/dist/components/ui-canvas-cad/index.d.ts +8 -0
  67. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +91 -0
  68. package/dist/components/ui-card/index.d.ts +1 -0
  69. package/dist/components/ui-card/ui-card.d.ts +18 -0
  70. package/dist/components/ui-checkbox/index.d.ts +1 -0
  71. package/dist/components/ui-checkbox/ui-checkbox.d.ts +36 -0
  72. package/dist/components/ui-drawer/drawer-acessibilidade.d.ts +16 -0
  73. package/dist/components/ui-drawer/index.d.ts +1 -0
  74. package/dist/components/ui-drawer/ui-drawer.d.ts +37 -0
  75. package/dist/components/ui-icone/index.d.ts +1 -0
  76. package/dist/components/ui-icone/ui-icone.d.ts +15 -0
  77. package/dist/components/ui-lista-flutuante/index.d.ts +1 -0
  78. package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +15 -0
  79. package/dist/components/ui-lista-flutuante/lista-flutuante-render.d.ts +9 -0
  80. package/dist/components/ui-lista-flutuante/lista-flutuante-teclado.d.ts +13 -0
  81. package/dist/components/ui-lista-flutuante/lista-flutuante-template.d.ts +2 -0
  82. package/dist/components/ui-lista-flutuante/tipos.d.ts +4 -0
  83. package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +63 -0
  84. package/dist/components/ui-mapa/index.d.ts +3 -0
  85. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -0
  86. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -0
  87. package/dist/components/ui-mapa/ui-mapa.d.ts +16 -0
  88. package/dist/components/ui-modal/index.d.ts +2 -0
  89. package/dist/components/ui-modal/modal-acessibilidade.d.ts +12 -0
  90. package/dist/components/ui-modal/ui-modal.d.ts +30 -0
  91. package/dist/components/ui-radio/index.d.ts +1 -0
  92. package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
  93. package/dist/components/ui-radio/ui-radio.d.ts +29 -0
  94. package/dist/components/ui-segmented/index.d.ts +1 -0
  95. package/dist/components/ui-segmented/segmented-indicador.d.ts +13 -0
  96. package/dist/components/ui-segmented/segmented-teclado.d.ts +4 -0
  97. package/dist/components/ui-segmented/segmented-template.d.ts +4 -0
  98. package/dist/components/ui-segmented/ui-segmented.d.ts +48 -0
  99. package/dist/components/ui-seletor-mapa-base/index.d.ts +2 -0
  100. package/dist/components/ui-seletor-mapa-base/tipos.d.ts +22 -0
  101. package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +43 -0
  102. package/dist/components/ui-skeleton/index.d.ts +1 -0
  103. package/dist/components/ui-skeleton/ui-skeleton.d.ts +19 -0
  104. package/dist/components/ui-stat/index.d.ts +1 -0
  105. package/dist/components/ui-stat/ui-stat.d.ts +30 -0
  106. package/dist/components/ui-switch/index.d.ts +1 -0
  107. package/dist/components/ui-switch/ui-switch.d.ts +36 -0
  108. package/dist/components/ui-tabela/index.d.ts +7 -0
  109. package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +14 -0
  110. package/dist/components/ui-tabela/tabela-corpo.d.ts +18 -0
  111. package/dist/components/ui-tabela/tabela-dom.d.ts +15 -0
  112. package/dist/components/ui-tabela/tabela-header.d.ts +18 -0
  113. package/dist/components/ui-tabela/tabela-interacao.d.ts +9 -0
  114. package/dist/components/ui-tabela/tabela-localizador.d.ts +4 -0
  115. package/dist/components/ui-tabela/tabela-ordenacao.d.ts +12 -0
  116. package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +18 -0
  117. package/dist/components/ui-tabela/tabela-redimensionamento.d.ts +28 -0
  118. package/dist/components/ui-tabela/tabela-remota.d.ts +15 -0
  119. package/dist/components/ui-tabela/tabela-renderizador.d.ts +29 -0
  120. package/dist/components/ui-tabela/tabela-selecao.d.ts +24 -0
  121. package/dist/components/ui-tabela/tipos.d.ts +27 -0
  122. package/dist/components/ui-tabela/ui-tabela.d.ts +83 -0
  123. package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +6 -0
  124. package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +7 -0
  125. package/dist/components/ui-tabela-propriedades/editores-cad.d.ts +17 -0
  126. package/dist/components/ui-tabela-propriedades/index.d.ts +6 -0
  127. package/dist/components/ui-tabela-propriedades/propriedades-densidade.d.ts +5 -0
  128. package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +6 -0
  129. package/dist/components/ui-tabela-propriedades/propriedades-editores.d.ts +5 -0
  130. package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +7 -0
  131. package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +26 -0
  132. package/dist/components/ui-tabela-propriedades/propriedades-painel-controles.d.ts +15 -0
  133. package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +24 -0
  134. package/dist/components/ui-tabela-propriedades/propriedades-seletor-tipo.d.ts +13 -0
  135. package/dist/components/ui-tabela-propriedades/propriedades-splitter.d.ts +13 -0
  136. package/dist/components/ui-tabela-propriedades/propriedades-template.d.ts +1 -0
  137. package/dist/components/ui-tabela-propriedades/tipos.d.ts +48 -0
  138. package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +66 -0
  139. package/dist/components/ui-texto/index.d.ts +1 -0
  140. package/dist/components/ui-texto/ui-texto.d.ts +15 -0
  141. package/dist/components/ui-tooltip/index.d.ts +1 -0
  142. package/dist/components/ui-tooltip/ui-tooltip.d.ts +25 -0
  143. package/dist/core/acessibilidade.d.ts +21 -0
  144. package/dist/core/form-associated-element.d.ts +33 -0
  145. package/dist/core/form-validacao.d.ts +34 -0
  146. package/dist/core/index.d.ts +7 -0
  147. package/dist/core/leaflet-loader.d.ts +7 -0
  148. package/dist/core/leaflet-style.d.ts +7 -0
  149. package/dist/core/listener-bag.d.ts +21 -0
  150. package/dist/core/ssr-safe.d.ts +20 -0
  151. package/dist/core/ui-bus.d.ts +85 -0
  152. package/dist/core/zero-js-triggers.d.ts +1 -0
  153. package/dist/core.cjs +1 -0
  154. package/dist/core.js +22 -0
  155. package/dist/data.cjs +1 -0
  156. package/dist/data.d.ts +22 -0
  157. package/dist/data.js +63 -0
  158. package/dist/feedback.cjs +1 -0
  159. package/dist/feedback.d.ts +26 -0
  160. package/dist/feedback.js +25 -0
  161. package/dist/form-validacao-BIOXxt-1.js +140 -0
  162. package/dist/form-validacao-ytRYSF3E.cjs +1 -0
  163. package/dist/forms.cjs +1 -0
  164. package/dist/forms.d.ts +22 -0
  165. package/dist/forms.js +25 -0
  166. package/dist/gerencigeo-canvas/canvas_destaque.d.ts +13 -0
  167. package/dist/gerencigeo-canvas/canvas_destaque_marcadores.d.ts +8 -0
  168. package/dist/gerencigeo-canvas/canvas_interacao.d.ts +56 -0
  169. package/dist/gerencigeo-canvas/canvas_selecao_box.d.ts +23 -0
  170. package/dist/gerencigeo-canvas/controller_dados_ops.d.ts +15 -0
  171. package/dist/gerencigeo-canvas/index.d.ts +17 -0
  172. package/dist/gerencigeo-canvas/layer_defaults.d.ts +3 -0
  173. package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +6 -0
  174. package/dist/gerencigeo-canvas/layer_manager.d.ts +37 -0
  175. package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +8 -0
  176. package/dist/gerencigeo-canvas/layer_renderer_factory.d.ts +14 -0
  177. package/dist/gerencigeo-canvas/layer_state_ops.d.ts +6 -0
  178. package/dist/gerencigeo-canvas/mapa_config.d.ts +11 -0
  179. package/dist/gerencigeo-canvas/mapa_controller.d.ts +53 -0
  180. package/dist/gerencigeo-canvas/mapa_core.d.ts +30 -0
  181. package/dist/gerencigeo-canvas/mapa_linhas.d.ts +14 -0
  182. package/dist/gerencigeo-canvas/mapa_marcadores.d.ts +18 -0
  183. package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +8 -0
  184. package/dist/gerencigeo-canvas/renderers/grid_renderer.d.ts +9 -0
  185. package/dist/gerencigeo-canvas/renderers/tile_renderer.d.ts +8 -0
  186. package/dist/gerencigeo-canvas/renderers/vector_lines_builder.d.ts +4 -0
  187. package/dist/gerencigeo-canvas/renderers/vector_lines_renderer.d.ts +9 -0
  188. package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +11 -0
  189. package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +9 -0
  190. package/dist/gerencigeo-canvas/renderers/wms_renderer.d.ts +8 -0
  191. package/dist/gerencigeo-canvas/sigef_consultor.d.ts +9 -0
  192. package/dist/gerencigeo-canvas/tile_preloader.d.ts +2 -0
  193. package/dist/gerencigeo-canvas/types.d.ts +169 -0
  194. package/dist/gerencigeo-canvas/utils.d.ts +46 -0
  195. package/dist/index.cjs +1 -0
  196. package/dist/index.d.ts +116 -0
  197. package/dist/index.js +186 -0
  198. package/dist/leaflet-Cw6tqYFh.cjs +1 -0
  199. package/dist/leaflet-DkaFZYc5.js +69 -0
  200. package/dist/leaflet-loader-94z5VsdY.cjs +2 -0
  201. package/dist/leaflet-loader-Cjcdgj5R.js +21 -0
  202. package/dist/listener-bag-D5omxZ9h.cjs +1 -0
  203. package/dist/listener-bag-DQgv7OON.js +34 -0
  204. package/dist/mapa.cjs +19 -0
  205. package/dist/mapa.d.ts +11 -0
  206. package/dist/mapa.js +264 -0
  207. package/dist/modal.cjs +1 -0
  208. package/dist/modal.d.ts +8 -0
  209. package/dist/modal.js +8 -0
  210. package/dist/register.cjs +1 -0
  211. package/dist/register.d.ts +7 -0
  212. package/dist/register.js +21 -0
  213. package/dist/seletor-mapa-base.cjs +53 -0
  214. package/dist/seletor-mapa-base.d.ts +8 -0
  215. package/dist/seletor-mapa-base.js +275 -0
  216. package/dist/ssr-safe-5cWfJP-s.js +10 -0
  217. package/dist/ssr-safe-CiHD1adl.cjs +1 -0
  218. package/dist/tabela.cjs +1 -0
  219. package/dist/tabela.d.ts +12 -0
  220. package/dist/tabela.js +56 -0
  221. package/dist/tools.cjs +1 -0
  222. package/dist/tools.d.ts +8 -0
  223. package/dist/tools.js +30 -0
  224. package/dist/ui-badge-92yelKls.js +183 -0
  225. package/dist/ui-badge-B95jSECC.cjs +28 -0
  226. package/dist/ui-botao-BShEouvi.js +124 -0
  227. package/dist/ui-botao-DF1yuUUD.cjs +12 -0
  228. package/dist/ui-campo-texto-BCh5HyCM.cjs +16 -0
  229. package/dist/ui-campo-texto-B_JF6POq.js +361 -0
  230. package/dist/ui-card-BJ8SmvVf.js +111 -0
  231. package/dist/ui-card-Bhm6k91e.cjs +20 -0
  232. package/dist/ui-kit.css +1 -0
  233. package/dist/ui-modal-Bi4isGYh.cjs +18 -0
  234. package/dist/ui-modal-DV-pw2x1.js +194 -0
  235. package/dist/ui-paleta-ferramentas-B6dJ0O6K.cjs +18 -0
  236. package/dist/ui-paleta-ferramentas-Bpp4XBVg.js +633 -0
  237. package/dist/ui-segmented-C8wuycjJ.js +411 -0
  238. package/dist/ui-segmented-NC5cBXLh.cjs +19 -0
  239. package/dist/ui-skeleton-B3xQyn0Z.js +396 -0
  240. package/dist/ui-skeleton-D42oQufF.cjs +33 -0
  241. package/dist/ui-switch-C6o4yZUF.cjs +53 -0
  242. package/dist/ui-switch-CO9MoS8x.js +826 -0
  243. package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +145 -0
  244. package/dist/ui-tabela-propriedades-D-XKNVwK.js +2078 -0
  245. package/dist/ui-toast-CQBqvUm3.cjs +20 -0
  246. package/dist/ui-toast-CwUmiqyG.js +156 -0
  247. package/dist/zero-js-triggers-DdESy0tk.js +205 -0
  248. package/dist/zero-js-triggers-QGD7FOTv.cjs +1 -0
  249. package/package.json +149 -0
@@ -0,0 +1,633 @@
1
+ var j = Object.defineProperty;
2
+ var q = (o, l, e) => l in o ? j(o, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[l] = e;
3
+ var c = (o, l, e) => q(o, typeof l != "symbol" ? l + "" : l, e);
4
+ import { L as E } from "./listener-bag-DQgv7OON.js";
5
+ import { d as k, S as C } from "./ssr-safe-5cWfJP-s.js";
6
+ const H = ':host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;color:inherit;flex-shrink:0;width:var(--ui-tamanho-icone, 20px);height:var(--ui-tamanho-icone, 20px);box-sizing:border-box}.ui-icone{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;color:inherit;font-size:var(--ui-tamanho-icone, 20px)}::slotted(svg),.ui-icone svg{width:100%!important;height:100%!important;display:block;shape-rendering:geometricPrecision}:host([cor="primaria"]),:host([color="primaria"]){color:var(--ui-cor-primaria, #00E08A)}:host([cor="secundaria"]),:host([color="secundaria"]){color:var(--ui-cor-texto-secundario, #888899)}:host([cor="erro"]),:host([color="erro"]){color:var(--ui-cor-texto-erro, #ff5555)}:host([cor="sucesso"]),:host([color="sucesso"]){color:var(--ui-cor-texto-sucesso, #00E08A)}:host([cor="alerta"]),:host([color="alerta"]){color:var(--ui-cor-texto-alerta, #ffb86c)}', S = {
7
+ search: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
8
+ check: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>',
9
+ eye: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>',
10
+ eyeOff: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',
11
+ lock: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>',
12
+ trash: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>',
13
+ gear: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>',
14
+ bell: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>',
15
+ alert: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>',
16
+ close: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'
17
+ };
18
+ class B extends C {
19
+ constructor() {
20
+ super();
21
+ c(this, "iconContainer");
22
+ c(this, "svgContainer");
23
+ c(this, "slotElement");
24
+ c(this, "handleSlotChange", () => {
25
+ this.syncState();
26
+ });
27
+ const e = this.attachShadow({ mode: "open" });
28
+ e.innerHTML = `
29
+ <style>${H}</style>
30
+ <span class="ui-icone" aria-hidden="true">
31
+ <span class="ui-icone__svg" style="display: none;"></span>
32
+ <slot></slot>
33
+ </span>
34
+ `, this.iconContainer = e.querySelector(".ui-icone"), this.svgContainer = e.querySelector(".ui-icone__svg"), this.slotElement = e.querySelector("slot");
35
+ }
36
+ static get observedAttributes() {
37
+ return ["tamanho", "size", "cor", "color", "nome", "name"];
38
+ }
39
+ connectedCallback() {
40
+ this.slotElement.addEventListener("slotchange", this.handleSlotChange), this.syncState();
41
+ }
42
+ disconnectedCallback() {
43
+ this.slotElement.removeEventListener("slotchange", this.handleSlotChange);
44
+ }
45
+ attributeChangedCallback(e, t, i) {
46
+ this.syncState();
47
+ }
48
+ resolveTamanhoPx() {
49
+ const e = this.getAttribute("tamanho") || this.getAttribute("size") || "md";
50
+ switch (e.toLowerCase()) {
51
+ case "sm":
52
+ return "16px";
53
+ case "md":
54
+ return "20px";
55
+ case "lg":
56
+ return "24px";
57
+ case "xl":
58
+ return "32px";
59
+ default:
60
+ return isNaN(Number(e)) ? e : `${e}px`;
61
+ }
62
+ }
63
+ syncState() {
64
+ const e = this.resolveTamanhoPx();
65
+ this.style.setProperty("--ui-tamanho-icone", e);
66
+ const t = this.getAttribute("cor") || this.getAttribute("color");
67
+ t ? (this.style.setProperty("--ui-cor-icone", t), this.iconContainer.style.color = t) : (this.style.removeProperty("--ui-cor-icone"), this.iconContainer.style.color = ""), this.hasAttribute("aria-label") || this.hasAttribute("label") ? this.iconContainer.removeAttribute("aria-hidden") : this.iconContainer.setAttribute("aria-hidden", "true");
68
+ const r = this.getAttribute("nome") || this.getAttribute("name"), n = this.slotElement.assignedNodes().length > 0;
69
+ r && S[r] && !n ? (this.svgContainer.innerHTML = S[r], this.svgContainer.style.display = "inline-flex") : (this.svgContainer.innerHTML = "", this.svgContainer.style.display = "none");
70
+ }
71
+ }
72
+ k("ui-icone", B);
73
+ const $ = ':host{display:block;position:relative;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}.ui-ribbon{display:flex;flex-direction:column;background:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));-webkit-user-select:none;user-select:none}.ui-ribbon__abas{display:flex;align-items:flex-end;gap:2px;height:30px;padding:0 8px;box-sizing:border-box;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__abas::-webkit-scrollbar{display:none}.ui-ribbon__aba{position:relative;flex-shrink:0;height:28px;padding:0 14px;border:0;border-radius:6px 6px 0 0;background:transparent;color:var(--ui-cor-texto-secundario, #888899);font:inherit;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.ui-ribbon__aba:hover{color:var(--ui-cor-texto, #e1e1e6)}.ui-ribbon__aba:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-ribbon__aba--ativa{color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-fundo-elevado, #1a1a1e)}.ui-ribbon__aba--ativa:after{content:"";position:absolute;left:8px;right:8px;bottom:0;height:2px;border-radius:2px 2px 0 0;background:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__aba--contextual{color:var(--ui-cor-primaria, #00E08A)}.ui-ribbon__painel{background:var(--ui-cor-fundo-elevado, #1a1a1e);overflow-x:auto}.ui-ribbon__grupos{display:flex;align-items:stretch;min-height:84px;padding:4px 8px;box-sizing:border-box}.ui-ribbon__grupo{display:flex;flex-direction:column;flex-shrink:0;padding:0 8px;border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ribbon__grupo:last-child{border-right:0}.ui-ribbon__grupo-itens{display:flex;flex:1;align-items:stretch;gap:2px}.ui-ribbon__grupo-rotulo{padding-top:2px;color:var(--ui-cor-texto-secundario, #888899);font-size:11px;text-align:center;white-space:nowrap}.ui-ribbon__coluna{display:flex;flex-direction:column;justify-content:center;gap:1px}.ui-ribbon__separador{width:1px;margin:4px 3px;background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-ferr-btn--grande{flex-direction:column;min-width:52px;padding:4px 6px;gap:3px}.ui-ferr-btn--pequeno{height:22px;padding:0 6px;justify-content:flex-start}.ui-ferr-btn--pequeno.ui-ferr-btn--so-icone{width:24px;padding:0;justify-content:center}:host([recolhido]) .ui-ribbon__painel{display:none;position:absolute;top:100%;left:0;right:0;z-index:var(--ui-z-docked-bar, 600);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));box-shadow:0 8px 24px #00000059}:host([recolhido]) .ui-ribbon--aberto .ui-ribbon__painel{display:block}:host([recolhido]) .ui-ribbon__aba--ativa:after{display:none}:host([compacto]) .ui-ribbon__grupos{min-height:64px}:host([compacto]) .ui-ferr-btn--grande{min-width:44px}', P = '.ui-ferr-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;padding:0;border:1px solid transparent;border-radius:var(--ui-raio-borda, 6px);background:transparent;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:12px;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.ui-ferr-btn:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-btn:active:not(:disabled){background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent)}.ui-ferr-btn:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-ferr-btn:disabled{opacity:.4;cursor:not-allowed}.ui-ferr-btn--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 55%,transparent)}.ui-ferr-btn__icone{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.ui-ferr-btn__rotulo{white-space:nowrap}.ui-ferr-btn__caret{width:0;height:0;flex-shrink:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid currentColor;opacity:.7}.ui-ferr-menu{position:fixed;z-index:var(--ui-z-popover, 1050);display:flex;flex-direction:column;gap:1px;min-width:180px;padding:4px;box-sizing:border-box;background:var(--ui-cor-fundo-menu, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);box-shadow:0 8px 24px #00000059;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}.ui-ferr-menu__item{display:flex;align-items:center;gap:8px;width:100%;height:28px;padding:0 8px;box-sizing:border-box;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:12px;text-align:left;cursor:pointer}.ui-ferr-menu__item:hover:not(:disabled),.ui-ferr-menu__item:focus-visible{outline:none;background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-ferr-menu__item:disabled{opacity:.4;cursor:not-allowed}.ui-ferr-menu__item--ativo{color:var(--ui-cor-primaria, #00E08A)}.ui-ferr-menu__icone{display:inline-flex;width:16px;justify-content:center}.ui-ferr-menu__rotulo{flex:1}.ui-ferr-menu__atalho{color:var(--ui-cor-texto-secundario, #888899);font-size:11px}.ui-ferr-menu__sep{height:1px;margin:3px 2px;background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}';
74
+ function F(o) {
75
+ const l = document.createElement("template");
76
+ l.innerHTML = o.trim();
77
+ const e = l.content.querySelector("svg");
78
+ return e ? (e.querySelectorAll("script, foreignObject").forEach((t) => t.remove()), [e, ...Array.from(e.querySelectorAll("*"))].forEach((t) => {
79
+ Array.from(t.attributes).forEach((i) => {
80
+ (/^on/i.test(i.name) || /^\s*javascript:/i.test(i.value)) && t.removeAttribute(i.name);
81
+ });
82
+ }), e) : null;
83
+ }
84
+ function L(o, l) {
85
+ if (!o) return null;
86
+ const e = document.createElement("ui-icone");
87
+ if (e.setAttribute("tamanho", String(l)), o.trimStart().startsWith("<")) {
88
+ const t = F(o);
89
+ if (!t) return null;
90
+ e.appendChild(t);
91
+ } else
92
+ e.setAttribute("nome", o);
93
+ return e;
94
+ }
95
+ function R(o) {
96
+ const l = o.rotulo || o.id;
97
+ return o.atalho ? `${l} (${o.atalho})` : l;
98
+ }
99
+ function w(o, l) {
100
+ o.disabled = !!l.disabled;
101
+ const e = l.tipo, t = e === "toggle" || e === "ferramenta";
102
+ t ? o.setAttribute("aria-pressed", String(!!l.ativo)) : o.removeAttribute("aria-pressed"), o.classList.toggle("ui-ferr-btn--ativo", t && !!l.ativo);
103
+ }
104
+ function I(o, l, e) {
105
+ var a;
106
+ const t = document.createElement("button");
107
+ t.type = "button", t.className = `ui-ferr-btn ui-ferr-btn--${l}`, t.dataset.id = o.id, t.tabIndex = -1, t.setAttribute("aria-label", o.rotulo || o.id), t.title = R(o);
108
+ const i = L(o.icone, e);
109
+ if (i) {
110
+ const s = document.createElement("span");
111
+ s.className = "ui-ferr-btn__icone", s.appendChild(i), t.appendChild(s);
112
+ }
113
+ const r = !!((a = o.filhos) != null && a.length), n = l !== "paleta" && !o.somenteIcone && !!o.rotulo;
114
+ if (l !== "paleta" && o.somenteIcone && t.classList.add("ui-ferr-btn--so-icone"), n) {
115
+ const s = document.createElement("span");
116
+ s.className = "ui-ferr-btn__rotulo", s.textContent = o.rotulo, t.appendChild(s);
117
+ }
118
+ if (r) {
119
+ if (l === "paleta")
120
+ t.classList.add("ui-ferr-btn--grupo");
121
+ else {
122
+ const s = document.createElement("span");
123
+ s.className = "ui-ferr-btn__caret", t.appendChild(s);
124
+ }
125
+ t.setAttribute("aria-haspopup", "menu"), t.setAttribute("aria-expanded", "false");
126
+ }
127
+ return w(t, o), t;
128
+ }
129
+ function f(o, l) {
130
+ for (const e of o) {
131
+ if (e.id === l) return e;
132
+ if (e.filhos) {
133
+ const t = f(e.filhos, l);
134
+ if (t) return t;
135
+ }
136
+ }
137
+ }
138
+ function D(o) {
139
+ const l = o.filter((e) => !e.disabled);
140
+ o.forEach((e) => e.tabIndex = -1), l.length && (l[0].tabIndex = 0);
141
+ }
142
+ function N(o, l, e, t) {
143
+ const i = l.filter((s) => !s.disabled), r = i.length, n = i.findIndex((s) => s === o.target);
144
+ if (r === 0 || n < 0) return !1;
145
+ let a = n;
146
+ if (e.includes(o.key)) a = (n - 1 + r) % r;
147
+ else if (t.includes(o.key)) a = (n + 1) % r;
148
+ else if (o.key === "Home") a = 0;
149
+ else if (o.key === "End") a = r - 1;
150
+ else return !1;
151
+ return o.preventDefault(), l.forEach((s) => s.tabIndex = -1), i[a].tabIndex = 0, i[a].focus(), !0;
152
+ }
153
+ function T(o, l, e, t, i = {}) {
154
+ var M;
155
+ const r = i.lado ?? "baixo", n = new E(), a = document.createElement("div");
156
+ a.className = "ui-ferr-menu", a.setAttribute("role", "menu");
157
+ const s = [];
158
+ let h = !1;
159
+ const b = () => {
160
+ var u;
161
+ h || (h = !0, n.cleanup(), a.remove(), (u = i.onFechar) == null || u.call(i));
162
+ };
163
+ e.forEach((u) => {
164
+ if (u.tipo === "separador") {
165
+ const p = document.createElement("div");
166
+ p.className = "ui-ferr-menu__sep", p.setAttribute("role", "separator"), a.appendChild(p);
167
+ return;
168
+ }
169
+ const d = document.createElement("button");
170
+ d.type = "button", d.className = "ui-ferr-menu__item", d.setAttribute("role", "menuitem"), d.dataset.id = u.id, d.disabled = !!u.disabled, u.ativo && d.classList.add("ui-ferr-menu__item--ativo");
171
+ const y = document.createElement("span");
172
+ y.className = "ui-ferr-menu__icone";
173
+ const _ = L(u.icone, 14);
174
+ _ && y.appendChild(_), d.appendChild(y);
175
+ const A = document.createElement("span");
176
+ if (A.className = "ui-ferr-menu__rotulo", A.textContent = u.rotulo || u.id, d.appendChild(A), u.atalho) {
177
+ const p = document.createElement("span");
178
+ p.className = "ui-ferr-menu__atalho", p.textContent = u.atalho, d.appendChild(p);
179
+ }
180
+ d.addEventListener("click", (p) => {
181
+ p.stopPropagation(), b(), t(u);
182
+ }), s.push(d), a.appendChild(d);
183
+ }), o.appendChild(a);
184
+ const m = l.getBoundingClientRect();
185
+ let v = r === "direita" ? m.top : m.bottom + 2, g = r === "direita" ? m.right + 4 : m.left;
186
+ const x = a.getBoundingClientRect();
187
+ x.width && g + x.width > window.innerWidth - 4 && (g = Math.max(4, window.innerWidth - x.width - 4)), x.height && v + x.height > window.innerHeight - 4 && (v = Math.max(4, window.innerHeight - x.height - 4)), a.style.top = `${v}px`, a.style.left = `${g}px`;
188
+ const z = () => s.filter((u) => !u.disabled);
189
+ return n.add(a, "keydown", (u) => {
190
+ const d = z(), y = d.findIndex((_) => _ === u.target);
191
+ if (u.key === "Escape")
192
+ u.preventDefault(), u.stopPropagation(), b(), l.focus();
193
+ else if (u.key === "Tab")
194
+ b();
195
+ else if (d.length && (u.key === "ArrowDown" || u.key === "ArrowUp")) {
196
+ u.preventDefault();
197
+ const _ = u.key === "ArrowDown" ? 1 : -1;
198
+ d[(y + _ + d.length) % d.length].focus();
199
+ } else d.length && u.key === "Home" ? (u.preventDefault(), d[0].focus()) : d.length && u.key === "End" && (u.preventDefault(), d[d.length - 1].focus());
200
+ }), n.add(document, "pointerdown", (u) => {
201
+ const d = u.composedPath();
202
+ !d.includes(a) && !d.includes(l) && b();
203
+ }, !0), n.add(window, "resize", b), n.add(window, "blur", b), i.focar && ((M = z()[0]) == null || M.focus()), { elemento: a, ancora: l, fechar: b };
204
+ }
205
+ class V extends C {
206
+ constructor() {
207
+ super();
208
+ c(this, "rootElement");
209
+ c(this, "abasElement");
210
+ c(this, "gruposElement");
211
+ c(this, "_abas", []);
212
+ c(this, "_abaAtiva", "");
213
+ c(this, "menu", null);
214
+ c(this, "listeners", new E());
215
+ /* ---------- Interação ---------- */
216
+ c(this, "handleClickAbas", (e) => {
217
+ const t = e.target.closest(".ui-ribbon__aba");
218
+ t != null && t.dataset.id && (this.selecionarAba(t.dataset.id), this.recolhido && this.rootElement.classList.toggle("ui-ribbon--aberto"));
219
+ });
220
+ c(this, "handleDblClickAbas", (e) => {
221
+ e.target.closest(".ui-ribbon__aba") && (this.recolhido = !this.recolhido);
222
+ });
223
+ c(this, "handleKeyDownAbas", (e) => {
224
+ var a, s;
225
+ const t = Array.from(this.abasElement.querySelectorAll(".ui-ribbon__aba")), i = t.findIndex((h) => h === e.target);
226
+ if (i < 0) return;
227
+ let r = i;
228
+ if (e.key === "ArrowRight") r = (i + 1) % t.length;
229
+ else if (e.key === "ArrowLeft") r = (i - 1 + t.length) % t.length;
230
+ else if (e.key === "Home") r = 0;
231
+ else if (e.key === "End") r = t.length - 1;
232
+ else if (e.key === "ArrowDown") {
233
+ e.preventDefault(), (a = this.botoesPainel().find((h) => !h.disabled)) == null || a.focus();
234
+ return;
235
+ } else return;
236
+ e.preventDefault();
237
+ const n = t[r].dataset.id;
238
+ n && this.selecionarAba(n), (s = this.abasElement.querySelector(`.ui-ribbon__aba[data-id="${CSS.escape(n ?? "")}"]`)) == null || s.focus();
239
+ });
240
+ c(this, "handleClickGrupos", (e) => {
241
+ const t = e.target.closest(".ui-ferr-btn");
242
+ t != null && t.dataset.id && this.acionar(t, !1);
243
+ });
244
+ c(this, "handleKeyDownGrupos", (e) => {
245
+ const t = this.botoesPainel();
246
+ if (N(e, t, ["ArrowLeft"], ["ArrowRight"])) return;
247
+ const i = e.target instanceof HTMLButtonElement ? e.target : null;
248
+ (i == null ? void 0 : i.getAttribute("aria-haspopup")) === "menu" && e.key === "ArrowDown" && (e.preventDefault(), this.acionar(i, !0));
249
+ });
250
+ c(this, "handleEscape", (e) => {
251
+ e.key === "Escape" && !this.menu && this.rootElement.classList.remove("ui-ribbon--aberto");
252
+ });
253
+ c(this, "handlePointerDownFora", (e) => {
254
+ !this.recolhido || !this.rootElement.classList.contains("ui-ribbon--aberto") || e.composedPath().includes(this) || this.rootElement.classList.remove("ui-ribbon--aberto");
255
+ });
256
+ const e = this.attachShadow({ mode: "open" });
257
+ e.innerHTML = `
258
+ <style>${P}${$}</style>
259
+ <div class="ui-ribbon">
260
+ <div class="ui-ribbon__abas" role="tablist"></div>
261
+ <div class="ui-ribbon__painel" role="tabpanel">
262
+ <div class="ui-ribbon__grupos" role="toolbar" aria-label="Ferramentas"></div>
263
+ </div>
264
+ </div>
265
+ `, this.rootElement = e.querySelector(".ui-ribbon"), this.abasElement = e.querySelector(".ui-ribbon__abas"), this.gruposElement = e.querySelector(".ui-ribbon__grupos");
266
+ }
267
+ static get observedAttributes() {
268
+ return ["aba-ativa", "recolhido"];
269
+ }
270
+ connectedCallback() {
271
+ this.listeners.cleanup(), this.listeners.add(this.abasElement, "click", this.handleClickAbas), this.listeners.add(this.abasElement, "dblclick", this.handleDblClickAbas), this.listeners.add(this.abasElement, "keydown", this.handleKeyDownAbas), this.listeners.add(this.gruposElement, "click", this.handleClickGrupos), this.listeners.add(this.gruposElement, "keydown", this.handleKeyDownGrupos), this.listeners.add(document, "pointerdown", this.handlePointerDownFora, !0), this.listeners.add(this.rootElement, "keydown", this.handleEscape);
272
+ const e = this.getAttribute("aba-ativa");
273
+ e && !this._abaAtiva && (this._abaAtiva = e), this.renderizar();
274
+ }
275
+ disconnectedCallback() {
276
+ this.fecharMenu(), this.listeners.cleanup();
277
+ }
278
+ attributeChangedCallback(e, t, i) {
279
+ t !== i && (e === "aba-ativa" && i && i !== this._abaAtiva ? this.selecionarAba(i, !1) : e === "recolhido" && this.rootElement.classList.remove("ui-ribbon--aberto"));
280
+ }
281
+ /* ---------- API pública ---------- */
282
+ get abas() {
283
+ return this._abas;
284
+ }
285
+ set abas(e) {
286
+ this._abas = Array.isArray(e) ? e : [], this.renderizar();
287
+ }
288
+ get abaAtiva() {
289
+ return this._abaAtiva;
290
+ }
291
+ set abaAtiva(e) {
292
+ this.selecionarAba(e);
293
+ }
294
+ get recolhido() {
295
+ return this.hasAttribute("recolhido");
296
+ }
297
+ set recolhido(e) {
298
+ e ? this.setAttribute("recolhido", "") : this.removeAttribute("recolhido");
299
+ }
300
+ selecionarAba(e, t = !0) {
301
+ const i = this._abas.find((r) => r.id === e && !r.oculta);
302
+ !i || i.id === this._abaAtiva || (this.fecharMenu(), this._abaAtiva = i.id, this.getAttribute("aba-ativa") !== i.id && this.setAttribute("aba-ativa", i.id), this.renderizar(), t && this.dispatchEvent(
303
+ new CustomEvent("ui-aba-change", {
304
+ detail: { id: i.id, aba: i },
305
+ bubbles: !0,
306
+ composed: !0
307
+ })
308
+ ));
309
+ }
310
+ definirAbaVisivel(e, t) {
311
+ const i = this._abas.find((r) => r.id === e);
312
+ i && (i.oculta = !t, !t && this._abaAtiva === e && (this._abaAtiva = ""), this.renderizar());
313
+ }
314
+ /** Atualiza um item (estado ou aparência) sem precisar recriar as abas. */
315
+ atualizarItem(e, t) {
316
+ const i = this._abas.flatMap((s) => s.grupos.flatMap((h) => h.itens)), r = f(i, e);
317
+ if (!r) return;
318
+ Object.assign(r, t);
319
+ const n = Object.keys(t).every((s) => s === "ativo" || s === "disabled"), a = this.gruposElement.querySelector(`.ui-ferr-btn[data-id="${CSS.escape(e)}"]`);
320
+ n && a ? w(a, r) : this.renderizarPainel();
321
+ }
322
+ /* ---------- Renderização ---------- */
323
+ abasVisiveis() {
324
+ return this._abas.filter((e) => !e.oculta);
325
+ }
326
+ renderizar() {
327
+ var t;
328
+ const e = this.abasVisiveis();
329
+ e.some((i) => i.id === this._abaAtiva) || (this._abaAtiva = ((t = e[0]) == null ? void 0 : t.id) ?? ""), this.renderizarAbas(), this.renderizarPainel();
330
+ }
331
+ renderizarAbas() {
332
+ this.abasElement.innerHTML = "", this.abasVisiveis().forEach((e) => {
333
+ const t = e.id === this._abaAtiva, i = document.createElement("button");
334
+ i.type = "button", i.className = "ui-ribbon__aba", i.setAttribute("role", "tab"), i.dataset.id = e.id, i.textContent = e.rotulo, i.tabIndex = t ? 0 : -1, i.setAttribute("aria-selected", String(t)), i.classList.toggle("ui-ribbon__aba--ativa", t), i.classList.toggle("ui-ribbon__aba--contextual", !!e.contextual), this.abasElement.appendChild(i);
335
+ });
336
+ }
337
+ renderizarPainel() {
338
+ this.fecharMenu(), this.gruposElement.innerHTML = "";
339
+ const e = this._abas.find((t) => t.id === this._abaAtiva);
340
+ e && (e.grupos.forEach((t) => this.gruposElement.appendChild(this.criarGrupo(t))), D(this.botoesPainel()));
341
+ }
342
+ criarGrupo(e) {
343
+ const t = document.createElement("div");
344
+ t.className = "ui-ribbon__grupo", t.setAttribute("role", "group"), t.setAttribute("aria-label", e.rotulo), t.dataset.id = e.id;
345
+ const i = document.createElement("div");
346
+ i.className = "ui-ribbon__grupo-itens";
347
+ let r = null, n = 0;
348
+ const a = () => {
349
+ r && i.appendChild(r), r = null, n = 0;
350
+ };
351
+ e.itens.forEach((h) => {
352
+ if (h.tipo === "separador") {
353
+ a();
354
+ const b = document.createElement("div");
355
+ b.className = "ui-ribbon__separador", b.setAttribute("role", "separator"), i.appendChild(b);
356
+ } else h.tamanho === "grande" ? (a(), i.appendChild(this.criarBotao(h, "grande", 24))) : (r || (r = document.createElement("div"), r.className = "ui-ribbon__coluna"), r.appendChild(this.criarBotao(h, "pequeno", 16)), ++n === 3 && a());
357
+ }), a();
358
+ const s = document.createElement("div");
359
+ return s.className = "ui-ribbon__grupo-rotulo", s.textContent = e.rotulo, t.appendChild(i), t.appendChild(s), t;
360
+ }
361
+ criarBotao(e, t, i) {
362
+ var n;
363
+ const r = (n = e.filhos) != null && n.length ? { ...e, tipo: "menu" } : e;
364
+ return I(r, t, i);
365
+ }
366
+ botoesPainel() {
367
+ return Array.from(this.gruposElement.querySelectorAll(".ui-ferr-btn"));
368
+ }
369
+ acionar(e, t) {
370
+ var n;
371
+ const i = this._abas.find((a) => a.id === this._abaAtiva), r = i && f(i.grupos.flatMap((a) => a.itens), e.dataset.id);
372
+ if (!(!r || r.disabled)) {
373
+ if ((n = r.filhos) != null && n.length) {
374
+ this.alternarMenu(e, r, t);
375
+ return;
376
+ }
377
+ r.tipo === "toggle" && (r.ativo = !r.ativo, w(e, r)), this.emitir(r), this.rootElement.classList.remove("ui-ribbon--aberto");
378
+ }
379
+ }
380
+ alternarMenu(e, t, i) {
381
+ var n;
382
+ const r = ((n = this.menu) == null ? void 0 : n.ancora) === e;
383
+ this.fecharMenu(), !r && (e.setAttribute("aria-expanded", "true"), this.menu = T(
384
+ this.shadowRoot,
385
+ e,
386
+ t.filhos,
387
+ (a) => {
388
+ a.tipo === "toggle" && (a.ativo = !a.ativo), this.emitir(a, t), this.rootElement.classList.remove("ui-ribbon--aberto");
389
+ },
390
+ {
391
+ lado: "baixo",
392
+ focar: i,
393
+ onFechar: () => {
394
+ e.setAttribute("aria-expanded", "false"), this.menu = null;
395
+ }
396
+ }
397
+ ));
398
+ }
399
+ fecharMenu() {
400
+ var e;
401
+ (e = this.menu) == null || e.fechar(), this.menu = null;
402
+ }
403
+ emitir(e, t) {
404
+ this.dispatchEvent(
405
+ new CustomEvent("ui-ferramenta", {
406
+ detail: { id: e.id, item: e, pai: t, ativo: e.ativo, origem: "ribbon", aba: this._abaAtiva },
407
+ bubbles: !0,
408
+ composed: !0
409
+ })
410
+ );
411
+ }
412
+ }
413
+ k("ui-ribbon", V);
414
+ const O = ':host{display:inline-block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #e1e1e6)}.ui-paleta{--ui-paleta-btn: 34px;--ui-paleta-padding: 4px;--ui-paleta-raio: var(--ui-paleta-raio-borda, 10px);--ui-paleta-btn-raio: var(--ui-paleta-raio-botao, max(2px, calc(var(--ui-paleta-raio) - var(--ui-paleta-padding))));display:flex;flex-direction:column;align-items:center;gap:2px;padding:var(--ui-paleta-padding);box-sizing:border-box;background:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-paleta-raio);-webkit-user-select:none;user-select:none}.ui-paleta--horizontal{flex-direction:row}.ui-paleta--sm{--ui-paleta-btn: 28px;--ui-paleta-raio: var(--ui-paleta-raio-borda, 8px)}.ui-paleta--lg{--ui-paleta-btn: 42px;--ui-paleta-raio: var(--ui-paleta-raio-borda, 12px)}.ui-paleta--cols-2{display:grid;grid-template-columns:repeat(2,var(--ui-paleta-btn));justify-content:center}.ui-paleta--cols-2 .ui-paleta__sep{grid-column:1 / -1}.ui-paleta .ui-ferr-btn{width:var(--ui-paleta-btn);height:var(--ui-paleta-btn);border-radius:var(--ui-paleta-btn-raio)}.ui-paleta .ui-ferr-btn--ativo{background:var(--ui-cor-primaria, #00E08A);border-color:transparent;color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-ferr-btn--grupo:after{content:"";position:absolute;right:3px;bottom:3px;width:0;height:0;border-left:5px solid transparent;border-bottom:5px solid currentColor;opacity:.7;pointer-events:none}.ui-paleta__sep{width:70%;height:1px;margin:3px 0;background:var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-paleta--horizontal .ui-paleta__sep{width:1px;height:70%;margin:0 3px}', K = 380, U = { sm: 16, md: 18, lg: 22 };
415
+ class G extends C {
416
+ constructor() {
417
+ super();
418
+ c(this, "rootElement");
419
+ c(this, "_ferramentas", []);
420
+ c(this, "_ativo", "");
421
+ c(this, "visiveis", /* @__PURE__ */ new Map());
422
+ // id do grupo → id do filho exibido
423
+ c(this, "menu", null);
424
+ c(this, "timerPressao");
425
+ c(this, "suprimirClique", !1);
426
+ c(this, "listeners", new E());
427
+ c(this, "handleClick", (e) => {
428
+ if (this.suprimirClique) {
429
+ this.suprimirClique = !1;
430
+ return;
431
+ }
432
+ const t = e.target.closest(".ui-ferr-btn"), i = t != null && t.dataset.id ? f(this._ferramentas, t.dataset.id) : void 0;
433
+ if (!t || !i) return;
434
+ const r = t.dataset.grupo ? f(this._ferramentas, t.dataset.grupo) : void 0;
435
+ this.acionar(i, r);
436
+ });
437
+ c(this, "handlePointerDown", (e) => {
438
+ const t = e;
439
+ if (t.pointerType === "mouse" && t.button !== 0) return;
440
+ const i = e.target.closest(".ui-ferr-btn--grupo");
441
+ !i || i.disabled || (this.cancelarPressao(), this.timerPressao = window.setTimeout(() => {
442
+ this.suprimirClique = !0, this.abrirFlyout(i, !1);
443
+ }, K));
444
+ });
445
+ c(this, "cancelarPressao", () => {
446
+ this.timerPressao !== void 0 && (window.clearTimeout(this.timerPressao), this.timerPressao = void 0);
447
+ });
448
+ c(this, "handleContextMenu", (e) => {
449
+ const t = e.target.closest(".ui-ferr-btn--grupo");
450
+ t && (e.preventDefault(), this.cancelarPressao(), this.abrirFlyout(t, !1));
451
+ });
452
+ c(this, "handleKeyDown", (e) => {
453
+ const t = this.getAttribute("orientacao") === "horizontal", i = t ? ["ArrowLeft"] : ["ArrowUp"], r = t ? ["ArrowRight"] : ["ArrowDown"];
454
+ if (N(e, this.botoes(), i, r)) return;
455
+ const n = t ? "ArrowDown" : "ArrowRight", a = e.target instanceof HTMLButtonElement ? e.target : null;
456
+ a != null && a.dataset.grupo && e.key === n && (e.preventDefault(), this.abrirFlyout(a, !0));
457
+ });
458
+ c(this, "handleAtalho", (e) => {
459
+ if (!this.hasAttribute("atalhos") || e.ctrlKey || e.metaKey || e.altKey || e.defaultPrevented) return;
460
+ const t = e.composedPath()[0];
461
+ if (t && (/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName) || t.isContentEditable)) return;
462
+ const i = (e.key || "").toUpperCase();
463
+ if (i.length !== 1) return;
464
+ const r = this.todasFerramentas().filter((s) => {
465
+ var h;
466
+ return !s.disabled && ((h = s.atalho) == null ? void 0 : h.toUpperCase()) === i;
467
+ });
468
+ if (!r.length) return;
469
+ e.preventDefault();
470
+ let n = r[0];
471
+ if (r.length > 1) {
472
+ const s = r.findIndex((h) => h.id === this._ativo);
473
+ n = r[(s + 1) % r.length];
474
+ }
475
+ const a = this._ferramentas.find((s) => {
476
+ var h;
477
+ return (h = s.filhos) == null ? void 0 : h.some((b) => b.id === n.id);
478
+ });
479
+ this.acionar(n, a);
480
+ });
481
+ const e = this.attachShadow({ mode: "open" });
482
+ e.innerHTML = `
483
+ <style>${P}${O}</style>
484
+ <div class="ui-paleta ui-paleta--vertical" role="toolbar" aria-orientation="vertical" aria-label="Ferramentas"></div>
485
+ `, this.rootElement = e.querySelector(".ui-paleta");
486
+ }
487
+ static get observedAttributes() {
488
+ return ["valor", "value", "orientacao", "colunas", "tamanho", "size"];
489
+ }
490
+ connectedCallback() {
491
+ this.listeners.cleanup(), this.listeners.add(this.rootElement, "click", this.handleClick), this.listeners.add(this.rootElement, "pointerdown", this.handlePointerDown), this.listeners.add(this.rootElement, "pointerup", this.cancelarPressao), this.listeners.add(this.rootElement, "pointerleave", this.cancelarPressao), this.listeners.add(this.rootElement, "pointercancel", this.cancelarPressao), this.listeners.add(this.rootElement, "contextmenu", this.handleContextMenu), this.listeners.add(this.rootElement, "keydown", this.handleKeyDown), this.listeners.add(document, "keydown", this.handleAtalho);
492
+ const e = this.getAttribute("valor") || this.getAttribute("value");
493
+ e && !this._ativo && this.definirAtivoInterno(e), this.renderizar();
494
+ }
495
+ disconnectedCallback() {
496
+ this.cancelarPressao(), this.fecharMenu(), this.listeners.cleanup();
497
+ }
498
+ attributeChangedCallback(e, t, i) {
499
+ t !== i && (e === "valor" || e === "value" ? i && i !== this._ativo && this.ativar(i, !1) : this.renderizar());
500
+ }
501
+ /* ---------- API pública ---------- */
502
+ get ferramentas() {
503
+ return this._ferramentas;
504
+ }
505
+ set ferramentas(e) {
506
+ this._ferramentas = Array.isArray(e) ? e : [], this.visiveis.clear(), this._ativo && this.definirAtivoInterno(this._ativo), this.renderizar();
507
+ }
508
+ get valor() {
509
+ return this._ativo;
510
+ }
511
+ set valor(e) {
512
+ this.ativar(e);
513
+ }
514
+ get value() {
515
+ return this.valor;
516
+ }
517
+ set value(e) {
518
+ this.valor = e;
519
+ }
520
+ /** Ativa uma ferramenta (exclusiva). Se estiver dentro de um grupo, ela passa a ser a exibida. */
521
+ ativar(e, t = !0) {
522
+ const i = f(this._ferramentas, e);
523
+ if (!i || i.disabled || (i.tipo ?? "ferramenta") !== "ferramenta") return;
524
+ const r = this._ativo;
525
+ if (this.definirAtivoInterno(e), this.getAttribute("valor") !== e && this.setAttribute("valor", e), this.renderizar(), t && r !== e) {
526
+ const n = { valor: e, item: i, anterior: r };
527
+ this.dispatchEvent(new CustomEvent("ui-change", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("ui-selecionar", { detail: n, bubbles: !0, composed: !0 }));
528
+ }
529
+ }
530
+ atualizarItem(e, t) {
531
+ const i = f(this._ferramentas, e);
532
+ i && (Object.assign(i, t), this.renderizar());
533
+ }
534
+ /* ---------- Estado interno ---------- */
535
+ definirAtivoInterno(e) {
536
+ this._ativo = e;
537
+ const t = this._ferramentas.find((i) => {
538
+ var r;
539
+ return (r = i.filhos) == null ? void 0 : r.some((n) => n.id === e);
540
+ });
541
+ t && this.visiveis.set(t.id, e);
542
+ }
543
+ itemExibido(e) {
544
+ var i;
545
+ if (!((i = e.filhos) != null && i.length)) return e;
546
+ const t = this.visiveis.get(e.id);
547
+ return e.filhos.find((r) => r.id === t) ?? e.filhos[0];
548
+ }
549
+ todasFerramentas() {
550
+ return this._ferramentas.flatMap((e) => {
551
+ var t;
552
+ return (t = e.filhos) != null && t.length ? e.filhos : [e];
553
+ }).filter((e) => e.tipo !== "separador");
554
+ }
555
+ /* ---------- Renderização ---------- */
556
+ renderizar() {
557
+ this.fecharMenu();
558
+ const e = this.getAttribute("orientacao") === "horizontal" ? "horizontal" : "vertical", t = this.getAttribute("tamanho") || this.getAttribute("size") || "md", i = this.getAttribute("colunas") === "2" ? 2 : 1;
559
+ this.rootElement.className = `ui-paleta ui-paleta--${e} ui-paleta--${t}`, i === 2 && e === "vertical" && this.rootElement.classList.add("ui-paleta--cols-2"), this.rootElement.setAttribute("aria-orientation", e), this.rootElement.innerHTML = "";
560
+ const r = U[t] ?? 18;
561
+ this._ferramentas.forEach((a) => {
562
+ var v;
563
+ if (a.tipo === "separador") {
564
+ const g = document.createElement("div");
565
+ g.className = "ui-paleta__sep", g.setAttribute("role", "separator"), this.rootElement.appendChild(g);
566
+ return;
567
+ }
568
+ const s = this.itemExibido(a), h = s.tipo ?? "ferramenta", b = {
569
+ ...s,
570
+ tipo: h,
571
+ ativo: h === "ferramenta" ? s.id === this._ativo : s.ativo,
572
+ filhos: a.filhos
573
+ }, m = I(b, "paleta", r);
574
+ m.dataset.id = s.id, (v = a.filhos) != null && v.length && (m.dataset.grupo = a.id), this.rootElement.appendChild(m);
575
+ }), D(this.botoes());
576
+ const n = this.botoes().find((a) => a.dataset.id === this._ativo && !a.disabled);
577
+ n && (this.botoes().forEach((a) => a.tabIndex = -1), n.tabIndex = 0);
578
+ }
579
+ botoes() {
580
+ return Array.from(this.rootElement.querySelectorAll(".ui-ferr-btn"));
581
+ }
582
+ /* ---------- Interação ---------- */
583
+ acionar(e, t) {
584
+ if (e.disabled) return;
585
+ const i = e.tipo ?? "ferramenta";
586
+ i === "ferramenta" ? this.ativar(e.id) : i === "toggle" && (e.ativo = !e.ativo, this.renderizar()), this.dispatchEvent(
587
+ new CustomEvent("ui-ferramenta", {
588
+ detail: {
589
+ id: e.id,
590
+ item: e,
591
+ pai: t,
592
+ ativo: i === "ferramenta" ? !0 : e.ativo,
593
+ origem: "paleta"
594
+ },
595
+ bubbles: !0,
596
+ composed: !0
597
+ })
598
+ );
599
+ }
600
+ abrirFlyout(e, t) {
601
+ var n;
602
+ const i = e.dataset.grupo ? f(this._ferramentas, e.dataset.grupo) : void 0;
603
+ if (!((n = i == null ? void 0 : i.filhos) != null && n.length)) return;
604
+ this.fecharMenu();
605
+ const r = i.filhos.map((a) => ({ ...a, ativo: a.id === this._ativo }));
606
+ e.setAttribute("aria-expanded", "true"), this.menu = T(
607
+ this.shadowRoot,
608
+ e,
609
+ r,
610
+ (a) => {
611
+ const s = f(i.filhos, a.id);
612
+ s && this.acionar(s, i);
613
+ },
614
+ {
615
+ lado: this.getAttribute("orientacao") === "horizontal" ? "baixo" : "direita",
616
+ focar: t,
617
+ onFechar: () => {
618
+ e.setAttribute("aria-expanded", "false"), this.menu = null;
619
+ }
620
+ }
621
+ );
622
+ }
623
+ fecharMenu() {
624
+ var e;
625
+ (e = this.menu) == null || e.fechar(), this.menu = null;
626
+ }
627
+ }
628
+ k("ui-paleta-ferramentas", G);
629
+ export {
630
+ B as U,
631
+ G as a,
632
+ V as b
633
+ };